/* ECM – engagement compliance monitoring.
   A shared house palette, spacing, radii and components on a light surface,
   with no logo and no mark. Headings are set in the body face; the display
   face is used for the product's own name and nothing else.

   One colour rule matters because it is about contrast: orange TEXT on a light
   surface is Ember; the brighter orange is for fills and the focus ring only. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* The product's name, and only that, is set in the display face. */
@font-face {
  font-family: "Delius Unicase";
  src: url("/fonts/DeliusUnicase-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --orange: #FF7A00;
  --ember: #B34D00;
  --ink: #0B0B0B;
  --bone: #FAF7F2;
  --orange-100: #FFE8D1;

  --n-0: #FFFFFF; --n-50: #FAF7F2; --n-100: #F0ECE4; --n-200: #DFDAD0;
  --n-300: #C4BFB4; --n-400: #A7A39A; --n-500: #8A867D; --n-600: #6E6A62;
  --n-700: #4A473F; --n-800: #2A2825;

  --bg: var(--bone);
  --bg-raised: var(--n-0);
  --bg-sunken: var(--n-100);
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --text: var(--ink);
  --text-secondary: var(--n-600);
  --text-accent: var(--ember);

  --success: #2E7D4F; --warning: #8F5500; --danger: #C0341A; --info: #2B6CB0;
  --success-bg: #E4F1E9; --warning-bg: #FBEBD3; --danger-bg: #FBE4DF; --info-bg: #E1ECF7;

  /* Chart fills for the six states, checked for colour-blind separation in
     this order. Every segment is also named and counted in ink beside it. */
  --seg-overdue: #C0341A; --seg-due-soon: #E08A00; --seg-in-window: #2B6CB0;
  --seg-compliant: #2E7D4F; --seg-late: #8A5FB5; --seg-in-progress: #A7A39A;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(11, 11, 11, 0.06);
  --shadow-focus: 0 0 0 3px rgba(255, 122, 0, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s5); }
@media (max-width: 860px) { html { scroll-padding-top: 64px; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: var(--font); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 650; }
h3 { font-size: 0.9375rem; font-weight: 600; }
p { margin: 0 0 var(--s3); }
a { color: var(--text-accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.8125rem; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.lede { font-size: 1.0625rem; color: var(--n-700); max-width: 70ch; margin-top: var(--s2); }
.code, .item-code { font-family: var(--mono); font-size: 0.8125rem; }

/* — frame — */
.top {
  display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap;
  padding: var(--s3) var(--s5);
  background: var(--bg-raised); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); }
.wordmark { font-family: "Delius Unicase", var(--font); font-weight: 700; text-transform: lowercase; letter-spacing: 0; }
.wordmark::after { content: "."; color: var(--orange); }
.brand-name { font-size: 1.625rem; line-height: 1; padding-right: var(--s3); border-right: 1px solid var(--border-strong); }
.brand-words { display: flex; flex-direction: column; line-height: 1.25; }
.brand-descriptor { font-weight: 600; font-size: 0.8125rem; text-transform: capitalize; }
.brand-firm { color: var(--text-secondary); font-size: 0.75rem; }
.nav { display: flex; gap: var(--s1); flex-wrap: wrap; }
.nav a {
  padding: var(--s1) var(--s3); border-radius: var(--r-pill);
  color: var(--n-700); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--bg-sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bone); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; }
.ahead, .who { display: flex; align-items: center; gap: var(--s2); margin: 0; }
.ahead-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }
.who-role { display: block; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.2; }
.who strong { display: block; line-height: 1.2; }
.ahead-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s3) var(--s5);
  background: var(--ink); color: var(--bone);
}
.ahead-banner strong { color: var(--orange); }
.ahead-banner form { margin: 0; }
.page { width: 100%; max-width: 860px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); flex: 1; }
.page-wide { max-width: 1240px; }
.page > * + * { margin-top: var(--s5); }
.page > h1 + .lede { margin-top: var(--s2); }
.foot-firm { color: inherit; text-decoration: none; cursor: default; }
.toast {
  position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); z-index: 50;
  max-width: min(520px, calc(100vw - 32px)); padding: var(--s3) var(--s4);
  background: var(--ink); color: var(--bone); border-radius: var(--r-sm); box-shadow: 0 12px 40px rgba(11, 11, 11, 0.16);
  font-size: 0.875rem;
}
.confetti { position: fixed; top: -12px; width: 8px; height: 14px; z-index: 49; pointer-events: none; animation: confetti-fall 2.4s ease-in forwards; }
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0.9; } }
/* Who made it. A slow band of orange travels along the second line and back;
   the gradient is clipped to the letters, so it reads as light moving over
   the words rather than a highlight behind them. */
.colophon { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: var(--s4); }
.colophon-by { font-size: 0.8125rem; }
.colophon-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.colophon-name:hover { color: var(--text-accent); }
.colophon-roles {
  font-size: 0.75rem;
  /* Explicit colours, not currentColor: the text's own colour is transparent
     so the gradient shows through the letters. */
  background-image: linear-gradient(90deg,
    var(--text-secondary) 0%, var(--text-secondary) 38%, var(--orange) 50%,
    var(--text-secondary) 62%, var(--text-secondary) 100%);
  background-size: 280% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: colophon-wave 7s ease-in-out infinite alternate;
}
@keyframes colophon-wave { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .colophon-roles { animation: none; background-image: none; color: var(--text-secondary); }
}
.colophon-sep { display: inline-block; padding: 0 9px; font-size: 19px; line-height: 0; vertical-align: middle; color: var(--text-accent); opacity: 0.6; }
.delorean { position: fixed; left: 0; bottom: 22vh; z-index: 72; pointer-events: none; transform: translateX(-240px); animation: delorean-run 1.7s cubic-bezier(0.55, 0, 0.9, 0.35) forwards; }
@keyframes delorean-run { to { transform: translateX(calc(100vw + 240px)); } }
/* What it leaves behind: two lines of fire where the wheels were. */
.delorean-fire { position: fixed; left: 0; right: 0; height: 5px; z-index: 71; pointer-events: none; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(255, 122, 0, 0), #FF7A00 30%, #FFC98F 60%, #FF7A00);
  box-shadow: 0 0 12px 2px rgba(255, 122, 0, 0.6); border-radius: 3px;
  animation: delorean-fire 3.4s ease-out forwards; }
@keyframes delorean-fire { 0% { transform: scaleX(0); opacity: 1; } 45% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.delorean-flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: #fff; opacity: 0; animation: delorean-flash 0.5s ease-out 1.25s; }
@keyframes delorean-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.time-circuits { position: fixed; right: var(--s5); top: 96px; z-index: 72; pointer-events: none; background: #0B0B0B; border-radius: var(--r-sm); padding: 10px 14px; box-shadow: 0 12px 40px rgba(11, 11, 11, 0.3); display: grid; gap: 6px; animation: circuits 5.5s ease-in forwards; }
.time-circuits div { display: grid; gap: 1px; }
.time-circuits b { font: 700 1rem var(--mono); letter-spacing: 0.08em; }
.time-circuits small { font: 600 0.5625rem var(--font); letter-spacing: 0.14em; color: #A7A39A; text-transform: uppercase; }
.time-circuits .tc-dest b { color: #FF5B4A; } .time-circuits .tc-now b { color: #5FBF88; } .time-circuits .tc-last b { color: #E8A33D; }
@keyframes circuits { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.foot-version { display: block; margin-top: var(--s1); font-family: var(--mono); font-size: 0.75rem; }
.foot {
  padding: var(--s5); border-top: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.8125rem; text-align: center;
}

/* — pieces — */
.card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s5); box-shadow: var(--shadow-1);
}
.card > * + * { margin-top: var(--s4); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 0.875rem/1 var(--font);
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
/* As tall as a text field, so a button beside one lines up with it. */
.btn { min-height: 40px; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.btn-primary:hover { background: var(--n-800); color: var(--bone); }
.btn-small { padding: 6px 10px; font-size: 0.8125rem; min-height: 0; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--n-700); }
.btn-quiet:hover { border-color: var(--border-strong); }
.ahead-banner .btn { background: var(--orange); border-color: var(--orange); color: var(--ink); }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  background: var(--bg-sunken); color: var(--n-700);
}
.pill-ok { background: var(--success-bg); color: var(--success); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-late { background: #EDE6F5; color: #5E3F8A; }
.tag { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: var(--r-xs); white-space: nowrap; }
.tag-critical { background: var(--orange-100); color: var(--ember); }
.flag {
  display: inline-block; margin: var(--s1) var(--s1) 0 0; padding: 1px 8px; border-radius: var(--r-xs);
  font-size: 0.75rem; font-weight: 600; background: var(--warning-bg); color: var(--warning);
}
.flag-critical { background: var(--orange-100); color: var(--ember); }
dd .flag { margin-left: var(--s2); }

.notice { padding: var(--s3) var(--s4); border-radius: var(--r-sm); border: 1px solid; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { background: var(--success-bg); border-color: #B9DAC6; color: #1F5C39; }
.notice-error { background: var(--danger-bg); border-color: #F0BDB2; color: #8E2412; }
.notice-warn { background: var(--warning-bg); border-color: #EBCB95; color: #5E3800; }
.notice-info { background: var(--info-bg); border-color: #B5CFEA; color: #1D4D80; }
.notice > * + * { margin-top: var(--s3); }
.notice-actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.notice-actions form { margin: 0; }
#newer-build { margin: var(--s3) var(--s5) 0; }
.empty { color: var(--text-secondary); padding: var(--s5); text-align: center; background: var(--bg-sunken); border-radius: var(--r-sm); }
.demo-note { font-size: 0.8125rem; color: var(--text-secondary); border-left: 3px solid var(--border-strong); padding-left: var(--s3); }

/* — forms — */
input[type="text"], input[type="search"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 8px 10px; width: 100%; min-height: 40px;
}
textarea { resize: vertical; min-height: 60px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--orange); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; flex: none; }
.field { display: flex; flex-direction: column; gap: var(--s1); font-size: 0.8125rem; font-weight: 600; }
.field > span .muted { font-weight: 400; }
.field-grow { flex: 1 1 260px; }
.inline-form { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; margin: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.stack > .field, .stack > .inline-form { width: 100%; }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choices { display: flex; gap: var(--s2); flex-wrap: wrap; }
.choices legend { font-size: 0.8125rem; font-weight: 600; margin-bottom: var(--s1); }
.choices label {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  background: var(--bg-raised); cursor: pointer; font-weight: 500;
}
.choices label:has(input:checked) { border-color: var(--ink); background: var(--bg-sunken); font-weight: 600; }
.filters { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: var(--s1); font-size: 0.8125rem; font-weight: 600; flex: 1 1 160px; max-width: 260px; }

/* — the search box — */
.filters .search { flex: 2 1 300px; max-width: 440px; }
.search-label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.search-hint { font-weight: 400; font-size: 0.6875rem; color: var(--text-secondary); white-space: nowrap; }
kbd { font: 600 0.625rem var(--mono); padding: 1px 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-raised); color: var(--n-700); }
.search-box { position: relative; display: block; }
.search-box input { padding-right: 38px; }
.search-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  text-decoration: none; color: var(--n-600); font-size: 1.25rem; line-height: 1; font-weight: 400;
}
.search-clear:hover { background: var(--bg-sunken); color: var(--ink); }
.search-clear[hidden] { display: none; }
@media (pointer: coarse) { .search-hint { display: none; } }

/* — help on hover — */
.tip {
  position: fixed; z-index: 60; max-width: min(320px, calc(100vw - 16px)); padding: 8px 11px;
  background: var(--ink); color: var(--bone); font: 400 0.8125rem/1.4 var(--font); text-align: left;
  text-transform: none; letter-spacing: 0; white-space: pre-line;
  border-radius: var(--r-sm); box-shadow: 0 12px 40px rgba(11, 11, 11, 0.16); pointer-events: none;
}
/* A person's name answers "who is that?" on hover. */
.person { cursor: help; }
/* A heading or label that explains itself on hover says so quietly. */
th[title], th[data-tip], dt[title], dt[data-tip], strong[title], strong[data-tip] {
  text-decoration: underline dotted var(--n-400); text-underline-offset: 3px; cursor: help;
}

/* — tables — */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.table td { padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
/* Banded, so a long row is easy to follow across; the row under the pointer is
   a shade stronger. */
.table tbody tr:nth-child(even) td { background: var(--n-50); }
.table tbody tr:hover td { background: var(--n-100); }
.table tbody tr.row-section:hover th { background: var(--bg-sunken); }
mark { background: var(--orange-100); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px var(--orange-100); }
.card-flush { padding: var(--s2) var(--s3); }
#results > * + * { margin-top: var(--s3); }
#results.is-loading { opacity: 0.6; }
.table-compact td { padding: var(--s2) var(--s3); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .date { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .bar-col { width: 34%; min-width: 160px; vertical-align: middle; }
.row-section th { background: var(--bg-sunken); color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 0.875rem; }
.row-off td { color: var(--text-secondary); }
.eng-link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 600; }
.eng-link .code { color: var(--text-accent); font-weight: 500; }
.eng-link:hover span:last-child { text-decoration: underline; }
.progress { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.progress-bar { width: 64px; height: 6px; border-radius: var(--r-pill); background: var(--n-200); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--ink); border-radius: var(--r-pill); }
.progress-text { font-variant-numeric: tabular-nums; font-size: 0.8125rem; color: var(--n-700); }
.slip { font-weight: 600; font-variant-numeric: tabular-nums; }
.slip-late { color: var(--warning); }
.slip-early { color: var(--success); }
.slip-count { font-weight: 400; color: var(--text-secondary); }

/* — front page — */
.login-intro { max-width: 70ch; }
/* The name and its three words, on one line at any width. */
.login-title { display: flex; align-items: baseline; gap: 0.45em; white-space: nowrap; font-size: clamp(0.8rem, 4.3vw, 2.5rem); letter-spacing: 0; }
/* The capital E of the three words stands exactly as tall as the m of the
   name. Measured in a browser: at the same font size the m is 77 units high
   and the E is 73, so the name is set at 73/77 of the words' size. */
.login-title .wordmark { font-size: calc(1em * 73 / 77); }
.login-descriptor { font-weight: 800; text-transform: capitalize; color: var(--ink); letter-spacing: -0.02em; }
.login-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--s4); align-items: stretch; }
.login-role { display: flex; flex-direction: column; gap: var(--s3); }
.login-role > * + * { margin-top: 0; }
.login-role p { margin: 0; flex: 1; }
.login-role form { margin: 0; }
.kicker { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-accent); }
.login-pick { width: 100%; padding: 12px; white-space: normal; line-height: 1.3; }
.login-everyone { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: var(--s3) var(--s5); }
.login-everyone > summary { cursor: pointer; font-weight: 600; padding: var(--s1) 0; }
.login-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4); margin: var(--s3) 0 var(--s2); }
.login-group { display: flex; flex-direction: column; gap: var(--s1); }
.login-group legend { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: var(--s2); padding: 0; }
.login-person {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg-raised); font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left;
}
.login-person:hover { border-color: var(--ink); background: var(--n-50); }

/* — worklist — */
.group { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.group > summary { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s4) var(--s5); cursor: pointer; list-style: none; flex-wrap: wrap; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before { content: "▸"; color: var(--text-secondary); }
.group[open] > summary::before { content: "▾"; }
.group-count { font-weight: 700; background: var(--bg-sunken); border-radius: var(--r-pill); padding: 0 10px; }
.group .table-wrap { padding: 0 var(--s3) var(--s3); }
.tabs { display: flex; gap: var(--s2); }
.tabs a { padding: var(--s1) var(--s3); border-radius: var(--r-pill); text-decoration: none; color: var(--n-700); border: 1px solid var(--border-strong); font-weight: 500; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bone); border-color: var(--ink); }

/* — one engagement — */
.eng-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5); flex-wrap: wrap; }
.crumb { font-size: 0.8125rem; margin-bottom: var(--s2); color: var(--text-secondary); }
.eng-status { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.eng-status .pill { font-size: 0.9375rem; padding: 6px 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4); margin: 0; }
.facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.facts dd { margin: 0; font-weight: 500; }
.facts-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.facts-row > * + * { margin-top: 0; }
.eng-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.eng-main > * + * { margin-top: var(--s5); }
.side { position: sticky; top: var(--s4); background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); }
.side ol { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.875rem; }
.side a:hover { background: var(--bg-sunken); }
/* Where the reader is: set by app.js as the page scrolls. */
.side a[aria-current] { background: var(--ink); color: var(--bone); font-weight: 600; }
.side a[aria-current] .side-count, .side a[aria-current] .side-done { color: var(--bone); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); }
.to-top { font-size: 0.8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--text-secondary); padding: 2px 8px; border-radius: var(--r-pill); }
.to-top:hover { background: var(--bg-sunken); color: var(--ink); }
/* At the top of the page there is nowhere to go back to (set by app.js). */
.at-top .to-top { visibility: hidden; }
/* The letter has a column of its own, so a title that wraps continues under
   the title and never under the letter. */
.side-code { flex: none; width: 1.1em; font-weight: 700; }
.side-title { flex: 1; min-width: 0; }
.side-count { flex: none; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.side-done { color: var(--success); font-weight: 700; }
.side-more { border-top: 1px solid var(--border); margin-top: var(--s2) !important; padding-top: var(--s2) !important; }
.side-more a { color: var(--n-700); }
.section > * + * { margin-top: var(--s3); }
.item {
  background: var(--bg-raised); border: 1px solid var(--border); border-left: 4px solid var(--n-300);
  border-radius: var(--r-md); padding: var(--s4) var(--s5);
}
.item > * + * { margin-top: var(--s3); }
.item-yes, .item-na { border-left-color: var(--success); }
.item-not_yet { border-left-color: var(--seg-due-soon); }
.item-head { display: flex; gap: var(--s3); align-items: flex-start; }
.item-code { font-weight: 700; background: var(--bg-sunken); border-radius: var(--r-xs); padding: 2px 8px; flex: none; }
.item-q { flex: 1; }
.item-q p { margin: var(--s1) 0 0; }
.found { font-size: 0.875rem; background: var(--bg-sunken); border-radius: var(--r-sm); padding: var(--s2) var(--s3); }
.answer { border-top: 1px dashed var(--border); padding-top: var(--s3); }
.answer > * + * { margin-top: var(--s2); }
.answer-state { font-weight: 700; margin-right: var(--s2); }
.answer-yes { color: var(--success); }
.answer-na { color: var(--n-700); }
.answer-not_yet { color: var(--warning); }
.answer-note { margin: var(--s2) 0 0; font-style: italic; }
.docs { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s1); }
.doc { display: inline-flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.doc-name { font-weight: 600; }
.doc-meta { font-size: 0.75rem; color: var(--text-secondary); }
.doc-missing { color: var(--danger); font-weight: 600; }
.ext {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--r-xs); background: var(--n-200); color: var(--n-700);
}
.ext-pdf { background: var(--danger-bg); color: var(--danger); }
.ext-docx { background: var(--info-bg); color: var(--info); }
.ext-msg { background: var(--warning-bg); color: var(--warning); }
.ext-xlsx { background: var(--success-bg); color: var(--success); }
.ext-pptx { background: var(--orange-100); color: var(--ember); }
.warn { font-size: 0.875rem; color: #5E3800; background: var(--warning-bg); border-radius: var(--r-sm); padding: var(--s2) var(--s3); margin: 0; }
.warn::before { content: "Check: "; font-weight: 700; }
.answer-form { border-top: 1px dashed var(--border); padding-top: var(--s3); display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; margin: 0; }
.answer-form .field, .answer-form .picker { width: 100%; }
.change > summary { cursor: pointer; font-weight: 600; font-size: 0.875rem; color: var(--text-accent); }
.change[open] > summary { margin-bottom: var(--s3); }
.change .answer-form { border-top: 0; padding-top: 0; }
.picker { border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--n-50); }
.picker > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; }
.picker-body { border-top: 1px solid var(--border); padding: var(--s3) var(--s4); max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s3); }
.picker-folder legend { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: var(--s1); }
.picker-doc { display: flex; gap: var(--s2); align-items: baseline; padding: 6px 8px; border-radius: var(--r-xs); cursor: pointer; }
.picker-doc:hover, .picker-doc:has(input:checked) { background: var(--bg-raised); }
.picker-doc input { position: relative; top: 2px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.step { padding: var(--s3) var(--s4); border: 1px solid var(--border); border-left: 4px solid var(--n-300); border-radius: var(--r-sm); display: flex; flex-direction: column; }
.step-done { border-left-color: var(--success); background: var(--success-bg); }
.history { margin: 0; padding-left: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.history p { margin: var(--s1) 0 0; }

/* — dashboard — */
.headline { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: var(--s6); align-items: center; }
.headline > * + * { margin-top: 0; }
.hero { display: flex; flex-direction: column; gap: var(--s1); }
.hero-value { font-size: 3.5rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.hero-label { font-size: 1.0625rem; font-weight: 600; }
.sbar { display: flex; gap: 2px; height: 14px; min-width: 12px; }
.headline .sbar { height: 28px; }
.sbar-seg { min-width: 6px; flex-basis: 0; }
.sbar-seg:first-child { border-radius: 4px 0 0 4px; }
.sbar-seg:last-child { border-radius: 0 4px 4px 0; }
.sbar-seg:only-child { border-radius: 4px; }
.sbar-seg:hover { filter: brightness(1.15); }
.seg-overdue { background: var(--seg-overdue); }
.seg-due_soon { background: var(--seg-due-soon); }
.seg-in_window { background: var(--seg-in-window); }
.seg-compliant { background: var(--seg-compliant); }
.seg-compliant_late { background: var(--seg-late); }
.seg-in_progress { background: var(--seg-in-progress); }
.legend { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s2) var(--s4); }
.legend li { display: flex; align-items: center; gap: var(--s2); }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend-label { color: var(--n-700); }
.legend-value { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s4); }
.tile {
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1);
}
.tile:hover { border-color: var(--ink); color: var(--ink); }
.tile-label { font-size: 0.8125rem; font-weight: 600; color: var(--n-700); }
.tile-value { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.tile-note { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.35; }
.tile-danger { border-top: 3px solid var(--danger); }
.tile-warning { border-top: 3px solid var(--seg-due-soon); }

/* — the pictures — */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: var(--s6); align-items: start; }
.chart { margin: 0; display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.chart figcaption p { margin: var(--s1) 0 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-donut { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.donut { max-width: 170px; flex: 0 0 150px; }
.donut-part { fill: none; stroke-width: 22; }
.donut-part:hover, .columns path:hover, .hbar:hover { filter: brightness(1.15); }
.donut-empty { fill: none; stroke: var(--n-200); stroke-width: 22; }
.stroke-compliant { stroke: var(--seg-compliant); }
.stroke-compliant_late { stroke: var(--seg-late); }
.stroke-overdue { stroke: var(--seg-overdue); }
.donut-centre { font: 700 30px var(--font); fill: var(--ink); text-anchor: middle; }
.donut-caption { font: 500 9.5px var(--font); fill: var(--n-600); text-anchor: middle; }
.legend-stack { grid-template-columns: 1fr; margin-top: 0; flex: 1 1 170px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: 0; }
.axis { stroke: var(--n-300); stroke-width: 1; }
.fill-overdue { fill: var(--seg-overdue); }
.fill-due_soon { fill: var(--seg-due-soon); }
.fill-in_window { fill: var(--seg-in-window); }
.col-value { font: 700 13px var(--font); fill: var(--ink); text-anchor: middle; }
.col-zero { fill: var(--n-500); font-weight: 500; }
.col-label { font: 500 10.5px var(--font); fill: var(--n-600); text-anchor: middle; }
.col-axis-title { font: 500 10.5px var(--font); fill: var(--n-600); text-anchor: middle; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.hbars li { display: grid; grid-template-columns: 34px 1fr 26px; align-items: center; gap: var(--s2); }
.hbars .item-code { text-align: center; padding: 1px 4px; }
.hbar-track { display: block; height: 14px; }
.hbar { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 0.8125rem; }
span.fill-critical, .hbar.fill-critical { background: var(--orange); }
span.fill-important, .hbar.fill-important { background: var(--n-400); }

/* — reminders — */
.outbox-day > * + * { margin-top: var(--s3); }
.mails { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.mail { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s3) var(--s4); }
.mail p { margin: var(--s1) 0 0; }
.mail-head { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.mail-subject { font-weight: 600; color: var(--ink); }
.mail-to { font-size: 0.8125rem; color: var(--text-secondary); margin-top: var(--s1); }

/* — admin — */
.draft-section > * + * { margin-top: var(--s3); }
.item-editor { border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); margin: 0; background: var(--n-50); }
.item-editor-off { opacity: 0.75; border-style: dashed; }
.item-editor-head { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.build { font-family: var(--mono); }

@media (max-width: 860px) {
  /* minmax(0, …): without it the strip's full width would stretch the page. */
  .eng-layout { grid-template-columns: minmax(0, 1fr); }
  /* On a narrow screen the list becomes a strip that stays in view, so the
     place is still shown while the checklist scrolls under it. */
  .side { position: sticky; top: 0; z-index: 5; padding: var(--s2); box-shadow: var(--shadow-1); display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side ol { display: flex; gap: var(--s1); }
  .side a { white-space: nowrap; padding: 6px 10px; }
  .side-code { width: auto; }
  .side-more { border-top: 0; border-left: 1px solid var(--border); margin: 0 0 0 var(--s1) !important; padding: 0 0 0 var(--s1) !important; }
  .headline { grid-template-columns: 1fr; }
  .top { padding: var(--s3) var(--s4); gap: var(--s3); }
  .top-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .page { padding: var(--s5) var(--s4) var(--s6); }
  .eng-status { align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .login-person, .tile, .nav a { transition: border-color 120ms, background-color 120ms; }
}
