* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:where(button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(208, 99, 47, .14);
}
[hidden] { display: none !important; }
#game { position: fixed; z-index: var(--z-world); inset: 0; width: 100%; height: 100%; display: block; }

.ui-status {
  position: fixed;
  z-index: var(--z-status);
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: min(430px, calc(100vw - 24px));
  min-height: 58px;
  padding: var(--space-3) var(--space-4);
  transform: translateX(-50%);
  border: 1px solid var(--zz-line-2);
  border-left: 3px solid var(--zz-system-cyan);
  border-radius: var(--radius-card);
  background: rgba(10, 18, 24, .96);
  box-shadow: 0 14px 42px rgba(0, 0, 0, .48);
  backdrop-filter: blur(10px);
  animation: ui-status-in var(--motion-base) var(--ease-enter);
}
.ui-status-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(101, 215, 218, .26);
  border-top-color: var(--zz-system-cyan);
  border-radius: 50%;
  animation: ui-status-spin .8s linear infinite;
}
.ui-status-copy { display: grid; gap: 2px; min-width: 0; }
.ui-status-copy b { color: var(--zz-text-1); font-size: var(--font-assist); }
.ui-status-copy small { overflow: hidden; color: var(--zz-text-2); font-size: var(--font-micro); text-overflow: ellipsis; white-space: nowrap; }
.ui-status-meter {
  overflow: hidden;
  width: 100%;
  height: 3px;
  margin-top: 3px;
  border-radius: 999px;
  background: rgba(101, 215, 218, .12);
}
.ui-status-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--zz-system-cyan);
  transition: width var(--motion-fast) linear;
}
.ui-status button {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--zz-line-2);
  border-radius: var(--radius-control);
  background: rgba(101, 215, 218, .08);
  color: var(--zz-text-1);
  font-size: var(--font-assist);
  font-weight: 800;
}
.ui-status[data-state="error"] { border-left-color: var(--zz-danger-red); }
.ui-status[data-state="error"] .ui-status-indicator {
  border: 0;
  border-radius: 2px;
  background: var(--zz-danger-red);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  animation: none;
}
.ui-status[data-state="error"] .ui-status-meter i { background: var(--zz-danger-red); }
.ui-status[data-state="empty"] { border-left-color: var(--zz-text-3); }
.ui-status[data-state="empty"] .ui-status-indicator { border-color: var(--zz-text-3); animation: none; }
.ui-status[data-state="empty"] .ui-status-meter i { background: var(--zz-text-3); }
@keyframes ui-status-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes ui-status-spin { to { transform: rotate(360deg); } }

.damage-feedback {
  --damage-angle: 0deg;
  position: fixed;
  z-index: var(--z-feedback);
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.damage-feedback::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 32%, rgba(255,29,28,.08) 63%, rgba(199,0,0,.58) 100%);
}
.damage-feedback.hit { animation: damage-flash .5s cubic-bezier(.18,.74,.26,1); }
.damage-feedback.critical {
  opacity: .34;
  animation: critical-vignette 1.15s ease-in-out infinite;
}
.damage-feedback.critical.hit { animation: damage-flash .5s cubic-bezier(.18,.74,.26,1), critical-vignette 1.15s .5s ease-in-out infinite; }
.damage-edge { position: absolute; display: block; background: linear-gradient(90deg, transparent, rgba(255,35,31,.96), transparent); filter: blur(5px); }
.edge-top, .edge-bottom { left: 8%; right: 8%; height: 16px; }
.edge-left, .edge-right { top: 8%; bottom: 8%; width: 16px; background: linear-gradient(0deg, transparent, rgba(255,35,31,.96), transparent); }
.edge-top { top: -5px; }
.edge-right { right: -5px; }
.edge-bottom { bottom: -5px; }
.edge-left { left: -5px; }
.damage-direction {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 108px;
  height: 108px;
  transform: translate(-50%, -50%) rotate(var(--damage-angle));
  border-top: 5px solid rgba(255,84,69,.96);
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(255,31,26,.7));
}
.damage-direction::after { content: ''; position: absolute; top: -8px; left: 50%; width: 16px; height: 9px; transform: translateX(-50%); clip-path: polygon(50% 0,100% 100%,0 100%); background: #ff6a58; }
.critical-health {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 88px));
  display: grid;
  grid-template-columns: 9px auto;
  column-gap: 8px;
  align-items: center;
  transform: translateX(-50%);
  padding: 8px 12px 8px 9px;
  border: 1px solid rgba(255,89,74,.48);
  border-radius: 5px;
  background: rgba(32,8,8,.76);
  box-shadow: 0 0 24px rgba(255,38,31,.2);
  pointer-events: none;
}
.critical-health > span { grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%; background: #ff4f43; box-shadow: 0 0 10px #ff3028; animation: critical-dot .65s ease-in-out infinite; }
.critical-health b { color: #ffd1cc; font-size: 10px; letter-spacing: 2px; }
.critical-health small { color: #b9918d; font-size: 8px; }
@keyframes damage-flash { 0% { opacity: .95; } 36% { opacity: .64; } 100% { opacity: 0; } }
@keyframes critical-vignette { 0%,100% { opacity: .18; } 50% { opacity: .43; } }
@keyframes critical-dot { 50% { transform: scale(.55); opacity: .55; } }

.hud {
  position: fixed;
  z-index: var(--z-hud);
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  width: min(620px, calc(100vw - 24px));
  transform: translateX(-50%);
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-top: 2px solid rgba(185, 242, 74, .65);
  border-radius: 4px 4px 14px 14px;
  background: linear-gradient(180deg, rgba(9, 15, 20, .92), rgba(17, 26, 33, .78));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
}
.hud-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mission, .score { display: flex; align-items: center; gap: 9px; }
.mission strong { font-size: 16px; letter-spacing: 1px; color: var(--acid); }
.mission span, .score span { color: var(--muted); font-size: 11px; }
#timer { min-width: 45px; font-variant-numeric: tabular-nums; color: #d7e2e4; }
.score b { padding: 3px 7px; border-radius: 3px; background: rgba(101, 215, 218, .12); color: var(--cyan); font-size: 10px; }
.stat { display: grid; grid-template-columns: 34px 60px 1fr; align-items: center; gap: 7px; margin-top: 5px; }
.stat > span { color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.stat > b { text-align: right; color: #d7e3e5; font-size: 9px; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 8px; overflow: hidden; border-radius: 2px; background: #090e12; box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
.track i, .track em { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width .24s ease; }
.track i { background: #8f3537; transition-duration: .65s; }
.hp-stat .track em { background: linear-gradient(90deg, #d74943, #ff7662); box-shadow: 0 0 7px rgba(255,98,92,.48); }
.xp-stat .track em { background: linear-gradient(90deg, #78ab39, var(--acid)); box-shadow: 0 0 7px rgba(185,242,74,.42); }

.combo {
  position: fixed;
  z-index: 11;
  left: 14px;
  top: max(132px, calc(env(safe-area-inset-top) + 122px));
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: 0 5px;
  min-width: 88px;
  padding: 8px 10px;
  border-left: 3px solid var(--orange);
  border-radius: 3px 10px 10px 3px;
  background: rgba(13, 20, 27, .82);
  box-shadow: 0 6px 18px rgba(0,0,0,.24);
  pointer-events: none;
}
.combo b { color: var(--orange); font-size: 25px; line-height: .9; font-style: italic; }
.combo span { color: #ffd7ad; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.combo small { grid-column: 1 / -1; margin-top: 3px; color: var(--muted); font-size: 8px; }
.combo.pulse { animation: combo-pulse .2s ease-out; }
@keyframes combo-pulse { 50% { transform: scale(1.09) rotate(-1deg); } }

.buff-status {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 106px);
  left: 50%;
  z-index: 5;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}
.buff-status:empty { display: none; }
.buff-status span {
  min-width: 78px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 3px;
  background: rgba(7,13,17,.82);
  box-shadow: 0 5px 18px rgba(0,0,0,.28);
  color: #eaf5f5;
  font-size: 9px;
  font-weight: 850;
  text-align: center;
  letter-spacing: .4px;
}
.buff-status .gatling { border-color: rgba(255,157,69,.55); color: #ffc681; }
.buff-status .shield { border-color: rgba(88,222,240,.55); color: #92eff8; }
.buff-status .sprint { border-color: rgba(185,242,74,.55); color: #cffa82; }
.buff-status .slowed { border-color: rgba(201,119,255,.55); color: #dfa9ff; }

.combat-guidance-slot {
  --guidance-safe-left: max(9px, calc(env(safe-area-inset-left) + 9px));
  --guidance-safe-right: max(9px, calc(env(safe-area-inset-right) + 9px));
  box-sizing: border-box;
}
.objective-hud {
  --objective-color: var(--orange);
  position: fixed;
  z-index: 12;
  top: calc(max(10px, env(safe-area-inset-top)) + 112px);
  left: 50%;
  display: grid;
  min-width: 214px;
  padding: 8px 12px 8px 42px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,191,92,.36);
  border-color: color-mix(in srgb, var(--objective-color) 38%, transparent);
  border-left: 3px solid var(--objective-color);
  border-radius: 4px 10px 10px 4px;
  background: rgba(7,13,17,.82);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  pointer-events: none;
}
.objective-hud::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%) rotate(45deg);
  border: 1px solid color-mix(in srgb, var(--objective-color) 76%, white);
  box-shadow: inset 0 0 0 4px rgba(7,13,17,.94);
}
.objective-hud span { color: var(--objective-color); font-size: 8px; font-weight: 900; letter-spacing: 2px; }
.objective-hud .objective-mode-line { display: flex; align-items: center; gap: 5px; }
.objective-hud .objective-mode-line > i { font-size: 10px; font-style: normal; line-height: 1; }
.objective-hud b { margin-top: 2px; font-size: 11px; }
.objective-hud small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.objective-rules { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.objective-rules span { padding: 2px 5px; border: 1px solid rgba(255,255,255,.14); border-radius: 3px; background: rgba(255,255,255,.05); color: #d8e3e4; font-size: 7px; letter-spacing: 0; }

.agent-hud {
  --agent-color: #ff9c57;
  position: fixed; z-index: 11; top: calc(max(10px, env(safe-area-inset-top)) + 108px); right: 14px;
  display: flex; align-items: center; gap: 7px; padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--agent-color) 44%, transparent); border-radius: 5px;
  background: rgba(7,13,17,.82); box-shadow: 0 7px 20px rgba(0,0,0,.25); pointer-events: none;
}
.agent-hud i { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--agent-color); border-radius: 50%; color: var(--agent-color); font-size: 8px; font-style: normal; font-weight: 900; }
.agent-hud span { display: grid; gap: 1px; }
.agent-hud b { color: #e6eeee; font-size: 9px; }
.agent-hud small { color: #7f9297; font-size: 7px; }

.sound-toggle {
  position: fixed;
  z-index: 28;
  right: 14px;
  bottom: max(61px, calc(env(safe-area-inset-bottom) + 58px));
  padding: 7px 10px;
  border: 1px solid rgba(190,215,222,.2);
  border-radius: 4px;
  background: rgba(11,20,26,.88);
  color: #aabcc1;
  font-size: 9px;
}
.sound-settings {
  position: fixed;
  z-index: 31;
  right: 14px;
  bottom: max(98px, calc(env(safe-area-inset-bottom) + 94px));
  width: 190px;
  padding: 11px;
  border: 1px solid rgba(190,215,222,.2);
  border-radius: 8px;
  background: rgba(12,21,27,.96);
  box-shadow: 0 14px 38px rgba(0,0,0,.45);
}
.sound-settings label { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.sound-settings label b { color: var(--cyan); }
.sound-settings input[type="range"] { width: 100%; margin: 7px 0 10px; accent-color: var(--cyan); }
.sound-comfort { display: grid; gap: 5px; margin: 1px 0 10px; padding: 8px; border: 1px solid rgba(190,215,222,.12); border-radius: 5px; background: rgba(255,255,255,.025); }
.sound-comfort label { display: grid; grid-template-columns: 15px 1fr; align-items: center; gap: 6px; line-height: 1.25; }
.sound-comfort input { width: 14px; height: 14px; margin: 0; accent-color: var(--cyan); }
.sound-settings small { display: block; margin: -1px 0 9px; color: #70858b; font-size: 8px; letter-spacing: .04em; }
.sound-settings button { width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.05); font-size: 9px; }

.combat-action-rail { display: contents; }
.armory-fab, .airstrike, .agent-skill, .primary-switch, .multifire-toggle {
  position: fixed;
  z-index: 12;
  bottom: max(16px, env(safe-area-inset-bottom));
  border: 1px solid rgba(222, 235, 235, .22);
  background: rgba(15, 24, 31, .9);
  box-shadow: 0 5px 16px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.06);
}
.combat-control {
  --combat-state-ink: #c4d0d2;
  isolation: isolate;
  overflow: visible;
}
.combat-control::before {
  content: attr(data-state-glyph);
  position: absolute;
  z-index: 2;
  top: -7px;
  left: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: #111a20;
  box-shadow: 0 2px 7px rgba(0,0,0,.58);
  color: var(--combat-state-ink);
  font: 900 12px/1 var(--font-mono);
  pointer-events: none;
}
.combat-control[data-combat-state="disabled"] {
  --combat-state-ink: #98a6a9;
  border-style: dotted;
  background-image: repeating-linear-gradient(135deg, rgba(220,231,232,.035) 0 3px, transparent 3px 8px);
}
.combat-control[data-combat-state="locked"] {
  --combat-state-ink: #d4d9da;
  border-style: dashed;
  background-image: repeating-linear-gradient(135deg, rgba(220,231,232,.07) 0 2px, transparent 2px 7px);
}
.combat-control[data-combat-state="cooldown"] {
  --combat-state-ink: #d9c3a8;
  border-style: dashed;
  box-shadow: 0 5px 16px rgba(0,0,0,.32), inset 0 0 0 2px rgba(211,221,222,.07);
}
.combat-control[data-combat-state="ready"] {
  --combat-state-ink: #f0f7e3;
  border-style: double;
  border-width: 3px;
  filter: none;
}
.combat-control[data-combat-state="ready"]::before { transform: rotate(45deg); border-radius: 1px; }
.combat-control[data-combat-state="active"] {
  --combat-state-ink: #fff;
  border-style: solid;
  outline: 2px solid rgba(238,246,246,.34);
  outline-offset: 2px;
  filter: none;
}
.combat-control em { font-variant-numeric: tabular-nums; font-weight: 850; }
.armory-fab { right: 14px; padding: 9px 12px; border-radius: 5px; color: #b8c7ca; font-size: 11px; }
.airstrike {
  --charge: 0deg;
  left: 14px;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  padding: 5px;
  border: 2px solid rgba(255,156,72,.5);
  border-radius: 50%;
  background: conic-gradient(var(--orange) var(--charge), rgba(55,66,72,.85) var(--charge));
}
.airstrike > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 40% 28%, #394853, #101920 70%); }
.airstrike b { color: #ffc18c; font-size: 12px; letter-spacing: 2px; }
.airstrike small { margin-top: -7px; color: #788c92; font-size: 8px; }
.airstrike em { position: absolute; right: -7px; bottom: 1px; min-width: 34px; padding: 2px 5px; border-radius: 99px; background: #222e36; color: #d8e1e3; font-size: 8px; font-style: normal; }
.airstrike:disabled { opacity: .76; cursor: default; filter: grayscale(.58) contrast(.94); }
.airstrike[data-combat-state="active"]:disabled { opacity: .94; filter: none; }
.airstrike.ready { animation: ready 1s ease-in-out infinite; }
.agent-skill {
  --agent-color: #ff9c57;
  left: 96px;
  display: grid;
  min-width: 116px;
  min-height: 54px;
  padding: 7px 10px;
  border-color: color-mix(in srgb, var(--agent-color) 52%, transparent);
  border-left: 3px solid var(--agent-color);
  border-radius: 4px 12px 12px 4px;
  text-align: left;
}
.agent-skill > span { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.agent-skill b { color: var(--agent-color); font-size: 10px; letter-spacing: 1px; }
.agent-skill small { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid rgba(220,235,236,.22); border-radius: 3px; color: #8ca0a4; font-size: 8px; }
.agent-skill em { margin-top: 3px; color: #c5d2d4; font-size: 8px; font-style: normal; }
.agent-skill:disabled { opacity: .76; cursor: default; filter: grayscale(.58) contrast(.94); }
.agent-skill.active:disabled { opacity: .92; filter: none; }
.agent-skill.ready { animation: skillReady 1.7s ease-in-out infinite; }
.agent-skill.active { background: color-mix(in srgb, var(--agent-color) 16%, rgba(15,24,31,.94)); box-shadow: 0 0 24px color-mix(in srgb, var(--agent-color) 24%, transparent); }
.agent-reconstruction { display: grid; gap: 3px; margin: 6px 0; color: var(--fd-paper-muted, #a79c83); font-size: 10px; line-height: 1.35; }
.agent-reconstruction b { color: var(--fd-orange, #b45d32); }
.agent-reconstruction small { color: inherit; font-size: 9px; }
.primary-switch {
  left: 226px;
  display: flex;
  min-width: 132px;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-color: rgba(115, 217, 229, .42);
  border-left: 3px solid var(--cyan);
  border-radius: 4px 12px 12px 4px;
  text-align: left;
}
.primary-switch span { display: grid; gap: 3px; }
.primary-switch small { color: #6f8b92; font-size: 7px; letter-spacing: .8px; }
.primary-switch b { max-width: 86px; overflow: hidden; color: #9eeaf0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.primary-switch em { flex: none; color: #b9c9cc; font-size: 8px; font-style: normal; }
.primary-switch:disabled { opacity: .76; cursor: default; filter: grayscale(.58) contrast(.94); }
.primary-switch.ready { box-shadow: 0 0 18px rgba(83, 202, 215, .16), inset 0 1px rgba(255,255,255,.06); }
.multifire-toggle {
  left: 372px;
  display: grid;
  min-width: 92px;
  min-height: 54px;
  align-content: center;
  gap: 2px;
  padding: 6px 9px;
  border-left: 3px solid var(--fd-orange, #b45d32);
  border-radius: 4px 12px 12px 4px;
  text-align: left;
}
.multifire-toggle span { display: grid; gap: 2px; }
.multifire-toggle small { color: var(--fd-paper-muted, #a79c83); font-size: 7px; letter-spacing: .8px; }
.multifire-toggle b { color: var(--fd-paper, #d3c5a7); font-size: 10px; }
.multifire-toggle em { overflow: hidden; color: var(--fd-paper-muted, #a79c83); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.multifire-toggle[data-combat-state="active"] { background: rgba(78, 55, 31, .94); }
@keyframes ready { 50% { transform: scale(1.07); box-shadow: 0 0 26px rgba(255,156,72,.52); } }
@keyframes skillReady { 50% { box-shadow: 0 0 18px color-mix(in srgb, var(--agent-color) 34%, transparent); } }

.panel {
  position: fixed;
  z-index: var(--z-panel);
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(14px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: rgba(4, 9, 12, .78);
  backdrop-filter: blur(8px);
}
.panel, .panel-card { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.panel-card {
  width: min(460px, 100%);
  max-height: 100%;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(190, 215, 222, .2);
  border-top: 3px solid var(--acid);
  border-radius: 4px 4px 18px 18px;
  background: linear-gradient(160deg, rgba(31, 44, 54, .98), rgba(13, 21, 27, .98));
  box-shadow: 0 24px 70px rgba(0,0,0,.52), inset 0 1px rgba(255,255,255,.05);
}
.eyebrow { margin-bottom: 4px; color: var(--acid); font-size: 9px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; }
.panel h2 { font-size: 27px; letter-spacing: 2px; }

.upgrade-panel { align-items: flex-start; overflow-y: auto; }
.upgrade-panel .panel-card { margin: auto; }
.loadout { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; min-height: 22px; }
.loadout span { padding: 3px 7px; border: 1px solid rgba(101,215,218,.22); border-radius: 3px; background: rgba(101,215,218,.08); color: #b9e9e8; font-size: 9px; }
.loadout .slot-chip { border-color: rgba(185,242,74,.48); background: rgba(185,242,74,.12); color: #ddff9b; font-weight: 900; }
.loadout .fusion-chip { border-color: rgba(207,141,255,.55); background: rgba(207,141,255,.12); color: #e4bcff; }
.loadout .empty { color: var(--muted); border-color: transparent; background: transparent; }
.weapon-row.unavailable { opacity: .48; filter: saturate(.55); }
.upgrade-list { display: grid; gap: 8px; }
.upgrade-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 13px 12px;
  border: 1px solid rgba(195, 218, 224, .18);
  border-left: 4px solid var(--cyan);
  border-radius: 4px 11px 11px 4px;
  background: linear-gradient(120deg, rgba(40,55,65,.9), rgba(21,32,40,.92));
  text-align: left;
  box-shadow: inset 0 1px rgba(255,255,255,.04);
  transition: transform var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}
.upgrade-art, .weapon-art {
  overflow: hidden;
  background-color: #111b21;
  background-repeat: no-repeat;
  image-rendering: auto;
}
.upgrade-art { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(222,237,236,.14); border-radius: 7px; box-shadow: inset 0 0 16px rgba(0,0,0,.45); }
.upgrade-art.generic { background: radial-gradient(circle at 48% 38%, rgba(185,242,74,.24), rgba(14,25,30,.98) 64%); color: var(--acid); font-size: 24px; }
.upgrade-art i { font-style: normal; }
.upgrade-copy { min-width: 0; }
.upgrade-card:hover { transform: translateX(3px); border-color: rgba(185,242,74,.5); background: linear-gradient(120deg, rgba(49,67,75,.96), rgba(24,38,45,.96)); }
.upgrade-card:active { transform: translateX(5px) scale(.99); }
.upgrade-card.weapon { border-left-color: var(--orange); }
.upgrade-card.survival { border-left-color: var(--acid); }
.upgrade-card.explosive { border-left-color: #ff685d; }
.upgrade-card.fusion { border: 1px solid rgba(207,141,255,.58); border-left: 4px solid #cf8dff; background: linear-gradient(120deg, rgba(65,43,83,.95), rgba(30,24,45,.96)); box-shadow: 0 0 22px rgba(177,91,239,.11), inset 0 1px rgba(255,255,255,.06); }
.upgrade-card.fusion header b, .upgrade-card.fusion small { color: #e1b5ff; }
.upgrade-card.fusion.confirming { border-color: #f0d8ff; transform: translateX(4px); }
.upgrade-card.rare { border: 1px solid rgba(255,212,103,.5); border-left: 4px solid #ffd467; background: linear-gradient(120deg, rgba(73,60,36,.95), rgba(37,31,24,.96)); }
.upgrade-card.rare header b, .upgrade-card.rare small { color: #ffe49a; }
.upgrade-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upgrade-card header b { font-size: 14px; }
.upgrade-card header em { padding: 2px 6px; border-radius: 3px; background: rgba(255,255,255,.08); color: var(--muted); font-size: 8px; font-style: normal; }
.upgrade-card p { margin-top: 5px; color: #aabcc1; font-size: 10px; line-height: 1.45; }
.upgrade-card small { display: block; margin-top: 7px; color: var(--acid); font-size: 9px; }
.minor-actions { display: flex; justify-content: center; gap: 8px; margin-top: 11px; }
.minor-actions button { padding: 7px 11px; border: 1px solid rgba(190,215,222,.18); border-radius: 4px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 9px; }
.minor-actions button:disabled { opacity: .35; }

.armory-card { display: flex; flex-direction: column; max-height: min(780px, 100%); }
.armory-card > header { display: flex; align-items: center; justify-content: space-between; }
.close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); color: var(--muted); font-size: 25px; }
.armory-card nav { flex: 0 0 auto; display: flex; gap: 6px; min-height: var(--control-min-touch); margin: 14px 0 10px; overflow-x: auto; }
.armory-card nav button { flex: none; padding: 6px 11px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.035); color: var(--muted); font-size: 10px; }
.armory-card nav button.active { border-color: var(--acid); background: rgba(185,242,74,.11); color: var(--acid); }
.armory-list { flex: 1 1 auto; min-height: 0; display: grid; gap: 7px; overflow-y: auto; }
.weapon-row { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.035); }
.weapon-row.locked { opacity: .46; filter: grayscale(.8); }
.weapon-row.fusion-row { border-color: rgba(207,141,255,.5); background: rgba(94,55,119,.18); }
.weapon-row.fusion-row .weapon-icon, .weapon-row.fusion-row header span { color: #d8a5ff; }
.weapon-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(225,237,235,.1); border-radius: 5px; background-color: #111b21; color: var(--orange); font-size: 22px; }
.weapon-art span { display: none; }
.weapon-row header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.weapon-row header b { font-size: 12px; }
.weapon-row header span { color: var(--acid); font-size: 9px; }
.weapon-row p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.weapon-row small { display: block; margin-top: 5px; color: #bdc9cb; font-size: 8px; }
.weapon-row small.weapon-mastery { color: #80dce5; }

.start-panel {
  z-index: 25;
  justify-content: center;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(90deg, rgba(3,8,11,.82) 0%, rgba(3,8,11,.4) 46%, rgba(3,8,11,.12) 72%, rgba(3,8,11,.3) 100%),
    linear-gradient(0deg, rgba(2,6,9,.66), transparent 50%),
    url('./assets/images/menu-quarantine-city-v1.png') center / cover no-repeat,
    linear-gradient(165deg, #15232a, #050a0d 72%);
}
.start-shell { display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(420px, .95fr); gap: clamp(18px, 4vw, 58px); align-items: end; width: min(1160px, calc(100% - 48px)); margin: auto; }
.start-copy { width: 100%; padding: 28px; border-left: 4px solid var(--acid); background: linear-gradient(90deg, rgba(8,14,18,.88), rgba(8,14,18,.36)); text-shadow: 0 2px 10px #000; }
.start-command { padding: 19px; border: 1px solid rgba(180,207,211,.2); border-top: 3px solid var(--cyan); border-radius: 4px 4px 13px 13px; background: linear-gradient(160deg, rgba(18,31,38,.96), rgba(7,14,18,.94)); box-shadow: 0 24px 70px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.04); }
.command-heading { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(198,218,221,.12); }
.command-heading span { grid-column: 1 / -1; color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: 2px; }
.command-heading b { font-size: 21px; letter-spacing: 1px; }
.command-heading small { align-self: center; color: #769197; font-size: 8px; }
.start-copy h1 { color: #f1f6f3; font-size: clamp(44px, 10vw, 76px); line-height: .98; letter-spacing: 6px; }
.tagline { margin-top: 9px; color: #c5d1d1; font-size: 14px; letter-spacing: 2px; }
.start-copy ul { display: grid; gap: 8px; margin: 24px 0 18px; list-style: none; }
.start-copy li { display: flex; align-items: center; gap: 10px; color: #b4c1c4; font-size: 12px; }
.start-copy li span { display: grid; place-items: center; width: 28px; height: 22px; border: 1px solid rgba(185,242,74,.35); color: var(--acid); font-size: 8px; }
.howto { color: #71878d; font-size: 10px; }
.home-returning .start-shell { grid-template-columns: minmax(280px, .72fr) minmax(480px, 1.28fr); gap: clamp(14px, 3vw, 38px); }
.home-returning .start-copy { padding: 20px 22px; }
.home-returning .start-copy h1 { font-size: clamp(38px, 6vw, 54px); }
.home-returning .start-copy ul { display: none; }
.home-returning .tagline { font-size: 12px; }
.home-returning .howto { margin-top: 12px; }
.profile-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 13px;
  padding: 8px 10px;
  border: 1px solid rgba(101,215,218,.28);
  border-radius: 4px;
  background: rgba(11,23,29,.8);
  text-align: left;
}
.profile-chip span { color: #71878d; font-size: 9px; letter-spacing: 1px; }
.profile-chip b { overflow: hidden; color: #dce9e8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip i { color: var(--cyan); font-size: 9px; font-style: normal; }
.profile-chip:hover { border-color: rgba(185,242,74,.55); background: rgba(18,34,40,.92); }
.primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.primary-actions button { min-width: 0; min-height: var(--control-min-touch); padding: 10px 12px; border-radius: 4px; font-size: var(--font-control); font-weight: 800; letter-spacing: .5px; text-align: left; }
.primary-actions .primary { grid-column: 1 / -1; min-height: var(--control-primary-touch); text-align: center; font-size: 13px; }
.start-command .primary-actions { grid-template-columns: 1fr; gap: 12px; }
.home-guidance {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid rgba(101,215,218,.26);
  border-left: 3px solid var(--cyan);
  border-radius: 4px 9px 9px 4px;
  background: rgba(101,215,218,.055);
}
.home-guidance > span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--cyan); color: var(--cyan); font-size: 12px; }
.home-guidance b { display: block; color: #dcebea; font-size: var(--font-assist); letter-spacing: .6px; }
.home-guidance p { margin-top: 2px; color: #8fa5aa; font-size: var(--font-micro); line-height: 1.4; }
.home-priority-actions { display: grid; gap: 7px; }
.home-priority-actions > header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  padding: 0 2px;
}
.home-priority-actions > header span { color: var(--acid); font: 800 var(--font-micro)/1 var(--font-mono); letter-spacing: .8px; }
.home-priority-actions > header b { color: #e4eed0; font-size: var(--font-assist); letter-spacing: 1px; }
.home-priority-actions > header small { color: var(--muted); font-size: var(--font-micro); text-align: right; }
.home-priority-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.home-priority-grid button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
.home-priority-grid button > [data-action-title], .home-priority-grid button > [data-action-detail] { grid-column: 1; }
.home-priority-grid button > [data-action-title] { font-weight: 900; }
.home-priority-grid button > [data-action-detail] { margin-top: 2px; color: #93abb0; font-size: var(--font-micro); letter-spacing: 0; }
.home-priority-grid .action-state-marker { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.recommended-action { display: grid; place-items: center; gap: 2px; }
.recommended-action span { font-size: 14px; font-weight: 950; letter-spacing: 1.4px; }
.recommended-action small { color: #3d520f; font-size: var(--font-micro); font-weight: 850; letter-spacing: .3px; }
.action-group { display: grid; gap: 7px; }
.action-group > header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  padding: 0 2px;
}
.action-group > header span { color: var(--cyan); font: 800 var(--font-micro)/1 var(--font-mono); letter-spacing: .8px; }
.action-group > header b { color: #dbe8e8; font-size: var(--font-assist); letter-spacing: 1px; }
.action-group > header small { color: var(--muted); font-size: var(--font-micro); text-align: right; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.primary { border: 1px solid #d8ff8a; background: linear-gradient(180deg, #c9f75b, #95c538); color: #17200c; box-shadow: 0 4px 0 #57771d; }
.secondary { border: 1px solid rgba(193,217,222,.24); background: rgba(34,48,57,.9); color: #c6d4d7; box-shadow: 0 4px 0 #111b21; }
.contract-action {
  display: grid;
  gap: 1px;
  min-width: 146px;
  border: 1px solid rgba(255,190,79,.72);
  background: linear-gradient(180deg, rgba(111,66,26,.98), rgba(55,33,20,.98));
  color: #ffe2aa;
  box-shadow: 0 4px 0 #2d1d12, 0 0 22px rgba(255,151,54,.12);
}
.contract-action span { font-weight: 900; }
.contract-action b { color: #ffbd68; font-size: 8px; font-weight: 700; letter-spacing: 0; }
.season-action {
  display: grid; gap: 1px; min-width: 132px; border: 1px solid rgba(255,211,108,.72);
  background: linear-gradient(145deg, rgba(91,65,25,.96), rgba(35,38,31,.98)); color: #fff0bb;
  box-shadow: 0 4px 0 #2a2114, inset 0 0 22px rgba(255,203,91,.07); text-align: left;
}
.season-action span { font-weight: 900; }
.season-action b { color: #ffd36c; font-size: 8px; letter-spacing: 0; }
.mastery-action { display: grid; gap: 1px; }
.mastery-action b { color: #83e9ef; font-size: 8px; letter-spacing: 0; }
.agent-action { display: grid; gap: 1px; }
.agent-action b { color: #ffb577; font-size: 8px; letter-spacing: 0; }
.community-action { display: grid; gap: 1px; }
.community-action b { color: #74e5d0; font-size: 8px; letter-spacing: 0; }
.archive-action { display: grid; gap: 1px; }
.archive-action b { color: #a9d8b8; font-size: 8px; letter-spacing: 0; }
.primary:active, .secondary:active, .contract-action:active, .redzone-action:active, .season-action:active { transform: translateY(3px); box-shadow: 0 1px 0 #111; }

.redzone-action {
  display: grid; gap: 1px; padding: 12px 16px; border: 1px solid rgba(255,94,78,.8); border-radius: 4px;
  background: linear-gradient(135deg, rgba(118,22,27,.88), rgba(37,20,27,.94)); color: #fff2e9;
  box-shadow: 0 4px 0 #361015, inset 0 0 24px rgba(255,74,57,.08); text-align: left; cursor: pointer;
}
.redzone-action span { font-weight: 900; }
.redzone-action b { color: #ff9b79; font-size: 8px; font-weight: 800; letter-spacing: 0; }
.primary-actions button[data-action-state] { position: relative; border-left-width: 3px; }
.primary-actions .action-state-marker, .stage-item .action-state-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  color: #91a5aa;
  font-size: var(--font-micro);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.action-state-marker i { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid currentColor; font-size: 9px; font-style: normal; }
.action-state-marker em { overflow: hidden; font-size: inherit; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
button[data-action-state="recommended"] { border-left-color: var(--acid); box-shadow: 0 0 0 1px rgba(185,242,74,.22), 0 5px 0 #18230b; }
button[data-action-state="recommended"] .action-state-marker { color: var(--acid); }
button[data-action-state="recommended"] .action-state-marker i { animation: home-state-ping var(--motion-attention) ease-in-out infinite; }
button[data-action-state="next"] { border-left-color: var(--cyan); box-shadow: 0 0 0 1px rgba(101,215,218,.18), 0 4px 0 #111b21; }
button[data-action-state="next"] .action-state-marker { color: var(--cyan); }
button[data-action-state="complete"] { border-left-color: #75e6a1; border-left-style: double; }
button[data-action-state="complete"] .action-state-marker { color: #8edfb0; }
button[data-action-state="locked"] { border-style: dashed; border-left-color: #7e8e92; }
button[data-action-state="locked"] .action-state-marker { color: #a1adb0; }
#begin[data-action-state="available"] { border-color: rgba(193,217,222,.24); border-left-color: #81969b; background: rgba(34,48,57,.9); color: #d1dcde; box-shadow: 0 4px 0 #111b21; }
#begin[data-action-state="available"] small { color: #91a5aa; }
#begin[data-action-state="recommended"] .action-state-marker { color: #26320f; }
@keyframes home-state-ping { 50% { opacity: .55; box-shadow: 0 0 0 4px rgba(185,242,74,.09); } }
.redzone-panel { z-index: 39; align-items: flex-start; overflow-y: auto; }
.redzone-card { width: min(1040px, 100%); margin: auto; border-top-color: #ff6658; }
.redzone-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.redzone-card .eyebrow { color: #ff7869; }
.redzone-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.redzone-meta p:last-child { color: #ffad84; }
.redzone-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.redzone-item {
  --risk-color: #ff735f; display: flex; flex-direction: column; min-height: 292px; padding: 12px;
  border: 1px solid rgba(211,226,228,.14); border-top: 3px solid var(--risk-color); border-radius: 4px 4px 10px 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--risk-color) 9%, #152028), rgba(12,19,24,.92));
}
.redzone-item.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--risk-color) 42%, transparent), 0 0 22px color-mix(in srgb, var(--risk-color) 10%, transparent); }
.redzone-head { display: flex; align-items: center; justify-content: space-between; color: var(--risk-color); }
.redzone-head b { font-size: 17px; }
.redzone-head i { font-size: 9px; font-style: normal; font-weight: 900; }
.redzone-item h3 { margin-top: 8px; font-size: 14px; }
.redzone-rule { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 8px; padding: 7px; border: 1px solid color-mix(in srgb, var(--risk-color) 34%, transparent); border-radius: 4px; background: color-mix(in srgb, var(--risk-color) 8%, rgba(14,23,29,.82)); }
.redzone-rule > i { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--risk-color); border-radius: 50%; color: var(--risk-color); font-size: 15px; font-style: normal; font-weight: 950; }
.redzone-rule b, .redzone-rule small { display: block; }
.redzone-rule b { color: #e6eeee; font-size: 9px; }
.redzone-rule small { margin-top: 2px; color: #98aaae; font-size: 7px; line-height: 1.35; }
.redzone-modifiers { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 0; }
.redzone-modifiers span { padding: 4px; border-radius: 3px; background: rgba(255,255,255,.045); color: #aebfc1; font-size: 7px; text-align: center; }
.redzone-conditions { display: grid; gap: 5px; margin-bottom: 12px; list-style: none; }
.redzone-conditions li { color: #c6d2d2; font-size: 8px; line-height: 1.35; }
.redzone-conditions li::before { content: '◆'; margin-right: 5px; color: var(--risk-color); font-size: 6px; }
.redzone-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: auto; }
.redzone-item button { padding: 9px; border: 1px solid var(--risk-color); border-radius: 4px; background: color-mix(in srgb, var(--risk-color) 15%, #152028); color: #f0f4f3; font-size: 9px; font-weight: 900; }
.redzone-item button.redzone-board { border-color: rgba(211,226,228,.25); background: rgba(211,226,228,.06); color: #aebdc0; }
.redzone-best { min-height: 28px; margin-top: 8px; color: #7f9196; font-size: 7px; line-height: 1.45; text-align: center; }

.contract-panel { z-index: 38; align-items: flex-start; overflow-y: auto; }
.contract-card { width: min(940px, 100%); margin: auto; border-top-color: #ffad52; }
.contract-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.contract-card .eyebrow { color: #ffb15b; }
.contract-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.contract-meta b { color: #ffd473; }
.contract-note { margin: 8px 0 15px; color: #8fa2a7; font-size: 9px; line-height: 1.5; }
.contract-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contract-item {
  --contract-color: #ffad52;
  display: flex;
  flex-direction: column;
  min-height: 294px;
  padding: 14px;
  border: 1px solid rgba(204,221,224,.15);
  border-top: 3px solid var(--contract-color);
  border-radius: 4px 4px 12px 12px;
  background: linear-gradient(155deg, rgba(42,54,60,.94), rgba(17,26,32,.96));
  text-align: left;
}
.contract-item.complete { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--contract-color) 36%, transparent); }
.contract-item > span { color: var(--contract-color); font-size: 8px; font-weight: 900; letter-spacing: 2px; }
.contract-item h3 { margin-top: 5px; font-size: 18px; }
.contract-item > p { min-height: 32px; margin-top: 5px; color: #9fb0b4; font-size: 9px; line-height: 1.45; }
.contract-goal { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 8px; padding: 8px; border-radius: 5px; background: rgba(0,0,0,.22); }
.contract-goal b { color: #eef4f3; font-size: 12px; }
.contract-goal small { color: var(--contract-color); font-size: 8px; }
.contract-doctrine { padding: 8px; border-left: 3px solid #ffd45d; background: rgba(255,210,93,.07); }
.contract-doctrine b { display: block; color: #ffe29b; font-size: 10px; }
.contract-doctrine small { display: block; margin-top: 3px; color: #9da9a9; font-size: 8px; line-height: 1.4; }
.contract-rules { display: grid; gap: 5px; margin: 8px 0 12px; }
.contract-rule { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: center; }
.contract-rule i { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-style: normal; }
.contract-rule b { display: block; color: #d9e2e2; font-size: 9px; }
.contract-rule small { display: block; color: #7f9297; font-size: 7px; line-height: 1.3; }
.contract-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: auto; }
.contract-item button { padding: 9px 10px; border: 1px solid var(--contract-color); border-radius: 4px; background: color-mix(in srgb, var(--contract-color) 18%, #152028); color: #f0f5f3; font-size: 10px; font-weight: 900; }
.contract-item button.contract-board { border-color: rgba(211,226,228,.25); background: rgba(211,226,228,.06); color: #aebdc0; }
.contract-best { margin-top: 7px; color: #819399; font-size: 8px; text-align: center; }

.panel-sticky-head {
  position: sticky;
  z-index: 4;
  top: 0;
  margin: -20px -20px 0;
  padding: 20px 20px 10px;
  border-bottom: 1px solid rgba(205,225,224,.12);
  background: linear-gradient(180deg, rgba(22,33,41,.99), rgba(14,23,29,.97));
  box-shadow: 0 9px 20px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
.panel-sticky-head > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-tab-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 11px; }
.panel-tab-nav button {
  min-width: 0;
  min-height: var(--control-min-touch);
  padding: 7px 8px;
  border: 1px solid rgba(193,217,222,.2);
  border-radius: var(--radius-control);
  background: rgba(255,255,255,.035);
  color: var(--zz-text-2);
  font-size: var(--font-assist);
  font-weight: 850;
  text-align: center;
}
.panel-tab-nav button[aria-selected="true"] { border-color: var(--cyan); background: rgba(101,215,218,.12); color: var(--zz-text-1); }
.panel-tab-nav button span { color: var(--cyan); font: 800 var(--font-micro)/1 var(--font-mono); }
.panel-tab-nav button b { margin-left: 4px; font-size: var(--font-assist); }
.agent-tab-nav { display: none; }

.agent-panel { z-index: 40; align-items: flex-start; overflow-y: auto; }
.agent-card { width: min(900px, 100%); margin: auto; border-top-color: #ff9c57; }
.agent-card .panel-sticky-head { --focus-ring: #ffb577; }
.agent-summary { margin: 10px 0 15px; color: #8fa2a7; font-size: 10px; line-height: 1.5; }
.agent-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.agent-item {
  --agent-color: #ff9c57; min-height: 336px; padding: 10px;
  border: 1px solid rgba(204,221,224,.15); border-top: 3px solid var(--agent-color); border-radius: 4px 4px 11px 11px;
  background: linear-gradient(150deg, rgba(42,54,60,.96), rgba(16,25,31,.97));
}
.agent-portrait { position: relative; isolation: isolate; height: 128px; margin: -1px -1px 9px; overflow: hidden; border-radius: 4px; background-color: #18242a; box-shadow: inset 0 -34px 30px rgba(5,12,16,.48); }
.agent-portrait::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 0;
  width: 100%;
  aspect-ratio: 1;
  content: '';
  background-image: var(--portrait-image);
  background-repeat: no-repeat;
  background-size: 200% 200%;
  background-position: var(--portrait-x, 0%) var(--portrait-y, 0%);
  transform: translateY(-45%);
}
.agent-portrait::after { position: absolute; z-index: 1; inset: 0; content: ''; background: linear-gradient(180deg, transparent 55%, rgba(9,16,20,.88)); pointer-events: none; }
.agent-portrait span { position: absolute; z-index: 2; right: 7px; bottom: 6px; padding: 3px 5px; border: 1px solid color-mix(in srgb, var(--agent-color) 45%, transparent); border-radius: 2px; background: rgba(7,14,18,.78); color: var(--agent-color); font-size: 7px; font-weight: 900; letter-spacing: 1px; }
.agent-item.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--agent-color) 42%, transparent), 0 0 22px color-mix(in srgb, var(--agent-color) 10%, transparent); }
.agent-mark { display: flex; align-items: end; justify-content: space-between; }
.agent-mark b { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid var(--agent-color); border-radius: 50%; color: var(--agent-color); font-size: 12px; }
.agent-mark small { color: var(--agent-color); font-size: 8px; letter-spacing: 1px; }
.agent-copy > span { display: block; margin-top: 11px; color: var(--agent-color); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.agent-copy h3 { margin-top: 4px; font-size: 15px; }
.agent-copy ul { display: grid; gap: 5px; min-height: 67px; margin: 12px 0; list-style: none; }
.agent-copy li { color: #b7c7c8; font-size: 8px; }
.agent-copy li::before { content: '+'; margin-right: 5px; color: var(--agent-color); font-weight: 900; }
.agent-copy li.weakness { color: #c79b96; }
.agent-copy li.weakness::before { content: '−'; color: #ff756b; }
.agent-copy button { width: 100%; padding: 9px; border: 1px solid var(--agent-color); border-radius: 4px; background: color-mix(in srgb, var(--agent-color) 13%, #132028); color: #e8efee; font-size: 9px; font-weight: 900; }
.agent-item.active button { background: var(--agent-color); color: #132028; }

/* Starter armament contract: the campaign runtime can render either name.
   Keep the two first-run choices brief, thumb-sized and visually equal. */
:where(.starter-loadout-choice, .starter-weapon-choice, #starter-options) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
:where(.starter-loadout-option, .starter-weapon-option, [data-starter-weapon], #starter-options [data-starter]) {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: max(68px, var(--control-min-touch));
  padding: 9px 10px;
  border: 1px solid var(--fd-line-strong);
  border-left: 3px solid var(--fd-olive-mid);
  border-radius: 3px;
  background: linear-gradient(155deg, rgba(44, 40, 31, .96), rgba(24, 22, 17, .98));
  color: var(--fd-paper);
  text-align: left;
  box-shadow: var(--fd-shadow-control);
}
:where(.starter-loadout-option, .starter-weapon-option, [data-starter-weapon], #starter-options [data-starter]):is(:hover, :focus-visible) {
  border-color: var(--fd-rust);
  border-left-color: var(--fd-orange);
}
:where(.starter-loadout-option, .starter-weapon-option, [data-starter-weapon])[aria-pressed='true'],
:where(.starter-loadout-option, .starter-weapon-option, [data-starter-weapon]).selected,
#starter-options [data-starter][aria-checked='true'],
#starter-options [data-starter].active {
  border-color: var(--fd-orange);
  border-left-color: var(--fd-orange);
  background: linear-gradient(155deg, rgba(82, 54, 33, .97), rgba(35, 27, 19, .99));
  box-shadow: 0 0 0 1px rgba(208, 99, 47, .22), var(--fd-shadow-control);
}
:where(.starter-loadout-icon, .starter-weapon-icon) {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(231, 220, 195, .18);
  border-radius: 2px;
  background-color: #24221b;
  background-repeat: no-repeat;
  color: var(--fd-orange);
  font-size: 22px;
}
:where(.starter-loadout-copy, .starter-weapon-copy) { display: grid; gap: 3px; min-width: 0; }
:where(.starter-loadout-copy, .starter-weapon-copy) b { overflow: hidden; color: var(--fd-paper-strong); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
:where(.starter-loadout-copy, .starter-weapon-copy) small { color: var(--fd-paper-muted); font-size: 11px; line-height: 1.3; }
#starter-options [data-starter] {
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: max(76px, var(--control-min-touch));
}
#starter-options [data-starter] span { color: var(--fd-paper-strong); font-size: 14px; font-weight: 850; }
#starter-options [data-starter] b { color: var(--fd-paper-muted); font-size: 11px; line-height: 1.35; }

.community-panel { z-index: 42; align-items: flex-start; overflow-y: auto; }
.community-card { width: min(820px, 100%); margin: auto; border-top-color: #74e5d0; }
.community-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.community-card .eyebrow { color: #74e5d0; }
.community-summary { margin: 10px 0 14px; color: #91a6a9; font-size: 10px; line-height: 1.55; }
.community-routes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.community-route { --route-color:#74e5d0; display: grid; gap: 8px; min-height: 230px; padding: 15px; border: 1px solid color-mix(in srgb, var(--route-color) 24%, transparent); border-top: 3px solid var(--route-color); border-radius: 5px 5px 13px 13px; background: linear-gradient(150deg, color-mix(in srgb, var(--route-color) 8%, #1a282e), #10191e); }
.community-route.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--route-color) 38%, transparent), 0 0 28px color-mix(in srgb, var(--route-color) 11%, transparent); }
.community-route header { display: flex; justify-content: space-between; gap: 10px; }
.community-route header span { color: var(--route-color); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.community-route header b { color: #dbe8e7; font-size: 11px; }
.community-route h3 { color: var(--route-color); font-size: 18px; }
.community-route p { color: #9cabad; font-size: 9px; line-height: 1.5; }
.community-route ul { display: grid; gap: 4px; margin: 0; list-style: none; }
.community-route li { color: #bdc9c9; font-size: 8px; }
.community-route li::before { content: '◆'; margin-right: 6px; color: var(--route-color); font-size: 6px; }
.community-meter { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(0,0,0,.32); }
.community-meter i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--route-color); box-shadow: 0 0 12px color-mix(in srgb, var(--route-color) 55%, transparent); }
.community-route button { width: 100%; padding: 9px; border: 1px solid var(--route-color); border-radius: 4px; background: color-mix(in srgb, var(--route-color) 9%, transparent); color: #e3ecec; font-size: 9px; font-weight: 900; }
.community-route.selected button { background: var(--route-color); color: #122027; }
.telemetry-consent { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 13px; padding: 12px 14px; border: 1px solid rgba(116,229,208,.2); border-radius: 7px; background: rgba(116,229,208,.045); }
.telemetry-consent b { color: #cce9e3; font-size: 10px; }
.telemetry-consent p { max-width: 600px; margin-top: 4px; color: #7f9498; font-size: 8px; line-height: 1.45; }
.telemetry-consent small { display: block; margin-top: 5px; color: #68b8ab; font-size: 7px; }
.telemetry-consent label { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; color: #a8d8ce; font-size: 9px; }
.telemetry-consent input { accent-color: #74e5d0; }

.mastery-panel { z-index: 39; align-items: flex-start; overflow-y: auto; }
.mastery-card { width: min(980px, 100%); margin: auto; border-top-color: #72e8f3; }
.mastery-card > header, .mastery-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mastery-meta { margin-top: 10px; color: #91a4aa; font-size: 10px; }
.mastery-meta b { color: #72e8f3; }
.mastery-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.mastery-item {
  --mastery-color: #72e8f3;
  display: grid; grid-template-columns: 38px 1fr; gap: 9px; padding: 11px;
  border: 1px solid rgba(204,221,224,.14); border-radius: 7px;
  background: linear-gradient(145deg, rgba(38,51,58,.95), rgba(16,25,31,.96));
}
.mastery-item.showcase { border-color: var(--mastery-color); box-shadow: inset 0 0 18px color-mix(in srgb, var(--mastery-color) 8%, transparent); }
.mastery-item.gold .mastery-icon { animation: mastery-pulse 1.8s ease-in-out infinite; }
.mastery-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--mastery-color); border-radius: 6px; color: var(--mastery-color); font-size: 11px; font-weight: 900; }
.mastery-copy h3 { font-size: 12px; }
.mastery-copy > span { color: #84979c; font-size: 8px; }
.mastery-ranks { display: flex; gap: 4px; margin: 7px 0; }
.mastery-ranks i { width: 25px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.1); }
.mastery-ranks i.active { background: var(--mastery-color); box-shadow: 0 0 8px color-mix(in srgb, var(--mastery-color) 45%, transparent); }
.mastery-next { min-height: 66px; color: #85969b; font-size: 8px; line-height: 1.4; }
.mastery-next b { display: block; color: #dbe5e5; font-size: 9px; }
.mastery-next small { display: block; color: #7e9297; font-size: 7px; }
.mastery-progress { display: block; height: 4px; margin: 6px 0 4px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.09); }
.mastery-progress i { display: block; height: 100%; border-radius: inherit; background: var(--mastery-color); box-shadow: 0 0 7px color-mix(in srgb, var(--mastery-color) 48%, transparent); }
.mastery-buttons { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin-top: 7px; }
.mastery-buttons button { padding: 7px 6px; border: 1px solid var(--mastery-color); border-radius: 4px; background: color-mix(in srgb, var(--mastery-color) 12%, #132028); color: #dce7e7; font-size: 8px; font-weight: 900; }
.mastery-buttons button:disabled { opacity: .42; cursor: default; }
.mastery-buttons button.select { border-color: rgba(211,226,228,.2); color: #91a4aa; }
@keyframes mastery-pulse { 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--mastery-color) 55%, transparent); transform: scale(1.04); } }

.archive-panel { z-index: 41; align-items: flex-start; overflow-y: auto; }
.archive-card { width: min(1080px, 100%); margin: auto; border-top-color: #8ed5aa; }
.archive-panel.season-frame .archive-card { border-color: rgba(244,184,78,.56); box-shadow: 0 0 0 2px rgba(244,184,78,.09), 0 18px 55px rgba(0,0,0,.48); }
.archive-meta, .archive-section > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.archive-card .eyebrow, .archive-section > header span { color: #8ed5aa; }
.archive-tab-nav button[aria-selected="true"] { border-color: #8ed5aa; background: rgba(142,213,170,.12); }
.archive-tab-panel { min-height: 180px; scroll-margin-top: 112px; }
.archive-overview-panel { padding-top: 1px; }
.archive-meta { margin-top: 10px; color: #90a3a7; font-size: 10px; }
.archive-meta b { color: #d8f2df; }
.archive-cloud { display: flex; align-items: center; gap: 7px; }
.archive-cloud span { color: #789397; font-size: 8px; }
.archive-cloud button { padding: 6px 9px; border: 1px solid rgba(142,213,170,.32); border-radius: 4px; background: rgba(142,213,170,.08); color: #cce8d7; font-size: 8px; font-weight: 900; }
.archive-cloud button:disabled { opacity: .5; }
.archive-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 13px 0 18px; }
.archive-summary div { padding: 10px; border: 1px solid rgba(142,213,170,.18); border-radius: 5px; background: rgba(142,213,170,.045); }
.archive-summary b { display: block; color: #d8f2df; font-size: 18px; }
.archive-summary span { color: #7f9498; font-size: 8px; }
.archive-section { margin-top: 18px; }
.archive-section > header { align-items: end; padding-bottom: 8px; border-bottom: 1px solid rgba(205,225,224,.12); }
.archive-section > header span { font-size: 7px; font-weight: 900; letter-spacing: 2px; }
.archive-section > header h3 { margin-top: 2px; font-size: 14px; }
.archive-section > header small { color: #71868b; font-size: 8px; text-align: right; }
.archive-season { margin-top: 9px; }
.season-hero { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 13px; border: 1px solid rgba(238,181,78,.25); border-radius: 7px; background: linear-gradient(135deg, rgba(98,72,35,.25), rgba(28,45,48,.45)); }
.season-hero span { color: #e2b75c; font-size: 7px; font-weight: 900; letter-spacing: 1.3px; }
.season-hero h4 { margin-top: 3px; color: #f2e3b4; font-size: 16px; }
.season-hero p { margin-top: 4px; color: #9bacaa; font-size: 8px; }
.season-hero strong { align-self: center; color: #ffd979; font-size: 22px; text-align: right; }
.season-hero strong small { display: block; color: #9dada9; font-size: 7px; font-weight: 600; }
.season-hero > i, .season-objectives i { display: block; height: 4px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.08); }
.season-hero > i { grid-column: 1 / -1; }
.season-hero em, .season-objectives em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d6953c, #ffe37e); }
.season-story { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr); gap: 12px; margin-top: 8px; padding: 10px 12px; border-left: 3px solid #d89b46; border-radius: 5px; background: linear-gradient(90deg, rgba(110,76,28,.17), rgba(20,30,34,.55)); }
.season-story-copy { display: grid; gap: 3px; }
.season-story-copy > span { color: #c99c4d; font-size: 7px; font-weight: 900; letter-spacing: 1px; }
.season-story-copy b { color: #f1ddaa; font-size: 11px; }
.season-story-copy p { color: #9caeac; font-size: 8px; line-height: 1.5; }
.season-story-copy small { color: #cfb36f; font-size: 7px; }
.season-story-track { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.season-story-track i { position: relative; display: grid; flex: 1; place-items: center; gap: 4px; color: #66787a; font-size: 6px; font-style: normal; }
.season-story-track i::before { position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: #344245; content: ''; }
.season-story-track i:first-child::before { display: none; }
.season-story-track i.unlocked::before { background: #b57d32; }
.season-story-track i em { position: relative; z-index: 1; width: 11px; height: 11px; border: 2px solid #455558; border-radius: 50%; background: #162024; }
.season-story-track i.unlocked { color: #dfbc6d; }
.season-story-track i.unlocked em { border-color: #edbd62; background: #a86f29; box-shadow: 0 0 9px rgba(232,171,76,.32); }
.season-directive-head { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: #efd18a; font-size: 9px; }
.season-directive-head span { color: #809397; font-size: 7px; text-align: right; }
.season-directives { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 7px; }
.season-directive { display: flex; min-height: 226px; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid rgba(231,173,76,.25); border-radius: 7px; background: linear-gradient(155deg, rgba(78,58,26,.17), rgba(16,25,30,.88)); }
.season-directive.complete { border-color: rgba(126,217,165,.45); box-shadow: inset 0 0 18px rgba(86,192,137,.06); }
.season-directive.locked { opacity: .42; filter: grayscale(.65); }
.season-directive > div:first-child { display: grid; gap: 2px; }
.season-directive > div:first-child span { color: #d7ae5d; font-size: 7px; letter-spacing: .7px; }
.season-directive > div:first-child b { font-size: 11px; }
.season-directive p { min-height: 30px; color: #9aabad; font-size: 8px; line-height: 1.45; }
.season-directive small { color: #d6c18d; font-size: 7px; }
.season-directive > em { min-height: 22px; color: #87a1a4; font-size: 7px; font-style: normal; }
.season-directive details { color: #8da0a2; font-size: 7px; }
.season-directive details summary { color: #d4b96f; cursor: pointer; font-weight: 800; }
.season-directive details span { display: block; margin-top: 4px; line-height: 1.45; }
.season-directive > i { color: #d8bd76; font-size: 7px; font-style: normal; }
.season-directive-actions { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin-top: auto; }
.season-directive-actions button, .season-rewards button { padding: 6px; border: 1px solid rgba(231,173,76,.34); border-radius: 4px; background: rgba(231,173,76,.09); color: #f0d99f; font-size: 7px; font-weight: 900; }
.season-directive-actions button:disabled, .season-rewards button:disabled { opacity: .4; cursor: default; }
.season-objectives { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 7px; }
.season-objectives article { padding: 9px; border: 1px solid rgba(205,225,224,.12); border-radius: 6px; background: rgba(255,255,255,.025); }
.season-objectives article.complete { border-color: rgba(142,213,170,.38); background: rgba(142,213,170,.07); }
.season-objectives b, .season-objectives span, .season-objectives small { display: block; }
.season-objectives b { font-size: 9px; }
.season-objectives span { min-height: 24px; margin: 4px 0; color: #7f9598; font-size: 7px; }
.season-objectives small { margin-top: 4px; color: #ceb875; font-size: 7px; text-align: right; }
.season-rewards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.season-rewards article { display: grid; gap: 5px; padding: 7px; border: 1px dashed rgba(205,225,224,.14); border-radius: 5px; color: #77898c; font-size: 7px; text-align: center; }
.season-rewards article.unlocked { border-style: solid; border-color: rgba(255,217,121,.36); color: #f3d986; background: rgba(255,217,121,.06); }
.season-rewards article.claimed { border-color: rgba(126,217,165,.35); }
.season-rewards b { display: block; margin-bottom: 2px; font-size: 9px; }
.season-rewards article > div { display: grid; gap: 3px; }
.season-rewards button.equipped { border-color: rgba(126,217,165,.58); color: #9be0b8; background: rgba(76,160,113,.12); }
.season-reward-preview { display: flex; align-items: center; gap: 4px; color: #788a8d; text-align: left; }
.season-reward-preview i { display: grid; width: 20px; height: 20px; flex: none; place-items: center; border: 1px solid color-mix(in srgb, var(--preview) 42%, transparent); border-radius: 4px; background: color-mix(in srgb, var(--preview) 8%, transparent); color: var(--preview); font-size: 6px; font-style: normal; font-weight: 900; }
.season-empty { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid rgba(205,225,224,.12); border-radius: 6px; }
.season-empty span { color: #7f9498; font-size: 8px; }
.archive-infected { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.archive-infected-item { --archive-color:#8ed5aa; min-height: 138px; padding: 10px; border: 1px solid rgba(205,225,224,.12); border-left: 3px solid var(--archive-color); border-radius: 4px 8px 8px 4px; background: linear-gradient(145deg, rgba(36,49,53,.94), rgba(15,24,29,.96)); }
.archive-infected-item.locked { opacity: .48; filter: grayscale(.8); border-left-color: #607177; }
.archive-infected-item .archive-id { display: flex; justify-content: space-between; color: var(--archive-color); font-size: 7px; font-weight: 900; letter-spacing: 1px; }
.archive-infected-item h4 { margin-top: 5px; font-size: 12px; }
.archive-infected-item p { margin-top: 6px; color: #aababa; font-size: 8px; line-height: 1.4; }
.archive-infected-item p b { color: #d8e3e2; }
.archive-kills { display: block; margin-top: 8px; color: var(--archive-color); font-size: 8px; }
.archive-teaching-replay-btn { width: 100%; min-height: var(--control-min-touch); margin-top: 9px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--archive-color) 42%, transparent); border-radius: 5px; background: color-mix(in srgb, var(--archive-color) 9%, #101b20); color: #dce8e6; font-size: 8px; font-weight: 900; }
.archive-teaching-replay-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--archive-color) 16%, #101b20); }
.archive-teaching-replay { margin-top: 7px; padding: 2px 9px 8px; border-left: 2px solid var(--archive-color); background: rgba(4,12,16,.42); overflow-wrap: anywhere; }
.archive-teaching-replay[hidden] { display: none; }
.archive-teaching-replay p { color: #c1d0d0; }
.archive-teaching-replay p b { color: var(--archive-color); }
.archive-medals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.archive-medal { min-height: 168px; padding: 10px; border: 1px solid rgba(205,225,224,.12); border-radius: 8px; background: rgba(255,255,255,.025); text-align: center; }
.archive-medal.unlocked { border-color: rgba(255,207,100,.42); background: radial-gradient(circle at 50% 0, rgba(255,197,80,.12), rgba(255,255,255,.025) 58%); }
.archive-medal .medal-icon { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 7px; border: 1px solid #63777c; border-radius: 50%; color: #71888c; font-size: 13px; }
.archive-medal.unlocked .medal-icon { border-color: #ffd06d; color: #ffd06d; box-shadow: 0 0 13px rgba(255,194,72,.16); }
.archive-medal h4 { font-size: 10px; }
.archive-medal p { min-height: 30px; margin-top: 4px; color: #7e9195; font-size: 7px; line-height: 1.4; }
.archive-medal small { display: block; margin-top: 6px; color: #9eb0b2; font-size: 7px; }
.archive-medal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 7px; }
.archive-medal button { width: 100%; padding: 6px 4px; border: 1px solid rgba(255,208,109,.36); border-radius: 3px; background: rgba(255,208,109,.08); color: #e9d7a5; font-size: 7px; font-weight: 900; }
.archive-medal button.active { background: #ffd06d; color: #202015; }
.archive-medal button.featured { border-color: #8ed5aa; background: rgba(142,213,170,.16); color: #bce6cb; }
.archive-medal button:disabled { opacity: .38; }
.build-share { padding: 12px; border: 1px solid rgba(101,215,218,.18); border-radius: 7px; background: rgba(42,68,72,.12); }
.build-share > p { margin-top: 10px; color: #a3b5b6; font-size: 9px; line-height: 1.5; }
.build-share code { display: block; max-height: 64px; margin-top: 8px; padding: 9px; overflow: auto; border-radius: 4px; background: #091116; color: #90d9c0; font: 7px/1.45 ui-monospace, monospace; overflow-wrap: anywhere; }
.build-share .archive-import { color: #f3c477; }
.archive-build-actions { display: flex; gap: 7px; margin-top: 9px; }
.archive-build-actions button { padding: 8px 11px; border: 1px solid rgba(142,213,170,.38); border-radius: 4px; background: rgba(142,213,170,.09); color: #d6e8df; font-size: 8px; font-weight: 900; }

.stage-panel { z-index: 36; align-items: flex-start; overflow-y: auto; }
.stage-card { width: min(860px, 100%); margin: auto; }
.stage-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stage-progress { margin: 10px 0 14px; color: var(--muted); font-size: 10px; }
.stage-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stage-item {
  min-height: 112px;
  padding: 11px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--stage-color, var(--acid));
  border-radius: 4px 4px 10px 10px;
  background: rgba(255,255,255,.035);
  text-align: left;
}
.stage-item span { color: var(--stage-color, var(--acid)); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.stage-item b { display: block; margin-top: 4px; font-size: 13px; }
.stage-item p { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.stage-item small { display: block; margin-top: 8px; color: #c8d5d6; font-size: 8px; }
.stage-item.complete::after { content: '已完成'; float: right; margin-top: -13px; color: var(--acid); font-size: 8px; }
.stage-item.locked { opacity: .42; filter: grayscale(.72); cursor: not-allowed; }
.stage-item[data-action-state]::after { display: none; }
.stage-item[data-action-state="recommended"] { background: linear-gradient(145deg, rgba(185,242,74,.1), rgba(255,255,255,.035)); }
.stage-item .action-state-marker { display: flex; margin-top: 10px; }
.stage-item .action-state-marker i { flex: none; }

.tutorial-tip {
  position: fixed;
  z-index: 24;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  width: min(420px, calc(100vw - 28px));
  padding: 13px 82px 13px 50px;
  transform: translateX(-50%);
  border: 1px solid rgba(185,242,74,.42);
  border-left: 4px solid var(--acid);
  border-radius: 4px 12px 12px 4px;
  background: rgba(8,16,21,.94);
  box-shadow: 0 16px 48px rgba(0,0,0,.48);
}
.tutorial-tip::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--acid);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(8,16,21,.94);
}
.tutorial-tip span { color: var(--acid); font-size: 8px; font-weight: 900; letter-spacing: 2px; }
.tutorial-tip .tutorial-step-line { display: flex; align-items: center; gap: 5px; }
.tutorial-tip .tutorial-step-line > i { font-size: 9px; font-style: normal; }
.tutorial-tip b { display: block; margin-top: 3px; font-size: 14px; }
.tutorial-tip p { margin-top: 4px; color: #aabcc1; font-size: 10px; line-height: 1.5; }
.tutorial-tip .tutorial-touch-hint { display: block; margin-top: 5px; color: #d4e3e4; font-size: 9px; font-weight: 800; letter-spacing: .4px; }
.tutorial-tip button { position: absolute; right: 10px; top: 10px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 8px; }

.story-scrim {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgba(1, 6, 9, .68);
  backdrop-filter: blur(1.5px) saturate(.72);
  cursor: default;
  touch-action: none;
}
.story-dialogue {
  --story-color: var(--acid);
  position: fixed;
  z-index: 61;
  left: 50%;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 82px));
  width: min(520px, calc(100vw - 28px));
  padding: 10px 12px 11px;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--story-color) 42%, transparent);
  border-left: 4px solid var(--story-color);
  border-radius: 5px 13px 13px 5px;
  background: linear-gradient(108deg, rgba(7,14,18,.97), rgba(12,23,28,.91));
  box-shadow: 0 18px 50px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.035);
  animation: story-in .2s ease-out;
  pointer-events: auto;
}
.story-channel { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.story-channel span { color: var(--story-color); font-size: 10px; font-weight: 900; letter-spacing: 1.7px; text-transform: uppercase; }
.story-channel small { color: #71878d; font-size: 10px; }
.story-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; }
.story-message > i {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--story-color); border-radius: 50%;
  background: color-mix(in srgb, var(--story-color) 11%, #10191e); color: var(--story-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--story-color) 16%, transparent);
  font-size: 10px; font-style: normal; font-weight: 950;
}
.story-message div { min-width: 0; }
.story-message span { color: #768b91; font-size: 9px; letter-spacing: .7px; }
.story-message b { margin-left: 6px; color: #dce8e8; font-size: 12px; }
.story-message p { margin-top: 3px; color: #eef4f3; font-size: 14px; line-height: 1.52; }
.story-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 7px; pointer-events: auto; }
.story-actions button { min-height: 32px; padding: 6px 10px; border: 0; background: transparent; color: #74898e; font-size: 10px; }
.story-actions #story-next { color: var(--story-color); font-weight: 850; }
.world-intro[hidden] { display: none; }
.world-intro { --intro-color: #ff795f; position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; }
.world-intro-backdrop { position: absolute; inset: 0; background: rgba(1,5,8,.88); backdrop-filter: blur(4px) saturate(.6); }
.world-intro-card {
  position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); width: min(720px, 100%);
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--intro-color) 42%, #33464d);
  border-top: 3px solid var(--intro-color); border-radius: 5px 5px 14px 14px;
  background: linear-gradient(145deg, rgba(14,25,31,.99), rgba(5,11,15,.99));
  box-shadow: 0 30px 90px rgba(0,0,0,.68), 0 0 42px color-mix(in srgb, var(--intro-color) 10%, transparent);
  animation: intro-card-in .28s cubic-bezier(.2,.78,.24,1);
}
.world-intro-card > header { grid-column: 1 / -1; display: flex; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid rgba(210,230,232,.1); }
.world-intro-card > header span { color: var(--intro-color); font-size: 8px; font-weight: 950; letter-spacing: 1.8px; }
.world-intro-card > header small { color: #71878d; font-size: 8px; }
.world-intro-visual {
  position: relative; display: grid; place-items: center; min-height: 218px; overflow: hidden;
  border-right: 1px solid rgba(210,230,232,.1); background:
    linear-gradient(rgba(110,149,157,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110,149,157,.08) 1px, transparent 1px),
    radial-gradient(circle, color-mix(in srgb, var(--intro-color) 18%, transparent), rgba(6,14,18,.96) 68%);
  background-size: 24px 24px, 24px 24px, auto;
}
.world-intro-visual::before, .world-intro-visual::after { position: absolute; border: 1px solid color-mix(in srgb, var(--intro-color) 38%, transparent); border-radius: 50%; content: ''; }
.world-intro-visual::before { width: 118px; height: 118px; }
.world-intro-visual::after { width: 72px; height: 72px; box-shadow: 0 0 24px color-mix(in srgb, var(--intro-color) 18%, transparent); }
.world-intro-visual i { position: absolute; width: 58px; height: 1px; background: var(--intro-color); opacity: .72; transform-origin: 100% 50%; animation: intro-scan 3.2s linear infinite; }
.world-intro-visual b { position: relative; z-index: 1; color: #edf4f2; font-size: 26px; letter-spacing: 4px; text-shadow: 0 0 18px var(--intro-color); }
.world-intro-visual em { position: absolute; right: 8px; bottom: 8px; left: 8px; color: color-mix(in srgb, var(--intro-color) 72%, #d8e3e1); font-size: 7px; font-style: normal; text-align: center; }
.world-intro-copy { align-self: center; padding: 24px 25px; }
.world-intro-copy p { color: #778c91; font-size: 8px; font-weight: 900; letter-spacing: 1.8px; }
.world-intro-copy h2 { margin-top: 8px; color: #edf4f2; font-size: clamp(20px, 3vw, 29px); line-height: 1.18; }
.world-intro-copy div { margin-top: 13px; color: #aebec0; font-size: 11px; line-height: 1.75; }
.world-intro-card > footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 13px; border-top: 1px solid rgba(210,230,232,.1); }
.world-intro-card > footer button { padding: 8px 12px; border: 1px solid rgba(196,218,222,.18); border-radius: 4px; background: rgba(255,255,255,.04); color: #83969a; font-size: 9px; }
.world-intro-card > footer #world-intro-next { border-color: color-mix(in srgb, var(--intro-color) 62%, transparent); background: color-mix(in srgb, var(--intro-color) 13%, #142027); color: #eef5ef; font-weight: 900; }
@keyframes intro-card-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes intro-scan { to { transform: rotate(360deg); } }
.mission-debrief {
  margin: 12px 0 6px; padding: 10px 12px; border: 1px solid rgba(185,242,74,.18); border-left: 3px solid var(--acid);
  border-radius: 4px 8px 8px 4px; background: rgba(185,242,74,.035); text-align: left;
}
.mission-debrief > span { color: var(--acid); font-size: 10px; font-weight: 900; letter-spacing: 1.7px; }
.mission-debrief-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; margin-top: 7px; color: #b9c9cb; font-size: 12px; line-height: 1.45; }
.mission-debrief-line b { color: var(--speaker-color, #dce8e8); white-space: nowrap; }
@keyframes story-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.over-panel { background: radial-gradient(circle at 50% 28%, rgba(93,48,43,.36), rgba(4,9,12,.9) 64%); }
.report-card { border-top-color: var(--red); text-align: center; }
.report-card .eyebrow { color: var(--red); }
.over-panel[data-outcome="success"] { background: radial-gradient(circle at 50% 28%, rgba(93,128,69,.26), rgba(4,9,12,.9) 64%); }
.over-panel[data-outcome="success"] .report-card { border-top-color: var(--acid); }
.over-panel[data-outcome="success"] .report-card .eyebrow { color: var(--acid); }
.report-card h2 { font-size: 34px; }
#over-summary { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 6px; }
.report-stats div { padding: 11px 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.035); }
.report-stats b { display: block; color: var(--orange); font-size: 20px; }
.report-stats span { color: var(--muted); font-size: 8px; }
.report-card .primary-actions { justify-content: center; }

.story-paused .hud, .story-paused .objective-hud, .story-paused .agent-hud,
.story-paused .combo, .story-paused .buff-status, .story-paused .armory-fab,
.story-paused .airstrike, .story-paused .agent-skill, .story-paused .primary-switch, .story-paused .multifire-toggle { filter: brightness(.5) saturate(.62); }
.in-menu .hud, .in-menu .combo, .in-menu .buff-status, .in-menu .objective-hud, .in-menu .agent-hud, .in-menu .armory-fab, .in-menu .airstrike, .in-menu .agent-skill, .in-menu .primary-switch, .in-menu .multifire-toggle, .in-menu .damage-feedback, .in-menu .critical-health, .in-menu .story-dialogue, .in-menu .story-scrim { display: none !important; }

@media (min-width: 941px) {
  .home-returning .start-command { padding: 14px; }
  .home-returning .primary-actions { gap: 8px; margin-top: 10px; }
  .home-returning .home-guidance { min-height: 48px; padding: 6px 9px; }
  .start-command .action-group button { padding-right: 86px; }
  .start-command .action-group .action-state-marker {
    position: absolute;
    top: 50%;
    right: 10px;
    margin: 0;
    transform: translateY(-50%);
  }
  .start-command #begin { padding-right: 94px; padding-left: 94px; }
  .start-command #begin .action-state-marker { position: absolute; top: 50%; right: 12px; margin: 0; transform: translateY(-50%); }
}

@media (max-width: 940px) and (min-width: 561px) {
  .start-panel { overflow-y: auto; }
  .start-shell { grid-template-columns: minmax(300px, .82fr) minmax(380px, 1.18fr); gap: 16px; width: calc(100% - 28px); }
  .start-copy { padding: 20px; }
  .start-copy h1 { font-size: clamp(42px, 8vw, 62px); }
  .start-copy ul { margin: 16px 0 13px; }
  .start-command { padding: 15px; }
  .home-returning .start-shell { grid-template-columns: minmax(230px, .68fr) minmax(390px, 1.32fr); }
  .home-returning .start-copy { padding: 16px; }
  .home-returning .start-copy h1 { font-size: clamp(36px, 5.5vw, 46px); }
  .home-returning .howto { display: none; }
  .primary-actions { gap: 7px; }
  .primary-actions button { padding: 9px 10px; font-size: var(--font-control); }
  .agent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .ui-status { bottom: max(10px, calc(env(safe-area-inset-bottom) + 8px)); min-height: 56px; padding: 10px 12px; }
  .ui-status button { min-width: var(--control-min-touch); min-height: var(--control-min-touch); }
  .panel button, .start-panel button { min-height: var(--control-min-touch); }
  .panel .close { min-width: var(--control-min-touch); width: var(--control-min-touch); height: var(--control-min-touch); }
  .hud {
    top: max(8px, calc(env(safe-area-inset-top) + 8px));
    width: calc(100vw - 18px);
    padding: 9px 10px 10px;
  }
  .hud-line { gap: 8px; margin-bottom: 7px; }
  .mission, .score { gap: 7px; }
  .mission strong { font-size: 15px; }
  .mission span, .score span, .score b { font-size: 12px; }
  .stat { grid-template-columns: 32px 76px minmax(0, 1fr); gap: 6px; }
  .stat > span, .stat > b { font-size: 12px; }
  .track { height: 9px; }
  #zone { display: none; }
  .start-panel {
    align-items: flex-end;
    padding:
      max(12px, env(safe-area-inset-top))
      max(var(--mobile-content-gutter), env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(var(--mobile-content-gutter), env(safe-area-inset-left));
    background:
      linear-gradient(0deg, rgba(3,8,11,.94) 0%, rgba(3,8,11,.62) 48%, rgba(3,8,11,.12) 82%),
      linear-gradient(90deg, rgba(3,8,11,.35), rgba(3,8,11,.08)),
      url('./assets/images/menu-quarantine-city-v1.png') 72% center / cover no-repeat,
      #071014;
  }
  .start-panel { overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .start-shell { grid-template-columns: 1fr; gap: 8px; width: 100%; margin: auto 0 0; padding: min(14vh, 96px) 0 0; }
  .start-copy { padding: 14px 13px; }
  .start-command { margin: 0; padding: 13px; }
  .start-copy h1 { font-size: clamp(38px, 12.2vw, 47px); letter-spacing: 4px; }
  .tagline { margin-top: 6px; font-size: 12px; }
  .start-copy ul { display: none; }
  .howto { margin-top: 9px; color: #9aadb1; font-size: 12px; line-height: 1.45; }
  .command-heading { padding-bottom: 10px; }
  .command-heading span { font-size: 11px; }
  .command-heading b { font-size: 20px; }
  .command-heading small { font-size: 11px; }
  .profile-chip { min-height: var(--control-min-touch); padding: 8px 10px; }
  .profile-chip span, .profile-chip b, .profile-chip i { font-size: 12px; }
  .home-guidance { min-height: 58px; padding: 9px 10px; }
  .home-guidance b, .home-guidance p { font-size: 12px; }
  .home-priority-actions > header { min-height: 24px; }
  .home-priority-grid button { min-height: 58px; }
  .home-priority-grid button > [data-action-title] { font-size: 13px; }
  .home-priority-grid button > [data-action-detail], .primary-actions .action-state-marker { font-size: 11px; }
  .home-returning .start-shell { grid-template-columns: 1fr; gap: 7px; padding-top: min(7vh, 48px); }
  .home-returning .start-copy { padding: 10px 12px; }
  .home-returning .start-copy h1 { font-size: clamp(30px, 9.8vw, 38px); letter-spacing: 3px; }
  .home-returning .tagline { margin-top: 3px; font-size: 11px; }
  .home-returning .howto { display: none; }
  .home-returning .home-priority-grid { grid-template-columns: 1fr; }
  .home-returning .home-priority-grid button { min-height: 58px; }
  .panel-card { padding: 16px 13px; }
  .panel-sticky-head { margin: -16px -13px 0; padding: 16px 13px 10px; }
  .panel-sticky-head > header h2 { font-size: 22px; letter-spacing: 1px; }
  .panel-tab-nav { gap: 5px; margin-top: 10px; }
  .panel-tab-nav button { min-height: var(--control-min-touch); padding: 6px 4px; font-size: 12px; }
  .panel-tab-nav button span { display: block; margin-bottom: 3px; font-size: 11px; }
  .panel-tab-nav button b { margin: 0; font-size: 12px; }
  .agent-tab-nav { display: grid; }
  .upgrade-card { padding: 11px; }
  .upgrade-card { grid-template-columns: 52px minmax(0, 1fr); gap: 9px; }
  .upgrade-art { width: 52px; height: 52px; }
  .primary-actions { gap: 12px; margin-top: 12px; }
  .primary-actions button { min-height: var(--control-min-touch); padding: 9px 10px; font-size: var(--font-control); }
  .primary-actions .primary { min-height: var(--control-primary-touch); }
  .action-group { gap: 7px; }
  .action-group > header { min-height: 24px; }
  .action-grid { gap: 8px; }
  .contract-action b, .redzone-action b, .season-action b,
  .mastery-action b, .agent-action b, .community-action b, .archive-action b { font-size: var(--font-micro); }
  .combat-action-rail {
    position: fixed;
    z-index: 12;
    right: max(99px, calc(env(safe-area-inset-right) + 99px));
    bottom: max(10px, calc(env(safe-area-inset-bottom) + 8px));
    left: max(9px, calc(env(safe-area-inset-left) + 9px));
    display: grid;
    grid-template-columns: 56px minmax(0, .86fr) minmax(0, 1fr) 50px;
    gap: var(--hud-action-gap);
    align-items: end;
  }
  .combat-action-rail .combat-control { position: relative; inset: auto; bottom: auto; width: 100%; }
  .airstrike { width: 56px; height: 56px; }
  .airstrike > span { width: 43px; height: 43px; }
  .airstrike b { font-size: 12px; }
  .agent-skill { min-width: 0; min-height: var(--control-combat-touch); padding: 6px 8px; }
  .agent-skill b { max-width: 65px; font-size: 12px; }
  .agent-skill em { font-size: 12px; }
  .primary-switch { display: grid; min-width: 0; min-height: var(--control-combat-touch); align-content: center; gap: 1px; padding: 5px 7px; }
  .primary-switch b { max-width: 100%; font-size: 12px; }
  .primary-switch em { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .multifire-toggle { min-width: 0; min-height: var(--control-combat-touch); padding: 5px 5px; text-align: center; }
  .multifire-toggle small { font-size: 8px; }
  .multifire-toggle b { font-size: 11px; }
  .multifire-toggle em { font-size: 9px; }
  .armory-fab { right: max(9px, calc(env(safe-area-inset-right) + 9px)); bottom: max(10px, calc(env(safe-area-inset-bottom) + 8px)); width: 82px; min-height: var(--control-min-touch); padding: 8px 6px; font-size: 12px; }
  .sound-toggle { right: 9px; bottom: max(62px, calc(env(safe-area-inset-bottom) + 60px)); min-height: var(--control-min-touch); font-size: 12px; }
  .sound-settings { right: 9px; bottom: max(112px, calc(env(safe-area-inset-bottom) + 110px)); width: min(250px, calc(100vw - 18px)); }
  .in-menu .sound-toggle {
    top: max(12px, calc(env(safe-area-inset-top) + 10px));
    right: max(9px, calc(env(safe-area-inset-right) + 9px));
    bottom: auto;
  }
  .in-menu .sound-settings {
    top: max(64px, calc(env(safe-area-inset-top) + 62px));
    right: max(9px, calc(env(safe-area-inset-right) + 9px));
    bottom: auto;
  }
  .sound-settings label, .sound-settings small, .sound-settings button { font-size: 12px; }
  .sound-settings input[type="range"] { min-height: var(--control-min-touch); margin: 0; }
  .sound-comfort label { min-height: var(--control-min-touch); font-size: 12px; }
  .objective-hud {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--hud-top-reserve));
    left: var(--guidance-safe-left);
    min-width: min(188px, calc(100vw - 110px));
    max-width: calc(100vw - 110px - env(safe-area-inset-left));
    transform: none;
  }
  .objective-hud span { font-size: 11px; }
  .objective-hud b { font-size: 13px; }
  .objective-hud small { font-size: 12px; }
  .objective-rules span { font-size: 11px; }
  .combo { top: calc(max(8px, env(safe-area-inset-top)) + 190px); right: 9px; left: auto; }
  .combo span, .combo small { font-size: 12px; }
  .buff-status {
    top: calc(max(8px, env(safe-area-inset-top)) + 190px);
    right: 105px;
    left: 9px;
    flex-wrap: wrap;
    transform: none;
  }
  .buff-status span { min-width: 0; font-size: 12px; }
  .stage-list { grid-template-columns: 1fr; }
  .stage-progress { font-size: 12px; }
  .stage-item { min-height: 136px; padding: 14px; }
  .stage-item span, .stage-item small { font-size: 11px; }
  .stage-item b { font-size: 15px; }
  .stage-item p { font-size: 12px; line-height: 1.5; }
  .stage-item.complete::after { font-size: 11px; }
  .contract-list { grid-template-columns: 1fr; }
  .redzone-list { grid-template-columns: 1fr; }
  .redzone-item { min-height: 0; }
  .redzone-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .agent-summary { margin: 13px 0; color: #afbec1; font-size: 14px; line-height: 1.55; }
  .agent-list { grid-template-columns: 1fr; }
  .agent-list[data-mobile-single="true"] .agent-item { min-height: 0; }
  .agent-item { padding: 13px; }
  .agent-portrait { height: 148px; }
  .agent-portrait span { font-size: 11px; }
  .agent-mark small, .agent-copy > span { font-size: 12px; }
  .agent-copy h3 { font-size: 18px; }
  .agent-copy ul { min-height: 0; margin: 14px 0; }
  .agent-copy li { font-size: 14px; line-height: 1.45; }
  .agent-copy button { min-height: 48px; font-size: 14px; }
  .community-routes { grid-template-columns: 1fr; }
  .community-route { min-height: 0; }
  .telemetry-consent { align-items: flex-start; flex-direction: column; }
  .mastery-list { grid-template-columns: 1fr; }
  .archive-tab-panel { min-height: 300px; }
  .archive-meta, .archive-section > header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .archive-meta { margin-top: 13px; font-size: 13px; line-height: 1.45; }
  .archive-summary { grid-template-columns: repeat(2, 1fr); }
  .archive-summary span { font-size: 12px; }
  .archive-cloud { width: 100%; justify-content: space-between; }
  .archive-cloud span, .archive-cloud button { font-size: 12px; }
  .archive-section { margin-top: 14px; }
  .archive-section > header span { font-size: 11px; }
  .archive-section > header h3 { font-size: 17px; }
  .archive-section > header small { font-size: 12px; line-height: 1.45; }
  .season-hero { grid-template-columns: 1fr; }
  .season-hero strong { text-align: left; }
  .season-hero span, .season-hero strong small { font-size: 11px; }
  .season-hero h4 { font-size: 18px; }
  .season-hero p { font-size: 14px; line-height: 1.5; }
  .season-story { grid-template-columns: 1fr; }
  .season-story-copy > span, .season-story-copy small { font-size: 11px; }
  .season-story-copy b { font-size: 14px; }
  .season-story-copy p { font-size: 14px; line-height: 1.5; }
  .season-story-track i { font-size: 11px; }
  .season-objectives { grid-template-columns: 1fr 1fr; }
  .season-directives { grid-template-columns: 1fr; }
  .season-directive { min-height: 0; }
  .season-directive-head { align-items: flex-start; flex-direction: column; }
  .season-directive-head { font-size: 14px; }
  .season-directive-head span { font-size: 12px; text-align: left; }
  .season-directive > div:first-child span { font-size: 12px; }
  .season-directive > div:first-child b { font-size: 14px; }
  .season-directive p { min-height: 0; font-size: 14px; }
  .season-directive small, .season-directive > em, .season-directive details, .season-directive > i { font-size: 12px; }
  .season-directive-actions button, .season-rewards button { min-height: var(--control-min-touch); font-size: 12px; }
  .season-objectives b { font-size: 14px; }
  .season-objectives span { font-size: 13px; }
  .season-objectives small { font-size: 12px; }
  .season-rewards { grid-template-columns: 1fr 1fr; }
  .season-rewards article { font-size: 12px; }
  .season-rewards b { font-size: 14px; }
  .archive-infected { grid-template-columns: 1fr; }
  .archive-infected-item { min-height: 0; padding: 14px; }
  .archive-infected-item .archive-id { font-size: 11px; }
  .archive-infected-item h4 { font-size: 16px; }
  .archive-infected-item p { font-size: 14px; line-height: 1.5; }
  .archive-kills { font-size: 12px; }
  .archive-teaching-replay-btn { min-height: var(--control-min-touch); font-size: 13px; }
  .archive-teaching-replay { padding: 2px 11px 9px; }
  .archive-medals { grid-template-columns: 1fr; }
  .archive-medal { min-height: 0; padding: 14px; }
  .archive-medal h4 { font-size: 15px; }
  .archive-medal p { min-height: 0; font-size: 14px; line-height: 1.5; }
  .archive-medal small { font-size: 12px; }
  .archive-medal button { min-height: var(--control-min-touch); font-size: 12px; }
  .archive-section > header small { text-align: left; }
  .archive-build-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .build-share > p { font-size: 14px; }
  .build-share code { max-height: 128px; font-size: 11px; }
  .archive-build-actions button { min-height: var(--control-min-touch); font-size: 12px; }
  .agent-hud { top: calc(max(8px, env(safe-area-inset-top)) + var(--hud-top-reserve)); right: max(9px, calc(env(safe-area-inset-right) + 9px)); min-height: 44px; padding: 5px 7px; }
  .agent-hud i { width: 30px; height: 30px; font-size: 11px; }
  .agent-hud span { display: none; }
  .agent-hud b { font-size: 12px; }
  .agent-hud small { display: none; }
  .contract-item { min-height: 0; }
  .contract-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .tutorial-tip {
    right: var(--guidance-safe-right);
    bottom: max(var(--hud-bottom-reserve), calc(env(safe-area-inset-bottom) + var(--hud-bottom-reserve)));
    left: var(--guidance-safe-left);
    width: auto;
    padding: 12px 82px 12px 47px;
    transform: none;
  }
  .tutorial-tip span { font-size: 11px; }
  .tutorial-tip b { font-size: 15px; }
  .tutorial-tip p { font-size: 12px; }
  .tutorial-tip .tutorial-touch-hint { font-size: 11px; }
  .tutorial-tip button { min-width: var(--control-min-touch); min-height: var(--control-min-touch); padding: 7px; font-size: 12px; }
  .story-dialogue { bottom: max(78px, calc(env(safe-area-inset-bottom) + 72px)); width: calc(100vw - 18px); padding: 9px 10px; }
  .story-channel span, .story-channel small { font-size: 11px; }
  .story-message { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
  .story-message > i { width: 30px; height: 30px; }
  .story-message span { font-size: 11px; }
  .story-message b { font-size: 12px; }
  .story-message p { font-size: 13px; }
  .story-actions { margin-top: 4px; }
  .story-actions button { min-height: var(--control-min-touch); padding: 7px 10px; font-size: 12px; }
  .world-intro { padding: 12px; }
  .world-intro-card { grid-template-columns: 1fr; width: min(430px, 100%); }
  .world-intro-card > header span, .world-intro-card > header small { font-size: 11px; }
  .world-intro-visual { min-height: 112px; border-right: 0; border-bottom: 1px solid rgba(210,230,232,.1); }
  .world-intro-visual::before { width: 84px; height: 84px; }
  .world-intro-visual::after { width: 50px; height: 50px; }
  .world-intro-visual i { width: 41px; }
  .world-intro-visual b { font-size: 21px; }
  .world-intro-visual em { font-size: 11px; }
  .world-intro-copy { padding: 18px 17px; }
  .world-intro-copy h2 { font-size: 20px; }
  .world-intro-copy p { font-size: 11px; }
  .world-intro-copy div { font-size: 13px; }
  .world-intro-card > footer button { min-height: var(--control-min-touch); font-size: 12px; }
  .mission-debrief > span { font-size: 11px; }
  .mission-debrief-line { grid-template-columns: 1fr; gap: 1px; font-size: 12px; }
  .report-stats span { font-size: 11px; }
}

@media (max-height: 690px) {
  .start-copy { padding-top: 14px; padding-bottom: 14px; }
  .start-copy ul { margin: 10px 0; gap: 5px; }
  .tagline { margin-top: 5px; }
  .upgrade-panel .panel-card { padding-top: 12px; padding-bottom: 10px; }
  .upgrade-card { padding-top: 8px; padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .damage-feedback.critical { opacity: .28; }
  .ui-status-indicator { animation: none; border-color: var(--zz-system-cyan); }
}
.qa-reduced-motion *, .qa-reduced-motion *::before, .qa-reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.qa-reduced-motion .action-state-marker i { animation: none !important; }
.qa-grayscale canvas { filter: grayscale(1) contrast(1.08); }
.qa-mobile-long-run-report {
  position: fixed;
  z-index: 30;
  top: calc(max(8px, env(safe-area-inset-top)) + 126px);
  left: max(9px, env(safe-area-inset-left));
  max-width: calc(100vw - 18px - env(safe-area-inset-left) - env(safe-area-inset-right));
  padding: 5px 7px;
  pointer-events: none;
  border: 1px solid rgba(185,242,74,.5);
  border-radius: 4px;
  background: rgba(4,10,13,.9);
  color: #d9e8e8;
  font: 800 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 0 5px 18px rgba(0,0,0,.35);
}

/* V23 · Field dossier app shell ------------------------------------------- */
body {
  background:
    linear-gradient(rgba(200, 181, 143, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 181, 143, .018) 1px, transparent 1px),
    radial-gradient(circle at 50% -14%, rgba(112, 92, 62, .12), transparent 42%),
    var(--fd-night-deep);
  background-size: 64px 64px, 64px 64px, auto, auto;
}

:where(.panel-card, .start-command, .field-card) {
  border-color: var(--fd-line);
  border-top-color: var(--fd-line-strong);
  background:
    linear-gradient(155deg, rgba(31, 28, 21, .99), rgba(17, 16, 12, .99));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .5), inset 0 1px rgba(239, 224, 191, .025);
}

.panel {
  background: rgba(11, 10, 8, .82);
  backdrop-filter: blur(6px) saturate(.72);
}

.panel-card {
  border-top-width: 1px;
  border-radius: 6px;
}

.eyebrow {
  color: var(--fd-paper-muted);
  font-size: 12px;
  letter-spacing: 1.4px;
}

.panel h2 { color: var(--fd-paper); }

.primary {
  border: 1px solid #f09a62;
  background: linear-gradient(180deg, #e9864b, var(--fd-orange));
  color: #18110b;
  box-shadow: 0 4px 0 var(--fd-orange-deep);
}

.secondary {
  border-color: var(--fd-line);
  background: linear-gradient(180deg, rgba(52, 48, 38, .96), rgba(34, 31, 25, .96));
  color: var(--fd-paper);
  box-shadow: 0 3px 0 #0f0d0a;
}

.start-panel {
  isolation: isolate;
  background:
    linear-gradient(0deg, rgba(14, 12, 9, .97) 0%, rgba(19, 17, 13, .72) 56%, rgba(23, 20, 15, .34) 100%),
    linear-gradient(90deg, rgba(41, 35, 24, .46), rgba(11, 10, 8, .08)),
    url('./assets/images/menu-quarantine-city-v1.png') 68% center / cover no-repeat,
    var(--fd-night);
}

.start-panel::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .23;
  background-image:
    linear-gradient(rgba(225, 208, 170, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(225, 208, 170, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(430px, 100%);
  height: min(860px, 100%);
  min-height: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--fd-line);
  border-radius: 7px;
  background: rgba(14, 13, 10, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .66), inset 0 1px rgba(226, 207, 164, .025);
}

.app-view {
  position: relative;
  min-height: 0;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.app-view[hidden] { display: none !important; }

.app-view > header,
.app-view > .view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.app-view > .view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: start;
  justify-items: start;
  gap: 2px;
  text-align: left;
}

.menu-settings-entry {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  min-width: 44px;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid var(--fd-line);
  border-radius: 3px;
  background: rgba(16, 14, 11, .86);
  color: var(--fd-paper-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
}

.menu-settings-entry::before {
  content: '⚙';
  display: block;
  color: var(--fd-orange);
  font-size: 13px;
  line-height: 1;
}

.app-view > .view-header { padding-right: 58px; }

.app-view > .view-header > .eyebrow { order: 1; }
.app-view > .view-header > :is(h1, h2) { order: 2; }

.app-view > .settings-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.settings-header > div {
  display: grid;
  gap: 2px;
}

.app-view h1,
.app-view h2 {
  color: var(--fd-paper);
  letter-spacing: .5px;
}

.app-view h1,
.app-view h2 { font-size: 24px; }

.field-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--fd-line);
  border-radius: 4px;
}

.field-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image:
    linear-gradient(31deg, transparent 46%, rgba(225, 208, 170, .12) 47%, transparent 48%),
    linear-gradient(121deg, transparent 63%, rgba(225, 208, 170, .09) 64%, transparent 65%);
  background-size: 84px 84px, 112px 112px;
  pointer-events: none;
}

.field-card > * { position: relative; }

.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
  padding: 9px;
  background: rgba(27, 24, 18, .94);
}

.profile-card .profile-chip,
.profile-card .profile-edit {
  min-height: 44px;
  margin: 0;
  border: 1px solid var(--fd-line);
  background: rgba(231, 220, 195, .035);
  color: var(--fd-paper);
}

.profile-card .profile-chip { min-width: 0; }
.profile-card .profile-edit { min-width: 44px; padding: 8px 12px; }
.profile-card :where(span, b, i) { font-size: 14px; }
.profile-card #archive-badge,
.profile-card .action-state-marker { display: none; }

.current-action-card {
  display: grid;
  gap: 16px;
  min-height: 244px;
  align-content: end;
  background:
    linear-gradient(180deg,
      rgba(24, 20, 15, .18) 0%,
      rgba(25, 21, 15, .5) 38%,
      rgba(107, 95, 72, .92) 53%,
      #74674e 67%,
      #5f5541 100%),
    url('./assets/images/menu-quarantine-city-v1.png') center top / 100% 54% no-repeat,
    #675c47;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .34), inset 0 1px rgba(244, 232, 203, .22);
}

.current-action-card::after {
  content: 'Z-09 · 现行';
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 7px;
  transform: rotate(-2deg);
  border: 1px solid rgba(58, 47, 31, .46);
  color: rgba(48, 39, 26, .7);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 1px;
}

.current-action-copy {
  display: grid;
  gap: 5px;
  max-width: 34rem;
}

.current-action-copy :where(h2, h3, b) {
  color: #f0e5c9;
  font-size: 20px;
  line-height: 1.18;
}

.current-action-copy :where(p, span, small) {
  color: #d0c29f;
  font-size: 12px;
  line-height: 1.45;
}

.current-action-copy #home-priority-status,
.current-action-copy #home-priority-title { display: none; }

#continue-action-btn {
  width: 100%;
  min-height: 56px;
  text-align: center;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 2px;
}

#continue-action-btn small {
  color: rgba(24, 17, 11, .72);
  font-size: 12px;
}

#continue-action-btn > small,
#continue-action-btn .action-state-marker { display: none; }

.home-secondary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.home-secondary-actions button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--fd-line);
  border-radius: 5px;
  background: rgba(52, 48, 38, .84);
  color: var(--fd-paper);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.home-secondary-actions button :where(small, b, span) { font-size: inherit; }
.home-secondary-actions .action-state-marker { grid-column: 2; margin: 0; }
.home-secondary-actions .action-state-marker i { display: none; }

.action-hub,
.readiness-hub,
.intel-hub,
.report-hub {
  display: grid;
  gap: 12px;
}

.action-hub .action-grid,
.readiness-hub .action-grid,
.intel-hub .action-grid,
.report-hub .action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

:where(.action-hub, .readiness-hub, .intel-hub) button {
  min-height: 52px;
  padding: 11px 12px;
  border-color: var(--fd-line);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(38, 34, 26, .94), rgba(25, 23, 18, .96));
  color: var(--fd-paper);
  font-size: 14px;
}

.report-hub > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fd-line);
}
.report-hub > header span { color: var(--fd-orange); font: 800 12px/1 var(--font-mono); }
.report-hub > header b { color: var(--fd-paper); font-size: 15px; }
.report-hub > header small { color: var(--fd-paper-faint); font-size: 11px; }
.report-hub-summary { display: grid; gap: 5px; min-height: 170px; align-content: end; padding: 14px; border: 1px solid var(--fd-line); background: linear-gradient(180deg, rgba(38, 33, 25, .12), rgba(47, 41, 30, .9)), url('./assets/images/menu-quarantine-city-v1.png') center / cover no-repeat; }
.report-hub-summary span { color: var(--fd-orange); font-size: 10px; font-weight: 850; letter-spacing: 1px; }
.report-hub-summary b { color: var(--fd-paper-strong); font-size: 22px; }
.report-hub-summary p { max-width: 26rem; color: var(--fd-paper-muted); font-size: 12px; line-height: 1.45; }
.report-hub .action-grid { margin-top: 2px; }
.report-hub .action-grid button { min-height: 48px; padding: 9px 10px; border: 1px solid var(--fd-line); background: rgba(39, 35, 27, .82); color: var(--fd-paper); text-align: left; }
.report-hub .action-grid button :where(span, b) { display: block; font-size: 12px; }
.report-hub .action-grid button b { margin-top: 2px; color: var(--fd-paper-muted); font-size: 10px; }

.action-hub > header,
.readiness-hub > header,
.intel-hub > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

:where(.action-hub, .readiness-hub, .intel-hub) > header > span {
  color: var(--fd-orange);
  font: 800 12px/1 var(--font-mono);
}

:where(.action-hub, .readiness-hub, .intel-hub) > header > b {
  color: var(--fd-paper);
  font-size: 16px;
}

:where(.action-hub, .readiness-hub, .intel-hub) > header > small {
  color: var(--fd-paper-muted);
  font-size: 12px;
  text-align: right;
}

.action-hub button,
.readiness-hub button,
.intel-hub button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
  column-gap: 8px;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 11px 12px;
  border: 1px solid var(--fd-line);
  border-radius: 5px;
  background: rgba(52, 48, 38, .82);
  box-shadow: 0 3px 0 #0f0d0a;
  color: var(--fd-paper);
  font-size: 14px;
  text-align: left;
}

:where(.action-hub, .readiness-hub, .intel-hub) button > :where(span, b, small) {
  grid-column: 1;
  color: inherit;
  font-size: 14px;
  line-height: 1.3;
}

:where(.action-hub, .readiness-hub, .intel-hub) .action-state-marker {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
}

:where(.action-hub, .readiness-hub, .intel-hub) .action-state-marker i { display: none; }

.action-hub #begin {
  border-color: var(--fd-line);
  background: rgba(52, 48, 38, .82);
  box-shadow: 0 3px 0 #0f0d0a;
  color: var(--fd-paper);
}

.action-hub #begin small { color: var(--fd-paper-muted); }

.action-hub .redzone-action {
  border-color: rgba(207, 85, 70, .58);
  background: rgba(105, 37, 30, .3);
  color: #ead4c9;
}

.action-hub :where(.contract-action, .season-action) {
  border-color: var(--fd-line);
  background: rgba(52, 48, 38, .82);
  color: var(--fd-paper);
}

:where(.action-hub, .readiness-hub, .intel-hub) button[data-action-state='recommended'] {
  border-color: rgba(225, 118, 55, .72);
  background: rgba(129, 61, 28, .34);
}

.bottom-nav {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 58px;
  border-top: 1px solid var(--fd-line);
  background: rgba(10, 9, 7, .99);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, .24);
}

.bottom-nav-item {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--fd-paper-faint);
  font-size: 11px;
  font-weight: 750;
}

.bottom-nav-item::after {
  content: '';
  position: absolute;
  right: 24%;
  bottom: 4px;
  left: 24%;
  height: 2px;
  transform: scaleX(0);
  background: var(--fd-orange);
  transition: transform var(--motion-fast) var(--ease-standard);
}

.bottom-nav-item[aria-selected='true'] {
  background: linear-gradient(0deg, rgba(208, 99, 47, .09), transparent 74%);
  color: var(--fd-orange);
}

.bottom-nav-item[aria-selected='true']::after { transform: scaleX(1); }

.settings-page {
  position: static;
  inset: auto;
  z-index: auto;
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-locale="en"] .panel-card,
html[data-locale="en"] .app-shell,
html[data-locale="en"] button,
html[data-locale="en"] select {
  word-break: normal;
  overflow-wrap: anywhere;
}

html[data-locale="en"] .current-action-card::after { content: 'Z-09 · ACTIVE'; }
html[data-locale="en"] .stage-item.complete::after { content: 'COMPLETE'; }

.settings-page small {
  margin: 0;
  color: var(--fd-paper-muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-primary,
.settings-switches,
.settings-advanced {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--fd-line);
  border-radius: 6px;
  background: rgba(41, 37, 29, .76);
  padding: 0;
}

.settings-page label {
  min-height: 44px;
  color: var(--fd-paper);
  font-size: 14px;
}

.settings-primary label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 0;
}

.settings-page label b { color: var(--fd-paper-muted); }

.settings-page input[type='range'] {
  min-height: 36px;
  margin: 0 14px 10px;
  accent-color: var(--fd-orange);
}

.settings-switches label,
.settings-advanced label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(211, 194, 156, .12);
}

.settings-switches label:last-child,
.settings-advanced label:last-child { border-bottom: 0; }

.settings-page input[type='checkbox'] {
  justify-self: end;
  width: 22px;
  height: 22px;
  accent-color: var(--fd-orange);
}

.settings-switches label > input[type='checkbox'],
.settings-advanced label > input[type='checkbox'] {
  grid-column: 2;
  grid-row: 1;
}

.settings-switches label > span,
.settings-advanced label > input[type='checkbox'] + span {
  grid-column: 1;
  grid-row: 1;
}

.settings-advanced > summary {
  min-height: 52px;
  padding: 16px 14px;
  color: var(--fd-paper);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.settings-page button {
  min-height: 44px;
  border-color: var(--fd-line);
  background: rgba(231, 220, 195, .045);
  color: var(--fd-paper);
  font-size: 14px;
}

.settings-advanced > small { padding: 0 14px 10px; }
.settings-advanced > button { margin: 0 14px 14px; }

.settings-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.settings-header .settings-close {
  border: 1px solid var(--fd-line-strong);
  background: rgba(222, 209, 176, .035);
  color: var(--fd-paper-muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 850;
}

.combat-settings-entry {
  position: fixed;
  z-index: var(--z-transient);
  top: max(12px, calc(env(safe-area-inset-top) + 10px));
  right: max(12px, calc(env(safe-area-inset-right) + 10px));
  bottom: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 11px;
  border-color: var(--fd-line);
  background: rgba(23, 21, 16, .9);
  color: var(--fd-paper-muted);
  font-size: 12px;
  pointer-events: auto;
}

.in-menu .combat-settings-entry { display: none !important; }

.sound-settings:not(.settings-page) {
  border-color: var(--fd-line);
  background: rgba(29, 26, 20, .98);
}

.sound-settings:not(.settings-page) input[type='range'] { accent-color: var(--fd-orange); }

.hud,
.objective-hud,
.agent-hud,
.combo,
.tutorial-tip,
.story-dialogue {
  border-color: var(--fd-line);
  background-color: rgba(20, 18, 14, .88);
}

.hud { border-top-color: var(--fd-orange); }
.objective-hud { --objective-color: var(--fd-orange); }

@media (max-width: 560px) {
  .start-panel {
    align-items: stretch;
    padding:
      max(8px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      0
      max(16px, env(safe-area-inset-left));
    overflow: hidden;
    background:
      linear-gradient(0deg, rgba(14, 12, 9, .98) 0%, rgba(19, 17, 13, .86) 62%, rgba(26, 22, 16, .46) 100%),
      url('./assets/images/menu-quarantine-city-v1.png') 70% center / cover no-repeat,
      var(--fd-night);
  }

  .app-shell {
    width: 100%;
    height: 100%;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(19, 17, 13, .9);
  }

  .app-view { padding: 14px 12px 16px; }
  .app-view h1,
  .app-view h2 { font-size: 23px; }

  .field-card { padding: 13px; }

  .current-action-card {
    min-height: min(37vh, 292px);
    gap: 14px;
  }

  .current-action-copy :where(h2, h3, b) { font-size: 20px; }

  .home-secondary-actions { grid-template-columns: 1fr; }

  .action-hub .action-grid,
  .readiness-hub .action-grid,
  .intel-hub .action-grid { grid-template-columns: 1fr; }

  .bottom-nav {
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item { min-height: 58px; font-size: 11px; }

  .settings-page label,
  .settings-page button,
  .settings-advanced > summary { font-size: 14px; }

  .settings-page input[type='range'] { min-height: 44px; }

  .panel button,
  .start-panel button { font-size: max(14px, var(--font-control)); }

  .command-heading > span,
  .action-group > header > span:first-child { display: none; }

  .action-state-marker { font-size: 12px; }
}
body[data-mobile-long-run-status="verified"] .qa-mobile-long-run-report { border-color: #83eeb7; color: #baffd9; }
body[data-mobile-long-run-status="failed"] .qa-mobile-long-run-report { border-color: #ff625c; color: #ffd2cf; }

/* V23 · Complete field-dossier fidelity --------------------------------- */
.dossier-panel {
  align-items: flex-start;
  overflow-y: auto;
  background:
    linear-gradient(rgba(201, 187, 155, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 187, 155, .02) 1px, transparent 1px),
    var(--fd-panel-scrim);
  background-size: 72px 72px, 72px 72px, auto;
  backdrop-filter: blur(5px) saturate(.62);
}

.dossier-panel > .dossier-modal-card {
  width: min(720px, 100%);
  max-height: none;
  margin: auto;
  padding: 16px;
  border: 1px solid var(--fd-line-strong);
  border-top: 1px solid var(--fd-line-strong);
  border-radius: 8px;
  background:
    linear-gradient(rgba(200, 181, 143, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 181, 143, .014) 1px, transparent 1px),
    linear-gradient(155deg, rgba(28, 25, 19, .995), rgba(13, 12, 9, .995));
  background-size: 48px 48px, 48px 48px, auto;
  box-shadow: var(--fd-shadow-card), inset 0 1px rgba(240, 229, 205, .05);
}

.dossier-panel-head,
.dossier-modal-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fd-line);
}

.dossier-panel-head > div { min-width: 0; }
.dossier-panel-head .eyebrow { margin-bottom: 3px; }
.dossier-modal-card h2 {
  color: var(--fd-paper-strong);
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.12;
  letter-spacing: .5px;
}

.dossier-stamp {
  flex: none;
  padding: 7px 9px;
  transform: rotate(-2deg);
  border: 1px solid rgba(184, 80, 39, .72);
  color: rgba(225, 118, 55, .8);
  font: 850 11px/1 var(--font-mono);
  letter-spacing: 1.4px;
}

.dossier-modal-card .close {
  flex: none;
  width: var(--control-min-touch);
  height: var(--control-min-touch);
  border-color: var(--fd-line-strong);
  background: rgba(231, 220, 195, .045);
  color: var(--fd-paper-muted);
  box-shadow: none;
}

.dossier-modal-card :where(button, input, summary) { touch-action: manipulation; }
.dossier-modal-card button { min-height: var(--control-min-touch); }
.dossier-modal-card :where(.contract-note, .agent-summary, .community-summary) {
  color: var(--fd-paper-muted);
  font-size: 14px;
  line-height: 1.5;
}

button[data-action-state='complete'] { border-left-color: var(--fd-olive-mid); }
button[data-action-state='complete'] .action-state-marker { color: #aaa486; }
.community-card,
.mastery-card,
.archive-card { border-top-color: var(--fd-rust) !important; }
.community-card .eyebrow,
.mastery-card .eyebrow,
.archive-card .eyebrow { color: var(--fd-orange); }
.mastery-meta b { color: var(--fd-paper); }

/* Loading and recoverable error use an operational strip, not a debug toast. */
#asset-status {
  width: min(420px, calc(100vw - 32px));
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--fd-line-strong);
  border-left: 4px solid var(--fd-orange);
  border-radius: 4px 8px 8px 4px;
  background: rgba(22, 20, 15, .96);
  box-shadow: var(--fd-shadow-card);
}

#asset-status .ui-status-indicator {
  border-color: var(--fd-paper-faint);
  border-top-color: var(--fd-orange);
  box-shadow: none;
}

#asset-status .ui-status-copy b { color: var(--fd-paper-strong); font-size: 14px; }
#asset-status .ui-status-copy small { color: var(--fd-paper-muted); font-size: 12px; }
#asset-status .ui-status-meter { background: rgba(231, 220, 195, .12); }
#asset-status .ui-status-meter i { background: var(--fd-orange); box-shadow: none; }
#asset-status button {
  border-color: rgba(225, 118, 55, .7);
  background: rgba(155, 63, 29, .28);
  color: var(--fd-paper-strong);
}
#asset-status[data-state='error'] { border-left-color: var(--fd-danger); }
#asset-status[data-state='error'] .ui-status-indicator { border-color: var(--fd-danger); }

/* Combat HUD stays lightweight and transparent over the world. */
.hud.combat-dossier-hud {
  border: 1px solid var(--fd-line);
  border-top: 2px solid var(--fd-orange);
  border-radius: 5px;
  background: var(--fd-combat-glass);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  backdrop-filter: blur(3px) saturate(.72);
}

.combat-dossier-hud .hud-line { border-bottom-color: rgba(211, 194, 156, .14); }
.combat-dossier-hud :where(.mission strong, .score b) { color: var(--fd-paper-strong); }
.combat-dossier-hud :where(.mission span, .score span, .stat > span, .stat > b) { color: var(--fd-paper-muted); }
.combat-dossier-hud .track { background: rgba(231, 220, 195, .12); box-shadow: none; }
.combat-dossier-hud .hp-stat .track em { background: #b94b3d; box-shadow: none; }
.combat-dossier-hud .xp-stat .track em { background: var(--fd-olive); box-shadow: none; }

:where(.objective-hud, .agent-hud, .combo, .buff-status > span) {
  border-color: var(--fd-line);
  background: var(--fd-combat-glass);
  box-shadow: none;
  backdrop-filter: blur(3px) saturate(.72);
}

.objective-hud { --objective-color: var(--fd-orange); }
.objective-hud::before { background: var(--fd-orange); box-shadow: none; }
.objective-hud span,
.objective-hud .objective-mode-line > i { color: var(--fd-orange); }
.objective-hud b { color: var(--fd-paper-strong); }
.objective-hud small,
.agent-hud small { color: var(--fd-paper-muted); }
.agent-hud { --agent-color: var(--fd-orange); }
.agent-hud i { border-color: var(--fd-orange); color: var(--fd-orange); }
.agent-hud b { color: var(--fd-paper); }
.combo b,
.combo span { color: var(--fd-orange); text-shadow: none; }

:where(.armory-fab, .airstrike, .agent-skill, .primary-switch, .multifire-toggle) {
  border-color: var(--fd-line-strong);
  background: rgba(27, 24, 18, .93);
  color: var(--fd-paper);
  box-shadow: var(--fd-shadow-control);
}

.armory-fab { border-left-color: var(--fd-orange); color: var(--fd-paper); }
.airstrike { --strike-color: var(--fd-orange); }
.airstrike > span { border-color: var(--fd-orange); color: var(--fd-orange); box-shadow: none; }
.agent-skill { --agent-color: var(--fd-orange); border-left-color: var(--fd-orange); }
.agent-skill :where(b, em) { color: var(--fd-paper); }
.agent-skill.active,
.agent-skill.ready,
.primary-switch.ready,
.multifire-toggle.ready { background: rgba(78, 55, 31, .94); box-shadow: var(--fd-shadow-control); animation: none; }
.primary-switch small { color: var(--fd-paper-muted); }
.combat-settings-entry { box-shadow: var(--fd-shadow-control); }

.combat-pause-sheet {
  position: fixed;
  z-index: calc(var(--z-panel) - 1);
  inset: 0;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
.combat-pause-sheet[hidden] { display: none !important; }
.combat-pause-backdrop { position: absolute; inset: 0; background: rgba(7, 6, 4, .74); backdrop-filter: blur(3px) saturate(.62); }
.combat-pause-card {
  position: relative;
  width: min(390px, 100%);
  padding: 20px;
  border: 1px solid var(--fd-line-strong);
  border-radius: 6px;
  background: linear-gradient(155deg, rgba(39, 36, 28, .99), rgba(20, 18, 14, .99));
  box-shadow: var(--fd-shadow-card);
}
.combat-pause-card > header { padding-bottom: 12px; border-bottom: 1px solid var(--fd-line); }
.combat-pause-card h2 { color: var(--fd-paper-strong); font-size: 28px; }
.combat-pause-card > p { margin-top: 10px; color: var(--fd-paper-muted); font-size: 14px; line-height: 1.5; }
.combat-pause-actions { display: grid; gap: 9px; margin-top: 16px; }
.combat-pause-actions button { min-height: var(--control-primary-touch); font-size: 14px; font-weight: 850; }
.combat-pause-actions .secondary { text-align: center; }
.combat-pause-exit { border: 1px solid rgba(207, 85, 70, .58); background: rgba(105, 37, 30, .22); color: #e8c8bf; }
.combat-exit-confirm { margin-top: 12px; padding: 12px; border: 1px solid rgba(207, 85, 70, .42); background: rgba(105, 37, 30, .16); }
.combat-exit-confirm p { display: grid; gap: 3px; }
.combat-exit-confirm b { color: var(--fd-paper); font-size: 14px; }
.combat-exit-confirm span { color: var(--fd-paper-muted); font-size: 12px; }
.combat-exit-confirm > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.combat-exit-confirm button { min-height: var(--control-min-touch); border: 1px solid var(--fd-line); background: rgba(231, 220, 195, .045); color: var(--fd-paper); }
#combat-exit-confirm-btn { border-color: var(--fd-danger); background: rgba(207, 85, 70, .28); }

/* Supply uses three compact filed rewards inside a phone-width shell. */
.supply-card { width: min(430px, 100%) !important; }
.loadout { min-height: 28px; margin: 12px 0; }
.loadout span,
.loadout .slot-chip,
.loadout .fusion-chip {
  padding: 5px 8px;
  border: 1px solid var(--fd-line);
  background: rgba(231, 220, 195, .055);
  color: var(--fd-paper-muted);
  font-size: 12px;
  box-shadow: none;
}

.upgrade-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.upgrade-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 8px;
  min-height: 230px;
  padding: 8px;
  border: 1px solid rgba(72, 62, 44, .34);
  border-left: 4px solid var(--fd-olive-mid);
  border-radius: 3px;
  background:
    linear-gradient(115deg, rgba(255, 242, 206, .035), transparent 48%),
    linear-gradient(180deg, #918469, #71664f);
  color: var(--fd-paper-ink);
  box-shadow: 0 7px 16px rgba(0, 0, 0, .34), inset 0 1px rgba(245, 226, 187, .12);
}

.upgrade-card:hover,
.upgrade-card:active {
  transform: translateY(-1px);
  border-color: rgba(90, 69, 41, .62);
  background: linear-gradient(180deg, #9b8d70, #776a51);
}
.upgrade-card.weapon { border-left-color: var(--fd-rust); }
.upgrade-card.survival { border-left-color: var(--fd-olive-mid); }
.upgrade-card.explosive { border-left-color: var(--fd-danger); }
.upgrade-card.fusion,
.upgrade-card.rare {
  border: 1px dashed rgba(96, 75, 48, .62);
  border-left: 4px solid var(--fd-rust);
  background: linear-gradient(180deg, #978a6f, #70644d);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .25);
}
.upgrade-card.fusion.confirming { border-color: var(--fd-rust-deep); transform: translateY(-1px); }
.upgrade-card :where(header b, p, small),
.upgrade-card.fusion :where(header b, small),
.upgrade-card.rare :where(header b, small) { color: var(--fd-paper-ink); }
.upgrade-card header { align-items: flex-start; flex-direction: column; gap: 4px; }
.upgrade-card header b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.upgrade-card header em {
  background: rgba(48, 40, 27, .1);
  color: var(--fd-paper-ink-muted);
  max-width: 100%;
  font-size: 9px;
}
.upgrade-card p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.upgrade-card small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.upgrade-art,
.weapon-art { background-color: #27251f; box-shadow: inset 0 0 14px rgba(0, 0, 0, .35); }
.upgrade-art { width: 100%; height: auto; aspect-ratio: 1 / .78; border-radius: 2px; }
.upgrade-art.generic { background: var(--fd-olive-deep); color: var(--fd-orange); }
.minor-actions button {
  min-height: var(--control-min-touch);
  border-color: var(--fd-line);
  background: rgba(231, 220, 195, .045);
  color: var(--fd-paper-muted);
  font-size: 13px;
}

.armory-card { width: min(560px, 100%) !important; }
.armory-card nav {
  gap: 6px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--fd-line);
}
.armory-card nav button {
  min-height: var(--control-min-touch);
  padding: 8px 13px;
  border-color: var(--fd-line);
  background: transparent;
  color: var(--fd-paper-muted);
  font-size: 13px;
}
.armory-card nav button.active {
  border-color: var(--fd-orange);
  background: rgba(225, 118, 55, .13);
  color: var(--fd-paper);
}
.armory-list { gap: 8px; }
.weapon-row,
.weapon-row.fusion-row {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--fd-line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(40, 36, 28, .96), rgba(25, 23, 18, .98));
  box-shadow: none;
}
.weapon-row.fusion-row { border-style: dashed; }
.weapon-row :where(header b, p, small),
.weapon-row.fusion-row :where(.weapon-icon, header span) { color: var(--fd-paper); }
.weapon-row header b { font-size: 15px; }
.weapon-row header span { color: var(--fd-rust-deep); font-size: 12px; }
.weapon-row p { color: var(--fd-paper-muted); font-size: 13px; }
.weapon-row small,
.weapon-row small.weapon-mastery { color: var(--fd-paper-faint); font-size: 12px; }
.weapon-icon { width: 56px; height: 56px; border-color: rgba(40, 34, 23, .28); background-color: #292720; color: var(--fd-orange); }

/* Mission selectors read as filed orders instead of glowing parameter walls. */
.redzone-card { width: min(720px, 100%) !important; }
.contract-card { width: min(720px, 100%) !important; }
.stage-card { width: min(640px, 100%) !important; }
.redzone-meta,
.contract-meta,
.mastery-meta,
.archive-meta {
  color: var(--fd-paper-muted);
  font-size: 13px;
}
.redzone-meta p:last-child,
.contract-meta b,
.mastery-meta b,
.archive-meta b { color: var(--fd-paper); }
.contract-note { margin: 8px 0 14px; }

.redzone-list { gap: 10px; }
.redzone-item {
  --risk-color: var(--fd-rust) !important;
  min-height: 286px;
  padding: 12px;
  border: 1px solid var(--fd-line);
  border-top: 4px solid var(--fd-rust);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(45, 38, 28, .96), rgba(25, 22, 17, .98));
  color: var(--fd-paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
}
.redzone-item.selected {
  border-color: var(--fd-rust-deep);
  box-shadow: 0 0 0 2px rgba(225, 118, 55, .24), 0 6px 14px rgba(0, 0, 0, .24);
}
.redzone-head { color: var(--fd-orange); }
.redzone-head b { font-size: 18px; }
.redzone-head i { font-size: 12px; }
.redzone-item h3 { color: var(--fd-paper); font-size: 17px; }
.redzone-rule {
  grid-template-columns: 36px minmax(0, 1fr);
  border-color: var(--fd-line);
  background: rgba(220, 196, 151, .035);
}
.redzone-rule > i { width: 34px; height: 34px; border-color: var(--fd-orange); color: var(--fd-orange); }
.redzone-rule b { color: var(--fd-paper); font-size: 13px; }
.redzone-rule small { color: var(--fd-paper-muted); font-size: 12px; }
.redzone-modifiers span {
  padding: 6px 4px;
  border: 1px solid var(--fd-line);
  background: rgba(220, 196, 151, .03);
  color: var(--fd-paper-muted);
  font-size: 11px;
}
.redzone-conditions li { color: var(--fd-paper-muted); font-size: 12px; }
.redzone-conditions li::before { color: var(--fd-orange); }
.redzone-item button,
.redzone-item button.redzone-board {
  min-height: var(--control-min-touch);
  border-color: var(--fd-rust-deep);
  background: var(--fd-rust);
  color: var(--fd-paper-strong);
  font-size: 13px;
  box-shadow: var(--fd-shadow-control);
}
.redzone-item button.redzone-board {
  border-color: rgba(72, 62, 44, .4);
  background: rgba(46, 39, 26, .1);
  color: var(--fd-paper-ink);
  box-shadow: none;
}
.redzone-best { color: var(--fd-paper-faint); font-size: 11px; }

.contract-list { gap: 10px; }
.contract-item {
  --contract-color: var(--fd-rust) !important;
  min-height: 340px;
  padding: 14px;
  border: 1px solid var(--fd-line);
  border-top: 4px solid var(--fd-rust);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(45, 38, 28, .96), rgba(25, 22, 17, .98));
  color: var(--fd-paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
}
.contract-item.complete { box-shadow: 0 0 0 2px rgba(69, 69, 51, .24), 0 6px 14px rgba(0, 0, 0, .2); }
.contract-item > span { color: var(--fd-orange); font-size: 11px; }
.contract-item h3 { color: var(--fd-paper); font-size: 19px; }
.contract-item > p { min-height: 0; color: var(--fd-paper-muted); font-size: 13px; }
.contract-goal { background: rgba(220, 196, 151, .035); }
.contract-goal b { color: var(--fd-paper); font-size: 14px; }
.contract-goal small { color: var(--fd-orange); font-size: 12px; }
.contract-doctrine {
  border-left-color: var(--fd-olive-mid);
  background: rgba(69, 69, 51, .11);
}
.contract-doctrine b { color: var(--fd-paper); font-size: 13px; }
.contract-doctrine small { color: var(--fd-paper-muted); font-size: 12px; }
.contract-rule b { color: var(--fd-paper); font-size: 12px; }
.contract-rule small { color: var(--fd-paper-muted); font-size: 11px; }
.contract-item button,
.contract-item button.contract-board {
  min-height: var(--control-min-touch);
  border-color: var(--fd-rust-deep);
  background: var(--fd-rust);
  color: var(--fd-paper-strong);
  font-size: 13px;
  box-shadow: var(--fd-shadow-control);
}
.contract-item button.contract-board {
  border-color: rgba(72, 62, 44, .4);
  background: rgba(46, 39, 26, .1);
  color: var(--fd-paper-ink);
  box-shadow: none;
}
.contract-best { color: var(--fd-paper-faint); font-size: 11px; }

.stage-progress { margin: 8px 0 12px; color: var(--fd-paper-muted); font-size: 12px; }
.stage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.stage-item {
  --stage-color: var(--fd-rust) !important;
  min-height: 118px;
  padding: 11px;
  border: 1px solid var(--fd-line);
  border-top: 3px solid var(--fd-rust);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(42, 37, 28, .98), rgba(24, 22, 17, .99));
  color: var(--fd-paper);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .34);
}
.stage-item[data-action-state='recommended'] {
  border-color: var(--fd-orange);
  background: linear-gradient(180deg, rgba(75, 50, 30, .98), rgba(34, 26, 19, .99));
  box-shadow: 0 0 0 1px rgba(208, 99, 47, .22), 0 6px 14px rgba(0, 0, 0, .34);
}
.stage-item span { color: var(--fd-orange); font-size: 10px; }
.stage-item b { color: var(--fd-paper); font-size: 15px; }
.stage-item p { color: var(--fd-paper-muted); font-size: 12px; }
.stage-item small,
.stage-item .action-state-marker { color: var(--fd-paper-faint); font-size: 11px; }
.stage-item small {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.stage-item.complete::after { color: #aaa486; font-size: 10px; }

/* Personnel cards retain local paper, while their browser stays dark and compact. */
.agent-card { width: min(640px, 100%) !important; }
.agent-card .panel-sticky-head,
.archive-card .panel-sticky-head {
  background: rgba(31, 28, 21, .98);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .22);
}
.agent-summary,
.community-summary { margin: 8px 0 14px; }
.agent-card .agent-summary { margin-top: 14px; }
.agent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-item {
  --agent-color: var(--fd-orange) !important;
  min-height: 324px;
  padding: 10px;
  border: 1px solid rgba(72, 62, 44, .36);
  border-top: 4px solid var(--fd-rust);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--fd-paper-surface), var(--fd-paper-surface-deep));
  color: var(--fd-paper-ink);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
}
.agent-item.active {
  border-color: var(--fd-rust-deep);
  box-shadow: 0 0 0 2px rgba(225, 118, 55, .22), 0 6px 14px rgba(0, 0, 0, .22);
}
.agent-portrait {
  height: 154px;
  border-radius: 2px;
  background-color: #24231e;
  box-shadow: inset 0 -44px 38px rgba(12, 10, 7, .58);
}
.agent-portrait span {
  border-color: rgba(231, 220, 195, .32);
  background: rgba(17, 15, 11, .8);
  color: var(--fd-paper);
  font-size: 11px;
}
.agent-mark b { border-color: var(--fd-rust-deep); color: var(--fd-rust-deep); }
.agent-mark small,
.agent-copy > span { color: var(--fd-rust-deep); font-size: 11px; }
.agent-copy h3 { color: var(--fd-paper-ink); font-size: 17px; }
.agent-copy ul { min-height: 0; }
.agent-copy li { color: var(--fd-paper-ink-muted); font-size: 12px; line-height: 1.35; }
.agent-copy li::before { color: var(--fd-olive-deep); }
.agent-copy li.weakness { color: #753d32; }
.agent-copy li.weakness::before { color: #753d32; }
.agent-copy button,
.agent-item.active button {
  min-height: var(--control-min-touch);
  border-color: var(--fd-rust-deep);
  background: var(--fd-rust);
  color: var(--fd-paper-strong);
  font-size: 13px;
  box-shadow: var(--fd-shadow-control);
}
.panel-tab-nav button {
  border-color: var(--fd-line);
  background: rgba(231, 220, 195, .035);
  color: var(--fd-paper-muted);
}
.panel-tab-nav button[aria-selected='true'] {
  border-color: var(--fd-orange);
  background: rgba(225, 118, 55, .13);
  color: var(--fd-paper);
}

.community-card { width: min(640px, 100%) !important; }
.community-routes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.community-route {
  --route-color: var(--fd-orange) !important;
  min-height: 240px;
  border: 1px solid var(--fd-line);
  border-top: 4px solid var(--fd-olive-mid);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(42, 37, 28, .98), rgba(24, 22, 17, .99));
  color: var(--fd-paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
}
.community-route.selected { border-top-color: var(--fd-rust); box-shadow: 0 0 0 2px rgba(225, 118, 55, .2), 0 6px 14px rgba(0, 0, 0, .2); }
.community-route header span { color: var(--fd-orange); font-size: 11px; }
.community-route header b { color: var(--fd-paper-muted); font-size: 13px; }
.community-route h3 { color: var(--fd-paper); font-size: 20px; }
.community-route p { color: var(--fd-paper-muted); font-size: 13px; }
.community-route li { color: var(--fd-paper-muted); font-size: 12px; }
.community-route li::before { color: var(--fd-rust-deep); }
.community-meter { height: 6px; background: rgba(46, 39, 26, .14); }
.community-meter i { background: var(--fd-rust); box-shadow: none; }
.community-route button,
.community-route.selected button {
  min-height: var(--control-min-touch);
  border-color: var(--fd-rust-deep);
  background: var(--fd-rust);
  color: var(--fd-paper-strong);
  font-size: 13px;
  box-shadow: var(--fd-shadow-control);
}
.telemetry-consent {
  border-color: var(--fd-line);
  background: rgba(231, 220, 195, .035);
}
.telemetry-consent b { color: var(--fd-paper); font-size: 13px; }
.telemetry-consent p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--fd-paper-muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.telemetry-consent small,
.telemetry-consent label { color: var(--fd-paper-muted); font-size: 12px; }
.telemetry-consent input { width: 22px; height: 22px; accent-color: var(--fd-orange); }

.mastery-card { width: min(640px, 100%) !important; }
.mastery-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mastery-item {
  --mastery-color: var(--fd-orange) !important;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--fd-line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(42, 37, 28, .98), rgba(24, 22, 17, .99));
  color: var(--fd-paper);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .2);
}
.mastery-item.showcase { border-color: var(--fd-rust-deep); box-shadow: 0 0 0 2px rgba(225, 118, 55, .2); }
.mastery-item.gold .mastery-icon { animation: none; }
.mastery-icon { width: 64px; height: 64px; border-color: rgba(46, 39, 26, .25); color: var(--fd-rust-deep); }
.mastery-copy h3 { color: var(--fd-paper); font-size: 16px; }
.mastery-copy > span { color: var(--fd-paper-muted); font-size: 12px; }
.mastery-ranks i { height: 5px; background: rgba(46, 39, 26, .15); }
.mastery-ranks i.active { background: var(--fd-rust); box-shadow: none; }
.mastery-next { min-height: 0; color: var(--fd-paper-muted); font-size: 12px; }
.mastery-next b { color: var(--fd-paper); font-size: 13px; }
.mastery-next small { color: var(--fd-paper-faint); font-size: 11px; }
.mastery-progress { background: rgba(46, 39, 26, .14); }
.mastery-progress i { background: var(--fd-rust); box-shadow: none; }
.mastery-buttons button,
.mastery-buttons button.select {
  min-height: var(--control-min-touch);
  border-color: var(--fd-rust-deep);
  background: var(--fd-rust);
  color: var(--fd-paper-strong);
  font-size: 12px;
  box-shadow: var(--fd-shadow-control);
}
.mastery-buttons button.select { border-color: rgba(72, 62, 44, .4); background: rgba(46, 39, 26, .1); color: var(--fd-paper-ink); box-shadow: none; }

/* Archive keeps dense history available, but groups it into readable files. */
.archive-card { width: min(720px, 100%) !important; }
.archive-panel.season-frame .archive-card { border-color: var(--fd-line-strong); box-shadow: var(--fd-shadow-card); }
.archive-card .eyebrow,
.archive-section > header span { color: var(--fd-orange); }
.archive-tab-nav button[aria-selected='true'] { border-color: var(--fd-orange); background: rgba(225, 118, 55, .13); }
.archive-tab-panel { scroll-margin-top: 118px; }
.archive-cloud span { color: var(--fd-paper-muted); font-size: 12px; }
.archive-cloud button,
.archive-build-actions button {
  min-height: var(--control-min-touch);
  border-color: var(--fd-line-strong);
  background: rgba(231, 220, 195, .055);
  color: var(--fd-paper);
  font-size: 12px;
}
.archive-summary { gap: 8px; margin: 12px 0 18px; }
.archive-summary div {
  padding: 11px;
  border: 1px solid rgba(72, 62, 44, .34);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(42, 37, 28, .98), rgba(24, 22, 17, .99));
}
.archive-summary b { color: var(--fd-paper); font-size: 20px; }
.archive-summary span { color: var(--fd-paper-muted); font-size: 12px; }
.archive-section > header { border-bottom-color: var(--fd-line); }
.archive-section > header span { font-size: 10px; }
.archive-section > header h3 { color: var(--fd-paper); font-size: 18px; }
.archive-section > header small { color: var(--fd-paper-muted); font-size: 12px; }

.season-hero,
.season-story,
.season-directive,
.season-objectives article,
.season-rewards article,
.season-empty {
  border-color: var(--fd-line);
  background: rgba(231, 220, 195, .04);
  box-shadow: none;
}
.season-directive.complete,
.season-objectives article.complete,
.season-rewards article.claimed {
  border-color: var(--fd-line-strong);
  background: rgba(170, 164, 134, .055);
  box-shadow: none;
}
.season-hero span,
.season-story-copy > span,
.season-directive > div:first-child span { color: var(--fd-orange); font-size: 11px; }
.season-hero h4,
.season-story-copy b,
.season-directive > div:first-child b,
.season-objectives b { color: var(--fd-paper); font-size: 14px; }
.season-hero p,
.season-story-copy p,
.season-directive p,
.season-objectives span,
.season-empty span { color: var(--fd-paper-muted); font-size: 12px; }
.season-hero strong { color: var(--fd-paper); }
.season-hero strong small,
.season-story-copy small,
.season-directive small,
.season-objectives small { color: var(--fd-paper-muted); font-size: 11px; }
.season-hero em,
.season-objectives em { background: var(--fd-orange); }
.season-story { border-left-color: var(--fd-orange); }
.season-story-track i.unlocked::before { background: var(--fd-orange-deep); }
.season-story-track i.unlocked { color: var(--fd-paper-muted); }
.season-story-track i.unlocked em { border-color: var(--fd-orange); background: var(--fd-orange-deep); box-shadow: none; }
.season-directive.complete { border-color: var(--fd-line-strong); box-shadow: none; }
.season-directive details,
.season-directive > em,
.season-directive > i { color: var(--fd-paper-muted); font-size: 11px; }
.season-directive details summary { min-height: 32px; color: var(--fd-paper); }
.season-directive-actions button,
.season-rewards button {
  min-height: var(--control-min-touch);
  border-color: var(--fd-line-strong);
  background: rgba(225, 118, 55, .12);
  color: var(--fd-paper);
  font-size: 11px;
}
.season-rewards article,
.season-rewards article.unlocked,
.season-rewards article.claimed { color: var(--fd-paper-muted); font-size: 11px; }
.season-reward-preview { color: var(--fd-paper-muted); }
.season-reward-preview i { border-color: var(--fd-line); background: rgba(231, 220, 195, .04); color: var(--fd-paper); }

.archive-infected,
.archive-medals { gap: 9px; }
.archive-infected-item {
  --archive-color: var(--fd-rust) !important;
  min-height: 166px;
  padding: 11px;
  border: 1px solid var(--fd-line);
  border-left: 4px solid var(--fd-rust);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(42, 37, 28, .98), rgba(24, 22, 17, .99));
  color: var(--fd-paper);
}
.archive-infected-item .archive-id { color: var(--fd-orange); font-size: 11px; }
.archive-infected-item h4 { color: var(--fd-paper); font-size: 15px; }
.archive-infected-item p,
.archive-infected-item p b { color: var(--fd-paper-muted); font-size: 12px; }
.archive-kills { color: var(--fd-orange); font-size: 12px; }
.archive-teaching-replay-btn,
.archive-teaching-replay-btn[aria-expanded='true'] {
  border-color: var(--fd-rust-deep);
  background: var(--fd-rust);
  color: var(--fd-paper-strong);
  font-size: 12px;
}
.archive-teaching-replay { border-left-color: var(--fd-rust-deep); background: rgba(46, 39, 26, .08); }
.archive-teaching-replay p,
.archive-teaching-replay p b { color: var(--fd-paper-ink-muted); }

.archive-medal,
.archive-medal.unlocked {
  min-height: 178px;
  border: 1px solid var(--fd-line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(42, 37, 28, .98), rgba(24, 22, 17, .99));
  color: var(--fd-paper);
}
.archive-medal .medal-icon,
.archive-medal.unlocked .medal-icon { border-color: var(--fd-rust-deep); color: var(--fd-rust-deep); box-shadow: none; }
.archive-medal h4 { color: var(--fd-paper); font-size: 13px; }
.archive-medal p,
.archive-medal small { color: var(--fd-paper-muted); font-size: 11px; }
.archive-medal button,
.archive-medal button.featured,
.archive-medal button.active {
  min-height: var(--control-min-touch);
  border-color: rgba(72, 62, 44, .42);
  background: rgba(46, 39, 26, .1);
  color: var(--fd-paper-ink);
  font-size: 11px;
}
.archive-medal button.active { border-color: var(--fd-rust-deep); background: var(--fd-rust); color: var(--fd-paper-strong); }
.archive-medal button.featured { border-color: var(--fd-line-strong); background: rgba(170, 164, 134, .08); color: var(--fd-paper); }
.build-share { border-color: var(--fd-line); background: rgba(231, 220, 195, .035); }
.build-share > p { color: var(--fd-paper-muted); font-size: 13px; }
.build-share code {
  max-height: 80px;
  background: rgba(9, 8, 6, .72);
  color: var(--fd-paper-muted);
  font-size: 11px;
}
.build-share .archive-import { color: var(--fd-orange); }
.archive-secondary-links .action-grid button {
  border-color: var(--fd-line);
  background: rgba(231, 220, 195, .045);
  color: var(--fd-paper);
  box-shadow: var(--fd-shadow-control);
}

/* Tutorial, radio, world brief and debrief follow the same restrained palette. */
.tutorial-tip {
  border-color: var(--fd-line-strong);
  border-left-color: var(--fd-orange);
  background: var(--fd-combat-glass);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .42);
}
.tutorial-tip::before { border-color: var(--fd-orange); box-shadow: inset 0 0 0 4px rgba(18, 16, 12, .92); }
.tutorial-tip span { color: var(--fd-orange); }
.tutorial-tip b { color: var(--fd-paper-strong); }
.tutorial-tip p,
.tutorial-tip .tutorial-touch-hint { color: var(--fd-paper-muted); }
.tutorial-tip button { min-width: var(--control-min-touch); min-height: var(--control-min-touch); border-color: var(--fd-line); background: transparent; color: var(--fd-paper-muted); }

.story-scrim { background: rgba(6, 5, 4, .7); backdrop-filter: blur(1px) saturate(.6); }
.story-dialogue.dossier-radio {
  --story-color: var(--fd-orange) !important;
  border-color: var(--fd-line-strong);
  border-left-color: var(--fd-orange);
  background: linear-gradient(108deg, rgba(22, 20, 15, .98), rgba(15, 13, 10, .95));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48);
}
.dossier-radio .story-channel span { color: var(--fd-orange); }
.dossier-radio .story-channel small,
.dossier-radio .story-message span { color: var(--fd-paper-muted); }
.dossier-radio .story-message > i { border-color: var(--fd-orange); background: rgba(225, 118, 55, .08); color: var(--fd-orange); box-shadow: none; }
.dossier-radio .story-message b,
.dossier-radio .story-message p { color: var(--fd-paper-strong); }
.dossier-radio .story-actions button { min-height: var(--control-min-touch); color: var(--fd-paper-muted); }
.dossier-radio .story-actions #story-next { color: var(--fd-orange); }

.world-intro-backdrop { background: rgba(7, 6, 4, .9); backdrop-filter: blur(4px) saturate(.58); }
.world-intro-card.dossier-briefing {
  width: min(760px, 100%);
  border: 1px solid var(--fd-line-strong);
  border-top: 1px solid var(--fd-line-strong);
  border-radius: 6px;
  background: rgba(25, 23, 18, .99);
  box-shadow: 0 28px 78px rgba(0, 0, 0, .68);
}
.dossier-briefing > header { border-bottom-color: var(--fd-line); }
.dossier-briefing > header span { color: var(--fd-orange); font-size: 11px; }
.dossier-briefing > header small { color: var(--fd-paper-muted); font-size: 11px; }
.dossier-briefing .world-intro-visual {
  min-height: 250px;
  border-right-color: var(--fd-line);
  background:
    linear-gradient(180deg, rgba(19, 17, 13, .08), rgba(19, 17, 13, .76)),
    url('./assets/images/menu-quarantine-city-v1.png') center / cover no-repeat,
    var(--fd-olive-deep);
}
.dossier-briefing .world-intro-visual::before,
.dossier-briefing .world-intro-visual::after,
.dossier-briefing .world-intro-visual i { display: none; }
.dossier-briefing .world-intro-visual b {
  padding: 8px 10px;
  border: 1px solid rgba(231, 220, 195, .46);
  color: var(--fd-paper);
  font-size: 22px;
  text-shadow: none;
}
.dossier-briefing .world-intro-visual em { color: var(--fd-paper-muted); font-size: 11px; }
.dossier-briefing .world-intro-copy p { color: var(--fd-orange); font-size: 11px; }
.dossier-briefing .world-intro-copy h2 { color: var(--fd-paper-strong); }
.dossier-briefing .world-intro-copy div { color: var(--fd-paper-muted); font-size: 14px; }
.dossier-briefing > footer { border-top-color: var(--fd-line); }
.dossier-briefing > footer button,
.dossier-briefing > footer #world-intro-next {
  min-height: var(--control-min-touch);
  border-color: var(--fd-line-strong);
  background: rgba(231, 220, 195, .045);
  color: var(--fd-paper);
  font-size: 13px;
}
.dossier-briefing > footer #world-intro-next { border-color: var(--fd-rust-deep); background: var(--fd-rust); color: var(--fd-paper-strong); }

.over-panel { background: rgba(8, 7, 5, .9); }
.over-panel[data-outcome='success'] { background: rgba(8, 7, 5, .9); }
.report-card.dossier-report {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(72, 62, 44, .45);
  border-top: 5px solid var(--fd-danger);
  border-radius: 3px;
  background:
    linear-gradient(115deg, rgba(255, 242, 206, .045), transparent 48%),
    linear-gradient(180deg, #95886e, #756950);
  color: var(--fd-paper-ink);
  box-shadow: var(--fd-shadow-card);
}
.dossier-report::before {
  display: block;
  height: 148px;
  margin: -6px -6px 16px;
  border: 1px solid rgba(72, 62, 44, .3);
  background:
    linear-gradient(180deg, rgba(36, 31, 22, .06), rgba(36, 31, 22, .5)),
    url('./assets/images/menu-quarantine-city-v1.png') center 48% / cover no-repeat,
    var(--fd-olive-deep);
  content: '';
}
.over-panel[data-outcome='success'] .report-card.dossier-report { border-top-color: var(--fd-olive-mid); }
.dossier-report .eyebrow,
.over-panel[data-outcome='success'] .dossier-report .eyebrow { color: var(--fd-rust-deep); }
.dossier-report h2 { color: var(--fd-paper-ink); }
.dossier-report #over-summary { color: var(--fd-paper-ink-muted); font-size: 14px; }
.dossier-report .report-stats div { border-color: rgba(72, 62, 44, .3); background: rgba(46, 39, 26, .08); }
.dossier-report .report-stats b { color: var(--fd-rust-deep); }
.dossier-report .report-stats span { color: var(--fd-paper-ink-muted); font-size: 12px; }
.dossier-report .mission-debrief { border-color: rgba(72, 62, 44, .3); border-left-color: var(--fd-rust); background: rgba(46, 39, 26, .08); }
.dossier-report .mission-debrief > span { color: var(--fd-rust-deep); }
.dossier-report .mission-debrief-line { color: var(--fd-paper-ink-muted); }
.dossier-report .mission-debrief-line b { color: var(--fd-paper-ink); }
.dossier-report .primary-actions button {
  min-height: var(--control-min-touch);
  border-color: rgba(72, 62, 44, .4);
  background: rgba(46, 39, 26, .1);
  color: var(--fd-paper-ink);
  box-shadow: none;
}
.dossier-report .primary-actions .primary { min-height: var(--control-primary-touch); border-color: var(--fd-rust-deep); background: var(--fd-rust); color: var(--fd-paper-strong); box-shadow: var(--fd-shadow-control); }

@media (max-width: 560px) {
  .dossier-panel {
    padding:
      max(var(--fd-panel-gutter), env(safe-area-inset-top))
      max(var(--fd-panel-gutter), env(safe-area-inset-right))
      max(var(--fd-panel-gutter), env(safe-area-inset-bottom))
      max(var(--fd-panel-gutter), env(safe-area-inset-left));
  }

  .dossier-panel > .dossier-modal-card {
    width: 100% !important;
    min-height: 0;
    padding: 13px;
    border-radius: 6px;
  }

  .dossier-panel-head,
  .dossier-modal-card > header {
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .dossier-modal-card h2 { font-size: 22px; }
  .dossier-stamp { padding: 6px; font-size: 10px; }
  .dossier-modal-card :where(.contract-note, .agent-summary, .community-summary) { font-size: 14px; }

  #asset-status {
    right: 16px;
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
    left: 16px;
    width: auto;
    min-height: 64px;
    transform: none;
  }
  #asset-status .ui-status-copy b { font-size: 14px; }
  #asset-status .ui-status-copy small { font-size: 12px; }

  .hud.combat-dossier-hud {
    top: max(8px, calc(env(safe-area-inset-top) + 8px));
    right: max(103px, calc(env(safe-area-inset-right) + 103px));
    left: max(9px, calc(env(safe-area-inset-left) + 9px));
    width: auto;
    padding: 9px 10px 10px;
    transform: none;
  }
  .combat-dossier-hud .score { display: none; }
  .objective-hud { padding: 9px 12px 9px 42px; }
  .objective-hud span { font-size: 11px; }
  .objective-hud b { font-size: 14px; }
  .objective-hud small { font-size: 12px; }
  .agent-hud { border-radius: 4px; }
  .buff-status span { border-color: var(--fd-line); color: var(--fd-paper); }
  .buff-status :where(.gatling, .shield, .sprint, .slowed) { border-color: var(--fd-line); color: var(--fd-paper); }

  .combat-action-rail { gap: 8px; }
  .combat-control::before { border-color: var(--fd-line-strong); background: var(--fd-night); box-shadow: none; }
  .airstrike { background: rgba(27, 24, 18, .94); }
  .airstrike > span { background: var(--fd-olive-deep); }
  .airstrike b { color: var(--fd-paper); }
  .airstrike small,
  .airstrike em { color: var(--fd-paper-muted); }
  .airstrike em { background: var(--fd-surface-2); }
  .primary-switch { border-left-color: var(--fd-orange); }
  .primary-switch b { color: var(--fd-paper); }
  .agent-skill b { color: var(--fd-paper); }

  .upgrade-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 210px;
    gap: 7px;
    padding: 7px;
  }
  .upgrade-art { width: 100%; height: auto; }
  .upgrade-copy { min-width: 0; overflow: hidden; }
  .upgrade-card header b { min-height: 30px; font-size: 12px; line-height: 1.25; }
  .upgrade-card header em {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .upgrade-card p {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }
  .upgrade-card.weapon small,
  .upgrade-card:not(.weapon) p { display: none; }
  .upgrade-card:not(.weapon) small {
    display: -webkit-box;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .minor-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .minor-actions button { font-size: 13px; }

  .armory-card nav { margin-right: -16px; margin-left: -16px; padding: 0 16px 8px; }
  .armory-card nav button { font-size: 13px; }
  .weapon-row,
  .weapon-row.fusion-row { grid-template-columns: 52px minmax(0, 1fr); padding: 10px; }
  .weapon-icon { width: 52px; height: 52px; }
  .weapon-row header b { font-size: 15px; }
  .weapon-row header span,
  .weapon-row small { font-size: 12px; }
  .weapon-row p { font-size: 13px; }

  .redzone-list,
  .contract-list,
  .stage-list,
  .agent-list,
  .community-routes,
  .mastery-list { grid-template-columns: 1fr; }

  .upgrade-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .redzone-meta,
  .contract-meta,
  .mastery-meta { align-items: flex-start; flex-direction: column; gap: 4px; font-size: 13px; }
  .redzone-item,
  .contract-item { min-height: 0; }
  .redzone-rule b,
  .contract-doctrine b,
  .contract-rule b { font-size: 13px; }
  .redzone-rule small,
  .contract-doctrine small,
  .contract-rule small { font-size: 12px; }
  .redzone-modifiers span { font-size: 12px; }
  .redzone-conditions li,
  .contract-item > p { font-size: 13px; }
  .redzone-actions,
  .contract-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .redzone-item button,
  .contract-item button { font-size: 13px; }
  .stage-item { min-height: 112px; }
  .stage-item span { font-size: 10px; }
  .stage-item b { font-size: 15px; }
  .stage-item p { font-size: 12px; }
  .stage-item small,
  .stage-item .action-state-marker { font-size: 12px; }

  .agent-card .panel-sticky-head,
  .archive-card .panel-sticky-head { margin: -13px -13px 0; padding: 13px 13px 9px; }
  .agent-summary,
  .community-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .agent-item { min-height: 0; padding: 12px; }
  .agent-portrait { height: 180px; }
  .agent-copy li { font-size: 14px; }
  .agent-copy button { font-size: 14px; }

  .community-route { min-height: 0; }
  .community-route header span { font-size: 11px; }
  .community-route header b { font-size: 13px; }
  .community-route p { font-size: 14px; }
  .community-route li { font-size: 13px; }
  .community-route button { font-size: 14px; }
  .telemetry-consent { align-items: flex-start; flex-direction: column; gap: 10px; }
  .telemetry-consent label { min-height: var(--control-min-touch); }

  .mastery-item { grid-template-columns: 58px minmax(0, 1fr); }
  .mastery-icon { width: 58px; height: 58px; }
  .mastery-copy h3 { font-size: 16px; }
  .mastery-copy > span,
  .mastery-next { font-size: 12px; }
  .mastery-next b { font-size: 13px; }
  .mastery-buttons button { font-size: 12px; }

  .archive-card .panel-tab-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    margin-right: -16px;
    margin-left: -16px;
    padding: 0 16px 8px;
    overflow: visible;
  }
  .archive-card .panel-tab-nav button { min-width: 0; padding-right: 2px; padding-left: 2px; font-size: 11px; }
  .archive-tab-panel { min-height: 260px; }
  .archive-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-summary b { font-size: 19px; }
  .archive-summary span { font-size: 12px; }
  .archive-section > header small { text-align: left; }
  .season-story,
  .season-hero { grid-template-columns: 1fr; }
  .season-directives { grid-template-columns: 1fr; }
  .season-directive { min-height: 0; }
  .season-objectives,
  .season-rewards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-infected { grid-template-columns: 1fr; }
  .archive-medals { grid-template-columns: 1fr; }
  .archive-infected-item,
  .archive-medal { min-height: 0; padding: 13px; }
  .archive-infected-item p,
  .archive-medal p { font-size: 14px; }
  .archive-medal-actions { grid-template-columns: 1fr 1fr; }
  .archive-build-actions { display: grid; grid-template-columns: 1fr 1fr; }

  .tutorial-tip {
    right: var(--guidance-safe-right);
    left: var(--guidance-safe-left);
    padding: 12px 76px 12px 46px;
  }
  .tutorial-tip b { font-size: 15px; }
  .tutorial-tip p { font-size: 13px; }
  .tutorial-tip .tutorial-touch-hint { font-size: 11px; }

  .story-dialogue.dossier-radio { width: calc(100vw - 18px); }
  .dossier-radio .story-message p { font-size: 14px; }
  .dossier-radio .story-actions button { font-size: 12px; }

  .world-intro-card.dossier-briefing { grid-template-columns: 1fr; }
  .dossier-briefing .world-intro-visual {
    min-height: 148px;
    border-right: 0;
    border-bottom: 1px solid var(--fd-line);
  }
  .dossier-briefing .world-intro-copy { padding: 18px 17px; }
  .dossier-briefing .world-intro-copy p { font-size: 11px; }
  .dossier-briefing .world-intro-copy h2 { font-size: 22px; }
  .dossier-briefing .world-intro-copy div { font-size: 14px; line-height: 1.6; }
  .dossier-briefing > footer { display: grid; grid-template-columns: 1fr 1fr; }
  .dossier-briefing > footer button { font-size: 13px; }

  .report-card.dossier-report { width: 100%; padding: 18px 16px; }
  .dossier-report h2 { font-size: 30px; }
  .dossier-report .report-stats { gap: 6px; }
  .dossier-report .report-stats div { padding: 10px 4px; }
  .dossier-report .report-stats b { font-size: 20px; }
  .dossier-report .report-stats span { font-size: 11px; }
  .dossier-report .primary-actions { grid-template-columns: 1fr 1fr; }
  .dossier-report .primary-actions .primary { grid-column: 1 / -1; }
}
