/* Vault. An instrument, not a brochure: stone, ink and a single signal colour taken from a combination dial.
   Archivo (wide cut) for names and numbers, the system face for reading, IBM Plex Mono for codes. */

@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #edeeeb;
  --surface: #ffffff;
  --sunk: #e4e5e1;
  --hover: #e8e9e5;
  --line: #d3d6d1;
  --line-soft: #e3e5e0;
  --ink: #121513;
  --ink-2: #444a46;
  --ink-3: #5c635e;
  --primary: #121513;
  --primary-ink: #ffffff;
  --signal: #c8963e;
  --focus: color-mix(in srgb, var(--signal) 45%, transparent);
  --good: #1d6a4c;
  --good-soft: #e3efe8;
  --warn: #8a5800;
  --warn-soft: #f6eedb;
  --bad: #b02a20;
  --bad-soft: #f8e4e1;
  --mark: #f3dc8f;
  --pop: 0 1px 0 rgba(18, 21, 19, .04), 0 18px 40px -16px rgba(18, 21, 19, .28);
  --plate: #0f1311;
  --plate-ink: #e8ebe7;
  --plate-dim: rgba(232, 235, 231, .52);
  --plate-line: rgba(232, 235, 231, .2);
  --r: 8px;
  --r-lg: 12px;
  --display: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* kept for older rules and inline styles */
  --serif: var(--display); --paper: var(--bg); --navy: var(--primary); --navy-ink: var(--primary-ink); --steel: var(--ink); --steel-soft: var(--sunk);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e0d; --surface: #141716; --sunk: #1a1e1c; --hover: #1d2120; --line: #2b302d; --line-soft: #222624;
    --ink: #e8ebe7; --ink-2: #b3b9b4; --ink-3: #868d88; --primary: #e8ebe7; --primary-ink: #0f1311;
    --good: #6dc59c; --good-soft: #142a20; --warn: #e2b05a; --warn-soft: #2c2310; --bad: #ef8a7e; --bad-soft: #351a17;
    --mark: #6a5718; --pop: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .8); --plate: #080a09;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e0d; --surface: #141716; --sunk: #1a1e1c; --hover: #1d2120; --line: #2b302d; --line-soft: #222624;
  --ink: #e8ebe7; --ink-2: #b3b9b4; --ink-3: #868d88; --primary: #e8ebe7; --primary-ink: #0f1311;
  --good: #6dc59c; --good-soft: #142a20; --warn: #e2b05a; --warn-soft: #2c2310; --bad: #ef8a7e; --bad-soft: #351a17;
  --mark: #6a5718; --pop: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .8); --plate: #080a09;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "kern"; }
::selection { background: color-mix(in srgb, var(--signal) 35%, transparent); }
a { color: var(--ink); text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font: 620 29px/1.1 var(--display); font-stretch: 112%; letter-spacing: -.012em; }
h2 { font: 620 15.5px/1.3 var(--display); font-stretch: 106%; letter-spacing: -.003em; }
h3 { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin: 16px 0 6px; letter-spacing: .01em; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-3); }
.fine { color: var(--ink-3); font-size: 12.5px; margin-top: 10px; }
.loading { color: var(--ink-3); }
.loading::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 9px; vertical-align: -1px; border: 1.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--bad); font-size: 14px; margin: 8px 0; }
.error:empty { display: none; }
.noscript { padding: 24px; }

/* Buttons */
button, .button { font: inherit; font-size: 14px; font-weight: 560; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .14s, border-color .14s, color .14s, transform .08s; }
button:active:not(:disabled) { transform: translateY(.5px); }
button:disabled { opacity: .55; cursor: progress; }
.primary { background: var(--primary); color: var(--primary-ink); }
.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 84%, var(--bg)); }
.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ghost:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.danger { background: var(--bad); color: #fff; }
.danger-text { color: var(--bad) !important; }
.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.block { width: 100%; margin-top: 10px; }
.icon-btn { padding: 0; width: 36px; }
.icon-btn.tiny { width: 26px; min-height: 26px; border: 0; background: transparent; }
.icon-btn.tiny:hover { background: var(--hover); }
.icon-btn.tiny .icon { width: 15px; height: 15px; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; font-weight: 500; }

/* Forms */
.field { margin: 0 0 16px; }
.field label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 6px; color: var(--ink-2); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; width: 100%; min-height: 40px; transition: border-color .14s, box-shadow .14s; }
input::placeholder { color: var(--ink-3); }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 28%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus); }
input[type=password] { letter-spacing: .08em; }
input.code { font: 500 24px/1 var(--mono); letter-spacing: .4em; text-align: center; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 6px 0 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 6px 0 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--primary); }

/* Entry screens: the dial plate and the form */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 46%) minmax(0, 1fr); }
.plate { position: relative; background: var(--plate); color: var(--plate-ink); display: grid; grid-template-rows: auto 1fr auto; padding: 36px 40px; overflow: hidden; box-shadow: inset -1px 0 0 rgba(232, 235, 231, .08); }
.plate-brand { display: flex; align-items: center; gap: 11px; font: 620 16px/1 var(--display); font-stretch: 115%; letter-spacing: .005em; }
.plate-brand .mark { width: 24px; height: 24px; }
.plate-dial { display: grid; place-items: center; padding: 28px 0; }
.dial { width: min(78%, 460px); height: auto; overflow: visible; }
.plate-note { margin: 0; max-width: 34ch; font: 400 12px/1.6 var(--mono); color: var(--plate-dim); letter-spacing: .01em; }
.gate-body { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--bg); }
.gate-inner { width: 100%; max-width: 400px; }
.gate .card.narrow { background: none; border: 0; box-shadow: none; padding: 0; max-width: none; }
.gate h1 { font-size: 32px; margin-bottom: 10px; }
.gate .lede { color: var(--ink-2); margin-bottom: 28px; font-size: 15.5px; }
.gate input { min-height: 46px; padding: 10px 13px; font-size: 15.5px; }
.gate .primary.block { min-height: 46px; font-size: 15px; margin-top: 14px; }
.gate .ghost.small { background: transparent; border-color: transparent; color: var(--ink-2); padding: 0; margin-top: 14px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-underline-offset: 3px; }
.gate > .loading { grid-column: 1 / -1; place-self: center; }

/* The dial, engraved in hairlines */
.dial .d-bezel { fill: none; stroke: var(--plate-line); stroke-width: 1; }
.dial .d-face { transform-box: view-box; transform-origin: 200px 200px; transform: rotate(var(--a, 0deg)); transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.dial .d-minor { stroke: rgba(232, 235, 231, .26); stroke-width: 1; }
.dial .d-major { stroke: rgba(232, 235, 231, .78); stroke-width: 1.4; }
.dial .d-num { fill: rgba(232, 235, 231, .62); font: 500 12px var(--mono); text-anchor: middle; dominant-baseline: central; letter-spacing: .04em; }
.dial .d-ring { fill: none; stroke: var(--plate-line); stroke-width: 1; }
.dial .d-knob { fill: #161b18; stroke: rgba(232, 235, 231, .14); stroke-width: 1; }
.dial .d-knurl { stroke: rgba(232, 235, 231, .16); stroke-width: 1; }
.dial .d-cap { fill: #121614; stroke: rgba(232, 235, 231, .1); stroke-width: 1; }
.dial .d-grip { stroke: var(--signal); stroke-width: 2.4; stroke-linecap: round; }
.dial .d-index { fill: var(--signal); }
.dial .d-pin { fill: var(--plate-ink); }
.working .dial .d-face { animation: turning 2.6s cubic-bezier(.45, .05, .55, .95) infinite; }
@keyframes turning { from { transform: rotate(var(--a, 0deg)); } to { transform: rotate(calc(var(--a, 0deg) - 360deg)); } }

/* The mark */
.mark { overflow: visible; }
.mark .g-ring { fill: none; stroke: currentColor; stroke-width: 2.6; }
.mark .g-knob { fill: currentColor; }
.mark .g-grip { stroke: var(--bg); stroke-width: 1.8; stroke-linecap: round; }
.plate .mark .g-grip { stroke: var(--plate); }
.reader-top .mark .g-grip { stroke: #0f1311; }
.mark .g-index { fill: var(--signal); stroke: var(--signal); stroke-width: .8; stroke-linejoin: round; }

/* Frame */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 58px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 640 16px/1 var(--display); font-stretch: 115%; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .mark { width: 22px; height: 22px; flex: none; }
.search { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--sunk); border: 1px solid transparent; border-radius: var(--r); color: var(--ink-3); transition: background .14s, border-color .14s; }
.search:hover { border-color: var(--line); }
.search:focus-within { background: var(--surface); border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus); }
.search input { border: 0; padding: 0; min-height: 36px; background: transparent; box-shadow: none !important; }
.who { display: flex; align-items: center; gap: 8px; }
.who-name { font-size: 13.5px; font-weight: 600; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.role { font-weight: 400; color: var(--ink-3); font-size: 12px; text-transform: capitalize; }
.menu-btn { display: none; }
.frame { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.side { padding: 18px 12px; border-right: 1px solid var(--line); position: sticky; top: 58px; align-self: start; max-height: calc(100vh - 58px); overflow: auto; }
.side a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.side a .icon { color: var(--ink-3); }
.side a span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a:hover { background: var(--hover); color: var(--ink); }
.side a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.side a.on .icon { color: var(--ink); }
.side a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--signal); }
.count { font: 500 11.5px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 10px 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.nav-empty { font-size: 13px; color: var(--ink-3); padding: 0 10px; }
.content { padding: 30px 36px 72px; max-width: 1280px; width: 100%; }
.content:focus { outline: none; }

/* Page parts */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumb a { color: var(--ink-3); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.panel > h2 { margin-bottom: 12px; }
.empty { padding: 40px 28px; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--ink-2); margin-bottom: 18px; }
.empty h2 { font-size: 19px; margin-bottom: 6px; color: var(--ink); }
.empty p { max-width: 460px; margin: 0 0 16px; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list.panel { padding: 4px 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
a.row:hover { background: var(--hover); }
.row + .row { border-top: 1px solid var(--line-soft); }
.row-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.row-icon .icon { width: 19px; height: 19px; }
.row-icon.warn { color: var(--warn); }
.row-icon.good { color: var(--good); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; align-items: center; gap: 10px; flex: none; }
.row-side select { width: auto; min-height: 30px; padding: 2px 8px; font-size: 13px; }
.row-time { font-size: 12.5px; color: var(--ink-3); min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sunk); color: var(--ink); border: 1px solid var(--line); display: grid; place-items: center; font: 600 12px var(--display); font-stretch: 110%; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--line); gap: 1px; }
.tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; color: var(--ink); text-decoration: none; background: var(--surface); }
.tile:hover { background: var(--hover); }
.tile .icon { color: var(--ink-3); width: 18px; height: 18px; margin-bottom: 8px; }
.tile-name { font-weight: 600; }
.tile-sub { font-size: 12.5px; color: var(--ink-3); }
.drop-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
body.dragging .content { outline: 1.5px dashed var(--ink-3); outline-offset: -10px; border-radius: 14px; }

/* Status: square-cut labels, colour only where it carries meaning */
.chip { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 4px; font: 500 11px/1 var(--mono); letter-spacing: .02em; white-space: nowrap; border: 1px solid currentColor; background: transparent; }
.chip.approved { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.chip.draft { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.chip.declined { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.chip.none { color: var(--ink-3); border-color: var(--line); text-transform: capitalize; }
.live { font-size: 12.5px; color: var(--good); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.live.small { font-size: 11.5px; }
.vbig { font: 640 16px var(--display); font-stretch: 110%; color: var(--ink); font-variant-numeric: tabular-nums; }
.meta-line { flex-basis: 100%; font-size: 13px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; font-size: 14px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); }
.notice.good { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); background: color-mix(in srgb, var(--good-soft) 60%, var(--surface)); }
.notice-actions { display: flex; gap: 8px; }
.note { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); color: var(--ink-2); white-space: pre-wrap; }
.note-by { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 3px; }

/* Document page */
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.viewer { background: var(--sunk); border-radius: var(--r-lg); padding: 20px; min-height: 300px; display: flex; flex-direction: column; gap: 18px; }
.page { margin: 0; position: relative; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 8px -2px rgba(0, 0, 0, .16); overflow: hidden; scroll-margin-top: 80px; }
.page canvas { display: block; width: 100%; height: 100%; }
.page figcaption { position: absolute; right: 8px; bottom: 8px; font: 500 11px var(--mono); background: rgba(18, 21, 19, .78); color: #fff; padding: 3px 7px; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.page:hover figcaption { opacity: 1; }
.image-view { max-width: 100%; border-radius: 4px; align-self: center; background: #fff; }
.preview-note { font-size: 13px; color: var(--ink-3); margin: 0; }
.text-unit { background: var(--surface); border-radius: var(--r); padding: 16px 18px; scroll-margin-top: 80px; }
.text-unit h3 { margin-top: 0; }
.text-unit p { white-space: pre-wrap; margin: 0; font-size: 15px; line-height: 1.6; }
.side-col { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; padding-bottom: 4px; }
.side-card { padding: 16px 18px; }
.side-card h2 { margin-bottom: 8px; }
.summary { font-size: 15px; line-height: 1.5; color: var(--ink); }
.changes, .figs, .timeline, .words { list-style: none; margin: 0; padding: 0; }
.changes > li { padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tag { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 3px 5px; border-radius: 3px; border: 1px solid currentColor; }
.removed .tag { color: var(--bad); }
.added .tag { color: var(--good); }
.changed .tag { color: var(--warn); }
.moved .tag { color: var(--ink-2); }
.ttl { color: var(--ink-3); flex-basis: 100%; font-size: 13px; }
.words { flex-basis: 100%; }
.words li { font-size: 13px; padding: 3px 0; }
del { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; padding: 0 3px; border-radius: 2px; }
ins { background: var(--good-soft); color: var(--good); text-decoration: none; padding: 0 3px; border-radius: 2px; }
.words .more { color: var(--ink-3); }
.fig { padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.fig-head { display: flex; justify-content: space-between; gap: 8px; }
.fig-name { font-weight: 600; }
.fig-status { font: 500 11.5px var(--mono); }
.fig.ok .fig-status { color: var(--good); }
.fig.differs .fig-status, .fig.invalid .fig-status { color: var(--bad); }
.fig.unframed .fig-status { color: var(--warn); }
.fig.absent .fig-status { color: var(--ink-3); }
.fig-approved { font-size: 12.5px; color: var(--ink-3); }
.fig-hit { font-size: 13px; margin-top: 6px; }
.snip { color: var(--ink-2); quotes: none; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 2px; }
.timeline li { position: relative; padding: 0 0 13px 22px; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 7px; height: 7px; transform: rotate(45deg); border-radius: 1px; background: var(--line); box-shadow: 0 0 0 3px var(--surface); z-index: 1; }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 12px; bottom: -6px; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.approved::before { background: var(--good); }
.timeline li.draft::before { background: var(--warn); }
.timeline li.declined::before { background: var(--bad); }
.timeline li.current::before { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--ink); }
.timeline a { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.timeline a:hover .t-num { text-decoration: underline; }
.t-num { font: 640 14px var(--display); font-stretch: 110%; font-variant-numeric: tabular-nums; min-width: 34px; }
.t-meta { font-size: 12px; color: var(--ink-3); }

/* Menus and dialogs */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 42px; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--pop); padding: 5px; z-index: 30; display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu button { justify-content: flex-start; background: none; color: var(--ink); font-weight: 500; border-radius: 5px; }
.menu button:hover { background: var(--hover); }
.shade { position: fixed; inset: 0; z-index: 50; background: rgba(12, 14, 13, .5); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow: auto; animation: fade .14s ease-out; }
.dialog { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--pop); animation: rise .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.dialog.wide { max-width: 760px; }
.dialog:focus { outline: none; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 0; }
.dialog-head h2 { font-size: 19px; font-stretch: 110%; }
.dialog-body { padding: 16px 20px 20px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 38px 16px; border: 1px dashed color-mix(in srgb, var(--ink) 30%, var(--line)); border-radius: var(--r-lg); text-align: center; color: var(--ink-2); cursor: pointer; background: var(--bg); transition: background .14s, border-color .14s; }
.drop .icon { width: 24px; height: 24px; color: var(--ink-2); }
.drop span { font-size: 13px; color: var(--ink-3); max-width: 340px; }
.drop.over, .drop:hover { border-color: var(--ink); background: var(--surface); }
.file-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--r); margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.file-line .muted { font-weight: 400; font-size: 13px; }
.becomes { margin-bottom: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.analysis { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 14px 12px; margin-bottom: 14px; background: var(--bg); }
.analysis .summary { font-size: 14.5px; }
.analysis .notice { margin: 6px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 60; background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: var(--r); font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--pop); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

/* Figures sheet, search, team, activity */
.table-wrap { overflow-x: auto; padding: 2px; }
.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px; border-bottom: 1px solid var(--line); }
.sheet td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.sheet input { min-height: 34px; padding: 6px 9px; min-width: 120px; }
.sheet input.wide { min-width: 180px; }
.bad-small { display: block; font-size: 12px; color: var(--bad); margin-top: 3px; }
.help { margin: 10px 0 18px; color: var(--ink-2); font-size: 14px; }
.help summary { cursor: pointer; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.help p { max-width: 760px; }
.result h2 { font-size: 16.5px; }
.result ul { list-style: none; padding: 0; margin: 8px 0 0; }
.result li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.hit-label { font-weight: 600; text-decoration: none; }
.explain ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.explain p { color: var(--ink-2); max-width: 760px; }
.activity { list-style: none; margin: 0; padding: 4px 18px; }
.activity li { display: flex; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.activity li:first-child { border-top: 0; }
.a-time { color: var(--ink-3); min-width: 96px; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Narrow screens */
@media (max-width: 1080px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; max-height: none; order: -1; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 58px; left: 0; bottom: 0; width: 272px; z-index: 25; background: var(--bg); transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); max-height: none; box-shadow: var(--pop); }
  .side a.on::before { left: -12px; }
  body.nav-open .side { transform: none; }
  .content { padding: 22px 16px 48px; }
  .who-name, .who .small { display: none; }
  .top { gap: 10px; padding: 0 12px; }
  .brand span { display: none; }
  .two { grid-template-columns: 1fr; }
  .row-time { display: none; }
  .result li { grid-template-columns: 1fr; gap: 2px; }
  h1 { font-size: 25px; }
  .viewer { padding: 10px; }
}
@media (max-width: 900px) {
  .gate { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .plate { display: block; height: 112px; padding: 0 18px; }
  .plate-brand { position: relative; z-index: 1; font-size: 15.5px; }
  .plate-dial { position: absolute; right: -86px; top: -92px; padding: 0; width: 300px; }
  .dial { width: 300px; }
  .plate-note { display: none; }
  .plate-brand { margin-top: 30px; }
  .plate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--plate) 30%, transparent 75%); pointer-events: none; }
  .gate-body { align-items: flex-start; padding: 28px 16px 40px; }
  .gate h1 { font-size: 27px; }
}

/* ===== Stage 3 and up ===== */

.mono { font-family: var(--mono); letter-spacing: .01em; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.split { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.label-small { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin: 8px 0 6px; }
h3.plain { font-size: 16px; color: var(--ink); margin: 0 0 2px; }
.count.warn { color: var(--warn); font-weight: 600; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 4px; }
kbd.k { font: 500 11px var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; background: var(--surface); cursor: pointer; white-space: nowrap; }
.search kbd.k { margin-left: auto; }
.who-name { text-decoration: none; color: var(--ink); }

/* Passphrase strength */
.meter-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; width: 132px; }
.meter span { height: 3px; border-radius: 1px; background: var(--line); transition: background .2s; }
.meter[data-s="1"] span:nth-child(-n+1) { background: var(--bad); }
.meter[data-s="2"] span:nth-child(-n+2) { background: var(--warn); }
.meter[data-s="3"] span:nth-child(-n+3) { background: var(--good); }
.meter[data-s="4"] span { background: var(--good); }
.meter-text { font: 500 11.5px var(--mono); color: var(--ink-3); }

/* Recovery kit and safety codes */
.kit-code span { display: block; white-space: nowrap; }
.kit-code { font: 500 18px/1.7 var(--mono); letter-spacing: .06em; text-align: center; padding: 18px 12px; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); word-break: break-word; user-select: all; box-shadow: inset 0 0 0 4px var(--bg); }
.safety { font: 500 26px/1.2 var(--mono); letter-spacing: .04em; white-space: nowrap; text-align: center; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); margin: 6px 0 12px; word-spacing: .3em; }
.safety.small { font-size: 19px; padding: 9px 14px; margin: 0; flex: none; }

/* Settings rows */
.panel.setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.panel.setting > div:first-child { flex: 1; min-width: 240px; }
.panel.setting h2 { margin-bottom: 4px; }
.panel.setting p { margin: 0; max-width: 620px; color: var(--ink-2); }
.panel.attention { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.guide p { max-width: 760px; color: var(--ink-2); }
.guide h2 { font-size: 17px; margin-bottom: 8px; }

/* Cards with a header row */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card.narrow { width: 100%; max-width: 420px; }
.lede { color: var(--ink-2); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.block.small { margin-top: 10px; }
.visual-flag { font-size: 13.5px; color: var(--warn); font-weight: 600; margin: 10px 0 0; }

/* Shared links */
.links { list-style: none; margin: 0; padding: 0; }
.links li + li { border-top: 1px solid var(--line-soft); }
.link-row { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; background: none; border: 0; padding: 10px 6px; text-align: left; color: var(--ink); border-radius: 6px; min-height: 0; font-weight: 500; }
.link-row:hover { background: var(--hover); }
.link-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-meta { grid-column: 1; font-size: 12.5px; color: var(--ink-3); }
.link-row .chip { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.links li.off .link-name, .links li.expired .link-name { color: var(--ink-3); text-decoration: line-through; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 4px 0 14px; }
.opts.inline { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.check.opt { align-items: flex-start; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r); transition: border-color .14s; }
.check.opt:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.check.opt:has(input:checked) { border-color: var(--ink); }
.check.opt input { margin-top: 2px; }
.check.opt span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.check.opt .hint { margin: 0; }
.ready-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ready-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--good); flex: none; }
.tiles.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 0; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); }
.stat-value { font: 640 23px/1.1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stat-hint { font-size: 12px; color: var(--warn); }
.bars { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.bars li { display: grid; grid-template-columns: 34px 1fr 64px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: var(--ink-3); text-align: right; font: 500 11.5px var(--mono); }
.bar-track { height: 8px; background: var(--sunk); border-radius: 1px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--ink); border-radius: 1px; }
.bar-value { color: var(--ink-2); font: 500 11.5px var(--mono); }
.visits { width: 100%; border-collapse: collapse; font-size: 13px; }
.visits th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.visits td { padding: 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.dialog section h3 { margin-top: 20px; }

/* Compare */
.pickers { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.pickers select { width: auto; min-height: 32px; padding: 3px 8px; }
.compare-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 18px; }
.compare-summary p { margin: 0 0 6px; }
.cmp-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.cmp-row.quiet { display: none; }
.show-quiet .cmp-row.quiet { display: block; opacity: .75; }
.cmp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cmp-head .tag { margin-left: 0; }
.t-added { color: var(--good); } .t-removed { color: var(--bad); }
.t-changed { color: var(--warn); } .t-moved, .t-same { color: var(--ink-2); }
.t-visual { color: var(--bad); } .t-quiet { color: var(--ink-3); }
.cmp-pics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cmp-fig { margin: 0; }
.cmp-fig canvas { width: 100%; height: auto; display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); background: #fff; }
.cmp-fig figcaption { font-size: 12px; color: var(--ink-3); margin-top: 6px; text-align: center; }
.cmp-text { white-space: pre-wrap; color: var(--ink-2); margin: 8px 0 0; }

/* Office previews (they show the document's own look, not the vault's) */
.office { display: flex; flex-direction: column; gap: 18px; }
.docx-page { background: #fff; color: #1b1b1b; padding: 56px 64px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 8px -2px rgba(0, 0, 0, .16); font: 15.5px/1.55 Georgia, "Times New Roman", serif; }
.docx-page .docx-title { font: 700 30px/1.2 Georgia, serif; margin: 0 0 18px; }
.docx-page .docx-h { font-family: Arial, "Helvetica Neue", sans-serif; color: #1d3557; margin: 22px 0 8px; line-height: 1.25; letter-spacing: 0; }
.docx-page h2.docx-h { font-size: 22px; } .docx-page h3.docx-h { font-size: 18px; } .docx-page h4.docx-h, .docx-page h5.docx-h, .docx-page h6.docx-h { font-size: 15.5px; }
.docx-page .docx-p { margin: 0 0 10px; }
.docx-page ul, .docx-page ol { margin: 0 0 10px; padding-left: 1.4em; }
.docx-img { max-width: 100%; height: auto; display: inline-block; margin: 6px 0; }
.docx-table-wrap { overflow-x: auto; margin: 8px 0 14px; }
.docx-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.docx-table td { border: 1px solid #cfd5dd; padding: 6px 8px; vertical-align: top; }
.docx-table td p { margin: 0; }
.slide { position: relative; width: 100%; container-type: inline-size; overflow: hidden; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 8px -2px rgba(0, 0, 0, .16); scroll-margin-top: 80px; color: #111; font-family: Arial, "Helvetica Neue", sans-serif; }
.slide .shape { position: absolute; display: flex; overflow: hidden; }
.slide .shape img { width: 100%; height: 100%; object-fit: fill; display: block; }
.slide .text { display: flex; flex-direction: column; width: 100%; height: 100%; }
.slide .text p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.slide-num { position: absolute; right: 8px; bottom: 6px; font: 500 11px var(--mono); color: rgba(0, 0, 0, .4); background: rgba(255, 255, 255, .7); padding: 1px 6px; border-radius: 3px; }
.sheet-view { background: var(--surface); border-radius: var(--r); padding: 12px; scroll-margin-top: 80px; }
.sheet-view h3 { margin-top: 0; }
.grid-wrap { overflow: auto; max-height: 70vh; }
.grid { border-collapse: collapse; font-size: 12.5px; }
.grid th { background: var(--sunk); color: var(--ink-3); font-weight: 600; padding: 3px 8px; border: 1px solid var(--line); position: sticky; top: 0; }
.grid tr th:first-child { position: sticky; left: 0; }
.grid td { border: 1px solid var(--line-soft); padding: 3px 8px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Jump to anything */
.palette { padding: 0 12px 12px; }
.palette input { font-size: 16px; min-height: 46px; }
.pal-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.pal-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.pal-list li .icon { color: var(--ink-3); }
.pal-list li.on { background: var(--sunk); }
.pal-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pal-sub { font-size: 12px; color: var(--ink-3); }

/* Reader page: what an investor sees */
body.reader { background: #161917; }
.reader .gate { color: var(--ink); }
.reader-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: rgba(15, 19, 17, .9); backdrop-filter: saturate(1.2) blur(14px); color: #e8ebe7; border-bottom: 1px solid rgba(232, 235, 231, .1); }
.reader-brand { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px/1 var(--display); font-stretch: 112%; color: rgba(232, 235, 231, .62); }
.reader-brand .mark { width: 15px; height: 15px; }
.reader-top h1 { font-size: 21px; color: #fff; margin: 7px 0 4px; }
.reader-sub { margin: 0; font-size: 12.5px; color: rgba(232, 235, 231, .55); }
.reader-actions .ghost { background: transparent; color: #e8ebe7; border-color: rgba(232, 235, 231, .24); }
.reader-actions .ghost:hover { border-color: rgba(232, 235, 231, .55); }
.reader-main { max-width: 980px; margin: 0 auto; padding: 28px 18px 40px; }
.reader-pages { display: flex; flex-direction: column; gap: 22px; position: relative; }
.reader-pages .page { box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 24px 50px -24px rgba(0, 0, 0, .7); }
.reader-pages .loading { color: rgba(232, 235, 231, .6); }
.reader-pages .loading::before { border-color: rgba(232, 235, 231, .2); border-top-color: #e8ebe7; }
.image-page img { width: 100%; display: block; }
.reader-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 16px 34px; font: 400 12px/1.5 var(--mono); color: rgba(232, 235, 231, .45); text-align: center; }
.reader-foot .icon { width: 14px; height: 14px; }
.mark-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 90px 70px; padding: 40px; transform: rotate(-24deg) scale(1.4); transform-origin: center; }
.mark-layer span { font: 600 15px var(--sans); color: rgba(128, 128, 128, .2); white-space: nowrap; }

@media (max-width: 860px) {
  .opts { grid-template-columns: 1fr; }
  .tiles.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-pics { grid-template-columns: 1fr 1fr; }
  .docx-page { padding: 24px 20px; }
  .reader-top { padding: 12px 14px; }
  .reader-top h1 { font-size: 18px; }
  .reader-main { padding: 14px 10px 30px; }
  .safety { font-size: 20px; letter-spacing: .02em; }
  .kit-code { font-size: 15.5px; }
  .search kbd.k { display: none; }
}
.nav-foot { display: none; margin: 22px 10px 0; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 8px; align-items: center; }
.nav-me { flex-basis: 100%; font-size: 13px; color: var(--ink-3); text-transform: none; }
@media (max-width: 860px) { .nav-foot { display: flex; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
