/* Open Sans, served from this app (no external font service), so every page uses the same typeface on every computer. */
@font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/open-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/open-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* TrueFan Delivery — stylesheet
   Contract: docs/DESIGN.md. Every colour is a token from :root; the only literal colours outside it are #fff on
   primary buttons and the URL-encoded stroke of the select chevron. Exactly three media queries exist: the compact
   layout (≤ 1024, so the §3.2 top-bar budget holds at exactly 1024), the phone layout (≤ 600, which also overrides
   the control-height tokens) and reduced motion.

   1 Tokens · 2 Base and type · 3 Utilities · 4 Page frame · 5 Containers · 6 Buttons · 7 Inputs and fields ·
   8 Forms · 9 Picker · 10 Tables · 11 Status · 12 Stats · 13 Empty · 14 Disclose, popover, help · 15 Tabs ·
   16 Filter bar and pager · 17 Facts · 18 Timeline · 19 Alerts and lists · 20 Bar · 21 Login and message pages ·
   22 Code and icons · 23 Typeahead · 24 Compact · 25 Phone */

/* ============================================================================ 1 Tokens */
:root {
  color-scheme: light;

  /* Neutrals: cool, the quote builder's ink family. Contrast is on white unless noted. */
  --n-0: #ffffff;   /* page, cards, top bar, inputs, popovers */
  --n-1: #fafafa;   /* row hover, sticky th backdrop */
  --n-2: #f3f4f6;   /* fills: tags, counts, neutral pill, disabled controls, ghost hover */
  --n-3: #e5e7eb;   /* hairline: borders, dividers, table rules, bar track */
  --n-4: #878d99;   /* control borders, hollow dots, chevrons — 3.33:1 */
  --n-5: #646b78;   /* muted text, placeholders, th, neutral dot — 5.36:1 */
  --n-6: #4b5563;   /* secondary text, field labels — 7.56:1 */
  --n-7: #111827;   /* ink — 17.74:1 */

  /* The one accent (quote builder brand). */
  --accent: #4a3fd1;        /* primary fill, focus ring, hot count, info dot — white on it 7.18:1 */
  --accent-hover: #3a30b0;  /* primary hover */
  --accent-text: #3a30b0;   /* links, disclosure summaries, active nav text — 9.42:1 */
  --accent-soft: #eeedfc;   /* active nav fill, info pill fill */

  /* Semantic triples: text (≥ 4.5:1 on white and on its own soft), dot (≥ 3:1 on white), soft fill. */
  --ok-text: #166534;     --ok-dot: #15803d;     --ok-soft: #e7f6ee;
  --warn-text: #854d0e;   --warn-dot: #b45309;   --warn-soft: #fdf4e0;
  --danger-text: #b42318; --danger-dot: #dc2626; --danger-soft: #fdecea;
  --info-text: var(--accent-text); --info-dot: var(--accent); --info-soft: var(--accent-soft);

  /* Type: one family, five sizes, each with its line height. Weights 400/500/600 only. */
  --font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;   /* pre.json only */
  --fs-0: 11px; --lh-0: 16px;   /* th, counts */
  --fs-1: 12px; --lh-1: 16px;   /* meta lines, hints, crumbs, pills, tags, timestamps, dt, stat labels */
  --fs-2: 13px; --lh-2: 20px;   /* body, tables, controls, labels, buttons, nav, h3 */
  --fs-3: 15px; --lh-3: 20px;   /* h2 */
  --fs-4: 20px; --lh-4: 28px;   /* h1, stat values */

  /* Spacing: 4 pt grid. No other margin, padding or gap values exist in the sheet. */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px;

  /* Shape. Pills are 999px and dots 50%: shapes, not tokens. */
  --r-ctl: 6px;     /* inputs, buttons, tags, picker field, menu rows */
  --r-panel: 8px;   /* cards, popover panels, flash, picker panel */

  /* Lines and the one shadow (floating layers only). */
  --line: 1px solid var(--n-3);
  --line-ctl: 1px solid var(--n-4);
  --shadow-pop: 0 4px 12px rgba(17, 24, 39, 0.08);

  /* Layers. */
  --z-th: 10; --z-topbar: 20; --z-pop: 30; --z-sheet: 40; --z-skip: 50;

  /* Layout. */
  --container: 1280px;
  --gutter: 24px;        /* 16px on phones */
  --topbar-h: 52px;
  --block-gap: 24px;     /* between cards, strips and grids; 16px on phones */

  /* Controls. */
  --h-ctl: 36px;         /* inputs, selects, buttons, picker field, tabs, popover summaries; 44 on phones */
  --h-ctl-sm: 28px;      /* .btn.small, card-head tools, .check rows; 44 on phones */

  /* Motion: the only duration; properties background-color, border-color, color, opacity. */
  --t: 120ms ease;
}

/* ============================================================================ 2 Base and type */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--n-0); color: var(--n-7);
  font: 400 var(--fs-2)/var(--lh-2) var(--font); font-feature-settings: 'cv11'; font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; color: var(--n-7); }
h1 { font: 600 var(--fs-4)/var(--lh-4) var(--font); letter-spacing: -0.01em; }
h2 { font: 600 var(--fs-3)/var(--lh-3) var(--font); }
h3 { font: 600 var(--fs-2)/var(--lh-2) var(--font); }
p { margin: 0; }
p + p { margin-top: var(--s-2); }
strong, b { font-weight: 600; }
table { font-size: var(--fs-2); }
form { margin: 0; }
hr { border: 0; border-top: var(--line); margin: var(--s-5) 0; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--topbar-h) + var(--s-3)); }

a { color: var(--accent-text); text-decoration: none; transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t); }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a.ink { color: var(--n-7); font-weight: 500; }

/* Focus: one global ring; controls use an inset ring plus the accent border (§7.2). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(:focus:not(:focus-visible)) { outline: none; }
main:focus { outline: none; }

/* ============================================================================ 3 Utilities */
.muted { color: var(--n-5); }
.small { font-size: var(--fs-1); line-height: var(--lh-1); }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
.meta-line { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); }

/* ============================================================================ 4 Page frame */
/* The skip link looks like a primary button but is not one, so it never counts as the view's primary. */
.skip {
  position: absolute; left: var(--s-2); top: -60px; z-index: var(--z-skip); display: inline-flex; align-items: center; height: var(--h-ctl);
  padding: 0 var(--s-4); border-radius: var(--r-ctl); background: var(--accent); color: #fff; font: 500 var(--fs-2)/1 var(--font); text-decoration: none;
}
.skip:focus { top: var(--s-2); }

main, .topbar-inner { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
main { padding-top: var(--s-6); padding-bottom: var(--s-8); }

/* Top bar: one 52 px row that never wraps or clips. */
.topbar { position: sticky; top: 0; z-index: var(--z-topbar); background: var(--n-0); border-bottom: var(--line); }
.topbar-inner { display: flex; align-items: center; gap: var(--s-6); height: calc(var(--topbar-h) - 1px); } /* 52 with the hairline */
.brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.brand span { font: 500 var(--fs-2)/var(--lh-2) var(--font); color: var(--n-5); }
/* From 1025 up the nav always fits (the name and role yield first, below); at 1024 and under it moves into the
   Menu sheet (§24), because a Head's five items do not fit beside the brand and the name between 601 and ~1000 px. */
.nav { flex: 1 0 auto; min-width: 0; display: flex; gap: var(--s-1); overflow: visible; } /* never shrinks: the name yields instead */
.nav a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s-3); border-radius: var(--r-ctl);
  font-weight: 500; color: var(--n-5); white-space: nowrap;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.nav a:hover { background: var(--n-2); color: var(--n-7); text-decoration: none; }
.nav a:focus-visible { outline-offset: -2px; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.count {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 var(--s-1); margin-left: var(--s-2);
  border-radius: 999px; background: var(--n-2); color: var(--n-6); font-size: var(--fs-0); font-weight: 600; text-align: center;
}
.count.hot { background: var(--accent); color: #fff; }
/* Above the compact width the bar is at most ~48 px short (Head at 1025), so the name and role give way first
   (ellipsis) and the nav never moves. */
.who { flex: 0 1000 auto; min-width: 0; display: flex; align-items: center; gap: var(--s-4); }
.who .alerts { color: var(--n-7); font-weight: 500; white-space: nowrap; }
.who .alerts[aria-current="page"] { color: var(--accent-text); }
.who .name { font-weight: 500; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.role { color: var(--n-5); font-weight: 400; }
.sheet { display: none; }

/* Page title block: the hairline under it is the page's structural device. */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-6); flex-wrap: wrap;
  padding-bottom: var(--s-5); margin-bottom: var(--block-gap); border-bottom: var(--line);
}
.page-head-main { min-width: 0; flex: 1 1 auto; }
.crumbs { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); margin-bottom: var(--s-1); }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin: 0 var(--s-2); }
.crumbs a { color: var(--n-5); }
.crumbs a:hover { color: var(--n-7); }
.page-head h1 { margin-bottom: var(--s-1); }
.page-head .sub { color: var(--n-5); margin: 0; max-width: 80ch; }
.page-head .tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-2); }
.notes { margin: var(--s-2) 0 0; color: var(--n-6); }
.page-actions { display: flex; gap: var(--s-2); flex: 0 0 auto; align-items: center; flex-wrap: wrap; }
.page-head > .help { flex-basis: 100%; }

/* Flash and inline banners: a dot, a soft fill, no border. */
.flash {
  position: relative; display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-2) var(--s-3) var(--s-2) 28px;
  border-radius: var(--r-panel); font-weight: 500; margin-bottom: var(--block-gap);
}
.flash::before { content: ''; position: absolute; left: var(--s-3); top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--ok-dot); }
.flash.ok { color: var(--ok-text); background: var(--ok-soft); }
.flash.warn { color: var(--warn-text); background: var(--warn-soft); }
.flash.warn::before { background: var(--warn-dot); }
.flash.err { color: var(--danger-text); background: var(--danger-soft); }
.flash.err::before { background: var(--danger-dot); }
.flash > .btn { margin: -4px 0 -4px auto; color: inherit; } /* the 28 px Dismiss sits inside the 20 px line: the banner stays 36 */
.flash > .btn:hover { color: inherit; }
.flash > .pop { margin-left: auto; }
.flash p { margin: 0; }

/* ============================================================================ 5 Containers */
.card { background: var(--n-0); border: var(--line); border-radius: var(--r-panel); padding: var(--s-4) var(--s-5); margin-bottom: var(--block-gap); }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: var(--s-3) var(--s-5); border-bottom: var(--line); margin: 0; }
.card.flush > .empty { padding: var(--s-4) var(--s-5); }
.card.flush > .form, .card.flush > form, .card.flush > .facts, .card.flush > .disclose { padding: var(--s-4) var(--s-5); }
.card.flush > .pad { padding: var(--s-2) var(--s-5) var(--s-3); }
.card.flush > table + .facts, .card.flush > table + .disclose, .card.flush > .facts + .disclose { border-top: var(--line); }
/* A card whose body is a closed-by-default list (the phone flags card): its summary is the card head. */
summary.card-head { margin: 0; }
summary.card-head .chev { color: var(--n-5); }
details[open] > summary.card-head .chev { transform: rotate(180deg); }
.flags-phone { display: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.card-head > div:first-child { min-width: 0; }
.card-head .sub { color: var(--n-5); font-size: var(--fs-1); line-height: var(--lh-1); margin: 2px 0 0; }
.tools { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; flex: 0 0 auto; }
.tools select, .tools input { height: var(--h-ctl-sm); font-size: var(--fs-1); width: auto; }
.sect + .sect { border-top: var(--line); margin-top: var(--s-5); padding-top: var(--s-5); }
.sect h3 { margin-bottom: var(--s-3); }
.grid { display: grid; gap: var(--block-gap); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.two > :only-child { grid-column: 1 / -1; }
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: var(--block-gap); }
.divider { border: 0; border-top: var(--line); margin: var(--s-5) 0; }
.section-title { margin: var(--s-7) 0 var(--s-4); }

/* ============================================================================ 6 Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--h-ctl); padding: 0 var(--s-4);
  border-radius: var(--r-ctl); border: var(--line-ctl); background: var(--n-0); color: var(--n-7);
  font: 500 var(--fs-2)/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.btn:hover { background: var(--n-1); border-color: var(--n-6); color: var(--n-7); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--n-6); }
.btn.ghost:hover { background: var(--n-2); border-color: transparent; color: var(--n-7); }
.btn.danger { background: var(--n-0); border-color: var(--n-4); color: var(--danger-text); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--n-6); color: var(--danger-text); }
.btn.link { height: auto; padding: 0; border: 0; background: none; color: var(--accent-text); border-radius: 0; }
.btn.link:hover { background: none; text-decoration: underline; text-underline-offset: 2px; }
.btn.small { height: var(--h-ctl-sm); padding: 0 var(--s-3); font-size: var(--fs-1); }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
details[open] > summary.btn { background: var(--n-1); border-color: var(--n-6); }
details[open] > summary.btn.ghost { background: var(--n-2); border-color: transparent; }
details[open] > summary.btn.danger { background: var(--danger-soft); }
.btn .icon { flex: 0 0 auto; }

/* ============================================================================ 7 Inputs and fields */
input:not([type]), input[type=text], input[type=date], input[type=number], input[type=url], input[type=email],
input[type=search], input[type=password], select, textarea {
  width: 100%; height: var(--h-ctl); padding: 0 var(--s-3); border: var(--line-ctl); border-radius: var(--r-ctl);
  background: var(--n-0); color: var(--n-7); font: inherit; margin: 0;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
input:hover, select:hover, textarea:hover { border-color: var(--n-6); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
input::placeholder, textarea::placeholder { color: var(--n-5); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: var(--n-2); color: var(--n-5); border-color: var(--n-4); }
[aria-invalid="true"] { border-color: var(--danger-dot); }
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
select {
  appearance: none; -webkit-appearance: none; padding-right: var(--s-7);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23646b78' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right var(--s-3) center;
}
textarea { height: auto; min-height: 72px; padding: var(--s-2) var(--s-3); line-height: var(--lh-2); resize: vertical; }
input[type=file] { width: 100%; font: inherit; font-size: var(--fs-1); color: var(--n-5); padding: 2px 0; }
/* Two separate rules on purpose: an unknown pseudo-element in a selector list would invalidate the whole rule. */
input[type=file]::file-selector-button {
  font: 500 var(--fs-1)/1 var(--font); color: var(--n-7); background: var(--n-0); border: var(--line-ctl); border-radius: var(--r-ctl);
  height: var(--h-ctl-sm); padding: 0 var(--s-3); margin-right: var(--s-3); cursor: pointer;
}
input[type=file]::-webkit-file-upload-button {
  font: 500 var(--fs-1)/1 var(--font); color: var(--n-7); background: var(--n-0); border: var(--line-ctl); border-radius: var(--r-ctl);
  height: var(--h-ctl-sm); padding: 0 var(--s-3); margin-right: var(--s-3); cursor: pointer;
}
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
input[type=checkbox]:focus, input[type=radio]:focus { outline: none; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label, .label, fieldset.field > legend { display: block; font: 500 var(--fs-2)/var(--lh-2) var(--font); color: var(--n-6); margin-bottom: var(--s-1); padding: 0; }
.field { min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.hint { margin: var(--s-1) 0 0; font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); }
.error { margin: var(--s-1) 0 0; font-size: var(--fs-1); line-height: var(--lh-1); color: var(--danger-text); font-weight: 500; }
.check { display: flex; align-items: center; gap: var(--s-2); min-height: var(--h-ctl-sm); font-weight: 400; color: var(--n-7); margin: 0; cursor: pointer; }
.check label { margin: 0; font-weight: 400; color: var(--n-7); cursor: pointer; }
.checks { display: grid; gap: 0; }

/* ============================================================================ 8 Forms */
.form { display: grid; gap: var(--s-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); align-items: start; }
.form-grid > .wide { grid-column: 1 / -1; }
.form-narrow { max-width: 640px; }
/* The Team form: five pickers in a row of fields; no double gap from the picker's own bottom margin. */
.form-tight { gap: var(--s-2); }
.form-tight details.dm-pick { margin-bottom: 0; }
.form-tight details.dm-pick[open] > summary { margin-bottom: var(--s-1, 4px); }
.form-tight { gap: var(--s-3); }
.row { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.row > input, .row > select { width: auto; }
.actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-top: var(--s-4); }
.actions.end { justify-content: flex-end; }
form[aria-busy="true"] .btn[type=submit] { opacity: .5; }

/* ============================================================================ 9 Picker: searchable multi-select with removable tags */
.picker { position: relative; }
.picker-field {
  min-height: var(--h-ctl); padding: 3px var(--s-7) 3px var(--s-2); border: var(--line-ctl); border-radius: var(--r-ctl); background: var(--n-0);
  display: flex; align-items: center; cursor: pointer; list-style: none; position: relative;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.picker-field::-webkit-details-marker { display: none; }
.picker-field:hover { border-color: var(--n-6); }
.picker-field:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.picker[open] > .picker-field { border-color: var(--accent); }
.picker-field > .chev { position: absolute; right: var(--s-3); top: 50%; margin-top: -8px; color: var(--n-5); }
.picker-tags { display: flex; flex-wrap: wrap; gap: var(--s-1); min-width: 0; }
.tag {
  display: inline-flex; align-items: center; gap: var(--s-1); height: 28px; padding: 0 var(--s-2); border-radius: var(--r-ctl);
  background: var(--n-2); color: var(--n-7); font: 500 var(--fs-1)/1 var(--font); white-space: nowrap;
}
.tag .muted { font-weight: 400; }
.tag-x {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0 -4px 0 0; padding: 0;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--n-6); cursor: pointer;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.tag-x:hover { background: var(--n-3); color: var(--n-7); }
.picker-placeholder { color: var(--n-5); line-height: 28px; }
.picker-panel { margin-top: var(--s-1); border: var(--line); border-radius: var(--r-panel); background: var(--n-0); padding: var(--s-2); }
.picker-list { list-style: none; margin: var(--s-2) 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.picker-list li .check { min-height: 32px; padding: 0 var(--s-2); border-radius: var(--r-ctl); }
.picker-list li .check:hover { background: var(--n-1); }
.picker-empty { margin: var(--s-2) 0 0; padding: 0 var(--s-2); color: var(--n-5); font-size: var(--fs-1); line-height: var(--lh-1); }
.picker-panel > .picker-empty:first-child { margin: 0; }

/* ============================================================================ 10 Tables */
table { width: 100%; border-collapse: collapse; table-layout: auto; }
caption { text-align: left; }
th {
  text-align: left; font: 600 var(--fs-0)/var(--lh-0) var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--n-5);
  padding: var(--s-2) var(--s-3); border-bottom: var(--line); white-space: nowrap; vertical-align: bottom;
}
td { padding: var(--s-3); border-bottom: var(--line); vertical-align: top; }
th.num, td.num { text-align: right; }
/* In .card.flush and frameless lists the rules span the full width and text aligns with the card title. */
th:first-child, td:first-child { padding-left: var(--s-5); }
th:last-child, td:last-child { padding-right: var(--s-5); }
.card:not(.flush) th:first-child, .card:not(.flush) td:first-child { padding-left: 0; }
.card:not(.flush) th:last-child, .card:not(.flush) td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
.card.flush > table tbody tr:last-child td { border-bottom: 0; }
table.kv td { padding: var(--s-2) var(--s-3); }
tbody tr:has(a, button):hover > td { background: var(--n-1); }
tr.dim td { color: var(--n-5); }
tr.editing td:first-child { box-shadow: inset 2px 0 var(--accent); }
tr.editing:hover > td { background: none; }
tr.group td, tr.group:hover > td {
  font: 600 var(--fs-0)/var(--lh-0) var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--n-5);
  padding: var(--s-4) var(--s-3) var(--s-2); background: none;
}
tr.group td:first-child { padding-left: var(--s-5); }
.card:not(.flush) tr.group td:first-child { padding-left: 0; }
th.main, td.main { min-width: 220px; }
td.act { text-align: right; white-space: nowrap; }
.row-actions { display: inline-flex; gap: var(--s-2); align-items: center; }
table.sticky thead th { position: sticky; top: var(--topbar-h); background: var(--n-0); z-index: var(--z-th); }

/* ============================================================================ 11 Status vocabulary: dot + word, pill, text */
/* The dot-word is always a span: table cells also carry the class `status` as their phone role (§4.7). */
span.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
span.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--n-5); flex: 0 0 auto; }
span.status.ok::before { background: var(--ok-dot); }
span.status.warn::before { background: var(--warn-dot); }
span.status.bad::before { background: var(--danger-dot); }
span.status.info::before { background: var(--accent); }
span.status.none::before { background: transparent; box-shadow: inset 0 0 0 1px var(--n-4); }
span.status.muted { color: var(--n-5); }
.pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s-2); border-radius: 999px;
  font: 500 var(--fs-1)/20px var(--font); white-space: nowrap; background: var(--n-2); color: var(--n-6);
}
/* Neutral (grey) pill: darker than the page and row-hover fills so it stays visible on them. */
.pill:not(.bad):not(.warn):not(.ok):not(.info) { background: #dfe2e8; color: var(--n-6); }
.pill.bad { background: var(--danger-soft); color: var(--danger-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.ok { background: var(--ok-soft); color: var(--ok-text); }
/* A cell that holds a status and its pills: one per line, or side by side while they fit, never touching. */
.state-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
span.status + span.status, span.status + .pill, .pill + .pill, .pill + span.status { margin-left: var(--s-2); }
/* After the sibling rule above, so the gap comes from the flex container and every item starts at the same left edge. */
.pill-row > .pill, .pill-row > span.status, .state-stack .pill, .state-stack span.status, .state-stack .pill-row > * { margin-left: 0; }
.prio { font-weight: 600; }
.prio.high { color: var(--danger-text); }
.prio.medium { color: var(--warn-text); }
.prio.low { color: var(--ok-text); }

/* ============================================================================ 12 Stats strip */
.stats { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-7); margin: 0 0 var(--block-gap); padding: 0; list-style: none; }
.stats li { min-width: 0; }
.stats a { display: block; color: inherit; text-decoration: none; }
.stats a:hover .value { text-decoration: underline; text-underline-offset: 2px; }
.stats .label { display: flex; align-items: center; font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); font-weight: 500; margin: 0; }
.stats .value { display: block; font: 600 var(--fs-4)/var(--lh-4) var(--font); color: var(--n-7); margin-top: 2px; }
.stats .value.zero { color: var(--n-5); }
.stats .sub { display: block; font-size: var(--fs-1); line-height: var(--lh-1); font-weight: 500; margin-top: 2px; }
.meta-line.pace.ok { color: var(--ok-text); }
.meta-line.pace.bad { color: var(--danger-text); }
.stats .sub.ok { color: var(--ok-text); }
.stats .sub.bad { color: var(--danger-text); }
.stats .value .small { display: block; font-weight: 400; }
/* Lines that belong to the strip (the bar and its percentage, a blocked reason, closed-short and written-off notes):
   12 px under the stats, one block gap above the first card. Empty, it collapses. */
.strip-notes { display: grid; gap: var(--s-2); margin: calc(-1 * var(--block-gap) + var(--s-3)) 0 var(--block-gap); }
.strip-notes:empty { display: none; }
.strip-notes > .notes, .strip-notes > .flash, .strip-notes > p { margin: 0; }

/* ============================================================================ 13 Empty states */
.empty { color: var(--n-5); padding: var(--s-4) 0; margin: 0; text-align: left; }

/* ============================================================================ 14 Disclose, popover, help */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.disclose > summary { display: inline-flex; align-items: center; gap: var(--s-1); min-height: var(--h-ctl-sm); color: var(--accent-text); font-weight: 500; }
.disclose > summary:hover { text-decoration: underline; text-underline-offset: 2px; }
.disclose > summary .chev { transform: rotate(-90deg); color: var(--n-5); }
.disclose[open] > summary .chev { transform: none; }
.disclose > .panel { padding-top: var(--s-3); }
.disclose.help > .panel { max-width: 64ch; color: var(--n-6); }
.pop { position: relative; display: inline-block; }
.pop-panel {
  position: absolute; z-index: var(--z-pop); top: calc(100% + var(--s-1)); left: 0; width: 320px; max-width: calc(100vw - 32px);
  padding: var(--s-4); background: var(--n-0); border: var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); text-align: left;
}
.pop.end .pop-panel { left: auto; right: 0; }
.pop .pop-panel.flip-left { left: auto; right: 0; }
.pop .pop-panel.flip-right { left: 0; right: auto; }
.pop-panel .actions { margin-top: var(--s-3); }
.pop-panel .btn.block { justify-content: flex-start; }
/* A "More" panel: a vertical list of ghost rows; a row that needs fields is a disclosure that opens in place. */
.pop-panel .menu { display: grid; gap: var(--s-1); }
/* A plain row is inset by the chevron's width so its label lines up with the disclosure rows around it. */
.pop-panel .menu .btn.ghost.block { padding: 0 var(--s-2) 0 calc(var(--s-2) + 16px + var(--s-1)); }
.pop-panel .menu .disclose > summary { min-height: var(--h-ctl); padding: 0 var(--s-2); width: 100%; border-radius: var(--r-ctl); color: var(--n-6); }
.pop-panel .menu .disclose > summary:hover { background: var(--n-2); color: var(--n-7); text-decoration: none; }
.pop-panel .menu .disclose > .panel { padding: var(--s-2) var(--s-2) var(--s-3); }
td .pop, .tools .pop { white-space: normal; }

/* ============================================================================ 15 Tabs (Admin) */
.tabs { display: flex; flex-wrap: wrap; gap: var(--s-1); border-bottom: var(--line); margin-bottom: var(--block-gap); }
.tabs a {
  display: inline-flex; align-items: center; height: var(--h-ctl); padding: 0 var(--s-3); margin-bottom: -1px; color: var(--n-5); font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: background-color var(--t), border-color var(--t), color var(--t), opacity var(--t);
}
.tabs a:hover { color: var(--n-7); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--n-7); border-bottom-color: var(--accent); }

/* ============================================================================ 16 Filter bar and pager */
.filterbar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-5); }
.filterbar input[type=search] { flex: 1 1 240px; width: auto; }
.filterbar select { width: auto; }
.filterbar .disclose { flex: 1 1 100%; }
.filterbar .disclose .panel { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: flex-end; }
.filterbar .check { min-height: var(--h-ctl); }
.pager { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: var(--line); }
.pager p { margin: 0 auto 0 0; }

/* ============================================================================ 17 Facts (definition list) */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-6); margin: 0; }
.facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s-3); min-height: 28px; align-items: baseline; }
.facts.wide > div { grid-template-columns: 200px minmax(0, 1fr); } /* long labels (the integration health list) */
.facts dt { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); font-weight: 500; }
.facts dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.grid.two .facts, .grid.side .facts, .pop-panel .facts { grid-template-columns: minmax(0, 1fr); }

/* ============================================================================ 18 Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-bottom: var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); }
.timeline .what { color: var(--n-7); display: flex; justify-content: space-between; gap: var(--s-3); align-items: flex-start; min-width: 0; }
.timeline .what > :first-child { min-width: 0; white-space: pre-wrap; }
.timeline .who { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); }
.timeline .next { color: var(--n-6); }
.quote { border-left: 2px solid var(--n-3); padding-left: var(--s-3); color: var(--n-6); margin-top: var(--s-1); white-space: pre-wrap; }

/* ============================================================================ 19 Alerts and lists */
.alert-group > h2 { margin: var(--s-5) 0 var(--s-2); }
.alert-group:first-child > h2 { margin-top: 0; }
ul.alerts { list-style: none; margin: 0; padding: 0; }
ul.alerts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); padding: var(--s-3) 0 var(--s-3) var(--s-4); border-bottom: var(--line); position: relative; }
ul.alerts li a.ink { font-weight: 500; }
ul.alerts li.unread a.ink, ul.alerts li.unread > div > span:first-child { font-weight: 600; }
ul.alerts li.unread::before { content: ''; position: absolute; left: 0; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
ul.alerts li p { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); margin: 0; }
ul.alerts time { font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); text-align: right; white-space: nowrap; }
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { padding: var(--s-1) 0; }
/* Labels may wrap: the dot sits on the first line, not between two. */
ul.list li .status { white-space: normal; align-items: flex-start; }
ul.list li .status::before { margin-top: 7px; }

/* ============================================================================ 20 Bar */
.bar { display: inline-block; vertical-align: middle; width: 72px; height: 4px; background: var(--n-3); border-radius: 2px; overflow: hidden; margin-right: var(--s-2); }
.bar > span { display: block; height: 100%; background: var(--n-7); }
.bar.over > span { background: var(--danger-dot); }
.bar-wrap { display: inline-flex; align-items: center; white-space: nowrap; }

/* ============================================================================ 21 Login and message pages */
.login { max-width: 360px; margin: 12vh auto 0; padding: 0 var(--gutter); }
.login > img { display: block; height: 28px; width: auto; margin-bottom: var(--s-5); }
.login h1 { margin-bottom: var(--s-1); }
.login > .sub { color: var(--n-5); margin: 0 0 var(--s-5); }
.login .flash { margin-bottom: var(--s-4); }
.userpick { display: grid; gap: var(--s-2); }
.userpick .btn { height: auto; min-height: 44px; padding-top: var(--s-2); padding-bottom: var(--s-2); gap: var(--s-3); justify-content: space-between; text-align: left; min-width: 0; }
.userpick .btn > span { min-width: 0; overflow-wrap: anywhere; }
.userpick .btn > .muted { text-align: right; }
.login .google { display: flex; justify-content: center; margin-top: var(--s-4); }

/* ============================================================================ 22 Code block and icons */
pre.json { background: var(--n-7); color: var(--n-2); padding: var(--s-3); border-radius: var(--r-ctl); overflow: auto; font: 400 var(--fs-1)/var(--lh-1) var(--font-mono); max-height: 360px; margin: 0; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
.icon.ext { width: 12px; height: 12px; margin-left: 2px; vertical-align: -1px; }

/* ============================================================================ 23 Typeahead (project search under "attach to any project") */
.typeahead-results { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.typeahead-results:empty { display: none; }
.typeahead-results .typeahead-pick { height: auto; min-height: var(--h-ctl-sm); padding: var(--s-1) var(--s-3); white-space: normal; text-align: left; }

/* ============================================================================ 24 Compact (≤ 1024): one column, no optional columns, the nav behind Menu */
@media (max-width: 1024px) {
  .grid.two, .grid.side { grid-template-columns: minmax(0, 1fr); }
  .role { display: none; }
  th.opt, td.opt { display: none; }
  th.main, td.main { min-width: 0; }

  /* Top bar: brand, then on the right Alerts, the name and Menu. The sheet repeats the nav as 44 px rows and holds
     Sign out. Nothing in the bar ever scrolls or clips. */
  .nav { display: none; }
  .who { flex: 0 0 auto; margin-left: auto; }
  .who > form { display: none; }
  .sheet { display: block; flex: 0 0 auto; }
  .sheet-panel {
    position: absolute; left: 0; right: 0; top: var(--topbar-h); background: var(--n-0); border-bottom: var(--line);
    box-shadow: var(--shadow-pop); z-index: var(--z-sheet); padding: var(--s-2) 0;
  }
  .sheet-panel nav { display: grid; }
  .sheet-panel a { display: flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); font-weight: 500; color: var(--n-7); }
  .sheet-panel a:hover { text-decoration: none; background: var(--n-2); }
  .sheet-panel a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
  .sheet-panel hr { margin: var(--s-2) 0; }
  /* A block, not a flex row: the " · " between name and role is text and must keep its spaces. */
  .sheet-panel .sheet-who { display: block; min-height: 44px; padding: var(--s-3) var(--s-4); color: var(--n-5); margin: 0; }
  .sheet-panel .sheet-who .role { display: inline; }
  .sheet-panel .btn { width: 100%; justify-content: flex-start; padding: 0 var(--s-4); border-radius: 0; }
}

/* ============================================================================ 25 Phone (≤ 600): the row model, 44 px controls */
@media (max-width: 600px) {
  :root { --gutter: 16px; --block-gap: 16px; --h-ctl: 44px; --h-ctl-sm: 44px; }

  /* Top bar: brand image, Alerts, Menu. */
  .brand span { display: none; }
  .who { gap: var(--s-2); }
  .who > :not(.alerts) { display: none; }
  .who .alerts { display: inline-flex; align-items: center; height: 44px; padding: 0 var(--s-2); }

  /* Page head stacks, 12 px tighter than on desktop so a two-row action block still leaves the first table within 480 px;
     the secondaries share a row and the primary takes a full row of its own, on every page. */
  .page-head { flex-direction: column; gap: var(--s-2); padding-bottom: var(--s-4); }
  .page-head .tags { margin-top: var(--s-1); }
  .crumbs li:nth-child(n+2) { display: none; }
  .page-actions { width: 100%; }
  .page-actions .btn, .actions .btn { flex: 1 1 auto; }
  .page-actions .btn.primary { flex: 1 1 100%; }
  .page-actions .pop { flex: 1 1 auto; }
  .page-actions .pop > summary { width: 100%; }

  /* Containers. */
  .card { padding: var(--s-4); }
  .card.flush > .card-head { padding: var(--s-3) var(--s-4); }
  .card.flush > .empty, .card.flush > .form, .card.flush > form, .card.flush > .facts, .card.flush > .disclose { padding: var(--s-4); }
  .card.flush > .pad { padding: var(--s-2) var(--s-4) var(--s-3); }
  /* Flags: the plain list under the stats gives way to a closed card after Line items, so the table stays within reach. */
  .flags-wide { display: none; }
  .flags-phone { display: block; }
  .sect.flags-wide + .sect { border-top: 0; margin-top: 0; padding-top: 0; } /* the hidden first section leaves no divider behind */
  /* Card-head tools take a full row under the title, so every card head stacks the same way. */
  .card-head { flex-wrap: wrap; }
  .card-head .tools { flex: 1 1 100%; }
  .card-head .tools > .btn, .card-head .tools > form, .card-head .tools > .pop { flex: 1 1 auto; }
  .card-head .tools > form > .btn, .card-head .tools > .pop > summary { width: 100%; }
  .tabs a { padding: 0 var(--s-2); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .stats { gap: var(--s-3) var(--s-7); }
  .stats li { flex: 1 1 40%; }
  .pager { padding: var(--s-3) var(--s-4); }
  .login { margin-top: 8vh; }

  /* Controls: 44 px targets. */
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  .tools select, .tools input { height: var(--h-ctl-sm); }
  .tag { height: 32px; }
  .tag-x { width: 44px; height: 44px; margin: -6px -10px -6px -4px; }
  .picker-list li .check { min-height: 44px; }
  .picker-placeholder { line-height: 32px; }
  /* The search spans the row; selects, and the Search/Apply and Reset buttons, pair up two per row. */
  .filterbar > input, .filterbar .panel > * { flex: 1 1 100%; width: 100%; }
  .filterbar > select, .filterbar > .btn { flex: 1 1 40%; width: auto; min-width: 0; }
  .filterbar .pop > summary { width: 100%; }
  .pop-panel, .pop .pop-panel.flip-left, .pop .pop-panel.flip-right {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
    border-radius: var(--r-panel) var(--r-panel) 0 0; z-index: var(--z-sheet); padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom));
    max-height: 85vh; overflow-y: auto;
  }

  /* Tables: the row model. Nothing scrolls sideways. */
  th:first-child, td:first-child { padding-left: var(--s-4); }
  th:last-child, td:last-child { padding-right: var(--s-4); }
  tr.group td:first-child { padding-left: var(--s-4); }
  table.rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.rows, table.rows tbody { display: block; }
  table.rows tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); row-gap: var(--s-1);
    padding: var(--s-3) 0; border-bottom: var(--line);
  }
  table.rows tbody tr:last-child { border-bottom: 0; }
  table.rows td { display: block; padding: 0; border: 0; }
  table.rows td.main { grid-column: 1; }
  table.rows td.main > a.ink { display: inline-block; padding: var(--s-3) 0; margin: calc(-1 * var(--s-3)) 0; }
  table.rows td.status { grid-column: 1; }
  table.rows td.keep { grid-column: 2; grid-row: 1; text-align: right; font-weight: 500; }
  table.rows td.x { grid-column: 1; font-size: var(--fs-1); line-height: var(--lh-1); color: var(--n-5); text-align: left; }
  table.rows td.x[data-label]::before { content: attr(data-label) ": "; }
  table.rows td.x[data-label] > div:first-child { display: inline; } /* the label and the first value share a line */
  table.rows td.x:has(> .nil:only-child) { display: none; }         /* a labelled dash says nothing on a phone */
  table.rows td.act { grid-column: 1 / -1; margin-top: var(--s-2); text-align: left; white-space: normal; }
  /* Row actions share the row in equal columns, whether each is a bare button, a form around one, or a popover
     summary; a long label widens only its own column. (A flex basis would count a button's padding and not a form's.) */
  table.rows td.act .row-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: var(--s-2); }
  table.rows td.act .row-actions .btn { width: 100%; }
  table.rows td.act .row-actions .pop > summary { width: 100%; }
  /* The editing row's accent inset moves from the first cell (which has no side padding here) to the row itself. */
  table.rows tr.editing { box-shadow: inset 2px 0 var(--accent); }
  table.rows tr.editing td:first-child { box-shadow: none; }
  /* Cells with no phone role hide. :where() keeps this rule's specificity below the role rules above and the
     group and span rules below, so a role class always wins. */
  table.rows td:where(:not(.main):not(.status):not(.keep):not(.x):not(.act):not(.span)) { display: none; }
  table.rows td.span { display: block; grid-column: 1 / -1; }
  table.rows tr.group { display: block; padding: var(--s-4) 0 var(--s-1); }
  table.rows tr.group td { display: block; padding: 0; }
  table.rows tbody tr:hover > td { background: none; }
  .card.flush > table.rows tr { padding-left: var(--s-4); padding-right: var(--s-4); }
  /* Key-value tables stay tables at 12 px; a 20 px line plus 12 px padding makes each row, and any link in it, 44 px. */
  table.kv { font-size: var(--fs-1); }
  table.kv th, table.kv td { padding: var(--s-2) var(--s-1); }
  table.kv td { padding: var(--s-3) var(--s-1); line-height: var(--lh-2); }
  table.kv td a { display: inline-block; padding: var(--s-3) 0; margin: calc(-1 * var(--s-3)) 0; }
  table.kv th:first-child, table.kv td:first-child { padding-left: var(--s-4); }
  table.kv th:last-child, table.kv td:last-child { padding-right: var(--s-4); }
  .bar { width: 48px; }
  /* Links in dot-word lists, fact rows, meta lines and crumbs get a 44 px hit box without moving the text around them. */
  ul.list li:has(> a, > .status > a) { padding: 0; }
  ul.list li > a, ul.list li > .status > a { display: inline-block; padding: var(--s-3) 0; }
  ul.list li .status:has(> a)::before { margin-top: 19px; } /* 7 px plus the link's 12 px top padding */
  .facts dd a, .meta-line a, .crumbs a, .notes a, .timeline .who a, table.rows td.x a:not(.btn), .alert-group > h2 > a { display: inline-block; padding: 14px 0; margin: -14px 0; }
  ul.alerts li > div > a.ink { display: block; padding: var(--s-3) 0; margin: calc(-1 * var(--s-3)) 0; }
}

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

/* ============================================================================ 26 Refined skin: one type scale, soft surfaces, brand purple as the accent
   Colour, type scale, depth and shape only; layout rules above still hold. One family (Inter), four sizes
   (12 / 14 / 16 / 24 px), three weights (400 / 500 / 600). White text is only used on --brand-1 (7.2:1). */
:root {
  --brand-1: #4a3fd1; --brand-2: #6a5ae8; --brand-dark: #3a30b0;
  --surface: #f7f8fb; --edge: #e6e8f0; --tint: #f5f4ff;
  --fs-0: 12px; --lh-0: 16px;
  --fs-1: 12px; --lh-1: 16px;
  --fs-2: 14px; --lh-2: 22px;
  --fs-3: 16px; --lh-3: 24px;
  --fs-4: 24px; --lh-4: 32px;
  --topbar-h: 60px; --h-ctl: 38px; --h-ctl-sm: 30px;
  --r-panel: 14px; --r-ctl: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lift: 0 4px 8px rgba(16, 24, 40, .05), 0 12px 24px rgba(74, 63, 209, .10);
  --line: 1px solid var(--edge);
}
body { background: var(--surface); letter-spacing: -0.003em; }
h1 { letter-spacing: -0.02em; }

/* Top bar: clean white, the brand stripe as a hairline of colour. */
.topbar { border-top: 3px solid var(--brand-1); border-bottom: 1px solid var(--edge); box-shadow: none; }
.brand img { height: 36px; }
.brand span { color: var(--n-6); font-weight: 500; padding-left: var(--s-2); border-left: 1px solid var(--edge); }
.nav a { border-radius: 8px; color: var(--n-6); }
.nav a:hover { background: var(--n-2); color: var(--n-7); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--brand-dark); font-weight: 600; }
.count.hot { background: var(--brand-1); }
.who .name { color: var(--n-7); }

/* Page head: a soft lavender panel with dark text, not a loud banner. */
.page-head {
  border: 1px solid var(--edge); border-radius: 16px; padding: var(--s-5) var(--s-6);
  background: linear-gradient(135deg, #f1efff 0%, #ffffff 62%); box-shadow: var(--shadow-card);
}
.page-head h1 { font-size: var(--fs-4); line-height: var(--lh-4); color: var(--n-7); }
.page-head .sub { color: var(--n-6); }
.crumbs a { color: var(--brand-dark); }

/* Buttons. */
.btn { border-radius: var(--r-ctl); font-weight: 500; border-color: #d5d8e3; }
.btn:hover { background: var(--n-1); border-color: #b9bed0; }
.btn.primary { background: var(--brand-1); border-color: var(--brand-1); box-shadow: 0 1px 2px rgba(74, 63, 209, .35); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); box-shadow: 0 4px 10px rgba(74, 63, 209, .30); }
.btn.ghost { border-color: transparent; }
.btn.small { font-weight: 500; }

/* Cards. */
.card { border-color: var(--edge); box-shadow: var(--shadow-card); }
.card.flush > .card-head { background: #fff; padding-top: var(--s-4); padding-bottom: var(--s-4); }
.card-head h2 { color: var(--n-7); }

/* Stats: white tiles with a colour-coded left edge. */
.stats { gap: var(--s-4); }
.stats li {
  flex: 1 1 170px; max-width: 260px; background: #fff; border: 1px solid var(--edge); border-left: 4px solid var(--brand-1);
  border-radius: var(--r-panel); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-card); transition: transform var(--t), box-shadow var(--t);
}
.stats li:has(.status.bad) { border-left-color: var(--danger-dot); }
.stats li:has(.status.warn) { border-left-color: var(--warn-dot); }
.stats li:has(.value.zero) { border-left-color: #d5d8e3; }
.stats li:has(a):hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.stats .label { color: var(--n-6); font-weight: 500; }
.stats .value { font-size: 28px; line-height: 36px; color: var(--n-7); font-weight: 600; }
.stats .value.zero { color: var(--n-5); }

/* Tables. */
th { background: #fafbfd; color: var(--n-5); letter-spacing: .05em; border-bottom: 1px solid var(--edge); }
td { border-bottom-color: #eef0f5; }
tbody tr:has(a, button):hover > td { background: #fafaff; }
.pill { height: 22px; line-height: 22px; font-weight: 500; }
span.status::before { width: 8px; height: 8px; }

/* Inputs. */
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(74, 63, 209, .16); outline: none; }

/* Login and message pages: a centred card on the soft background. */
.login { max-width: 400px; margin-top: 10vh; padding: var(--s-7) var(--s-6); background: #fff; border: 1px solid var(--edge); border-radius: 20px; box-shadow: var(--shadow-lift); }
.login > img { height: 32px; }

.bar { height: 6px; border-radius: 3px; background: #e9e8f7; }
.bar > span { background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); border-radius: 3px; }
.bar.over > span { background: var(--danger-dot); }
/* Polish pass: tiles, card heads, section labels, table density, pills, empty states. */
.stats li { border-left-width: 1px; border-top: 3px solid var(--brand-1); }
.stats li:has(.status.bad) { border-top-color: var(--danger-dot); }
.stats li:has(.status.warn) { border-top-color: var(--warn-dot); }
.stats li:has(.value.zero) { border-top-color: var(--edge); }
.stats .label { white-space: normal; text-transform: uppercase; letter-spacing: .04em; font-size: var(--fs-1); }
.stats .value { font-size: var(--fs-4); line-height: var(--lh-4); letter-spacing: -0.02em; }
.card-head h2 { font-size: var(--fs-3); line-height: var(--lh-3); }
.card.flush > .card-head { border-bottom: var(--line); margin-bottom: 0; }
.sect h3 { font-size: var(--fs-1); line-height: var(--lh-1); text-transform: uppercase; letter-spacing: .05em; color: var(--n-5); margin-bottom: var(--s-3); }
.sect + .sect { margin-top: var(--s-4); padding-top: var(--s-4); }
.page-head { padding: var(--s-4) var(--s-6); box-shadow: none; }
main { padding-top: var(--s-5); }
td { padding-top: 10px; padding-bottom: 10px; }
.pill { font-size: var(--fs-0); font-weight: 600; letter-spacing: .01em; }
span.status { font-weight: 500; }
.empty { text-align: center; padding: var(--s-6) var(--s-4); background: var(--surface); border: 1px dashed #d5d8e3; border-radius: var(--r-ctl); color: var(--n-6); }
.card.flush > .empty { margin: var(--s-4) var(--s-5); }
.meta-line { color: var(--n-6); }

@media (max-width: 600px) {
  .page-head { padding: var(--s-4); border-radius: 14px; }
  .stats li { flex: 1 1 calc(50% - var(--s-2)); max-width: none; min-width: 0; padding: var(--s-3) var(--s-4); }
  .stats .label { white-space: normal; }
  .login { margin-top: 4vh; padding: var(--s-5) var(--s-4); }
}
@media (prefers-reduced-motion: reduce) { .stats li { transition: none; } .stats li:has(a):hover { transform: none; } }

/* ============================================================================ 27 Sidebar layout (inspired by the soft lavender dashboard reference)
   From 1200 px the top bar becomes a floating left sidebar with icons; the soft lavender page, rounded pastel tiles and a
   greeting header follow. At 1024 and under nothing moves (the Menu sheet still applies). */
body { background: #f4f3ff; }
.page-head { background: transparent; border: 0; box-shadow: none; padding: var(--s-2) 0 var(--s-3); border-radius: 0; }
.page-head h1 { font-size: 24px; line-height: 32px; font-weight: 600; color: #2b1f5c; }
.page-head::after { display: none; }
.card { border: 0; border-radius: 16px; padding: var(--s-3) var(--s-4); box-shadow: 0 2px 4px rgba(60, 40, 120, .04), 0 12px 32px rgba(60, 40, 120, .08); }
.card.flush > .card-head { background: transparent; }
.stats li { border: 0; border-top: 0; border-radius: 12px; flex: 1 1 130px; max-width: 190px; padding: var(--s-2) var(--s-3); background: #efeafc; box-shadow: none; }
.stats li:has(.status.bad) { background: #fde9ee; }
.stats li:has(.status.warn) { background: #fff1de; }
.stats li:has(.value.zero) { background: rgba(255, 255, 255, .6); }
.stats li:has(a):hover { box-shadow: var(--shadow-lift); }
.stats .value { color: #2b1f5c; }
.stats .value.zero { color: var(--n-5); }
.btn { border-radius: 12px; }
.empty { background: rgba(255, 255, 255, .7); border-radius: 14px; }

@media (min-width: 100000px) { /* left sidebar switched off: the top navigation bar is used at every width */
  body { padding-left: 248px; }
  .topbar { position: fixed; z-index: var(--z-topbar); top: 16px; left: 16px; bottom: 16px; width: 216px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 2px 4px rgba(60, 40, 120, .05), 0 16px 40px rgba(60, 40, 120, .12); }
  .topbar-inner { flex-direction: column; align-items: stretch; gap: var(--s-4); height: 100%; max-width: none; margin: 0; padding: var(--s-5) var(--s-3) var(--s-3); }
  .brand { padding: 0 var(--s-2); }
  .brand img { height: 30px; }
  .brand span { display: none; }
  .nav { flex: 1 1 auto; flex-direction: column; gap: 2px; overflow-y: auto; }
  .nav a, .who .alerts { height: 34px; padding: 0 var(--s-3); border-radius: 8px; gap: 8px; font-size: 13px; display: flex; align-items: center; color: var(--n-6); font-weight: 500; }
  .nav a:hover, .who .alerts:hover { background: #f3f0ff; color: var(--brand-dark); text-decoration: none; }
  .nav a[aria-current="page"], .who .alerts[aria-current="page"] { background: var(--brand-1); color: #fff; box-shadow: none; }
  .nav a[aria-current="page"] .count { background: rgba(255, 255, 255, .25); color: #fff; }
  .nav .count, .who .alerts .count { margin-left: auto; }
  .who { flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--edge); }
  .who .name { display: block; padding: var(--s-2) var(--s-3); border-radius: 12px; background: #f6f3ff; white-space: normal; line-height: 18px; font-size: 13px; }
  .who .name .role { display: block; font-size: var(--fs-1); }
  .who > form .btn { width: 100%; justify-content: flex-start; }
  .sheet { display: none; }
  main { max-width: 1120px; padding-top: var(--s-5); }
}
.stats { gap: var(--s-3); }
.stats .value { font-size: 20px; line-height: 28px; }
.stats .label { font-size: 11px; line-height: 14px; }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: var(--s-3) var(--s-4); }
.card.flush > .empty { margin: var(--s-3) var(--s-4); }
th:first-child, td:first-child { padding-left: var(--s-4); }
th:last-child, td:last-child { padding-right: var(--s-4); }
td { padding-top: 8px; padding-bottom: 8px; }

/* ============================================================================ 28 Compact density (desktop and tablet; phones keep 44 px touch targets)
   One shared scale for every page, tables and controls included: 13 px body, 32 px controls, 26 px small controls. */
@media (min-width: 601px) {
  :root {
    --fs-0: 11px; --lh-0: 16px; --fs-1: 12px; --lh-1: 16px; --fs-2: 13px; --lh-2: 20px; --fs-3: 15px; --lh-3: 22px; --fs-4: 22px; --lh-4: 30px;
    --h-ctl: 32px; --h-ctl-sm: 26px; --r-ctl: 8px; --block-gap: 16px;
  }
  .page-head h1 { font-size: 22px; line-height: 30px; }
  .btn, input, select, textarea { font-size: 13px; }
  .btn { padding: 0 var(--s-3); }
  .btn.small { font-size: 12px; padding: 0 var(--s-2); }
  select { padding-right: var(--s-6); background-position: right 8px center; }
  .filterbar { gap: var(--s-2); margin-bottom: var(--s-4); }
  .filterbar input[type=search] { flex: 1 1 220px; }
  .filterbar select, .filterbar .btn { height: 32px; }
  .filterbar .disclose summary { font-size: 13px; }
  th { padding: 6px var(--s-3); }
  td { padding-top: 8px; padding-bottom: 8px; }
  .stats .value { font-size: 20px; line-height: 28px; }
  .pill { height: 20px; line-height: 20px; font-size: 11px; }
  .card-head h2 { font-size: 15px; line-height: 22px; }
  .page-head { margin-bottom: var(--s-3); padding-bottom: 0; }
  /* Empty states: one quiet line, not a tall dashed box. */
  .empty { padding: var(--s-3) var(--s-4); text-align: left; background: transparent; border: 0; border-radius: 0; font-size: 13px; color: var(--n-5); }
  .card.flush > .empty { margin: 0; padding: var(--s-3) var(--s-4); }
  .disclose > summary, .page-head .disclose summary { font-size: 13px; }
  .card.flush > .card-head { padding: var(--s-3) var(--s-4); }
}

/* Stat tiles: the label stays at the top and the number sits at the bottom, so values line up across a row. */
.stats li { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-2); min-height: 72px; }
.stats li > a { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-2); }
.stats .value { margin-top: auto; }

/* Signed-out pages (sign-in, messages) have no nav: no sidebar, no left offset. */
@media (min-width: 100000px) { /* left sidebar switched off: the top navigation bar is used at every width */
  body:not(:has(.nav)) { padding-left: 0; }
  .topbar:not(:has(.nav)) { display: none; }
}

/* Role badges (ADMIN, DELIVERY HEAD, DM, SDM, SALES) in the sidebar and menu. */
.role-badge { display: inline-block; margin: 2px 4px 0 0; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--brand-dark, #3a30b0); font: 600 10px/18px var(--font); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.role-badge:first-child { margin-left: 0; }
.who .name .role { display: block; }

/* Team form: the delivery managers as a plain, scrollable checklist. */
.checks-scroll { max-height: 280px; overflow-y: auto; padding: var(--s-2) var(--s-3); border: var(--line); border-radius: var(--r-ctl); background: var(--n-0); }
.checks-scroll fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks-scroll legend { padding: 0; margin-bottom: var(--s-2); font-weight: 500; color: var(--n-6); }
.checks-scroll .check { min-height: 32px; padding: 0 var(--s-2); border-radius: var(--r-ctl); }
.checks-scroll .check:hover { background: var(--n-1); }

/* A risk raised by hand reads as a warning: red text on a soft red band. */
.notes.note-risk { display: inline-block; padding: var(--s-1) var(--s-3); border-radius: var(--r-ctl); border-left: 3px solid var(--danger-dot); background: var(--danger-soft); color: var(--danger-text); font-weight: 500; }
.notes.note-risk strong { color: var(--danger-text); }

/* Escalations stand out in red wherever they are listed. */
.hl-red { color: var(--danger-text); font-weight: 600; }
.hl-green { color: var(--ok-text); font-weight: 600; }

/* Flush cards no longer hide what sticks out of them (pop-up panels such as "Add proof" must be able to overflow);
   their corners are rounded on the content instead. */
.card.flush { overflow: visible; }
.card.flush > :first-child { border-top-left-radius: var(--r-panel); border-top-right-radius: var(--r-panel); }
.card.flush > :last-child { border-bottom-left-radius: var(--r-panel); border-bottom-right-radius: var(--r-panel); }
.card.flush > table:first-child thead th:first-child { border-top-left-radius: var(--r-panel); }
.card.flush > table:first-child thead th:last-child { border-top-right-radius: var(--r-panel); }

/* Cross-platform hardening (Windows and Mac, 100% to 150% display scaling).
   - The sidebar needs 1200 px: a Windows laptop at 125% to 150% scaling is often 1100 to 1300 css px wide.
   - A reserved scrollbar gutter stops the layout shifting when Windows' classic scrollbar appears.
   - Cards and tiles get a hairline edge, so they stay visible on low-contrast laptop panels.
   - A short window scrolls inside the sidebar instead of clipping it. */
html { scrollbar-gutter: stable; }
.card { border: 1px solid #e1dff3; }
.stats li { border: 1px solid #e1dff3; border-top-width: 3px; }
.stats li:has(.value.zero) { border-color: #e1dff3; }
@media (min-width: 100000px) { /* left sidebar switched off: the top navigation bar is used at every width */
  .topbar-inner { overflow-y: auto; overflow-x: hidden; }
}

/* With the sidebar open the page content is about 250 px narrower than the window. On windows from 1200 to 1399 px wide
   the optional table columns are dropped (as they are on tablets) so no table forces a sideways scroll. */
@media (min-width: 100000px) and (max-width: 100001px) {
  html:not(.scaled) th.opt, html:not(.scaled) td.opt { display: none; }
  html:not(.scaled) th.main, html:not(.scaled) td.main { min-width: 0; }
}

/* "Set deadline" is highlighted while there is no deadline: it is the next thing to do on the line. */
.btn-attn, .btn-attn:hover { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border-color: var(--brand-1); color: #fff; box-shadow: 0 2px 8px rgba(74, 63, 209, .35); }
.btn-attn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.details.pop[open] > .btn-attn { background: var(--brand-dark); }
/* The small "Move date" control inside the Deadline tile. */
.tile-action { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; line-height: 16px; }
.tile-action .btn { height: 22px; padding: 0 var(--s-2); font-size: 12px; }
.stats .value .pop { display: inline-block; }

/* Long status text inside a table cell (a flag such as "AI Model Training Fee - Per Face, Per Costume (One-Time): due in 2
   days") wraps instead of stretching the table past its card; the dot stays on the first line. */
td span.status { white-space: normal; align-items: flex-start; }
td span.status::before { margin-top: 6px; }
td { overflow-wrap: anywhere; }
td.num, td.act, td.nowrap { overflow-wrap: normal; }
/* The "Set deadline" button is the next step on a line: slightly larger than the other header buttons. */
.page-actions .btn-attn { height: 42px; padding: 0 var(--s-5); font-size: 14px; font-weight: 600; border-radius: 10px; }

/* One tile size everywhere. The width and height no longer depend on how many tiles there are or how much a tile holds, so
   a tile appearing (the Deadline tile after a date is set) never changes the others. */
.stats { display: grid; grid-template-columns: repeat(auto-fill, 184px); gap: var(--s-3); justify-content: start; }
.stats li { width: 184px; max-width: none; flex: none; height: 96px; min-height: 0; padding: 10px 14px; }
.stats .label { max-height: 28px; overflow: hidden; }
.tile-sub { display: flex; align-items: center; gap: var(--s-2); font-size: 12px; font-weight: 400; line-height: 16px; margin-top: 2px; }
.tile-sub .btn { height: 20px; padding: 0 var(--s-2); font-size: 12px; }
.tile-sub .pop { display: inline-block; }
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li { width: auto; }
}

/* Alerts: read/unread filter and a grey Read button on every unread alert. */
.seg { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 var(--s-4); background: #fff; border: 1px solid #e1dff3; border-radius: 10px; }
.seg a { padding: 4px 12px; border-radius: 8px; color: var(--n-6); font-weight: 500; text-decoration: none; }
.seg a:hover { background: var(--n-2); color: var(--n-7); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--accent-soft); color: var(--brand-dark); font-weight: 600; }
.alert-side { display: flex; align-items: center; gap: var(--s-3); }
.btn.btn-grey { background: #e9eaee; border-color: #e9eaee; color: #4b5563; box-shadow: none; }
.btn.btn-grey:hover { background: #dcdee4; border-color: #dcdee4; color: #374151; }

/* Stat tiles: 168 px wide so the six tiles of the Head's dashboard fit on one row at the standard page width. */
.stats { grid-template-columns: repeat(auto-fill, 168px); }
.stats li { width: 168px; padding: 10px 12px; }
.tile-sub { gap: 6px; }
@media (max-width: 600px) { .stats li { width: auto; } }

/* The alerts filter is centred and stretched across the page, with three equal segments. */
.seg { display: flex; width: min(100%, 640px); margin: 0 auto var(--s-5); padding: 4px; }
.seg a { flex: 1 1 0; text-align: center; padding: 8px 16px; }

/* Shorter tiles: the label sits on top, the value right under it, with no empty band between them. */
.stats li { height: 72px; padding: 6px 12px 7px; gap: 2px; }
.stats .label { max-height: 28px; }
.tile-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tile-row .btn { height: 22px; padding: 0 var(--s-2); font-size: 12px; font-weight: 500; }
.tile-row .pop { display: inline-block; }

/* 29. Shorter stat tiles: the value sits right under the label instead of being pushed to the bottom. */
.stats li { height: 62px; padding: 5px 12px 4px; gap: 0; justify-content: flex-start; }
.stats li > a { gap: 0; justify-content: flex-start; }
.stats .label { max-height: 26px; line-height: 13px; }
.stats .value { margin-top: 0; font-size: 20px; line-height: 24px; }
.tile-row { min-height: 24px; }

/* 30. Alerts filter: same height and radius as the filter controls on Audit and Projects. */
.seg { display: inline-flex; width: auto; margin: 0 0 var(--s-4); padding: 2px; height: var(--h-ctl); border-radius: var(--r-ctl); align-items: stretch; }
.seg a { flex: none; display: inline-flex; align-items: center; padding: 0 var(--s-4); border-radius: calc(var(--r-ctl) - 2px); }

/* 31. Alerts filter: standard control height, but centred and stretched across the page. */
.seg { display: flex; width: min(100%, 640px); margin: 0 auto var(--s-4); }
.seg a { flex: 1 1 0; justify-content: center; }

/* 32. Stat tiles, compact padded size: label on top, value at the bottom, one-line labels. */
.stats { grid-template-columns: repeat(auto-fill, 200px); }
.stats li { width: 200px; height: 80px; padding: 12px 16px; gap: 0; justify-content: space-between; }
.stats li > a { gap: 0; justify-content: space-between; }
.stats .label { font-size: 10.5px; letter-spacing: .03em; line-height: 14px; max-height: 28px; }
.stats .value { margin-top: auto; font-size: 22px; line-height: 28px; }
.tile-row { min-height: 28px; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats li { width: auto; } }

/* 33. Six tiles must fit one row at the 1440 design width (1120px of content). */
.stats { grid-template-columns: repeat(auto-fill, 176px); gap: var(--s-2); }
.stats li { width: 176px; padding: 12px 14px; }
.stats .label { letter-spacing: .02em; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats li { width: auto; } }

/* 34. 170px so six tiles fit the 1072px content width in one row. */
.stats { grid-template-columns: repeat(auto-fill, 170px); }
.stats li { width: 170px; padding: 12px; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats li { width: auto; } }

/* 35. Alert group headings carry the project name beside the code. */
.alert-group > h2 .alert-group-name { font-weight: 500; color: var(--n-6); }

/* 36. Projects: the filter bar stays fixed at the top of the page while the list scrolls, with the column headers just under it. */
.filterbar.pinned { position: sticky; top: 0; z-index: calc(var(--z-th) + 1); background: #f4f3ff; margin-bottom: 0; padding: var(--s-3) 0 var(--s-2); }
table.sticky thead th { top: var(--pin-h, 0px); }

/* 37. The DM list on the Team form collapses to a one-line summary after a tick. */
details.dm-pick { margin-bottom: var(--s-4); }
details.dm-pick > summary { display: block; width: 100%; text-align: left; font-weight: 500; cursor: pointer; list-style: none; }
details.dm-pick > summary::-webkit-details-marker { display: none; }
details.dm-pick[open] > summary { margin-bottom: var(--s-2); }

/* 38. The chosen-DMs summary: text centred vertically in the control. */
details.dm-pick > summary { display: flex; align-items: center; min-height: var(--h-ctl); height: auto; padding: 0 var(--s-3); line-height: 1.3; }

/* 39. Project timeline by line item (Gantt): name column, month header, bars filled to progress, today line. */
.tl-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: 0 var(--s-4) var(--s-3); color: var(--n-6); font-size: 12px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-key { display: inline-block; width: 18px; height: 8px; border-radius: 4px; }
.tl-key.ok { background: #5b50e6; } .tl-key.risk { background: #e0a23c; } .tl-key.bad { background: #dc4d65; } .tl-key.done { background: #34a56b; }
.tl-scroll { overflow-x: auto; padding: 0 var(--s-4) var(--s-4); }
.tl { --lab: 230px; min-width: 760px; position: relative; }
.tl-head { display: grid; grid-template-columns: var(--lab) 1fr; border-top: 1px solid #eceaf8; border-bottom: 1px solid #eceaf8; }
.tl-head .hd { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--n-6); font-weight: 600; padding: 8px 0; }
.tl-months { display: grid; }
.tl-months span { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--n-6); font-weight: 600; padding: 8px 0 8px 8px; border-left: 1px solid #eceaf8; }
.tl-body { position: relative; }
.tl-over { position: absolute; left: var(--lab); right: 0; top: 0; bottom: 0; pointer-events: none; }
.tl-grid { position: absolute; inset: 0; display: grid; }
.tl-grid span { border-left: 1px solid #eceaf8; }
.tl-today { position: absolute; top: 0; bottom: 0; left: var(--today); border-left: 2px dashed #dc4d65; z-index: 3; }
.tl-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 600; color: #dc4d65; background: #fff; padding: 0 4px; border-radius: 4px; }
.tl-row { display: grid; grid-template-columns: var(--lab) 1fr; border-bottom: 1px solid #f1effa; }
.tl-row:last-child { border-bottom: 0; }
.tl-lab { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px var(--s-3) 8px 0; }
.tl-lab a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-lab small { color: var(--n-6); font-size: 11px; line-height: 16px; }
.tl-track { position: relative; min-height: 52px; }
.tl-bar { position: absolute; top: 15px; height: 22px; border-radius: 7px; overflow: hidden; background: #e4e1fa; }
.tl-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6a5ff0, #4a3fd1); border-radius: 7px 0 0 7px; }
.tl-bar span { position: absolute; left: 9px; top: 0; line-height: 22px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.tl-bar.risk { background: #fcebcf; } .tl-bar.risk .tl-fill { background: linear-gradient(90deg, #ecb04f, #d98f22); }
.tl-bar.bad { background: #fbdde3; } .tl-bar.bad .tl-fill { background: linear-gradient(90deg, #e8647a, #d03f58); }
.tl-bar.done { background: #d7efe2; } .tl-bar.done .tl-fill { background: linear-gradient(90deg, #46b97e, #2d9a64); }
.tl-bar.idle { background: #ebe9f8; }
.tl-dot { position: absolute; top: 22.5px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #2b1f5c; z-index: 2; box-sizing: border-box; }
.tl-dot.hollow { background: #fff; border-color: #8a82e0; }
.tl-dot:not(.hollow) { background: #2b1f5c; }
.tl-legend .tl-dot, .tl-legend .tl-diamond { position: static; display: inline-block; }
.tl-diamond { position: absolute; top: 19px; width: 14px; height: 14px; background: #2b1f5c; transform: rotate(45deg); border-radius: 3px; z-index: 2; border: 2px solid #fff; box-sizing: border-box; }
.tl-diamond.bad { background: #dc4d65; }
.tl-nodate { position: absolute; top: 19px; color: var(--n-5); font-size: 11px; white-space: nowrap; }

/* 40. Timeline: closer to the portfolio sample: slimmer rows, plain bars with the percentage inside, no markers on the bar. */
.tl { --lab: 220px; }
.tl-track { min-height: 44px; }
.tl-row .tl-lab { padding: 6px var(--s-3) 6px 0; }
.tl-bar { top: 11px; height: 22px; border-radius: 6px; }
.tl-fill { border-radius: 6px 0 0 6px; }
.tl-bar.open { opacity: .75; }
.tl-bar span.dim { color: #6f67c9; }
.tl-bar.risk span.dim { color: #9a6a12; } .tl-bar.bad span.dim { color: #a8324a; } .tl-bar.done span.dim { color: #23704a; }
.tl-lab small.late { color: #b42a42; }

/* 41. Portfolio: columns per status for each DM, DM cards, and the projects and line items under each DM. */
.pf-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: 0 var(--s-4); color: var(--n-6); font-size: 12px; }
.pf-legend span, .pf-card li span { display: inline-flex; align-items: center; gap: 6px; }
.pf-legend i, .pf-card li i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.pf-chart { position: relative; height: 260px; margin: 26px var(--s-4) 0 calc(var(--s-4) + 34px); display: flex; align-items: flex-end; border-bottom: 1px solid #e1dff3; }
.pf-y span { position: absolute; left: -34px; width: 28px; text-align: right; font-size: 11px; color: var(--n-5); transform: translateY(50%); }
.pf-gl { position: absolute; left: 0; right: 0; border-top: 1px solid #eceaf8; }
.pf-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.pf-grp { display: flex; align-items: flex-end; gap: 3px; height: 100%; justify-content: center; width: 86%; }
.pf-grp div { position: relative; flex: 0 1 18px; border-radius: 5px 5px 0 0; min-width: 6px; }
.pf-grp div b { position: absolute; top: -16px; left: -4px; right: -4px; text-align: center; font-size: 10px; color: var(--n-6); font-weight: 600; }
.pf-xl { display: flex; margin: 0 var(--s-4) var(--s-4) calc(var(--s-4) + 34px); }
.pf-xl div { flex: 1; text-align: center; font-size: 12px; padding-top: 6px; line-height: 16px; min-width: 0; }
.pf-xl small { display: block; color: var(--n-5); font-size: 11px; }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-3); margin: var(--s-4) 0; }
.pf-card { border: 1px solid #e1dff3; border-radius: 14px; padding: 12px 14px; background: #fff; }
.pf-card h3 { margin: 0 0 2px; font-size: 14px; }
.pf-big { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; color: #2b1f5c; }
.pf-big span { font-size: 12px; font-weight: 500; color: var(--n-6); letter-spacing: 0; }
.pf-mix { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #eef0f5; min-width: 120px; margin: 6px 0; }
.pf-card ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.pf-card li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px solid #eceaf8; }
.pf-dm > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); list-style: none; }
.pf-dm > summary::-webkit-details-marker { display: none; }
.pf-dm > summary .pf-mix { width: 200px; flex: none; }
.pf-projects { padding: 0 var(--s-4) var(--s-4); }
.pf-project { border-top: 1px solid #eceaf8; padding: var(--s-3) 0; }
.pf-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-2); }
.pf-pm { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; font-size: 12px; }
.pf-lines { width: 100%; }
.pf-lines th.num, .pf-lines td.num { text-align: right; }
.pf-nolines { margin: 0; }
.pf-lines { table-layout: fixed; }
.pf-lines th:nth-child(1) { width: 34%; } .pf-lines th:nth-child(2) { width: 18%; } .pf-lines th:nth-child(3) { width: 18%; } .pf-lines th:nth-child(4) { width: 18%; } .pf-lines th:nth-child(5) { width: 12%; }
.pf-lines td { overflow: hidden; text-overflow: ellipsis; }
.pf-xl small b { color: #2b1f5c; }
.pf-dm > summary > svg { flex: none; }

/* 42. Portfolio: the DM's projects in a list on the left, the chosen project's details and line items on the right. */
.pf-md { display: grid; grid-template-columns: 300px 1fr; border-top: 1px solid #e1dff3; min-height: 280px; }
.pf-md > aside { border-right: 1px solid #e1dff3; background: #faf9ff; }
.pf-md > aside a { display: block; padding: 11px 14px; border-bottom: 1px solid #eceaf8; color: inherit; text-decoration: none; }
.pf-md > aside a:hover { background: #f3f1fd; }
.pf-md > aside a.on { background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.pf-md > aside a b { display: block; color: #2b1f5c; font-weight: 600; line-height: 18px; }
.pf-md > aside a small { display: block; color: var(--n-6); font-size: 12px; }
.pf-li { display: flex; align-items: center; gap: var(--s-2); margin-top: 4px; flex-wrap: wrap; }
.pf-panels { padding: var(--s-4) var(--s-5); min-width: 0; }
.pf-panel h3 { margin: 0; font-size: 15px; }
.pf-panel .meta-line { margin: 2px 0 var(--s-3); }
.pf-facts { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin: 0 0 var(--s-4); }
.pf-facts dt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--n-6); }
.pf-facts dd { margin: 2px 0 0; font-weight: 600; color: #2b1f5c; }
.pf-md.md-on .pf-panel { display: none; }
.pf-md.md-on .pf-panel.on { display: block; }
.pf-panel + .pf-panel { margin-top: var(--s-5); border-top: 1px solid #eceaf8; padding-top: var(--s-4); }
.pf-md.md-on .pf-panel + .pf-panel { margin-top: 0; border-top: 0; padding-top: 0; }
@media (max-width: 760px) { .pf-md { grid-template-columns: 1fr; } .pf-md > aside { border-right: 0; border-bottom: 1px solid #e1dff3; } }

/* 43. Timeline: date brackets inside each month, and the exact date on the Today marker. */
.tl-months span.tl-mname { display: block; padding: 8px 0 2px 8px; border: 0; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--n-6); font-weight: 600; }
.tl-mo { border-left: 1px solid #dcd9f2; min-width: 0; }
.tl-brk { display: grid; padding-bottom: 6px; }
.tl-brk i { font-style: normal; font-size: 9.5px; line-height: 14px; color: var(--n-5); text-align: center; border-left: 1px solid #eceaf8; overflow: hidden; white-space: nowrap; }
.tl-brk i:first-child { border-left: 0; }
.tl-months.dense .tl-brk i { color: transparent; }
.tl-months { align-items: stretch; }
.tl-grid span { display: grid; border-left: 1px solid #dcd9f2; }
.tl-grid span i { border-left: 1px dotted #e6e4f6; }
.tl-grid span i:first-child { border-left: 0; }
.tl-today span { white-space: nowrap; }

/* 44. Timeline: only the dates 5, 10, 15, 20 and 25 are shown inside a month, on a faint line, instead of date brackets. */
.tl-brk { position: relative; display: block; height: 18px; padding: 0; }
.tl-brk i { position: absolute; top: 0; transform: translateX(-50%); border: 0; font-size: 10px; line-height: 14px; color: var(--n-5); text-align: center; overflow: visible; }
.tl-grid span { position: relative; display: block; }
.tl-grid span i { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dotted #e6e4f6; }

/* 45. Teams tab: one form per team. */
.pf-team { padding: var(--s-4) var(--s-5); border-top: 1px solid #eceaf8; max-width: 640px; }
.pf-team h3 { margin: 0 0 var(--s-3); }
.pf-team-del { margin-top: calc(-1 * var(--s-2)); }
.pf-team-del { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid #eceaf8; }

/* 46. Timeline zoom: pick a month and the chart widens so that month fills the card; the line-item column stays put. */
.tl-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: 0 var(--s-4) var(--s-3); }
.tl-zoom[hidden] { display: none; }
.tl-zl { font-size: 12px; color: var(--n-6); margin-right: 2px; }
.tl-zoom .btn.on { background: var(--accent-soft); color: var(--brand-dark); border-color: transparent; font-weight: 600; }
.tl-row .tl-lab, .tl-head .hd { position: sticky; left: 0; z-index: 5; background: #fff; }

/* 47. Teams: one row per team (name, lead, headcount); open a row for its members and to edit it. */
.pf-trow { border-top: 1px solid #eceaf8; }
.pf-trow > summary { display: flex; align-items: center; gap: var(--s-3); padding: 14px var(--s-5); cursor: pointer; list-style: none; }
.pf-trow > summary::-webkit-details-marker { display: none; }
.pf-trow > summary:hover { background: #faf9ff; }
.pf-tname { font-weight: 600; color: #2b1f5c; }
.pf-tmeta { color: var(--n-6); font-size: 12px; margin-left: auto; }
.pf-tbody { padding: 0 var(--s-5) var(--s-5) calc(var(--s-5) + 24px); max-width: 720px; }
.pf-tmembers h4 { margin: 0 0 var(--s-2); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--n-6); }
.pf-tmembers ul { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pf-tmembers li { background: #f1effa; border-radius: 999px; padding: 2px 12px; font-size: 13px; color: #2b1f5c; }
.pill-lead { margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #3a30b0; background: #fff; border-radius: 999px; padding: 0 6px; }
.pf-trow .pf-team-del { margin-top: var(--s-3); }
.tl-step { min-width: 32px; font-size: 16px; line-height: 1; padding: 0 var(--s-2); }

/* 48. Dashboard: "N more" opens the rest of the list in place. */
details.more-rows > summary { cursor: pointer; list-style: none; color: var(--brand-dark); font-size: 13px; padding: var(--s-2) 0; }
details.more-rows > summary::-webkit-details-marker { display: none; }
details.more-rows > summary:hover { text-decoration: underline; }
details.more-rows[open] > summary { margin-bottom: var(--s-1); }

/* 49. Admin users: the search box sits at the top right of the card header. */
.user-search { margin: 0; }
.user-search input[type=search] { width: 240px; height: var(--h-ctl-sm, 30px); }
#users-list tr[hidden] { display: none; }

/* The "N more" line goes away once the list is open; "Show fewer" closes it again. */
details.more-rows[open] > summary { display: none; }

/* One typeface everywhere (Open Sans), three heading sizes and one body size, kept as one block at the end so it wins over the earlier
   per-component rules, including the small-screen ones.
   Page title 22px, section heading 16px, sub-heading 14px (all in weight 600, the same as the order form), body 13px, small text 12px. */
h1, .page-head h1, .login h1 { font-family: var(--font); font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; color: var(--n-7); }
h2, .card-head h2, .alert-group > h2 { font-family: var(--font); font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: 0; color: var(--n-7); }
h3, .sect h3 { font-family: var(--font); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--n-7); }
html, body, button, input, select, textarea, table, th, td, label, legend, summary, a, span, p, li, dt, dd, small, caption { font-family: var(--font); }
pre, pre.json, code { font-family: var(--font-mono); }

/* Stat tiles: every tile has the same plain base (the one "At risk" and "Blocked" have), no red or amber fill and no severity dot.
   On hover the tile lifts 4px off the page and takes the palest lavender under a soft purple shadow. */
.stats li, .stats li:has(.status.bad), .stats li:has(.status.warn), .stats li:has(.value.zero), .stats li:has(a) {
  background: rgba(255, 255, 255, .7); border: 1px solid #e1dff3; border-top: 3px solid #c9c4ee; box-shadow: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.stats .label.status::before { display: none; }
.stats .label.status { padding-left: 0; }
.stats li:hover, .stats li:has(.status.bad):hover, .stats li:has(.status.warn):hover, .stats li:has(.value.zero):hover, .stats li:has(a):hover {
  transform: translateY(-4px); background: #fff; border-color: var(--brand-1);
  box-shadow: 0 10px 22px rgba(74, 63, 209, .12);
}
.stats li a, .stats li a:hover, .stats li a:hover .value, .stats li a:hover .label { text-decoration: none !important; }
@media (prefers-reduced-motion: reduce) { .stats li:hover { transform: none; } }

/* Dashboard sections: each card's header sits on the same light-purple band with a purple title, so sections read as separate blocks.
   "Needs attention" has no band and its title is red. */
.card.dash-card > .card-head { background: #f1effc; border-bottom: 1px solid #e1dff3; border-radius: 16px 16px 0 0; }
.card.dash-card > .card-head h2 { color: #3a30b0; }
.card.dash-card.dash-attention > .card-head { background: transparent; border-bottom: 0; border-radius: 0; }
.card.dash-card.dash-attention > .card-head h2 { color: #dc2626; }

/* Smaller section headings: the Incoming lists and the DM names on Portfolio use 14px instead of 16px, with tighter header padding. */
.card.compact-head > .card-head h2, .pf-dm > summary h2 { font-size: 14px; line-height: 20px; }
.card.flush.compact-head > .card-head { padding-top: var(--s-3); padding-bottom: var(--s-3); }
.pf-dm > summary .sub { font-size: 12px; line-height: 16px; }
.pf-dm > summary.card-head, .card.flush.pf-dm > summary.card-head { padding-top: var(--s-3); padding-bottom: var(--s-3); }

/* Table rows: a visible divider between every row and a stronger rule under the header, so rows do not blend into the card. */
table:not(.kv) td { border-bottom: 1px solid #c8c3e4; }
table:not(.kv) th { border-bottom: 1px solid #b5afdc; }
table:not(.kv) tbody tr:last-child td { border-bottom: 0; }

/* Timeline: every date when zoomed in; a drag handle on the end of a bar; the dialog that asks why a deadline moves. */
.tl-brk i, .tl-grid span i { display: none; }
.tl-brk i.mk, .tl-grid span i.mk, .tl.all-days .tl-brk i, .tl.all-days .tl-grid span i { display: block; }
.tl.all-days .tl-brk i { font-size: 10px; }
.tl-bar[data-line] { overflow: visible; }
.tl-grip { position: absolute; top: -2px; bottom: -2px; right: -5px; width: 12px; cursor: ew-resize; touch-action: none; z-index: 4; border-radius: 6px; }
.tl-grip::after { content: ''; position: absolute; top: 5px; bottom: 5px; left: 4px; width: 4px; border-radius: 2px; background: #2b1f5c; opacity: 0; transition: opacity .15s; }
.tl-bar:hover .tl-grip::after, .tl-bar.dragging .tl-grip::after { opacity: .55; }
.tl-bar.dragging { box-shadow: 0 0 0 2px var(--brand-1); }
.tl-dialog { border: 1px solid #e1dff3; border-radius: 16px; padding: 20px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(60, 40, 120, .25); }
.tl-dialog::backdrop { background: rgba(20, 20, 43, .35); }
.tl-dialog h3 { margin: 0 0 4px; }
.tl-dialog .field { display: block; margin-top: 12px; }
.tl-dialog .actions { display: flex; gap: 8px; margin-top: 16px; }
.tl.all-days .tl-months.dense .tl-brk i { color: var(--n-6); }
.tl-months.half .tl-brk i.mk:not(.hf) { color: transparent; }
.tl.all-days .tl-months.half .tl-brk i, .tl.all-days .tl-months.dense .tl-brk i { color: var(--n-6); }

/* The drag handle is always visible (not only on hover) so people can find it. */
.tl-grip::after { opacity: .5; }
.tl-key.grip { width: 4px; height: 14px; background: #2b1f5c; opacity: .5; }
.tl-hint { margin-left: auto; }

/* Working today: a round tick, filled green once ticked. DMs click it; everyone else sees it with the names beside it. */
.tick-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1.5px solid var(--n-4); background: #fff; color: #cfd3dc; cursor: pointer; }
.tick-btn .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.tick-btn:hover { border-color: #2d9a64; color: #9bd3b5; }
.tick-btn.on { background: #2d9a64; border-color: #2d9a64; color: #fff; }
.tick-btn.on:hover { background: #247e52; color: #fff; }
.tick-btn.static { cursor: default; }
.work-today .meta-line { margin-top: 4px; }
.tick-btn.static:not(.on):hover { border-color: var(--n-4); color: #cfd3dc; }

/* Centred column (Working today): heading and icon sit in the middle. */
th.ctr, td.ctr { text-align: center; }
td.ctr .work-today { display: flex; flex-direction: column; align-items: center; }
td.ctr .work-today .meta-line { text-align: center; }

/* The tick sits on the same line as the "Post an update" button: both are centred in a row as tall as a small control. */
td.ctr .work-today, td.ctr > .tick-btn { margin-top: 0; }
td.ctr .tick-btn { margin-top: calc((var(--h-ctl-sm) - 22px) / 2); margin-bottom: calc((var(--h-ctl-sm) - 22px) / 2); }

/* Shrink-to-fit columns: as wide as their content plus the usual padding, so the space between columns stays the same. */
th.fit, td.fit { width: 1%; white-space: nowrap; }

/* Centred columns: pills, bars and the status stack centre too, not only plain text. */
td.ctr .state-stack { align-items: center; }
td.ctr .pill-row { justify-content: center; }
td.ctr .row-actions { justify-content: center; }

th.lft, td.lft, td.act.lft { text-align: left; }
td.lft .row-actions { justify-content: flex-start; }

/* Projects list: a wide table that scrolls inside its own frame; the header stays put while the rows scroll. */
.table-scroll { overflow: auto; max-height: calc(100vh - 230px); border-top: var(--line); }
.table-scroll table.rows.wide { width: max-content; min-width: 100%; }
.table-scroll table.sticky thead th { top: 0; }
.table-scroll td, .table-scroll th { white-space: normal; }
.table-scroll td.fit, .table-scroll th.fit { width: auto; }
.update-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
/* A pen button: the words show on hover or focus. */
.btn.icon-btn { position: relative; width: 32px; padding: 0; justify-content: center; }
.btn.icon-btn::after {
  /* To the left of the icon, so it never slides under the sticky table header (above) or gets cut off at the bottom of the table. */
  content: attr(data-tip); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  background: var(--n-3); color: var(--n-7); border: 1px solid var(--n-4); font-size: var(--fs-1); line-height: 16px; padding: 4px 8px; border-radius: 6px;
  box-shadow: 0 2px 6px rgba(20, 20, 43, .12); z-index: 5; opacity: 0; transition: opacity var(--t);
}
.btn.icon-btn:hover::after, .btn.icon-btn:focus-visible::after { opacity: 1; }
.pop[open] > .icon-btn::after { opacity: 0; }

/* The scrolling table is a framed grid: an outline round it and a hairline between columns. */
.table-scroll { border: 1px solid var(--n-4); border-radius: var(--r-panel); background: var(--n-0); }
.table-scroll th, .table-scroll td { border-right: var(--line); }
.table-scroll th:last-child, .table-scroll td:last-child { border-right: 0; }
.table-scroll tbody tr:last-child td { border-bottom: 0; }

/* The priority word in the page head is the same size as the tags beside it; the raised-risk note is a compact tag. */
.tags .prio { font-size: var(--fs-0); letter-spacing: .01em; }
.notes.note-risk { padding: 2px var(--s-2); font-size: inherit; line-height: inherit; font-weight: 500; } /* same size as the plain note above it (On hold) */

/* The project type is a purple tag. */
.pill.info { background: var(--accent-soft); color: var(--accent-text); }

.type-purple { color: var(--accent-text); font-weight: 600; }

/* The status dropdown on each Projects row: compact. */
.status-pick { display: flex; align-items: center; gap: var(--s-2); margin: 0; }
.status-pick select { height: 26px; min-height: 26px; padding: 0 22px 0 8px; font-size: var(--fs-1); line-height: 1; width: auto; min-width: 0; max-width: 104px; background-position: right 6px center; }
/* The status dropdown fills its column. */
.status-pick { display: block; width: 100%; }
.status-pick select { width: 100%; max-width: none; min-width: 0; }
/* The scrolling table is the containing block for its hidden screen-reader text, so nothing in it can widen the page. */
.table-scroll { position: relative; }

/* Timeline table: line items plain, micros italic, a + on the header for new columns. */
.tt .card-head .row { gap: 8px; }
.tt > .table-scroll { max-height: 420px; margin: 4px 24px 24px; }
.tt .tt-micro { font-style: italic; }
.tt .tt-micro:first-child { padding-left: 32px; }
.tt .tt-cell { width: 100%; min-width: 140px; border: 0; background: transparent; font: inherit; padding: 4px 0; }
.tt .tt-micro .tt-cell { font-style: italic; }
.tt .tt-cell:focus { outline: 1px solid var(--accent, #4b3fd1); background: #faf9ff; border-radius: 4px; }
.tt .tt-micrbtn { font-size: 12px; color: #4b3fd1; background: none; border: 0; cursor: pointer; padding: 2px 0; white-space: nowrap; }
.tt .tt-micrbtn:hover { text-decoration: underline; }
.tt .tt-delbtn { font-size: 12px; color: #b3261e; background: none; border: 0; cursor: pointer; padding: 2px 0 2px 12px; white-space: nowrap; }
.tt .tt-delbtn:hover { text-decoration: underline; }
.tt .tt-plus { width: 48px; }
.tt .tt-plusbtn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #cfcfe6; background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.tt-dialog { width: min(640px, calc(100vw - 32px)); }
.tt-prev { margin-top: 14px; border: 1px dashed #cfcfe6; border-radius: 10px; padding: 10px; background: #fafaff; }
.tt-prev .table-scroll { max-height: 260px; margin-top: 6px; border: 0; }
.tt-prev .tt-new td { background: #efecff; }

.tt .tt-cell, .tt td { font-size: inherit; font-weight: 400; }
.tt input.tt-cell { font-size: inherit; line-height: inherit; }
.tt .tt-item:first-child .tt-cell, .tt td.tt-item:first-child { font-weight: 500; }

/* Compact rows, as in the Projects table: the cell padding does the spacing, the inputs add none. */
.tt table.rows td { vertical-align: middle; }
.tt .tt-cell { padding: 0; min-height: 0; height: 20px; line-height: 20px; }
.tt .tt-micrbtn { padding: 0; line-height: 20px; }
.tt .tt-plusbtn { width: 24px; height: 24px; font-size: 15px; }
.tt th.tt-plus { padding-top: 4px; padding-bottom: 4px; }

/* A micro's name and extra columns are italic; its delivery date is normal. */
.tt td.tt-micro:nth-child(2), .tt td.tt-micro:nth-child(2) .tt-cell { font-style: normal; }

/* ============================================================================ Navigation bar
   The Nexus name in Open Sans Bold (black, as on the Collections portal) with the TrueFan AI logo to its right; thin lines between the tabs and a
   violet underline under the active one. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.brand { gap: 10px; margin-right: var(--s-2); }
.brand .brand-mark { height: 30px; width: 30px; }
.brand .brand-word { font: 700 17px/1.2 var(--font); letter-spacing: -.01em; padding: 0; border: 0; margin-left: -2px; color: var(--n-7); }
/* The TrueFan AI logo sits to the right of the name, after a thin divider. */
.brand .brand-by { display: flex; align-items: center; height: 26px; margin-left: 2px; padding: 0 0 0 12px; border: 0; border-left: 1px solid #d9d6ee; }
.brand .brand-sub { height: 17px; width: auto; display: block; }
/* Tabs: a thin line between each, and a violet underline under the one you are on. */
.topbar-inner { gap: var(--s-4); }
.nav { flex: 0 0 auto; gap: 0; align-items: center; }
.nav a { position: relative; height: 34px; padding: 0 11px; border-radius: 0; border-left: 1px solid #d9d6ee; font-size: 13.5px; background: none; }
.nav a:first-child { border-left: 0; }
.nav a:hover { background: #f6f5fe; color: var(--n-7); }
.nav a[aria-current="page"] { background: none; color: var(--brand-dark); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: calc(-1 * (var(--topbar-h) - 1px - 34px) / 2);
  height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-1);
}
.who { margin-left: auto; }
/* On phones the name stays beside the mark (the older rule hid it); the TrueFan logo gives way so the bar fits. */
@media (max-width: 600px) { .brand .brand-word { display: block; } .brand .brand-by { display: none; } }

/* Attendance grid: editors down the side, working days across, scrolling to the right. */
.att-filter { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-3); margin: 0 0 var(--s-4); }
.att-filter label { display: grid; gap: 4px; font-size: 13px; color: var(--n-600, #5b5f73); }
.att-scroll { overflow-x: auto; border: 1px solid var(--n-200, #e3e3f0); border-radius: 12px; background: var(--n-0, #fff); }
.att-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.att-grid th, .att-grid td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--n-100, #eeeef7); white-space: nowrap; }
.att-grid thead th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--n-600, #5b5f73); background: var(--n-0, #fff); }
.att-grid tbody tr:last-child td { border-bottom: 0; }
.att-sticky { position: sticky; background: var(--n-0, #fff); z-index: 2; }
.att-c1 { left: 0; min-width: 180px; }
.att-c2 { left: 180px; min-width: 150px; border-right: 1px solid var(--n-200, #e3e3f0); }
.att-grid td.att-today, .att-grid th.att-today { background: #f5f3fe; }
.att-edit { display: grid; gap: 6px; min-width: 150px; }
.att-edit select, .att-edit input { width: 100%; }
.att-pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.att-present { background: #e7f6ee; color: #166534; }
.att-absent { background: #fde4e2; color: #b3261e; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.att-sub { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--n-500, #7a7e92); }
.att-grid thead th { text-align: center; }
.att-grid thead th.att-sticky { text-align: left; }
.att-grid td:not(.att-sticky) { text-align: center; }
.att-grid td .att-edit { text-align: left; }
/* Attendance: columns hug their content; the controls in the open day are compact. */
.att-grid { min-width: 0; }
.att-grid th, .att-grid td { padding: 8px 12px; }
.att-edit { min-width: 0; width: 132px; gap: 4px; }
.att-edit select, .att-edit input { padding: 4px 8px; font-size: 13px; min-height: 0; height: 30px; }
.att-grid td:not(.att-sticky):not(.att-today), .att-grid th:not(.att-sticky):not(.att-today) { min-width: 90px; }

/* Stat cards: the Utilization subtitle ("Under utilization by ₹X") may need more room, so every card in the row grows with the
   tallest one (grid rows stretch their cards), the label is never squeezed out, and the cards are a little wider. */
.stats .label { flex-shrink: 0; }
.stats li { height: auto; min-height: 80px; }
@media (min-width: 601px) {
  .stats { grid-template-columns: repeat(auto-fill, 208px); }
  .stats li { width: 208px; }
}

/* Staging role walkthrough */
.demo-walk { min-width: 0; display: grid; gap: var(--s-2); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line, #e5e7eb); }
.demo-walk h2 { font-size: 1rem; margin: 0; }
.demo-walk form { min-width: 0; }
.demo-walk p { margin: 0; overflow-wrap: anywhere; }
.demo-walk .btn { box-sizing: border-box; width: 100%; max-width: 100%; white-space: normal; height: auto; min-height: 44px; padding-block: var(--s-2); flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
.demo-switch, .who > .demo-switch { display: block; position: fixed; right: 16px; bottom: 16px; z-index: 60; }
.demo-switch summary { list-style: none; cursor: pointer; background: #fff; border: 1px solid var(--edge, #e5e7eb); border-radius: 999px; padding: 8px 14px; font-weight: 600; box-shadow: 0 4px 16px rgba(60, 40, 120, .18); }
.demo-switch summary::-webkit-details-marker { display: none; }
.demo-switch .demo-menu { position: absolute; right: 0; bottom: calc(100% + 8px); display: grid; gap: 4px; min-width: 190px; padding: var(--s-2); background: #fff; border: 1px solid var(--edge, #e5e7eb); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
/* Dashboard tiles stay on one row on a desktop screen, whatever their number, sharing the width equally; they wrap again on narrow screens. */
@media (min-width: 1000px) {
  .stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .stats li { width: auto; max-width: none; }
}

/* 39. The Delivery managers and Editors pickers look exactly like the SDM, KAM and Lead DM dropdowns: same border, height, arrow and left-aligned text. */
details.dm-pick > summary {
  justify-content: flex-start; text-align: left; font-weight: 400; color: var(--n-7);
  height: var(--h-ctl); min-height: var(--h-ctl); padding: 0 var(--s-7) 0 var(--s-3);
  border: var(--line-ctl); border-radius: var(--r-ctl); background-color: var(--n-0, #fff);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23646b78' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right var(--s-3) center;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; line-height: calc(var(--h-ctl) - 2px);
}
details.dm-pick[open] > summary { margin-bottom: var(--s-1); }
/* The list's own heading repeats the header above it: keep it for screen readers only. */
.checks-scroll legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details.dm-pick > summary:hover { border-color: var(--n-6); }
