/* NOX 1.2 — tactical neo-noir interface */
:root {
  --bg: #070907;
  --surface: #101410;
  --surface-2: #151b16;
  --surface-3: #202820;
  --line: rgba(221, 255, 105, 0.12);
  --line-strong: rgba(221, 255, 105, 0.24);
  --text: #f3f6ed;
  --muted: #929b8e;
  --accent: #d9ff4d;
  --accent-2: #64e9ff;
  --danger: #ff596a;
  --warning: #ffbd52;
  --info: #64e9ff;
  --good: #73f5a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --radius-sm: 9px;
  font-family: "Bahnschrift", "Arial Narrow", Inter, ui-sans-serif, system-ui, sans-serif;
}

html {
  background: #050605;
}

body {
  background:
    linear-gradient(rgba(217, 255, 77, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 255, 77, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 14% -10%, rgba(217, 255, 77, 0.12), transparent 31rem),
    radial-gradient(circle at 105% 25%, rgba(100, 233, 255, 0.08), transparent 29rem),
    #070907;
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 4px);
  opacity: 0.34;
}

h1,
h2,
h3 {
  font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.app-shell {
  padding-bottom: calc(94px + var(--safe-bottom));
}

.topbar {
  min-height: 72px;
  padding: max(11px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(6, 8, 6, 0.88);
  box-shadow: 0 12px 36px rgba(0,0,0,0.34);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.58;
}

.brand-mark {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 12px rgba(217,255,77,0.3));
}

.brand-copy strong {
  font-size: 0.9rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand-copy span {
  color: var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
}

.resource-pill,
.status-pill {
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 7px;
  border-color: rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.035);
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
}

.resource-pill .symbol {
  color: var(--accent);
}

.layout {
  width: min(100%, 1320px);
}

.main-content {
  padding: 18px 12px 32px;
}

.screen {
  gap: 13px;
}

.screen-header {
  align-items: center;
  padding: 4px 2px 7px;
  border-bottom: 1px solid var(--line);
}

.screen-header h1 {
  margin: 0 0 2px;
  font-size: clamp(1.65rem, 8vw, 2.6rem);
  letter-spacing: -0.055em;
}

.screen-header p {
  max-width: 48ch;
  font-family: ui-monospace, monospace;
  font-size: 0.73rem;
}

.card {
  border-color: rgba(217,255,77,0.105);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.025), transparent 42%),
    linear-gradient(150deg, rgba(18,23,18,0.98), rgba(8,11,9,0.98));
  box-shadow: 0 12px 36px rgba(0,0,0,0.27);
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 3px;
  background: var(--accent);
  opacity: 0.54;
  pointer-events: none;
}

.card-pad,
.quest-card {
  padding: 17px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 0.63rem;
  letter-spacing: 0.16em;
}

.muted {
  color: var(--muted);
}

.btn {
  min-height: 43px;
  border-radius: 7px;
  padding: 10px 14px;
  font-family: "Bahnschrift", sans-serif;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.btn-primary {
  color: #0a0d08;
  background: var(--accent);
  box-shadow: 0 8px 26px rgba(217,255,77,0.14);
}

.btn-primary:hover {
  background: #e6ff83;
}

.btn-ghost {
  border-color: rgba(217,255,77,0.13);
  background: rgba(217,255,77,0.035);
}

.btn-danger {
  border-color: rgba(255,89,106,0.35);
  background: rgba(255,89,106,0.13);
}

.progress {
  height: 7px;
  border-radius: 1px;
  background: rgba(255,255,255,0.07);
}

.progress > span {
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), #89ff9a);
  box-shadow: 0 0 13px rgba(217,255,77,0.35);
}

.progress.energy > span {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.reward-chip,
.tag {
  border-radius: 5px;
  padding: 5px 8px;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.035);
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.tag.accent {
  color: var(--accent);
  border-color: rgba(217,255,77,0.28);
}

.atlas-art,
.character-art {
  display: block;
  background-image: var(--art-image);
  background-position: var(--art-position);
  background-repeat: no-repeat;
  background-size: 300% 200%;
}

.hero-card-v2 {
  position: relative;
  min-height: 430px;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background-image:
    linear-gradient(90deg, rgba(5,7,5,0.97) 0%, rgba(5,7,5,0.78) 44%, rgba(5,7,5,0.12) 78%),
    linear-gradient(0deg, rgba(5,7,5,0.95), transparent 48%),
    var(--district-art);
  background-position: center;
  background-size: cover;
}

.hero-card-v2::before {
  content: "NOX // ACTIVE ROUTE";
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 16px;
  color: rgba(255,255,255,0.58);
  font-family: ui-monospace, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.17em;
}

.hero-card-v2::after {
  width: 42%;
  height: 3px;
  opacity: 0.9;
}

.hero-scanline {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.018) 3px 4px);
  mix-blend-mode: overlay;
}

.hero-character {
  position: absolute;
  z-index: 1;
  right: -52px;
  bottom: 0;
  width: min(82%, 520px);
  aspect-ratio: 1;
  background-color: #0a0d0b;
  filter: saturate(1.05) contrast(1.05);
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
}

.hero-copy-v2 {
  position: absolute;
  z-index: 5;
  left: 18px;
  right: 28%;
  bottom: 98px;
}

.hero-copy-v2 h1 {
  max-width: 9ch;
  margin: 0 0 5px;
  font-size: clamp(2.45rem, 14vw, 5.1rem);
  line-height: 0.82;
  text-shadow: 0 7px 24px rgba(0,0,0,0.65);
}

.hero-copy-v2 p {
  margin: 0 0 12px;
  color: rgba(255,255,255,0.78);
  font-family: ui-monospace, monospace;
  font-size: 0.69rem;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero-route-button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.67rem;
}

.hero-stats-v2 {
  position: absolute;
  z-index: 6;
  left: 13px;
  right: 13px;
  bottom: 13px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.hero-stats-v2 .mini-stat {
  padding: 9px 7px;
  border-radius: 7px;
  border-color: rgba(217,255,77,0.17);
  background: rgba(5,8,5,0.78);
  backdrop-filter: blur(10px);
}

.hero-stats-v2 .mini-stat strong {
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

.loadout-rail {
  padding: 14px;
}

.loadout-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.loadout-heading .eyebrow {
  margin: 0;
}

.loadout-heading strong {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.66rem;
}

.equipment-slots {
  gap: 7px;
}

.slot {
  min-height: 118px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-style: solid;
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  text-align: left;
}

.slot-art {
  width: 100%;
  aspect-ratio: 1.45;
  margin-bottom: 6px;
  border-radius: 5px;
  background-size: 300% 200%;
}

.slot span:not(.slot-art):not(.slot-placeholder) {
  font-family: ui-monospace, monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
}

.slot strong {
  min-height: 2.1em;
  font-size: 0.66rem;
  line-height: 1.05;
}

.slot-placeholder {
  display: grid;
  place-items: center;
  min-height: 55px;
  color: rgba(217,255,77,0.3);
  font-size: 1.5rem;
}

.slot-legendary {
  border-color: rgba(255,189,82,0.4);
  box-shadow: inset 0 0 22px rgba(255,189,82,0.05);
}

.inventory-grid,
.shop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.item-card {
  padding: 9px;
  border-radius: 10px;
}

.item-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, transparent 60%, rgba(217,255,77,0.035));
}

.item-art {
  width: 100%;
  aspect-ratio: 1.08;
  margin-bottom: 8px;
  border-radius: 7px;
  background-color: #0a0d0b;
  background-size: 300% 200%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.item-card h3 {
  min-height: 2.1em;
  margin: 7px 0 4px;
  font-size: 0.85rem;
  line-height: 1.02;
}

.item-card p {
  min-height: 3.5em;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.62rem;
}

.item-card .stack {
  gap: 6px;
}

.item-card .btn {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 0.61rem;
}

.rarity-common { border-color: rgba(255,255,255,0.09); }
.rarity-uncommon { border-color: rgba(115,245,168,0.27); }
.rarity-rare { border-color: rgba(100,233,255,0.34); }
.rarity-epic { border-color: rgba(209,102,255,0.42); }
.rarity-legendary {
  border-color: rgba(255,189,82,0.52);
  box-shadow: 0 12px 36px rgba(255,164,46,0.07);
}

.rarity-legendary::after {
  background: var(--warning);
  opacity: 1;
}

.fighter-card {
  min-height: 132px;
  padding: 12px;
  grid-template-columns: 108px 1fr;
  border-radius: 10px;
}

.fighter-portrait {
  width: 108px;
  border-radius: 8px;
}

.character-fighter {
  background-size: 300% 200%;
}

.fighter-card.enemy-card {
  background:
    linear-gradient(135deg, rgba(255,89,106,0.13), transparent 58%),
    #101010;
}

.battle-actions {
  gap: 6px;
}

.action-btn {
  min-height: 62px;
  border-radius: 7px;
}

.battle-log {
  font-family: ui-monospace, monospace;
}

.district-card {
  min-height: 245px;
  border-radius: 10px;
  filter: saturate(0.82) contrast(1.08);
}

.district-card::before {
  background: linear-gradient(to top, rgba(5,7,5,0.98), rgba(5,7,5,0.16) 82%);
}

.quest-card .quest-index {
  border-radius: 4px;
  background: rgba(217,255,77,0.1);
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

.bottom-nav {
  left: 8px;
  right: 8px;
  bottom: 8px;
  gap: 2px;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(8,11,8,0.92);
  box-shadow: 0 18px 50px rgba(0,0,0,0.52);
}

.nav-button {
  min-height: 57px;
  border-radius: 7px;
}

.nav-button .nav-icon {
  font-family: ui-monospace, monospace;
}

.nav-button .nav-label {
  font-size: 0.55rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.nav-button.active {
  color: #0b0d08;
  background: var(--accent);
}

.nav-button.battle-active:not(.active) {
  color: var(--danger);
}

.onboarding {
  background:
    linear-gradient(90deg, rgba(4,6,4,0.94), rgba(4,6,4,0.55)),
    url('/assets/generated/characters-atlas-v2.png') center/cover fixed;
}

.onboarding::before {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.018) 3px 4px),
    rgba(5,7,5,0.54);
  backdrop-filter: blur(2px);
}

.onboarding-panel {
  padding: 18px;
  border-radius: 13px;
  border-color: var(--line-strong);
  background: rgba(7,10,7,0.94);
}

.owner-gate-panel {
  box-shadow: 0 28px 90px rgba(0,0,0,0.7);
}

.input,
.select {
  border-radius: 7px;
  border-color: rgba(217,255,77,0.17);
  background: rgba(0,0,0,0.4);
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217,255,77,0.1);
}

.selection-grid {
  gap: 8px;
}

.selection-inner {
  height: 100%;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

.selection-card input:checked + .selection-inner {
  border-color: var(--accent);
  background: rgba(217,255,77,0.06);
  box-shadow: inset 0 0 0 1px rgba(217,255,77,0.13), 0 10px 30px rgba(0,0,0,0.24);
}

.faction-portrait-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: -1px -1px 11px;
}

.faction-mini-portrait {
  aspect-ratio: 0.84;
  border-radius: 5px;
  background-size: 300% 200%;
  filter: contrast(1.06) saturate(0.9);
}

.class-preview {
  width: 100%;
  aspect-ratio: 1.05;
  margin-bottom: 10px;
  border-radius: 6px;
  background-size: 300% 200%;
}

.modal {
  border-radius: 12px;
  background: #0b0e0b;
}

.modal-item-art {
  aspect-ratio: 1.35;
}

.toast,
.warning-box,
.info-box,
.success-box {
  border-radius: 7px;
}

@media (min-width: 620px) {
  .main-content {
    padding: 24px 20px 42px;
  }

  .hero-card-v2 {
    min-height: 500px;
  }

  .hero-character {
    right: 3%;
    width: min(62%, 570px);
  }

  .hero-copy-v2 {
    left: 28px;
    bottom: 108px;
  }

  .inventory-grid,
  .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .item-card {
    padding: 11px;
  }
}

@media (min-width: 920px) {
  .app-shell {
    padding-bottom: 0;
  }

  .layout {
    grid-template-columns: 226px minmax(0, 1fr);
  }

  .side-nav {
    top: 72px;
    height: calc(100vh - 72px);
    padding: 22px 13px;
    background: rgba(6,8,6,0.68);
    border-color: var(--line);
  }

  .side-nav .nav-button {
    border-radius: 7px;
  }

  .main-content {
    padding: 28px 30px 58px;
  }

  .hero-card-v2 {
    min-height: 545px;
  }

  .hero-copy-v2 {
    right: 48%;
  }

  .hero-copy-v2 h1 {
    font-size: 5.5rem;
  }

  .hero-character {
    right: 4%;
    width: 56%;
  }

  .hero-stats-v2 {
    right: 53%;
    left: 24px;
  }

  .inventory-grid,
  .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .hero-copy-v2 {
    right: 18%;
  }

  .hero-copy-v2 h1 {
    font-size: 2.15rem;
  }

  .resource-pill {
    padding-inline: 6px;
  }

  .nav-button .nav-label {
    display: none;
  }
}

/* NOX 1.3 — original dense browser-RPG command deck */
.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.nav-button.active .nav-icon {
  border-color: rgba(7, 9, 7, 0.28);
  background: rgba(7, 9, 7, 0.12);
}

.bottom-nav .nav-button {
  min-width: 56px;
}

.bottom-nav .nav-icon {
  margin-inline: auto;
}

.story-hero-card {
  min-height: clamp(290px, 37vw, 430px) !important;
  background-position: center 58%;
  border-color: rgba(100, 233, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 20px 50px rgba(0, 0, 0, 0.34);
}

.story-hero-card::before {
  background:
    linear-gradient(to top, rgba(4, 7, 7, 0.99) 2%, rgba(4, 7, 7, 0.7) 45%, rgba(4, 7, 7, 0.08) 82%),
    linear-gradient(to right, rgba(4, 7, 7, 0.5), transparent 72%);
}

.story-hero-card .hero-content {
  padding: clamp(22px, 4vw, 34px);
}

.story-hero-card h1 {
  margin-bottom: 6px;
  font-size: clamp(2.3rem, 7vw, 4.9rem);
  line-height: 0.92;
}

.story-hero-card p {
  max-width: 64ch;
  color: rgba(244, 248, 239, 0.82);
}

.encounter-roster {
  min-height: 88px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: rgba(100, 233, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(100, 233, 255, 0.06), transparent 48%),
    #0b0f0d;
}

.encounter-roster-copy {
  min-width: 92px;
}

.encounter-roster-copy .eyebrow {
  margin: 0 0 2px;
}

.encounter-roster-copy strong {
  font: 800 1.2rem/1 ui-monospace, monospace;
}

.encounter-roster-list {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  overflow-x: auto;
}

.roster-enemy {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: #111713;
  opacity: 0.52;
}

.roster-enemy.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 255, 77, 0.1), 0 0 20px rgba(217, 255, 77, 0.14);
  opacity: 1;
}

.roster-enemy.defeated {
  filter: grayscale(1);
  opacity: 0.28;
}

.roster-enemy.defeated::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--danger);
  background: rgba(4, 6, 4, 0.52);
  font: 900 1.45rem/1 ui-monospace, monospace;
}

.roster-portrait {
  width: 100%;
  height: 100%;
}

.roster-enemy b {
  position: absolute;
  z-index: 2;
  right: 3px;
  bottom: 2px;
  min-width: 15px;
  padding: 1px 3px;
  border-radius: 3px;
  color: #080a07;
  background: var(--accent);
  font: 900 0.58rem/1.25 ui-monospace, monospace;
  text-align: center;
}

.enemy-fighter {
  background-color: #0b1110;
  background-size: 300% 200%;
}

.enemy-role-1 { filter: saturate(0.92) contrast(1.04); }
.enemy-role-2 { filter: saturate(1.08) contrast(1.08); }
.enemy-role-3 { filter: saturate(1.16) contrast(1.12); }

.nav-rail-header,
.nav-rail-footer {
  display: none;
}

@media (min-width: 920px) {
  .layout {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .side-nav {
    grid-template-rows: auto repeat(9, auto) 1fr;
    gap: 7px;
    padding: 18px 13px 14px;
    background:
      linear-gradient(180deg, rgba(100, 233, 255, 0.035), transparent 34%),
      rgba(5, 8, 6, 0.92);
  }

  .nav-rail-header {
    display: grid;
    gap: 4px;
    margin: -2px 2px 8px;
    padding: 0 4px 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav-rail-header span {
    color: var(--accent-2);
    font: 700 0.55rem/1 ui-monospace, monospace;
    letter-spacing: 0.16em;
  }

  .nav-rail-header strong {
    font-size: 0.77rem;
    letter-spacing: 0.1em;
  }

  .side-nav .nav-button {
    position: relative;
    min-height: 52px;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    padding: 0 10px;
    border: 1px solid transparent;
  }

  .side-nav .nav-button:hover {
    border-color: rgba(217, 255, 77, 0.13);
    background: rgba(217, 255, 77, 0.035);
  }

  .side-nav .nav-button.active {
    border-color: rgba(217, 255, 77, 0.64);
    box-shadow: 0 8px 24px rgba(217, 255, 77, 0.1);
  }

  .side-nav .nav-button.active::after {
    content: "";
    position: absolute;
    top: 8px;
    right: -14px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
  }

  .side-nav .nav-label {
    font-size: 0.68rem;
    letter-spacing: 0.07em;
  }

  .nav-rail-footer {
    align-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 11px 5px 2px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font: 700 0.52rem/1.2 ui-monospace, monospace;
    letter-spacing: 0.08em;
  }

  .nav-rail-footer b {
    margin-left: auto;
    color: var(--accent-2);
  }
}

@media (max-width: 520px) {
  .encounter-roster {
    align-items: flex-start;
    flex-direction: column;
  }

  .encounter-roster-list {
    width: 100%;
    justify-content: flex-start;
  }

  .roster-enemy {
    width: 48px;
    height: 48px;
  }
}

/* NOX 1.4 — operations, workshop and tactical combat loop */
.material-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.material-pill {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(9, 13, 10, 0.9);
}

.material-pill > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--accent);
  font: 900 0.9rem/1 ui-monospace, monospace;
}

.material-pill div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.material-pill small {
  color: var(--muted);
  font: 700 0.58rem/1 ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.material-pill strong {
  overflow: hidden;
  font: 900 1rem/1 ui-monospace, monospace;
  text-overflow: ellipsis;
}

.material-intel > span { color: var(--accent-2); }
.material-cores > span { color: #ff8dd0; }
.material-influence > span { color: #b99cff; }

.operation-district-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.operation-district-tabs::-webkit-scrollbar { display: none; }

.district-tab {
  min-width: 112px;
  display: grid;
  gap: 3px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.district-tab span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.district-tab small {
  font: 700 0.57rem/1 ui-monospace, monospace;
  text-transform: uppercase;
}

.district-tab.active {
  border-color: var(--accent);
  color: #090b08;
  background: var(--accent);
}

.district-tab.active span { color: #090b08; }

.operation-hero {
  min-height: 265px;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background-image:
    linear-gradient(90deg, rgba(4, 7, 5, 0.98), rgba(4, 7, 5, 0.73) 52%, rgba(4, 7, 5, 0.12)),
    linear-gradient(0deg, rgba(4, 7, 5, 0.92), transparent 70%),
    var(--operation-art);
  background-position: center;
  background-size: cover;
}

.operation-hero-copy {
  width: min(620px, 100%);
}

.operation-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
}

.operation-hero p { color: #c0c8bc; }

.mastery-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 7px;
  font: 750 0.7rem/1 ui-monospace, monospace;
  text-transform: uppercase;
}

.mastery-line strong { color: var(--accent); }

.operation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.operation-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.operation-card h2,
.operation-card p { margin: 0; }

.operation-card p { min-height: 3.3em; }

.operation-card .btn { margin-top: auto; }

.operation-risk-2 { border-color: rgba(100, 233, 255, 0.24); }
.operation-risk-3 { border-color: rgba(255, 89, 106, 0.34); }
.operation-risk-3::after { background: var(--danger); }

.risk-dots {
  color: var(--warning);
  font: 800 0.68rem/1 ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.operation-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.operation-specs span {
  display: grid;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  color: var(--muted);
  font: 650 0.57rem/1.2 ui-monospace, monospace;
  text-align: center;
}

.operation-specs b {
  color: var(--text);
  font-size: 0.78rem;
}

.objective-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.objective-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.objective-card.claimed {
  opacity: 0.62;
  border-color: rgba(115, 245, 168, 0.22);
}

.intent-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 15px;
  border-left: 3px solid var(--accent-2);
}

.intent-panel div { display: grid; }
.intent-panel .eyebrow { margin: 0 0 3px; }
.intent-panel strong { text-transform: uppercase; }
.intent-panel p { margin: 0; color: var(--muted); font-size: 0.76rem; }
.intent-heavy,
.intent-pierce,
.intent-drain { border-left-color: var(--danger); background: linear-gradient(90deg, rgba(255, 89, 106, 0.1), rgba(8, 11, 9, 0.98) 45%); }
.intent-stunned { border-left-color: var(--good); }

.progress.momentum > span {
  background: linear-gradient(90deg, #64e9ff, #d9ff4d, #ffbd52);
  box-shadow: 0 0 14px rgba(255, 189, 82, 0.34);
}

.momentum-label { margin-top: 10px; }

.finisher-action:not(:disabled) {
  color: #130b00;
  border-color: var(--warning);
  background: var(--warning);
  box-shadow: 0 0 22px rgba(255, 189, 82, 0.18);
}

.recipe-grid,
.calibration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.recipe-card,
.calibration-card {
  min-width: 0;
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.recipe-card { grid-template-columns: 92px minmax(0, 1fr); }
.recipe-copy { min-width: 0; display: grid; gap: 8px; }
.recipe-art { width: 92px; min-height: 118px; border-radius: 6px; }
.cost-line { color: var(--accent); font: 750 0.62rem/1.35 ui-monospace, monospace; }

.calibration-card {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
}

.calibration-card .btn { grid-column: 1 / -1; }
.calibration-card h3 { margin: 6px 0 3px; }
.calibration-art { width: 72px; height: 82px; border-radius: 6px; }

@media (min-width: 920px) {
  .side-nav { grid-template-rows: auto repeat(9, auto) 1fr; }
  .side-nav .nav-button { min-height: 46px; }
}

@media (max-width: 780px) {
  .material-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-grid,
  .objective-grid,
  .recipe-grid,
  .calibration-grid { grid-template-columns: 1fr; }
  .operation-card p { min-height: 0; }
}

@media (max-width: 520px) {
  .operation-hero { min-height: 300px; padding: 18px; }
  .operation-specs { grid-template-columns: 1fr; }
  .operation-specs span { grid-template-columns: 34px 1fr; align-items: center; text-align: left; }
  .intent-panel { align-items: flex-start; flex-direction: column; gap: 5px; }
  .recipe-card { grid-template-columns: 76px minmax(0, 1fr); }
  .recipe-art { width: 76px; min-height: 100px; }
}
