:root {
  --ink: #090909;
  --ink-soft: #141312;
  --ivory: #eee9dc;
  --ivory-muted: #b8b0a0;
  --paper: #ded5c4;
  --red: #8f1720;
  --red-bright: #c02d35;
  --green: #7d9a78;
  --amber: #c39a52;
  --line: rgba(238, 233, 220, 0.18);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ivory);
  background:
    radial-gradient(circle at 20% -10%, rgba(143, 23, 32, 0.2), transparent 35rem),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 28px 28px, 28px 28px, auto;
  font-family: var(--sans);
  line-height: 1.55;
}

.entry-page,
.transmission-page {
  overflow: hidden;
  background: #050505;
}

.entry-sequence,
.transmission-screen {
  min-height: 100svh;
}

.entry-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms ease;
}

.entry-stage--active {
  opacity: 1;
  visibility: visible;
}

.entry-stage > p,
.entry-stage__type {
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(1.6rem, 7vw, 3.4rem);
  text-align: center;
}

.entry-stage__cursor {
  position: absolute;
  left: calc(50% + min(39vw, 330px));
  width: 2px;
  height: 1.2em;
  background: var(--red-bright);
  animation: cursor-blink 800ms steps(1) infinite;
}

.signal-loader {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 70px;
}

.signal-loader i {
  width: 3px;
  height: 18px;
  background: var(--red-bright);
  animation: signal-load 900ms ease-in-out infinite alternate;
}

.signal-loader i:nth-child(2) { animation-delay: 120ms; }
.signal-loader i:nth-child(3) { animation-delay: 240ms; }
.signal-loader i:nth-child(4) { animation-delay: 360ms; }
.signal-loader i:nth-child(5) { animation-delay: 480ms; }
.signal-loader--waiting { position: absolute; transform: translateY(-52px); }

.secure-mark {
  position: absolute;
  width: 64px;
  height: 64px;
  margin-top: -105px;
  border: 1px solid var(--green);
  border-radius: 50%;
}

.secure-mark::before,
.secure-mark::after {
  position: absolute;
  content: "";
  background: var(--green);
}

.secure-mark::before { width: 24px; height: 1px; top: 34px; left: 18px; transform: rotate(42deg); }
.secure-mark::after { width: 34px; height: 1px; top: 29px; left: 29px; transform: rotate(-50deg); transform-origin: left; }

.entry-stage--identity {
  overflow-y: auto;
  align-items: center;
}

.identity-prompt {
  width: min(100%, 480px);
}

.identity-prompt__signal {
  margin: 0 0 22px;
  color: var(--red-bright);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.identity-prompt h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 13vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.identity-prompt__hint {
  margin: 24px 0 36px;
  color: var(--ivory-muted);
  font-family: var(--serif);
  font-size: 1rem;
}

.identity-prompt__error {
  margin: -18px 0 24px;
  color: var(--red-bright);
  font-size: 0.78rem;
}

.identity-form {
  display: grid;
  gap: 24px;
}

.identity-form label {
  display: grid;
  gap: 7px;
}

.identity-form label span {
  color: var(--ivory-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.identity-form input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(238, 233, 220, 0.35);
  border-radius: 0;
  padding: 12px 0;
  color: var(--ivory);
  background: transparent;
  outline: 0;
}

.identity-form input:focus { border-color: var(--red-bright); }

.identity-form button {
  justify-self: end;
  min-width: 120px;
  margin-top: 12px;
  border: 1px solid var(--red-bright);
  padding: 12px 24px;
  color: var(--ivory);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

[data-entry-stage="verified"] {
  align-content: center;
  gap: 12px;
}

[data-entry-stage="verified"] strong {
  color: var(--red-bright);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.transmission-screen {
  display: grid;
  place-items: center;
  align-content: center;
  padding: 28px;
  text-align: center;
}

.transmission-screen__label {
  margin: 0 0 18px;
  color: var(--red-bright);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.transmission-screen h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 12vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.waveform--transmission {
  width: min(100%, 340px);
  margin: 34px 0;
}

.waveform--transmission i { animation-play-state: paused; opacity: 0.45; }
.waveform--transmission.waveform--playing i { animation-play-state: running; opacity: 1; }

.audio-trigger {
  position: relative;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(238, 233, 220, 0.5);
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 0 0 12px rgba(238, 233, 220, 0.04);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.audio-trigger:hover,
.audio-trigger:focus-visible { transform: scale(1.04); box-shadow: 0 0 0 15px rgba(238, 233, 220, 0.07); }

.audio-trigger span {
  position: absolute;
  top: 50%;
  left: 53%;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 19px solid var(--ink);
  transform: translate(-50%, -50%);
}

.audio-trigger--playing span {
  left: 50%;
  width: 15px;
  height: 24px;
  border: 0;
  border-inline: 5px solid var(--ink);
}

.transmission-screen__state {
  min-height: 1.5em;
  margin: 18px 0 0;
  color: var(--ivory-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.transmission-screen__continue {
  margin-top: 28px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--red-bright);
  color: var(--ivory);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.identity-review {
  margin-bottom: 22px;
  padding: 24px;
}

.identity-review__details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.identity-review__details div { display: grid; gap: 4px; }
.identity-review__details span { color: var(--ivory-muted); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; }
.identity-review__details strong { overflow-wrap: anywhere; }

@keyframes cursor-blink { 50% { opacity: 0; } }
@keyframes signal-load { to { height: 58px; opacity: 0.35; } }

@media (max-width: 560px) {
  .identity-review__details { grid-template-columns: 1fr; }
  .entry-stage__cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .entry-stage,
  .signal-loader i,
  .entry-stage__cursor { animation: none; transition: none; }
}

button, input, textarea { font: inherit; }
a { color: inherit; }

.app::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: linear-gradient(115deg, transparent 46%, rgba(255,255,255,0.025) 50%, transparent 54%);
}

.access-shell,
.mission-shell,
.admin-shell {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

.access-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-block: 32px;
}

.mission-shell { padding: 20px 0 56px; }
.admin-shell { width: min(100% - 32px, 1120px); padding: 28px 0 64px; }

.dossier {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.055), transparent 30%),
    var(--ink-soft);
  box-shadow: var(--shadow);
}

.dossier::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.14;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,0.04) 4px);
}

.dossier > * { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--ivory-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.classified-stamp {
  display: inline-block;
  border: 3px double var(--red-bright);
  padding: 4px 9px;
  color: var(--red-bright);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.classified-stamp--tilted { transform: rotate(7deg); }
.classified-stamp--approved { color: var(--green); border-color: var(--green); }

.access-card { width: min(100%, 470px); padding: clamp(28px, 7vw, 54px); }
.access-card .classified-stamp { position: absolute; top: 24px; right: 22px; }
.access-card__title, .access-card h1 { margin: 34px 0 18px; font-family: var(--serif); font-size: clamp(2.4rem, 11vw, 4.5rem); line-height: 0.91; font-weight: 500; }
.access-card__title--agent { color: var(--paper); }
.access-card__lede { color: var(--ivory-muted); }
.identity-lock { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 15px; margin: 24px 0; border-block: 1px solid var(--line); padding: 13px 0; }
.identity-lock span { color: var(--ivory-muted); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.identity-lock strong { grid-row: 1 / 3; grid-column: 2; font-family: monospace; letter-spacing: 0.12em; }
.identity-lock i { color: var(--green); font-size: 0.66rem; font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; }
.passphrase-clue { margin: 26px 0 8px; border-left: 2px solid var(--red); padding-left: 15px; }
.passphrase-clue p:last-child { margin-bottom: 0; font-family: var(--serif); font-size: 1.08rem; }
.format-hint { color: var(--ivory-muted); font-size: 0.78rem; }
.format-hint summary { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.format-hint strong { color: var(--ivory); }

.form { display: grid; gap: 18px; margin-top: 28px; }
.field { display: grid; gap: 7px; }
.field__label { color: var(--ivory-muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.field__input {
  width: 100%;
  border: 1px solid rgba(238,233,220,0.28);
  border-radius: 0;
  padding: 13px 14px;
  color: var(--ivory);
  background: rgba(0,0,0,0.35);
  outline: none;
}
.field__input:focus { border-color: var(--red-bright); box-shadow: 0 0 0 2px rgba(192,45,53,0.18); }
.field__input--textarea { min-height: 88px; resize: vertical; }
.field__hint { color: var(--ivory-muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

.code-entry { position: relative; display: block; }
.code-entry__input { width: 100%; border: 1px solid rgba(238,233,220,0.28); padding: 14px; color: var(--ivory); background: rgba(0,0,0,0.35); font-family: monospace; font-size: 1.5rem; letter-spacing: 0.45em; text-align: center; text-transform: none; }
.code-entry__cells { display: none; }
.code-entry--enhanced .code-entry__input { position: absolute; inset: 0; z-index: 2; height: 100%; opacity: 0; cursor: text; }
.code-entry--enhanced .code-entry__cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 9px; }
.code-entry__cell { display: grid; place-items: center; aspect-ratio: 0.9; border: 1px solid rgba(238,233,220,0.3); color: var(--ivory); background: rgba(0,0,0,0.35); font-family: monospace; font-size: clamp(1.25rem, 7vw, 2rem); text-transform: none; transition: border-color 150ms ease, background 150ms ease; }
.code-entry--enhanced:focus-within .code-entry__cell { border-color: rgba(192,45,53,0.7); background: rgba(143,23,32,0.08); }
.code-entry__cell--filled { border-color: var(--ivory-muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  padding: 11px 16px;
  color: var(--ivory);
  background: rgba(255,255,255,0.05);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.button:hover, .button:focus-visible { transform: translateY(-1px); border-color: var(--ivory-muted); }
.button--primary { border-color: var(--red); background: var(--red); }
.button--primary:hover { background: var(--red-bright); }
.button--success { border-color: #536b50; background: #334530; }
.button--danger { border-color: var(--red); background: rgba(143,23,32,0.35); }
.button--quiet { background: transparent; }
.button--full { width: 100%; }

.alert { margin: 20px 0; border-left: 3px solid var(--amber); padding: 12px 14px; color: var(--paper); background: rgba(195,154,82,0.1); font-size: 0.88rem; }
.alert--danger { border-color: var(--red-bright); background: rgba(143,23,32,0.15); }
.alert--warning { border-color: var(--amber); }

.security-note { margin: 24px 0 0; color: var(--ivory-muted); font-size: 0.7rem; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
.status-light { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: signal-pulse 2s infinite; }

.topbar, .admin-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.topbar { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.topbar__brand { font-family: var(--serif); font-size: 1rem; }
.topbar__signal, .topbar__agent { color: var(--ivory-muted); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }

.transmission, .role-card, .mission-card, .final-card { padding: clamp(24px, 6vw, 46px); }
.transmission { margin-top: 30px; }
.transmission__header, .mission-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.transmission__code { color: var(--red-bright); font-family: monospace; }
.transmission h1, .mission-card h1, .final-card h1 { margin: 24px 0; font-family: var(--serif); font-size: clamp(2rem, 8vw, 3.8rem); line-height: 1; font-weight: 500; }
.transmission h1 span { color: var(--red-bright); }
.transmission__transcript { border-left: 2px solid var(--red); padding-left: 14px; color: var(--ivory-muted); font-family: var(--serif); font-style: italic; }
.transmission__notice { color: var(--ivory-muted); font-size: 0.78rem; letter-spacing: 0.04em; }
.transmission__accept { margin-top: 24px; }
.transcript { margin-top: 18px; color: var(--ivory-muted); font-size: 0.78rem; }
.transcript summary { cursor: pointer; letter-spacing: 0.08em; text-transform: uppercase; }
.transcript p { border-left: 2px solid var(--red); padding-left: 14px; font-family: var(--serif); font-style: italic; }
.role-card { margin-top: 22px; }
.role-card h2, .audio-panel h2, .evidence-panel h2, .waiting-panel h2 { margin: 5px 0 12px; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.role-card--clearance { margin-top: 48px; }
.role-card--clearance .classified-stamp { position: absolute; top: 28px; right: 26px; }
.role-card--clearance h1 { margin: 32px 0 14px; font-family: var(--serif); font-size: clamp(2.4rem, 10vw, 4rem); font-weight: 500; line-height: 0.95; }
.role-card__lead { margin-bottom: 35px; color: var(--ivory-muted); }

.waveform { height: 70px; display: flex; align-items: center; justify-content: center; gap: 4px; margin: 22px 0; overflow: hidden; }
.waveform i { width: 3px; height: 16px; background: var(--red-bright); animation: waveform 1.3s ease-in-out infinite alternate; }
.waveform i:nth-child(3n) { animation-delay: -0.8s; }
.waveform i:nth-child(4n) { animation-delay: -0.3s; }
.waveform i:nth-child(5n) { animation-delay: -1.1s; }
.waveform--small { height: 48px; }
.native-audio { width: 100%; min-height: 44px; filter: sepia(0.7) saturate(0.8); }
.countdown { margin-top: 18px; color: var(--red-bright); font-size: 0.75rem; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }

.progress-strip { margin: 28px 0 15px; }
.progress-strip__line { height: 2px; background: rgba(238,233,220,0.12); }
.progress-strip__line span { display: block; width: 20%; height: 100%; background: var(--red-bright); box-shadow: 0 0 12px rgba(192,45,53,0.7); }
.progress-strip p { display: flex; justify-content: space-between; color: var(--ivory-muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mission-card__header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.mission-card__header h1 { margin: 0; }

.briefing-block { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin: 10px 0 25px; }
.briefing-block__index { color: rgba(238,233,220,0.18); font-family: var(--serif); font-size: 3.6rem; line-height: 1; }
.clue-text { margin: 0; font-family: var(--serif); font-size: 1.2rem; }
.coordinate-panel { margin-bottom: 28px; border: 1px solid var(--line); padding: 22px; background: rgba(0,0,0,0.25); }
.coordinate-panel__value { margin: 12px 0; color: var(--red-bright); font-family: monospace; font-size: clamp(1.55rem, 7vw, 2.7rem); line-height: 1.25; letter-spacing: 0.04em; }
.audio-panel, .evidence-panel, .waiting-panel { padding: 8px 0 24px; text-align: center; }
.protocol-tag { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 25px; border: 1px solid var(--line); padding: 11px 13px; color: var(--ivory-muted); font-size: 0.67rem; letter-spacing: 0.1em; text-transform: uppercase; }
.protocol-tag strong { color: var(--paper); }
.handoff-panel { padding: 8px 0 24px; text-align: center; }
.handoff-panel h2 { margin: 5px 0 12px; font-family: var(--serif); font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 500; }
.signal-count { display: flex; justify-content: center; gap: 18px; margin: 18px 0; }
.signal-count i { width: 48px; height: 48px; border: 1px solid var(--amber); border-radius: 50%; background: radial-gradient(circle, rgba(238,233,220,0.95) 0 8%, rgba(195,154,82,0.65) 25%, rgba(195,154,82,0.08) 68%); box-shadow: 0 0 24px rgba(195,154,82,0.35); animation: signal-flash 2.4s infinite; }
.signal-count i:nth-child(2) { animation-delay: 0.35s; }
.signal-count i:nth-child(3) { animation-delay: 0.7s; }
.authorization-preview { display: grid; gap: 5px; margin: 24px 0 0; border: 1px dashed var(--red-bright); padding: 20px; color: var(--ivory); background: rgba(143,23,32,0.08); text-decoration: none; }
.authorization-preview span, .authorization-preview small { color: var(--ivory-muted); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.authorization-preview strong { color: var(--paper); font-family: monospace; font-size: 1.4rem; letter-spacing: 0.1em; }
.supply-reveal__briefing { margin-bottom: 22px; color: var(--ivory-muted); }
.supply-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 22px 0; }
.supply-progress i { display: grid; place-items: center; min-height: 34px; border: 1px solid var(--line); color: var(--ivory-muted); font-family: monospace; font-size: 0.67rem; font-style: normal; }
.supply-progress__current { border-color: var(--amber) !important; color: var(--paper) !important; background: rgba(195,154,82,0.12); }
.supply-progress__complete { border-color: var(--green) !important; color: var(--green) !important; }
.supply-asset { position: relative; min-height: 230px; display: grid; align-content: center; margin: 20px 0 26px; border: 1px solid rgba(195,154,82,0.4); padding: 28px 24px; overflow: hidden; background: linear-gradient(135deg, rgba(195,154,82,0.1), rgba(0,0,0,0.24)); }
.supply-asset__number { position: absolute; top: -18px; right: 8px; color: rgba(238,233,220,0.08); font-family: var(--serif); font-size: 8rem; line-height: 1; }
.supply-asset h2, .project-reveal h2 { position: relative; margin: 8px 0 12px; font-family: var(--serif); font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 500; line-height: 1; }
.supply-asset p { position: relative; }
.project-reveal { padding: 10px 0 20px; text-align: center; }
.project-reveal .classified-stamp { margin-bottom: 28px; }
.project-reveal__message { max-width: 590px; margin: 0 auto 28px; color: var(--ivory-muted); font-family: var(--serif); font-size: 1.08rem; }
.project-package { margin: 24px 0; border: 1px dashed var(--amber); padding: 24px; background: rgba(195,154,82,0.08); }
.project-package h3 { margin: 6px 0 10px; color: var(--paper); font-family: var(--serif); font-size: clamp(1.5rem, 7vw, 2.3rem); font-weight: 500; }
.intel-alert { display: grid; grid-template-columns: auto 1fr; gap: 16px; margin-bottom: 28px; border: 1px solid rgba(192,45,53,0.55); padding: 18px; background: rgba(143,23,32,0.12); }
.intel-alert p:last-child { margin-bottom: 0; font-family: var(--serif); font-size: 1.08rem; }
.intel-alert__beacon { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 18px var(--red-bright); animation: signal-pulse 1s infinite; }
.cache-riddle { margin: 28px 0; border-left: 2px solid var(--red); padding-left: 18px; }
.cache-recovery { padding: 8px 0 12px; }
.cache-recovery .classified-stamp { margin-bottom: 28px; }
.cache-recovery h2 { margin: 8px 0 14px; font-family: var(--serif); font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 500; }
.memory-briefing { margin-bottom: 22px; border-left: 2px solid var(--red); padding-left: 16px; color: var(--ivory-muted); }
.memory-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 26px 0 34px; }
.memory-progress__dot { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); color: var(--ivory-muted); font-family: monospace; font-size: 0.75rem; }
.memory-progress__dot--current { border-color: var(--red-bright); color: var(--ivory); background: rgba(143,23,32,0.24); box-shadow: 0 0 16px rgba(143,23,32,0.22); }
.memory-progress__dot--complete { border-color: var(--green); color: var(--green); background: rgba(125,154,120,0.09); }
.memory-question { margin-bottom: 24px; }
.memory-question h2 { margin: 8px 0; font-family: var(--serif); font-size: clamp(1.55rem, 7vw, 2.35rem); font-weight: 500; line-height: 1.2; }
.choice-fieldset { margin: 0; border: 0; padding: 0; }
.choice-fieldset legend { margin-bottom: 9px; }
.choice-list { display: grid; gap: 10px; }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-card span { display: block; border: 1px solid var(--line); padding: 15px 16px; color: var(--paper); background: rgba(0,0,0,0.24); transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
.choice-card input:focus-visible + span { outline: 2px solid var(--red-bright); outline-offset: 2px; }
.choice-card input:checked + span { border-color: var(--red-bright); background: rgba(143,23,32,0.2); transform: translateX(3px); }

.radar { position: relative; width: 110px; height: 110px; margin: 5px auto 25px; overflow: hidden; border: 1px solid rgba(125,154,120,0.5); border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 18px, rgba(125,154,120,0.18) 19px 20px); }
.radar::before, .radar::after { position: absolute; content: ""; background: rgba(125,154,120,0.25); }
.radar::before { width: 1px; height: 100%; left: 50%; }
.radar::after { width: 100%; height: 1px; top: 50%; left: 0; }
.radar span { position: absolute; inset: 50% 50% 0 0; transform-origin: 100% 0; background: linear-gradient(45deg, transparent 45%, rgba(125,154,120,0.65)); animation: radar-sweep 2.5s linear infinite; }
.text-link { color: var(--paper); text-underline-offset: 4px; }
.logout-form { margin-top: 24px; text-align: center; }
.text-button { border: 0; color: var(--ivory-muted); background: transparent; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }

.evidence-modal { width: min(calc(100% - 28px), 480px); border: 1px solid var(--line); padding: 0; color: var(--ivory); background: var(--ink-soft); box-shadow: var(--shadow); }
.evidence-modal::backdrop { background: rgba(0,0,0,0.83); backdrop-filter: blur(5px); }
.evidence-modal__card { position: relative; padding: 32px; }
.evidence-modal__card .classified-stamp { position: absolute; top: 32px; right: 30px; }
.evidence-modal__card h2 { margin: 34px 0 12px; font-family: var(--serif); font-size: 2rem; }
.evidence-modal__close { position: absolute; top: 8px; right: 10px; border: 0; color: var(--ivory-muted); background: transparent; font-size: 1.6rem; cursor: pointer; }
.file-picker { display: flex; justify-content: center; margin-top: 24px; border: 1px dashed var(--ivory-muted); padding: 18px; cursor: pointer; }
.file-picker span { font-size: 0.73rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker__name { min-height: 24px; color: var(--ivory-muted); font-size: 0.75rem; text-align: center; }

.admin-header h1 { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 500; }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; padding: 22px; }
.admin-summary div { display: grid; gap: 5px; padding: 0 18px; border-right: 1px solid var(--line); }
.admin-summary div:last-child { border: 0; }
.admin-summary span { color: var(--ivory-muted); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-grid { display: grid; gap: 20px; }
.admin-mission { padding: 25px; }
.admin-mission--active { border-color: rgba(192,45,53,0.65); }
.admin-mission header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.admin-mission h2 { margin: 0; font-family: var(--serif); font-weight: 500; }
.admin-mission__number { color: rgba(238,233,220,0.2); font-family: var(--serif); font-size: 2.8rem; }
.status-badge { border: 1px solid var(--line); padding: 4px 8px; color: var(--ivory-muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.status-badge--waiting { color: var(--amber); border-color: var(--amber); }
.status-badge--passed { color: var(--green); border-color: var(--green); }
.status-badge--retry { color: var(--red-bright); border-color: var(--red-bright); }
.evidence-preview { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 15px; margin: 20px 0; color: var(--ivory-muted); text-decoration: none; }
.evidence-preview img { width: 110px; height: 80px; object-fit: cover; border: 1px solid var(--line); }
.admin-actions { display: grid; gap: 14px; margin-top: 22px; }
.admin-actions__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-protocol { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 18px 0; border-left: 2px solid var(--red); padding-left: 13px; font-size: 0.76rem; }
.admin-protocol span { color: var(--ivory-muted); text-transform: uppercase; }
.admin-answer-list { display: grid; gap: 8px; margin: 16px 0; padding-left: 22px; }
.admin-answer-list li { padding-left: 6px; color: var(--ivory-muted); font-size: 0.76rem; }
.admin-answer-list li span, .admin-answer-list li strong { display: block; }
.admin-answer-list li strong { margin-top: 2px; color: var(--paper); }

.final-archive-alert { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin-bottom: 28px; border: 1px solid rgba(195,154,82,0.45); padding: 20px; background: linear-gradient(135deg, rgba(195,154,82,0.12), rgba(143,23,32,0.08)); }
.final-archive-alert__mark { color: rgba(238,233,220,0.2); font-family: var(--serif); font-size: 3.6rem; line-height: 1; }
.final-archive-alert p:last-child { margin-bottom: 0; font-family: var(--serif); font-size: 1.08rem; }
.final-coordinate-panel { border-color: rgba(195,154,82,0.45); }
.final-hold { padding-top: 18px; }
.final-reveal { margin: -8px -8px -24px; padding: clamp(28px, 7vw, 54px); color: #211b17; background: linear-gradient(145deg, rgba(143,23,32,0.08), transparent 42%), var(--ivory); text-align: left; }
.final-reveal .eyebrow { margin-top: 34px; color: #756b60; }
.final-reveal h2, .final-accepted h2 { margin: 8px 0 24px; font-family: var(--serif); font-size: clamp(2.2rem, 9vw, 4rem); font-weight: 500; line-height: 0.98; }
.classified-stamp--declassified { border-color: var(--red); color: var(--red); transform: rotate(-5deg); }
.final-reveal__letter { margin: 24px 0; border-left: 2px solid var(--red); padding-left: 18px; font-family: var(--serif); font-size: 1.03rem; line-height: 1.65; }
.final-reveal__instruction { margin: 30px 0; border-block: 1px solid rgba(33,27,23,0.28); padding: 18px 0; color: var(--red); font-size: 0.82rem; font-weight: 900; letter-spacing: 0.11em; text-align: center; text-transform: uppercase; }
.final-accepted { min-height: 430px; display: grid; align-content: center; justify-items: center; padding: 36px 12px; text-align: center; }
.final-accepted .classified-stamp { margin-bottom: 28px; }
.final-accepted p:last-child { color: var(--ivory-muted); font-family: var(--serif); font-size: 1.1rem; }

.authorization-page { min-height: 100vh; padding: 20px; color: #171514; background: var(--paper); }
.authorization-document { position: relative; width: min(100%, 720px); margin: 20px auto; border: 2px solid #171514; padding: clamp(28px, 7vw, 60px); background: var(--ivory); box-shadow: var(--shadow); }
.authorization-document .eyebrow { color: #5f5750; }
.authorization-document .classified-stamp { position: absolute; top: 30px; right: 30px; }
.authorization-document h1 { max-width: 520px; margin: 40px 0; font-family: var(--serif); font-size: clamp(2.2rem, 9vw, 4.4rem); font-weight: 500; line-height: 0.95; }
.authorization-document dl { margin: 30px 0; border-block: 1px solid #81786e; }
.authorization-document dl div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid #b9b0a4; }
.authorization-document dl div:last-child { border: 0; }
.authorization-document dt { color: #5f5750; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.authorization-document dd { margin: 0; font-weight: 800; }
.authorization-document__code { color: var(--red); font-family: monospace; font-size: 1.25rem; letter-spacing: 0.08em; }
.authorization-document__warning { margin-top: 35px; border-top: 4px solid #171514; padding-top: 12px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.activity-log { margin-top: 22px; padding: 25px; }
.activity-log__entry { display: grid; grid-template-columns: 160px 190px 1fr; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 0.78rem; }
.activity-log__entry time, .activity-log__entry span { color: var(--ivory-muted); }

@keyframes signal-pulse { 50% { opacity: 0.45; } }
@keyframes waveform { from { height: 9px; opacity: 0.35; } to { height: 58px; opacity: 1; } }
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@keyframes signal-flash { 0%, 18%, 100% { opacity: 0.25; } 8% { opacity: 1; } }

@media print {
  .authorization-page { padding: 0; background: #fff; }
  .authorization-document { width: 100%; margin: 0; box-shadow: none; }
  .authorization-document__print { display: none; }
}

@media (max-width: 620px) {
  .access-shell, .mission-shell, .admin-shell { width: min(100% - 20px, 760px); }
  .mission-card__header { display: grid; }
  .mission-card__header .classified-stamp { justify-self: start; }
  .admin-header { align-items: flex-end; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-summary div { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-mission { padding: 18px; }
  .admin-mission header { grid-template-columns: auto 1fr; }
  .admin-mission header .status-badge { grid-column: 1 / -1; justify-self: start; }
  .admin-actions__buttons .button { flex: 1 1 calc(50% - 8px); }
  .activity-log__entry { grid-template-columns: 1fr; gap: 2px; }
}

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