/*
 * Mechanical Bench — stylesheet.
 *
 * This is the v0.1 prototype's visual system, brought across to the live app:
 * slate and teal, Archivo for display, IBM Plex Sans for body, IBM Plex Mono
 * for every figure. Light and dark are both real. Dark is for a workshop;
 * light is for the projector in the room where promotions get decided.
 *
 * COLOUR DOCTRINE — the one rule to hold on to:
 *
 *   ok    (green)  a requirement is met.
 *   warn  (amber)  outstanding. Not done YET. This is the ordinary state of a
 *                  career in progress and it is NOT a failure. Most of what is
 *                  on these screens most of the time should be amber, and that
 *                  is fine.
 *   crit  (red)    something is wrong RIGHT NOW: a lapsed safety certificate,
 *                  work a person is not currently permitted to do. If red is
 *                  on the screen, somebody should act today.
 *
 * The prototype marked every unmet gate red. That reads as a verdict on the
 * person rather than a description of the work left, so gates are amber here
 * and red is kept for things that have actually expired.
 *
 * Fonts are served from /fonts, not from Google. This is an offline-first PWA
 * for people standing next to an engine; a stylesheet that phones a third
 * party for its typeface is both a privacy leak and a blank screen on a site
 * with no signal.
 */

@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/archivo-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/archivo-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/fonts/archivo-latin-800-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

/* ── tokens ────────────────────────────────────────────────────────────── */
:root {
  --ground:#e9eef1;
  --surface:#ffffff;
  --surface-2:#f4f7f9;
  --surface-3:#eaeff2;
  --line:#ccd6dc;
  --line-soft:#e0e7eb;
  --ink:#111a1f;
  --ink-2:#47565f;
  --ink-3:#75848d;
  --accent:#0b6b75;
  --accent-2:#0e8a96;
  --accent-wash:#dfeef0;
  --ok:#2c7a4e;
  --ok-wash:#dcefe3;
  --warn:#8a5a12;
  --warn-wash:#f6e9d4;
  --crit:#a3352f;
  --crit-wash:#f6dedc;
  /* The level scale. Five steps of one hue, so a row of cells reads as a
     gradient rather than a set of unrelated colours — that is what makes a
     thin row visible from across a meeting room. */
  --l0:#e6ebee;
  --l1:#d5e6e7;
  --l2:#a7ccd0;
  --l3:#6aadb4;
  --l4:#218a95;
  --l5:#0a5c67;
  --l0-t:#8d99a1;
  --l1-t:#2a4247;
  --l2-t:#173438;
  --l3-t:#08242a;
  --l4-t:#ffffff;
  --l5-t:#ffffff;
  --hatch:rgba(0,0,0,.22);
  --shadow:0 1px 2px rgba(16,30,38,.06), 0 6px 20px -10px rgba(16,30,38,.22);
  --shadow-lift:0 2px 6px rgba(16,30,38,.10), 0 22px 48px -18px rgba(16,30,38,.36);
  --sans:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --disp:"Archivo","IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color-scheme: light dark;
}

/* Dark by system preference, unless the page has been pinned to light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:#0c1215;
    --surface:#151e23;
    --surface-2:#1a242a;
    --surface-3:#202c33;
    --line:#2a3941;
    --line-soft:#212e35;
    --ink:#e7eef1;
    --ink-2:#9daab3;
    --ink-3:#74848d;
    --accent:#3fb0ba;
    --accent-2:#5cc7d1;
    --accent-wash:#12333a;
    --ok:#5cc186;
    --ok-wash:#14301f;
    --warn:#d5a154;
    --warn-wash:#33260f;
    --crit:#e0736c;
    --crit-wash:#361a19;
    --l0:#1c262c;
    --l1:#1e343a;
    --l2:#2a5760;
    --l3:#377f8a;
    --l4:#48a7b2;
    --l5:#78d5de;
    --l0-t:#6a7880;
    --l1-t:#93b3ba;
    --l2-t:#d3ecf0;
    --l3-t:#f0fbfd;
    --l4-t:#04262b;
    --l5-t:#04262b;
    --hatch:rgba(255,255,255,.24);
    --shadow:0 1px 2px rgba(0,0,0,.5), 0 6px 20px -10px rgba(0,0,0,.7);
    --shadow-lift:0 2px 6px rgba(0,0,0,.5), 0 22px 48px -18px rgba(0,0,0,.85);
  }
}
:root[data-theme="dark"] {
  --ground:#0c1215;
  --surface:#151e23;
  --surface-2:#1a242a;
  --surface-3:#202c33;
  --line:#2a3941;
  --line-soft:#212e35;
  --ink:#e7eef1;
  --ink-2:#9daab3;
  --ink-3:#74848d;
  --accent:#3fb0ba;
  --accent-2:#5cc7d1;
  --accent-wash:#12333a;
  --ok:#5cc186;
  --ok-wash:#14301f;
  --warn:#d5a154;
  --warn-wash:#33260f;
  --crit:#e0736c;
  --crit-wash:#361a19;
  --l0:#1c262c;
  --l1:#1e343a;
  --l2:#2a5760;
  --l3:#377f8a;
  --l4:#48a7b2;
  --l5:#78d5de;
  --l0-t:#6a7880;
  --l1-t:#93b3ba;
  --l2-t:#d3ecf0;
  --l3-t:#f0fbfd;
  --l4-t:#04262b;
  --l5-t:#04262b;
  --hatch:rgba(255,255,255,.24);
  --shadow:0 1px 2px rgba(0,0,0,.5), 0 6px 20px -10px rgba(0,0,0,.7);
  --shadow-lift:0 2px 6px rgba(0,0,0,.5), 0 22px 48px -18px rgba(0,0,0,.85);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 20px 72px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.note { color: var(--ink-2); font-size: 13px; }
.muted { color: var(--ink-3); }
.eyebrow {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── boot / loading ────────────────────────────────────────────────────── */
.boot {
  min-height: 60vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; color: var(--ink-3);
}
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-spinner { animation: none; } }

/* ── header ────────────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.masthead .wrap { padding-top: 0; padding-bottom: 0; }
.mast-row { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; min-width: 0; }
.brand h1 {
  font-family: var(--disp); font-weight: 800; font-size: 17px; letter-spacing: -.015em;
  margin: 0; color: var(--ink); white-space: nowrap;
}
.brand .tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px;
  white-space: nowrap;
}
.who { text-align: right; line-height: 1.25; min-width: 0; }
.who-name { font-family: var(--disp); font-weight: 600; font-size: 13px; }
.who-role {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}

.seg { display: flex; background: var(--surface-3); border-radius: 7px; padding: 3px; gap: 2px; }
.seg button {
  font-family: var(--disp); font-weight: 600; font-size: 12.5px; letter-spacing: .01em;
  border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 14px; border-radius: 5px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  font-family: var(--disp); font-weight: 600; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 7px 13px; border-radius: 7px; cursor: pointer;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  width: 100%; padding: 11px; font-size: 14px;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-primary[disabled] { opacity: .6; cursor: progress; }

/* ── environment banner ────────────────────────────────────────────────── */
.envbar {
  text-align: center; padding: 6px 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--warn-wash); color: var(--warn);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
}
.demo-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 0; padding: 9px 14px; border-radius: 8px;
  background: var(--warn-wash); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  color: var(--warn); font-size: 12.5px;
}
.demo-strip strong { font-family: var(--disp); font-weight: 700; }

/* ── panels ────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-hd {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.panel-hd h2 { font-family: var(--disp); font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin: 0; }
.panel-hd .sub { color: var(--ink-3); font-size: 12.5px; margin-left: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-top: 16px; }

/* ── controls ──────────────────────────────────────────────────────────── */
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--disp); font-weight: 600; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 6px 13px; border-radius: 20px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: #04262b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip[aria-pressed="true"] { color: #04262b; }
}
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select, input[type="text"], input[type="email"], input[type="password"] {
  font-family: var(--sans); font-size: 13px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 11px;
}
select { font-family: var(--disp); font-weight: 600; cursor: pointer; }
select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── matrix ────────────────────────────────────────────────────────────── */
.matrix-scroll { overflow-x: auto; }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; }
table.matrix th, table.matrix td { padding: 0; }
.grp-th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; text-align: left;
  padding: 12px 8px 5px !important; border-bottom: 1px solid var(--line-soft);
}
.code-th {
  font-family: var(--disp); font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--ink-2); text-align: center; padding: 5px 2px 9px !important;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.code-th.mand::after { content: "•"; color: var(--crit); margin-left: 2px; font-size: 13px; line-height: 0; }
.name-th {
  text-align: left; padding: 12px 14px 9px !important; border-bottom: 1px solid var(--line);
  position: sticky; left: 0; background: var(--surface); z-index: 2;
}
.eng-td {
  position: sticky; left: 0; background: var(--surface); z-index: 2;
  border-bottom: 1px solid var(--line-soft); padding: 0 !important;
}
.eng-btn {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  cursor: pointer; padding: 7px 14px; font-family: inherit; color: inherit;
}
.eng-btn:hover { background: var(--surface-2); }
.eng-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.eng-name { display: block; font-family: var(--disp); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.eng-meta { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; margin-top: 1px; }
.cell-td { border-bottom: 1px solid var(--line-soft); padding: 2px 1px !important; text-align: center; }
.cell {
  width: 100%; min-width: 34px; height: 30px; border: 0; border-radius: 3px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 3; }
/* Held once, out of currency now. Hatched rather than blanked, because a blank
   cell says "never did this" and that is the opposite of the truth.
   The hatch alone is not enough: --hatch is one colour for the whole theme, so
   on a dark level-5 fill in light mode it disappears. The amber ring is what
   actually carries the meaning, and amber is the right colour for it — this is
   outstanding work, not a fault. */
.stale {
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--hatch) 3px 5px);
  box-shadow: inset 0 0 0 1.5px var(--warn);
}
.grp-sep { border-left: 1px solid var(--line); }

.legend { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.lg-scale { display: flex; align-items: center; gap: 4px; }
.lg-sw {
  width: 26px; height: 16px; border-radius: 2px; display: inline-flex;
  align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; font-weight: 600;
}
.lg-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }

/* ── rows / pills ──────────────────────────────────────────────────────── */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.rows .row:last-child { border-bottom: 0; }
.row .who2 { font-family: var(--disp); font-weight: 600; font-size: 13px; }
.row .what { color: var(--ink-2); font-size: 12.5px; }
.row .right { margin-left: auto; text-align: right; }
.pill {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 3px; white-space: nowrap; text-transform: uppercase;
  display: inline-block;
}
.pill.ok   { background: var(--ok-wash);   color: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.crit { background: var(--crit-wash); color: var(--crit); }
.pill.mute { background: var(--surface-3); color: var(--ink-3); }
.pill.code { background: var(--accent-wash); color: var(--accent); text-transform: none; }
.stripe { width: 3px; align-self: stretch; border-radius: 2px; flex: 0 0 3px; min-height: 30px; }
.stripe.ok { background: var(--ok); }
.stripe.warn { background: var(--warn); }
.stripe.crit { background: var(--crit); }
.stripe.mute { background: var(--line); }

/* ── coverage bars ─────────────────────────────────────────────────────── */
.cov { display: flex; flex-direction: column; }
.cov-row { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.cov-row:last-child { border-bottom: 0; }
.cov-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.cov-name { font-family: var(--disp); font-weight: 600; font-size: 13.5px; }
.cov-note { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: auto; }
.bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: var(--l0); }
.bar span { display: block; }
.cov-key { display: flex; gap: 14px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.cov-key b { font-family: var(--mono); font-weight: 600; color: var(--ink-2); }

/* ── engineer view ─────────────────────────────────────────────────────── */
.eng-hd { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 22px 0 4px; }
.eng-hd h2 { font-family: var(--disp); font-weight: 800; font-size: 26px; letter-spacing: -.02em; margin: 0; }
.eng-hd .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-bottom: 4px; }
.ladder { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; flex-wrap: wrap; }
.rung {
  font-family: var(--disp); font-weight: 600; font-size: 12.5px; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--ink-3); background: var(--surface); white-space: nowrap;
}
.rung.now { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.rung.next { border-color: var(--accent); color: var(--accent); border-style: dashed; }
.arrow { color: var(--ink-3); font-family: var(--mono); }

.verdict { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding: 16px 18px; }
.dial { flex: 0 0 auto; }
.verdict-txt { flex: 1 1 240px; min-width: 0; }
.verdict-txt h3 { font-family: var(--disp); font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.gates { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.gate { display: flex; align-items: center; gap: 11px; padding: 9px 18px; border-bottom: 1px solid var(--line-soft); }
.gate:last-child { border-bottom: 0; }
.gate .g-name { font-size: 13px; min-width: 0; }
.gate .g-name b { font-family: var(--disp); font-weight: 600; }
.gate .g-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mini { width: 56px; height: 6px; border-radius: 3px; background: var(--l0); overflow: hidden; flex: 0 0 56px; }
.mini span { display: block; height: 100%; background: var(--warn); }
.mini span.done { background: var(--ok); }

.gap-list { display: flex; flex-direction: column; }
.gap { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); }
.gap:last-child { border-bottom: 0; }
.gap .g-t { font-family: var(--disp); font-weight: 600; font-size: 13.5px; }
.gap .g-s { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.gap .g-a { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.gap .g-n { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; text-align: right; }
.lvlstep { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.lvlstep .to { color: var(--ink); }

/* ── drawer ────────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(8,16,20,.5); z-index: 50; display: flex; justify-content: flex-end; }
.scrim[hidden] { display: none !important; }
.drawer {
  width: min(560px, 100%); background: var(--surface); height: 100%; overflow-y: auto;
  box-shadow: var(--shadow-lift); border-left: 1px solid var(--line);
}
.drawer-hd {
  position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 16px 20px; display: flex; align-items: flex-start; gap: 14px; z-index: 1;
}
.drawer-hd h3 { font-family: var(--disp); font-weight: 700; font-size: 16px; margin: 0 0 2px; letter-spacing: -.01em; }
.x {
  margin-left: auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; flex: 0 0 28px;
}
.x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drawer-body { padding: 0 0 30px; }
.calc {
  margin: 16px 20px; padding: 13px 15px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; line-height: 1.75;
}
.calc .k { color: var(--ink-3); }
.calc .v { float: right; color: var(--ink); font-weight: 600; }
.calc hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.calc .line { clear: both; }
.ev { padding: 11px 20px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: flex-start; }
.ev .swr { font-family: var(--mono); font-size: 11.5px; color: var(--accent); font-weight: 600; flex: 0 0 auto; }
.ev .body { flex: 1 1 auto; min-width: 0; }
.ev .t { font-size: 13px; }
.ev .s { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }
.sec-lbl {
  padding: 16px 20px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ── login ─────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 380px; }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand h1 { font-family: var(--disp); font-weight: 800; font-size: 25px; letter-spacing: -.02em; margin: 0 0 4px; }
.field { margin-bottom: 13px; }
.field label {
  display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px;
}
.field input { width: 100%; }
.formerr {
  background: var(--crit-wash); color: var(--crit); border: 1px solid color-mix(in srgb, var(--crit) 35%, transparent);
  border-radius: 7px; padding: 9px 12px; font-size: 13px; margin-bottom: 13px;
}
.login-hint { margin-top: 16px; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

footer { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }

@media (prefers-reduced-motion: no-preference) {
  .cell, .chip, .eng-btn, .btn { transition: filter .12s ease, background .12s ease; }
  .cell:hover { filter: brightness(1.08); }
}

/* ── phone ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .wrap { padding: 0 14px 56px; }
  .mast-row { min-height: 54px; gap: 10px; padding: 8px 0; }
  .brand h1 { font-size: 15px; }
  .brand .tag { display: none; }
  .eng-hd h2 { font-size: 21px; }
  .verdict { gap: 14px; }
  .panel-hd .sub { margin-left: 0; flex-basis: 100%; }
  .drawer { width: 100%; }
  .legend { gap: 12px; }
  .legend .lg-item:last-child { display: none; }
}
