/* Premium P.E.T. companion HUD — amber tech frame, room for full labels */
.map-pet-wrap {
  --pet-amber: #f0c56a;
  --pet-amber-deep: #c88830;
  --pet-amber-soft: rgba(240, 197, 106, 0.5);
  --pet-ink: #070910;
  --pet-panel: #0c121c;
  --pet-line: rgba(240, 197, 106, 0.48);
  --pet-glow: rgba(240, 197, 106, 0.22);
  position: fixed;
  pointer-events: auto !important;
  width: 352px !important;
  min-width: 352px;
  max-width: 352px;
  height: auto;
  min-height: 0;
  padding: 0 0 0 8px !important;
  overflow: visible !important;
  color: #f6f0e6;
  font: 12px "Segoe UI", Tahoma, Arial, sans-serif;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.58));
}
.map-pet-wrap.map-pet-w0 { z-index: 2147482000; }
.map-pet-wrap.map-pet-w1 { z-index: 2147482001; }
.map-pet-wrap.map-pet-w2 { z-index: 2147482002; }
.map-pet-wrap.hidden { display: none !important; }
.map-pet-wrap.docked { display: none !important; }
.map-pet-wrap.minimize-anim {
  opacity: 0.25;
  transform: translate(var(--fly-x, 0), var(--fly-y, 0)) scale(0.15);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Chassis */
.map-pet-wrap::after {
  content: "";
  position: absolute;
  inset: 0 0 0 8px;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255, 210, 140, 0.07) 0%, transparent 38%),
    linear-gradient(180deg, rgba(32, 24, 14, 0.98) 0%, rgba(7, 9, 14, 0.99) 55%, rgba(10, 12, 18, 0.98) 100%);
  clip-path: polygon(
    14px 0,
    calc(100% - 8px) 0,
    100% 10px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    12px 100%,
    0 calc(100% - 16px),
    0 14px
  );
  border: 1px solid var(--pet-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.16),
    inset 0 0 48px rgba(240, 197, 106, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Left energy rail */
.map-pet-rail {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 6px;
  z-index: 2;
  border-radius: 2px;
  background:
    linear-gradient(180deg, #ffe29a 0%, #f0c56a 28%, #c47a28 62%, #6a3a12 100%);
  box-shadow:
    0 0 14px rgba(240, 197, 106, 0.55),
    inset 0 0 5px rgba(255, 245, 200, 0.4);
}
.map-pet-rail::before,
.map-pet-rail::after {
  content: "";
  position: absolute;
  left: -2px;
  width: 10px;
  height: 10px;
  background: var(--pet-amber);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 10px rgba(240, 197, 106, 0.8);
}
.map-pet-rail::before { top: -3px; }
.map-pet-rail::after { bottom: -3px; }

.map-pet-wrap > .map-pet-head,
.map-pet-wrap > .map-pet-body {
  position: relative;
  z-index: 1;
}

/* —— Header —— */
.map-pet-wrap .map-pet-head {
  height: 36px;
  margin: 0;
  padding: 0 28px 0 20px !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(240, 197, 106, 0.28) !important;
  border-radius: 0 !important;
  color: #ffe8bc !important;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.map-pet-wrap .map-pet-head:active { cursor: grabbing; }
.map-pet-wrap .map-pet-grip { display: none; }
.map-pet-wrap .map-pet-title-block {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 9px;
}
.map-pet-wrap .map-pet-mark {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: var(--pet-amber);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 10px rgba(240, 197, 106, 0.85);
}
.map-pet-wrap .map-pet-slot-label {
  font: 800 13px/34px "Segoe UI", Tahoma, Arial, sans-serif !important;
  color: #fff6e4 !important;
  letter-spacing: 2.4px !important;
  text-transform: uppercase !important;
  margin: 0 !important;
  text-shadow: 0 1px 3px #000, 0 0 12px rgba(240, 197, 106, 0.25) !important;
}
.map-pet-wrap .map-pet-chip {
  font: 800 8px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, #ffe29a, #e0a040 55%, #c88830);
  padding: 4px 8px;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  box-shadow: 0 0 10px rgba(240, 197, 106, 0.35);
}
.map-pet-wrap .map-pet-name-line,
.map-pet-wrap .map-pet-badge { display: none !important; }
.map-pet-wrap .map-pet-close,
.map-pet-wrap .map-pet-min {
  margin-left: auto;
  margin-right: 2px;
  flex: 0 0 30px;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(240, 197, 106, 0.7);
  background: linear-gradient(180deg, rgba(60, 42, 18, 0.95), rgba(22, 16, 10, 0.95));
  color: #ffe29a;
  cursor: pointer;
  line-height: 22px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 2px;
  clip-path: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 10px rgba(240, 197, 106, 0.2);
  z-index: 3;
  position: relative;
}
.map-pet-wrap .map-pet-min:hover,
.map-pet-wrap .map-pet-close:hover {
  background: linear-gradient(180deg, rgba(120, 80, 28, 0.98), rgba(50, 34, 14, 0.98));
  border-color: #ffe29a;
  color: #fff;
  box-shadow: 0 0 14px rgba(240, 197, 106, 0.45);
}

/* —— Body —— */
.map-pet-wrap .map-pet-body {
  padding: 12px 14px 13px 16px !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  overflow: visible;
}
.map-pet-wrap .pet-ui.pet-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  color: #f6f0e6;
  overflow: visible;
}

/* —— Hero —— */
.map-pet-wrap .pet-hero,
.map-pet-wrap .pet-card-top {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 14px;
  position: relative;
  padding: 2px 2px 6px;
}
.map-pet-wrap .pet-avatar-ring {
  position: absolute;
  left: 0;
  top: 50%;
  width: 68px;
  height: 68px;
  margin-top: -34px;
  pointer-events: none;
  background:
    conic-gradient(from 210deg, transparent 0 58%, var(--pet-amber-soft) 58% 82%, transparent 82% 100%);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  opacity: 0.9;
  animation: pet-ring-spin 10s linear infinite;
  will-change: transform;
  contain: layout style;
}
@keyframes pet-ring-spin {
  to { transform: rotate(360deg); }
}
.map-pet-wrap .pet-ui.is-idle .pet-avatar-ring { animation-play-state: paused; opacity: 0.4; }
.map-pet-wrap .pet-ui.is-destroyed .pet-avatar-ring { animation: none; opacity: 0.2; filter: grayscale(1); }

.map-pet-wrap .pet-avatar {
  position: relative;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  margin: 4px;
  z-index: 1;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 210, 140, 0.3), transparent 55%),
    linear-gradient(160deg, #221810, #06080e);
  border: 0;
  box-shadow: none;
  overflow: hidden;
}
.map-pet-wrap .pet-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: inherit;
  box-shadow: inset 0 0 0 1.5px rgba(240, 197, 106, 0.7);
  pointer-events: none;
}
.map-pet-wrap .pet-ui.is-active .pet-avatar::after {
  box-shadow: inset 0 0 0 1.5px rgba(255, 220, 140, 0.98), inset 0 0 20px rgba(240, 197, 106, 0.28);
}
.map-pet-wrap .pet-ui.is-destroyed .pet-avatar {
  filter: grayscale(0.5) brightness(0.8);
}
.map-pet-wrap .pet-level-img {
  position: absolute;
  left: 50%; top: 50%;
  width: 50px; height: 50px;
  margin: -25px 0 0 -25px;
  background-image: url('/do_img/global/HTML5/UI/windows/pet_level_atlas.png');
  background-repeat: no-repeat;
  background-size: 750px 50px;
}
.map-pet-wrap .pet-level-1 { background-position: 0 0; }
.map-pet-wrap .pet-level-2 { background-position: -50px 0; }
.map-pet-wrap .pet-level-3 { background-position: -100px 0; }
.map-pet-wrap .pet-level-4 { background-position: -150px 0; }
.map-pet-wrap .pet-level-5 { background-position: -200px 0; }
.map-pet-wrap .pet-level-6 { background-position: -250px 0; }
.map-pet-wrap .pet-level-7 { background-position: -300px 0; }
.map-pet-wrap .pet-level-8 { background-position: -350px 0; }
.map-pet-wrap .pet-level-9 { background-position: -400px 0; }
.map-pet-wrap .pet-level-10 { background-position: -450px 0; }
.map-pet-wrap .pet-level-11 { background-position: -500px 0; }
.map-pet-wrap .pet-level-12 { background-position: -550px 0; }
.map-pet-wrap .pet-level-13 { background-position: -600px 0; }
.map-pet-wrap .pet-level-14 { background-position: -650px 0; }
.map-pet-wrap .pet-level-15 { background-position: -700px 0; }
.map-pet-wrap .pet-level-16,
.map-pet-wrap .pet-level-17,
.map-pet-wrap .pet-level-18,
.map-pet-wrap .pet-level-19,
.map-pet-wrap .pet-level-20 { background-position: -700px 0; }
.map-pet-wrap .pet-avatar em {
  position: absolute;
  right: 6px; bottom: 8px;
  min-width: 15px;
  padding: 0 4px;
  font: 800 10px/13px "Segoe UI", Arial, sans-serif;
  font-style: normal;
  color: #1a1208;
  background: var(--pet-amber);
  z-index: 2;
  pointer-events: none;
  text-align: center;
  clip-path: polygon(2px 0, 100% 0, calc(100% - 2px) 100%, 0 100%);
}

.map-pet-wrap .pet-card-id {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 5px;
  z-index: 1;
}
.map-pet-wrap .pet-card-kicker {
  font: 700 8px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(240, 197, 106, 0.88);
}
.map-pet-wrap .pet-card-name {
  font: 800 18px/1.1 "Segoe UI", Tahoma, Arial, sans-serif;
  color: #fffaf0;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-pet-wrap .pet-card-state {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  padding: 4px 10px 4px 8px;
  font: 800 9px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
  background: rgba(40, 48, 60, 0.85);
  color: #b8c8d8;
}
.map-pet-wrap .pet-card-state::before {
  content: "";
  width: 6px; height: 6px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.map-pet-wrap .pet-ui.is-active .pet-card-state {
  color: #102010;
  background: linear-gradient(90deg, #8dffaa, #3cb86a);
  box-shadow: 0 0 12px rgba(90, 220, 130, 0.35);
}
.map-pet-wrap .pet-ui.is-active .pet-card-state::before {
  animation: pet-status-blink 1.2s ease-in-out infinite;
}
@keyframes pet-status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.map-pet-wrap .pet-ui.is-idle .pet-card-state {
  color: #2a1c08;
  background: linear-gradient(90deg, #f0c56a, #c88830);
}
.map-pet-wrap .pet-ui.is-destroyed .pet-card-state {
  color: #fff;
  background: linear-gradient(90deg, #c04040, #802020);
}

/* —— Telemetry —— */
.map-pet-wrap .pet-telemetry-label {
  font: 700 8px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(240, 197, 106, 0.72);
  padding-left: 2px;
  margin-bottom: -2px;
}
.map-pet-wrap .pet-card-vitals {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.map-pet-wrap .pet-vital {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 12px 7px 8px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.22));
  border: 1px solid rgba(240, 197, 106, 0.12);
  border-left: 2px solid rgba(240, 197, 106, 0.3);
  border-radius: 0;
  /* No angled clip — keeps HP/Fuel numbers fully visible */
  clip-path: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.map-pet-wrap .pet-vital:hover {
  background: linear-gradient(90deg, rgba(240, 197, 106, 0.1), rgba(0, 0, 0, 0.28));
  border-color: rgba(240, 197, 106, 0.35);
  box-shadow: inset 0 0 12px rgba(240, 197, 106, 0.04);
}
.map-pet-wrap .pet-vital--hp { border-left-color: rgba(90, 220, 130, 0.55); }
.map-pet-wrap .pet-vital--shield { border-left-color: rgba(90, 180, 230, 0.55); }
.map-pet-wrap .pet-vital--fuel { border-left-color: rgba(240, 197, 106, 0.65); }
.map-pet-wrap .pet-vital--xp { border-left-color: rgba(120, 170, 220, 0.5); }
.map-pet-wrap .pet-vital.hidden { display: none !important; }

.map-pet-wrap .pet-vital > .win-small-icon {
  width: 18px !important; height: 18px !important;
  min-width: 18px !important; flex: 0 0 18px !important;
  background-image: url('/do_img/global/HTML5/UI/windows/window_icons_atlas.png?v=4') !important;
  background-repeat: no-repeat !important;
  display: inline-block !important;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
}
.map-pet-wrap .pet-vital > .win-small-icon.hp_small { background-position: -36px -18px !important; }
.map-pet-wrap .pet-vital > .win-small-icon.shild_small { background-position: -90px 0 !important; }
.map-pet-wrap .pet-vital > .win-small-icon.fuel_small { background-position: -90px -18px !important; }
.map-pet-wrap .pet-vital > .win-small-icon.xp_small { background-position: -36px 0 !important; }
.map-pet-wrap .pet-vital-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.map-pet-wrap .pet-vital-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  min-width: 0;
}
.map-pet-wrap .pet-vital-label {
  flex: 0 0 auto;
  font: 800 8px "Segoe UI", Arial, sans-serif;
  letter-spacing: 1px;
  color: #a89a86;
  text-transform: uppercase;
}
.map-pet-wrap .pet-vital-val {
  flex: 1 1 auto;
  min-width: 0;
  font: 800 12px/1.15 "Segoe UI", Tahoma, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #fff8ec;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: visible;
  text-align: right;
  letter-spacing: 0.15px;
}
.map-pet-wrap .pet-vital--hp .pet-vital-val { color: #a8ffc4; }
.map-pet-wrap .pet-vital--shield .pet-vital-val { color: #9adcff; }
.map-pet-wrap .pet-vital--fuel .pet-vital-val { color: #ffd070; }
.map-pet-wrap .pet-vital--xp .pet-vital-val { color: #b0d8f0; }

.map-pet-wrap .pet-bar,
.map-pet-wrap .map-pet-bar-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.58) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  clip-path: none;
}
.map-pet-wrap .pet-bar i,
.map-pet-wrap .map-pet-bar-fill {
  display: block;
  height: 100%;
  border-radius: 0;
  max-width: 100%;
  transition: width 0.2s ease-out;
}
.map-pet-wrap .pet-vital--hp .map-pet-bar-fill,
.map-pet-wrap .pet-vital--hp .pet-bar i {
  background: linear-gradient(90deg, #1a6040, #5dff9a) !important;
  box-shadow: 0 0 8px rgba(93, 255, 154, 0.35);
}
.map-pet-wrap .pet-vital--shield .map-pet-bar-fill,
.map-pet-wrap .pet-vital--shield .pet-bar i {
  background: linear-gradient(90deg, #184868, #5ec8ff) !important;
  box-shadow: 0 0 8px rgba(94, 200, 255, 0.3);
}
.map-pet-wrap .pet-vital--fuel .map-pet-bar-fill,
.map-pet-wrap .pet-vital--fuel .pet-bar i {
  background: linear-gradient(90deg, #7a4810, #f0c56a) !important;
  box-shadow: 0 0 8px rgba(240, 197, 106, 0.35);
}
.map-pet-wrap .pet-vital--xp .map-pet-bar-fill,
.map-pet-wrap .pet-vital--xp .pet-bar i {
  background: linear-gradient(90deg, #2a4058, #8ab4d0) !important;
}

/* —— Actions —— */
.map-pet-wrap .pet-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 10px 4px 2px;
  margin-top: 2px;
  border-top: 1px solid rgba(240, 197, 106, 0.22);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  position: relative;
  z-index: 4;
}
.map-pet-wrap .pet-card-actions .map-pet-btn-launch,
.map-pet-wrap .pet-card-actions .map-pet-btn-stop,
.map-pet-wrap .pet-card-actions .map-pet-btn-repair {
  width: 53px !important;
  height: 35px !important;
  flex: 0 0 53px !important;
  border: 0 !important;
  padding: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  cursor: pointer !important;
  background-color: transparent !important;
  background-image: url('/do_img/global/HTML5/UI/windows/pet_buttons_atlas.png?v=pet_card_r2') !important;
  background-repeat: no-repeat !important;
  background-size: 633px 35px !important;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: filter 0.15s, transform 0.12s, opacity 0.15s;
}
.map-pet-wrap .pet-card-actions .map-pet-btn-launch:hover:not(:disabled),
.map-pet-wrap .pet-card-actions .map-pet-btn-stop:hover:not(:disabled),
.map-pet-wrap .pet-card-actions .map-pet-btn-repair:hover:not(:disabled) {
  transform: translateY(-1px);
}
.map-pet-wrap .map-pet-btn-stop { background-position: 0 0 !important; }
.map-pet-wrap .map-pet-btn-stop:hover { background-position: -53px 0 !important; }
.map-pet-wrap .map-pet-btn-repair { background-position: -106px 0 !important; }
.map-pet-wrap .map-pet-btn-repair:hover { background-position: -159px 0 !important; }
.map-pet-wrap .map-pet-btn-launch { background-position: -212px 0 !important; }
.map-pet-wrap .map-pet-btn-launch:hover:not(:disabled) { background-position: -265px 0 !important; }
.map-pet-wrap .map-pet-btn-repair:disabled {
  opacity: 0.35;
  filter: grayscale(0.55);
  cursor: default !important;
  transform: none !important;
}
.map-pet-wrap .map-pet-btn-launch,
.map-pet-wrap .map-pet-btn-stop {
  display: inline-block !important;
  visibility: visible !important;
}
.map-pet-wrap .map-pet-btn-lit {
  opacity: 1 !important;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)) !important;
  cursor: pointer !important;
}
.map-pet-wrap .map-pet-btn-lit.map-pet-btn-stop:hover { background-position: -53px 0 !important; }
.map-pet-wrap .map-pet-btn-lit.map-pet-btn-launch:hover { background-position: -265px 0 !important; }
.map-pet-wrap .map-pet-btn-dim {
  opacity: 0.32 !important;
  filter: grayscale(0.6) brightness(0.82) !important;
  cursor: default !important;
  pointer-events: none;
  transform: none !important;
}
.map-pet-wrap .pet-gear-wrap {
  flex: 1;
  min-width: 0;
  height: 35px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 5;
}
.map-pet-wrap .map-pet-gear-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(240, 197, 106, 0.5);
  border-radius: 0;
  clip-path: none;
  background: linear-gradient(180deg, #2a2014, #0e1016);
  color: #ffe8bc;
  font: 700 12px "Segoe UI", Arial, sans-serif;
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.08);
}
.map-pet-wrap .map-pet-gear-btn:hover,
.map-pet-wrap .pet-gear-wrap.is-open .map-pet-gear-btn {
  border-color: rgba(255, 220, 140, 0.9);
  background: linear-gradient(180deg, #342818, #14161e);
  box-shadow: 0 0 14px rgba(240, 197, 106, 0.18), inset 0 1px 0 rgba(255, 220, 160, 0.12);
}
.map-pet-wrap .map-pet-gear-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.map-pet-wrap .map-pet-gear-btn-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-pet-wrap .map-pet-gear-btn-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #f0c56a;
  flex: 0 0 auto;
  transition: transform 0.15s;
}
.map-pet-wrap .pet-gear-wrap.is-open .map-pet-gear-btn-caret {
  transform: rotate(180deg);
}

/* Full-panel gear menu — every mode name fits */
.map-pet-wrap .map-pet-gear-menu {
  position: absolute;
  right: 0;
  left: auto;
  bottom: calc(100% + 6px);
  width: 318px;
  max-width: calc(100vw - 24px);
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(34, 26, 16, 0.99), rgba(8, 10, 16, 0.995));
  border: 1px solid rgba(240, 197, 106, 0.55);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.72),
    0 0 20px rgba(240, 197, 106, 0.12),
    inset 0 1px 0 rgba(255, 220, 160, 0.1);
  clip-path: none;
  border-radius: 2px;
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: #c88830 rgba(0, 0, 0, 0.35);
}
.map-pet-wrap .map-pet-gear-menu[hidden] {
  display: none !important;
}
.map-pet-wrap .map-pet-gear-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin: 0 0 2px;
  border: 0;
  background: transparent;
  color: #f6eee2;
  font: 600 12px/1.25 "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  clip-path: none;
  box-sizing: border-box;
}
.map-pet-wrap .map-pet-gear-opt-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #f0c56a;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 7px rgba(240, 197, 106, 0.55);
}
.map-pet-wrap .map-pet-gear-opt-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.map-pet-wrap .map-pet-gear-opt-hint {
  flex: 0 0 auto;
  font: 700 8px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(200, 180, 140, 0.55);
}
.map-pet-wrap .map-pet-gear-opt.is-owned:hover {
  background: rgba(240, 197, 106, 0.16);
  color: #fff8ec;
}
.map-pet-wrap .map-pet-gear-opt.is-selected {
  background: rgba(240, 197, 106, 0.24);
  color: #ffe8bc;
  box-shadow: inset 2px 0 0 #f0c56a;
}
.map-pet-wrap .map-pet-gear-opt.is-selected .map-pet-gear-opt-dot {
  background: #7dff9a;
  box-shadow: 0 0 8px rgba(125, 255, 154, 0.6);
}
.map-pet-wrap .map-pet-gear-opt.is-locked {
  opacity: 0.38;
  color: #9a9080;
  cursor: default;
  filter: grayscale(0.35);
}
.map-pet-wrap .map-pet-gear-opt.is-locked .map-pet-gear-opt-dot {
  background: #6a6458;
  box-shadow: none;
}
.map-pet-wrap .map-pet-gear-opt.is-locked:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* legacy select (if any) */
.map-pet-wrap .map-pet-select {
  width: 100%;
  height: 32px;
  border: 1px solid rgba(240, 197, 106, 0.4);
  border-radius: 0;
  background: #12141a;
  color: #ffe8bc;
  font: 700 11px "Segoe UI", Arial, sans-serif;
  padding: 0 8px;
}

.map-pet-wrap .pet-extra-actions {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.map-pet-wrap .pet-extra-actions button {
  border: 1px solid rgba(240, 197, 106, 0.4);
  background: rgba(30, 22, 12, 0.9);
  color: #ffe8bc;
  border-radius: 0;
  font: bold 10px Arial;
  padding: 4px 7px;
  cursor: pointer;
}
.map-pet-wrap .pet-extra-actions button:hover { filter: brightness(1.15); }
.map-pet-wrap .pet-extra-actions button:disabled { opacity: 0.4; cursor: default; }

.map-pet-wrap .map-pet-msg {
  min-height: 0;
  font-size: 10px;
  color: #ffd070;
  padding: 0 2px;
  letter-spacing: 0.2px;
}
.map-pet-wrap .map-pet-msg.ok { color: #8affb8; }
.map-pet-wrap .map-pet-msg.err { color: #ff9a9a; }
.map-pet-wrap .map-pet-empty-note { color: #9a9080; margin: 8px 0; }
.map-pet-wrap .map-pet-links a { color: #f0c56a; }
.map-pet-wrap .map-pet-repair-status { font-size: 10px; color: #c8b890; min-height: 12px; }
.map-pet-wrap .map-pet-meta,
.map-pet-wrap .map-pet-fuel-rate,
.map-pet-wrap .map-pet-xp-remain { display: none !important; }
.map-pet-wrap .map-pet-row { margin: 0; padding: 0; border: 0; }
.map-pet-wrap .map-pet-hp-val { display: none; }

/* Legacy multi-tab */
.map-pet-tabs {
  display: flex;
  gap: 4px;
  padding: 5px 6px 0;
  background: rgba(12, 10, 8, 0.96);
  border-bottom: 1px solid rgba(240, 197, 106, 0.28);
}
.map-pet-tab {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid rgba(240, 197, 106, 0.3);
  border-bottom: none;
  border-radius: 0;
  background: rgba(30, 22, 12, 0.85);
  color: #c8b890;
  font: bold 11px/1.2 "Segoe UI", Tahoma, Arial, sans-serif;
  cursor: pointer;
}
.map-pet-tab.is-active {
  background: linear-gradient(180deg, rgba(120, 80, 30, 0.95), rgba(40, 28, 12, 0.98));
  color: #fff4dc;
  border-color: rgba(240, 197, 106, 0.6);
}
.map-pet-tab.is-online::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 4px;
  background: #5cff9a;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  vertical-align: middle;
}
.map-pet-pane { display: none; }
.map-pet-pane.is-active { display: block; }

/* G-TRA1 Cargo Trader */
.map-pet-trade {
  position: absolute;
  z-index: 2147482001;
  pointer-events: auto !important;
  width: 320px;
  max-height: min(70vh, 560px);
  overflow: auto;
  background: rgba(8, 14, 22, 0.94);
  border: 1px solid #3a6a8a;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  color: #dff;
  font: 12px/1.35 Tahoma, sans-serif;
  padding: 10px;
  border-radius: 6px;
}
.map-pet-trade.hidden { display: none !important; }
.map-pet-trade .pt-head {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px;
}
.map-pet-trade .pt-icon { width: 40px; height: 40px; flex: 0 0 40px; }
.map-pet-trade .pt-head-meta { flex: 1; min-width: 0; }
.map-pet-trade .pt-head-meta strong { display: block; color: #9fdfff; font-size: 13px; }
.map-pet-trade .pt-head-meta span { color: #8aa; font-size: 11px; }
.map-pet-trade .pt-close {
  background: transparent; border: 0; color: #9ab; font-size: 18px; cursor: pointer; line-height: 1;
}
.map-pet-trade .pt-hint {
  min-height: 16px; margin-bottom: 8px; color: #cde; font-size: 11px;
}
.map-pet-trade .pt-hint.is-ok { color: #8f8; }
.map-pet-trade .pt-hint.is-err { color: #f88; }
.map-pet-trade .pt-hint.is-warn { color: #fd6; }
.map-pet-trade .pt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px;
}
.map-pet-trade .pt-ore {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #121c28; border: 1px solid #2a4a6a; color: #dff;
  padding: 6px 4px; cursor: pointer; border-radius: 2px;
}
.map-pet-trade .pt-ore img { width: 36px; height: 36px; object-fit: contain; }
.map-pet-trade .pt-ore-name { font-size: 11px; }
.map-pet-trade .pt-ore-count { color: #9fdfff; font-weight: 700; }
.map-pet-trade .pt-ore-price { color: #fd6; font-size: 10px; }
.map-pet-trade .pt-ore.selected { border-color: #5ad0ff; background: #1a3048; }
.map-pet-trade .pt-ore.is-empty { opacity: 0.45; }
.map-pet-trade .pt-form-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
}
.map-pet-trade .pt-form-row label { flex: 0 0 auto; }
.map-pet-trade .pt-form-row input {
  flex: 1; background: #0d1824; border: 1px solid #3a6a8a; color: #dff; padding: 4px 6px;
}
.map-pet-trade .pt-preview {
  display: flex; justify-content: space-between; margin-bottom: 8px; color: #9ec;
}
.map-pet-trade .pt-preview strong { color: #ffd24d; }
.map-pet-trade .pt-actions { display: flex; gap: 8px; }
.map-pet-trade .pt-btn {
  flex: 1; background: #1a3048; border: 1px solid #3a6a8a; color: #dff; padding: 7px; cursor: pointer;
}
.map-pet-trade .pt-btn:disabled { opacity: 0.4; cursor: default; }
.map-pet-trade .pt-sell { background: #2a4a20; border-color: #5a8a3a; color: #dff; font-weight: 700; }
