/* Q-Vault — product design system.
   ============================================================================================
   This is an application, not a website about an application. Three rules shape it.

   1. COLOUR NEVER DECORATES DATA. The only saturated colour anywhere near a value is one of
      three status hues — sealed, waiting, broken — reporting the state of something the reader
      must act on or trust. No brand accent on a link, a button, a chip or a cell.

      This rule used to read "colour only ever means status", applied to the whole interface, and
      that was too far: every surface became the same off-white, every edge the same hairline,
      and the result read as *not yet styled* rather than as restrained. So the CHROME — the
      rail, and only the rail — is now a dark achromatic surface. It carries no hue and therefore
      still means nothing, but it gives the product a spine, and it makes the light working
      surfaces read as instrument panels rather than as paper.

   2. THE INTERFACE EXPLAINS NOTHING. It shows work and affords action. Cryptographic fact —
      algorithms, fingerprints, key states, verification results — appears as ordinary product
      metadata in tables and detail panels, the way a serious operations console shows it, never
      as a lesson. Every word of explanation lives in /docs.

   3. EVERY SCREEN HAS EXACTLY ONE MOMENT OF SCALE. A dense interface with no contrast anywhere
      is unreadable in a different way from a cluttered one: nothing is first. Each screen puts
      its single most important figure in `.head__figure` at ~1.6rem mono — the tally on a
      decision, the Merkle root on Audit, the pass count on Security — and nothing else on that
      screen competes.

   Density is the point. Rows are ~38px, body type is .875rem, and a screen is expected to carry
   fifty rows a user scans rather than one sentence a user reads. That is a claim about the DATA
   as much as the CSS: a console showing two rows is not dense, it is empty, and no amount of
   type scale will fix it.
   ============================================================================================ */

:root {
  --paper:    #FBFBF9;
  --surface:  #FFFFFF;
  --sunk:     #F5F5F2;
  --sunk-2:   #EFEFEB;
  --rule:     #E2E2DC;
  --rule-2:   #EDEDE8;
  --ink:      #16181C;
  --ink-2:    #4A4E56;
  --ink-3:    #6A6F78;

  /* Chrome. Achromatic on purpose — near-black with a barely-perceptible cool cast, so it reads
     as an instrument surface without introducing a hue that would compete with status. */
  --chrome:      #15191C;
  --chrome-2:    #22282C;
  --chrome-rule: #2B3237;
  --chrome-ink:  #ECEEED;
  --chrome-ink-2:#98A1A6;

  --sealed:      #1B6B4F;
  --sealed-tint: #EAF3EE;
  --sealed-line: #B9D8C8;
  --waiting:      #8A5A12;
  --waiting-tint: #FAF2E4;
  --waiting-line: #E8D4AC;
  --broken:      #A82D20;
  --broken-tint: #FBECEA;
  --broken-line: #EFC4BE;

  --display: 'Archivo', 'Inter', system-ui, sans-serif;
  --sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius:  4px;
  --side-w:  216px;
  --row-h:   38px;
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .875rem;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -0.005em; line-height: 1.2; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--rule); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 2px; }

.mono, code, .num { font-family: var(--mono); font-size: .78rem; }
.muted { color: var(--ink-3); }
.dim   { color: var(--ink-2); }
.small { font-size: .8rem; }
.tiny  { font-size: .72rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.push  { margin-left: auto; }
.measure { max-width: 68ch; }

.label {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-3);
}

/* ============================================================================================
   SHELL — a fixed left rail. The single strongest signal that this is software you work in
   rather than a site you read: navigation is always present and never scrolls away.
   ============================================================================================ */

.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

.side {
  background: var(--chrome); color: var(--chrome-ink-2);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__brand {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--chrome-rule);
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  color: var(--chrome-ink); letter-spacing: -0.01em;
}
.side__brand:hover { text-decoration: none; }
.side__nav { padding: .6rem .5rem; display: flex; flex-direction: column; gap: 1px; }
.side__link {
  display: flex; align-items: center; gap: .55rem;
  padding: .4rem .55rem; border-radius: var(--radius);
  color: var(--chrome-ink-2); font-size: .84rem; font-weight: 500;
  position: relative;
}
.side__link:hover { background: var(--chrome-2); color: var(--chrome-ink); text-decoration: none; }
.side__link[aria-current="page"] { background: var(--chrome-2); color: var(--chrome-ink); font-weight: 600; }
/* A flush marker on the current item: position in the rail, stated once, achromatically. */
.side__link[aria-current="page"]::before {
  content: ""; position: absolute; left: -.5rem; top: .25rem; bottom: .25rem;
  width: 2px; background: var(--chrome-ink); border-radius: 0 1px 1px 0;
}
.side__link svg { flex: 0 0 auto; opacity: .6; }
.side__link[aria-current="page"] svg { opacity: 1; }

/* The badge is the only place a count is allowed to be loud, because it is the one number that
   means "you personally are blocking something". */
.side__badge {
  margin-left: auto; font-family: var(--mono); font-size: .68rem; font-weight: 600;
  background: var(--waiting); color: #fff; border-radius: 9px; padding: 0 .35rem; min-width: 17px;
  text-align: center; line-height: 17px;
}
.side__sep { height: 1px; background: var(--chrome-rule); margin: .55rem .55rem; }
.side__foot { margin-top: auto; padding: .7rem 1rem; border-top: 1px solid var(--chrome-rule); }

.side__user { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.side__user .small { color: var(--chrome-ink); }
.side__user .muted { color: var(--chrome-ink-2); }
.side__avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  background: var(--chrome-2); border: 1px solid var(--chrome-rule);
  display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: var(--chrome-ink);
}
/* The sign-out control lives on chrome, so it cannot use the light ghost button. */
.side .btn--ghost {
  background: transparent; border-color: var(--chrome-rule); color: var(--chrome-ink-2);
}
.side .btn--ghost:hover { background: var(--chrome-2); border-color: var(--chrome-ink-2); color: var(--chrome-ink); }
.side :focus-visible { outline-color: var(--chrome-ink); }

/* min-height so the signed-OUT shell (which has no .app grid to inherit from) can centre its
   content instead of pinning it to the top of a mostly empty viewport. */
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* Page header: title, context, the screen's one figure, and its actions. */
.head {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .85rem 1.5rem; border-bottom: 1px solid var(--rule); background: var(--surface);
}
.head__title { font-family: var(--display); font-size: 1.3rem; font-weight: 700;
                letter-spacing: -0.015em; line-height: 1.15; }
.head__sub { font-size: .78rem; color: var(--ink-3); }
.head__actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* Rule 3: the one moment of scale on the screen. A figure, not a label — if a screen has no
   single number worth this much room, it should not use the component, and a screen that has a
   `.figures` strip already has its moment and should not use this as well. */
.head__figure { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05;
                padding-right: .9rem; margin-right: .1rem; border-right: 1px solid var(--rule); }
.head__figure b { font-family: var(--mono); font-size: 1.5rem; font-weight: 600;
                  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.head__figure span { font-size: .6rem; text-transform: uppercase; letter-spacing: .07em;
                     font-weight: 700; color: var(--ink-3); margin-top: .2rem; white-space: nowrap; }
.head__figure--sealed b { color: var(--sealed); }
.head__figure--broken b { color: var(--broken); }

.crumbs { font-size: .78rem; color: var(--ink-3); display: flex; gap: .35rem; align-items: center; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

.body { padding: 1.25rem 1.5rem 3rem; flex: 1; }
.body--flush { padding: 0 0 3rem; }

/* ============================================================================================
   TOOLBAR — search, filters, sort. Persistent, compact, and never below the fold.
   ============================================================================================ */

.toolbar {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  padding: .6rem 1.5rem; border-bottom: 1px solid var(--rule); background: var(--surface);
}
.toolbar__search { position: relative; flex: 1 1 15rem; max-width: 26rem; }
.toolbar__search input { padding-left: 1.9rem; }
.toolbar__search svg { position: absolute; left: .55rem; top: 50%; transform: translateY(-50%);
                       opacity: .5; pointer-events: none; }
.toolbar__count { margin-left: auto; font-size: .76rem; color: var(--ink-3); white-space: nowrap; }

.tabs { display: flex; gap: 0; padding: 0 1.5rem; border-bottom: 1px solid var(--rule);
        background: var(--surface); overflow-x: auto; }
.tab {
  padding: .55rem .75rem; font-size: .82rem; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab__n { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); margin-left: .3rem; }

/* ============================================================================================
   DATA TABLE — the workhorse. Dense rows, sticky header, whole-row targets.
   ============================================================================================ */

.dt { width: 100%; border-collapse: collapse; }
.dt th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-3); white-space: nowrap;
  padding: .45rem .75rem; background: var(--sunk); border-bottom: 1px solid var(--rule);
}
.dt th a { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.dt th a:hover { color: var(--ink); text-decoration: none; }
.dt td {
  padding: 0 .75rem; height: var(--row-h); border-bottom: 1px solid var(--rule-2);
  vertical-align: middle; background: var(--surface);
}
.dt tbody tr:hover td { background: var(--sunk); }
/* :first-child, not every cell — applied to every td it drew a 2px amber bar down the left of
   each column, which reads as fake column rules rather than as one marked row. */
.dt tbody tr.is-unread td:first-child { box-shadow: inset 2px 0 0 var(--waiting); }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
/* .num is a mono treatment for VALUES. A th is a label, so it keeps the header face — otherwise
   right-aligned headers render in JetBrains Mono beside Inter ones in the same row. */
.dt th.num { font-family: var(--sans); font-size: .68rem; letter-spacing: .08em; }
.dt__link { font-weight: 500; display: block; }
.dt__link:hover { text-decoration: underline; }
.dt__sub { display: block; font-size: .74rem; color: var(--ink-3); }
.dt--fixed { table-layout: fixed; }

/* A table that scrolls sideways rather than forcing the page to.
   Note the interaction with `.dt th { position: sticky }`: per CSS Overflow 3, setting one axis
   to a non-visible value makes the other compute to `auto`, so this wrapper becomes the nearest
   scrollport — and with no height constraint it is zero-height, which pins the header to a box
   that never scrolls. Sticky headers therefore need `--tall`, which gives it a real height. */
.scroll-x { overflow-x: auto; }
.scroll-x--tall { max-height: calc(100vh - 8.5rem); overflow: auto; }

.pager {
  display: flex; align-items: center; gap: .5rem; justify-content: flex-end;
  padding: .6rem 1.5rem; border-top: 1px solid var(--rule); font-size: .78rem; color: var(--ink-3);
}

/* ============================================================================================
   EMPTY STATES — an invitation to act, never an explanation of a concept.
   ============================================================================================ */

.empty { padding: 3rem 1.5rem; text-align: center; }
.empty__title { font-family: var(--display); font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.empty__sub { font-size: .82rem; color: var(--ink-3); margin: 0 auto 1rem; max-width: 40ch; }

/* ============================================================================================
   PANELS & DETAIL LAYOUT
   ============================================================================================ */

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel__head {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .85rem; border-bottom: 1px solid var(--rule); background: var(--sunk);
}
.panel__body { padding: .85rem; }
.panel__body > :last-child { margin-bottom: 0; }
.panel + .panel { margin-top: 1rem; }
/* .stack already spaces its children with `gap`, so the adjacency margin doubled it to 2rem
   everywhere panels are stacked — which is most of the detail screens. */
.stack > .panel + .panel { margin-top: 0; }

.split { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 68rem) {
  .split { grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; }
  .split--wide { grid-template-columns: minmax(0, 1fr) 25rem; }
  .split--even { grid-template-columns: 1fr 1fr; }
}
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hstack { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hstack--tight { gap: .3rem; }
.fill { flex: 1 1 12rem; min-width: 0; }
.divider { height: 1px; background: var(--rule-2); margin: .75rem 0; border: 0; }

/* Inline metadata: the standard way cryptographic fact appears on a detail screen. */
.meta { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .35rem .8rem; margin: 0; }
.meta dt { font-size: .72rem; color: var(--ink-3); align-self: center; }
.meta dd { margin: 0; font-size: .8rem; align-self: center; min-width: 0; overflow-wrap: anywhere; }

/* ============================================================================================
   STATUS ATOMS — these carry colour because they ARE status.
   ============================================================================================ */

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 600; padding: .05rem .4rem; border-radius: 2px;
  border: 1px solid var(--rule); background: var(--sunk); color: var(--ink-2); white-space: nowrap;
}
.chip--sealed  { color: var(--sealed);  background: var(--sealed-tint);  border-color: var(--sealed-line); }
.chip--waiting { color: var(--waiting); background: var(--waiting-tint); border-color: var(--waiting-line); }
.chip--broken  { color: var(--broken);  background: var(--broken-tint);  border-color: var(--broken-line); }

.dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.dot--sealed { background: var(--sealed); }
.dot--waiting { background: var(--waiting); }
.dot--broken { background: var(--broken); }

/* Machine identifiers — algorithm names, backends, key ids. Grey: a fact, not a status. */
.tag {
  display: inline-flex; align-items: center; font-family: var(--mono); font-size: .7rem;
  padding: .02rem .3rem; border-radius: 2px;
  background: var(--sunk); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap;
}
.hash {
  font-family: var(--mono); font-size: .7rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 2px;
  padding: .02rem .28rem; cursor: pointer;
}
.hash:hover { border-color: var(--ink-3); color: var(--ink); }
.hash.copied { color: var(--sealed); border-color: var(--sealed-line); background: var(--sealed-tint); }

/* Threshold as countable slots. A quorum is a number of people, not a percentage. */
.tally { display: inline-flex; gap: 2px; vertical-align: middle; }
.tally__slot { width: 13px; height: 7px; border-radius: 1px; background: var(--surface); border: 1px solid var(--rule); }
.tally__slot--approve { background: var(--sealed); border-color: var(--sealed); }
.tally__slot--reject  { background: var(--broken); border-color: var(--broken); }
.tally__slot--needed  { background: repeating-linear-gradient(135deg, var(--ink-3) 0 1px, transparent 1px 4px);
                        border-color: var(--ink-3); }

/* ============================================================================================
   STATUS BANNER — survives in exactly one place: an integrity failure. Everything else reports
   state in a chip. A product does not shout a sentence at you on every screen; it shouts when
   the record it exists to protect has been altered.
   ============================================================================================ */

.banner {
  display: flex; align-items: flex-start; gap: .7rem;
  border: 1px solid var(--rule); border-left: 3px solid var(--ink-3);
  border-radius: var(--radius); background: var(--surface);
  padding: .7rem .9rem; margin-bottom: 1rem;
}
.banner__title { font-family: var(--display); font-weight: 700; font-size: .92rem; }
.banner__body  { font-size: .8rem; color: var(--ink-2); margin-top: .1rem; }
.banner__body > :last-child { margin-bottom: 0; }
.banner--sealed  { border-color: var(--sealed-line);  border-left-color: var(--sealed);  background: var(--sealed-tint); }
.banner--waiting { border-color: var(--waiting-line); border-left-color: var(--waiting); background: var(--waiting-tint); }
.banner--broken  { border-color: var(--broken-line);  border-left-color: var(--broken);  background: var(--broken-tint); }
.banner--sealed .banner__title  { color: var(--sealed); }
.banner--waiting .banner__title { color: var(--waiting); }
.banner--broken .banner__title  { color: var(--broken); }
.banner__actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; flex: 0 0 auto; }

/* ============================================================================================
   FIGURES — where a number is genuinely the content.
   ============================================================================================ */

/* The separators are the GRID GAP, not per-cell borders. With `border-right` the last cell of a
   wrapped row kept a rule it should not have, and an incomplete final row left a bordered void —
   which is exactly what the landing page was rendering. Gap-as-rule cannot get that wrong,
   because a gap only exists between two cells that are actually adjacent. */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
           gap: 1px; background: var(--rule-2);
           border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.figure { padding: .7rem .85rem; background: var(--surface); }
.figure__num { font-family: var(--mono); font-size: 1.15rem; font-weight: 600;
               letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
/* A hash IS the figure here, so it takes the figure's scale rather than the small bordered chip
   treatment — otherwise one cell in a row of four large numerals holds a tiny boxed string. */
.figure__num .hash { font-size: inherit; font-weight: inherit; letter-spacing: inherit;
                     border: 0; background: none; padding: 0; color: inherit; }
.figure__num .hash:hover { color: var(--ink-3); }
.figure__label { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.figure__sub { font-size: .7rem; color: var(--ink-3); font-family: var(--mono); }

.bar { background: var(--rule-2); border-radius: 1px; height: 5px; overflow: hidden; min-width: 50px; }
.bar__fill { height: 100%; background: var(--ink-2); }
.bar__fill--alt { background: var(--ink-3); }

/* ============================================================================================
   BUTTONS — greyscale. An action is not a status.
   ============================================================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font-family: var(--sans); font-size: .8rem; font-weight: 600; line-height: 1.3;
  padding: .35rem .7rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .1s, border-color .1s, color .1s;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #000; color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--sunk); }
.btn--quiet { background: transparent; color: var(--ink-3); padding: .2rem .35rem; }
.btn--quiet:hover { background: var(--sunk); color: var(--ink); }
.btn--danger { background: var(--surface); border-color: var(--broken-line); color: var(--broken); }
.btn--danger:hover { background: var(--broken-tint); border-color: var(--broken); }
.btn--sealed { background: var(--surface); border-color: var(--sealed-line); color: var(--sealed); }
.btn--sealed:hover { background: var(--sealed-tint); border-color: var(--sealed); }
.btn--sm { font-size: .74rem; padding: .2rem .45rem; }
.btn--block { width: 100%; }

/* ============================================================================================
   FORMS
   ============================================================================================ */

.field { margin-bottom: .7rem; }
.field__label { display: block; font-size: .76rem; font-weight: 600; color: var(--ink-2); margin-bottom: .2rem; }
.field__help  { font-size: .74rem; color: var(--ink-3); margin: .2rem 0 0; }
.field__error { font-size: .74rem; color: var(--broken); margin: .2rem 0 0; }

.input, .form-control, .form-select, select, textarea {
  display: block; width: 100%;
  font-family: var(--sans); font-size: .82rem; line-height: 1.4;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .32rem .5rem; height: 30px;
}
textarea, textarea.input { height: auto; min-height: 5.5rem; resize: vertical; padding: .4rem .5rem; }
.input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.input::placeholder { color: var(--ink-3); }
.input--auto { width: auto; min-width: 8rem; }
input[type="checkbox"] { accent-color: var(--ink); width: 14px; height: 14px; }

.downgrade { border: 1px solid var(--broken-line); background: var(--broken-tint);
             border-radius: var(--radius); padding: .6rem .7rem; margin: .5rem 0; }

/* ============================================================================================
   FLASH MESSAGES
   ============================================================================================ */

.alert {
  display: flex; align-items: flex-start; gap: .6rem;
  border: 1px solid var(--rule); border-left: 3px solid var(--ink-3); border-radius: var(--radius);
  background: var(--surface); padding: .5rem .75rem; margin-bottom: .8rem; font-size: .82rem;
}
.alert-success { border-color: var(--sealed-line);  border-left-color: var(--sealed);  background: var(--sealed-tint);  color: var(--sealed); }
.alert-warning { border-color: var(--waiting-line); border-left-color: var(--waiting); background: var(--waiting-tint); color: var(--waiting); }
.alert-danger  { border-color: var(--broken-line);  border-left-color: var(--broken);  background: var(--broken-tint);  color: var(--broken); }
.alert .btn-close { margin-left: auto; background: none; border: 0; cursor: pointer; padding: 0;
                    font-size: 1rem; line-height: 1; color: inherit; opacity: .5; }
.alert .btn-close:hover { opacity: 1; }

/* ============================================================================================
   DOCS — the one place with prose, so the one place with a reading measure.
   ============================================================================================ */

.doc { max-width: 68ch; font-size: .92rem; line-height: 1.65; }
.doc h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
.doc h3 { font-size: 1rem; margin: 1.75rem 0 .4rem; }
.doc p, .doc ul, .doc ol { margin: 0 0 .9rem; }
.doc ul, .doc ol { padding-left: 1.2rem; }
.doc li { margin-bottom: .3rem; }
.doc code { background: var(--sunk); border: 1px solid var(--rule); border-radius: 2px; padding: 0 .25rem; }
.doc .pre { background: var(--sunk); border: 1px solid var(--rule); border-radius: 4px;
            padding: .7rem .85rem; overflow-x: auto; margin: 0 0 .9rem;
            font-family: var(--mono); font-size: .78rem; line-height: 1.5; }
.doc .pre code { background: none; border: 0; padding: 0; }
.doc table { margin-bottom: 1rem; }
.doc__nav { display: flex; flex-direction: column; gap: 1px; }
.doc__nav a { padding: .35rem .55rem; border-radius: var(--radius); font-size: .82rem; color: var(--ink-2); }
.doc__nav a:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.doc__nav a[aria-current="page"] { background: var(--sunk-2); color: var(--ink); font-weight: 600; }

/* Developer tools sit behind a dashed edge so nobody mistakes a demonstration switch for a
   feature of the product. */
.dev { border-style: dashed; }

/* ============================================================================================
   SIGNED OUT — no navigation rail to inherit, so these pages stand on their own.
   ============================================================================================ */

/* The signed-out shell has no `.app` grid, so `.body { flex: 1 }` had nothing to grow into and
   every auth page pinned its form to the top of a 63%-empty viewport. `.main` now carries
   min-height and this centres within it. */
.body--anon { display: grid; place-items: center; }

/* A footer rail for the signed-out pages. Without it /login and /register are dead ends with no
   route to the public verifier that the landing page advertises as needing no account. */
.anonbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.5rem; border-top: 1px solid var(--rule); background: var(--surface);
  font-size: .76rem; color: var(--ink-3);
}
.anonbar a { color: var(--ink-3); }
.anonbar a:first-child { font-family: var(--display); font-weight: 700; color: var(--ink); }
.anonbar a:hover { color: var(--ink); }

.auth { max-width: 21rem; margin: 0 auto; width: 100%; }
.auth__mark { display: flex; align-items: center; gap: .5rem; font-family: var(--display);
              font-weight: 700; font-size: 1rem; margin-bottom: 1.5rem; }
.auth__title { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; }
.auth__foot { margin-top: 1rem; }

.landing { max-width: 44rem; margin: 0 auto; text-align: center; }
.landing__mark { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display);
                 font-weight: 700; font-size: 1.05rem; margin-bottom: 2rem; }
.landing__title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.12;
                  letter-spacing: -0.015em; margin-bottom: .85rem; }
.landing__lead { color: var(--ink-2); font-size: .95rem; max-width: 34rem; margin: 0 auto 1.75rem; }
.landing__figures { text-align: left; }

/* ============================================================================================
   VERIFY — reachable without an account, so it works with or without the rail.
   ============================================================================================ */

.verify { max-width: 44rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.verify__head { margin-bottom: .25rem; }
.verify__title { font-family: var(--display); font-size: 1.35rem; font-weight: 700;
                 letter-spacing: -0.01em; margin: 0 0 .2rem; }
.verify__lead { color: var(--ink-3); font-size: .85rem; margin: 0; }
.verify__more { margin: .25rem 0 .9rem; }
.verify__more > summary { font-size: .78rem; color: var(--ink-3); cursor: pointer;
                          padding: .2rem 0; user-select: none; }
.verify__more > summary:hover { color: var(--ink); }
.verify__foot { text-align: center; margin: 0; }

/* The checks ARE the explanation — each row states one step of the argument, so the list is
   the only place on this page allowed to read as prose. */
.checks { list-style: none; margin: 0; padding: 0; counter-reset: check; }
.checks__row { display: flex; gap: .7rem; align-items: baseline;
               padding: .55rem .9rem; border-top: 1px solid var(--rule-2); }
.checks__row:first-child { border-top: 0; }
.checks__mark { flex: 0 0 1rem; text-align: center; font-weight: 700; font-size: .9rem;
                line-height: 1.2; }
.checks__row.is-ok      .checks__mark { color: var(--sealed); }
.checks__row.is-bad     .checks__mark { color: var(--broken); }
.checks__row.is-skipped .checks__mark { color: var(--ink-3); }
.checks__text { min-width: 0; }
.checks__title { display: block; font-size: .84rem; }
.checks__row.is-bad .checks__title { color: var(--broken); font-weight: 600; }
.checks__detail { display: block; font-family: var(--mono); font-size: .72rem;
                  color: var(--ink-3); margin-top: .12rem; word-break: break-word; }

/* ============================================================================================
   RESPONSIVE — the rail becomes a top bar below the breakpoint.
   ============================================================================================ */

@media (max-width: 60rem) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .side__nav { flex-direction: row; flex-wrap: wrap; }
  .side__link[aria-current="page"]::before { display: none; }
  .side__sep { display: none; }
  .side__foot { margin-top: 0; }
  .head, .toolbar, .tabs, .body, .pager { padding-left: 1rem; padding-right: 1rem; }
  .head__title { font-size: 1.15rem; }
  .head__figure b { font-size: 1.25rem; }
}

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