/* Close Portal · design system · app.css
   Light theme, vanilla CSS, no external requests. Class reference: KIT.md. Gallery: kit.html.
   1 Tokens · 2 Base · 3 Shared blocks · 4 Shell · 5 Basics · 6 Forms · 7 Overlays · 8 Finance
   9 Workflow · 10 Assistant · 11 Login · 12 Icons · 13 Tones · 14 Motion */

@view-transition { navigation: auto; }

/* ===== 1. Tokens ===== */
:root {
  /* ink: sidebar, code blocks, toasts, login brand panel */
  --ink-950: #080d19; --ink-900: #0d1424; --ink-800: #151e33; --ink-700: #202b45; --ink-600: #33405e;
  /* neutrals (cool slate) */
  --n-25: #fafbfc; --n-50: #f4f6f9; --n-100: #eceff4; --n-200: #dfe3ea; --n-300: #c8ceda; --n-400: #8b94a8;
  --n-500: #5f697e; --n-600: #4c5568; --n-700: #353d4f; --n-800: #1f2636; --n-900: #121826;
  /* surfaces and text (every text pair meets WCAG AA) */
  --bg: #f6f7fa; --surface: #fff; --line: var(--n-200); --line-2: var(--n-100);
  --text: var(--n-900); --text-2: var(--n-600); --text-3: var(--n-500);
  /* tones: 50 tint · 100 soft border · 300 edge · 500 fill · 700 text */
  --accent-50: #eef2ff; --accent-100: #dde5ff; --accent-300: #a9b9f7; --accent-500: #3d5ce0; --accent-600: #3250cf; --accent-700: #2a43ad;
  --ai-50: #f4f1ff; --ai-100: #e4dcff; --ai-300: #bcaaf5; --ai-500: #6f4fe3; --ai-700: #5a3bc6;
  --ok-50: #e9f7f0; --ok-500: #0f8f5b; --ok-700: #0b6e46;
  --warn-50: #fff6e0; --warn-100: #f8e3ad; --warn-500: #c47a02; --warn-700: #8a5300;
  --bad-50: #fdeeee; --bad-100: #f7cfd1; --bad-500: #d93a44; --bad-600: #c92f3a; --bad-700: #b0202b;
  --ai-grad: linear-gradient(135deg, #7c5cf0, #4f6bf0);
  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "Noto Sans", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", monospace;
  /* spacing (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  /* radius */
  --r-1: 4px; --r-2: 6px; --r-3: 8px; --r-4: 12px; --r-5: 16px; --r-full: 999px;
  /* shadow */
  --sh-1: 0 1px 2px rgba(13, 20, 36, .05);
  --sh-2: 0 1px 2px rgba(13, 20, 36, .04), 0 4px 12px -2px rgba(13, 20, 36, .08);
  --sh-3: 0 2px 4px rgba(13, 20, 36, .04), 0 12px 28px -6px rgba(13, 20, 36, .16);
  --sh-4: 0 8px 16px -4px rgba(13, 20, 36, .1), 0 28px 64px -12px rgba(13, 20, 36, .32);
  --focus: 0 0 0 3px rgba(61, 92, 224, .2);
  /* motion */
  --t-1: 120ms; --t-2: 180ms; --t-3: 240ms; --t-4: 360ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --tr: background-color var(--t-1), border-color var(--t-1), color var(--t-1), box-shadow var(--t-1);
  /* layout */
  --side-w: 248px; --top-h: 56px; --class-h: 24px;
}

/* ===== 2. Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + var(--class-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:not([class]), .link { color: var(--accent-600); }   /* plain text links (or .link) are coloured and underline on hover */
a:not([class]):hover, .link:hover { text-decoration: underline; }
button, input, select, textarea { margin: 0; font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, iframe { display: block; max-width: 100%; }
small { font-size: inherit; }
b, strong, h1, h2, h3, h4 { font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
::selection { background: var(--accent-100); }
code { padding: 1px 5px; border-radius: var(--r-1); background: var(--n-100); font: .92em var(--mono); }

/* Tooltip: data-tip="text" on any element that does not already draw an ::after */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 70; padding: 5px 8px; border-radius: var(--r-2);
  background: var(--ink-800); color: #fff; box-shadow: var(--sh-2); font: 500 11.5px/1.3 var(--font); letter-spacing: 0; text-transform: none; white-space: nowrap;
  pointer-events: none; transform: translateX(-50%); animation: fade-in var(--t-1) .2s backwards;
}
[data-tip][data-tip-pos=bottom]::after { bottom: auto; top: calc(100% + 8px); }

/* Layout helpers */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.spread { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: var(--gap, 16px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* Text helpers */
.muted { color: var(--text-3); } .soft { color: var(--text-2); } .small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg, .adv { color: var(--bad-700); } .fav { color: var(--ok-700); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1280px) { .hide-md { display: none !important; } }
@media (max-width: 720px) { .hide-sm { display: none !important; } }

/* ===== 3. Shared blocks: written once, used by many components ===== */
/* surface */
.card, .stat, .track, .tbl-wrap, .flow-node, .audit, .mbox, .scn, .scn-sum, .msg-card, .prop { border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--sh-1); }
/* eyebrow label */
.side-group, .menu-label, .mbox-title, .prop-kicker, .prop-fields-head, .tbl th, .tbl-group > td, .scn-when b, .classbar { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
/* one-line truncation */
.truncate, .persona-txt > *, .flow-txt > *, .mail-from, .mail-subj, .mail-snip, .att-name, .side-link > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* inline chips */
.btn, .pill, .tag, .role, .chip, .fchip, .sugg, .basis, .actor, .hash, .delta, .att, .count { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }

/* ===== 4. App shell: .shell > .side + .main ( .classbar, .top, .page ) ===== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; overflow-x: clip; }
.page { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px 28px 64px; }
/* .shell-fill: the page fills the viewport and its panes scroll (mailbox) */
.shell-fill .main { height: 100dvh; overflow: hidden; }
.shell-fill .page { display: flex; flex-direction: column; min-height: 0; padding-bottom: 20px; }
.shell-fill .page > .mbox { flex: 1; height: auto; min-height: 0; }

/* Sidebar (dark ink) */
.side { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; height: 100dvh; background: linear-gradient(var(--ink-900), var(--ink-950)); color: #b9c2d9; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; view-transition-name: side; }
.side :focus-visible, .code :focus-visible, .toast :focus-visible { outline-color: #9db0ff; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; color: #fff; }
.side-name { display: grid; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.side-name small { color: #7f8aa8; font-size: 11.5px; font-weight: 500; }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 0 10px 12px; }
.side-group { padding: 16px 10px 6px; color: #7f8aa8; }
.side-link { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-3); color: #b9c2d9; font-size: 13.5px; font-weight: 500; transition: var(--tr); }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link > .ico { opacity: .72; }
.side-link.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.side-link.is-active > .ico { opacity: 1; }
.side-link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #8fa4ff; }
.side-count { min-width: 20px; height: 18px; margin-left: auto; padding: 0 6px; border-radius: 9px; background: rgba(255, 255, 255, .1); color: #dfe5f5; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.side-count.is-hot { background: var(--accent-500); color: #fff; }
.side-foot { display: grid; gap: 2px; padding: 12px 16px 14px; border-top: 1px solid rgba(255, 255, 255, .08); color: #8792b0; font-size: 12px; }
.side-foot b { color: #dfe5f5; }
.side-scrim { display: none; }

/* Product mark: a closing ring and its final dot */
.mark { position: relative; flex: none; width: 28px; height: 28px; border-radius: var(--r-3); background: linear-gradient(135deg, #6f8bff, #3d5ce0 55%, #6f4fe3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px rgba(0, 0, 0, .3); }
.mark::before { content: ""; position: absolute; inset: 25%; border: 2.5px solid #fff; border-right-color: transparent; border-radius: 50%; transform: rotate(-45deg); }
.mark::after { content: ""; position: absolute; right: 23%; top: 23%; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.mark-lg { width: 36px; height: 36px; border-radius: 10px; }
.mark-lg::before { border-width: 3px; } .mark-lg::after { width: 5px; height: 5px; }

/* Classification banner */
.classbar { position: sticky; top: 0; z-index: 31; display: flex; align-items: center; justify-content: center; gap: 8px; height: var(--class-h); background: var(--ink-900); color: #e6c670; letter-spacing: .14em; white-space: nowrap; }
.classbar::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.classbar + .top { top: var(--class-h); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px 12px; min-height: var(--top-h); padding: 8px 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); view-transition-name: top; }
.top-left, .top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-right { flex: none; margin-left: auto; }
.btn-icon.top-burger { display: none; }
.top-sep { width: 1px; height: 20px; margin: 0 2px; background: var(--line); }

/* Pill-style select: <label class="sel"><i class="ico ico-building"></i><select>…</select></label> */
.sel { position: relative; display: inline-flex; align-items: center; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: var(--r-full); background: #fff; box-shadow: var(--sh-1); transition: var(--tr); }
.sel:hover { border-color: var(--n-300); }
.sel:focus-within { border-color: var(--accent-500); box-shadow: var(--focus); }
.sel > .ico { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.sel > select { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 240px; height: 100%; padding: 0 30px 0 12px; border: 0; border-radius: inherit; background: none; outline: none; font-size: 13px; font-weight: 600; text-overflow: ellipsis; cursor: pointer; }
.sel > .ico + select { padding-left: 33px; }
.sel::after { content: ""; --k: 25; --sz: 14px; position: absolute; right: 10px; color: var(--text-3); pointer-events: none; }

/* Chips: persona, demo clock, AI status */
.chip { gap: 7px; height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-full); background: #fff; color: var(--text); box-shadow: var(--sh-1); font-size: 13px; font-weight: 600; transition: var(--tr); }
button.chip:hover, a.chip:hover { border-color: var(--n-300); background: var(--n-25); }
.chip[aria-expanded=true] { border-color: var(--accent-300); box-shadow: var(--focus); }
.chip > .ico, .chip-k, .chip-sub { color: var(--text-3); font-weight: 500; }
.chip-persona { padding-left: 5px; }
.chip-ai[data-state=live] .dot { color: var(--ok-500); }
.chip-ai[data-state=fallback] { border-color: var(--warn-100); background: var(--warn-50); color: var(--warn-700); }
.chip-ai[data-state=fallback] .dot { color: var(--warn-500); }

/* Status dot; .dot-pulse adds the soft live pulse */
.dot { position: relative; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-pulse::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: pulse 2.4s var(--ease) infinite; }

/* Count bubble */
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--n-100); color: var(--text-2); font-size: 11px; font-weight: 600; }
.count-accent { background: var(--accent-500); color: #fff; }
.count-bad { background: var(--bad-600); color: #fff; }
.btn-icon > .count { position: absolute; top: -3px; right: -3px; box-shadow: 0 0 0 2px #fff; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.page-head > :first-child { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; color: var(--text-3); font-size: 12.5px; }
.crumbs > * + *::before { content: "/"; margin-right: 6px; color: var(--n-300); }
.crumbs a { color: inherit; }
.crumbs [aria-current] { color: var(--text-2); font-weight: 600; }
.page-title { font-size: 22px; line-height: 1.25; letter-spacing: -.018em; }
.page-sub { max-width: 76ch; margin-top: 4px; color: var(--text-2); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Sections inside a page */
.sec { margin-top: 32px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.sec-title { font-size: 15px; }
.sec-sub { color: var(--text-3); font-size: 13px; }
.sec-head > :last-child:not(:first-child, .sec-sub) { margin-left: auto; align-self: center; }

/* Tabs: <div class="tabs"> <button class="tab is-active" data-tab="panel-id">… ; panels are .tab-panel */
.tabs { position: relative; display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 0; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: color var(--t-1); }
.tab:hover, .tab.is-active { color: var(--text); }
.tab:focus-visible { outline-offset: -2px; }
.tab.is-active::after, .tabs.has-ink::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent-500); }
.tabs.has-ink .tab.is-active::after { display: none; }
.tabs.has-ink::after { left: 0; right: auto; width: var(--ink-w, 0); transform: translateX(var(--ink-x, 0)); transition: transform var(--t-3) var(--ease), width var(--t-3) var(--ease); }
.tab-panel:not([hidden]) { animation: rise var(--t-3) var(--ease) backwards; }

/* Narrow: the sidebar becomes a drawer, then the top bar wraps to two rows */
@media (max-width: 1500px) { .chip-k, .chip-sub { display: none; } }
@media (max-width: 1220px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); visibility: hidden; transform: translateX(-102%); box-shadow: var(--sh-4); transition: transform var(--t-3) var(--ease), visibility 0s var(--t-3); }
  .is-side-open .side { visibility: visible; transform: none; transition-delay: 0s; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(13, 20, 36, .44); opacity: 0; pointer-events: none; transition: opacity var(--t-3); }
  .is-side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .btn-icon.top-burger { display: inline-grid; }
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; padding: 8px 12px; }
  .top-left { order: 3; flex: 1 1 100%; }
  .top-left > .sel { flex: 1 1 0; }
  .top-left > .sel > select { width: 100%; max-width: none; }
  .top-right { gap: 6px; }
  .page { padding: 16px 16px 48px; }
  .page-title { font-size: 20px; }
}

/* ===== 5. Basics ===== */

/* Buttons: .btn + .btn-primary | -secondary | -ghost | -danger · size .btn-sm · states .is-loading, disabled */
.btn { gap: 7px; height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-3); background: none; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: var(--tr), transform var(--t-1); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-500); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(42, 67, 173, .45); }
.btn-primary:hover { background: var(--accent-600); }
.btn-secondary { border-color: var(--n-300); background: #fff; box-shadow: var(--sh-1); }
.btn-secondary:hover { border-color: var(--n-400); background: var(--n-25); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--n-100); color: var(--text); }
.btn-danger { background: var(--bad-600); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(176, 32, 43, .4); }
.btn-danger:hover { background: var(--bad-700); }
.btn-sm { gap: 5px; height: 28px; padding: 0 10px; border-radius: var(--r-2); font-size: 12.5px; }
.btn-sm > .ico { --sz: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled, .btn[aria-disabled=true] { opacity: .5; box-shadow: none; pointer-events: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > .ico { display: none; }
.btn.is-loading::before, .pill-running::before { content: ""; width: 14px; height: 14px; border: 2px solid; border-right-color: transparent; border-radius: 50%; background: none; animation: spin .7s linear infinite; }

/* Icon-only button */
.btn-icon { position: relative; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-3); background: none; color: var(--text-2); transition: var(--tr); }
.btn-icon:hover { background: var(--n-100); color: var(--text); }
.btn-icon.btn-sm { width: 24px; height: 24px; border-radius: var(--r-2); }
.btn-icon[aria-expanded] > .ico { transition: transform var(--t-2) var(--ease); }
.btn-icon[aria-expanded=true] > .ico-chev-down { transform: rotate(180deg); }
.btn-icon[aria-expanded=true] > .ico-chev-right { transform: rotate(90deg); }

/* Status pills: .pill + .pill-STATUS (colours in section 13). A dot or glyph is drawn for you. */
.pill { --c: var(--n-600); --b: var(--n-100); gap: 5px; height: 22px; padding: 0 9px 0 8px; border-radius: var(--r-full); background: var(--b); color: var(--c); font-size: 11.5px; font-weight: 600; }
.pill::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-plain::before { display: none; }
.pill-open, .pill-expired, .pill-notrun { box-shadow: inset 0 0 0 1px var(--n-300); }
.pill-open::before, .pill-pending::before, .pill-expired::before, .pill-notrun::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill-signed::before, .pill-done::before, .pill-pass::before { --k: 4; --sz: 11px; border-radius: 0; }
.pill-rejected::before, .pill-fail::before { --k: 6; --sz: 11px; border-radius: 0; }
.pill-returned::before { --k: 53; --sz: 11px; border-radius: 0; }
.pill-ai::before { --k: 21; --sz: 12px; border-radius: 0; }
.pill-human::before { --k: 47; --sz: 11px; border-radius: 0; }
.pill-live::before { box-shadow: 0 0 0 3px rgba(15, 143, 91, .18); animation: breathe 2.4s ease-in-out infinite; }
.pill-running::before { width: 10px; height: 10px; border-width: 1.5px; background: none; }

/* Role pills: .role + .role-analyst | -controller | -delegate | -mdo | -bank | -admin | -viewer */
.role { --c: var(--n-600); --b: var(--n-100); height: 20px; padding: 0 7px; border-radius: 5px; background: var(--b); color: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 16%, transparent); font-size: 11px; font-weight: 600; }
.role-analyst { --c: #1d5fa8; --b: #eaf3fd; }
.role-delegate { --c: #0b6b74; --b: #e4f6f7; }
.role-mdo { --c: #8a2f79; --b: #fbebf7; }
.role-admin { --c: #fff; --b: var(--ink-800); }

/* Tag: quiet metadata chip (template version, classification) */
.tag { --c: var(--n-600); --b: var(--n-100); gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--b); color: var(--c); font-size: 11px; font-weight: 600; }
.tag > .ico { --sz: 11px; }
.tag-line { background: none; box-shadow: inset 0 0 0 1px var(--n-300); }

/* Avatars: <span class="avatar" data-name="Jane Tan"></span> (JS fills initials and a stable colour) */
.avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--av, var(--n-200)); color: var(--av-fg, var(--n-700)); font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: .02em; text-transform: uppercase; user-select: none; }
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-lg { width: 36px; height: 36px; font-size: 13px; }
.avatar-ai { background: var(--ai-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.avatar-ai::before { content: ""; --k: 21; --sz: 15px; }
.avatar-ai.avatar-sm::before { --sz: 12px; } .avatar-ai.avatar-lg::before { --sz: 19px; }
.avatars { display: inline-flex; }
.avatars > .avatar { box-shadow: 0 0 0 2px #fff; }
.avatars > .avatar + .avatar { margin-left: -7px; }

/* Persona: avatar + name + role */
.persona { display: inline-flex; align-items: center; gap: 9px; min-width: 0; text-align: left; }
.persona-txt { display: grid; min-width: 0; line-height: 1.25; }
.persona-txt b { font-size: 13px; }
.persona-txt small { color: var(--text-3); font-size: 12px; }

/* Cards (surface comes from section 3) */
.card-pad, .card-body { padding: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 52px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { color: var(--text-3); font-size: 12.5px; }
.card-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.card-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--r-4) var(--r-4); background: var(--n-25); color: var(--text-2); font-size: 12.5px; }
.card-hover { display: block; cursor: pointer; transition: var(--tr), transform var(--t-3) var(--ease); }
.card-hover:hover { transform: translateY(-2px); border-color: var(--n-300); box-shadow: var(--sh-3); }
.card-hover:active { transform: none; box-shadow: var(--sh-2); }

/* Callouts: .callout (info) + .callout-ok | -warn | -bad */
.callout { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px 11px 15px; border-radius: var(--r-3); background: var(--b); box-shadow: inset 3px 0 0 var(--e); color: var(--n-800); font-size: 13.5px; }
.callout::before { content: ""; --k: 9; margin-top: 2px; color: var(--c); }
.callout-ok::before { --k: 5; } .callout-warn::before { --k: 8; } .callout-bad::before { --k: 7; }
.callout-body { flex: 1; min-width: 0; }
.callout-title { color: var(--c); font-weight: 600; }
.callout-actions { display: flex; gap: 6px; align-self: center; }

/* Empty state */
.empty { display: grid; justify-items: center; gap: 4px; padding: 40px 24px; color: var(--text-2); text-align: center; }
.empty-ico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: var(--r-4); background: var(--n-100); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.empty-title { color: var(--text); font-size: 14.5px; font-weight: 600; }
.empty p { max-width: 46ch; }
.empty .btn { margin-top: 12px; }

/* Skeleton shimmer */
.skel { display: block; height: 12px; border-radius: var(--r-2); background: linear-gradient(90deg, var(--n-100) 25%, var(--n-50) 45%, var(--n-100) 65%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
.skel-title { width: 40%; height: 18px; }
.skel-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.skel-block { height: 96px; border-radius: var(--r-3); }
.skel-w60 { width: 60%; } .skel-w80 { width: 80%; }

/* Key-value list: <dl class="kv"><dt>…</dt><dd>…</dd></dl> */
.kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 8px 20px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* Code / JSON block: .code > .code-head + pre (add data-json for colouring) */
.code { border: 1px solid var(--ink-700); border-radius: var(--r-3); background: var(--ink-900); color: #d6dcec; overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px 4px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #97a2bf; font: 12px var(--mono); }
.code-head .btn { margin-left: auto; color: #c3cbe0; }
.code-head .btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.code pre { margin: 0; padding: 14px 16px; max-height: 320px; overflow: auto; font: 12.5px/1.65 var(--mono); tab-size: 2; scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; }
.tok-k { color: #9db4ff; } .tok-s { color: #9ee6bf; } .tok-n { color: #f3c98b; } .tok-b { color: #d7b0ff; }

/* ===== 6. Forms ===== */
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.label { color: var(--n-700); font-size: 12.5px; font-weight: 600; }
.label small { margin-left: 4px; color: var(--text-3); font-weight: 500; }
.hint { color: var(--text-3); font-size: 12px; }
.error { display: none; align-items: center; gap: 5px; color: var(--bad-700); font-size: 12px; font-weight: 600; }
.field.is-invalid .error { display: flex; }
.field.is-invalid .hint { display: none; }
.input, .select, .textarea, .composer-input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--n-300); border-radius: var(--r-3); background: #fff; color: var(--text); font-size: 13.5px; transition: var(--tr); }
.input::placeholder, .textarea::placeholder, .composer-input::placeholder { color: var(--text-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--n-400); }
.input:focus, .select:focus, .textarea:focus, .composer-input:focus { outline: none; border-color: var(--accent-500); box-shadow: var(--focus); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--n-50); color: var(--text-3); cursor: not-allowed; }
.textarea { height: auto; min-height: 84px; padding: 8px 11px; line-height: 1.5; resize: vertical; }
.select { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer; background: #fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235f697e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>") right 10px center / 14px no-repeat; }
.field.is-invalid :is(.input, .select, .textarea) { border-color: var(--bad-500); box-shadow: 0 0 0 3px rgba(217, 58, 68, .14); }
.input-ico { position: relative; display: block; }
.input-ico > .ico { position: absolute; left: 11px; top: 10px; color: var(--text-3); pointer-events: none; }
.input-ico > .input { padding-left: 34px; }

/* Checkbox, radio: <label class="check"><input type="checkbox"><span>Label</span></label> */
.check, .radio, .switch { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 18px; cursor: pointer; }
.check input, .radio input, .switch input { -webkit-appearance: none; appearance: none; flex: none; width: 16px; height: 16px; margin: 1px 0 0; border: 1.5px solid var(--n-400); border-radius: var(--r-1); background: #fff; cursor: pointer; transition: var(--tr), border-width var(--t-1); }
.radio input { border-radius: 50%; }
.check input:hover, .radio input:hover { border-color: var(--accent-500); }
.check input:checked { border-color: var(--accent-500); background: var(--accent-500) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 8.5l3 3 6-7'/></svg>") center / 12px no-repeat; }
.radio input:checked { border-color: var(--accent-500); border-width: 5px; }
:is(.check, .radio, .switch) input:disabled { opacity: .5; cursor: not-allowed; }

/* Toggle switch: <label class="switch"><input type="checkbox"><span>Label</span></label> */
.switch { gap: 10px; line-height: 20px; }
.switch input { position: relative; width: 34px; height: 20px; margin: 0; border: 0; border-radius: 10px; background: var(--n-400); }
.switch input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(13, 20, 36, .3); transition: transform var(--t-2) var(--ease); }
.switch input:checked { background: var(--accent-500); }
.switch input:checked::before { transform: translateX(14px); }

/* Segmented control: radio labels (label.seg-opt > input + span) or buttons (button.seg-opt.is-active) */
.seg { position: relative; display: inline-flex; padding: 2px; border-radius: 9px; background: var(--n-100); box-shadow: inset 0 0 0 1px var(--line); }
.seg-opt { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color var(--t-1); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:is(:hover, .is-active, :has(:checked)) { color: var(--text); }
.seg:not(.has-ink) :is(.seg-opt.is-active, .seg-opt:has(:checked)), .seg.has-ink::before { background: #fff; box-shadow: var(--sh-1), 0 0 0 1px rgba(13, 20, 36, .05); }
.seg-opt:has(:focus-visible) { outline: 2px solid var(--accent-500); outline-offset: 1px; }
.seg.has-ink::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: 0; width: var(--ink-w, 0); border-radius: 7px; transform: translateX(var(--ink-x, 0)); transition: transform var(--t-3) var(--ease), width var(--t-3) var(--ease); }

/* File drop zone: <label class="drop"><input type="file"> … </label>; .is-over while dragging */
.drop { position: relative; display: grid; justify-items: center; gap: 2px; padding: 22px 20px; border: 1.5px dashed var(--n-300); border-radius: var(--r-4); background: var(--n-25); color: var(--text-2); font-size: 13px; text-align: center; cursor: pointer; transition: var(--tr); }
.drop:hover { border-color: var(--n-400); background: #fff; }
.drop:focus-within { border-color: var(--accent-500); box-shadow: var(--focus); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-ico { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 10px; background: #fff; color: var(--text-3); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); transition: transform var(--t-3) var(--ease); }
.drop-title { color: var(--text); font-weight: 600; }
.drop-files { margin-top: 6px; color: var(--accent-700); font-size: 12.5px; font-weight: 600; }
.drop-files:empty { display: none; }
.drop.is-over { border-style: solid; border-color: var(--accent-500); background: var(--accent-50); color: var(--accent-700); }
.drop.is-over .drop-ico { color: var(--accent-600); transform: translateY(-2px); }

/* Filter chips: <div class="filter" data-filter="#list"> <button class="fchip is-active" data-f="">All</button> … */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fchip { gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-full); background: #fff; color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--tr); }
.fchip:hover { border-color: var(--n-400); color: var(--text); }
.fchip .count { margin-right: -4px; }
.fchip.is-active { border-color: var(--ink-800); background: var(--ink-800); color: #fff; }
.fchip.is-active .count { background: rgba(255, 255, 255, .16); color: #fff; }

/* ===== 7. Overlays: modal, drawer, menu / popover, toasts ===== */
.modal, .drawer { max-width: none; padding: 0; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--sh-4); overflow: hidden; }
.modal { width: min(540px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 48px)); border-radius: 14px; }
.modal-lg { width: min(820px, calc(100vw - 32px)); }
.drawer { inset: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; max-height: none; margin: 0; border-radius: 14px 0 0 14px; }
.modal[open], .drawer[open] { display: flex; flex-direction: column; animation: modal-in var(--t-3) var(--ease); }
.drawer[open] { animation: drawer-in var(--t-4) var(--ease); }
.modal::backdrop, .drawer::backdrop { background: rgba(13, 20, 36, .44); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fade-in var(--t-3) ease; }
.modal.is-closing { animation: modal-out var(--t-2) ease forwards; }
.drawer.is-closing { animation: drawer-out var(--t-3) ease forwards; }
.is-closing::backdrop { animation: fade-out var(--t-3) ease forwards; }
.modal-head, .drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 4px; }
.drawer-head { padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.modal-head > .btn-icon, .drawer-head > .btn-icon { margin: -5px -8px 0 auto; }
.modal-title, .drawer-title { font-size: 16px; letter-spacing: -.01em; }
.modal-sub, .drawer-sub { margin-top: 2px; color: var(--text-2); font-size: 13px; }
.modal-body, .drawer-body { flex: 1; min-height: 0; padding: 12px 20px 20px; overflow: auto; }
.drawer-body { padding-top: 16px; }
.modal-foot, .drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--n-25); }

/* Menu / popover: <button data-menu="m1">…</button> … <div class="menu" id="m1" hidden>…</div> */
.menu { position: fixed; inset: auto; z-index: 60; min-width: 208px; max-width: min(380px, calc(100vw - 16px)); max-height: min(520px, calc(100dvh - 16px)); margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); box-shadow: var(--sh-3); font-size: 13px; overflow: auto; }
.menu.is-open { animation: menu-in var(--t-2) var(--ease); }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 5px 9px; border: 0; border-radius: var(--r-2); background: none; color: var(--text); font-weight: 500; text-align: left; cursor: pointer; transition: var(--tr); }
.menu-item:hover, .menu-item:focus-visible { background: var(--n-100); outline: none; }
.menu-item > .ico { color: var(--text-3); }
.menu-item.is-active { background: var(--accent-50); color: var(--accent-700); }
.menu-item.is-danger, .menu-item.is-danger > .ico { color: var(--bad-700); }
.menu-end { margin-left: auto; padding-left: 12px; color: var(--text-3); font-size: 12px; }
.menu-label { padding: 8px 9px 4px; color: var(--text-3); }
.menu-sep { height: 1px; margin: 5px -5px; background: var(--line-2); }
.pop { width: 320px; padding: 14px; }
.pop-title { margin-bottom: 2px; font-size: 13.5px; font-weight: 600; }

/* Toasts (built by ECA.toast) */
.toasts { position: fixed; inset: auto 20px 20px auto; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); margin: 0; padding: 0; border: 0; background: none; overflow: visible; pointer-events: none; }
.toast { --c: #9db4ff; display: flex; align-items: flex-start; gap: 10px; padding: 11px 10px 11px 13px; border-radius: 10px; background: var(--ink-800); color: #eef1f8; box-shadow: var(--sh-3), inset 0 0 0 1px rgba(255, 255, 255, .06); font-size: 13.5px; line-height: 1.45; overflow: hidden; pointer-events: auto; animation: rise var(--t-3) var(--ease) backwards; transition: all var(--t-3) var(--ease); }
.toast > .ico { margin-top: 2px; color: var(--c); }
.toast-ok { --c: #5fd4a0; } .toast-warn { --c: #f3c56b; } .toast-bad { --c: #ff8f96; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-text b { display: block; }
.toast-x { display: grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--r-2); background: none; color: #97a2bf; }
.toast-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateX(12px); }

/* ===== 8. Finance: stat tiles, stage track, data table ===== */

/* Stat tile */
.stat { position: relative; display: grid; align-content: start; gap: 6px; padding: 16px 18px 14px; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat-label > .ico { color: var(--text-3); }
.stat-value { font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -.022em; white-space: nowrap; }
.stat-value small { margin-left: 6px; color: var(--text-3); font-size: 14px; letter-spacing: 0; }
.stat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 20px; color: var(--text-3); font-size: 12.5px; }
.stat > .ring { position: absolute; top: 14px; right: 16px; }

/* Delta chip: direction (.delta-up | .delta-down | .delta-flat) is separate from meaning (.is-good | .is-bad) */
.delta { --c: var(--n-700); --b: var(--n-100); gap: 2px; height: 20px; padding: 0 6px 0 4px; border-radius: var(--r-2); background: var(--b); color: var(--c); font-size: 12px; font-weight: 600; }
.delta::before { content: ""; --k: 42; --sz: 12px; }
.delta-up::before { --k: 28; } .delta-down::before { --k: 29; }

/* Stage track: .track > .track-head + .track-steps > a.track-step[data-state=done|current|blocked|todo] */
.track { padding: 14px 18px 16px; }
.track + .track { margin-top: 12px; }
.track-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 16px; }
.track-entity { font-size: 14px; font-weight: 600; }
.track-period { color: var(--text-3); font-size: 12.5px; }
.track-sum { margin-left: auto; color: var(--text-2); font-size: 12.5px; }
.track-steps { --n: 7; --p: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.track-steps::before, .track-steps::after { content: ""; position: absolute; top: 11px; left: calc(50% / var(--n)); right: calc(50% / var(--n)); height: 2px; border-radius: 2px; background: var(--n-200); }
.track-steps::after { background: var(--ok-500); transform-origin: 0 0; transform: scaleX(var(--p)); transition: transform var(--t-4) var(--ease) 120ms; }
.track-step { --c: var(--n-300); position: relative; z-index: 1; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 0 6px; text-align: center; }
.track-dot { display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 6px; border: 2px solid var(--c); border-radius: 50%; background: #fff; color: #fff; transition: var(--tr), transform var(--t-2) var(--ease); }
.track-name { color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.3; transition: color var(--t-1); }
.track-meta { color: var(--mc, var(--text-3)); font-size: 11.5px; line-height: 1.35; }
.track-step:hover .track-dot { transform: scale(1.12); }
.track-step:hover .track-name { color: var(--accent-700); }
.track-step[data-state=done] { --c: var(--ok-500); }
.track-step[data-state=blocked] { --c: var(--bad-500); --mc: var(--bad-700); }
.track-step[data-state=current] { --c: var(--accent-500); --mc: var(--accent-700); }
.track-step[data-state=todo] .track-name { color: var(--text-2); }
.track-step:is([data-state=done], [data-state=blocked]) .track-dot { background: var(--c); }
.track-step:is([data-state=done], [data-state=blocked]) .track-dot::after { content: ""; --k: 4; --sz: 14px; }
.track-step[data-state=blocked] .track-dot::after { --k: 41; --sz: 12px; }
.track-step[data-state=current] .track-dot { box-shadow: 0 0 0 4px var(--accent-50); }
.track-step[data-state=current] .track-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); animation: breathe 2.4s ease-in-out infinite; }
.track-step:is([data-state=current], [data-state=blocked]) .track-meta { font-weight: 600; }
@media (max-width: 720px) {
  .track-steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .track-steps::before, .track-steps::after { top: 12px; bottom: 12px; left: 11px; right: auto; width: 2px; height: auto; }
  .track-steps::after { transform: scaleY(var(--p)); }
  .track-step { grid-template-columns: 24px minmax(0, 1fr) auto; justify-items: start; align-items: center; gap: 12px; padding: 0; text-align: left; }
  .track-dot { margin: 0; }
}

/* Data table: .tbl-wrap (scrolls sideways; + .tbl-scroll = fixed height with sticky header) > table.tbl */
.tbl-wrap { overflow-x: auto; }
.tbl-scroll { max-height: var(--tbl-h, 420px); overflow-y: auto; }
.card > .tbl-wrap { border: 0; border-radius: 0 0 var(--r-4) var(--r-4); box-shadow: none; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 2; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--n-50); color: var(--text-2); text-align: left; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; transition: background-color var(--t-1); }
.tbl .wrap, .tbl .tbl-detail > td { white-space: normal; }
.tbl tbody tr:last-child > td { border-bottom: 0; }
.tbl :is(th, td):first-child { padding-left: 16px; }
.tbl :is(th, td):last-child { padding-right: 16px; }
.tbl .num { text-align: right; }
.tbl tbody tr:hover > td, .tbl-group > td, .tbl-total > td, .tbl .tbl-detail > td { background: var(--n-25); }
.tbl tr.is-selected > td { background: #f5f8ff; }
.tbl tr.is-selected > td:first-child { box-shadow: inset 2px 0 0 var(--accent-500); }
.tbl tr[data-expand] { cursor: pointer; }
.tbl-dense td { padding-top: 6px; padding-bottom: 6px; }
.tbl-code { margin-right: 8px; color: var(--text-3); font: 12px var(--mono); }
.tbl-group > td { color: var(--text-2); }
.tbl-total > td { border-top: 1px solid var(--n-300); font-weight: 600; }
.tbl .tbl-detail > td { padding: 0; box-shadow: inset 2px 0 0 var(--accent-300); }
.tbl-detail-in { padding: 14px 16px 16px 48px; animation: rise var(--t-3) var(--ease) backwards; }

/* Inline delta bar, centre zero: <span class="dbar is-fav" data-v="-0.42"></span>  (−1 … 1) */
.dbar { --v: 0; --c: var(--n-400); position: relative; display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--n-100); vertical-align: middle; overflow: hidden; }
.dbar::before { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--c); transform-origin: 0 0; transform: scaleX(var(--v)); transition: transform var(--t-4) var(--ease); }
.dbar::after { content: ""; position: absolute; inset: 0 auto 0 calc(50% - .5px); width: 1px; background: var(--n-400); }
.dbar.is-fav { --c: var(--ok-500); } .dbar.is-adv { --c: var(--bad-500); }

/* ===== 9. Workflow: flow strip, pipeline, progress, SLA, notifications, audit ===== */

/* Flow strip: .flow > .flow-node, .flow-link, .flow-node.flow-node-ai, .flow-link, .flow-node */
.flow { display: flex; align-items: stretch; }
.flow-node { flex: 1 1 0; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; transition: var(--tr); }
.flow-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--n-100); color: var(--n-700); transition: var(--tr); }
.flow-node-ai .flow-ico { background: var(--ai-grad); color: #fff; }
.flow-txt { display: grid; min-width: 0; line-height: 1.3; }
.flow-txt b { font-size: 13.5px; }
.flow-txt small { color: var(--text-3); font-size: 12px; }
.flow-link { --dir: 90deg; position: relative; flex: 0 0 clamp(36px, 6vw, 88px); align-self: center; height: 2px; background: repeating-linear-gradient(var(--dir), var(--n-300) 0 4px, transparent 4px 8px); }
.flow-link::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--dir), var(--accent-300), var(--accent-500)); opacity: 0; transition: opacity var(--t-3); }
.flow-link::after { content: ""; position: absolute; right: 1px; top: -3px; width: 8px; height: 8px; border: solid var(--n-400); border-width: 2px 2px 0 0; transform: rotate(45deg); transition: var(--tr); }
.flow-link.is-on::before { opacity: 1; }
.flow-link.is-on::after { border-color: var(--accent-500); }
.flow-dot { position: absolute; left: 0; top: 50%; z-index: 1; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent-500); box-shadow: 0 0 0 3px rgba(61, 92, 224, .18), 0 0 14px 3px rgba(61, 92, 224, .5); pointer-events: none; }
.flow-node.is-hit { border-color: var(--accent-300); box-shadow: 0 0 0 4px rgba(61, 92, 224, .1), var(--sh-2); }
.flow-node.is-hit:not(.flow-node-ai) .flow-ico { background: var(--accent-50); color: var(--accent-700); }
@media (max-width: 720px) {
  .flow { flex-direction: column; }
  .flow-link { --dir: 180deg; flex-basis: 28px; width: 2px; height: 28px; }
  .flow-link::after { right: -3px; top: auto; bottom: 1px; transform: rotate(135deg); }
  .flow-dot { left: 50%; top: 0; }
}

/* Pipeline stepper: ol.pipe > li.pipe-step[data-state=pending|running|done|warn|fail].
   Vertical by default (and always on small screens or with .pipe-v); horizontal from 721px up. */
.pipe { --n: 7; display: grid; counter-reset: pipe; }
.pipe-step { --c: var(--n-300); position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 10px; padding-bottom: 12px; counter-increment: pipe; }
.pipe-step::before { content: ""; position: absolute; top: 25px; bottom: 3px; left: 10px; width: 2px; border-radius: 2px; background: linear-gradient(var(--ok-500) 0 0) 0 0 / 100% 0 no-repeat var(--n-200); transition: background-size var(--t-4) var(--ease); }
.pipe-step:last-child { padding-bottom: 0; }
.pipe-step:last-child::before { display: none; }
.pipe-dot { position: relative; display: grid; place-items: center; grid-row: span 2; width: 22px; height: 22px; border: 2px solid var(--c); border-radius: 50%; background: #fff; color: var(--text-3); font-size: 10.5px; font-weight: 600; transition: var(--tr); }
.pipe-dot::before { content: counter(pipe); }
.pipe-name { color: var(--text-2); font-size: 12.5px; font-weight: 600; line-height: 22px; transition: color var(--t-2); }
.pipe-detail { grid-column: 2; color: var(--dc, var(--text-3)); font-size: 11.5px; line-height: 1.35; opacity: 0; transform: translateY(4px); transition: opacity var(--t-3), transform var(--t-3) var(--ease); }
.pipe-step[data-state=running] { --c: var(--accent-100); }
.pipe-step[data-state=running] .pipe-dot { color: var(--accent-700); box-shadow: 0 0 0 4px var(--accent-50); }
.pipe-step[data-state=running] .pipe-dot::after { content: ""; position: absolute; inset: -2px; border: 2px solid transparent; border-top-color: var(--accent-500); border-radius: 50%; animation: spin .8s linear infinite; }
.pipe-step[data-state=running] .pipe-name { color: var(--accent-700); }
.pipe-step[data-state=done] { --c: var(--ok-500); --k: 4; }
.pipe-step[data-state=warn] { --c: var(--warn-500); --k: 8; --dc: var(--warn-700); }
.pipe-step[data-state=fail] { --c: var(--bad-500); --k: 6; --dc: var(--bad-700); }
.pipe-step:is([data-state=done], [data-state=warn], [data-state=fail]) .pipe-dot { background: var(--c); color: #fff; }
.pipe-step:is([data-state=done], [data-state=warn], [data-state=fail]) .pipe-dot::before { content: none; }
.pipe-step:is([data-state=done], [data-state=warn], [data-state=fail]) .pipe-dot::after { content: ""; --sz: 12px; animation: wipe var(--t-3) var(--ease) backwards; }
.pipe-step:is([data-state=done], [data-state=warn], [data-state=fail]) .pipe-name { color: var(--text); }
.pipe-step:is([data-state=done], [data-state=warn], [data-state=fail]) .pipe-detail { opacity: 1; transform: none; }
@media (min-width: 721px) {
  .pipe:not(.pipe-v) { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .pipe:not(.pipe-v) .pipe-step { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 6px; padding: 0 6px; text-align: center; }
  .pipe:not(.pipe-v) .pipe-step::before { top: 13px; bottom: auto; left: calc(50% + 20px); width: calc(100% - 40px); height: 2px; background-size: 0 100%; }
  .pipe:not(.pipe-v) .pipe-dot { grid-row: auto; width: 28px; height: 28px; font-size: 11.5px; }
  .pipe:not(.pipe-v) .pipe-dot::after { --sz: 14px; }
  .pipe:not(.pipe-v) .pipe-name { line-height: inherit; }
  .pipe:not(.pipe-v) .pipe-detail { grid-column: auto; max-width: 20ch; min-height: 2.7em; }
}
.pipe .pipe-step:is([data-state=done], [data-state=warn])::before { background-size: 100% 100%; }

/* Progress bars: .bar (0…1) · .conf (confidence, coloured by threshold) · .due (SLA, may pass 1). Value from data-v. */
.bar, .conf, .due { --v: 0; position: relative; display: block; min-width: 48px; height: 6px; border-radius: 3px; background: var(--n-100); overflow: hidden; }
.bar::before, .conf::before, .due::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c, var(--accent-500)); transform: translateX(calc((var(--v) - 1) * 100%)); transition: transform var(--t-4) var(--ease), background-color var(--t-3); }
.bar-lg { height: 8px; border-radius: 4px; }
.conf { --c: var(--n-400); }
.bar-ok, .ring-ok, .conf[data-level=high], .due[data-level=ok] { --c: var(--ok-500); }
.bar-warn, .ring-warn, .conf[data-level=mid], .due[data-level=near] { --c: var(--warn-500); }
.bar-bad, .ring-bad, .conf[data-level=low], .due[data-level=over] { --c: var(--bad-500); }
.due[data-level=over]::before { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(255, 255, 255, .28) 4px 8px); }

/* Progress ring: <span class="ring" data-v="0.72"><b>72%</b></span> (JS adds the SVG) */
.ring { --v: 0; position: relative; display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; font-size: 11.5px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--n-100); stroke-width: 3.5; }
.ring .ring-fg { stroke: var(--c, var(--accent-500)); stroke-linecap: round; stroke-dasharray: 100px; stroke-dashoffset: calc(100px - var(--v) * 100px); transition: stroke-dashoffset var(--t-4) var(--ease); }
.ring.is-empty .ring-fg { opacity: 0; }
.ring-sm { width: 28px; height: 28px; font-size: 0; } .ring-lg { width: 72px; height: 72px; font-size: 16px; }

/* SLA row: who · what · age · due bar */
.sla { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2.4fr) auto minmax(120px, 1fr); align-items: center; gap: 8px 20px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.sla:last-child { border-bottom: 0; }
.sla-what small, .audit-detail { display: block; color: var(--text-3); font-size: 12px; }
.sla-age { min-width: 64px; color: var(--text-2); text-align: right; white-space: nowrap; }
.sla-due { display: grid; gap: 5px; }
.sla-due small { color: var(--text-3); font-size: 11.5px; }
.sla[data-level=near] .sla-due small { color: var(--warn-700); font-weight: 600; }
.sla[data-level=over] .sla-due small { color: var(--bad-700); font-weight: 600; }
@media (max-width: 720px) { .sla { grid-template-columns: minmax(0, 1fr) auto; } .sla-what, .sla-due { grid-column: 1 / -1; } .sla-age { order: -1; grid-column: 2; grid-row: 1; } }

/* Notification list item */
.notif { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 10px; border-radius: var(--r-3); color: var(--text); transition: var(--tr); }
.notif:hover { background: var(--n-50); }
.notif-ico { --c: var(--n-600); --b: var(--n-100); display: grid; place-items: center; grid-row: span 2; width: 28px; height: 28px; border-radius: var(--r-3); background: var(--b); color: var(--c); }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-time { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.notif-text { grid-column: 2 / -1; color: var(--text-2); font-size: 12.5px; }
.notif.is-unread .notif-title::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent-500); vertical-align: 2px; }

/* Audit / timeline list with a chained-hash indicator */
.audit-item { position: relative; display: grid; grid-template-columns: 68px 168px minmax(0, 1fr) 84px; align-items: start; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.audit-item:last-child { border-bottom: 0; }
.audit-item:not(:last-child)::after { content: ""; position: absolute; right: 89px; top: 34px; bottom: -9px; z-index: 1; border-left: 1.5px dotted var(--n-300); }
.audit-time { padding-top: 3px; color: var(--text-3); font: 12px var(--mono); }
.audit-what { min-width: 0; padding-top: 2px; }
.actor { --c: var(--n-700); --b: var(--n-100); justify-self: start; gap: 6px; max-width: 100%; height: 24px; padding: 0 9px 0 2px; border-radius: var(--r-full); background: var(--b); color: var(--c); font-size: 12px; font-weight: 600; }
.actor > .avatar { width: 20px; height: 20px; font-size: 9px; }
.actor > .avatar-ai::before { --sz: 11px; }
.hash { justify-self: start; gap: 4px; height: 22px; padding: 0 7px 0 5px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--n-25); color: var(--n-600); font: 11px var(--mono); }
.hash::before { content: ""; --k: 40; --sz: 11px; color: var(--ok-500); }
.hash.is-broken { border-color: var(--bad-100); background: var(--bad-50); color: var(--bad-700); }
.hash.is-broken::before { --k: 8; color: var(--bad-500); }
@media (max-width: 720px) {
  .audit-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .audit-what { grid-column: 1 / -1; order: 4; }
  .audit-item:not(:last-child)::after { display: none; }
}

/* ===== 10. Assistant: thread, mailbox, proposal card, acceptance lab ===== */

/* Thread: .thread > article.msg.msg-out (assistant) | .msg-in (person), .thread-note, .thinking */
.thread { --tbg: var(--bg); position: relative; display: flex; flex-direction: column; gap: 14px; }
:is(.card, .drawer, .modal) .thread { --tbg: var(--surface); }
.thread::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 15px; width: 2px; border-radius: 2px; background: var(--line); }
.msg, .thinking { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 12px; }
:is(.msg, .thinking) > .avatar { width: 32px; height: 32px; font-size: 12px; box-shadow: 0 0 0 4px var(--tbg); }
:is(.msg, .thinking) > .avatar-ai::before { --sz: 17px; }
.msg-card { --edge: var(--n-400); position: relative; padding: 12px 16px 14px 19px; overflow: hidden; }
.msg-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--edge); }
.msg-out .msg-card { --edge: var(--ai-500); background: linear-gradient(#faf9ff, #fff 72px); }
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.msg-from { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; font-size: 13.5px; }
.msg-from > .ico { --sz: 12px; color: var(--n-400); }
.msg-from > span { color: var(--text-2); }
.msg-time { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.msg-meta, .msg-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-atts { gap: 8px; margin-top: 12px; }
.msg-body { max-width: 80ch; margin-top: 10px; color: var(--n-800); line-height: 1.6; }
.msg-body > * + * { margin-top: 8px; }
.msg-body ul { padding-left: 18px; list-style: disc; }
.msg-basis { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--text-3); font-size: 12px; font-weight: 600; }
.msg.is-superseded .msg-card { --edge: var(--n-300); border-style: dashed; background: var(--n-25); box-shadow: none; }
.msg.is-superseded .msg-body { color: var(--text-3); }
:is(.msg, .thread-note, .thinking).is-new { animation: rise var(--t-4) var(--ease) backwards; }
.mention { padding: 1px 5px; border-radius: 5px; background: var(--accent-50); color: var(--accent-700); font-weight: 600; white-space: nowrap; }

/* Attachment chip: .att[data-verdict=accepted|rejected|quarantined] > icon, .att-name, .att-size, .att-dot | .att-x */
.att { --c: var(--n-300); justify-content: flex-start; gap: 8px; max-width: 100%; height: 34px; padding: 0 10px 0 9px; border: 1px solid var(--line); border-radius: var(--r-3); background: #fff; color: var(--text); font-size: 12.5px; transition: var(--tr), opacity var(--t-2), transform var(--t-2); }
a.att:hover { border-color: var(--n-400); background: var(--n-25); }
.att > .ico, .att-size { color: var(--text-3); }
.att-name { font-weight: 600; }
.att-size { font-size: 11.5px; }
.att-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }
.att[data-verdict=accepted] { --c: var(--ok-500); }
.att[data-verdict=quarantined] { --c: var(--warn-500); }
.att[data-verdict=rejected] { --c: var(--bad-500); }
.att[data-verdict=rejected] .att-name { color: var(--text-2); text-decoration: line-through; }
.att-x { display: grid; place-items: center; flex: none; width: 20px; height: 20px; margin-right: -4px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); }
.att-x:hover { background: var(--n-100); color: var(--text); }
.att-x > .ico { --sz: 12px; }
.att.is-leaving { opacity: 0; transform: scale(.96); }

/* Basis chip: a link to the portal record an answer rests on */
.basis { gap: 5px; height: 22px; padding: 0 9px 0 7px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--n-25); color: var(--n-700); font-size: 11.5px; font-weight: 600; transition: var(--tr); }
.basis::before { content: ""; --k: 40; --sz: 11px; opacity: .7; }
.basis:hover { border-color: var(--accent-300); background: var(--accent-50); color: var(--accent-700); }

/* System note between messages, and the thinking row */
.thread-note { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-left: 44px; color: var(--text-3); font-size: 12px; }
.thread-note::before { content: ""; position: absolute; left: -33px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border: 2px solid var(--n-300); border-radius: 50%; background: var(--tbg); box-shadow: 0 0 0 3px var(--tbg); }
.thread-note > .ico { --sz: 13px; }
.thread-note b { color: var(--text-2); }
.thinking { align-items: center; color: var(--text-2); font-size: 13px; }
.thinking > span:last-child { display: flex; align-items: center; gap: 10px; }
.thinking-dots { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: var(--r-full); background: var(--ai-50); box-shadow: inset 0 0 0 1px var(--ai-100); }
.thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ai-500); animation: think 1.4s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .16s; } .thinking-dots i:nth-child(3) { animation-delay: .32s; }

/* Mailbox: .mbox > .mbox-boxes | .mbox-list | .mbox-read. Height from --mbox-h, or the rest of the page under .shell-fill */
.mbox { display: grid; grid-template-columns: 220px 340px minmax(0, 1fr); height: var(--mbox-h, 680px); overflow: hidden; }
.mbox-boxes { display: flex; flex-direction: column; gap: 1px; min-height: 0; padding: 10px 8px; border-right: 1px solid var(--line); background: var(--n-25); overflow-y: auto; }
.mbox-title { padding: 4px 8px 8px; color: var(--text-3); }
.mbox-box { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 8px; border-radius: var(--r-3); color: var(--text); transition: var(--tr); }
.mbox-box:hover { background: var(--n-100); }
.mbox-box.is-active { background: #fff; box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.mbox-box > .persona-txt { flex: 1; }
.mbox-list, .mbox-read { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mbox-list { border-right: 1px solid var(--line); }
.mbox-list-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.mbox-list-head > :last-child:not(:first-child) { margin-left: auto; }
.mbox-items { flex: 1; min-height: 0; overflow-y: auto; }
.mail { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 10px 14px 11px 26px; border-bottom: 1px solid var(--line-2); color: var(--n-700); font-size: 13px; transition: var(--tr); }
.mail:hover { background: var(--n-25); }
.mail:focus-visible { outline-offset: -2px; }
.mail-time { display: flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.mail-time > .ico { --sz: 12px; }
.mail-subj, .mail-snip { grid-column: 1 / -1; }
.mail-snip { color: var(--text-3); font-size: 12.5px; }
.mail.is-unread :is(.mail-from, .mail-subj) { color: var(--text); font-weight: 600; }
.mail.is-unread::before { content: ""; position: absolute; left: 11px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-500); }
.mail.is-selected { background: var(--accent-50); box-shadow: inset 2px 0 0 var(--accent-500); }
.mbox-read-head { display: grid; gap: 8px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line-2); }
.mbox-subj { font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.mbox-frame { flex: 1; width: 100%; min-height: 120px; border: 0; background: #fff; }

/* Reply composer: form.composer > .composer-input, .composer-atts, .composer-sugg, .composer-bar */
.composer { display: grid; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--n-25); }
.composer-input { height: auto; min-height: 64px; max-height: 200px; padding: 9px 11px; border-radius: 10px; line-height: 1.5; resize: none; }
.composer-atts, .composer-sugg, .composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.composer-atts:empty { display: none; }
.composer-atts .att { height: 28px; }
.composer-bar > .btn-primary { margin-left: auto; }
.sugg { height: 26px; padding: 0 10px; border: 1px solid var(--ai-100); border-radius: var(--r-full); background: var(--ai-50); color: var(--ai-700); font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--tr); }
.sugg:hover { border-color: var(--ai-300); background: #fff; }
@media (max-width: 1360px) {   /* mailboxes shrink to avatars so the reading pane keeps its width */
  .mbox { grid-template-columns: 60px 280px minmax(0, 1fr); }
  .mbox-title, .mbox-box > .persona-txt { display: none; }
  .mbox-box { position: relative; justify-content: center; }
  .mbox-box > .count { position: absolute; top: 0; right: 0; }
}
@media (max-width: 720px) {    /* phones: panes stack and the page scrolls normally */
  .shell-fill .main { height: auto; overflow: clip visible; }
  .mbox { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mbox-boxes { flex-direction: row; gap: 4px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow: auto hidden; }
  .mbox-box { flex: none; }
  .mbox-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .mbox-items { max-height: 264px; }
  .mbox-frame { flex: none; height: 340px; }
}

/* Proposal card: article.prop[data-state=open|confirmed|rejected|expired] */
.prop { --edge: var(--accent-500); position: relative; box-shadow: var(--sh-2); overflow: hidden; }
.prop::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--edge); }
.prop[data-state=confirmed] { --edge: var(--ok-500); --oc: var(--ok-700); }
.prop[data-state=rejected] { --edge: var(--bad-500); --oc: var(--bad-700); }
.prop[data-state=expired] { --edge: var(--n-300); --oc: var(--text-2); box-shadow: var(--sh-1); }
.prop-head { display: flex; align-items: flex-start; gap: 12px; padding: 17px 18px 12px; }
.prop-head > :first-child { flex: 1; min-width: 0; }
.prop-kicker { display: flex; align-items: center; gap: 5px; color: var(--ai-700); }
.prop-kicker > .ico { --sz: 12px; }
.prop-title { margin-top: 3px; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.prop[data-state=expired] .prop-title { color: var(--text-2); }
.prop-by { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 6px; color: var(--text-2); font-size: 12.5px; }
.prop-body { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 18px; padding: 2px 18px 14px; }
.prop-evi { align-self: start; border: 1px solid var(--line); border-radius: 10px; background: var(--n-50); overflow: hidden; }
.prop-evi :is(img, svg) { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.prop-evi figcaption { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--line-2); background: #fff; color: var(--text-3); font-size: 11.5px; }
.prop-fields { display: grid; align-content: start; }
.prop-fields-head, .prop-field { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px 36px; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.prop-fields-head { padding-top: 0; border-color: var(--line); color: var(--text-3); font-size: 10.5px; }
.prop-field:last-child { border-bottom: 0; }
.prop-k, .conf-n { color: var(--text-2); }
.prop-v { font-weight: 600; text-align: right; }
.conf-n { font-size: 12px; text-align: right; }
.prop-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.prop-exp, .prop-outcome { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; color: var(--text-2); font-size: 12.5px; }
.prop-outcome { color: var(--oc); font-size: 13px; font-weight: 600; }
@media (max-width: 720px) { .prop-body { grid-template-columns: minmax(0, 1fr); } .prop-evi { max-width: 260px; } }

/* Verification checklist V1…V7: ul.vchecks > li.vcheck[data-result=pass|fail|na] > .vcheck-mark, b, span */
.vchecks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding: 10px 18px; border-top: 1px solid var(--line-2); background: var(--n-25); }
.vcheck { --c: var(--n-200); display: grid; grid-template-columns: 18px 22px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 28px; color: var(--n-700); font-size: 12.5px; transition: color var(--t-2); }
.vcheck b { color: var(--text-3); font: 600 11px var(--mono); }
.vcheck-mark { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; transition: var(--tr); }
.vcheck-mark::after { content: ""; --sz: 11px; }
.vcheck[data-result=na] { --k: 42; color: var(--text-3); }
.vcheck[data-result=na] .vcheck-mark { color: var(--n-600); }
.vcheck[data-result=pass] { --c: var(--ok-500); --k: 4; }
.vcheck[data-result=fail] { --c: var(--bad-500); --k: 6; color: var(--bad-700); font-weight: 600; }
.vcheck.is-wait { --c: var(--n-200); color: var(--text-3); font-weight: 400; }
.is-wait .vcheck-mark::after, .scn-step.is-wait::after { opacity: 0; }
.is-shown .vcheck-mark, .scn-step.is-shown::after { animation: pop var(--t-3) var(--ease); }
@media (max-width: 720px) { .vchecks { grid-template-columns: minmax(0, 1fr); } }

/* Scenario card (acceptance lab): article.scn[data-status=notrun|running|pass|fail] */
.scn { transition: var(--tr); }
.scn[data-status=running] { border-color: var(--accent-300); box-shadow: 0 0 0 3px rgba(61, 92, 224, .1); }
.scn[data-status=fail] { border-color: var(--bad-100); }
.scn-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; }
.scn-code { display: inline-grid; place-items: center; flex: none; min-width: 48px; height: 24px; padding: 0 8px; border-radius: var(--r-2); background: var(--ink-800); color: #fff; font: 600 11.5px var(--mono); }
.scn-main { flex: 1; min-width: 0; }
.scn-title { font-size: 14px; }
.scn-when { margin-top: 1px; color: var(--text-2); font-size: 12.5px; }
.scn-when b { margin-right: 5px; color: var(--text-3); }
.scn-steps { position: relative; display: grid; gap: 2px; padding: 10px 14px 12px; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--r-4) var(--r-4); background: var(--n-25); animation: rise var(--t-3) var(--ease) backwards; }
.scn-steps::before { content: ""; position: absolute; left: 25px; top: 22px; bottom: 24px; width: 2px; background: var(--line); }
.scn-step { --c: var(--n-600); position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 10px; min-height: 32px; color: var(--n-700); font-size: 13px; }
.scn-step small { margin-left: 6px; color: var(--text-3); font-size: 12px; }
.scn-ico { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #fff; color: var(--c); box-shadow: inset 0 0 0 1px var(--line); }
.scn-ico::before { content: ""; --sz: 13px; }
.scn-step[data-kind=portal] { --k: 0; }
.scn-step[data-kind=out] { --k: 36; --c: var(--ai-700); }
.scn-step[data-kind=in] { --k: 2; --c: var(--accent-700); }
.scn-step[data-kind=agent] { --k: 21; --c: #fff; }
.scn-step[data-kind=agent] .scn-ico { background: var(--ai-grad); box-shadow: none; }
.scn-step[data-kind=check] { --k: 14; }
.scn-step[data-result]::after { content: ""; --k: 5; color: var(--ok-500); }
.scn-step[data-result=fail]::after { --k: 7; color: var(--bad-500); }
.scn-step[data-result=fail] { color: var(--bad-700); font-weight: 600; }
@media (max-width: 720px) { .scn-head { flex-wrap: wrap; } .scn-main { flex-basis: calc(100% - 64px); } }

/* Lab summary bar */
.scn-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 18px; }
.scn-sum-n { color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.scn-sum-n b { margin-right: 4px; color: var(--text); font-size: 24px; letter-spacing: -.02em; }
.scn-sum > .bar { flex: 1 1 200px; }

/* ===== 11. Login: <body class="login">, or <div class="login login-frame"> for a fixed-height preview ===== */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100dvh; background: var(--surface); }
.login-frame { height: 640px; min-height: 0; border: 1px solid var(--line); border-radius: var(--r-5); box-shadow: var(--sh-2); overflow: hidden; }
.login-brand { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; background: var(--ink-900); color: #c9d1e6; overflow: hidden; }
.login-brand::before { content: ""; position: absolute; inset: -30%; z-index: -2; background: radial-gradient(38% 34% at 24% 28%, rgba(79, 107, 240, .5), transparent 70%), radial-gradient(34% 32% at 78% 70%, rgba(124, 92, 240, .42), transparent 70%), radial-gradient(30% 28% at 62% 18%, rgba(15, 143, 91, .16), transparent 70%); animation: drift 26s ease-in-out infinite alternate; }
.login-brand::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 40px 40px; -webkit-mask-image: radial-gradient(120% 90% at 0 0, #000 20%, transparent 78%); mask-image: radial-gradient(120% 90% at 0 0, #000 20%, transparent 78%); }
.login-name { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 16px; font-weight: 600; }
.login-pitch { max-width: 440px; }
.login-pitch h1 { color: #fff; font-size: 32px; line-height: 1.15; letter-spacing: -.025em; }
.login-values { display: grid; gap: 14px; margin-top: 28px; }
.login-values li { display: flex; align-items: center; gap: 12px; }
.login-values li > span { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: var(--r-3); background: rgba(255, 255, 255, .08); color: #c5d0ff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.login-foot { color: #8792b0; font-size: 12px; }
.login-main { display: grid; place-items: center; padding: 32px 24px; }
.login-card { display: grid; gap: 16px; width: min(360px, 100%); animation: rise var(--t-4) var(--ease) backwards; }
.login-title { font-size: 22px; letter-spacing: -.018em; }
.login-sub { margin-top: -10px; color: var(--text-2); }
.login-card .btn { height: 38px; }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; }
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { padding: 20px 24px; }
  .login-pitch, .login-foot { display: none; }
}

/* ===== 12. Icons: <i class="ico ico-NAME"></i> =====
   One SVG sprite used as a mask, so an icon takes the current text colour. --k is its slot in the sprite,
   --sz its size (16px; .ico-sm 14, .ico-lg 20). To add one: append a <path> on the 16-unit grid translated
   24 per slot, bump --sprite-n, add an .ico-NAME rule. The first rule also lists every pseudo-element
   that draws a sprite icon. */
:root {
  --sprite-n: 55;
  --sprite: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1320 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'>\
<path d='M2.5 2.5H7V7H2.5zM9 2.5h4.5V7H9zM2.5 9H7v4.5H2.5zM9 9h4.5v4.5H9z'/>\
<path transform='translate(24)' d='M2 3.5h12v9H2zM2.5 4.25 8 8.75l5.5-4.5'/>\
<path transform='translate(48)' d='M2 9.5l2.25-6h7.5L14 9.5v3H2zM2 9.5h3.25l.9 1.5h3.7l.9-1.5H14'/>\
<path transform='translate(72)' d='M2.5 3h11v8h-6l-3 2.5V11h-2z'/>\
<path transform='translate(96)' d='M3.5 8.5l3 3 6-7'/>\
<path transform='translate(120)' d='M8 1.75a6.25 6.25 0 1 0 0 12.5 6.25 6.25 0 0 0 0-12.5zM5.4 8.2l1.8 1.8 3.4-3.9'/>\
<path transform='translate(144)' d='M4 4l8 8M12 4l-8 8'/>\
<path transform='translate(168)' d='M8 1.75a6.25 6.25 0 1 0 0 12.5 6.25 6.25 0 0 0 0-12.5zM6 6l4 4M10 6l-4 4'/>\
<path transform='translate(192)' d='M8 2.25 14.25 13H1.75zM8 6.5v3M8 11.2v.05'/>\
<path transform='translate(216)' d='M8 1.75a6.25 6.25 0 1 0 0 12.5 6.25 6.25 0 0 0 0-12.5zM8 7.25v3.5M8 5.1v.05'/>\
<path transform='translate(240)' d='M2 3h12v10H2zM2 6.5h12M2 9.75h12M6.25 6.5V13'/>\
<path transform='translate(264)' d='M4 1.75h5.25l3 3v9.5H4zM9.25 1.75v3h3M6.25 8.25H10M6.25 11H10'/>\
<path transform='translate(288)' d='M4 1.75h5.25l3 3v9.5H4zM9.25 1.75v3h3'/>\
<path transform='translate(312)' d='M2.25 3h11.5v10H2.25zM2.25 10.75l3.25-3 2.5 2.25 2-1.75 3.75 3.25M10.5 5.75v.05'/>\
<path transform='translate(336)' d='M8 1.75l5 1.75v4c0 3.2-2.1 5.6-5 6.75-2.9-1.15-5-3.55-5-6.75v-4zM5.9 8l1.5 1.5 2.8-3.1'/>\
<path transform='translate(360)' d='M1.75 6.25 8 2.5l6.25 3.75zM3.75 6.5V11M6.6 6.5V11M9.4 6.5V11M12.25 6.5V11M2 13.25h12'/>\
<path transform='translate(384)' d='M6 1.75h4M6.75 1.75v4.5L3.1 12.4a1.1 1.1 0 0 0 1 1.6h7.8a1.1 1.1 0 0 0 1-1.6L9.25 6.25v-4.5M5.1 10h5.8'/>\
<path transform='translate(408)' d='M8 1.75a6.25 6.25 0 1 0 0 12.5 6.25 6.25 0 0 0 0-12.5zM8 4.75V8l2.25 1.5'/>\
<path transform='translate(432)' d='M2.5 3.25h11v10h-11zM2.5 6.5h11M5.5 1.75v3M10.5 1.75v3'/>\
<path transform='translate(456)' d='M3 14V2.5h7V14M10 6.5h3V14M1.75 14h12.5M5.5 5.25h2M5.5 8h2M5.5 10.75h2'/>\
<path transform='translate(480)' d='M4 11V7a4 4 0 0 1 8 0v4l1.25 1.5H2.75zM6.75 14.25h2.5'/>\
<path transform='translate(504)' d='M7 3l1.4 4.1 4.1 1.4-4.1 1.4L7 14l-1.4-4.1-4.1-1.4 4.1-1.4zM12.5 1.5v3M11 3h3'/>\
<path transform='translate(528)' d='M2 4.5h6.5M12 4.5h2M2 11.5h2M7.5 11.5H14M10.25 2.75v3.5M5.75 9.75v3.5'/>\
<path transform='translate(552)' d='M6 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM1.75 13.5c0-2.3 1.9-3.75 4.25-3.75s4.25 1.45 4.25 3.75M10.5 2.75a2.4 2.4 0 0 1 0 4.5M12 9.9c1.4.5 2.25 1.7 2.25 3.6'/>\
<path transform='translate(576)' d='M8 7.5A2.75 2.75 0 1 0 8 2a2.75 2.75 0 0 0 0 5.5zM2.75 14c0-2.6 2.3-4.25 5.25-4.25s5.25 1.65 5.25 4.25'/>\
<path transform='translate(600)' d='M4 6l4 4 4-4'/>\
<path transform='translate(624)' d='M6 4l4 4-4 4'/>\
<path transform='translate(648)' d='M3 8h10M9 4l4 4-4 4'/>\
<path transform='translate(672)' d='M8 13V3M4 7l4-4 4 4'/>\
<path transform='translate(696)' d='M8 3v10M4 9l4 4 4-4'/>\
<path transform='translate(720)' d='M7 12A5 5 0 1 0 7 2a5 5 0 0 0 0 10zM10.75 10.75 14 14'/>\
<path transform='translate(744)' d='M2 3.5h12L9.5 8.75V13l-3-1.5V8.75z'/>\
<path transform='translate(768)' d='M8 2v8.5M4.5 7 8 10.5 11.5 7M2.5 13.5h11'/>\
<path transform='translate(792)' d='M8 10.5V2M4.5 5.5 8 2l3.5 3.5M2.5 13.5h11'/>\
<path transform='translate(816)' d='M5.5 5.5h8v8h-8zM10.5 5.5v-3h-8v8h3'/>\
<path transform='translate(840)' d='M13.9 7.3l-5.8 5.8a3.8 3.8 0 0 1-5.4-5.4l5.8-5.8a2.55 2.55 0 0 1 3.6 3.6l-5.8 5.8a1.25 1.25 0 0 1-1.8-1.8l5.4-5.3'/>\
<path transform='translate(864)' d='M14 2 7.25 8.75M14 2 9.75 14l-2.5-5.25L2 6.25z'/>\
<path transform='translate(888)' d='M13.5 2.75v3.5H10M2.5 13.25v-3.5H6M12.9 6.25A5.25 5.25 0 0 0 3.6 5M3.1 9.75A5.25 5.25 0 0 0 12.4 11'/>\
<path transform='translate(912)' d='M5 3l8 5-8 5z'/>\
<path transform='translate(936)' d='M3.2 8h.6M7.7 8h.6M12.2 8h.6'/>\
<path transform='translate(960)' d='M6.75 9.25a3 3 0 0 0 4.25 0l2.25-2.25A3 3 0 0 0 9 2.75l-1 1M9.25 6.75a3 3 0 0 0-4.25 0L2.75 9A3 3 0 0 0 7 13.25l1-1'/>\
<path transform='translate(984)' d='M4 7.25h8v6.25H4zM5.75 7.25V5a2.25 2.25 0 0 1 4.5 0v2.25'/>\
<path transform='translate(1008)' d='M3.5 8h9'/>\
<path transform='translate(1032)' d='M8 3.5v9M3.5 8h9'/>\
<path transform='translate(1056)' d='M2.5 4.5h11M2.5 8h11M2.5 11.5h11'/>\
<path transform='translate(1080)' d='M8 1.75l5.5 2.75v7L8 14.25 2.5 11.5v-7zM2.5 4.5 8 7.25l5.5-2.75M8 7.25v7'/>\
<path transform='translate(1104)' d='M2 4.5h2c3.2 0 4.8 7 8 7h2M2 11.5h2c1 0 1.8-.7 2.5-1.6M9.5 6.1c.7-.9 1.5-1.6 2.5-1.6h2M12 2.5l2 2-2 2M12 9.5l2 2-2 2'/>\
<path transform='translate(1128)' d='M2.5 13.5l.75-3 7.5-7.5a1.4 1.4 0 0 1 2 0l.25.25a1.4 1.4 0 0 1 0 2l-7.5 7.5zM9.5 4.25l2.25 2.25'/>\
<path transform='translate(1152)' d='M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8zM8 9.75a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5z'/>\
<path transform='translate(1176)' d='M3.5 14V2.5M3.5 3H12l-2 3 2 3H3.5'/>\
<path transform='translate(1200)' d='M2.75 4.25h10.5M6 4.25V2.5h4v1.75M4 4.25l.6 9.25h6.8l.6-9.25M6.75 7v4M9.25 7v4'/>\
<path transform='translate(1224)' d='M6.5 2.5h-4v11h4M10 5l3 3-3 3M13 8H6'/>\
<path transform='translate(1248)' d='M2.5 13.5h11M4.5 11V8M8 11V4M11.5 11V6.5'/>\
<path transform='translate(1272)' d='M5.5 3l-3 3 3 3M2.5 6H10a3.5 3.5 0 0 1 0 7H7'/>\
<path transform='translate(1296)' d='M5.5 4h8M5.5 8h8M5.5 12h8M2.5 4h.05M2.5 8h.05M2.5 12h.05'/>\
</svg>");
}
.ico, .sel::after, .pill-signed::before, .pill-done::before, .pill-pass::before, .pill-rejected::before, .pill-fail::before, .pill-returned::before,
.pill-ai::before, .pill-human::before, .avatar-ai::before, .callout::before, .delta::before,
.track-step:is([data-state=done], [data-state=blocked]) .track-dot::after,
.pipe-step:is([data-state=done], [data-state=warn], [data-state=fail]) .pipe-dot::after, .hash::before, .basis::before, .vcheck-mark::after,
.scn-ico::before, .scn-step[data-result]::after {
  flex: none; width: var(--sz, 16px); height: var(--sz, 16px); background-color: currentColor;
  -webkit-mask: var(--sprite) calc(var(--k, 0) * -1.5 * var(--sz, 16px)) 0 / calc(var(--sprite-n) * 1.5 * var(--sz, 16px)) var(--sz, 16px) no-repeat;
  mask: var(--sprite) calc(var(--k, 0) * -1.5 * var(--sz, 16px)) 0 / calc(var(--sprite-n) * 1.5 * var(--sz, 16px)) var(--sz, 16px) no-repeat;
}
.ico { display: inline-block; vertical-align: -3px; }
.ico-sm { --sz: 14px; vertical-align: -2px; } .ico-lg { --sz: 20px; vertical-align: -5px; }
.ico-grid { --k: 0; } .ico-mail { --k: 1; } .ico-inbox { --k: 2; } .ico-chat { --k: 3; } .ico-check { --k: 4; } .ico-check-circle { --k: 5; } .ico-x { --k: 6; }
.ico-x-circle { --k: 7; } .ico-alert { --k: 8; } .ico-info { --k: 9; } .ico-table { --k: 10; } .ico-doc { --k: 11; } .ico-file { --k: 12; } .ico-image { --k: 13; }
.ico-shield { --k: 14; } .ico-bank { --k: 15; } .ico-flask { --k: 16; } .ico-clock { --k: 17; } .ico-calendar { --k: 18; } .ico-building { --k: 19; } .ico-bell { --k: 20; }
.ico-sparkle { --k: 21; } .ico-sliders { --k: 22; } .ico-users { --k: 23; } .ico-user { --k: 24; } .ico-chev-down { --k: 25; } .ico-chev-right { --k: 26; } .ico-arrow-right { --k: 27; }
.ico-arrow-up { --k: 28; } .ico-arrow-down { --k: 29; } .ico-search { --k: 30; } .ico-filter { --k: 31; } .ico-download { --k: 32; } .ico-upload { --k: 33; } .ico-copy { --k: 34; }
.ico-clip { --k: 35; } .ico-send { --k: 36; } .ico-refresh { --k: 37; } .ico-play { --k: 38; } .ico-more { --k: 39; } .ico-link { --k: 40; } .ico-lock { --k: 41; }
.ico-minus { --k: 42; } .ico-plus { --k: 43; } .ico-menu { --k: 44; } .ico-box { --k: 45; } .ico-shuffle { --k: 46; } .ico-edit { --k: 47; } .ico-eye { --k: 48; }
.ico-flag { --k: 49; } .ico-trash { --k: 50; } .ico-logout { --k: 51; } .ico-chart { --k: 52; } .ico-undo { --k: 53; } .ico-list { --k: 54; }

/* ===== 13. Tones: the one place that colours pills, tags, callouts, deltas, roles, notification icons ===== */
.pill-review, .pill-info, .pill-running, .tag-info, .callout, .role-controller { --c: var(--accent-700); --b: var(--accent-50); --e: var(--accent-500); }
.pill-signed, .pill-approved, .pill-done, .pill-live, .pill-pass, .tag-ok, .callout-ok, .delta.is-good, .notif-ico.is-ok, .role-bank { --c: var(--ok-700); --b: var(--ok-50); --e: var(--ok-500); }
.pill-pending, .tag-warn, .callout-warn, .notif-ico.is-warn { --c: var(--warn-700); --b: var(--warn-50); --e: var(--warn-500); }
.pill-overdue, .pill-rejected, .pill-fail, .tag-bad, .callout-bad, .delta.is-bad, .notif-ico.is-bad { --c: var(--bad-700); --b: var(--bad-50); --e: var(--bad-500); }
.pill-ai, .tag-ai, .actor-ai, .notif-ico.is-ai { --c: var(--ai-700); --b: var(--ai-50); }
.pill-returned { --c: #a3460c; --b: #fff0e5; }
.pill-human, .pill-open { --c: var(--n-700); }
.pill-open { --b: #fff; }
.pill-expired, .pill-notrun { --c: var(--n-500); --b: transparent; }

/* ===== 14. Motion: 120–360 ms, ease-out, no bounce. All of it is switched off for reduced motion. ===== */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { opacity: .5; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.8); } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes think { 0%, 70%, 100% { opacity: .3; transform: scale(.85); } 35% { opacity: 1; transform: scale(1); } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes drawer-out { to { transform: translateX(100%); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes drift { to { transform: translate(4%, -3%) rotate(8deg) scale(1.08); } }

/* Reveal on first paint: one element (data-reveal), or the direct children of a data-reveal-group 40 ms apart */
[data-reveal], [data-reveal-group] > * { animation: rise var(--t-4) var(--ease) backwards; }
[data-reveal-group] > :nth-child(2) { animation-delay: 40ms; }
[data-reveal-group] > :nth-child(3) { animation-delay: 80ms; }
[data-reveal-group] > :nth-child(4) { animation-delay: 120ms; }
[data-reveal-group] > :nth-child(5) { animation-delay: 160ms; }
[data-reveal-group] > :nth-child(6) { animation-delay: 200ms; }
[data-reveal-group] > :nth-child(7) { animation-delay: 240ms; }
[data-reveal-group] > :nth-child(n + 8) { animation-delay: 280ms; }

/* View transitions: page content cross-fades while the sidebar and top bar stay put */
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 200ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  /* spinners carry state, so they keep turning */
  .btn.is-loading::before, .pill-running::before, .pipe-step[data-state=running] .pipe-dot::after { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
