:root {
  color-scheme: dark;
  --ink: #070909;
  --ink-soft: #0d1111;
  --panel: rgba(12, 16, 16, .9);
  --line: rgba(188, 255, 0, .2);
  --line-strong: rgba(188, 255, 0, .55);
  --acid: #bcff00;
  --acid-hot: #dcff72;
  --red: #ff365e;
  --paper: #edf6e4;
  --muted: #8c9d8d;
  --dim: #536055;
  --mono: "Cascadia Mono", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  --shadow: 0 22px 70px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 85% 5%, rgba(188, 255, 0, .075), transparent 28rem),
    linear-gradient(rgba(188, 255, 0, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(188, 255, 0, .025) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 44px 44px, 44px 44px, auto;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.scanline {
  position: fixed;
  z-index: 19;
  top: -10%;
  left: 0;
  width: 100%;
  height: 8rem;
  pointer-events: none;
  opacity: .09;
  background: linear-gradient(transparent, var(--acid), transparent);
  animation: scan 11s linear infinite;
}

.topbar {
  min-height: 74px;
  padding: 0 clamp(20px, 4vw, 68px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(7, 9, 9, .82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  font: 900 1.2rem/1 var(--mono);
  clip-path: polygon(0 0, 100% 0, 100% 75%, 74% 100%, 0 100%);
}

.brand strong, .brand small { display: block; }
.brand strong { font: 800 .95rem/1 var(--mono); letter-spacing: .18em; }
.brand small { margin-top: 5px; color: var(--muted); font: 600 .58rem/1 var(--mono); letter-spacing: .13em; }

.system-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 700 .65rem/1 var(--mono);
  letter-spacing: .16em;
}

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar-actions form { margin: 0; }
.lock-button {
  padding: 8px 10px;
  color: var(--red);
  border: 1px solid rgba(255, 54, 94, .4);
  background: transparent;
  cursor: pointer;
  font: 700 .6rem/1 var(--mono);
  letter-spacing: .12em;
}
.lock-button:hover { color: var(--ink); background: var(--red); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 14px var(--acid);
  animation: pulse 2.2s ease-in-out infinite;
}

.shell {
  width: min(1540px, calc(100% - clamp(24px, 5vw, 84px)));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 96px) 0 38px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding-bottom: clamp(36px, 5vw, 66px);
  animation: rise .65s ease-out both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font: 700 .68rem/1.2 var(--mono);
  letter-spacing: .17em;
  text-transform: uppercase;
}
.eyebrow span { color: var(--acid); margin-right: 8px; }

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 970px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 7.5vw, 7.4rem);
  line-height: .79;
  letter-spacing: -.075em;
  text-transform: uppercase;
  font-weight: 950;
}
h1 em {
  color: transparent;
  -webkit-text-stroke: 1px var(--acid);
  font-style: normal;
  text-shadow: 0 0 32px rgba(188, 255, 0, .12);
}
.lede {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(.96rem, 1.5vw, 1.08rem);
  line-height: 1.65;
}

.archive-readout {
  min-width: 185px;
  border-left: 1px solid var(--acid);
  padding: 8px 0 8px 22px;
  font-family: var(--mono);
}
.archive-readout span { display: block; color: var(--muted); font-size: .63rem; letter-spacing: .13em; }
.archive-readout strong { display: block; margin: 5px 0 8px; color: var(--acid); font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: .9; }

.workspace {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  border: 1px solid var(--line);
  background: rgba(3, 5, 5, .52);
  box-shadow: var(--shadow);
  animation: rise .7s .08s ease-out both;
}

.library-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 34px);
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.panel-heading, .files-toolbar, .reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.panel-heading h2 { margin: 0 0 25px; font-size: 1.85rem; letter-spacing: -.04em; }
.reset-button {
  margin-bottom: 25px;
  padding: 8px 11px;
  color: var(--acid);
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font: 700 .62rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.reset-button:hover { background: rgba(188, 255, 0, .08); }

.category-grid { display: grid; gap: 12px; }
.category-card {
  position: relative;
  min-height: 150px;
  padding: 20px;
  overflow: hidden;
  color: var(--paper);
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.category-card::after {
  content: "";
  position: absolute;
  inset: auto -28px -48px auto;
  width: 115px;
  height: 115px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: transform .35s, background .35s;
}
.category-card:hover, .category-card[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: rgba(188, 255, 0, .055);
  transform: translateX(3px);
}
.category-card:hover::after, .category-card[aria-pressed="true"]::after { transform: scale(1.18); background: rgba(188, 255, 0, .05); }
.category-card > span, .category-card strong { display: block; }
.category-code, .category-count { color: var(--acid); font: 700 .62rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.category-card strong { margin: 24px 0 7px; font-size: 1.25rem; }
.category-card strong + span { max-width: 76%; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.category-count { margin-top: 15px; }
.category-card i { position: absolute; top: 19px; right: 19px; color: var(--dim); font: normal 1.1rem/1 var(--mono); }

.timeline-section, .files-section { margin-top: 30px; animation: reveal .3s ease-out both; }
.timeline-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.timeline-button {
  min-width: 0;
  padding: 11px 5px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .09);
  background: transparent;
  cursor: pointer;
  font: 700 .7rem/1 var(--mono);
  transition: color .18s, border-color .18s, background .18s;
}
.timeline-button:hover, .timeline-button[aria-pressed="true"] { color: var(--ink); border-color: var(--acid); background: var(--acid); }
.timeline-button:disabled { opacity: .28; cursor: not-allowed; }

.files-toolbar h3 { margin: 0 0 14px; font-size: 1.2rem; }
.result-count { color: var(--muted); font: 700 .61rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.search-field {
  height: 43px;
  margin-bottom: 11px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .3);
}
.search-field:focus-within { border-color: var(--line-strong); }
.search-field svg, .icon-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.search-field svg { color: var(--dim); }
.search-field input { min-width: 0; color: var(--paper); border: 0; outline: 0; background: transparent; font-size: .78rem; }
.search-field input::placeholder { color: var(--dim); }
kbd { padding: 4px 6px; color: var(--dim); border: 1px solid rgba(255,255,255,.1); font: .58rem/1 var(--mono); }

.file-list {
  max-height: 440px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.file-button {
  width: 100%;
  padding: 13px 10px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.065);
  background: transparent;
  cursor: pointer;
  transition: background .15s;
  animation: reveal .22s ease-out both;
}
.file-button:hover, .file-button.active { background: rgba(188, 255, 0, .065); }
.file-index { color: var(--acid); font: 700 .62rem/1 var(--mono); }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.file-size { color: var(--dim); font: .58rem/1 var(--mono); }
.no-results { padding: 24px 10px; color: var(--muted); font: .75rem/1.5 var(--mono); }

.selection-prompt {
  min-height: 160px;
  margin-top: 28px;
  border: 1px dashed rgba(255,255,255,.1);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--dim);
  text-align: center;
}
.selection-prompt > span { color: var(--acid); font: 2.2rem/1 var(--mono); animation: pulse 2.2s ease-in-out infinite; }
.selection-prompt p { max-width: 230px; margin: 0; font-size: .78rem; line-height: 1.5; }
.selection-prompt strong { color: var(--muted); }

.reader-panel { min-width: 0; min-height: 720px; background: #0a0d0d; position: relative; overflow: hidden; }
.reader-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(188,255,0,.035), transparent 38%);
}
.reader-empty {
  position: absolute;
  inset: 0;
  padding: 34px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.reader-empty h2 { margin-bottom: 12px; font-size: clamp(1.55rem, 3vw, 2.5rem); letter-spacing: -.045em; }
.reader-empty > p:last-child { max-width: 440px; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.reticle { width: 130px; height: 130px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; position: relative; animation: spin 15s linear infinite; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: var(--line-strong); }
.reticle::before { width: 160%; height: 1px; }
.reticle::after { width: 1px; height: 160%; }
.reticle span { width: 57px; height: 57px; border: 1px dashed var(--acid); border-radius: 50%; }

.reader-active { position: absolute; inset: 0; display: grid; grid-template-rows: 64px 46px minmax(0, 1fr); background: #151a19; animation: reveal .25s ease-out both; }
.reader-toolbar { min-width: 0; padding: 0 18px 0 22px; border-bottom: 1px solid var(--line); background: #0d1111; }
.reader-title-wrap { min-width: 0; }
.reader-title-wrap span, .reader-title-wrap strong { display: block; }
.reader-kicker { margin-bottom: 4px; color: var(--acid); font: 700 .55rem/1 var(--mono); letter-spacing: .12em; }
.reader-title-wrap strong { max-width: min(54vw, 750px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.reader-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.icon-link { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 1px solid rgba(255,255,255,.1); background: transparent; text-decoration: none; cursor: pointer; }
.icon-link:hover { color: var(--acid); border-color: var(--line-strong); }
.close-reader { display: none; }
.pdf-controls {
  min-width: 0;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #111615;
  color: var(--muted);
  font: 700 .62rem/1 var(--mono);
}
.pdf-control-group { min-width: 0; display: flex; align-items: center; gap: 5px; }
.pdf-controls button {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.24);
  cursor: pointer;
  font: 800 .68rem/1 var(--mono);
}
.pdf-controls button:hover:not(:disabled), .pdf-controls button[aria-pressed="true"] { color: var(--ink); border-color: var(--acid); background: var(--acid); }
.pdf-controls button:disabled { opacity: .3; cursor: default; }
.pdf-page-field { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pdf-page-field input {
  width: 45px;
  height: 30px;
  padding: 0 5px;
  color: var(--paper);
  text-align: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 0;
  background: rgba(0,0,0,.3);
  font: 700 .65rem/1 var(--mono);
  appearance: textfield;
}
.pdf-page-field input::-webkit-inner-spin-button { appearance: none; }
.pdf-zoom-label { min-width: 38px; text-align: center; color: var(--dim); }
.pdf-stage {
  min-width: 0;
  min-height: 0;
  padding: 17px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  display: grid;
  align-items: start;
  justify-items: center;
  background:
    radial-gradient(circle at 50% 0, rgba(188,255,0,.045), transparent 38%),
    #242827;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) #171b1a;
}
.pdf-stage:focus-visible { outline-offset: -3px; }
#pdf-canvas {
  display: block;
  max-width: none;
  background: #fff;
  box-shadow: 0 8px 36px rgba(0,0,0,.55);
}
.pdf-loader, .pdf-error {
  align-self: center;
  max-width: 390px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font: 700 .64rem/1.5 var(--mono);
  letter-spacing: .1em;
}
.pdf-loader-ring {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  display: block;
  border: 1px solid rgba(188,255,0,.2);
  border-top-color: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(188,255,0,.07);
  animation: spin .8s linear infinite;
}
.pdf-error { border: 1px solid rgba(255,54,94,.35); background: rgba(6,8,8,.82); }
.pdf-error strong { color: var(--red); }
.pdf-error p { margin: 12px 0 16px; color: var(--muted); letter-spacing: 0; font-family: var(--sans); font-weight: 500; }
.pdf-error a { color: var(--acid); }

footer {
  width: min(1540px, calc(100% - clamp(24px, 5vw, 84px)));
  margin: 0 auto;
  padding: 22px 0 30px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--dim);
  font: 600 .57rem/1.4 var(--mono);
  letter-spacing: .12em;
}

/* Server-authenticated access gate */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.login-shell {
  width: min(100% - 32px, 600px);
  padding: 38px 0;
  position: relative;
  z-index: 2;
}
.login-card {
  padding: clamp(28px, 7vw, 56px);
  border: 1px solid var(--line-strong);
  background: rgba(8, 11, 10, .94);
  box-shadow: 0 0 0 1px rgba(0,0,0,.9), 0 30px 100px rgba(0,0,0,.7), inset 0 0 80px rgba(188,255,0,.025);
  position: relative;
  overflow: hidden;
  animation: gate-in .55s ease-out both;
}
.login-card::before, .login-card::after {
  content: "";
  position: absolute;
  width: 52px;
  height: 52px;
  pointer-events: none;
}
.login-card::before { top: 12px; left: 12px; border-top: 2px solid var(--acid); border-left: 2px solid var(--acid); }
.login-card::after { right: 12px; bottom: 12px; border-right: 2px solid var(--acid); border-bottom: 2px solid var(--acid); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font: 800 .95rem/1 var(--mono); letter-spacing: .18em; }
.login-brand small { margin-top: 5px; color: var(--muted); font: 600 .58rem/1 var(--mono); letter-spacing: .13em; }
.auth-visual { position: absolute; top: 40px; right: 42px; width: 104px; height: 104px; opacity: .72; }
.auth-ring { width: 100%; height: 100%; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; animation: spin 7s linear infinite; }
.auth-ring::before, .auth-ring::after { content: ""; position: absolute; background: var(--acid); }
.auth-ring::before { width: 120%; height: 1px; }
.auth-ring::after { width: 1px; height: 120%; }
.auth-ring span { width: 48px; height: 48px; border: 1px dashed var(--red); border-radius: 50%; }
.auth-sweep { position: absolute; inset: 50% 0 auto; height: 1px; background: var(--acid); box-shadow: 0 0 12px var(--acid); animation: auth-sweep 2.4s ease-in-out infinite; }
.login-title { margin-bottom: 26px; font-size: clamp(3.1rem, 12vw, 5.7rem); }
.check-sequence { margin-bottom: 28px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); display: grid; gap: 9px; }
.check-sequence span { color: var(--dim); font: 650 .62rem/1 var(--mono); letter-spacing: .12em; animation: check-line 2.8s ease-in-out infinite; }
.check-sequence span:nth-child(2) { animation-delay: .35s; }
.check-sequence span:nth-child(3) { animation-delay: .7s; }
.login-form label { display: block; margin-bottom: 9px; color: var(--acid); font: 700 .62rem/1 var(--mono); letter-spacing: .14em; }
.password-row { display: grid; grid-template-columns: 1fr auto; }
.password-row input {
  min-width: 0;
  height: 52px;
  padding: 0 15px;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.15);
  border-right: 0;
  border-radius: 0;
  outline: 0;
  background: #050707;
  font: .9rem/1 var(--mono);
}
.password-row input:focus { border-color: var(--acid); box-shadow: inset 0 0 20px rgba(188,255,0,.04); }
.password-row button {
  padding: 0 20px;
  color: var(--ink);
  border: 1px solid var(--acid);
  background: var(--acid);
  cursor: pointer;
  font: 800 .68rem/1 var(--mono);
  letter-spacing: .12em;
}
.password-row button:hover { background: var(--acid-hot); }
.login-error { min-height: 1.3em; margin: 12px 0 0; color: var(--red); font: 650 .68rem/1.35 var(--mono); }
.login-footnote { margin: 20px 0 0; color: var(--dim); font: .6rem/1.55 var(--mono); }

.access-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--paper);
  background: #050707;
  animation: access-dismiss 2.15s ease forwards;
}
.access-core { width: 100px; height: 100px; margin-bottom: 24px; border: 1px solid var(--acid); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 30px rgba(188,255,0,.12); animation: spin 1.5s linear infinite; }
.access-core::before, .access-core::after { content: ""; position: absolute; background: var(--acid); }
.access-core::before { width: 132px; height: 1px; }
.access-core::after { width: 1px; height: 132px; }
.access-core span { width: 44px; height: 44px; border: 1px dashed var(--red); border-radius: 50%; }
.access-overlay > strong { color: var(--acid); font: 800 .85rem/1 var(--mono); letter-spacing: .2em; }
.access-overlay > p { margin: 18px 0 0; display: grid; gap: 7px; text-align: center; }
.access-overlay > p span { color: var(--dim); font: 600 .58rem/1 var(--mono); letter-spacing: .13em; animation: check-line 1s ease both; }
.access-overlay > p span:nth-child(2) { animation-delay: .25s; }
.access-overlay > p span:nth-child(3) { animation-delay: .5s; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: .4; box-shadow: 0 0 4px var(--acid); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { from { transform: translateY(-20vh); } to { transform: translateY(120vh); } }
@keyframes gate-in { from { opacity: 0; transform: scale(.98) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes auth-sweep { 0%, 100% { transform: translateY(-35px); opacity: .25; } 50% { transform: translateY(35px); opacity: 1; } }
@keyframes check-line { 0%, 100% { color: var(--dim); } 45%, 60% { color: var(--acid); text-shadow: 0 0 9px rgba(188,255,0,.5); } }
@keyframes access-dismiss { 0%, 68% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }

@media (max-width: 960px) {
  .workspace { grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); }
  .reader-title-wrap strong { max-width: 28vw; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 720px); padding-top: 46px; }
  .intro { grid-template-columns: 1fr; align-items: start; }
  .archive-readout { width: 170px; }
  .workspace { display: block; min-height: 0; }
  .library-panel { min-height: 620px; border-right: 0; }
  .reader-panel { min-height: 0; }
  .reader-empty { display: none; }
  .reader-active {
    position: fixed;
    z-index: 30;
    inset: 0;
    grid-template-rows: 66px 46px minmax(0, 1fr);
  }
  .reader-title-wrap strong { max-width: 52vw; }
  .close-reader { display: grid; }
  .pdf-stage { padding: 10px; }
  footer { width: min(100% - 24px, 720px); flex-direction: column; }
}

@media (max-width: 480px) {
  .topbar { min-height: 66px; padding: 0 14px; }
  .brand small { display: none; }
  .system-state { font-size: .57rem; letter-spacing: .1em; }
  h1 { font-size: clamp(2.75rem, 16vw, 4.5rem); }
  .library-panel { padding: 20px; }
  .category-card { min-height: 145px; }
  .timeline-list { grid-template-columns: repeat(2, 1fr); }
  .reader-toolbar { padding: 0 8px 0 13px; gap: 8px; }
  .reader-title-wrap strong { max-width: 41vw; font-size: .7rem; }
  .icon-link { width: 34px; height: 34px; }
  .pdf-controls { padding: 0 6px; }
  .pdf-controls button { min-width: 29px; padding: 0 6px; }
  .pdf-zoom-label { display: none; }
  .auth-visual { width: 76px; height: 76px; top: 34px; right: 32px; }
  .login-title { font-size: 3.45rem; }
  .password-row { grid-template-columns: 1fr; gap: 8px; }
  .password-row input { border-right: 1px solid rgba(255,255,255,.15); }
  .password-row button { height: 48px; }
  .topbar-actions { gap: 9px; }
  .system-state { display: none; }
}

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