:root {
  color-scheme: dark;
  --bg: #07110f;
  --panel: #101a17;
  --panel-strong: #16241f;
  --line: #2e4b41;
  --line-bright: #6ecfb0;
  --text: #e9f5ef;
  --muted: #9ab0a7;
  --amber: #d7a944;
  --red: #d46d62;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(110, 207, 176, 0.14), transparent 30rem),
    linear-gradient(135deg, #07110f 0%, #101713 48%, #18150e 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
}

.station-header,
.station-intro,
.archive-shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
  min-width: 0;
}

.station-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 38px 0 18px;
}

.station-intro {
  margin-bottom: 24px;
}

.station-intro .header-copy {
  width: 100%;
  max-width: none;
}


.station-mark {
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  border: 1px solid var(--line-bright);
  background: rgba(16, 26, 23, 0.82);
  box-shadow: var(--shadow);
}

.station-mark span {
  grid-area: 1 / 1;
  display: block;
  border: 1px solid var(--line-bright);
}

.station-mark span:nth-child(1) {
  width: 54px;
  aspect-ratio: 1;
}

.station-mark span:nth-child(2) {
  width: 34px;
  aspect-ratio: 1;
  transform: rotate(45deg);
}

.station-mark span:nth-child(3) {
  width: 8px;
  aspect-ratio: 1;
  background: var(--line-bright);
}

.eyebrow,
.status-label,
.card-topline,
.document-id,
.document-action,
.generation-stamp {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.95;
}

h1 span {
  display: inline;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.header-copy {
  max-width: 980px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: balance;
}

.archive-shell {
  display: grid;
  gap: 24px;
  padding-bottom: 44px;
}

.archive-shell > section {
  min-width: 0;
  max-width: 100%;
}

.status-summary {
  display: grid;
  gap: 10px;
}

.summary-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(7, 17, 15, 0.72);
}

.summary-switch button {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.74rem;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.summary-switch button:last-child {
  border-right: 0;
}

.summary-switch button:hover,
.summary-switch button:focus-visible,
.summary-switch button[aria-pressed="true"] {
  background: rgba(22, 36, 31, 0.95);
  color: var(--text);
  outline: none;
}

.summary-switch button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px rgba(110, 207, 176, 0.28);
}

.status-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(16, 26, 23, 0.72);
  box-shadow: var(--shadow);
}

.status-panel > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.status-panel > div:last-child {
  border-right: 0;
}

.status-panel strong {
  font-size: 1.1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-detail {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.status-panel .cleared strong {
  color: var(--line-bright);
}

.status-panel .in-progress strong {
  color: var(--amber);
}

.status-panel .classified strong {
  color: var(--red);
}

.status-panel .in-progress {
  background: rgba(44, 34, 14, 0.22);
}

.status-panel .classified {
  background: rgba(52, 19, 18, 0.24);
}


.section-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-grid {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 14px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  padding: 0 0 12px;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--line-bright) rgba(16, 26, 23, 0.86);
  scrollbar-width: thin;
  scroll-snap-type: inline proximity;
}

.section-grid::-webkit-scrollbar {
  height: 10px;
}

.section-grid::-webkit-scrollbar-track {
  background: rgba(16, 26, 23, 0.86);
  border-radius: 999px;
}

.section-grid::-webkit-scrollbar-thumb {
  background: var(--line-bright);
  border-radius: 999px;
}

.section-card {
  display: grid;
  flex: 0 0 calc((100% - 42px) / 4);
  gap: 14px;
  min-width: 0;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(16, 26, 23, 0.76);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.section-card:hover,
.section-card:focus-visible,
.section-card[data-active="true"] {
  border-color: var(--line-bright);
  background: rgba(22, 36, 31, 0.95);
  box-shadow: inset 0 0 0 1px rgba(110, 207, 176, 0.32), 0 0 22px rgba(110, 207, 176, 0.14);
  outline: none;
}

.section-card.maintenance {
  border-color: rgba(215, 169, 68, 0.45);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.section-card strong {
  font-size: 1.25rem;
}

.card-copy {
  color: var(--muted);
  line-height: 1.45;
}

.card-status {
  align-self: end;
  color: var(--line-bright);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.maintenance .card-status {
  color: var(--amber);
}

.document-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(16, 26, 23, 0.78);
  box-shadow: var(--shadow);
  padding: 20px;
}

.document-panel[hidden] {
  display: none;
}

.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(7, 17, 15, 0.72);
  color: var(--text);
  cursor: pointer;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--line-bright);
  outline: none;
}

.document-list {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.document-row {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 2fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 74px;
  padding: 14px;
  border: 1px solid rgba(110, 207, 176, 0.22);
  border-radius: 4px;
  background: rgba(7, 17, 15, 0.62);
  color: var(--text);
  text-decoration: none;
}

.document-row:hover,
.document-row:focus-visible {
  border-color: var(--line-bright);
  outline: none;
}

.document-row.in-progress {
  border-color: rgba(215, 169, 68, 0.64);
  background: rgba(44, 34, 14, 0.5);
}

.document-row.in-progress:hover,
.document-row.in-progress:focus-visible {
  border-color: var(--amber);
}

.document-row.classified {
  border-color: rgba(212, 109, 98, 0.72);
  background: rgba(52, 19, 18, 0.54);
}

.document-row.classified:hover,
.document-row.classified:focus-visible {
  border-color: var(--red);
}

.document-row.unavailable {
  cursor: default;
}

.document-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.document-row > * {
  min-width: 0;
  max-width: 100%;
}

.document-main strong,
.document-main span,
.document-id {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.document-main span {
  color: var(--muted);
}

.document-row.in-progress .document-main span,
.document-row.in-progress .document-action {
  color: var(--amber);
}

.document-row.classified .document-main span,
.document-row.classified .document-action {
  color: var(--red);
}

.document-action {
  color: var(--line-bright);
  white-space: nowrap;
}

.maintenance-notice {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(215, 169, 68, 0.5);
  border-radius: 4px;
  background: rgba(44, 34, 14, 0.38);
}

.maintenance-notice span {
  color: var(--amber);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.maintenance-notice p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.maintenance-notice.neutral {
  border-color: rgba(110, 207, 176, 0.35);
  background: rgba(7, 17, 15, 0.42);
}

.maintenance-notice.neutral span {
  color: var(--line-bright);
}

@media (max-width: 980px) {
  .header-copy {
    white-space: normal;
  }

  .section-grid {
    gap: 12px;
  }

  .section-card {
    flex-basis: min(320px, 72vw);
  }

  .document-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .document-id {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 50% -8rem, rgba(110, 207, 176, 0.16), transparent 20rem),
      linear-gradient(135deg, #07110f 0%, #101713 58%, #17140e 100%);
  }

  .station-header,
  .station-intro,
  .archive-shell {
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
  }

  .station-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 18px 0 14px;
  }

  .station-mark {
    width: 42px;
    margin-top: 4px;
  }

  .station-mark span:nth-child(1) {
    width: 27px;
  }

  .station-mark span:nth-child(2) {
    width: 18px;
  }

  h1 {
    max-width: 100%;
    margin-bottom: 8px;
    font-size: 1.72rem;
    line-height: 1;
    overflow-wrap: anywhere;
  }

  h1 span {
    display: block;
  }

  h2 {
    font-size: 1.35rem;
  }

  .eyebrow,
  .status-label,
  .card-topline,
  .document-id,
  .document-action,
  .generation-stamp {
    font-size: 0.68rem;
  }

  .header-copy {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .archive-shell {
    gap: 16px;
    padding-bottom: 26px;
  }

  .status-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .summary-switch {
    width: 100%;
  }

  .summary-switch button {
    min-width: 0;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .status-panel > div {
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
  }

  .status-panel > div:last-child {
    border-bottom: 0;
  }

  .status-panel strong {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
  }

  .status-detail {
    font-size: 0.68rem;
  }

  .section-heading {
    display: grid;
    align-items: start;
    gap: 6px;
    margin-bottom: 10px;
  }

  .section-grid {
    width: 100%;
    min-width: 0;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-snap-type: inline mandatory;
  }

  .section-card {
    flex: 0 0 calc(100vw - 42px);
    max-width: calc(100vw - 42px);
    gap: 6px 10px;
    min-height: 0;
    padding: 12px;
    scroll-snap-align: start;
  }

  .card-topline,
  .card-status {
    grid-column: 1 / -1;
  }

  .card-topline {
    order: -1;
  }

  .section-card strong {
    font-size: 1.05rem;
  }

  .card-copy {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .card-status {
    margin-top: 2px;
    font-size: 0.72rem;
  }

  .document-panel {
    min-width: 0;
    padding: 12px;
  }

  .document-row {
    min-width: 0;
    max-width: 100%;
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    gap: 8px;
    padding: 12px;
  }

  .document-main {
    gap: 4px;
  }

  .document-main strong {
    font-size: 0.98rem;
  }

  .document-action {
    white-space: normal;
  }

  .maintenance-notice {
    min-width: 0;
    padding: 12px;
  }
}
