:root {
  color-scheme: light;
  --page: #f4f4f2;
  --paper: #fff;
  --rail: #eef0ef;
  --soft: #f6f8f8;
  --ink: #1f2328;
  --muted: #546069;
  --line: #d6dcdd;
  --accent: #0a3d62;
  --accent-soft: #e8f4f8;
  --control-text: var(--ink);
  --control-line: var(--line);
  --control-bg: var(--soft);
  --control-hover: var(--accent-soft);
  --audit: #a13228;
  --audit-bg: #fcf1ee;
  --trace: #287d60;
  --mono: "Cascadia Mono", Consolas, "Microsoft YaHei UI", monospace;
  --sans: "Segoe UI", "Microsoft YaHei UI", "PingFang HK", sans-serif;
}
:root[data-mode="off"] {
  color-scheme: dark;
  --page: #0a0c0f;
  --paper: #0d0f12;
  --rail: #101215;
  --soft: #15181b;
  --ink: #dcdfe4;
  --muted: #9ea8af;
  --line: #33393e;
  --accent: #b9c5d3;
  --accent-soft: #20262e;
  --signal: #2ecc71;
  --control-text: #d8dce0;
  --control-line: rgba(255,255,255,0.16);
  --control-bg: #16191d;
  --control-hover: #22272e;
  --audit: #f0786c;
  --audit-bg: #211515;
  --trace: #c0392b;
}
* { box-sizing: border-box; }
[hidden], [data-mode="on"] [data-view="off"], [data-mode="off"] [data-view="on"] { display: none !important; }
html { min-height: 100%; scrollbar-color: var(--line) var(--page); scroll-padding-top: 80px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.65 var(--sans); }
::selection { background: var(--accent); color: var(--paper); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1:focus { outline: 0; }
p { margin: 0 0 1em; }
h2 { margin: 0; line-height: 1.45; }
code, time, .time { font-family: var(--mono); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 67px;
  padding: .65rem clamp(1rem, 3vw, 2.75rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  background: var(--accent);
  color: var(--paper);
  font: 700 15px/1 var(--mono);
  letter-spacing: -.06em;
}
.system-name { font: 700 .78rem/1.55 var(--mono); letter-spacing: .025em; overflow-wrap: anywhere; }
.case-id { color: var(--muted); white-space: nowrap; font-weight: 400; }
.topbar-controls, .sound-controls { display: flex; align-items: center; gap: 9px; }
.archive-language-switch { display: flex; flex: none; margin-inline-start: auto; }
.archive-language-switch button {
  min-height: 38px;
  min-width: 43px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: .77rem;
}
.archive-language-switch button + button { margin-inline-start: -1px; }
.archive-language-switch button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.archive-language-switch button:focus-visible { position: relative; z-index: 1; }
.mobile-directory { display: none; }
.archive-startup { max-width: 44rem; padding: 1.5rem; margin: 2rem auto; }
.archive-startup h1 { margin: 0 0 .7rem; font-size: 1.35rem; }
.offline-tools { margin-top: .85rem; }
.offline-tools p { margin: .3em 0 0; font-size: .82rem; color: var(--muted); }
.offline-tools p:empty { display: none; }
video.media-pending { opacity: 0; pointer-events: none; }
.topbar-controls { flex: none; }
.sound-switch { min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); background: var(--soft); white-space: nowrap; font-weight: 650; font-size: .76rem; }
.sound-switch:hover, .sound-switch[data-enabled="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sound-volume { width: 64px; min-width: 0; margin: 0; accent-color: var(--accent); }
.filter {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding: 5px 6px 5px 11px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--soft);
  text-align: left;
  font-size: .83rem;
  font-weight: 650;
}
.filter:hover, .filter:focus-visible, .filter.recommended { border-color: var(--accent); background: var(--accent-soft); }
.filter-name small { display: block; color: var(--muted); font: .64rem/1.25 var(--mono); }
.filter-value { min-width: 34px; padding: 5px 4px; text-align: center; font: 700 .72rem/1.25 var(--mono); background: var(--accent-soft); color: var(--accent); }
.filter[aria-checked="false"] .filter-value { background: var(--audit-bg); color: var(--audit); }
[data-mode="off"] .filter:not(:disabled) .filter-value { background: #172520; color: var(--signal); }
.filter:disabled { border-color: var(--line); background: var(--rail); color: var(--muted); cursor: default; }
.filter:disabled .filter-value { background: var(--line); color: var(--ink); white-space: nowrap; }
.office-intro { display: grid; align-content: center; max-width: 890px; min-height: calc(100svh - 92px); padding: 24px; margin: auto; }
.office-intro-panel { width: min(100%, 34rem); padding: clamp(22px, 5vw, 48px); background: var(--paper); border: 1px solid var(--line); }
.office-intro h1 { margin: 0 0 10px; font-size: clamp(1.75rem, 4vw, 2.45rem); line-height: 1.25; }
.office-intro p { margin-bottom: 24px; color: var(--muted); }
.office-intro .action { min-height: 44px; background: var(--accent); color: var(--paper); }
.office-intro .action:hover { background: var(--accent-soft); color: var(--accent); }
.workspace {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 67px);
  max-width: 1600px;
  margin: auto;
}
.sidebar {
  position: sticky;
  top: 67px;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 67px);
  max-height: calc(100dvh - 67px);
  overflow: auto;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.rail-heading { margin: 0; color: var(--muted); font-size: .77rem; font-weight: 650; letter-spacing: .1em; }
.directory { min-height: 0; overflow: auto; padding: 22px 15px 16px; }
.directory > summary { cursor: pointer; margin: 0 10px 10px; }
.directory:not([open]) > summary { margin-bottom: 0; }
.file-list, .clue-list, .legend { margin: 0; padding: 0; list-style: none; }
.file-list li + li { margin-top: 4px; }
.file-list .file-group { margin: 15px 8px 4px; }
.file-list .file-group:first-child { margin-top: 3px; }
.file-group h2 { color: var(--muted); font: 600 .72rem/1.5 var(--sans); }
.file-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 45px;
  padding: 8px 8px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  color: var(--ink);
  font: .76rem/1.35 var(--mono);
}
.file-nav:hover { background: var(--soft); border-color: var(--line); }
.file-nav[aria-current="page"] { background: var(--accent-soft); border-color: var(--line); color: var(--accent); font-weight: 700; }
.file-nav-text { display: grid; gap: 3px; min-width: 0; }
.file-nav-label { font: 650 .86rem/1.25 var(--sans); }
.file-nav-name { color: var(--muted); font-size: .69rem; overflow-wrap: anywhere; }
.nav-state { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .67rem; }
.lock-icon { display: inline-block; position: relative; width: 8px; height: 7px; margin-top: 3px; border: 1px solid currentColor; }
.lock-icon::before { content: ""; position: absolute; width: 4px; height: 4px; left: 1px; top: -5px; border: 1px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.progress-panel { flex: none; margin-top: auto; padding: 17px 25px 20px; border-top: 1px solid var(--line); }
.progress-readout { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 9px 0 7px; font-size: .84rem; }
.progress-readout output { font: 700 .87rem/1.4 var(--mono); color: var(--accent); }
.full-archive-link { display: inline-block; margin-top: 9px; color: var(--accent); font-size: .8rem; }
.marks { margin-top: 11px; font-size: .78rem; }
.marks summary { cursor: pointer; color: var(--muted); }
.marks output { margin-inline-start: 5px; font: 700 .75rem var(--mono); }
.marks-hint { color: var(--muted); margin: 5px 0 0; font-size: .75rem; }
progress { display: block; appearance: none; border: 0; width: 100%; height: 4px; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.clue-list { display: grid; gap: 4px; margin-top: 12px; max-height: min(132px, 20dvh); overflow: auto; }
.clue-list:empty { display: none; }
.clue-link { text-align: left; font: .77rem/1.5 var(--sans); padding: 3px 0; border: 0; background: transparent; }
.clue-link:hover { color: var(--accent); background: var(--control-hover); }
.clue-link b { padding-right: 8px; color: var(--audit); font: 700 .7rem var(--mono); }
.viewport { padding: clamp(17px, 3.2vw, 48px); min-width: 0; }
.file-frame { max-width: 1040px; min-height: 470px; margin-inline: auto; background: var(--paper); border: 1px solid var(--line); }
.file-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 84px;
  padding: 17px clamp(16px, 3.4vw, 46px);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.file-type {
  display: grid;
  place-items: center;
  min-height: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--accent);
  font: 700 .75rem/1 var(--mono);
}
.file-header h1 { margin: 0; overflow-wrap: anywhere; font: 700 clamp(1.25rem, 2.6vw, 1.85rem)/1.22 var(--sans); letter-spacing: -.025em; }
.file-name { margin: 5px 0 0; color: var(--muted); font: .74rem/1.35 var(--mono); overflow-wrap: anywhere; }
.file-status { color: var(--audit); font: 700 .75rem var(--mono); }
.file-body { max-width: 820px; margin-inline: auto; padding: 28px clamp(16px, 3.4vw, 46px) 34px; font-size: 1rem; }
.read-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 16px clamp(16px, 3.4vw, 46px);
  background: var(--soft);
  border-top: 1px solid var(--line);
}
.read-step { display: grid; align-content: center; gap: 3px; min-height: 57px; padding: 6px 12px; border: 1px solid var(--line); background: var(--paper); text-align: left; }
.read-step:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.read-step:active:not(:disabled), .file-nav:active { background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--line); }
.read-step:disabled { cursor: default; color: var(--muted); }
.read-next { grid-column: 2; text-align: right; }
.step-label { color: var(--muted); font-size: .73rem; }
.headers {
  display: grid;
  grid-template-columns: minmax(65px, max-content) minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 5px;
  margin: 0 0 25px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font: .78rem/1.65 var(--mono);
}
.headers dt { color: var(--muted); }
.headers dd { margin: 0; overflow-wrap: anywhere; }
.prose { max-width: 77ch; }
.prose, .prose p { line-height: 1.75; }
.prose h2, .group-name, .inventory h2, .plot h2 { font-size: 1.05rem; }
.signature { margin-top: 18px; }
.clue {
  display: inline;
  padding: 0 2px;
  border: 0;
  background: transparent;
  text-align: inherit;
  color: inherit;
  font-weight: 650;
  border-bottom: 1px dashed var(--muted);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.clue:hover { color: var(--audit); background: var(--audit-bg); }
.clue[aria-pressed="true"] { color: var(--audit); background: var(--audit-bg); outline: 1px solid var(--audit); border-bottom-color: transparent; }
.audit, .annotation {
  padding: 10px 13px;
  color: var(--audit);
  background: var(--audit-bg);
  border: 1px solid color-mix(in srgb, var(--audit) 35%, var(--line));
  font-family: var(--mono);
  font-size: .79rem;
  overflow-wrap: anywhere;
}
.audit { margin: 18px 0 22px; border-inline-start: 3px solid var(--audit); }
.annotation { font: italic .87rem/1.7 "KaiTi", "STKaiti", var(--sans); margin: 8px 0 0; }
del { color: var(--audit); }
.signoff { margin-top: 24px; padding: 15px 17px; border: 1px solid var(--line); background: var(--soft); }
.signoff label { display: flex; align-items: flex-start; gap: 11px; font-size: .87rem; cursor: pointer; }
.signoff input { width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.stamp { display: inline-block; margin: 0; border: 2px solid currentColor; padding: 2px 8px; color: var(--audit); font: 700 .81rem/1.6 var(--mono); }
.manual ol { margin: 17px 0 0; padding-left: 1.8rem; }
.manual li { padding-left: 6px; margin-bottom: 14px; }
.manual li::marker { color: var(--muted); font: .82rem var(--mono); }
.chat-log { margin-top: 18px; }
.chat-phase h3 { margin: 20px 0 0; padding: 9px 11px; background: var(--accent-soft); color: var(--accent); font-size: .81rem; }
.chat-phase ol { margin: 0; padding: 0; list-style: none; }
.message { display: grid; grid-template-columns: 51px minmax(0, 1fr); gap: 9px; padding: 11px 7px; border-bottom: 1px solid var(--line); }
.message > time { color: var(--muted); font-size: .76rem; }
.sender { display: block; color: var(--accent); font-size: .78rem; margin-bottom: 3px; }
.message p { margin: 0; }
.message p + p { margin-top: 5px; }
.message-audit { color: var(--audit); font-size: .83rem; }
.redaction { background: var(--ink); color: var(--paper); padding: 0 3px; }
.evidence { margin: 20px 0 24px; max-width: 720px; }
.evidence img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--soft); }
.evidence figcaption { margin: 0; padding: 8px 0 0; }
.evidence img { cursor: zoom-in; }
.cabin-view { position: relative; }
.cabin-view video { position: absolute; inset: 0; width: 100%; height: 100%; background: #101215; object-fit: contain; }
.archive-monitor { max-width: 720px; margin: 1.3rem 0; }
.archive-monitor .evidence { margin: 0; }
.archive-monitor .frame-choices { margin: 0 0 .55rem; }
.monitor-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25em 1em;
  padding: .45em .8em;
  background: #182322;
  border: 1px solid #344844;
  color: #bfd2cc;
  font: .78rem/1.6 var(--mono);
}
.monitor-readout { font-variant-numeric: tabular-nums; }
.monitor-alert { color: #f4cba0; }
[data-mode="off"] .monitor-header time { color: var(--signal); }
.monitor-screen { position: relative; overflow: hidden; background: #131a1b; }
.monitor-screen img { border-top: 0; }
details.archive-monitor > summary { margin-bottom: .5rem; }
.dispatch-sheet { max-width: 660px; margin: 12px 0; border: 1px solid var(--line); background: var(--soft); }
.dispatch-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font: .78rem var(--mono); }
.dispatch-sheet dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; padding: 11px 12px; }
.dispatch-sheet dt { color: var(--muted); }
.dispatch-sheet dd { margin: 0; overflow-wrap: anywhere; }
.evidence-enlarge { margin-inline-start: .8em; }
.evidence-viewer {
  width: min(96vw, 64rem);
  height: min(86vh, 52rem);
  height: min(86dvh, 52rem);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}
.evidence-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.evidence-viewer::backdrop { background: rgb(0 0 0 / 78%); }
.evidence-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 12px; }
.evidence-viewer-bar h2 { margin: 0; font-size: .92rem; }
.evidence-viewer-controls { display: flex; gap: 4px; }
.evidence-viewer-controls button { min-height: 40px; min-width: 42px; padding: 0 6px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
.evidence-viewer-controls button:hover { color: var(--accent); border-color: var(--accent); }
.evidence-viewer-stage { position: relative; overflow: hidden; touch-action: none; background: #101215; cursor: grab; }
.evidence-viewer-stage:active { cursor: grabbing; }
.evidence-viewer-stage .evidence-viewer-picture { position: absolute; top: 50%; left: 50%; pointer-events: none; }
.evidence-viewer-picture img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.archive-expansion > section:not(:first-child) { margin-top: 2rem; }
.archive-expansion h2 { margin: 0 0 .75rem; }
.archive-expansion blockquote { margin: 1em 0; padding-left: 1em; border-left: 2px solid var(--line); }
.archive-expansion blockquote > :last-child { margin-bottom: 0; }
.archive-expansion time { font-size: .83em; color: var(--muted); }
.evidence-disclosure { margin: .8em 0 1.2em; }
:is(.evidence-disclosure, .headlamp-explore, .manual-entry, .marks) > summary {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--control-line);
  background: var(--control-bg);
  color: var(--control-text);
  cursor: pointer;
}
:is(.evidence-disclosure, .headlamp-explore, .manual-entry, .marks) > summary:hover {
  background: var(--control-hover);
}
.evidence-disclosure .evidence { margin-top: 6px; }
.archive-video { max-width: 720px; }
.archive-video video { display: block; width: 100%; max-height: 65vh; margin-top: 6px; background: #101215; }
.archive-video-error { margin-top: .5em; color: var(--audit); }
.archive-video-error[data-loading] { color: var(--muted); }
.archive-script { margin-top: 1.7rem; overflow-wrap: anywhere; }
.archive-version h3, .archive-script > h3 { margin: 1.4em 0 .6em; font-size: 1.02em; }
.archive-version h4 { margin: 1.35em 0 .6em; font-size: .98em; }
.archive-version hr { margin: 1.45rem 0; border: 0; border-top: 1px solid var(--line); }
.archive-version ul { padding-inline-start: 1.45em; }
.archive-version li + li { margin-top: .5em; }
.finale-video { margin: 20px 0 23px; border: 1px solid var(--control-line); background: var(--control-bg); }
.finale-video > summary {
  display: grid;
  grid-template-columns: minmax(104px, 37%) minmax(0, 1fr);
  width: auto;
  align-items: center;
  gap: clamp(10px, 2.5vw, 22px);
  padding: clamp(10px, 2.5vw, 16px);
  list-style: none;
  border: 0;
}
.finale-video > summary::-webkit-details-marker { display: none; }
.finale-video-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--control-line);
}
.finale-video-label { display: grid; gap: 4px; }
.finale-video-label strong::before {
  display: inline-block;
  width: .4em;
  height: .4em;
  margin: 0 .55em .13em .1em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  content: "";
}
.finale-video-label > span { color: var(--muted); font-size: .85rem; }
.finale-video[open] > summary { grid-template-columns: minmax(0, 1fr); }
.finale-video[open] .finale-video-cover { display: none; }
.finale-video[open] .finale-video-label strong::before { transform: rotate(45deg); }
.finale-video-player { padding: 0 clamp(10px, 2.5vw, 16px) 12px; }
.ivan-mirror-photo { display: block; width: 100%; padding: 0; border: 0; background: var(--soft); }
.ivan-mirror-photo img { cursor: pointer; }
.finale-actions { margin-top: 1.3em; }
.finale-actions [role="status"] { margin-top: .5em; color: var(--muted); }
.finale-actions .action:disabled, .archive-cover .action:disabled, .frame-choice:disabled { opacity: .65; cursor: default; }
.reset-archive { margin-block: .4em; color: var(--muted); }
.evidence-anchor:focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.dashcam-view { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #111414; }
.dashcam-view .dashcam-filtered { filter: blur(8px) brightness(.52) contrast(.76); }
.dashcam-view video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chat-attachment { max-width: 480px; margin: 12px 0 5px; }
.still-frame img { aspect-ratio: 12 / 7; object-fit: cover; }
.headlamp-reader { max-width: 720px; margin-bottom: 23px; }
.headlamp-reader .footage { margin: 0; }
.compare-line { margin: 12px 0; }
.headlamp-explore, .manual-entry { margin-top: 14px; }
.headlamp-explore summary, .manual-entry summary { font-size: .88rem; }
.headlamp-reader .headlamp-explore .footage, .manual-entry form { margin-top: 10px; }
.archive-cover { margin-top: 18px; padding: 14px; border: 1px solid var(--line); background: var(--soft); }
.text-action {
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid var(--control-line);
  background: var(--control-bg);
  color: var(--control-text);
  text-decoration: none;
}
.text-action:hover { background: var(--control-hover); }
.meeting-records { margin: 0 0 20px; padding: 0; list-style: none; }
.meeting-records li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meeting-records time { color: var(--muted); font-size: .76rem; }
.meeting-records em { color: var(--muted); }
.meeting-transcript-note { margin: 0; }
.meeting-transcript-note p { margin: .65em 0 0; }
#alex-ticket { margin-top: 1.4rem; }
.meeting-frame { max-width: 560px; margin: 12px 0 3px; }
.meeting-frame img { aspect-ratio: 4 / 3; object-fit: contain; }
.meeting-view { position: relative; }
.meeting-view .meeting-shift {
  position: absolute;
  inset: 0;
  height: 100%;
  clip-path: inset(35% 0 0 72%);
  mask-image: linear-gradient(to right, transparent 72%, #000 75%), linear-gradient(to bottom, transparent 35%, #000 41%);
  mask-composite: intersect;
}
.meeting-cache { margin-top: 12px; }
.meeting-primary { align-items: center; }
.meeting-still-action { margin-top: 10px; }
.meeting-cache > summary { font-size: .85rem; }
.meeting-cache-frames { position: relative; aspect-ratio: 4 / 3; background: #101215; }
.meeting-cache-frames img { height: 100%; }
.frame-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 5px; }
.frame-choice { min-height: 44px; padding: 6px 12px; border: 1px solid var(--control-line); background: var(--control-bg); color: var(--control-text); text-align: start; font-size: .85rem; }
.frame-choice:hover { border-color: var(--accent); }
.frame-choice:active, .audio-evidence .action:active { background: var(--accent-soft); color: var(--accent); }
.frame-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pantry-frame { margin-bottom: 7px; }
.evidence-index { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: -8px 0 12px; }
.chat-index { margin-top: 8px; }
.evidence-link { display: inline-block; padding: 2px 0; border: 0; background: transparent; color: var(--control-text); text-align: left; font-size: .81rem; text-decoration: none; }
.evidence-link:hover { background: var(--control-hover); }
.archive-next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.archive-next-links .evidence-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: 100%;
  padding: 6px 11px;
  border: 1px solid var(--control-line);
  background: var(--control-bg);
}
.archive-next-links .evidence-link::before { content: "→"; color: var(--muted); }
.archive-next-links .evidence-link:hover { background: var(--control-hover); }
.audio-evidence { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin: 11px 0 2px; }
.audio-evidence span { color: var(--muted); font: .75rem var(--mono); }
.office-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.office-evidence .evidence { margin: 0; }
[id^="office-"]:focus, #meeting-frame:focus, #meeting-tail:focus, #meeting-exchange:focus, .message:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.facility-log h2 { margin-bottom: 12px; font: 650 .84rem/1.5 var(--mono); overflow-wrap: anywhere; }
.facility-table { table-layout: fixed; }
.facility-table th, .facility-table td { overflow-wrap: anywhere; padding-inline: 8px; }
.facility-table th:nth-child(1) { width: 15%; }
.facility-table th:nth-child(2) { width: 19%; }
.facility-table th:nth-child(3) { width: 15%; }
.facility-table th:nth-child(4) { width: 25%; }
.facility-table td strong { color: var(--audit); }
.inventory h2 { margin-bottom: 10px; }
.inventory .table-scroll + h2 { margin-top: 25px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead { background: var(--soft); }
th[scope="row"] { font-weight: 600; }
.table-scroll table { min-width: 565px; }
.telemetry, .footage, .transcript { max-width: 720px; }
.plot { margin-bottom: 23px; }
.plot h2 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.plot h2 span, .legend, .data-summary, figcaption { font: .77rem/1.5 var(--mono); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 13px; margin: 8px 0; }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend li::before { content: ""; width: 9px; height: 3px; background: var(--series); }
.plot canvas, .footage canvas { display: block; width: 100%; height: auto; }
.plot canvas { border: 1px solid var(--line); background: var(--soft); }
.plot-stage { position: relative; margin-top: 8px; }
#gps { margin-top: 8px; }
.plot-tip {
  position: absolute;
  top: 12px;
  z-index: 1;
  min-width: 110px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 4px 12px #0002;
  font: .73rem/1.4 var(--mono);
  white-space: pre;
  pointer-events: none;
}
.data-summary { margin: 7px 0 0; }
.action {
  min-height: 39px;
  padding: 7px 12px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 .85rem/1.4 var(--mono);
}
.action:hover { background: var(--accent); color: var(--paper); }
[data-mode="off"] :is(.action, .action:hover) {
  border-color: var(--control-line);
  background: var(--control-bg);
  color: var(--control-text);
}
[data-mode="off"] .action:hover { background: var(--control-hover); }
[data-mode="off"] .meeting-primary .action { border-color: #687787; background: #242b34; }
[data-mode="off"] .meeting-primary .action:hover { background: #313b46; }
.action[aria-pressed="true"] { border-color: var(--audit); color: var(--audit); background: var(--audit-bg); }
.unlock { max-width: 610px; padding: 18px; background: var(--soft); border: 1px solid var(--line); }
.unlock h2 { font-size: 1rem; }
.access-index { margin: 7px 0 12px; font-family: var(--mono); }
.access-index span { color: var(--muted); }
.unlock-controls { display: flex; gap: 8px; margin-top: 13px; }
.unlock-controls input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  caret-color: var(--accent);
  font-family: var(--mono);
}
.footage { margin: 0 0 24px; }
.footage canvas { background: #000; cursor: crosshair; touch-action: none; }
figcaption { margin-top: 8px; }
.transcript ul { margin: 10px 0 0; padding-left: 1.4em; }
.transcript li { margin: 7px 0; }
.log-heading, .draft-time { margin-top: 11px; font: .82rem/1.6 var(--mono); color: var(--muted); }
.log-heading.audit { color: var(--audit); }
.draft-time { margin-top: 22px; color: var(--accent); }
.draft hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0 16px; }
.notice { position: fixed; z-index: 7; right: 16px; bottom: 16px; max-width: calc(100vw - 32px); padding: 10px 14px; background: var(--paper); color: var(--audit); border: 1px solid var(--audit); font-size: .86rem; }
[data-mode="off"] :is(.meeting-view, .meeting-cache-frames, .monitor-screen, .dashcam-view)::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(transparent 0 3px, #0002 3px 4px);
}
.ambient-vignette {
  position: fixed;
  z-index: 7;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 42%, transparent 44%, rgba(0, 0, 0, .54) 100%);
  transition: opacity 420ms ease;
}
[data-mode="off"] .ambient-vignette { opacity: 1; }
.ambient-grain {
  position: fixed;
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: overlay;
}
[data-mode="off"] .ambient-grain { opacity: .035; }
.glitch { display: none; position: fixed; z-index: 9; inset: 0; pointer-events: none; }
.glitch.run { display: block; animation: interference 350ms steps(1, end) both; }
.glitch.run::before, .glitch.run::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(179.5deg, #cdd8dd 0 1px, #0d1014 1px 4px, #50646a 4px 7px, transparent 7px 10px);
  animation: tearing 350ms steps(1, end) both;
  mix-blend-mode: screen;
}
.glitch.run::after { animation-direction: reverse; background-size: 83% 65%; }
[data-mode="off"] .file-header.torn h1 { animation: text-shift 350ms steps(1, end); }
@keyframes interference { 0% { opacity: .36; } 23% { opacity: .18; } 40% { opacity: .3; } 62% { opacity: .09; } 100% { opacity: 0; } }
@keyframes tearing {
  0% { clip-path: inset(18% 0 67%); transform: translateX(4%); }
  24% { clip-path: inset(69% 0 24%); transform: translateX(-7%); }
  45% { clip-path: inset(36% 0 36%); transform: translateX(13%); }
  72% { clip-path: inset(86% 0 11%); transform: translateX(-10%); }
  100% { clip-path: inset(0 0 100%); }
}
@keyframes text-shift { 0%, 44% { transform: translateX(-3px); text-shadow: 3px 0 var(--audit); } 24% { transform: translateX(3px); } 68%, 100% { transform: none; text-shadow: none; } }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 285px minmax(0, 1fr); }
  .file-nav { font-size: .71rem; }
}
@media (min-width: 761px) and (max-height: 620px) {
  .directory { padding-top: 12px; padding-bottom: 9px; }
  .file-list li + li { margin-top: 2px; }
  .file-nav { min-height: 34px; padding-block: 5px; }
  .progress-panel { padding-top: 9px; padding-bottom: 12px; }
}
@media (max-width: 760px), (max-width: 940px) and (pointer: coarse) {
  html { scroll-padding-top: var(--topbar-clearance, 125px); }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .topbar {
    gap: 5px; min-height: 64px; flex-wrap: wrap;
    padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
    padding-left: max(.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: .5rem;
  }
  .topbar-controls { flex-basis: 100%; justify-content: space-between; gap: 5px; }
  .identity { flex: 1 1 0; }
  .archive-language-switch button { min-height: 44px; }
  .sound-controls { gap: 5px; }
  .sound-switch { font-size: .75rem; min-height: 44px; padding-inline: 7px; }
  .sound-volume { width: clamp(36px, 15vw, 64px); }
  .brand-mark { display: none; }
  .system-name { font-size: .67rem; }
  .system-name .case-id { display: none; }
  .filter { gap: 4px; font-size: .75rem; min-height: 44px; padding-left: 6px; }
  .filter-name small { display: none; }
  .filter-value { min-width: 26px; }
  .topbar-controls:has(.filter:disabled) { flex-wrap: wrap; }
  .topbar-controls:has(.filter:disabled) .sound-volume { width: clamp(28px, 9vw, 44px); }
  .filter:disabled .filter-name { display: none; }
  .mobile-directory { display: block; min-height: 44px; padding: 0 .55rem; border: 1px solid var(--line); background: var(--soft); font-size: .77rem; }
  .workspace { display: block; }
  .sidebar { position: static; min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .directory { padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px)); }
  .directory > summary { margin-left: 0; }
  .file-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
  .file-list li + li { margin: 0; }
  .file-list .file-group { grid-column: 1 / -1; margin: 10px 5px 3px; }
  .file-list .file-group:first-child { margin-top: 2px; }
  .file-nav { min-height: 43px; padding: 5px; gap: 4px; }
  .file-nav-name { display: none; }
  .nav-state .state-text { display: none; }
  .progress-panel { padding: 7px 14px 11px; }
  .progress-readout { margin: 0 0 4px; }
  .clue-list { display: flex; flex-wrap: wrap; column-gap: 12px; margin-top: 6px; }
  .viewport { padding: 12px max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px)); }
  .file-header { min-height: 65px; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; }
  .file-type { min-height: 29px; font-size: .63rem; }
  .file-status { font-size: .64rem; }
  .file-body { padding-top: 17px; }
  .file-body input:not([type="checkbox"]):not([type="range"]) { font-size: 16px; }
  .frame-choice, .audio-evidence :is(.action, .text-action), .evidence-viewer-controls button { min-height: 44px; }
  .archive-next-links .evidence-link, .meeting-still-action .text-action { min-height: 44px; }
  .headers { font-size: .72rem; gap: 4px 8px; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
}
@media (max-width: 580px) {
  .file-body { font-size: .96rem; }
  .office-evidence { grid-template-columns: minmax(0, 1fr); }
  .meeting-records li { grid-template-columns: 1fr; gap: 3px; }
  .facility-table, .facility-table tbody, .facility-table tr, .facility-table th, .facility-table td { display: block; }
  .facility-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .facility-table tbody tr { margin: 0 0 14px; border: 1px solid var(--line); }
  .facility-table tbody th[scope="row"] { width: auto; background: var(--soft); }
  .facility-table tbody th code { white-space: nowrap; }
  .facility-table tbody td { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; }
  .facility-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; }
  .facility-table tbody td:last-child { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .glitch.run, [data-mode="off"] .file-header.torn h1 { animation: none; }
  .glitch.run { display: none; }
}

