/* FIELD OPERATIONS HUD: desktop dock + independent touch layouts (restyled 2026-10-09, direction A, Proposed).
   Plates, palette and type come from base.css (which maps the legacy names onto css/ui-tokens.css). This file keeps
   the accepted HUD geometry; the look is: chamfered graphite plates, amber for what you can press, cyan for
   information, Oxanium numbers, Chakra Petch labels, IBM Plex Sans Thai sentences.
   Skill sockets (#bSkill0-4, #bShoulder): .action-icon is a fixed square that holds either a legacy line glyph
   (svg.icon) or the new skill art (svg.sart from js/ui/art-skills.js, best with { plate: false }: the socket draws
   the frame); .cd is the cooldown sweep (--p from ui.js), .t the seconds, .k the key hint (mouse only), .l the name
   strip, .auto-mark a pip (hollow = auto-cast enabled, filled = firing under auto hunt).
   #bAuto.locked (or [data-locked="true"]): hatched + padlock; an optional <small class="lock-note"> child shows why. */
.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
}
.eyebrow {
  font: 600 11px/1.2 var(--f-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
kbd {
  font: 700 11px/1 var(--f-num);
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 2px 4px;
  background: rgba(4, 8, 9, 0.6);
}
button:disabled,
button[aria-disabled="true"] {
  cursor: default;
}

/* ------------------------------------------------------------------------------------------------- pilot frame */
#runtimeStats {
  position: absolute;
  top: -8px;
  left: 14px;
  display: flex;
  gap: 10px;
  padding: 0 5px;
  background: #101c20eb;
  border-radius: 2px;
  color: #aebfbe;
  font: 10px/12px var(--f-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
#runtimeStats b { color: #e3ece8; font-weight: 500; }
#pf {
  --c1: 14px;
  --c2: 14px;
  --deco: linear-gradient(var(--accent), var(--accent)) 14px 0 / 76px 2px no-repeat;
  top: calc(24px + var(--st));
  left: calc(24px + var(--sl));
  width: 302px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 11px 12px 11px 11px;
  pointer-events: auto;
}
.pilot-portrait {
  position: relative;
  padding: 0;
  overflow: hidden;
  width: 64px;
  height: 67px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 32%, #2e3f44, #0b1112 78%);
  -webkit-clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.pilot-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 5.8px, var(--line-strong) 0 7px, transparent 0),
    linear-gradient(315deg, transparent 5.8px, var(--accent-dim) 0 7px, transparent 0);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.pilot-portrait.is-pressed::after {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pilot-portrait img {
  width: 130%;
  height: 130%;
  object-fit: cover;
  position: absolute;
  left: -15%;
  top: -4%;
  filter: saturate(0.85) contrast(1.05);
}
.pilot-portrait #pLv {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 12, 13, 0.55), rgba(8, 12, 13, 0.96) 45%);
  color: var(--accent);
  font: 700 12px/19px var(--f-num);
  letter-spacing: 0.02em;
}
.pilot-info {
  padding-top: 3px;
  min-width: 0;
}
#pf .top {
  align-items: baseline;
  margin-bottom: 8px;
  gap: 6px;
  min-width: 0;
}
#pf .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 19px/1.15 var(--f-head);
  letter-spacing: 0.03em;
  color: var(--text);
}
.serial {
  color: var(--dim);
}
.class-name {
  flex-shrink: 0;
  font: 600 13px/1.2 var(--f-head);
  color: var(--info);
  white-space: nowrap;
}
/* a pilot's own name (front end) may be Thai: no tracking */
#pf .name.is-named {
  letter-spacing: 0;
}
#hpBar {
  height: 16px;
  border: 1px solid rgba(142, 219, 90, 0.28);
  background: rgba(4, 8, 9, 0.9);
}
#hpBar .f {
  background: linear-gradient(180deg, #c6f59d, var(--hp) 42%, #4c9a2a);
}
/* segment ticks every 10 % over the fill (under the number) */
#hpBar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(4, 8, 9, 0.7) calc(10% - 1px) 10%);
}
#hpBar > span {
  font: 700 12px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 1px #000, 0 0 3px #000, 0 0 3px #000;
}
.pilot-info .row {
  margin-top: 7px;
  justify-content: space-between;
  align-items: center;
}
#pf .row {
  font-size: 12px;
}
.health-label {
  font: 600 11px/1.2 var(--f-head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
#money {
  font: 700 15px/1 var(--f-num);
  color: var(--accent);
}
#pf .row small {
  font: 700 12px/1 var(--f-num);
  color: var(--accent-dim);
}
#tags {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
}
.tag {
  padding: 3px 8px 4px;
  background: rgba(10, 15, 16, 0.86);
  font: 600 13px/1.2 var(--f-head);
  color: var(--text);
  text-transform: none;
}
.tag.auto {
  color: var(--accent);
  border-color: var(--accent-dim);
}
.tag.rest {
  color: var(--good);
  border-color: rgba(127, 224, 138, 0.45);
}
.tag.buff {
  color: var(--info);
  border-color: var(--info-dim);
}

/* ------------------------------------------------------------------------------------------------- target frame */
#tf {
  --c1: 10px;
  --c2: 10px;
  --bd: rgba(255, 122, 107, 0.5);
  --deco: linear-gradient(var(--danger), var(--danger)) 10px 0 / 60px 2px no-repeat;
  --fill: linear-gradient(180deg, rgba(255, 75, 58, 0.1), transparent 60%), var(--glass);
  top: 112px;
  width: 270px;
  padding: 9px 12px 10px;
}
.target-eyebrow {
  display: flex;
  justify-content: space-between;
  font: 600 11px/1.15 var(--f-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff9c8f;
}
#tDist {
  font-family: var(--f-num);
  letter-spacing: 0.02em;
  color: var(--dim);
}
#tf .top {
  align-items: baseline;
}
#tName {
  font: 700 17px/1.2 var(--f-head);
  letter-spacing: 0.02em;
}
#tLv {
  font: 700 13px/1.2 var(--f-num);
  white-space: nowrap;
}
#tBar {
  height: 6px;
  border-radius: 0;
}
#tBar > i {
  background: linear-gradient(180deg, #ff9a8a, var(--danger) 55%, #a32014);
}
#tf .sub {
  font: 600 12px/1.2 var(--f-head);
  letter-spacing: 0.04em;
  color: var(--dim);
}
#tNote {
  font: 13px/1.35 var(--f-body);
  color: var(--dim);
}

/* ------------------------------------------------------------------------------------------------- minimap */
#tr {
  top: calc(24px + var(--st));
  right: calc(24px + var(--sr));
  width: 202px;
  gap: 10px;
}
.map-shell {
  --c1: 12px;
  --c2: 12px;
  --fill: linear-gradient(180deg, rgba(232, 237, 230, 0.05), transparent 30%), rgba(9, 14, 15, 0.92);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.map-heading {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 14px;
  font: 600 11px/1 var(--f-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.map-heading button {
  border: 0;
  background: none;
  padding: 2px;
  color: var(--accent);
}
.map-heading .icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.map-heading #mapCollapse .icon {
  color: var(--dim);
}
#mm {
  width: 200px;
  height: 160px;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  filter: saturate(0.75) brightness(0.86) contrast(1.06);
}
.north {
  position: absolute;
  top: 34px;
  left: calc(50% - 4px);
  color: var(--accent);
  font: 700 11px/1 var(--f-num);
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
#zoneTag {
  position: relative;
  display: block;
  font: 600 13px/1.25 var(--f-head);
  letter-spacing: 0.01em;
  color: var(--text);
  padding: 7px 12px 8px 14px;
  min-height: 27px;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(57, 198, 217, 0.16), transparent 75%);
  box-shadow: inset 3px 0 0 var(--info);
}

/* ------------------------------------------------------------------------------------------------- Salvage Core */
#core {
  --c1: 10px;
  --c2: 10px;
  --deco: linear-gradient(var(--accent), var(--accent)) 0 10px / 2px calc(100% - 20px) no-repeat;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 10px;
  gap: 10px;
  pointer-events: auto;
  width: 100%;
}
.core-icon .icon {
  width: 29px;
  height: 29px;
  color: var(--accent);
}
.core-content {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
#core .top {
  display: flex;
  align-items: baseline;
  font: 600 11px/1.2 var(--f-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
#core .top b {
  font: 700 14px/1 var(--f-num);
  letter-spacing: 0;
  color: var(--accent);
}
#coreBar {
  display: block;
  height: 5px;
  border-radius: 0;
}
#coreBar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(4, 8, 9, 0.75) calc(10% - 1px) 10%);
}
#coreNote {
  font: 13px/1.35 var(--f-body);
  color: var(--dim);
  display: block;
}

/* ------------------------------------------------------------------------------------------------- combat dock (mouse) */
#act {
  --c1: 14px;
  --c2: 14px;
  --bd: rgba(88, 112, 118, 0.85);
  --deco: repeating-linear-gradient(135deg, var(--accent) 0 5px, transparent 0 10px) 16px 0 / 64px 3px no-repeat;
  --fill: linear-gradient(180deg, rgba(232, 237, 230, 0.05), transparent 45%), rgba(9, 14, 15, 0.9);
  width: auto !important;
  /* lower and tighter since 2026-10-10 (user: the bottom stack took almost 30% of the screen): about 6 px between
     EXP, this dock and the field chat, and no "COMBAT SYSTEMS / frame" caption, so the plate hugs the buttons; was
     height 100, bottom 41, padding 26/9 */
  height: 80px !important;
  left: 50%;
  right: auto;
  bottom: calc(22px + var(--sb));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 8px 12px 7px;
  isolation: isolate;
}
#combatSkills,
#combatUtility {
  display: flex;
  gap: 6px;
}
#combatUtility {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
/* sockets: chamfered square (top-left + bottom-right), plate + 1px line drawn on the element, art clipped inside */
.ab {
  --cut: 8px;
  --bd: rgba(120, 146, 152, 0.7);
  --plate: linear-gradient(180deg, #223036, #121a1c 70%);
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: 62px;
  height: 61px;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background:
    linear-gradient(135deg, transparent calc(var(--cut) * 0.7071 - 0.6px), var(--bd) 0 calc(var(--cut) * 0.7071 + 0.6px), transparent 0),
    linear-gradient(315deg, transparent calc(var(--cut) * 0.7071 - 0.6px), var(--bd) 0 calc(var(--cut) * 0.7071 + 0.6px), transparent 0),
    var(--plate);
  box-shadow: inset 0 0 0 1px var(--bd), inset 0 1px 0 1px rgba(232, 237, 230, 0.06);
  -webkit-clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  overflow: hidden;
  display: block;
  --skill-color: #dfe6e2;
  color: var(--skill-color);
  touch-action: none;
  transition: filter var(--t-fast, 120ms);
}
.ab:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: -4px;
}
.ab.is-pressed {
  filter: brightness(1.3);
}
@media (hover: hover) and (pointer: fine) {
  .ab:hover {
    --bd: rgba(170, 196, 200, 0.9);
  }
}
/* the art square: 42 px on the mouse dock (40-64 px everywhere) */
.ab .action-icon {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}
.ab .action-icon > .icon {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}
.ab .action-icon > :is(svg.sart, .skill-art) {
  width: 100%;
  height: 100%;
  display: block;
}
.ab .l {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: block;
  overflow: hidden;
  padding: 0 2px 1px;
  font: 600 13px/15px var(--f-head);
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 9, 0.88) 45%);
}
.ab .k {
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: auto;
  right: auto;
  z-index: 3;
  padding: 1px 3px 2px;
  background: rgba(4, 8, 9, 0.82);
  color: var(--text);
  font: 700 11px/1 var(--f-num);
}
.ab .t {
  position: absolute;
  inset: 0 0 12px;
  display: grid;
  place-items: center;
  z-index: 3;
  color: #fff;
  font: 700 21px/1 var(--f-num);
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
  pointer-events: none;
}
/* cooldown sweep: the dark part is the time left; a thin amber edge marks the hand while cooling */
.ab .cd {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: conic-gradient(rgba(4, 8, 9, 0.8) var(--p, 0%), transparent 0);
  z-index: 2;
  pointer-events: none;
}
.ab.cooling .cd {
  background: conic-gradient(rgba(4, 8, 9, 0.78) var(--p, 0%), rgba(255, 178, 30, 0.55) var(--p, 0%) calc(var(--p, 0%) + 1.2%), transparent 0);
}
.ab.cooling .action-icon {
  filter: saturate(0.4) brightness(0.8);
}
.ab.cooling .l {
  opacity: 0.55;
}
.ab.empty {
  --bd: rgba(88, 112, 118, 0.55);
  --plate: var(--hatch), rgba(9, 14, 15, 0.82);
  color: var(--faint);
}
.ab.empty .l {
  color: var(--dim);
  background: none;
}
.ab.empty .action-icon > .icon {
  opacity: 0.7;
  width: 20px;
  height: 20px;
}
.ab.on {
  --bd: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), inset 0 -3px 0 var(--accent), inset 0 0 14px rgba(255, 178, 30, 0.28);
}
/* auto-cast pip in the free top-right corner: hollow = enabled, filled = firing under auto hunt */
.ab .auto-mark {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  font-size: 0;
  z-index: 3;
  pointer-events: none;
}
.ab .auto-mark:not(:empty) {
  transform: rotate(45deg);
  border: 2px solid var(--accent);
  background: rgba(4, 8, 9, 0.85);
  box-shadow: 0 0 0 1px rgba(4, 8, 9, 0.85);
}
.ab.on .auto-mark:not(:empty) {
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(4, 8, 9, 0.85), 0 0 6px rgba(255, 178, 30, 0.8);
}
.ab .n {
  position: absolute;
  right: 3px;
  bottom: 16px;
  z-index: 3;
  padding: 1px 3px;
  background: var(--good);
  color: #0b1a0e;
  font: 700 11px/1 var(--f-num);
}
.ab.sm {
  width: 56px;
  height: 61px;
}
.ab.sm .action-icon {
  width: 36px;
  height: 36px;
  margin-left: -18px;
  top: 7px;
}
.ab.sm .action-icon > .icon {
  width: 25px;
  height: 25px;
}
#bShoulder {
  --skill-color: #d5ddb8;
}
#bKit {
  --skill-color: var(--good);
}
#bRest {
  --skill-color: #b7d9cc;
}
#bDash {
  --skill-color: var(--info);
}
/* Attack: the one big amber control */
#bAttack {
  --cut: 10px;
  --bd: #ffd27a;
  --plate: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 50%), linear-gradient(180deg, var(--accent), #d98a0c);
  width: 76px;
  height: 61px;
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px #ffd27a, inset 0 -3px 0 rgba(26, 18, 3, 0.25);
}
#bAttack .action-icon,
#bAttack > .icon,
#bAttack > [data-icon] {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 32px;
  height: 32px;
  margin-left: -16px;
}
#bAttack .icon {
  width: 32px;
  height: 32px;
  color: var(--accent-ink);
}
#bAttack .l {
  font: 700 13px/16px var(--f-head);
  color: var(--accent-ink);
  text-shadow: none;
  background: none;
  bottom: 3px;
}
#bAttack .k {
  background: rgba(26, 18, 3, 0.82);
  color: var(--accent);
}
/* AUTO hunt toggle */
.auto-controls {
  display: flex;
  height: 61px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
  gap: 3px;
}
#bAuto {
  --c1: 8px;
  --c2: 8px;
  --bd: rgba(120, 146, 152, 0.75);
  --deco: none;
  --fill: linear-gradient(180deg, #223036, #121a1c 70%);
  position: relative;
  isolation: isolate;
  min-width: 72px;
  border: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: 700 13px/1 var(--f-head);
  letter-spacing: 0.1em;
  touch-action: manipulation;
}
#bAuto:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: -4px;
}
#bAuto.is-pressed {
  filter: brightness(1.3);
}
#bAuto .icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
#bAuto kbd {
  position: absolute;
  top: 2px;
  left: 2px;
  border: 0;
  padding: 1px 3px 2px;
  background: rgba(4, 8, 9, 0.82);
  color: var(--text);
}
#bAuto[aria-pressed="true"] {
  --bd: var(--accent);
  --deco: repeating-linear-gradient(135deg, rgba(255, 178, 30, 0.55) 0 4px, transparent 0 8px) 0 100% / 100% 4px no-repeat;
  --fill: radial-gradient(ellipse at 50% 40%, rgba(255, 178, 30, 0.32), transparent 70%), linear-gradient(180deg, rgba(255, 178, 30, 0.16), rgba(255, 178, 30, 0.04) 70%), #17140a;
  color: var(--accent);
}
/* locked until the tutorial step that unlocks auto hunt */
#bAuto:is(.locked, .is-locked, [data-locked="true"]) {
  --bd: rgba(88, 112, 118, 0.6);
  --deco: linear-gradient(transparent, transparent);
  --fill: var(--hatch), rgba(9, 14, 15, 0.88);
  color: var(--faint);
}
#bAuto:is(.locked, .is-locked, [data-locked="true"]) .icon {
  color: var(--faint);
}
#bAuto:is(.locked, .is-locked, [data-locked="true"])::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#bAuto :is(.lock-note, small) {
  display: none;
}
#bAuto:is(.locked, .is-locked, [data-locked="true"]) :is(.lock-note, small) {
  position: absolute;
  right: 0;
  bottom: calc(100% + 5px);
  display: block;
  padding: 3px 8px 4px;
  white-space: nowrap;
  font: 500 12px/1.3 var(--f-body);
  letter-spacing: 0;
  color: var(--accent);
  background: rgba(9, 14, 15, 0.94);
  border: 1px solid var(--accent-dim);
  pointer-events: none;
}
/* mouse dock: grow rightwards from AUTO's left edge, so the note clears the field chat that now sits just above the
   dock (2026-10-10) */
body:not(.touch) #bAuto:is(.locked, .is-locked, [data-locked="true"]) :is(.lock-note, small) {
  left: 0;
  right: auto;
}
/* the plate vars inherit from #act: every plate host inside the dock sets its own */
#autoSettings {
  --c1: 6px;
  --c2: 6px;
  --bd: rgba(120, 146, 152, 0.6);
  --deco: none;
  --fill: linear-gradient(180deg, #1c282d, #111819 70%);
  width: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 4px;
  color: var(--dim);
}
#autoSettings .icon {
  width: 18px;
  height: 18px;
  color: var(--dim);
}

/* ------------------------------------------------------------------------------------------------- EXP, hints */
#expTrack {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 4px;
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: none;
}
#expTrack > span {
  font: 600 11px/1 var(--f-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: var(--hud-shadow);
  white-space: nowrap;
}
#expTrack > #expPct {
  font: 700 12px/1 var(--f-num);
  letter-spacing: 0.02em;
  color: var(--exp);
}
#expBar {
  flex: 1;
  height: 5px;
  background: rgba(4, 8, 9, 0.78);
  box-shadow: 0 0 0 1px rgba(4, 8, 9, 0.5);
}
#expBar > i {
  background: linear-gradient(180deg, #fff0a8, var(--exp) 50%, #b8901a);
}
#expBar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(4, 8, 9, 0.85) calc(10% - 1px) 10%);
}
#keys {
  position: absolute;
  bottom: 26px;
  left: 24px;
  right: auto;
  max-width: 260px;
  font: 500 13px/1.9 var(--f-body);
  color: var(--text);
  text-shadow: var(--hud-shadow);
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  text-align: left;
  pointer-events: auto;
}
#keys i {
  height: 9px;
  border-left: 1px solid rgba(232, 237, 230, 0.35);
  margin: 0 3px;
}
#keys kbd {
  color: var(--text);
  background: rgba(9, 14, 15, 0.82);
  text-shadow: none;
}
#keys button {
  border: 0;
  background: none;
  color: var(--text);
  font: 500 13px/1.9 var(--f-body);
  padding: 0;
}
#keys > span,
#keys > i:nth-last-of-type(1) {
  display: none;
}
#toasts {
  top: 140px;
  left: 24px;
  width: 270px;
  pointer-events: none;
}
#banner {
  top: 30%;
  pointer-events: none;
}
#bnBig {
  font-size: 44px;
}
#vign,
#floats {
  pointer-events: none;
}
#touchHint,
#portraitHint {
  display: none;
}
#stick {
  display: none;
}
/* Legacy page content (ui-panels.js pages shown inside the new window shell by ui-legacy.js until every page module
   exists). The old drawer shell (#drawer, #menuBackdrop, .dh, .dtabs, .dbody, .terminal-footer) was removed 2026-10-09:
   js/ui/windows.js draws the window now (and reuses the #dClose id, so no #dClose rule may live here). */
.panel-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.pill {
  font: 8px var(--f-data);
  color: var(--amber);
  border: 1px solid #a8976955;
  background: #bda4690d;
  border-radius: 3px;
  padding: 6px 8px;
  white-space: nowrap;
}
.pill.mock {
  border-color: #96b6c54d;
  color: #a8cad3;
}
.subnav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}
.subnav .btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 8px 14px;
  min-height: 34px;
}
.subnav .btn.on {
  border-color: #89978566;
  background: #69877618;
  color: var(--fg);
}
.btn {
  border-radius: 3px;
  padding: 9px 13px;
  min-height: 36px;
  font: 500 12px var(--f-body);
  background: #263733;
  border: 1px solid #95b39944;
  box-shadow: none;
}
.btn.pri {
  background: linear-gradient(120deg, #d7b777, #b79b64);
  border-color: #e8c887;
  color: #19241f;
  font-weight: 600;
}
.btn.on {
  background: #798e5728;
  border-color: #afbd7966;
  color: #d6ddb0;
}
.btn.warn {
  background: #9b514722;
  border-color: #c57f6455;
  color: #f1af8d;
}
.btn[aria-disabled="true"] {
  opacity: 0.4;
}
.btns {
  gap: 6px;
  margin-top: 12px;
}
.sec {
  margin: 0 0 22px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.sec h3,
.section-heading {
  font: 500 17px var(--f-display);
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--fg);
  margin: 0 0 13px;
}
.sec p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.box {
  border: 1px solid var(--line);
  background: #0f1b2055;
  border-radius: 3px;
  padding: 14px;
  margin-bottom: 10px;
}
.box .hd {
  gap: 8px;
}
.box .hd b {
  font-size: 14px;
}
.meta {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.num {
  font-weight: 400;
}
.rar {
  font: 8px var(--f-data);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 4px 6px;
  background: #a0b8a517;
  color: #bec9bb;
  border: 1px solid #a0b8a544;
}
.rar.Tuned {
  color: #97ccd7;
  border-color: #75b8d366;
  background: #719eae16;
}
.rar.Special {
  color: #d2b7e0;
  border-color: #b097d466;
  background: #a897c316;
}
.opt {
  border-radius: 3px;
  font-size: 10px;
  padding: 5px 8px;
}
.confirm {
  border-color: #d1b47f66;
  background: #3e392eee;
  padding: 20px;
}
.confirm .meta {
  color: #dedbc5;
}
.kv {
  font: 11px/1.8 var(--f-data);
}
.stat-row {
  padding: 16px 10px;
  gap: 16px;
}
.stat-row > b {
  color: var(--amber);
  font-size: 20px;
}
.stat-row .v {
  font-size: 20px;
  color: var(--fg);
}
.stat-row .d {
  font-size: 10px;
}
.seg {
  border-radius: 3px;
}
.seg button {
  padding: 12px;
  font: 10px var(--f-data);
}
select {
  padding: 10px;
  font: 11px var(--f-body);
  max-width: 100%;
}
.field {
  margin: 14px 0;
  min-height: 44px;
}
.field input {
  min-height: 26px;
}
/* Equipment */
.equipment-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
}
.frame-display {
  position: relative;
  min-height: 318px;
  background:
    radial-gradient(ellipse at 50% 42%, #44544688, transparent 68%),
    linear-gradient(#111f2277, #162425);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.frame-display:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, #182728 98%);
  pointer-events: none;
}
.frame-display > img {
  position: absolute;
  inset: 18px 0 0;
  width: 100%;
  height: 93%;
  object-fit: contain;
  mix-blend-mode: lighten;
  filter: saturate(0.58) brightness(0.85);
  mask-image: radial-gradient(ellipse at 50% 50%, #000 42%, transparent 75%);
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 50%,
    #000 42%,
    transparent 75%
  );
}
.frame-label {
  position: absolute;
  top: 15px;
  left: 17px;
  z-index: 1;
}
.frame-label b {
  font: 22px var(--f-display);
  letter-spacing: 0.08em;
  display: block;
}
.frame-label small {
  font: 8px var(--f-data);
  color: var(--muted);
}
.frame-scale {
  position: absolute;
  right: 15px;
  top: 20px;
  bottom: 55px;
  width: 9px;
  border-right: 1px solid #8fa38e44;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 20px,
    #8fa38e55 20px 21px
  );
  z-index: 1;
}
.frame-caption {
  position: absolute;
  bottom: 15px;
  left: 16px;
  right: 16px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  font: 7px var(--f-data);
  letter-spacing: 0.06em;
  color: #a2b3a5;
}
.frame-caption span:last-child {
  color: #758c83;
}
.equipment-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  align-content: start;
}
.fit-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0e1a1d88;
  padding: 12px;
  min-width: 0;
  min-height: 71px;
  cursor: default;
  text-align: left;
  display: grid;
  grid-template-columns: 33px 1fr;
  gap: 8px;
  align-items: center;
}
.fit-card .icon {
  width: 29px;
  height: 29px;
  color: #c9bf9a;
}
.fit-card > span {
  min-width: 0;
}
.fit-card small {
  display: block;
  color: #91a49a;
  font: 8px var(--f-data);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fit-card b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fit-card em {
  font: 8px var(--f-body);
  color: #a5baad;
  display: block;
  margin-top: 4px;
}
.fit-card.vacant {
  border-style: dashed;
}
.fit-card.vacant b {
  color: #7f988e;
}
.fit-card.vacant .icon {
  color: #647e72;
}
.fit-card.Tuned {
  border-color: #6e9fa466;
}
.fit-card.Special {
  border-color: #a78cb766;
}
.set-bonus {
  grid-column: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #88a88633;
  background: #7199700a;
  font-size: 10px;
  color: #b2c9ad;
}
.set-bonus .icon {
  width: 19px;
  height: 19px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 17px;
  border-radius: 3px;
  overflow: hidden;
}
.metrics > div {
  background: #182628;
  padding: 13px;
}
.metrics small {
  font: 8px var(--f-data);
  color: var(--muted);
  display: block;
  line-height: 1.6;
}
.metrics b {
  font: 20px var(--f-display);
  display: block;
  color: #dbdec6;
  margin-top: 2px;
}
.metrics b em {
  font: 10px var(--f-body);
  color: var(--muted);
  font-style: normal;
}
.equipment-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}
.equipment-footer .note {
  max-width: 62%;
  margin: 0;
}
.equipment-footer .btn {
  white-space: nowrap;
}
/* Inventory and inspection */
.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 22px;
}
.inventory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}
.inventory-toolbar .subnav {
  margin: 0;
  gap: 0;
  flex-wrap: wrap;
}
.inventory-toolbar .btn {
  padding: 6px 10px;
  font-size: 11px;
}
.item-count {
  font: 9px var(--f-data);
  color: var(--muted);
  white-space: nowrap;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}
.item-cell {
  aspect-ratio: 1;
  position: relative;
  border: 1px solid #7d99804d;
  background: radial-gradient(ellipse at 50% 65%, #38504555, #132328);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: #bdcbb2;
  min-width: 0;
  padding: 10px 3px 8px;
}
.item-cell .icon {
  width: 34px;
  height: 34px;
}
.item-cell b {
  font: 8px var(--f-data);
  font-weight: 400;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-cell .cell-meta {
  position: absolute;
  top: 5px;
  left: 5px;
  font: 7px var(--f-data);
  color: #9fbbaa;
}
.item-cell .equipped-mark {
  position: absolute;
  top: 3px;
  right: 4px;
  font: 8px var(--f-data);
  color: #c4dfb7;
}
.item-cell .quantity {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font: 9px var(--f-data);
  color: var(--fg);
}
.item-cell.Tuned {
  border-color: #78b1c080;
  background: radial-gradient(ellipse at 50% 65%, #2c626a55, #14252b);
  color: #a4d1d9;
}
.item-cell.Special {
  border-color: #ad97c080;
  background: radial-gradient(ellipse at 50% 65%, #63437455, #201f2f);
  color: #d2b8e2;
}
.item-cell.selected {
  border-color: var(--amber);
  box-shadow:
    inset 0 0 0 1px #e8c48077,
    0 0 12px #e5c77b12;
}
.item-cell.blank {
  border: 1px dashed #88a38e18;
  background: #0c181b55;
  pointer-events: none;
}
.item-cell.blank:after {
  content: "+";
  color: #708e7f25;
  font: 20px var(--f-data);
}
.item-detail {
  background: #0e1a1f88;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  align-self: start;
  min-height: 330px;
}
.detail-art {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse, #a3ad6a1c, transparent 70%);
  margin-bottom: 10px;
  position: relative;
}
.detail-art .icon {
  width: 76px;
  height: 76px;
  color: #ddd1a3;
  stroke-width: 1.2;
}
.detail-art.Tuned .icon {
  color: #93cad7;
}
.detail-art.Special .icon {
  color: #c9a4db;
}
.detail-art:after {
  content: "";
  position: absolute;
  bottom: 12px;
  width: 85px;
  height: 12px;
  border: 1px solid #a2b99d22;
  border-radius: 50%;
}
.item-detail h2 {
  font: 500 23px/1.2 var(--f-display);
  margin: 11px 0 7px;
}
.item-detail .rar {
  display: inline-block;
}
.detail-type {
  font: 8px var(--f-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 8px 0 17px;
}
.detail-stats {
  margin: 16px 0;
  padding: 12px 0;
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.detail-stats b {
  font: 11px var(--f-data);
  color: var(--fg);
}
.item-detail .btns .btn {
  flex: 1;
  min-width: 40%;
  text-align: center;
}
.detail-empty {
  display: grid;
  place-content: center;
  min-height: 280px;
  text-align: center;
  color: var(--muted);
  gap: 10px;
}
.detail-empty .icon {
  margin: auto;
  width: 40px;
  height: 40px;
  opacity: 0.5;
}
.detail-empty p {
  font-size: 12px;
}
.inventory-note {
  font-size: 10px;
  color: #8fa398;
  margin: 14px 0 0;
}
.empty-state {
  grid-column: 1/-1;
  padding: 35px 15px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
/* Skills: four class slots, separate shoulder and a readable 1 > 2 > 4 tree. */
.loadout-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  background: #0e1b2066;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  border-radius: 3px;
}
.loadout-strip > span {
  font: 8px var(--f-data);
  color: var(--muted);
  line-height: 1.8;
  width: 65px;
  flex-shrink: 0;
}
.loadout-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 9px;
  border: 1px solid var(--line);
  background: #24342f66;
  border-radius: 3px;
  position: relative;
  text-align: left;
  min-height: 52px;
}
.loadout-slot .icon {
  width: 26px;
  height: 26px;
  color: var(--amber);
  flex-shrink: 0;
}
.loadout-slot small {
  display: block;
  color: var(--muted);
  font: 8px var(--f-data);
  margin-top: 4px;
}
.loadout-slot b {
  display: block;
  font-size: 10px;
  font-weight: 500;
}
.loadout-slot kbd {
  position: absolute;
  top: 2px;
  right: 3px;
  border: 0;
  font-size: 11px;
}
.loadout-slot.shoulder {
  border-style: dashed;
  flex: 0.85;
  color: var(--muted);
}
.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
}
.skill-tree {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 22px 12px;
  position: relative;
  padding: 3px 10px 15px;
}
.skill-node {
  position: relative;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 0;
  min-height: 82px;
  z-index: 1;
}
.skill-node.node0 {
  grid-column: 2/4;
}
.skill-node.node1 {
  grid-column: 1/3;
}
.skill-node.node2 {
  grid-column: 3/5;
}
.skill-node .node-icon {
  height: 51px;
  width: 51px;
  background: linear-gradient(145deg, #445649, #1c3030);
  border: 1px solid #99b29188;
  transform: rotate(45deg);
  border-radius: 6px;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 4px #0d1c1d,
    0 0 0 5px #899d7733;
  margin: 6px;
}
.skill-node .icon {
  transform: rotate(-45deg);
  width: 29px;
  height: 29px;
  color: #d1d6a8;
}
.skill-node b {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
}
.skill-node small {
  font: 8px var(--f-data);
  color: #a6b99d;
}
.skill-node.locked .node-icon {
  background: #19282c;
  border-color: #4a6258;
}
.skill-node.locked .icon {
  color: #7b9188;
}
.skill-node.locked b,
.skill-node.locked small {
  color: #8a9f95;
}
.skill-node.selected .node-icon {
  border-color: var(--amber);
  box-shadow:
    0 0 0 4px #122020,
    0 0 0 5px #c6b27a88;
  background: linear-gradient(145deg, #676645, #263832);
}
.skill-node.selected .icon {
  color: var(--amber);
}
.tree-lines {
  position: absolute;
  inset: 26px 0 64px;
  width: 100%;
  height: calc(100% - 90px);
  pointer-events: none;
  fill: none;
  stroke: #8eaa7666;
  stroke-width: 1;
}
.skill-detail .detail-art {
  height: 56px;
  width: 62px;
  float: right;
  margin: 0 0 8px 10px;
}
.skill-detail .detail-art .icon {
  width: 54px;
  height: 54px;
}
.skill-detail .detail-art:after {
  display: none;
}
.skill-detail h2 {
  font-size: 24px;
  min-height: 30px;
  margin: 10px 0 12px;
}
.skill-detail .meta {
  font-size: 11px;
  clear: both;
  padding-top: 5px;
}
.skill-detail .detail-stats {
  margin: 12px 0;
  padding: 10px 0;
}
.skill-detail .setting-line {
  padding: 6px 0;
}
.skill-detail .detail-label {
  margin-top: 13px;
}
/* class weapon mastery: its steps, lit once reached (2026-10-08) */
.mastery-steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 5px;
}
.mastery-steps li {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  padding-left: 9px;
  border-left: 2px solid var(--line-strong);
}
.mastery-steps li.on {
  color: #eef1ea;
  border-left-color: #b6c38b;
}
.mastery-steps b {
  font: 600 10px var(--f-data);
  margin-right: 4px;
}
.mastery-steps small {
  color: var(--muted);
}
.skill-level {
  height: 4px;
  background: #365045;
  margin: 12px 0;
}
.skill-level > i {
  display: block;
  height: 100%;
  background: #b6c38b;
}
.assign-row {
  display: flex;
  gap: 5px;
}
.assign-row .btn {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 8px;
}
.detail-label {
  font: 8px var(--f-data);
  color: var(--muted);
  letter-spacing: 0.1em;
  margin: 18px 0 8px;
}
.skill-reset {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.skill-reset .note {
  max-width: 60%;
  margin: 0;
}
.skill-reset .btn {
  font-size: 10px;
}
.points-badge {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--amber);
  font: 11px var(--f-data);
}
.points-badge b {
  font: 25px var(--f-display);
}
/* Auto-hunt, navigation, map and previews */
.auto-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.auto-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background:
    radial-gradient(ellipse at 0 0, #52634844, transparent 70%), #172927;
  border: 1px solid #9bac6b55;
  margin-bottom: 18px;
  border-radius: 3px;
}
.auto-hero > .icon {
  width: 41px;
  height: 41px;
  color: var(--amber);
}
.auto-hero h2 {
  margin: 0 0 5px;
  font: 23px var(--f-display);
}
.auto-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.auto-hero .btn {
  margin-left: auto;
  white-space: nowrap;
}
.setting-card {
  background: #101e2277;
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 3px;
}
.setting-card h3 {
  font: 17px var(--f-display);
  margin: 0 0 12px;
}
.setting-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  padding: 9px 0;
}
.setting-line small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.switch {
  border: 1px solid #7e948655;
  background: #283c35;
  border-radius: 16px;
  width: 40px;
  height: 23px;
  flex-shrink: 0;
  position: relative;
  padding: 0;
}
.switch:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #92a49a;
  transition: transform 0.15s;
}
.switch[aria-checked="true"] {
  background: #737449;
  border-color: #c9bc75;
}
.switch[aria-checked="true"]:before {
  transform: translateX(17px);
  background: #f1dfb4;
}
.auto-skill-list {
  display: grid;
  gap: 5px;
}
.auto-skill-list .setting-line {
  border-bottom: 1px solid var(--line);
}
.auto-skill-list .icon {
  width: 24px;
  height: 24px;
  color: #b1c2a4;
}
.auto-skill-list .setting-line > span {
  flex: 1;
}
.reserve-meter {
  height: 8px;
  background: #07151a;
  margin: 12px 0 8px;
}
.reserve-meter > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #94895b, #dac285);
}
.reserve-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.reserve-heading b {
  font: 27px var(--f-display);
  color: var(--amber);
}
.session-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.session-metrics b {
  font: 22px var(--f-display);
  display: block;
  margin-top: 3px;
}
.session-metrics small {
  font: 8px var(--f-data);
  color: var(--muted);
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.menu-tile {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  text-align: left;
  padding: 21px 16px;
  background: #102027;
  border: 1px solid var(--line);
  border-radius: 3px;
  min-height: 100px;
}
.menu-tile > .icon {
  color: var(--amber);
  width: 30px;
  height: 30px;
}
.menu-tile b {
  display: block;
  font: 18px var(--f-display);
}
.menu-tile small {
  display: block;
  font: 11px/1.5 var(--f-body);
  color: var(--muted);
  margin-top: 5px;
}
.menu-tile .pill {
  display: inline-block;
  margin-top: 9px;
}
.map-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
.field-map {
  position: relative;
  background: #1e302b;
  border: 1px solid var(--line);
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
}
.field-map img {
  width: 100%;
  height: 100%;
  filter: saturate(0.7);
}
.field-map .map-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: #102122df;
  font: 9px var(--f-data);
  color: var(--muted);
}
.zone-card {
  border: 1px solid var(--line);
  padding: 13px;
  margin-bottom: 9px;
  border-radius: 3px;
  background: #122127;
}
.zone-card h3 {
  font: 18px var(--f-display);
  margin: 0 0 4px;
}
.zone-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.zone-card .btn {
  margin-top: 10px;
  font-size: 11px;
  min-height: 32px;
}
.preview-notice {
  padding: 12px 15px;
  background: #789bad0c;
  border: 1px solid #8ba9b233;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #acc7cc;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.preview-notice .icon {
  width: 22px;
  height: 22px;
}
.market-row {
  display: grid;
  grid-template-columns: 40px 1fr 110px 100px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 17px 12px;
}
.market-row > .icon {
  color: var(--amber);
  width: 30px;
  height: 30px;
}
.market-row b {
  font-weight: 500;
  font-size: 13px;
}
.market-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.market-row .price {
  font: 13px var(--f-data);
  color: var(--amber);
}
.paint-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.paint-swatches {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}
.swatch {
  width: 44px;
  height: 44px;
  border: 3px solid #16262a;
  outline: 1px solid #74887a88;
  border-radius: 50%;
  background: var(--swatch);
}
.swatch[aria-pressed="true"] {
  outline: 2px solid var(--amber);
}
.paint-sample {
  height: 150px;
  border: 1px solid var(--line);
  background: var(--paint, #6e7953);
  display: grid;
  place-items: center;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.paint-sample .icon {
  height: 100px;
  width: 100px;
  color: #ffffff7a;
  stroke-width: 1;
}
.paint-sample:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, #ffffff33, transparent 40%, #0006);
}
.supplies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.supply-art {
  height: 90px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse, #9bcab01a, transparent 65%);
}
.supply-art .icon {
  height: 56px;
  width: 56px;
  color: #bad6be;
}
.settings-layout {
  max-width: 720px;
  margin: auto;
}
.workshop-layout .box {
  break-inside: avoid;
}
.workshop-layout .sec > p {
  max-width: 75ch;
}
.dev-tools {
  border: 1px dashed #b5916155;
  padding: 15px;
  margin-top: 20px;
}
.dev-tools summary {
  font: 11px var(--f-data);
  color: var(--amber);
  cursor: default;
}
.help li {
  margin-bottom: 10px;
}
.help ul {
  font-size: 12px;
}
.help kbd {
  font-size: 11px;
}
/* Smaller desktop windows keep keyboard controls. Input mode is independent from viewport size. */
@media (max-width: 1200px) {
  #keys {
    bottom: 26px;
    max-width: 145px;
    font-size: 11px;
  }
  #keys > i {
    display: none;
  }
  #act {
    gap: 6px;
    padding-inline: 9px;
  }
  .ab {
    width: 48px;
  }
  .ab.sm {
    width: 41px;
  }
  #combatSkills,
  #combatUtility {
    gap: 4px;
  }
  .auto-controls {
    gap: 2px;
    padding-left: 6px;
  }
  #bAuto {
    min-width: 50px;
  }
  #pf {
    width: 276px;
  }
  .class-name {
    display: none;
  }
}
@media (max-width: 1000px) {
  #act {
    bottom: calc(22px + var(--sb));
  }
  #keys {
    display: none;
  }
  #tr {
    width: 152px;
  }
  #mm {
    width: 150px;
    height: 126px;
  }
  #pf {
    width: 249px;
    grid-template-columns: 52px 1fr;
    gap: 8px;
  }
  .pilot-portrait {
    width: 52px;
    height: 59px;
  }
  #pf .name {
    font-size: 17px;
  }
  .health-label {
    font-size: 11px;
  }
  .item-grid {
    gap: 7px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .equipment-layout {
    gap: 18px;
  }
  .inventory-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
  }
  .skills-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
  }
  .loadout-slot {
    padding: 7px;
    gap: 6px;
  }
  .loadout-slot b {
    font-size: 9px;
  }
  .loadout-slot .icon {
    width: 22px;
    height: 22px;
  }
  .loadout-strip > span {
    width: 55px;
    font-size: 7px;
  }
  .more-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 760px) {
  body:not(.touch) #act {
    transform: translateX(-50%) scale(0.85);
    transform-origin: center bottom;
  }
  body:not(.touch) #pf {
    left: 14px;
    top: 14px;
  }
  body:not(.touch) #tr {
    right: 14px;
    top: 14px;
  }
  .inventory-layout {
    grid-template-columns: 1fr 230px;
    gap: 14px;
  }
  .item-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .item-detail {
    padding: 15px;
  }
  .skills-layout {
    grid-template-columns: 1fr 230px;
    gap: 15px;
  }
  .equipment-slots {
    gap: 6px;
  }
  .fit-card {
    padding: 8px;
    gap: 6px;
  }
  .frame-display {
    min-height: 315px;
  }
  .metrics > div {
    padding: 10px;
  }
  .metrics b {
    font-size: 18px;
  }
  .more-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* ------------------------------------------------------------------------------------------------- touch layout
   Touch: 44px+ targets, floating movement origin, action fan at the right thumb. Same plates and palette as the mouse
   HUD; the fan uses round sockets (they sit 43 px apart on an arc, so round faces never collide) with a segmented
   steel ring, the conic cooldown sweep and the skill art centred. Attack is the one big amber disc. */
body.touch #keys,
body.touch kbd,
body.touch .ab .k {
  display: none;
}
body.touch #pf {
  top: calc(12px + var(--st));
  left: calc(14px + var(--sl));
  width: 223px;
  padding: 7px 8px 7px 7px;
  grid-template-columns: 45px 1fr;
  gap: 8px;
}
body.touch .pilot-portrait {
  width: 45px;
  height: 51px;
}
body.touch #pf .name {
  font-size: 16px;
}
body.touch .pilot-info {
  padding-top: 2px;
}
body.touch #pf .top {
  margin-bottom: 7px;
}
body.touch .pilot-info .row {
  margin-top: 5px;
}
body.touch #hpBar {
  height: 13px;
}
body.touch .class-name,
body.touch .health-label {
  display: none;
}
body.touch .pilot-info .row {
  justify-content: flex-end;
}
body.touch #tags {
  top: calc(100% + 5px);
  gap: 4px;
}
body.touch .tag {
  padding: 4px 7px;
}
body.touch #tr {
  top: calc(12px + var(--st));
  right: calc(14px + var(--sr));
  width: 138px;
  gap: 5px;
}
body.touch #mm {
  width: 136px;
  height: 96px;
}
body.touch .map-heading {
  height: 24px;
  padding-left: 8px;
}
body.touch .map-heading button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
body.touch #zoneTag {
  padding: 4px 8px;
  min-height: 24px;
  font-size: 12px;
}
body.touch #core {
  padding: 7px;
  gap: 6px;
}
body.touch .core-icon .icon {
  width: 21px;
  height: 21px;
}
body.touch #coreNote {
  display: none;
}
body.touch #tf {
  top: 70px;
  width: 205px;
  padding: 7px 10px 8px;
}
body.touch #tName {
  font-size: 15px;
}
body.touch #tLv {
  font-size: 12px;
}
body.touch #tNote {
  font-size: 12px;
}
body.touch #toasts {
  top: 153px;
  left: 14px;
  width: 210px;
}
body.touch .toast {
  font-size: 13px;
  padding: 6px 10px 6px 12px;
}
body.touch #act {
  width: 270px !important;
  height: 202px !important;
  left: auto;
  right: calc(16px + var(--sr));
  bottom: calc(31px + var(--sb));
  transform: none;
  padding: 0;
  display: block;
  pointer-events: none;
}
/* no dock plate behind the fan: the sockets float over the field */
body.touch #act::before {
  display: none;
}
body.touch #combatSkills,
body.touch #combatUtility {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  border: 0;
  pointer-events: none;
}
body.touch .ab {
  --bd: rgba(150, 176, 180, 0.78);
  --tick: rgba(214, 228, 226, 0.9);
  --plate: radial-gradient(circle at 50% 28%, #2b3b42, #141d20 62%, #0c1214);
  position: absolute !important;
  width: 49px;
  height: 49px;
  padding: 0;
  border-radius: 50% !important;
  -webkit-clip-path: none;
  clip-path: none;
  background: var(--plate);
  box-shadow:
    inset 0 0 0 1.5px var(--bd),
    inset 0 0 0 4px rgba(4, 8, 9, 0.55),
    inset 0 0 0 5px rgba(232, 237, 230, 0.06),
    0 0 0 1px rgba(4, 8, 9, 0.55),
    0 3px 6px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}
/* segmented outer ring: four short bright arcs at the diagonals (static) */
body.touch .ab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(from 35deg, var(--tick) 0 20deg, transparent 20deg 90deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(circle closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
body.touch .ab .action-icon {
  top: 1px;
  width: 36px;
  height: 36px;
  margin-left: -18px;
}
body.touch .ab .action-icon > .icon {
  width: 25px;
  height: 25px;
}
body.touch .ab .l {
  bottom: 3px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 14px;
  background: none;
  text-shadow: 0 1px 2px #000, 0 0 3px #000, 0 0 3px #000;
}
body.touch .ab .t {
  inset: 0 0 8px;
  font-size: 18px;
}
body.touch .ab .cd {
  border-radius: 50%;
}
body.touch .ab.cooling .cd {
  background: conic-gradient(rgba(4, 8, 9, 0.8) var(--p, 0%), rgba(255, 178, 30, 0.7) var(--p, 0%) calc(var(--p, 0%) + 1.5%), transparent 0);
}
body.touch .ab .auto-mark {
  right: auto;
  left: calc(50% - 4px);
  top: 1px;
}
/* class skills and the shoulder: the art alone (names are in the Skills window); utility buttons keep their word */
body.touch #combatSkills .ab .l {
  display: none;
}
body.touch #combatSkills .ab .action-icon {
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
}
body.touch #combatSkills .ab .t {
  inset: 0;
  font-size: 20px;
}
/* repair kits on touch: the count replaces the word under the cross */
body.touch .ab .n {
  left: 50%;
  right: auto;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 1px 4px;
}
body.touch #bKit .l {
  display: none;
}
body.touch .ab.on {
  --bd: var(--accent);
  --tick: #ffe2a0;
  box-shadow:
    inset 0 0 0 1.5px var(--accent),
    inset 0 0 12px rgba(255, 178, 30, 0.35),
    0 0 0 1px rgba(4, 8, 9, 0.55),
    0 0 8px rgba(255, 178, 30, 0.45);
}
body.touch .ab.empty {
  --bd: rgba(120, 146, 152, 0.55);
  --tick: rgba(149, 163, 158, 0.45);
  --plate: var(--hatch), rgba(9, 14, 15, 0.78);
}
body.touch .ab.empty .action-icon > .icon {
  width: 20px;
  height: 20px;
}
/* five class skills and the shoulder skill on an arc round Attack (2026-10-07: 5 class slots, user), 25 deg apart,
   100 px from Attack's centre */
body.touch #bSkill0 {
  left: 84px !important;
  top: 142px !important;
}
body.touch #bSkill1 {
  left: 86px !important;
  top: 99px !important;
}
body.touch #bSkill2 {
  left: 106px !important;
  top: 60px !important;
}
body.touch #bSkill3 {
  left: 140px !important;
  top: 34px !important;
}
body.touch #bSkill4 {
  left: 183px !important;
  top: 25px !important;
}
body.touch #bShoulder {
  left: 221px !important;
  top: 34px !important;
}
body.touch #bAttack {
  --bd: #ffe2a0;
  --tick: rgba(26, 18, 3, 0.55);
  left: 167px !important;
  top: 109px !important;
  width: 81px;
  height: 81px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.3), transparent 46%),
    radial-gradient(circle at 50% 50%, #ffc542, var(--accent) 56%, #c97f08 100%);
  box-shadow:
    inset 0 0 0 2px #ffe2a0,
    inset 0 0 0 7px rgba(26, 18, 3, 0.18),
    inset 0 0 0 8px rgba(255, 226, 160, 0.45),
    0 0 0 2px rgba(4, 8, 9, 0.6),
    0 0 14px rgba(255, 178, 30, 0.35),
    0 4px 8px rgba(0, 0, 0, 0.4);
  color: var(--accent-ink);
}
body.touch #bAttack::before {
  background: repeating-conic-gradient(from 0deg, var(--tick) 0 6deg, transparent 6deg 30deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px), #000 calc(100% - 2.5px), transparent calc(100% - 2px));
  mask: radial-gradient(circle closest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px), #000 calc(100% - 2.5px), transparent calc(100% - 2px));
}
body.touch #bAttack > [data-icon],
body.touch #bAttack > .icon {
  top: 12px;
  width: 36px;
  height: 36px;
  margin-left: -18px;
}
body.touch #bAttack .icon {
  width: 36px;
  height: 36px;
}
body.touch #bAttack .l {
  bottom: 13px;
  font: 700 14px/16px var(--f-head);
  text-shadow: none;
}
body.touch #bKit {
  left: 17px !important;
  top: 142px !important;
}
body.touch #bDash {
  left: 18px !important;
  top: 87px !important;
}
body.touch #bRest {
  left: 0 !important;
  top: 31px !important;
}
body.touch .auto-controls {
  position: absolute;
  right: 0;
  top: -24px;
  height: 44px;
  border: 0;
  padding: 0;
  gap: 4px;
  pointer-events: auto;
}
body.touch #bAuto {
  flex-direction: row;
  gap: 6px;
  min-width: 84px;
  padding: 7px 10px;
  font-size: 13px;
}
body.touch #bAuto .icon {
  width: 21px;
  height: 21px;
}
body.touch #autoSettings {
  width: 44px;
  padding: 8px;
}
body.touch #autoSettings .icon {
  width: 20px;
  height: 20px;
}
body.touch #expTrack {
  left: 14px;
  right: 14px;
  bottom: 12px;
  gap: 8px;
}
body.touch #expTrack > span:first-child {
  display: none;
}
/* movement stick: a steel ring with four index ticks; the knob is the amber-rimmed thumb pad */
body.touch #stick {
  display: block;
  position: fixed;
  left: calc(88px + var(--sl));
  top: auto;
  bottom: calc(41px + var(--sb));
  width: 112px;
  height: 112px;
  transform: translateX(-50%);
  border: 1px solid rgba(150, 176, 180, 0.5);
  background: radial-gradient(circle, rgba(12, 18, 20, 0.05) 30%, rgba(12, 18, 20, 0.42) 70%, rgba(12, 18, 20, 0.2));
  box-shadow:
    inset 0 0 0 7px rgba(4, 8, 9, 0.18),
    inset 0 0 0 8px rgba(150, 176, 180, 0.16),
    0 0 0 1px rgba(4, 8, 9, 0.35);
  pointer-events: none;
  opacity: 0.7;
}
body.touch #stick::before,
body.touch #stick::after {
  content: "";
  position: absolute;
  background: rgba(214, 228, 226, 0.55);
}
/* four ticks (N E S W) on the ring instead of a full crosshair */
body.touch #stick::before {
  left: calc(50% - 1px);
  top: 3px;
  width: 2px;
  height: calc(100% - 6px);
  background: linear-gradient(rgba(214, 228, 226, 0.6) 0 9px, transparent 9px calc(100% - 9px), rgba(214, 228, 226, 0.6) calc(100% - 9px));
}
body.touch #stick::after {
  top: calc(50% - 1px);
  left: 3px;
  height: 2px;
  width: calc(100% - 6px);
  background: linear-gradient(90deg, rgba(214, 228, 226, 0.6) 0 9px, transparent 9px calc(100% - 9px), rgba(214, 228, 226, 0.6) calc(100% - 9px));
}
body.touch #stick.active {
  transform: translate(-50%, -50%);
  bottom: auto;
  opacity: 1;
}
body.touch #knob {
  position: absolute;
  left: 33px;
  top: 33px;
  width: 44px;
  height: 44px;
  z-index: 1;
  background: radial-gradient(circle at 50% 32%, #34464d, #172226 70%);
  border: 0;
  box-shadow:
    inset 0 0 0 1.5px var(--accent),
    inset 0 0 0 4px rgba(4, 8, 9, 0.5),
    inset 0 0 0 5px rgba(255, 178, 30, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.45);
}
body.touch #touchHint {
  display: block;
  position: absolute;
  bottom: calc(26px + var(--sb));
  left: calc(72px + var(--sl));
  font: 600 12px/1 var(--f-head);
  color: var(--text);
  opacity: 0.8;
  pointer-events: none;
  text-shadow: var(--hud-shadow);
}
body.touch .btn {
  min-height: 40px;
}
body.touch .fit-card {
  min-height: 73px;
  padding: 9px;
}
body.touch .panel-intro {
  margin-bottom: 12px;
}
body.touch .subnav {
  margin-bottom: 14px;
}
body.touch .subnav .btn {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 11px;
}
body.touch .loadout-strip {
  margin-bottom: 14px;
  padding: 9px;
  gap: 6px;
}
body.touch .loadout-slot {
  min-height: 44px;
}
body.touch .item-detail {
  padding: 14px;
}
body.touch .detail-art {
  height: 72px;
}
body.touch .detail-art .icon {
  width: 53px;
  height: 53px;
}
body.touch .item-detail h2 {
  font-size: 21px;
}
body.touch .skills-layout {
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 18px;
}
body.touch .skill-tree {
  gap: 20px 10px;
}
body.touch .skill-node {
  min-height: 76px;
}
body.touch .skill-node .node-icon {
  width: 44px;
  height: 44px;
}
body.touch .skill-node .icon {
  width: 25px;
  height: 25px;
}
body.touch .skill-node b {
  font-size: 9px;
}
body.touch .equipment-layout {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
body.touch .frame-display {
  min-height: 308px;
}
body.touch .auto-layout {
  gap: 16px;
}
body.touch .setting-card {
  padding: 13px;
}
body.touch .switch {
  width: 46px;
  height: 28px;
}
body.touch .switch:before {
  width: 20px;
  height: 20px;
}
body.touch .switch[aria-checked="true"]:before {
  transform: translateX(18px);
}
body.touch .setting-line {
  min-height: 44px;
}
@media (max-height: 450px) and (orientation: landscape) {
  body.touch #pf {
    width: 201px;
    grid-template-columns: 39px 1fr;
    gap: 7px;
    padding: 6px;
  }
  body.touch .pilot-portrait {
    width: 39px;
    height: 44px;
  }
  body.touch #pf .name {
    font-size: 14px;
  }
  body.touch #pf .top {
    margin-bottom: 5px;
  }
  body.touch .health-label {
    font-size: 11px;
  }
  body.touch #hpBar {
    height: 10px;
  }
  body.touch #tr {
    width: 117px;
  }
  body.touch #mm {
    width: 115px;
    height: 74px;
  }
  body.touch .map-heading {
    font-size: 11px;
    height: 22px;
  }
  body.touch .north {
    top: 26px;
    font-size: 11px;
  }
  body.touch #core {
    padding: 5px;
  }
  body.touch #core .top {
    font-size: 11px;
  }
  body.touch #core .top b {
    font-size: 11px;
  }
  body.touch #zoneTag {
    font-size: 11px;
    min-height: 19px;
  }
  body.touch #tf {
    top: 61px;
    width: 190px;
  }
  body.touch #act {
    right: calc(14px + var(--sr));
    bottom: calc(27px + var(--sb));
  }
  body.touch #toasts {
    top: 132px;
    width: 200px;
  }
  body.touch #stick {
    width: 100px;
    height: 100px;
    left: calc(78px + var(--sl));
    bottom: 42px;
  }
  body.touch #knob {
    left: 28px;
    top: 28px;
  }
  body.touch #touchHint {
    left: 62px;
  }
  body.touch .frame-display {
    min-height: 300px;
  }
}
@media (max-width: 700px) and (orientation: landscape) {
  body.touch #tf {
    left: 53%;
    width: 175px;
    top: 16px;
  }
  body.touch #act {
    width: 244px !important;
    height: 185px !important;
    transform: scale(0.9);
    transform-origin: right bottom;
    right: 12px;
    bottom: 27px;
  }
  body.touch #pf {
    width: 190px;
  }
  body.touch #toasts {
    max-width: 170px;
  }
  body.touch .inventory-layout {
    grid-template-columns: 1fr 218px;
    gap: 14px;
  }
  body.touch .item-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  body.touch .loadout-strip > span {
    display: none;
  }
  body.touch .loadout-slot b {
    font-size: 8px;
  }
  body.touch .loadout-slot .icon {
    width: 18px;
    height: 18px;
  }
  body.touch .skills-layout {
    grid-template-columns: 1fr 205px;
    gap: 12px;
  }
  body.touch .skill-tree {
    gap: 20px 3px;
    padding-inline: 0;
  }
  body.touch .skill-node b {
    font-size: 8px;
  }
  body.touch .skill-node .node-icon {
    width: 36px;
    height: 36px;
  }
  body.touch .skill-node .icon {
    width: 22px;
    height: 22px;
  }
  body.touch .metrics small {
    font-size: 6px;
  }
  body.touch .fit-card {
    grid-template-columns: 25px 1fr;
  }
  body.touch .fit-card .icon {
    width: 23px;
    height: 23px;
  }
  body.touch .fit-card b {
    font-size: 10px;
  }
}
/* Portrait is usable for checks and menus; landscape remains the proposed combat orientation. */
@media (orientation: portrait) and (max-width: 700px) {
  body.touch #pf {
    width: 224px;
    left: 12px;
    top: 12px;
  }
  body.touch #tr {
    top: 95px;
    right: 12px;
    width: 120px;
  }
  body.touch #mm {
    width: 118px;
    height: 96px;
  }
  body.touch #tf {
    top: 102px;
    left: 12px;
    transform: none;
    width: calc(100vw - 158px);
    max-width: 230px;
  }
  body.touch #toasts {
    top: 251px;
    left: 12px;
    width: 220px;
  }
  body.touch #act {
    right: 8px;
    bottom: 34px;
    transform: scale(0.91);
    transform-origin: right bottom;
  }
  body.touch #stick {
    left: 66px;
    bottom: 59px;
    width: 96px;
    height: 96px;
  }
  body.touch #knob {
    left: 25px;
    top: 25px;
  }
  body.touch #touchHint {
    left: 50px;
    bottom: 44px;
  }
  body.touch #bRest {
    left: 25px !important;
    top: -48px !important;
  }
  body.touch #bDash {
    left: 77px !important;
    top: -48px !important;
  }
  body.touch #bKit {
    left: 129px !important;
    top: -48px !important;
  }
  body.touch .auto-controls {
    top: -96px;
  }
  body.touch #portraitHint {
    display: block;
    position: absolute;
    bottom: 12px;
    left: 12px;
    font: 11px var(--f-body);
    color: #d9dfce;
    pointer-events: none;
  }
  body.touch #expTrack {
    bottom: 23px;
  }
  body.touch .equipment-layout {
    grid-template-columns: 1fr;
  }
  body.touch .frame-display {
    min-height: 270px;
  }
  body.touch .frame-display > img {
    height: 103%;
  }
  body.touch .metrics {
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
  }
  body.touch .metrics small {
    font-size: 7px;
  }
  body.touch .equipment-footer {
    flex-direction: column;
    align-items: stretch;
  }
  body.touch .equipment-footer .note {
    max-width: none;
  }
  body.touch .inventory-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  body.touch .item-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  body.touch .item-cell {
    padding: 8px 4px;
  }
  body.touch .inventory-toolbar .btn {
    padding: 6px 8px;
    font-size: 10px;
  }
  body.touch .item-detail {
    min-height: 0;
  }
  body.touch .detail-art {
    height: 66px;
    float: left;
    width: 76px;
    margin-right: 12px;
  }
  body.touch .detail-type {
    min-height: 30px;
  }
  body.touch .detail-stats {
    clear: both;
  }
  body.touch .skills-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  body.touch .loadout-strip > span {
    display: none;
  }
  body.touch .loadout-slot {
    padding: 6px 4px;
    justify-content: center;
  }
  .loadout-slot > span {
    min-width: 0;
  }
  body.touch .loadout-slot b {
    display: none;
  }
  body.touch .loadout-slot small {
    font-size: 6px;
  }
  body.touch .loadout-slot .icon {
    width: 20px;
    height: 20px;
  }
  body.touch .loadout-strip {
    gap: 5px;
    padding: 8px;
  }
  body.touch .skill-tree {
    margin: 10px 0;
    gap: 20px 9px;
  }
  body.touch .skill-node b {
    font-size: 9px;
  }
  body.touch .skill-node .node-icon {
    width: 44px;
    height: 44px;
  }
  body.touch .auto-layout,
  body.touch .map-layout,
  body.touch .paint-layout,
  body.touch .supplies-grid {
    grid-template-columns: 1fr;
  }
  body.touch .auto-hero {
    padding: 14px;
    gap: 10px;
  }
  body.touch .auto-hero > .icon {
    width: 30px;
    height: 30px;
  }
  body.touch .auto-hero h2 {
    font-size: 19px;
  }
  body.touch .auto-hero .btn {
    font-size: 10px;
    padding: 9px;
  }
  body.touch .more-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body.touch .menu-tile {
    padding: 15px 12px;
    flex-direction: column;
    gap: 10px;
  }
  body.touch .menu-tile b {
    font-size: 17px;
  }
  body.touch .market-row {
    grid-template-columns: 27px 1fr 80px;
    gap: 9px;
    padding: 14px 5px;
  }
  body.touch .market-row .btn {
    grid-column: 2/4;
  }
  body.touch .market-row .price {
    font-size: 11px;
  }
  body.touch .panel-intro {
    align-items: flex-start;
  }
  body.touch .panel-intro p {
    font-size: 11px;
  }
  body.touch .skill-reset {
    align-items: flex-start;
  }
  body.touch .sec p {
    font-size: 11px;
  }
  body.touch .kv {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.skill-detail .rar {
  font-size: 11px;
}
.skill-detail .setting-line > span {
  font-size: 11px;
}
@media (orientation: landscape) {
  body.touch #core {
    position: fixed;
    left: calc(14px + var(--sl));
    top: calc(150px + var(--st));
    width: 215px;
    min-height: 30px;
  }
  body.touch #toasts {
    top: 190px;
  }
}
@media (max-height: 450px) and (orientation: landscape) {
  body.touch #core {
    top: calc(136px + var(--st));
    width: 201px;
  }
  body.touch #toasts {
    top: 176px;
  }
  body.touch .loadout-strip {
    padding: 5px 7px;
    margin-bottom: 8px;
    flex-shrink: 0;
    min-height: 42px;
  }
  body.touch .loadout-slot {
    min-height: 30px;
    padding: 4px 6px;
  }
  body.touch .loadout-slot .icon {
    width: 20px;
    height: 20px;
  }
  body.touch .loadout-slot b {
    font-size: 8px;
  }
  body.touch .loadout-slot small {
    font-size: 6px;
    margin-top: 2px;
  }
}
@media (max-width: 700px) and (orientation: landscape) {
  body.touch #core {
    width: 190px;
  }
  body.touch #bRest {
    width: 49px;
    height: 49px;
  }
}
.skill-reset-mobile {
  display: none;
}

@media (max-width: 700px) and (orientation: landscape) {
  body.touch #act {
    width: 270px !important;
    height: 202px !important;
  }
}
/* the connection stalled (no state from the server for a moment; main.js): centred under the top bar */
#netWarn {
  --c1: 6px;
  --c2: 6px;
  --bd: var(--bad);
  --fill: rgba(20, 12, 4, 0.9);
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px 7px;
  color: var(--bad);
  font: 600 13px/1.2 var(--f-head);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}
#netWarn[hidden] { display: none; }
/* a phone held upright: the top bar runs two rows deep, so it sits in the open sky above the robot instead */
@media (orientation: portrait) {
  #netWarn { top: 34%; }
}
#netWarn small { color: var(--dim); font: 500 11px/1.2 var(--f-body); }
#previewMode {
  --c1: 5px;
  --c2: 5px;
  --bd: var(--accent-dim);
  --fill: rgba(9, 14, 15, 0.9);
  display: none;
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 9px 4px;
  color: var(--accent);
  font: 600 12px/1.2 var(--f-head);
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 700px) {
  body.touch #previewMode {
    display: block;
  }
}
@media (max-width: 700px) {
  body:not(.touch) #act {
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: center;
    width: max-content !important;
    max-width: calc(100vw - 24px);
    height: auto !important;
    transform: translateX(-50%);
    padding: 10px 12px 11px;
    gap: 8px;
  }
  body:not(.touch) #combatSkills {
    grid-column: 1/-1;
    justify-content: center;
  }
  body:not(.touch) #combatUtility {
    padding-left: 0;
    border-left: 0;
  }
  body:not(.touch) #tf {
    top: 130px;
    left: 150px;
    width: 240px;
  }
  body:not(.touch) .inventory-layout,
  body:not(.touch) .equipment-layout,
  body:not(.touch) .skills-layout,
  body:not(.touch) .auto-layout,
  body:not(.touch) .map-layout,
  body:not(.touch) .paint-layout {
    grid-template-columns: 1fr;
  }
  body:not(.touch) .loadout-slot b {
    display: none;
  }
}
@media (max-width: 700px) {
  body:not(.touch) #tf {
    left: 14px;
    top: 174px;
    transform: none;
    width: 230px;
  }
  body:not(.touch) #toasts {
    top: 265px;
    width: 235px;
  }
}
.item-inspector {
  min-width: 0;
}
.back-inventory {
  display: none;
}
@media (orientation: portrait) and (max-width: 700px) {
  body.touch .inventory-layout .item-inspector {
    display: none;
  }
  body.touch .inventory-layout.inspect-open > section {
    display: none;
  }
  body.touch .inventory-layout.inspect-open .item-inspector {
    display: block;
  }
  body.touch .back-inventory {
    display: inline-flex;
    margin-bottom: 12px;
    background: transparent;
    border-color: var(--line);
  }
  body.touch .inventory-layout.inspect-open .detail-art {
    float: none;
    width: 100%;
    height: 120px;
    margin: 0 0 12px;
  }
  body.touch .inventory-layout.inspect-open .detail-art .icon {
    width: 72px;
    height: 72px;
  }
}
@media (max-height: 450px) and (orientation: landscape) {
  body.touch #tags .tag {
    font: 11px/1 var(--f-data);
    padding: 3px 5px;
  }
  body.touch #core {
    top: calc(149px + var(--st));
  }
  body.touch #toasts {
    top: 189px;
  }
}
@media (max-width: 700px) and (max-height: 340px) and (orientation: landscape) {
  body.touch .auto-controls {
    right: 145px;
  }
  body.touch #tf {
    left: 57%;
    top: 12px;
    width: 200px;
  }
  body.touch #tf .target-eyebrow {
    display: none;
  }
  body.touch #tNote {
    font-size: 11px;
  }
}

/* Base Zero: building name labels over the town, and the "open this building" prompt on its pad. */
#labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.blabel {
  position: absolute;
  left: 0;
  top: 0;
  padding: 4px 9px 5px 10px;
  font: 700 13px/1.1 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  will-change: transform;
  background:
    linear-gradient(var(--acc), var(--acc)) 0 0 / 3px 100% no-repeat,
    linear-gradient(90deg, rgba(9, 14, 15, 0.9), rgba(9, 14, 15, 0.72));
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--acc) 55%, transparent);
  -webkit-clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  text-shadow: 0 1px 1px #000;
}
/* the building prompt: an amber "act here" plate (Enter / tap) */
#svc {
  --c1: 10px;
  --c2: 10px;
  --bd: var(--accent);
  --deco: linear-gradient(var(--accent), var(--accent)) 0 0 / 4px 100% no-repeat;
  --fill: linear-gradient(90deg, rgba(255, 178, 30, 0.2), rgba(255, 178, 30, 0.04) 60%), rgba(9, 14, 15, 0.94);
  position: absolute;
  left: 50%;
  bottom: calc(165px + var(--sb));
  transform: translateX(-50%);
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px 8px 18px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  pointer-events: auto;
  max-width: calc(100% - 32px);
  box-shadow: 0 0 18px rgba(255, 178, 30, 0.18);
}
#svc b {
  font: 700 16px/1.15 var(--f-head);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
#svc span {
  font: 500 13px/1.3 var(--f-body);
  color: var(--text);
}
#svc kbd {
  margin-left: 4px;
  color: var(--accent);
  border-color: var(--accent-dim);
}
#svc[hidden] {
  display: none;
}
.svc-head { border-left:3px solid var(--acc); padding-left:12px; }
.swatches { display:flex; flex-wrap:wrap; gap:12px; }
.swatches .swatch { display:grid; justify-items:center; gap:6px; width:auto; height:auto; background:none; border:0; font:11px var(--f-data); color:var(--muted); }
.swatches input { width:52px; height:34px; padding:0; background:none; border:1px solid var(--line-strong); cursor:default; }
ul.plain { padding-left:18px; color:var(--muted); line-height:1.5; }
body.touch #svc { bottom:calc(110px + var(--sb)); }
body.touch #svc kbd { display:none; }
@media (max-width:760px), (max-height:560px) { .blabel { font-size:11px; } #svc { padding:8px 10px; } }
@media (max-width:600px) and (orientation:portrait) { body.touch #svc { bottom:calc(295px + var(--sb)); flex-wrap:wrap; width:max-content; } }

/* weight budget line in Equipment (2026-10-07) */
.weight-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted, #9fb3ab);
}
.weight-line i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.weight-line i b {
  display: block;
  height: 100%;
  background: #e7c86b;
}
.weight-line span b {
  color: #f0e2b6;
}

/* the class skill tree, one tier at a time (2026-10-07) */
.skill-tree.tiered {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
}
.skill-tree.tiered .skill-node {
  grid-column: auto;
}
.mod-row .btn {
  flex: 1;
}

/* ------------------------------------------------------------------------------------------------- other pilots */
/* name tags over other pilots' robots (stage 1, js/remote-players.js); placed each frame, never take input */
#remoteTags {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.remote-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 7px 3px;
  background: rgba(9, 14, 15, 0.62);
  border: 1px solid rgba(155, 227, 139, 0.45);
  color: #e9f3e6;
  font: 600 12px/1.2 var(--f-head);
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
  will-change: transform;
}
.remote-tag small {
  color: #9be38b;
  font: 600 11px/1 var(--f-num, var(--f-head));
}
