/* splash — the logged-out page, in the signed-in app's look: Argon's Track B with depth (tokens.css + depth.css,
   copied here as values because the splash loads nothing from static/app/). The desk is warm newsprint one shade below
   the sheet; the floating slate rail is the app's rail, locked; the form is a lifted sheet with wells and a beveled ink
   button. The one-time pad still prints behind everything, now in rule-colored ink on the desk (splash.js reads the
   --pad-* inks below). Crimson keeps one job, as in the app: the brand point, the read head and what needs you.
   Fonts are self-hosted next to this file (Instrument Serif and Plus Jakarta Sans: SIL OFL); no third-party request. */

@font-face { font-family: 'Berkeley Mono'; font-style: normal; font-weight: 100 500; font-display: swap; src: url('fonts/BerkeleyMono-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Berkeley Mono'; font-style: normal; font-weight: 501 1000; font-display: swap; src: url('fonts/BerkeleyMono-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;
  /* Track B (static/app/tokens.css) */
  --paper: #F6F4EF; --paper-elevated: #FFFFFF; --paper-sunken: #ECE9E1;
  --ink: #141413; --ink-secondary: #52504C; --ink-muted: #6E6B64; --rule: #DCD8CE; --rule-strong: #C4BFB3;
  --slate-text: #F3F1EC; --slate-muted: #A4A8B0;
  --crimson: #C8192E; --crimson-ink: #7D0B19; --crimson-soft: #FCE8EB; --crimson-border: #F2B8C0;
  --emerald: #116B45;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'Berkeley Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* depth (static/app/depth.css) */
  --desk: #EBE7DF;
  --ring: 0 0 0 .5px rgba(20,20,19,.10), 0 0 0 1px rgba(20,20,19,.035);
  --edge: inset 0 1px 0 rgba(255,255,255,.95);
  --lift-2: var(--ring), 0 2px 3px rgba(20,20,19,.05), 0 8px 18px -4px rgba(20,20,19,.12), 0 26px 50px -18px rgba(20,20,19,.24);
  --well: inset 0 1px 2px rgba(20,20,19,.09), inset 0 0 0 1px rgba(20,20,19,.07);
  --field: #FBFAF8;
  --focus: 0 0 0 3px rgba(20,20,19,.14);
  /* the pad's inks on the desk (splash.js): faint .. full print, the lamp, a decoded intercept, the read head */
  --pad-bg: #EBE7DF; --pad-faint: #E2DDD3; --pad-print: #D0CABE; --pad-lamp: #6E6B64; --pad-plain: #141413; --pad-head: #C8192E;
  --gutter: clamp(16px, 4vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--desk); -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  background: var(--desk);
  color: var(--ink);
  font: 400 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: rgba(20,20,19,.16); color: var(--ink); }
i { font-style: normal; color: var(--rule-strong); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* the one-time pad: drawn once, then only where something changes (splash.js) */
#pad { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; display: block; opacity: 0; }
#pad.on { opacity: 1; }   /* an opaque canvas is black until its first print; on the desk that would flash */

.shell {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  transition: opacity 220ms linear;
}
body.exit .shell { opacity: 0; }

/* ── the floating rail (depth.css .rail), locked ─────────────────────────── */
.rail {
  position: sticky; top: 8px; align-self: start;
  margin: 8px 0 8px 8px;
  height: calc(100vh - 16px); height: calc(100dvh - 16px);
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px 14px;
  border-radius: 16px;
  color: var(--slate-text);
  background: linear-gradient(180deg, #1D1F23 0%, #16171A 38%, #131417 100%);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 0 1px rgba(255,255,255,.035),
              0 3px 6px rgba(20,20,19,.14), 0 24px 48px -16px rgba(20,20,19,.55);
  overflow: hidden;
}
.rail i { color: #4A4E56; }
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--slate-text); }
.mark { width: 18px; height: 18px; display: block; flex: none; }
.wordmark { font: 400 14px/1 var(--font-mono); letter-spacing: -0.04em; }
.w-state { font-weight: 700; color: #E0384C; }   /* crimson lifted a step for the slate (4.6:1) */
.dtg { font: 400 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; font-variant-numeric: tabular-nums;
  color: var(--slate-muted); white-space: nowrap; }
.dtg-top { display: none; }

.rail-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.rail-label { font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--slate-muted);
  padding: 12px 8px 5px; }
.telemetry { display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px; font: 400 11px/1.55 var(--font-mono);
  color: var(--slate-muted); text-transform: uppercase; letter-spacing: .06em;
  background: rgba(0,0,0,.22); box-shadow: inset 0 1px 2px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.04); }
.telemetry p { display: flex; justify-content: space-between; gap: 10px; }
.telemetry strong { font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.telemetry .closed { color: #E0384C; display: inline-flex; align-items: center; gap: 7px; }
.telemetry .closed::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 2px rgba(224,56,76,.18); }

/* the tiles (depth.css .tiles), redacted: badge, a bar where the name goes, two dots where the count goes */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 6px; }
.tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 10px 6px;
  padding: 9px 10px 10px; border-radius: 11px;
  background: linear-gradient(180deg, #2D3036 0%, #222429 100%);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.35), 0 4px 10px -4px rgba(0,0,0,.4);
}
.tile .badge { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(180deg, #5A5D65, #3E4147);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 0 rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.35); }
.tile .count { justify-self: end; font: 700 17px/24px var(--font-sans); color: #5A5E66; letter-spacing: .1em; }
.tile .bar { grid-column: 1 / -1; height: 9px; width: 70%; border-radius: 2px; background: #3A3D44; }
.tile:nth-child(2) .bar { width: 82%; } .tile:nth-child(3) .bar { width: 58%; } .tile:nth-child(4) .bar { width: 76%; }
.locked-list { display: grid; gap: 14px; padding: 12px 10px; }
.locked-list .bar { height: 8px; border-radius: 2px; background: #2A2D33; }
.locked-list .w1 { width: 62%; } .locked-list .w2 { width: 48%; } .locked-list .w3 { width: 71%; }

.rail-foot { display: grid; gap: 4px; padding: 12px 8px 2px; border-top: 1px solid rgba(255,255,255,.06);
  font: 400 10px/1.5 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: #7D818A; }
.rail-foot a, .foot a { color: inherit; text-decoration: none; }
.rail-foot a:hover { color: #fff; }
.rail-foot a:focus-visible, .foot a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }

/* ── the desk ─────────────────────────────────────────────────────────────── */
.desk { min-width: 0; display: grid; grid-template-rows: 1fr auto;
  padding: max(clamp(20px, 4vh, 48px), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) var(--gutter); }
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
  max-width: 1160px; width: 100%; margin: 0 auto;
}
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }

.kicker { display: inline-flex; align-items: center; gap: 10px; font: 600 11px/1.4 var(--font-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-secondary); }
.kicker .sq { width: 6px; height: 6px; border-radius: 1px; background: var(--crimson); flex: none; }

/* the product name is Pravda's lockup (brand/lockup-black.svg, never retyped); the decoder wipes it in from the left.
   Since 0.43.2 the lockup ends in the punctuation square (496.545 units, the letters end at 454.41): the width keeps the
   letters at their size (3.61em x 496.545 / 454.41), and the cipher stops at the letters' ink (8.486% in from the right),
   so its digits sit over the letters as before and the square lands with the last one */
.name { position: relative; font-size: clamp(44px, 8.4vw, 124px); line-height: 0; max-width: 100%; margin: .26em 0 .2em; }
.name-mark { display: block; width: 3.945em; max-width: 100%; height: auto; }
.name-vis { position: absolute; top: 6%; height: 69%; left: 0; right: 8.486%; display: flex; justify-content: flex-end; align-items: center;
  overflow: hidden; white-space: nowrap; pointer-events: none; font: 400 1.1em/1 var(--font-mono); }
.name-vis:empty { display: none; }
.name-vis .run { display: block; transform: scaleX(0.68); transform-origin: right center; }
.name-vis .c { color: var(--rule-strong); }
.name-vis .t { font-weight: 700; color: var(--crimson); }

.lede { font: 400 clamp(26px, 2.6vw, 38px)/1.08 var(--font-serif); letter-spacing: -.01em; color: var(--ink); }
.lede.r3 { font-style: italic; color: var(--ink-secondary); }
.lede + .lede { margin-top: -10px; }

/* redaction bars: newsprint ink, lifting toward the right as each line arrives */
.redact { position: relative; }
.redact::after { content: ""; position: absolute; inset: -1px -5px; border-radius: 2px; background: var(--ink);
  transform-origin: 100% 50%; transform: scaleX(0); pointer-events: none; }

/* ── the sheet: lifted, not outlined ─────────────────────────────────────── */
.panel {
  position: relative; min-width: 0;
  padding: 22px 26px 16px;
  border-radius: 16px;
  background: var(--paper-elevated);
  box-shadow: var(--lift-2), var(--edge);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px dashed var(--rule); }   /* the pad's perforation */
.panel-title { font: 400 32px/1 var(--font-serif); letter-spacing: -.01em; color: var(--ink); outline: none; }
.panel-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 3px; }
.panel-ref { font: 500 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }

.view { display: flex; flex-direction: column; gap: 14px; }
.view[hidden], .field[hidden] { display: none; }
.plain { font-size: 14px; line-height: 1.55; color: var(--ink-secondary); }
.plain strong { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.plain.dim { color: var(--ink-muted); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.ellipsis::after { content: "…"; }

.field { display: flex; flex-direction: column; gap: 7px; }
label { font: 600 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-secondary); }

/* fields are wells (depth.css) */
input {
  width: 100%; height: 44px; padding: 0 13px;
  background: var(--field); border: 0; border-radius: 9px;
  box-shadow: var(--well);
  color: var(--ink); font: 500 15px/1 var(--font-sans); letter-spacing: 0;
  caret-color: var(--crimson);
  transition: box-shadow 140ms var(--ease);
  -webkit-appearance: none; appearance: none;
}
input:hover { box-shadow: inset 0 1px 2px rgba(20,20,19,.10), inset 0 0 0 1px rgba(20,20,19,.16); }
input:focus { outline: none; box-shadow: inset 0 1px 2px rgba(20,20,19,.08), inset 0 0 0 1px var(--ink-secondary), var(--focus); }
input[aria-invalid="true"] { box-shadow: inset 0 1px 2px rgba(20,20,19,.08), inset 0 0 0 1.5px var(--crimson); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink); caret-color: var(--crimson);
  -webkit-box-shadow: 0 0 0 100px var(--field) inset, inset 0 0 0 1px rgba(20,20,19,.07);
}
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--field) inset, inset 0 0 0 1px var(--ink-secondary), var(--focus); }

.hint { font-size: 12px; line-height: 1.45; color: var(--ink-muted); }
.rules { list-style: none; display: flex; flex-direction: column; gap: 3px; margin-top: -2px;
  font: 400 11.5px/1.5 var(--font-mono); color: var(--ink-muted); }
.rules li[data-rule]::before { content: "[ ] "; white-space: pre; color: var(--rule-strong); }
.rules li.ok { color: var(--emerald); }
.rules li.ok::before { content: "[x] "; color: var(--emerald); }
.rules .note { padding-left: 4ch; }

/* the primary: the app's beveled ink button (depth.css .btn.primary) */
.go {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; height: 48px; margin-top: 6px; padding: 0 16px;
  border: 0; border-radius: 10px;
  color: #fff; background: linear-gradient(180deg, #38373A 0%, #1E1E1D 55%, var(--ink) 100%);
  box-shadow: 0 0 0 .5px #000, 0 1px 2px rgba(20,20,19,.3), 0 4px 10px -4px rgba(20,20,19,.4), inset 0 1px 0 rgba(255,255,255,.16);
  font: 600 14px/1 var(--font-sans); letter-spacing: 0; text-decoration: none;
  cursor: pointer;
  transition: background .12s var(--ease), box-shadow .12s var(--ease), transform .12s var(--ease);
}
.go:hover { background: linear-gradient(180deg, #424144 0%, #282827 55%, #1C1C1B 100%); }
.go:active { transform: translateY(.5px); background: #111110; box-shadow: 0 0 0 .5px #000, inset 0 1px 3px rgba(0,0,0,.5); }
.go:focus { outline: none; }
.go:focus-visible { box-shadow: 0 0 0 .5px #000, 0 0 0 2px var(--paper-elevated), 0 0 0 4px var(--ink); }
.go[aria-busy="true"] { cursor: progress; background: #2B2B29; }
.go-label { white-space: pre; font-variant-numeric: tabular-nums; }
.go-arrow { font-weight: 400; transition: transform 260ms var(--ease-out); }
.go:hover .go-arrow { transform: translateX(3px); }

.aux { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: -4px; }
.link {
  background: none; border: 0; padding: 10px 0; min-height: 44px;
  color: var(--ink-secondary); font: 500 13px/1.2 var(--font-sans); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px;
  transition: color 120ms linear, text-decoration-color 120ms linear;
}
.link:hover, .link:focus-visible { color: var(--ink); text-decoration-color: var(--ink); }
.link:focus { outline: none; }
.link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.notice, .error { font-size: 13px; line-height: 1.5; }
.notice:not(:empty) { display: flex; gap: 10px; align-items: baseline; margin-bottom: 14px; color: var(--ink); }
.notice:not(:empty)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); flex: none; transform: translateY(-1px); }
/* the one alarm meaning: crimson needs you (the app's alarm strip) */
.error:not(:empty) { margin-bottom: 14px; padding: 9px 12px; border-radius: 9px; color: var(--crimson-ink);
  background: var(--crimson-soft); box-shadow: inset 3px 0 0 var(--crimson), inset 0 0 0 1px var(--crimson-border), inset 0 1px 0 rgba(255,255,255,.65); }

.panel-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px;
  border-top: 1px dashed var(--rule); overflow: hidden; white-space: nowrap;
  font: 500 9.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.panel-foot .perf { color: var(--rule-strong); letter-spacing: 0; overflow: hidden; }

/* the desk's own footer: only where the rail folds into a bar */
.foot { display: none; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 14px;
  border-top: 1px solid var(--rule); font: 400 10px/1.5 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.foot a:hover { color: var(--ink); }

/* ── motion (only without the reduce preference) ─────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .rail { animation: ns-rail 620ms var(--ease-out) both; }
  .name-mark { clip-path: inset(0 100% 0 0); animation: ns-show 0s 2.5s forwards; }
  .redact::after { animation: ns-lift 460ms var(--ease-out) both; }
  .redact.r1::after { animation-delay: 260ms; }
  .redact.r2::after { animation-delay: 1050ms; }
  .redact.r3::after { animation-delay: 1170ms; }
  .panel { animation: ns-rise 560ms var(--ease-out) 140ms both; }
  .view:not([hidden]) > * { animation: ns-in 360ms var(--ease-out) both; }
  .view:not([hidden]) > :nth-child(2) { animation-delay: 40ms; }
  .view:not([hidden]) > :nth-child(3) { animation-delay: 80ms; }
  .view:not([hidden]) > :nth-child(4) { animation-delay: 120ms; }
  .view:not([hidden]) > :nth-child(5) { animation-delay: 160ms; }
  .view:not([hidden]) > :nth-child(n+6) { animation-delay: 200ms; }
  .error:not(:empty), .notice:not(:empty) { animation: ns-in 260ms var(--ease-out) both; }
  .ellipsis::after { animation: ns-dots 1.2s steps(4, end) 4 both; content: "…"; }
}
@keyframes ns-lift { 0%, 30% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes ns-in { from { opacity: 0; transform: translateY(6px); } }
/* the sheet is set down on the desk: it arrives a little high, its shadow tight, and settles */
@keyframes ns-rise { from { opacity: 0; transform: translateY(10px) scale(.985); box-shadow: var(--ring); } }
@keyframes ns-rail { from { opacity: 0; transform: translateX(-10px); } }
@keyframes ns-show { to { clip-path: none; } }
@keyframes ns-dots { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── widths ──────────────────────────────────────────────────────────────── */
@media (max-height: 700px) and (min-width: 901px) { .locked-list { display: none; } }
@media (max-width: 1100px) and (min-width: 901px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .stage { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); }
}
/* tablets and phones: the rail folds into a floating slate bar across the top, as the app's does */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .rail { position: relative; top: 0; height: auto; margin: max(8px, env(safe-area-inset-top)) 8px 0; padding: 12px 14px;
    border-radius: 14px; }
  .rail-top { padding: 0; }
  .dtg-top { display: inline; }
  .rail-body, .rail-foot { display: none; }
  .desk { padding-top: 0; }
  .stage { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: center; gap: 28px; padding: 64px 0 48px; }
  .panel { max-width: 480px; width: 100%; }
  .name { font-size: clamp(44px, 13vw, 96px); }
  .foot { display: flex; }
}
@media (max-width: 640px), (pointer: coarse) { input { font-size: 16px; } }
@media (max-width: 480px) {
  .panel { padding: 18px 16px 14px; border-radius: 14px; }
  .panel-title { font-size: 28px; }
  .foot-r { display: none; }
  .hero { gap: 10px; }
  .stage { padding: 44px 0 36px; }
}
@media (max-width: 360px) {
  .wordmark { font-size: 13px; }
  .dtg { letter-spacing: .04em; font-size: 10px; }
  .kicker { letter-spacing: .05em; }
}

/* the pending view: the break-glass command an admin runs while mail delivery is off (Astra R36-07) */
[data-view="pending"] [data-mail="queued"] { display: flex; flex-direction: column; gap: 10px; }
[data-view="pending"] [data-mail][hidden] { display: none; }
.plain code.cmd { display: block; padding: 8px 10px; border-radius: 8px; background: var(--paper-sunken); box-shadow: var(--well);
  font: 400 12px/1.5 var(--font-mono); color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
