/* ---- Tool pages ---- */
.page-hero {
  padding-top: 56px;
  padding-bottom: 40px;
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.page-hero h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.9;
}

.page-lead {
  max-width: 640px;
  margin-bottom: 24px;
  color: #b2bcb7;
  font-size: 1.02rem;
  line-height: 1.7;
}

.inline-link {
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.callout-panel {
  padding: 22px;
  border: 1px solid #3e4a4c;
  background:
    linear-gradient(135deg, transparent 12px, #0b181a 0) top left,
    linear-gradient(225deg, transparent 12px, #0b181a 0) top right,
    linear-gradient(315deg, transparent 12px, #0b181a 0) bottom right,
    linear-gradient(45deg, transparent 12px, #0b181a 0) bottom left;
  background-size: 52% 52%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 3px #060809;
}

.callout-panel.warn-panel {
  border-color: #6a4a2a;
}

.callout-list {
  margin: 0 0 18px;
  padding-left: 18px;
  color: #aeb8b3;
  font-size: 0.88rem;
  line-height: 1.65;
}

.callout-list li + li {
  margin-top: 8px;
}

.callout-body {
  margin: 0;
  color: #aeb8b3;
  font-size: 0.88rem;
  line-height: 1.65;
}

.tool-section {
  border-top: 1px solid var(--line-soft);
}

.alt-section {
  background: #070a0b;
}

.tool-panel {
  margin-bottom: 36px;
  padding: 22px;
  border: 1px solid #3a4749;
  background: #080d0e;
  box-shadow: inset 0 0 0 3px #050708;
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  align-items: end;
  margin-bottom: 20px;
}

.tool-controls-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: min(100%, 260px);
}

.field span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field select,
.field input {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid #455153;
  background: var(--panel);
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #aeb8b3;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.tool-output,
.result-grid {
  display: grid;
  gap: 14px;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-card {
  padding: 18px;
  border: 1px solid #3e494a;
  background: #0a1112;
}

.result-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.result-stage {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-meta strong {
  font-family: var(--mono);
  font-size: 1rem;
  text-transform: uppercase;
}

.password-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.password-icons.is-text code {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.icon-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #5c6a6c;
  background: #0c2428;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 2px #041012;
}

.result-notes {
  margin-bottom: 14px;
  color: #8f9a96;
  font-size: 0.82rem;
  line-height: 1.55;
}

.result-verification {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
  padding: 9px 11px;
  border-left: 3px solid #68716e;
  background: #0a1112;
  color: #8f9a96;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.5;
}

.result-verification strong {
  color: #cbd5cf;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-verification--confirmed {
  border-left-color: var(--green);
}

.result-verification--confirmed strong {
  color: var(--green);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-actions .button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.65rem;
  box-shadow: inset 0 0 0 2px #060808, 2px 2px 0 #000;
}

.gs-code {
  display: inline-block;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #4a5a4a;
  background: #0a150c;
  color: var(--green);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tool-empty,
.tool-error {
  margin: 0;
  color: #7f8b87;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.tool-error {
  color: var(--red);
}

.static-table-wrap {
  overflow-x: auto;
}

.table-title {
  margin-bottom: 14px;
  color: #d7ddd8;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border: 1px solid #2c3637;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #0c1516;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  background: #080d0e;
  color: #c5cec9;
}

.data-table code {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.9em;
  letter-spacing: 0.06em;
}

.source-note {
  margin-top: 12px;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.faq-card {
  padding: 20px;
  border: 1px solid #3e494a;
  background: #0a1112;
}

.faq-card h3 {
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.faq-card p {
  margin: 0;
  color: #aeb8b3;
  font-size: 0.88rem;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .page-hero-grid,
  .result-grid,
  .faq-grid,
  .tool-controls-3 {
    grid-template-columns: 1fr;
  }

  .field {
    min-width: 100%;
  }
}

@media (max-width: 620px) {
  .page-hero {
    padding-top: 36px;
  }

  .tool-panel {
    padding: 16px;
  }

  .data-table th,
  .data-table td {
    padding: 10px;
    font-size: 0.75rem;
  }

  .icon-chip {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.62rem;
  }
}

/* ---- Pixel icons & GBC screen previews ---- */
.pixel-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.icon-chip-image {
  flex-direction: column;
  gap: 6px;
  min-width: 72px;
  min-height: auto;
  padding: 8px 6px 6px;
  background: #071416;
}

.icon-chip-image img {
  width: 48px;
  height: 48px;
}

.icon-chip-image em {
  max-width: 70px;
  color: #9aa49f;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.screen-preview {
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid #3e494a;
  background:
    linear-gradient(180deg, #12181a, #070b0c);
  box-shadow: inset 0 0 0 3px #050708;
}

.screen-preview img {
  width: 100%;
  max-width: 360px;
  height: auto;
  margin-inline: auto;
  border: 1px solid #4a5557;
  background: #020404;
}

.screen-preview figcaption {
  margin-top: 8px;
  color: #7f8b87;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.result-card-visual {
  display: grid;
}

.icon-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 28px;
}

.icon-legend-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #2c3637;
  background: #080d0e;
}

.icon-legend-item img {
  width: 48px;
  height: 48px;
  background: #071416;
  border: 1px solid #3a4749;
}

.icon-legend-item span {
  color: #c5cec9;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.asset-note {
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #3a4749;
  background: #0a1214;
  color: #8f9a96;
  font-size: 0.82rem;
  line-height: 1.6;
}

.asset-note strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-icon-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.table-icon-row img {
  width: 28px;
  height: 28px;
  background: #071416;
  border: 1px solid #3a4749;
}

.table-icon-row span {
  color: #8f9a96;
  font-size: 0.72rem;
}

@media (max-width: 900px) {
  .icon-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .icon-legend {
    grid-template-columns: 1fr;
  }

  .icon-chip-image {
    min-width: 64px;
  }

  .icon-chip-image img {
    width: 40px;
    height: 40px;
  }
}

.rom-capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.rom-capture-grid .screen-preview img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: #000;
  border: 2px solid rgba(255, 200, 80, 0.35);
}

/* ==========================================================================
   P0 visual mission walkthrough
   ========================================================================== */
.walkthrough-page {
  background:
    radial-gradient(circle at 82% 9%, rgb(185 242 74 / 9%), transparent 30rem),
    radial-gradient(circle at 9% 28%, rgb(242 138 33 / 7%), transparent 24rem),
    #050607;
}

.walkthrough-page h2,
.walkthrough-page h3,
.walkthrough-page h4 {
  text-wrap: balance;
}

.walkthrough-hero {
  position: relative;
  padding: 72px 0 0;
  overflow: hidden;
  border-bottom: 1px solid #263234;
}

.walkthrough-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(185 242 74 / 3%) 1px, transparent 1px),
    linear-gradient(rgb(185 242 74 / 3%) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.walkthrough-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.75fr) minmax(540px, 1.25fr);
  gap: clamp(40px, 5vw, 76px);
  align-items: center;
  padding-bottom: 62px;
}

.walkthrough-hero-copy h1 {
  max-width: 720px;
  margin-bottom: 26px;
  font-size: clamp(4.8rem, 8.3vw, 8.2rem);
  line-height: 0.74;
}

.walkthrough-deck {
  max-width: 650px;
  margin-bottom: 28px;
  color: #b7c1bc;
  font-size: 1.08rem;
  line-height: 1.75;
}

.walkthrough-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.walkthrough-hero-visual {
  position: relative;
  margin: 0;
  padding: 12px;
  border: 1px solid #526063;
  background: linear-gradient(180deg, #11191b, #06090a);
  box-shadow: var(--shadow), inset 0 0 0 3px #030405;
}

.walkthrough-hero-visual::before,
.walkthrough-hero-visual::after {
  position: absolute;
  z-index: 2;
  width: 26px;
  height: 26px;
  content: "";
  pointer-events: none;
}

.walkthrough-hero-visual::before {
  top: 5px;
  left: 5px;
  border-top: 2px solid var(--green);
  border-left: 2px solid var(--green);
}

.walkthrough-hero-visual::after {
  right: 5px;
  bottom: 35px;
  border-right: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
}

.walkthrough-hero-visual img {
  width: 100%;
  height: auto;
  border: 1px solid #303c3e;
}

.walkthrough-hero-visual figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: #77827e;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.walkthrough-hero-visual figcaption span {
  color: var(--green);
}

.walkthrough-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #2b3739;
  background: #070b0c;
}

.walkthrough-stats > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 80px;
  padding: 18px 26px;
  border-right: 1px solid #263234;
}

.walkthrough-stats > div:last-child {
  border-right: 0;
}

.walkthrough-stats strong {
  color: var(--orange);
  font-family: var(--display);
  font-size: 2.1rem;
  font-style: italic;
  line-height: 1;
}

.walkthrough-stats span {
  color: #85908b;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mission-jump {
  position: sticky;
  top: 76px;
  z-index: 80;
  border-bottom: 1px solid #364345;
  background: rgb(5 7 8 / 96%);
  backdrop-filter: blur(14px);
}

.mission-jump-inner {
  display: grid;
  grid-template-columns: auto repeat(8, minmax(0, 1fr));
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
}

.mission-jump-label {
  display: grid;
  min-width: 118px;
  place-items: center start;
  padding-inline: 16px;
  color: #798480;
  font-family: var(--mono);
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mission-jump a {
  position: relative;
  display: grid;
  min-width: 88px;
  place-items: center;
  gap: 1px;
  min-height: 58px;
  padding: 8px 10px;
  border-left: 1px solid #202a2b;
  color: #7f8985;
  font-family: var(--mono);
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.mission-jump a b {
  font-size: 0.78rem;
}

.mission-jump a span {
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mission-jump a:hover,
.mission-jump a[aria-current="true"] {
  background: #102427;
  color: var(--green);
}

.mission-jump a[aria-current="true"]::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  content: "";
  background: var(--green);
  box-shadow: 0 0 12px rgb(185 242 74 / 40%);
}

.walkthrough-toolbar {
  padding: 38px 0;
  border-bottom: 1px solid #283436;
  background: #071012;
}

.walkthrough-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.55fr) minmax(300px, 0.72fr);
  gap: 28px;
  align-items: center;
}

.walkthrough-toolbar .eyebrow {
  margin-bottom: 8px;
}

.walkthrough-toolbar h2 {
  max-width: 680px;
  margin-bottom: 9px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2rem, 3.3vw, 3.2rem);
  font-style: italic;
  line-height: 0.96;
  text-transform: uppercase;
}

.walkthrough-toolbar p {
  max-width: 720px;
  margin: 0;
  color: #8f9a96;
  font-size: 0.84rem;
  line-height: 1.6;
}

.display-control {
  display: grid;
  gap: 10px;
}

.display-control > span,
.walkthrough-progress > div > span {
  color: #7e8985;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.display-control button {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: 1px solid #526063;
  background: #0b1719;
  color: var(--text);
  cursor: pointer;
}

.display-control button i {
  position: relative;
  width: 38px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #1f2b2d;
  box-shadow: inset 0 0 0 1px #4d5a5d;
}

.display-control button i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  content: "";
  background: #7d8784;
  transition: transform 160ms ease, background 160ms ease;
}

.display-control button[aria-pressed="true"] i::after {
  background: var(--green);
  transform: translateX(18px);
}

.display-control button b {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.walkthrough-progress {
  display: grid;
  gap: 9px;
  padding: 15px 17px;
  border: 1px solid #354244;
  background: #080e0f;
}

.walkthrough-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.walkthrough-progress strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.walkthrough-progress #walkthrough-reset-progress {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7e8985;
  font-family: var(--mono);
  font-size: 0.58rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.section-tight {
  padding-block: 72px;
}

.compact-heading {
  margin-bottom: 28px;
}

.compact-heading h2,
.compact-heading h3 {
  margin-bottom: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.field-key {
  border-bottom: 1px solid #253133;
  background: linear-gradient(180deg, #050607, #080c0d);
}

.field-key-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.field-key-grid article {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 13px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid #303c3e;
  background: #080e0f;
}

.key-swatch {
  width: 13px;
  height: 44px;
  margin-top: 2px;
  box-shadow: 0 0 12px rgb(255 255 255 / 9%);
}

.key-green { background: var(--green); }
.key-orange { background: var(--orange); }
.key-red { background: #ef564d; }
.key-yellow { background: var(--yellow); }

.field-key-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-key-grid p {
  margin: 0;
  color: #89948f;
  font-size: 0.76rem;
  line-height: 1.55;
}

.controls-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid #303c3e;
  background: #070b0c;
}

.controls-strip > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 11px 14px;
  border-right: 1px solid #263133;
}

.controls-strip > div:last-child { border-right: 0; }

.controls-strip kbd,
.step-stack kbd {
  display: inline-grid;
  min-width: 34px;
  min-height: 30px;
  place-items: center;
  padding: 3px 7px;
  border: 1px solid #5a6769;
  border-bottom-width: 3px;
  border-radius: 4px;
  background: #12191a;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.62rem;
  box-shadow: inset 0 0 0 2px #090d0e;
}

.controls-strip span {
  color: #89948f;
  font-size: 0.66rem;
  line-height: 1.35;
}

.controls-strip b {
  display: block;
  color: #d8ddd7;
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
}

.mission-file {
  scroll-margin-top: 134px;
  padding-bottom: 94px;
  border-bottom: 1px solid #293537;
  background:
    radial-gradient(circle at 95% 4%, rgb(185 242 74 / 7%), transparent 24rem),
    #050607;
}

.mission-file-alt {
  background:
    radial-gradient(circle at 4% 8%, rgb(242 138 33 / 7%), transparent 24rem),
    #070a0b;
}

.mission-file-header {
  margin-bottom: 58px;
  padding: 60px 0 48px;
  border-top: 1px solid #2e3a3c;
  border-bottom: 1px solid #2e3a3c;
  background: linear-gradient(90deg, #071012, #0b1b1e 50%, #071012);
}

.mission-file-header-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(300px, 0.62fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
}

.mission-number-block {
  display: grid;
  min-height: 150px;
  place-content: center;
  border: 1px solid #425052;
  background: #071012;
  text-align: center;
  box-shadow: inset 0 0 0 4px #040607;
}

.mission-number-block span,
.mission-number-block i {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mission-number-block span { color: #81908b; }
.mission-number-block i { color: var(--green); }

.mission-number-block strong {
  margin: 5px 0 7px;
  color: var(--orange);
  font-family: var(--display);
  font-size: 4.7rem;
  font-style: italic;
  line-height: 0.88;
}

.mission-file-header .eyebrow { margin-bottom: 11px; }

.mission-file-header h2 {
  margin-bottom: 14px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(3rem, 5.8vw, 5.7rem);
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 0.86;
  text-transform: uppercase;
}

.mission-file-header p:last-child {
  max-width: 760px;
  margin: 0;
  color: #a1ada7;
  font-size: 0.95rem;
  line-height: 1.65;
}

.mission-brief-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border: 1px solid #354244;
  background: #070c0d;
}

.mission-brief-facts div {
  min-height: 78px;
  padding: 13px;
  border-right: 1px solid #263133;
  border-bottom: 1px solid #263133;
}

.mission-brief-facts div:nth-child(2n) { border-right: 0; }
.mission-brief-facts div:nth-last-child(-n + 2) { border-bottom: 0; }

.mission-brief-facts dt {
  color: #78847f;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mission-brief-facts dd {
  margin: 6px 0 0;
  color: #d7ddd7;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.mission-body,
.mission-file-body {
  display: grid;
  gap: 58px;
}

.panel-kicker {
  margin-bottom: 10px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.objective-board {
  display: grid;
  grid-template-columns: minmax(200px, 0.58fr) minmax(420px, 1.25fr) 260px;
  gap: 28px;
  align-items: start;
  padding: 28px;
  border: 1px solid #3c494b;
  background: #091113;
  box-shadow: inset 0 0 0 4px #050708;
}

.objective-board h3,
.panel-heading-row h3,
.operation-steps h3,
.stuck-card h3,
.password-access-copy h3,
.code-breaker h3,
.item-intel h3,
.raw-capture-gallery h3 {
  margin-bottom: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.1vw, 3rem);
  font-style: italic;
  line-height: 0.96;
  text-transform: uppercase;
}

.objective-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.objective-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  padding: 13px;
  border-left: 3px solid var(--green);
  background: #070d0e;
}

.objective-list li > span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 900;
}

.objective-list strong {
  display: block;
  margin-bottom: 3px;
  color: #dce1dc;
  font-size: 0.84rem;
}

.objective-list p {
  margin: 0;
  color: #89948f;
  font-size: 0.75rem;
  line-height: 1.5;
}

.briefing-screen {
  margin: 0;
  padding: 10px;
  border: 1px solid #4b585a;
  background: #030405;
  box-shadow: inset 0 0 0 3px #101516;
}

.briefing-screen img {
  width: 100%;
  height: auto;
  background: #000;
}

.briefing-screen figcaption {
  margin-top: 8px;
  color: #7e8985;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.panel-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 22px;
}

.accuracy-badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #495759;
  background: #0a1112;
  color: #89948f;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.route-map-panel {
  padding: 28px;
  border: 1px solid #3a4749;
  background: #070b0c;
}

.route-map-panel figure {
  margin: 0;
}

.route-map-panel .zoomable-media,
.route-map-panel > figure {
  position: relative;
  display: block;
}

.route-map-panel img,
.annotated-frame img,
.mission-tip-figure img,
.visual-frame-media > img:not(.is-clean-frame) {
  width: 100%;
  height: auto;
  border: 1px solid #273234;
  background: #030405;
}

.route-map-panel img {
  display: block;
  background: #030405;
  cursor: zoom-in;
}

.route-map-panel figcaption,
.annotated-frame figcaption,
.mission-tip-figure figcaption {
  margin-top: 11px;
  color: #9aa49f;
  font-size: 0.78rem;
  line-height: 1.55;
}

.zoomable-media {
  position: relative;
  display: block;
  margin: 0;
}

.zoomable-media > img,
button.zoomable-trigger {
  display: block;
  width: 100%;
  height: auto;
}

button.zoomable-trigger {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

button.zoomable-trigger:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.zoom-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgb(185 242 74 / 35%);
  background: rgb(2 5 5 / 90%);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Full-bleed route maps on wide screens so schematic labels stay readable */
@media (min-width: 1180px) {
  .shell > .route-map-panel,
  .mission-body > .route-map-panel,
  .mission-file-body > .route-map-panel {
    width: min(1480px, calc(100vw - 32px));
    margin-inline: calc(50% - min(740px, calc(50vw - 16px)));
  }
}

/* Field plates and annotated ROM frames */
.field-plate-grid {
  display: grid;
  gap: 28px;
}

.field-plate {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1.58fr);
  gap: 22px;
  align-items: start;
  padding: 22px;
  border: 1px solid #3a4749;
  background: #070b0c;
}

.field-plate-copy h3 {
  margin-bottom: 10px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
  font-style: italic;
  line-height: 0.98;
  text-transform: uppercase;
}

.field-plate-copy p:not(.panel-kicker) {
  margin: 0;
  color: #9aa49f;
  font-size: 0.84rem;
  line-height: 1.6;
}

.annotated-frame,
.mission-tip-figure,
.briefing-frame {
  margin: 0;
  padding: 10px;
  border: 1px solid #445153;
  background: #080d0e;
  box-shadow: inset 0 0 0 3px #040607;
}

.annotated-frame img,
.mission-tip-figure img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: #020404;
}

.briefing-frame {
  max-width: 280px;
  justify-self: end;
}

.briefing-frame img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

.briefing-frame figcaption {
  margin-top: 8px;
  color: #7e8985;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.mission-tip-figure {
  margin-top: 18px;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgb(2 4 5 / 92%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.image-lightbox-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1600px, 100%);
  height: min(92vh, 100%);
  max-height: 92vh;
  border: 1px solid #445153;
  background: #05090a;
  box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
}

.image-lightbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #2f3b3d;
  background: #091113;
}

.image-lightbox-toolbar p {
  margin: 0;
  color: #c5cec9;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.image-lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-lightbox-actions button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #536164;
  background: #10191a;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.image-lightbox-actions button:hover,
.image-lightbox-actions button:focus-visible {
  border-color: var(--green);
}

.image-lightbox-stage {
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px),
    #020404;
  background-size: 24px 24px;
  cursor: grab;
  touch-action: pan-x pan-y;
}

.image-lightbox-stage.is-dragging {
  cursor: grabbing;
}

.image-lightbox-stage img {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0 auto;
  transform-origin: center top;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox-stage img.is-pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.image-lightbox-caption {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid #2f3b3d;
  color: #9aa49f;
  font-size: 0.78rem;
  line-height: 1.5;
  background: #091113;
}

body.lightbox-open {
  overflow: hidden;
}

.visual-walkthrough {
  display: grid;
  gap: 34px;
}

.visual-walkthrough .compact-heading h3 {
  font-size: clamp(2.1rem, 4vw, 3.8rem);
}

.visual-step-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(330px, 0.62fr);
  gap: 24px;
  align-items: stretch;
}

.visual-step-grid-reverse {
  grid-template-columns: minmax(330px, 0.62fr) minmax(0, 1.38fr);
}

.visual-frame {
  min-width: 0;
  margin: 0;
  border: 1px solid #445153;
  background: #080d0e;
  box-shadow: inset 0 0 0 3px #040607;
}

.visual-frame-media {
  position: relative;
  display: grid;
  aspect-ratio: 1200 / 760;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgb(255 255 255 / 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.018) 1px, transparent 1px),
    #020404;
  background-size: 16px 16px;
}

.visual-frame-media > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 120ms ease;
}

.visual-frame-media > img.is-clean-frame {
  width: auto;
  max-width: 100%;
  height: 100%;
  padding: 20px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.frame-source {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 8px;
  border: 1px solid rgb(185 242 74 / 35%);
  background: rgb(2 5 5 / 88%);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.visual-frame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border-top: 1px solid #303c3e;
}

.visual-frame figcaption div {
  display: grid;
  gap: 2px;
}

.visual-frame figcaption span {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.visual-frame figcaption strong {
  color: #dce1dc;
  font-size: 0.75rem;
}

.frame-toggle,
.copy-code {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #536164;
  background: #10191a;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.frame-toggle:hover,
.copy-code:hover {
  border-color: var(--green);
}

.step-stack {
  display: grid;
  align-content: stretch;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: route-step;
}

.step-stack li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 13px;
  align-items: start;
  padding: 16px;
  border: 1px solid #344143;
  background: #091113;
}

.step-stack li > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #516063;
  background: #050708;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
}

.step-stack h4 {
  margin: 0 0 5px;
  color: #e0e4df;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.step-stack p {
  margin: 0;
  color: #929d98;
  font-size: 0.76rem;
  line-height: 1.55;
}

.operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.operation-steps,
.stuck-card {
  padding: 28px;
  border: 1px solid #3a4749;
  background: #091113;
}

.operation-steps h3 { margin-bottom: 24px; }

.compact-route-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-route-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 13px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid #273234;
}

.compact-route-list li:last-child { border-bottom: 1px solid #273234; }

.compact-route-list span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
}

.compact-route-list p {
  margin: 0;
  color: #a4aea9;
  font-size: 0.82rem;
  line-height: 1.6;
}

.stuck-card {
  position: relative;
  overflow: hidden;
  border-color: #6b4b1e;
  background: linear-gradient(145deg, #181207, #090d0e 67%);
}

.stuck-card::after {
  position: absolute;
  right: -54px;
  bottom: -54px;
  width: 170px;
  height: 170px;
  border: 20px solid rgb(242 138 33 / 6%);
  border-radius: 50%;
  content: "";
}

.stuck-card-red {
  border-color: #673330;
  background: linear-gradient(145deg, #1d0c0b, #090d0e 67%);
}

.stuck-label {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 9px;
  background: var(--orange);
  color: #080604;
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stuck-card-red .stuck-label { background: #ef564d; }

.stuck-card h3 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 2.7vw, 2.65rem);
}

.stuck-card > p {
  color: #a5afa9;
  font-size: 0.82rem;
  line-height: 1.65;
}

.stuck-action {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding: 10px;
  border: 1px solid #475456;
  background: rgb(5 8 9 / 82%);
}

.stuck-action img {
  width: 58px;
  height: 58px;
  image-rendering: pixelated;
  background: #071416;
}

.stuck-action span {
  color: #a1aaa6;
  font-size: 0.7rem;
}

.stuck-action b {
  display: block;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.item-intel,
.raw-capture-gallery {
  padding: 28px;
  border: 1px solid #3a4749;
  background: #070b0c;
}

.item-table-wrap {
  overflow-x: auto;
  border: 1px solid #303c3e;
}

.walkthrough-item-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.walkthrough-item-table th,
.walkthrough-item-table td {
  padding: 13px 14px;
  border-right: 1px solid #263234;
  border-bottom: 1px solid #263234;
  text-align: left;
  vertical-align: middle;
}

.walkthrough-item-table th:last-child,
.walkthrough-item-table td:last-child { border-right: 0; }
.walkthrough-item-table tbody tr:last-child td { border-bottom: 0; }

.walkthrough-item-table th {
  background: #0f1b1d;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.walkthrough-item-table td {
  background: #080e0f;
  color: #99a49f;
  font-size: 0.76rem;
  line-height: 1.45;
}

.walkthrough-item-table tbody tr:hover td { background: #0b1517; }

.walkthrough-item-table td:first-child { width: 80px; }

.walkthrough-item-table img {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  background: #071416;
  border: 1px solid #344143;
}

.walkthrough-item-table strong { color: #e0e4df; }

.required-pill,
.optional-pill {
  display: inline-block;
  padding: 5px 7px;
  border: 1px solid rgb(185 242 74 / 42%);
  background: rgb(185 242 74 / 8%);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.optional-pill {
  border-color: #4b585a;
  background: #111819;
  color: #89948f;
}

.raw-capture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.raw-capture-grid figure {
  margin: 0;
  padding: 9px;
  border: 1px solid #354244;
  background: #030405;
}

.raw-capture-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 160 / 144;
  object-fit: contain;
  background: #000;
}

.raw-capture-grid figcaption {
  margin-top: 7px;
  color: #818c88;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.mission-complete-panel {
  display: grid;
  grid-template-columns: auto 52px 1fr;
  gap: 14px;
  align-items: center;
  padding: 20px 24px;
  border: 1px solid #425052;
  background: #091113;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.mission-complete-panel input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mission-complete-box {
  grid-column: 2;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid #596668;
  background: #050708;
  color: transparent;
  font-size: 1.4rem;
  font-weight: 900;
}

.mission-complete-panel > span:last-child {
  grid-column: 3;
  display: grid;
  gap: 3px;
}

.mission-complete-panel b {
  color: #dce1dc;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mission-complete-panel small { color: #7f8a85; }

.mission-complete-panel.is-complete,
.mission-file.is-complete .mission-file-header {
  border-color: rgb(185 242 74 / 55%);
}

.mission-complete-panel.is-complete {
  background: rgb(185 242 74 / 7%);
}

.mission-complete-panel.is-complete .mission-complete-box {
  border-color: var(--green);
  background: var(--green);
  color: #050607;
  box-shadow: 0 0 16px rgb(185 242 74 / 24%);
}

.password-access-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(480px, 1.2fr);
  gap: 24px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid #3a4749;
  background: #091113;
}

.password-access-copy {
  display: grid;
  align-content: center;
}

.password-access-copy h3 { margin-bottom: 16px; }

.password-access-copy > p:not(.panel-kicker) {
  color: #9aa59f;
  font-size: 0.82rem;
  line-height: 1.65;
}

.password-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px 0 22px;
}

.password-icon-row > span {
  display: grid;
  min-width: 82px;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #354244;
  background: #071012;
}

.password-icon-row img {
  width: 54px;
  height: 54px;
  image-rendering: pixelated;
}

.password-icon-row b {
  color: #b7c0bc;
  font-family: var(--mono);
  font-size: 0.53rem;
  text-transform: uppercase;
}

.password-icon-row i {
  color: var(--orange);
  font-style: normal;
}

.compact-visual-frame { align-self: center; }

.code-breaker {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.65fr) minmax(220px, 0.5fr);
  gap: 16px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid #3a4749;
  background: #071012;
}

.code-breaker > div:first-child { align-self: center; }
.code-breaker h3 { margin-bottom: 12px; }
.code-breaker p:not(.panel-kicker) { margin: 0; color: #8e9994; font-size: 0.8rem; line-height: 1.6; }

.code-card {
  display: grid;
  place-content: center;
  min-height: 150px;
  padding: 20px;
  border: 1px solid #4a575a;
  background: #091416;
  text-align: center;
}

.code-card > span {
  color: #7f8a86;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-card strong {
  margin: 10px 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  letter-spacing: 0.05em;
}

.code-card strong i { color: var(--orange); font-style: normal; }
.code-card small { color: #7f8a86; font-size: 0.67rem; }
.code-card-vault strong { color: var(--orange); font-size: clamp(2.2rem, 4vw, 3.8rem); line-height: 1; }
.code-card-vault .copy-code { justify-self: center; }

.mission-index-section {
  background:
    radial-gradient(circle at 50% 0, rgb(16 52 56 / 34%), transparent 30rem),
    #050607;
}

.mission-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mission-index-card {
  scroll-margin-top: 144px;
  padding: 22px;
  border: 1px solid #364345;
  background: #091113;
  transition: border-color 160ms ease, transform 160ms ease;
}

.mission-index-card:hover {
  border-color: #657174;
  transform: translateY(-2px);
}

.mission-index-card.is-complete {
  border-color: rgb(185 242 74 / 55%);
  background: rgb(185 242 74 / 6%);
}

.mission-index-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.mission-index-top span {
  color: var(--orange);
  font-family: var(--display);
  font-size: 2.3rem;
  font-style: italic;
  line-height: 1;
}

.mission-index-top i {
  padding: 5px 7px;
  border: 1px solid #4a575a;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mission-index-card h3 {
  margin-bottom: 5px;
  color: #e2e6e1;
  font-family: var(--display);
  font-size: 2rem;
  font-style: italic;
  text-transform: uppercase;
}

.mission-index-card > p {
  color: #87928d;
  font-size: 0.75rem;
}

.mini-password {
  display: flex;
  gap: 6px;
  margin: 18px 0;
  padding: 8px;
  border: 1px solid #2d383a;
  background: #050809;
}

.mini-password img {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
  border: 1px solid #354244;
  background: #071416;
}

.mission-index-card > label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #a2aca7;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  cursor: pointer;
}

.mission-index-card input { accent-color: var(--green); }

.mission-index-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: calc(100% - 40px);
  padding: 12px 16px;
  border: 1px solid var(--green);
  background: #091113;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .walkthrough-hero-grid {
    grid-template-columns: 1fr;
  }

  .walkthrough-hero-copy {
    max-width: 860px;
  }

  .walkthrough-hero-visual {
    max-width: 940px;
  }

  .walkthrough-toolbar-grid {
    grid-template-columns: 1fr 0.65fr;
  }

  .walkthrough-progress {
    grid-column: 1 / -1;
  }

  .mission-file-header-grid {
    grid-template-columns: 130px 1fr;
  }

  .mission-brief-facts {
    grid-column: 1 / -1;
  }

  .objective-board {
    grid-template-columns: 1fr 1.7fr;
  }

  .briefing-screen {
    grid-column: 1 / -1;
    width: min(100%, 360px);
  }

  .visual-step-grid,
  .visual-step-grid-reverse {
    grid-template-columns: 1fr;
  }

  .visual-step-grid-reverse .step-stack { order: 2; }
  .visual-step-grid-reverse .visual-frame { order: 1; }

  .field-plate {
    grid-template-columns: 1fr;
  }

  .briefing-frame {
    max-width: 220px;
    justify-self: start;
  }

  .password-access-panel {
    grid-template-columns: 1fr;
  }

  .compact-visual-frame { max-width: 900px; }

  .code-breaker {
    grid-template-columns: 1fr 1fr;
  }

  .code-breaker > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .walkthrough-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .walkthrough-stats > div:nth-child(2) { border-right: 0; }
  .walkthrough-stats > div:nth-child(-n + 2) { border-bottom: 1px solid #263234; }

  .mission-jump-label { display: none; }

  .mission-jump-inner {
    grid-template-columns: repeat(8, minmax(82px, 1fr));
  }

  .field-key-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-strip > div:nth-child(2n) { border-right: 0; }
  .controls-strip > div:nth-child(-n + 4) { border-bottom: 1px solid #263133; }
  .controls-strip > div:last-child { grid-column: 1 / -1; }

  .operation-grid {
    grid-template-columns: 1fr;
  }

  .raw-capture-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mission-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 700px) {
  .walkthrough-hero {
    padding-top: 46px;
  }

  .walkthrough-hero-grid {
    gap: 36px;
    padding-bottom: 46px;
  }

  .walkthrough-hero-copy h1 {
    font-size: clamp(4rem, 20vw, 6.7rem);
  }

  .walkthrough-deck {
    font-size: 0.95rem;
  }

  .walkthrough-hero-actions {
    display: grid;
  }

  .walkthrough-hero-visual {
    padding: 7px;
  }

  .walkthrough-hero-visual figcaption {
    display: grid;
  }

  .mission-jump {
    top: 68px;
  }

  .walkthrough-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .walkthrough-progress { grid-column: auto; }

  .field-key-grid,
  .controls-strip {
    grid-template-columns: 1fr;
  }

  .controls-strip > div,
  .controls-strip > div:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid #263133;
  }

  .controls-strip > div:last-child {
    grid-column: auto;
    border-bottom: 0;
  }

  .mission-file {
    scroll-margin-top: 126px;
    padding-bottom: 72px;
  }

  .mission-file-header {
    margin-bottom: 42px;
    padding: 42px 0 36px;
  }

  .mission-file-header-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .mission-number-block {
    min-height: 100px;
    width: 120px;
  }

  .mission-number-block strong { font-size: 3.6rem; }
  .mission-brief-facts { grid-column: auto; }

  .objective-board {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .briefing-screen { grid-column: auto; }

  .route-map-panel,
  .operation-steps,
  .stuck-card,
  .item-intel,
  .raw-capture-gallery,
  .password-access-panel,
  .code-breaker,
  .field-plate {
    padding: 18px;
  }

  .image-lightbox-dialog {
    height: 100%;
    max-height: 100%;
  }

  .image-lightbox-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading-row {
    display: grid;
    align-items: start;
  }

  .accuracy-badge { justify-self: start; }

  .visual-frame figcaption {
    align-items: flex-start;
    flex-direction: column;
  }

  .frame-toggle { width: 100%; }

  .step-stack li {
    grid-template-columns: 36px 1fr;
    padding: 13px;
  }

  .step-stack li > span {
    width: 32px;
    height: 32px;
  }

  .mission-complete-panel {
    grid-template-columns: 46px 1fr;
    padding: 16px;
  }

  .mission-complete-box { grid-column: 1; }
  .mission-complete-panel > span:last-child { grid-column: 2; }

  .password-icon-row i { display: none; }

  .code-breaker {
    grid-template-columns: 1fr;
  }

  .code-breaker > div:first-child { grid-column: auto; }

  .mission-index-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 470px) {
  .walkthrough-stats {
    grid-template-columns: 1fr;
  }

  .walkthrough-stats > div,
  .walkthrough-stats > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid #263234;
  }

  .walkthrough-stats > div:last-child { border-bottom: 0; }

  .mission-brief-facts {
    grid-template-columns: 1fr;
  }

  .mission-brief-facts div,
  .mission-brief-facts div:nth-child(2n),
  .mission-brief-facts div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid #263133;
  }

  .mission-brief-facts div:last-child { border-bottom: 0; }

  .raw-capture-grid {
    grid-template-columns: 1fr;
  }

  .password-icon-row > span {
    min-width: calc(50% - 4px);
  }

  .mini-password img {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .walkthrough-page *,
  .walkthrough-page *::before,
  .walkthrough-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.mission-open-link {
  display: inline-flex;
  margin-top: 11px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.mission-open-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.mission-complete-panel input {
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  pointer-events: auto;
}

.mission-complete-panel:has(input:focus-visible) {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

/* Intrinsic-size guards for narrow walkthrough layouts. */
.walkthrough-page :where(
  .walkthrough-hero-grid,
  .walkthrough-toolbar-grid,
  .field-key-grid,
  .controls-strip,
  .mission-file-header-grid,
  .mission-body,
  .objective-board,
  .objective-list li,
  .visual-step-grid,
  .visual-step-grid-reverse,
  .operation-grid,
  .password-access-panel,
  .code-breaker,
  .mission-index-grid
) > * {
  min-width: 0;
}

.walkthrough-hero-copy,
.walkthrough-deck,
.walkthrough-hero-actions,
.walkthrough-hero-visual,
.objective-board,
.objective-list,
.briefing-screen {
  width: 100%;
  max-width: 100%;
}

.walkthrough-page :where(h1, h2, h3, h4, p, strong, small, span) {
  overflow-wrap: break-word;
}

/* Mission route tips */
.mission-tip-panel,
.expanded-route {
  margin: 2rem 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line, #405154);
  background: rgba(7, 17, 19, 0.88);
}
.mission-tip-panel { border-left: 4px solid #f28a21; }
.expanded-route-list { display: grid; gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.expanded-route-list li { display: grid; grid-template-columns: 3rem 1fr; gap: .8rem; align-items: start; padding: .85rem; border: 1px solid rgba(126, 151, 151, .28); background: rgba(255,255,255,.025); }
.expanded-route-list li > span { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #b9f24a; color: #071012; font-weight: 800; }
.expanded-route-list p { margin: 0 0 .35rem; }
.expanded-route-list small { color: var(--muted, #aab5b0); }
.expanded-route-list small a { color: #d6e35a; }

/* route-frame-panel */
.route-frame-panel{margin:2rem 0;padding:1.25rem;border:1px solid var(--line,#405154);background:rgba(6,14,16,.82)}
.route-frame-note{max-width:78ch;color:var(--muted,#aeb8b2)}
.trace-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}
.trace-card{margin:0;border:1px solid var(--line,#405154);background:#081113}
.trace-card img{display:block;width:100%;height:auto}
.trace-card figcaption{display:grid;gap:.3rem;padding:.8rem 1rem}
.trace-card figcaption b{color:var(--accent,#b9f24a)}
.trace-card figcaption span{font-family:var(--mono,monospace);font-size:.78rem;overflow-wrap:anywhere}
.trace-card figcaption small{color:var(--muted,#aeb8b2)}
@media(max-width:760px){.trace-card-grid{grid-template-columns:1fr}}

/* ---- Arsenal & Gadget Database ---- */
.arsenal-page {
  background:
    radial-gradient(circle at 82% 5%, rgb(185 242 74 / 8%), transparent 32rem),
    radial-gradient(circle at 8% 28%, rgb(242 138 33 / 6%), transparent 28rem),
    linear-gradient(180deg, #020303, #050708 34rem);
}

.arsenal-page code {
  font-family: var(--mono);
}

.arsenal-hero {
  position: relative;
  padding: clamp(64px, 7vw, 112px) 0 72px;
  overflow: hidden;
}

.arsenal-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.8%, rgb(185 242 74 / 3%) 50%, transparent 50.2%),
    linear-gradient(rgb(255 255 255 / 1.5%) 1px, transparent 1px);
  background-size: 160px 100%, 100% 32px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.arsenal-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(520px, 1.16fr);
  gap: clamp(38px, 5vw, 76px);
  align-items: center;
}

.arsenal-hero-copy {
  min-width: 0;
}

.arsenal-hero h1 {
  margin: 0 0 24px;
  max-width: 760px;
  color: #f2f3ec;
  font-family: var(--display);
  font-size: clamp(4rem, 8.5vw, 7.4rem);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.78;
  text-transform: uppercase;
  text-shadow: 5px 5px 0 #091315;
}

.arsenal-hero h1 span {
  color: var(--orange);
  text-shadow: 4px 4px 0 #542405;
}

.arsenal-deck {
  max-width: 680px;
  margin: 0 0 28px;
  color: #b4bfba;
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.75;
}

.arsenal-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 34px 0 0;
  border: 1px solid #344143;
  background: rgb(5 12 13 / 78%);
  box-shadow: inset 0 0 0 3px #030506;
}

.arsenal-hero-stats div {
  min-width: 0;
  padding: 15px 13px;
  border-right: 1px solid #263133;
}

.arsenal-hero-stats div:last-child {
  border-right: 0;
}

.arsenal-hero-stats dt,
.arsenal-hero-stats dd {
  margin: 0;
}

.arsenal-hero-stats dt {
  margin-bottom: 6px;
  color: #76827e;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arsenal-hero-stats dd {
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(0.88rem, 1.2vw, 1.08rem);
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.arsenal-hero-visual {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #506063;
  background: #05090a;
  box-shadow: 0 30px 90px rgb(0 0 0 / 55%), inset 0 0 0 3px #010303;
  transform: rotate(0.35deg);
}

.arsenal-hero-visual::before,
.arsenal-hero-visual::after {
  position: absolute;
  z-index: 2;
  width: 54px;
  height: 54px;
  content: "";
  pointer-events: none;
}

.arsenal-hero-visual::before {
  top: -5px;
  left: -5px;
  border-top: 3px solid var(--green);
  border-left: 3px solid var(--green);
}

.arsenal-hero-visual::after {
  right: -5px;
  bottom: -5px;
  border-right: 3px solid var(--orange);
  border-bottom: 3px solid var(--orange);
}

.arsenal-hero-visual img {
  width: 100%;
  height: auto;
  border: 1px solid #1c2729;
}

.arsenal-hero-captures,
.enemy-hero-captures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  background: #101719;
}

.arsenal-hero-captures img,
.enemy-hero-captures img {
  width: 100%;
  aspect-ratio: 160 / 144;
  object-fit: cover;
  image-rendering: pixelated;
}

.arsenal-hero-visual figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 9px 3px;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.arsenal-hero-visual figcaption b {
  color: var(--green);
}

.arsenal-database-section {
  position: relative;
}

.arsenal-section-heading code {
  color: var(--green);
}

.arsenal-filter-panel {
  margin-bottom: 30px;
  padding: 22px;
  border: 1px solid #3a4749;
  background:
    linear-gradient(135deg, rgb(185 242 74 / 3%), transparent 40%),
    #070c0d;
  box-shadow: inset 0 0 0 3px #030506;
}

.arsenal-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(2, minmax(160px, 0.8fr));
  gap: 14px;
}

.arsenal-filter-grid .field {
  min-width: 0;
}

.arsenal-filter-grid .field input,
.arsenal-filter-grid .field select {
  border-color: #506063;
  background: #091517;
}

.arsenal-filter-grid .field input:focus,
.arsenal-filter-grid .field select:focus {
  border-color: var(--green);
}

.arsenal-filter-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #202b2d;
}

.arsenal-result-count {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arsenal-reset {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #a5afaa;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
  cursor: pointer;
}

.arsenal-reset:hover {
  color: var(--green);
}

.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.arsenal-card {
  min-width: 0;
  scroll-margin-top: 100px;
  border: 1px solid #405052;
  background: #080d0e;
  box-shadow: inset 0 0 0 3px #030506, 0 16px 45px rgb(0 0 0 / 20%);
  overflow: clip;
}

.arsenal-card:target {
  border-color: var(--green);
  box-shadow: inset 0 0 0 3px #030506, 0 0 0 3px rgb(185 242 74 / 10%), 0 18px 55px rgb(0 0 0 / 42%);
}

.arsenal-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 15px;
  border-bottom: 1px solid #283436;
  background: #0a1517;
}

.arsenal-class-tag,
.arsenal-mission-badge {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.arsenal-class-tag {
  color: #c1cbc6;
}

.arsenal-mission-badge {
  padding: 5px 8px;
  border: 1px solid #49653b;
  color: var(--green);
  background: #0a170c;
}

.arsenal-card-body {
  display: grid;
  grid-template-columns: minmax(196px, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  min-width: 0;
  padding: 20px;
}

.arsenal-card-visual {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-self: stretch;
  min-width: 0;
  margin: 0;
  border: 1px solid #364345;
  background: #040707;
  overflow: hidden;
}

.arsenal-card-visual img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.arsenal-card-hud {
  width: 100%;
  height: auto;
  min-height: 42px;
  object-fit: fill;
  border-bottom: 1px solid #263133;
}

.arsenal-card-effect {
  width: 100%;
  height: 100%;
  min-height: 176px;
  object-fit: cover;
  object-position: center;
}

.arsenal-card-visual figcaption {
  padding: 8px 10px;
  border-top: 1px solid #263133;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.arsenal-key-visual {
  place-items: center;
  min-height: 234px;
  background:
    radial-gradient(circle, rgb(185 242 74 / 9%), transparent 45%),
    #040707;
}

.arsenal-key-visual img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
}

.arsenal-key-visual figcaption {
  width: 100%;
  align-self: end;
}

.arsenal-card-copy {
  min-width: 0;
}

.arsenal-record-index {
  margin: 2px 0 8px;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.arsenal-card-copy h3 {
  margin: 0 0 11px;
  color: #f0f2ed;
  font-family: var(--display);
  font-size: clamp(1.75rem, 2.8vw, 2.55rem);
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 0.94;
  text-transform: uppercase;
}

.arsenal-card-copy > p:not(.arsenal-record-index) {
  margin: 0;
  color: #9da8a3;
  font-size: 0.88rem;
  line-height: 1.62;
}

.arsenal-mission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.arsenal-mission-chips a {
  display: inline-grid;
  min-width: 37px;
  min-height: 32px;
  place-items: center;
  border: 1px solid #4b595b;
  background: #0a1517;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 900;
  text-decoration: none;
}

.arsenal-mission-chips a:hover {
  border-color: var(--green);
  background: #11271b;
}

.arsenal-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #263133;
  border-bottom: 1px solid #263133;
  background: #071011;
}

.arsenal-card-stats > div {
  min-width: 0;
  padding: 13px 12px;
  border-right: 1px solid #263133;
}

.arsenal-card-stats > div:last-child {
  border-right: 0;
}

.arsenal-card-stats span,
.arsenal-card-stats strong,
.arsenal-card-stats small {
  display: block;
  overflow-wrap: anywhere;
}

.arsenal-card-stats span {
  margin-bottom: 5px;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arsenal-card-stats strong {
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.arsenal-card-stats small {
  margin-top: 3px;
  color: #75807c;
  font-size: 0.58rem;
  line-height: 1.25;
}

.arsenal-card-metric strong {
  color: var(--green);
}

.arsenal-dossier {
  background: #070b0c;
}

.arsenal-dossier > summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.arsenal-dossier > summary::-webkit-details-marker {
  display: none;
}

.arsenal-dossier > summary:hover {
  background: #0b1517;
}

.arsenal-dossier[open] > summary {
  border-bottom: 1px solid #2c383a;
}

.arsenal-dossier[open] > summary span:last-child {
  transform: rotate(45deg);
}

.arsenal-dossier-body {
  padding: 20px;
}

.arsenal-dossier-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.arsenal-dossier-columns > section,
.arsenal-location-section,
.arsenal-field-notes {
  min-width: 0;
  padding: 18px;
  border: 1px solid #303c3e;
  background: #091012;
}

.arsenal-dossier h4 {
  margin: 0 0 15px;
  color: #dfe5e1;
  font-family: var(--mono);
  font-size: 0.88rem;
  text-transform: uppercase;
}

.arsenal-dossier .eyebrow {
  margin-bottom: 8px;
  font-size: 0.55rem;
}

.arsenal-control-note,
.arsenal-address-note {
  margin: 13px 0 0;
  color: #8f9a96;
  font-size: 0.76rem;
  line-height: 1.55;
}

.arsenal-control-note b {
  color: #d8dfda;
}

.arsenal-code-stack {
  display: grid;
  gap: 9px;
}

.arsenal-code-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(110px, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #354244;
  background: #071011;
}

.arsenal-code-row > span {
  color: #838e8a;
  font-family: var(--mono);
  font-size: 0.54rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arsenal-code-row code {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.arsenal-code-row button {
  padding: 6px 8px;
  border: 1px solid #4b595b;
  background: #0d1d20;
  color: #d0d8d4;
  font-family: var(--mono);
  font-size: 0.53rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.arsenal-code-row button:hover {
  border-color: var(--green);
  color: var(--green);
}

.arsenal-location-section,
.arsenal-field-notes {
  margin-top: 18px;
}

.arsenal-location-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arsenal-location-list li {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #2d393b;
  background: #071011;
}

.arsenal-mission-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #506063;
  background: #0a181a;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 900;
  text-decoration: none;
}

.arsenal-mission-number:hover {
  border-color: var(--green);
}

.arsenal-location-list strong {
  margin-right: 8px;
  color: #d9e0dc;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.arsenal-mission-role {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.53rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arsenal-location-list p {
  margin: 6px 0;
  color: #94a09b;
  font-size: 0.78rem;
  line-height: 1.5;
}

.arsenal-location-list small {
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.arsenal-field-notes ul {
  margin: 0;
  padding-left: 18px;
  color: #929d99;
  font-size: 0.78rem;
  line-height: 1.58;
}

.arsenal-field-notes li + li {
  margin-top: 7px;
}

.arsenal-dossier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.arsenal-dossier-actions .button {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 0.58rem;
}

.arsenal-empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  border: 1px dashed #4a585a;
  background: #070b0c;
  text-align: center;
}

.arsenal-empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-family: var(--mono);
  text-transform: uppercase;
}

.arsenal-empty-state p,
.arsenal-noscript {
  margin: 0;
  color: #87938e;
}

.arsenal-noscript {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #6d4a28;
  background: #160f08;
}

.arsenal-ram-section {
  border-block: 1px solid #233032;
  background: #060a0b;
}

.arsenal-memory-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 26px;
}

.arsenal-memory-rule {
  display: grid;
  min-height: 132px;
  align-content: center;
  gap: 6px;
  padding: 20px;
  border: 1px solid #415052;
  background:
    linear-gradient(135deg, transparent 16px, #091315 0) top left;
  box-shadow: inset 0 0 0 3px #030506;
}

.arsenal-memory-rule span,
.arsenal-memory-rule small {
  color: #76827e;
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arsenal-memory-rule strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.arsenal-memory-key strong {
  color: var(--orange);
}

.arsenal-memory-arrow {
  color: #5e6a66;
  font-family: var(--mono);
  font-size: 1.6rem;
}

.arsenal-table-wrap {
  border: 1px solid #354244;
}

.arsenal-table a {
  color: #dce4df;
  font-weight: 800;
  text-decoration-color: #536062;
  text-underline-offset: 3px;
}

.arsenal-table a:hover {
  color: var(--green);
  text-decoration-color: var(--green);
}

.arsenal-page :where(
  .arsenal-hero-grid,
  .arsenal-hero-stats,
  .arsenal-filter-grid,
  .arsenal-grid,
  .arsenal-card-body,
  .arsenal-card-stats,
  .arsenal-dossier-columns,
  .arsenal-code-row,
  .arsenal-location-list li,
  .arsenal-memory-layout
) > * {
  min-width: 0;
}

.arsenal-page :where(h1, h2, h3, h4, p, strong, small, span, code, td, th) {
  overflow-wrap: break-word;
}

@media (max-width: 1120px) {
  .arsenal-hero-grid {
    grid-template-columns: 1fr;
  }

  .arsenal-hero-copy {
    max-width: 850px;
  }

  .arsenal-hero-visual {
    max-width: 900px;
  }

  .arsenal-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arsenal-search-field {
    grid-column: span 2;
  }

  .arsenal-grid {
    grid-template-columns: 1fr;
  }

  .arsenal-card-body {
    grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
  }

}

@media (max-width: 860px) {
  .arsenal-hero {
    padding-top: 60px;
  }

  .arsenal-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arsenal-hero-stats div:nth-child(2) {
    border-right: 0;
  }

  .arsenal-hero-stats div:nth-child(-n + 2) {
    border-bottom: 1px solid #263133;
  }

  .arsenal-dossier-columns {
    grid-template-columns: 1fr;
  }

  .arsenal-memory-layout {
    grid-template-columns: 1fr;
  }

  .arsenal-memory-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

}

@media (max-width: 680px) {
  .arsenal-hero h1 {
    font-size: clamp(3.4rem, 18vw, 5.3rem);
  }

  .arsenal-hero-visual figcaption {
    display: grid;
  }

  .arsenal-filter-grid {
    grid-template-columns: 1fr;
  }

  .arsenal-search-field {
    grid-column: auto;
  }

  .arsenal-filter-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .arsenal-card-body {
    grid-template-columns: 1fr;
  }

  .arsenal-card-visual {
    max-width: 100%;
  }

  .arsenal-card-effect {
    min-height: 240px;
  }

  .arsenal-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arsenal-card-stats > div:nth-child(2n) {
    border-right: 0;
  }

  .arsenal-card-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid #263133;
  }

  .arsenal-code-row {
    grid-template-columns: 1fr auto;
  }

  .arsenal-code-row > span {
    grid-column: 1 / -1;
  }

}

@media (max-width: 470px) {
  .arsenal-hero-stats {
    grid-template-columns: 1fr;
  }

  .arsenal-hero-stats div,
  .arsenal-hero-stats div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid #263133;
  }

  .arsenal-hero-stats div:last-child {
    grid-column: auto;
    border-bottom: 0;
  }

  .arsenal-card-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .arsenal-card-body,
  .arsenal-dossier-body {
    padding: 15px;
  }

  .arsenal-card-effect {
    min-height: 190px;
  }

  .arsenal-location-list li {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .arsenal-mission-number {
    width: 40px;
    height: 40px;
  }
}

/* Walkthrough to Arsenal cross-links */
.arsenal-crosslinks {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid #3b4a4c;
  border-left: 4px solid var(--green);
  background:
    linear-gradient(135deg, rgb(185 242 74 / 5%), transparent 46%),
    #071011;
  box-shadow: inset 0 0 0 3px #030506;
}

.arsenal-crosslinks-copy {
  min-width: 0;
}

.arsenal-crosslinks-copy h3 {
  margin: 0 0 8px;
  color: #e3e9e5;
  font-family: var(--mono);
  font-size: clamp(0.88rem, 1.5vw, 1.05rem);
  line-height: 1.25;
  text-transform: uppercase;
}

.arsenal-crosslinks-copy p:last-child {
  margin: 0;
  color: #87938e;
  font-size: 0.78rem;
  line-height: 1.55;
}

.arsenal-crosslink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
  min-width: 0;
}

.arsenal-crosslink-grid a {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  padding: 7px;
  border: 1px solid #354345;
  background: #091416;
  color: inherit;
  text-decoration: none;
}

.arsenal-crosslink-grid a:hover,
.arsenal-crosslink-grid a:focus-visible {
  border-color: var(--green);
  background: #102019;
}

.arsenal-crosslink-grid img {
  width: 88px;
  height: 34px;
  border: 1px solid #293537;
  background: #030606;
  object-fit: fill;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.arsenal-crosslink-grid span,
.arsenal-crosslink-grid strong,
.arsenal-crosslink-grid small {
  display: block;
  min-width: 0;
}

.arsenal-crosslink-grid small {
  margin-bottom: 4px;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-transform: uppercase;
}

.arsenal-crosslink-grid strong {
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .arsenal-crosslinks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .arsenal-crosslinks {
    padding: 14px;
  }

  .arsenal-crosslink-grid {
    grid-template-columns: 1fr;
  }

  .arsenal-crosslink-grid a {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .arsenal-crosslink-grid img {
    width: 96px;
    height: 36px;
  }
}

/* Enemy & Boss Database + Text & Story Archive */
@media (min-width: 861px) and (max-width: 1220px) {
  .header-inner {
    grid-template-columns: auto 1fr;
    gap: 18px;
  }

  .header-cta {
    display: none;
  }

  .primary-nav .nav-passwords {
    display: inline;
  }

  .primary-nav {
    gap: clamp(12px, 1.65vw, 22px);
  }

  .primary-nav a {
    font-size: clamp(0.61rem, 0.72vw, 0.7rem);
  }
}

.enemy-page,
.story-page {
  background:
    radial-gradient(circle at 78% 4%, rgb(31 81 82 / 24%), transparent 34rem),
    linear-gradient(180deg, #020303, var(--bg) 30rem);
}

.enemy-hero,
.story-hero {
  position: relative;
  padding: 70px 0 64px;
  overflow: hidden;
}

.enemy-hero::before,
.story-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 49.8%, rgb(255 255 255 / 2.5%) 50%, transparent 50.2%),
    linear-gradient(rgb(255 255 255 / 1.6%) 1px, transparent 1px);
  background-size: 128px 100%, 100% 32px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.enemy-hero::after,
.story-hero::after {
  position: absolute;
  right: -12vw;
  bottom: -22vw;
  width: 54vw;
  height: 54vw;
  content: "";
  pointer-events: none;
  border-radius: 50%;
}

.enemy-hero::after {
  background: radial-gradient(circle, rgb(239 63 57 / 9%), rgb(242 138 33 / 4%) 35%, transparent 68%);
}

.story-hero::after {
  background: radial-gradient(circle, rgb(90 169 255 / 10%), rgb(185 242 74 / 4%) 35%, transparent 68%);
}

.enemy-hero-grid,
.story-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(520px, 1.15fr);
  gap: clamp(40px, 5vw, 78px);
  align-items: center;
}

.enemy-hero-copy,
.story-hero-copy {
  min-width: 0;
}

.enemy-hero h1,
.story-hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.6rem, 7.3vw, 7.5rem);
  font-style: italic;
  letter-spacing: -0.055em;
  line-height: 0.81;
  text-transform: uppercase;
  text-shadow: 6px 7px 0 rgb(0 0 0 / 42%);
}

.enemy-hero h1 span {
  color: var(--orange);
}

.story-hero h1 span {
  color: var(--blue);
}

.enemy-deck,
.story-deck {
  max-width: 660px;
  margin: 30px 0 26px;
  color: #b7c0bc;
  font-size: clamp(0.94rem, 1.25vw, 1.06rem);
  line-height: 1.75;
}

.enemy-hero-stats,
.story-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 720px;
  margin: 34px 0 0;
  border: 1px solid #344143;
  background: #071012;
  box-shadow: inset 0 0 0 3px #030506;
}

.enemy-hero-stats div,
.story-hero-stats div {
  display: grid;
  min-width: 0;
  padding: 15px 14px;
  border-right: 1px solid #263133;
}

.enemy-hero-stats div:last-child,
.story-hero-stats div:last-child {
  border-right: 0;
}

.enemy-hero-stats dt,
.story-hero-stats dt {
  color: #87938e;
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.enemy-hero-stats dd,
.story-hero-stats dd {
  margin: 7px 0 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.enemy-hero-stats dd {
  color: var(--orange);
}

.story-hero-stats dd {
  color: var(--blue);
}

.enemy-hero-visual,
.story-hero-visual {
  position: relative;
  min-width: 0;
  margin: 0;
  border: 1px solid #536063;
  background: #030506;
  box-shadow:
    0 30px 90px rgb(0 0 0 / 52%),
    inset 0 0 0 4px #020303;
}

.enemy-hero-visual::before,
.story-hero-visual::before {
  position: absolute;
  inset: 10px;
  z-index: 1;
  content: "";
  border: 1px solid rgb(255 255 255 / 10%);
  pointer-events: none;
}

.enemy-hero-visual img,
.story-hero-visual img {
  width: 100%;
  aspect-ratio: 1400 / 820;
  object-fit: cover;
}

.story-briefing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  background: #101719;
}

.story-briefing-grid img {
  width: 100%;
  aspect-ratio: 160 / 144;
  object-fit: cover;
  image-rendering: pixelated;
}

.enemy-hero-visual figcaption,
.story-hero-visual figcaption {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 15px;
  border-top: 1px solid #293537;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-transform: uppercase;
}

.enemy-hero-visual figcaption b {
  color: var(--orange);
}

.story-hero-visual figcaption b {
  color: var(--blue);
}

.enemy-database-section,
.story-chapter-section,
.story-character-section {
  background:
    linear-gradient(180deg, rgb(8 22 24 / 78%), rgb(3 6 7 / 72%)),
    repeating-linear-gradient(90deg, transparent 0 96px, rgb(255 255 255 / 1.2%) 96px 97px);
}

.enemy-matrix-section,
.story-matrix-section,
.story-act-section {
  border-block: 1px solid #1d2728;
  background: #050809;
}

.enemy-section-heading,
.story-section-heading {
  align-items: end;
}

.enemy-section-heading > p,
.story-section-heading > p {
  max-width: 610px;
  color: #89958f;
}

.enemy-filter-panel,
.story-filter-panel {
  margin-bottom: 30px;
  padding: 22px;
  border: 1px solid #3e4b4e;
  background:
    linear-gradient(135deg, rgb(185 242 74 / 3%), transparent 42%),
    #071012;
  box-shadow: inset 0 0 0 3px #030506;
}

.enemy-filter-grid,
.story-filter-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px, 0.8fr));
  gap: 15px;
}

.enemy-filter-grid {
  grid-template-columns: minmax(280px, 1.7fr) repeat(2, minmax(150px, 0.8fr));
}

.enemy-filter-panel .field,
.story-filter-panel .field {
  min-width: 0;
}

.enemy-filter-panel .field span,
.story-filter-panel .field span {
  display: block;
  margin-bottom: 7px;
  color: #8f9b96;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enemy-filter-panel input,
.enemy-filter-panel select,
.story-filter-panel input,
.story-filter-panel select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #455255;
  border-radius: 0;
  background: #030708;
  color: #dbe3df;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.enemy-filter-panel input:focus,
.enemy-filter-panel select:focus {
  border-color: var(--orange);
}

.story-filter-panel input:focus,
.story-filter-panel select:focus {
  border-color: var(--blue);
}

.enemy-filter-footer,
.story-filter-footer {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #283436;
}

.enemy-result-count,
.story-result-count {
  margin: 0;
  color: #9ba7a1;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.enemy-reset,
.story-reset {
  padding: 8px 12px;
  border: 1px solid #465255;
  background: #071012;
  color: #c6cfca;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.enemy-reset:hover,
.enemy-reset:focus-visible {
  border-color: var(--orange);
  color: var(--orange);
}

.story-reset:hover,
.story-reset:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.enemy-grid,
.story-grid {
  display: grid;
  gap: 28px;
}

.enemy-card,
.story-card {
  min-width: 0;
  border: 1px solid #3f4d50;
  background: #071012;
  box-shadow:
    inset 0 0 0 3px #030506,
    0 20px 60px rgb(0 0 0 / 28%);
  scroll-margin-top: 96px;
}

.enemy-card {
  border-left-width: 4px;
  border-left-color: var(--orange);
}

.story-card {
  border-left: 4px solid var(--blue);
}

.enemy-card-topline,
.story-card-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid #293537;
  background: #05090a;
}

.enemy-category-tag,
.enemy-mission-badge,
.story-mission-tag,
.story-act-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid #3f4d50;
  background: #091315;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-transform: uppercase;
}

.enemy-category-tag,
.story-mission-tag {
  color: #dce4df;
}

.enemy-mission-badge {
  color: var(--orange);
}

.story-act-badge {
  color: var(--blue);
}

.enemy-card-body,
.story-card-body {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(22px, 3vw, 38px);
  align-items: center;
  padding: 22px;
}

.enemy-card-visual,
.story-card-visual {
  min-width: 0;
  margin: 0;
  border: 1px solid #354244;
  background: #030506;
}

.enemy-card-visual img,
.story-card-visual img {
  width: 100%;
  aspect-ratio: 160 / 144;
  object-fit: cover;
  image-rendering: pixelated;
}

.enemy-card-visual figcaption,
.story-card-visual figcaption {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 11px;
  border-top: 1px solid #293537;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.enemy-card-visual figcaption b {
  color: var(--orange);
}

.story-card-visual figcaption b {
  color: var(--blue);
}

.enemy-card-copy,
.story-card-copy {
  min-width: 0;
}

.enemy-record-index,
.story-record-index {
  margin: 0 0 9px;
  color: #83908a;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.enemy-card-copy h3,
.story-card-copy h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2.25rem, 4.2vw, 4rem);
  font-style: italic;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-transform: uppercase;
}

.story-mission-title {
  margin: 9px 0 0 !important;
  color: var(--blue) !important;
  font-family: var(--mono);
  font-size: 0.68rem !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enemy-card-copy > p:not(.enemy-record-index),
.story-card-copy > p:not(.story-record-index):not(.story-mission-title) {
  margin: 17px 0 0;
  color: #aab5b0;
  font-size: 0.9rem;
  line-height: 1.72;
}

.enemy-mission-chips,
.story-entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 19px;
}

.enemy-mission-chips a {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px 8px 6px 6px;
  border: 1px solid #344244;
  background: #091315;
  color: inherit;
  text-decoration: none;
}

.enemy-mission-chips a:hover,
.enemy-mission-chips a:focus-visible {
  border-color: var(--orange);
}

.enemy-mission-chips span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid #596568;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 900;
}

.enemy-mission-chips small {
  color: #aeb8b3;
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.story-entity-chips a,
.story-organization-chip {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 9px;
  border: 1px solid #354345;
  background: #091315;
  color: #cdd7d2;
  font-family: var(--mono);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-decoration: none;
  text-transform: uppercase;
}

.story-entity-chips a:hover,
.story-entity-chips a:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.story-organization-chip {
  color: var(--green);
}

.enemy-card-stats,
.story-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid #293537;
  background: #05090a;
}

.enemy-card-stats > div,
.story-card-stats > div {
  display: grid;
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid #263133;
}

.enemy-card-stats > div:last-child,
.story-card-stats > div:last-child {
  border-right: 0;
}

.enemy-card-stats span,
.story-card-stats span {
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.enemy-card-stats strong,
.story-card-stats strong {
  margin-top: 5px;
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.enemy-card-stats small,
.story-card-stats small {
  margin-top: 4px;
  color: #929e99;
  font-size: 0.66rem;
  line-height: 1.35;
}

.enemy-dossier,
.story-dossier {
  border: 0;
}

.enemy-dossier > summary,
.story-dossier > summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  background: #081113;
  color: #c9d2cd;
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.enemy-dossier > summary::-webkit-details-marker,
.story-dossier > summary::-webkit-details-marker {
  display: none;
}

.enemy-dossier > summary:hover,
.enemy-dossier > summary:focus-visible {
  color: var(--orange);
}

.story-dossier > summary:hover,
.story-dossier > summary:focus-visible {
  color: var(--blue);
}

.enemy-dossier[open] > summary,
.story-dossier[open] > summary {
  border-bottom: 1px solid #293537;
}

.enemy-dossier[open] > summary span:last-child,
.story-dossier[open] > summary span:last-child {
  transform: rotate(45deg);
}

.enemy-dossier-body,
.story-dossier-body {
  display: grid;
  gap: 24px;
  padding: 24px;
  background: #05090a;
}

.enemy-dossier-body h4,
.story-dossier-body h4 {
  margin: 0 0 12px;
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.enemy-dossier-body .eyebrow,
.story-dossier-body .eyebrow {
  margin-bottom: 8px;
  font-size: 0.55rem;
}

.enemy-dossier-columns,
.story-dossier-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.enemy-dossier-columns > section,
.story-dossier-columns > section {
  min-width: 0;
  padding: 20px;
  border: 1px solid #2f3c3e;
  background: #071012;
}

.enemy-dossier-columns ul,
.story-dossier-columns ul,
.story-dossier-columns ol {
  color: #9da8a3;
  font-size: 0.79rem;
  line-height: 1.65;
}

.enemy-dossier-columns ul,
.story-dossier-columns ul,
.story-dossier-columns ol {
  margin: 0;
  padding-left: 20px;
}

.enemy-dossier-columns li + li,
.story-dossier-columns li + li {
  margin-top: 8px;
}

.enemy-dossier-actions,
.story-dossier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 3px;
}

.enemy-table-wrap,
.story-table-wrap {
  border-color: #3c494c;
  background: #060b0c;
}

.enemy-table td:first-child a:hover,
.story-table td:nth-child(2) a:hover {
  color: var(--green);
}

.enemy-empty-state,
.story-empty-state {
  padding: 42px;
  border: 1px dashed #465356;
  background: #071012;
  text-align: center;
}

.enemy-empty-state strong,
.story-empty-state strong {
  display: block;
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.enemy-empty-state p,
.story-empty-state p,
.enemy-noscript,
.story-noscript {
  margin: 10px 0 0;
  color: #89958f;
  font-size: 0.78rem;
}

/* Story archive-specific structures */
.story-act-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.story-act-grid article {
  min-width: 0;
  padding: 20px;
  border: 1px solid #334144;
  border-top: 3px solid var(--blue);
  background: #071012;
  scroll-margin-top: 96px;
}

.story-act-topline,
.story-character-topline {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  color: #929e99;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.story-act-topline strong,
.story-character-topline strong {
  color: var(--blue);
}

.story-act-grid h3,
.story-character-grid h3 {
  margin: 17px 0 10px;
  color: #dce4df;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.35;
  text-transform: uppercase;
}

.story-act-grid p,
.story-character-grid p {
  margin: 0;
  color: #89958f;
  font-size: 0.75rem;
  line-height: 1.62;
}

.story-act-missions,
.story-character-missions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.story-act-missions a,
.story-character-missions a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #425053;
  background: #040809;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 900;
  text-decoration: none;
}

.story-act-missions a:hover,
.story-act-missions a:focus-visible,
.story-character-missions a:hover,
.story-character-missions a:focus-visible {
  border-color: var(--blue);
  background: #0b1a25;
}

.story-structure-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.story-structure-list > div {
  padding: 12px;
  border-left: 2px solid var(--blue);
  background: #040809;
}

.story-structure-list dt {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-structure-list dd {
  margin: 5px 0 0;
  color: #9da8a3;
  font-size: 0.75rem;
  line-height: 1.6;
}

.story-topic-block + .story-topic-block {
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid #293537;
}

.story-topic-block > span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-topic-block > p {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.story-topic-block em {
  padding: 5px 7px;
  border: 1px solid #344244;
  background: #040809;
  color: #aab5b0;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-style: normal;
  text-transform: uppercase;
}

.story-continuity-links {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid #2f3c3e;
  background: #071012;
}

.story-continuity-links a,
.story-continuity-links > span {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.story-continuity-links > span {
  color: #76827d;
}

.story-continuity-links a:hover,
.story-continuity-links a:focus-visible {
  color: var(--green);
}

.story-character-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.story-character-grid article {
  min-width: 0;
  padding: 20px;
  border: 1px solid #334144;
  background: #071012;
  scroll-margin-top: 96px;
}

.story-character-grid article:target {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgb(90 169 255 / 16%);
}

.story-character-role {
  margin: -3px 0 10px !important;
  color: var(--blue) !important;
  font-family: var(--mono);
  font-size: 0.56rem !important;
  font-weight: 800;
  text-transform: uppercase;
}

.enemy-page :where(
  .enemy-hero-grid,
  .enemy-hero-stats,
  .enemy-filter-grid,
  .enemy-card-body,
  .enemy-card-stats,
  .enemy-dossier-columns
) > *,
.story-page :where(
  .story-hero-grid,
  .story-hero-stats,
  .story-filter-grid,
  .story-card-body,
  .story-card-stats,
  .story-dossier-columns,
  .story-act-grid,
  .story-character-grid
) > * {
  min-width: 0;
}

.enemy-page :where(h1, h2, h3, h4, p, strong, small, span, code, td, th),
.story-page :where(h1, h2, h3, h4, p, strong, small, span, code, td, th) {
  overflow-wrap: break-word;
}

@media (max-width: 1120px) {
  .enemy-hero-grid,
  .story-hero-grid {
    grid-template-columns: 1fr;
  }

  .enemy-hero-copy,
  .story-hero-copy {
    max-width: 860px;
  }

  .enemy-hero-visual,
  .story-hero-visual {
    max-width: 920px;
  }

  .enemy-filter-grid,
  .story-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .enemy-search-field,
  .story-search-field {
    grid-column: span 2;
  }

  .story-act-grid,
  .story-character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .enemy-card-body,
  .story-card-body {
    grid-template-columns: 1fr;
  }

  .enemy-card-visual,
  .story-card-visual {
    max-width: 720px;
  }

  .story-native-briefing {
    max-width: 360px;
  }
}

@media (max-width: 760px) {
  .enemy-hero,
  .story-hero {
    padding-top: 58px;
  }

  .enemy-hero-stats,
  .story-hero-stats,
  .enemy-card-stats,
  .story-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .enemy-hero-stats div:nth-child(2n),
  .story-hero-stats div:nth-child(2n),
  .enemy-card-stats > div:nth-child(2n),
  .story-card-stats > div:nth-child(2n) {
    border-right: 0;
  }

  .enemy-hero-stats div:nth-child(-n + 2),
  .story-hero-stats div:nth-child(-n + 2),
  .enemy-card-stats > div:nth-child(-n + 2),
  .story-card-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid #263133;
  }

  .enemy-dossier-columns,
  .story-dossier-columns {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 620px) {
  .enemy-hero h1,
  .story-hero h1 {
    font-size: clamp(3.5rem, 18vw, 5.6rem);
  }

  .enemy-hero-visual figcaption,
  .story-hero-visual figcaption,
  .enemy-card-visual figcaption,
  .story-card-visual figcaption {
    display: grid;
  }

  .enemy-filter-grid,
  .story-filter-grid {
    grid-template-columns: 1fr;
  }

  .enemy-search-field,
  .story-search-field {
    grid-column: auto;
  }

  .enemy-filter-footer,
  .story-filter-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .enemy-card-body,
  .story-card-body,
  .enemy-dossier-body,
  .story-dossier-body {
    padding: 16px;
  }

  .enemy-card-topline,
  .story-card-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-act-grid,
  .story-character-grid {
    grid-template-columns: 1fr;
  }

  .story-continuity-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-briefing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 470px) {
  .enemy-hero-stats,
  .story-hero-stats,
  .enemy-card-stats,
  .story-card-stats {
    grid-template-columns: 1fr;
  }

  .enemy-hero-stats div,
  .enemy-hero-stats div:nth-child(2n),
  .story-hero-stats div,
  .story-hero-stats div:nth-child(2n),
  .enemy-card-stats > div,
  .enemy-card-stats > div:nth-child(2n),
  .story-card-stats > div,
  .story-card-stats > div:nth-child(2n) {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid #263133;
    border-top: 0;
  }

  .enemy-hero-stats div:last-child,
  .story-hero-stats div:last-child,
  .enemy-card-stats > div:last-child,
  .story-card-stats > div:last-child {
    border-bottom: 0;
  }

  .enemy-filter-panel,
  .story-filter-panel {
    padding: 15px;
  }
}
