:root {
  --background: #F2F0EA; --card: #FAF9F5; --card-foreground: #16202A;
  --foreground: #16202A; --muted-foreground: #5B645E;
  --muted: #EDEAE1; --border: #DAD9CC; --input: #C7C4B2;
  --ring: #16202A;
  --primary: #16202A; --primary-foreground: #FAF9F5;
  --secondary: #EDEAE1; --secondary-foreground: #22343F;
  --accent: #EDEAE1; --accent-foreground: #22343F;
  --popover: #16202A; --popover-foreground: #FAF9F5;
  --sage: #5C7C6C; --sage-text: #46604F;
  --key-metric: #D9F0E4;
  --good: #15803D; --good-bg: #DCFCE7;
  --warn: #92400E; --warn-bg: #FEF3C7;
  --crit: #B91C1C; --crit-bg: #FEE2E2;
  --chart-1: #16202A; --chart-1-muted: #D9D6CB; --chart-2: #71717A; --chart-3: #A1A1AA;
  --row-hover: rgba(22,32,42,.045);
  --row-hover-solid: color-mix(in srgb, var(--foreground) 4.5%, var(--card)); /* the opaque twin of --row-hover (sticky first column); follows both themes */
  --podium-1: var(--sage); --podium-23: #ABA894;
  --logo-bg: #16202A; --logo-ink: #8FAE9E;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-fraunces: "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 12px; --radius-md: 8px; --radius-sm: 6px;
  /* motion tokens (DESIGN.md Motion) */
  --dur-press: 90ms;  --dur-fast: 160ms; --dur-exit: 200ms; --dur-move: 280ms;  --dur-slide: 280ms;
  --dur-enter: 400ms; --dur-draw: 560ms; --dur-hero: 720ms; --dur-pulse: 1400ms; --dur-wash: 2400ms;
  --delay-skeleton: 160ms; --delay-dim: 120ms;
  --ease-out: cubic-bezier(.2,.7,.2,1);      /* routine arrivals (the incumbent meter curve) */
  --ease-expo: cubic-bezier(.16,1,.3,1);     /* signature arrivals: hero chars, meter first fill, seat, overlays */
  --ease-in-out: cubic-bezier(.65,0,.35,1);  /* on-screen A->B moves: indicators, row glide, bar morph */
  --ease-exit: cubic-bezier(.4,0,1,1);       /* exits, ghosts */
  --ease-pulse: cubic-bezier(.45,0,.55,1);   /* skeleton breath only */
  --rise: 6px; --rise-sm: 4px; --roll: .62em; --press: .97; --enter-scale: .985;
  --stagger: 32ms; --stagger-chars: 18ms; --stagger-cap: 8; --stagger-bars: 200ms;
  --fresh-card: color-mix(in srgb, var(--sage) 14%, var(--card));    /* exception E1 */
  --fresh-muted: color-mix(in srgb, var(--sage) 10%, var(--muted));  /* exception E1 */
  --fresh-key: color-mix(in srgb, var(--sage) 10%, var(--key-metric)); /* exception E1, key tiles */
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-exit: 160ms; --dur-move: 160ms; --dur-enter: 160ms;
    --dur-slide: 0ms; --dur-draw: 0ms; --dur-hero: 0ms;
    --rise: 0px; --rise-sm: 0px; --roll: 0em; --press: 1; --enter-scale: 1;
    --stagger: 0ms; --stagger-chars: 0ms; --stagger-bars: 0ms;
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #09090B; --card: #111113; --card-foreground: #FAFAFA;
    --foreground: #FAFAFA; --muted-foreground: #A1A1AA;
    --muted: #1C1C1F; --border: #27272A; --input: #3F3F46;
    --ring: #8FAE9E;
    --primary: #8FAE9E; --primary-foreground: #16202A;
    --secondary: #1C1C1F; --secondary-foreground: #FAFAFA;
    --accent: #202024; --accent-foreground: #FAFAFA;
    --popover: #F4F4F5; --popover-foreground: #09090B;
    --sage: #8FAE9E; --sage-text: #8FAE9E;
    --key-metric: #182B22;
    --good: #4ADE80; --good-bg: #14291D;
    --warn: #FBBF24; --warn-bg: #3A2A0D;
    --crit: #F87171; --crit-bg: #3B1616;
    --chart-1: #E4E4E7; --chart-1-muted: #3F3F46; --chart-2: #A1A1AA; --chart-3: #71717A;
    --row-hover: rgba(255,255,255,.045);
    --podium-1: var(--sage); --podium-23: #52525B;
    --logo-bg: #16202A; --logo-ink: #8FAE9E;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #09090B; --card: #111113; --card-foreground: #FAFAFA;
  --foreground: #FAFAFA; --muted-foreground: #A1A1AA;
  --muted: #1C1C1F; --border: #27272A; --input: #3F3F46;
  --ring: #8FAE9E;
  --primary: #8FAE9E; --primary-foreground: #16202A;
  --secondary: #1C1C1F; --secondary-foreground: #FAFAFA;
  --accent: #202024; --accent-foreground: #FAFAFA;
  --popover: #F4F4F5; --popover-foreground: #09090B;
  --sage: #8FAE9E; --sage-text: #8FAE9E;
  --key-metric: #182B22;
  --good: #4ADE80; --good-bg: #14291D;
  --warn: #FBBF24; --warn-bg: #3A2A0D;
  --crit: #F87171; --crit-bg: #3B1616;
  --chart-1: #E4E4E7; --chart-1-muted: #3F3F46; --chart-2: #A1A1AA; --chart-3: #71717A;
  --row-hover: rgba(255,255,255,.045);
  --podium-1: var(--sage); --podium-23: #52525B;
  --logo-bg: #16202A; --logo-ink: #8FAE9E;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
}
* { box-sizing: border-box; }
body {
  background: var(--background); color: var(--foreground); font-family: var(--font-sans);
  font-size: 14px; line-height: 1.45; margin: 0; padding-inline: 16px; padding-block: 0 56px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-foreground); }
.wrap { max-width: 1180px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-sans); margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 500; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.num { }
.muted { color: var(--muted-foreground); }
.sub { color: var(--muted-foreground); }
svg.ic { flex: none; display: block; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--background); padding-block: 16px 0; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.logo-mark { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--logo-bg); color: var(--logo-ink); display: grid; place-items: center; font-family: var(--font-fraunces); font-weight: 600; font-size: 22px; line-height: 1; flex: none; }
.brand-name { display: grid; line-height: 1.15; }
.wordmark { font-family: var(--font-fraunces); font-weight: 600; font-size: 23px; letter-spacing: -0.01em; color: var(--foreground); white-space: nowrap; }
@media (max-width: 420px) { .wordmark { font-size: 20px; } }
.wordmark b { font-weight: 600; color: var(--sage-text); }
.brand-name small { font-size: 11px; color: var(--muted-foreground); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.seg { display: inline-flex; background: var(--muted); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; color: var(--muted-foreground); font-weight: 500; font-size: 13px; height: 30px; }
@media (hover: hover) { .seg button:hover { color: var(--foreground); } }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.ctl { display: flex; align-items: center; gap: 9px; }
.ctl-label { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.tabs { display: flex; gap: 2px; margin-top: 14px; background: var(--muted); border-radius: var(--radius-md); padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 700px) { .top { position: static; } }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted-foreground); font-weight: 500; white-space: nowrap; border-radius: var(--radius-sm); font-size: 14px; }
@media (hover: hover) { .tabs a:hover { color: var(--foreground); } }
.tabs a[aria-current="page"] { color: var(--foreground); background: var(--card); box-shadow: var(--shadow-sm); font-weight: 600; }
.viewnote { margin-top: 12px; font-size: 13px; padding: 9px 14px; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-foreground); }

/* panels */
main { display: grid; gap: 18px; margin-top: 18px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 16px; }
.panel-head h2 { color: var(--card-foreground); }
.panel-head .muted { font-size: 13px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* hero band — same card recipe as any other panel; prominence comes from scale + the sage meter, not a colour block */
.hero-band { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.hero-grid { display: grid; gap: 22px 36px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero-label { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.hero-fig { font-weight: 600; font-size: clamp(34px, 5.8vw, 60px); line-height: 1; letter-spacing: -0.03em; margin-top: 8px; color: var(--card-foreground); }
.meter { margin-top: 18px; }
.meter-track { position: relative; height: 8px; background: var(--muted); border-radius: 100px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--sage); border-radius: 100px; }
.meter-proj { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--muted-foreground); opacity: .8; }
.meter-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-foreground); margin-top: 7px; }
.pace { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 13px; color: var(--muted-foreground); align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles .tile { background: var(--muted); border-radius: var(--radius-sm); padding: 14px; min-width: 0; display: flex; gap: 9px; align-items: flex-start; }
.tiles .tile svg.ic { width: 16px; height: 16px; color: var(--muted-foreground); margin-top: 2px; }
.tile-body { min-width: 0; }
.tile-label { font-size: 12px; color: var(--muted-foreground); line-height: 1.25; }
.tile-val { font-weight: 600; font-size: 24px; line-height: 1.2; margin-top: 3px; color: var(--card-foreground); letter-spacing: -0.02em; }
.tile-goal { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }

/* agent stat row — the same flat-cell treatment as the hero tiles */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-row .tile { background: var(--muted); border-radius: var(--radius-sm); padding: 14px; display: flex; gap: 9px; align-items: flex-start; }
.stat-row .tile svg.ic { width: 16px; height: 16px; color: var(--muted-foreground); margin-top: 3px; }
.stat-row .tile-val { color: var(--card-foreground); font-size: 24px; }
.stat-row .tile-label { color: var(--muted-foreground); }
.stat-row .tile-goal { color: var(--muted-foreground); }
.tiles .tile.key-metric, .stat-row .tile.key-metric { background: var(--key-metric); }

/* badges */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px 3px 7px; border-radius: var(--radius-md); white-space: nowrap; }
.chip svg { flex: none; }
.chip.good { color: var(--good); background: var(--good-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.crit { color: var(--crit); background: var(--crit-bg); }

/* shared avatar */
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--muted); color: var(--muted-foreground); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }

/* monthly bonus tracker */
.rulenote { font-size: 13px; padding: 9px 14px; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-foreground); margin-bottom: 16px; }
.bonus-list { display: grid; gap: 0; }
.bonus-row { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(0, 1.6fr); gap: 6px 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.bonus-row:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 640px) { .bonus-row { grid-template-columns: minmax(0, 1fr); } }
.bonus-who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; }
.bonus-earned { font-weight: 600; font-size: 15px; color: var(--card-foreground); white-space: nowrap; }
.bonus-earned span { font-weight: 400; font-size: 12px; color: var(--muted-foreground); margin-left: 4px; }
.bonus-track { position: relative; height: 8px; background: var(--muted); border-radius: 100px; margin-top: 2px; }
.bonus-fill { position: absolute; inset: 0 auto 0 0; background: var(--sage); border-radius: 100px; }
.bonus-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--border); }
.bonus-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12.5px; color: var(--muted-foreground); margin-top: 6px; }
.bonus-next { font-weight: 500; color: var(--card-foreground); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted-foreground); font-size: 11px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .base { stroke: var(--input); stroke-width: 1; }
.chart .mark { fill: var(--chart-1); }
.chart .mark.dim { fill: var(--chart-1-muted); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:focus { outline: none; }
.chart .hit:focus-visible { stroke: var(--ring); stroke-width: 2; }
.chart .endlabel { fill: var(--card-foreground); font-weight: 600; }
.tip { position: absolute; pointer-events: none; background: var(--popover); color: var(--popover-foreground); font-size: 12px; padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; transform: translate(-50%, calc(-100% - 9px)); z-index: 3; box-shadow: var(--shadow-sm); }
.tip b { font-weight: 600; }
.chart-cap { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; }
details.tv { margin-top: 12px; font-size: 13px; }
details.tv summary { cursor: pointer; color: var(--primary); font-weight: 500; width: fit-content; }
@media (hover: hover) { details.tv summary:hover { text-decoration: underline; } }
.small-multiples { display: grid; gap: 20px; }

/* tables */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: right; padding: 0 11px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
th { height: 40px; }
td { height: 44px; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 500; color: var(--muted-foreground); font-size: 13px; font-variant-numeric: normal; }
th button { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 500; color: inherit; display: inline-flex; gap: 4px; align-items: center; font-size: 13px; }
@media (hover: hover) { th button:hover { color: var(--foreground); } }
th[aria-sort] button { color: var(--foreground); font-weight: 600; }
@media (hover: hover) { tbody tr:hover td { background: var(--row-hover); } }
tr.subtotal td { font-weight: 600; background: var(--muted); }
@media (hover: hover) { tr.subtotal:hover td { background: var(--muted); } }
tr.off td { color: var(--muted-foreground); }
tbody tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; }
.rank { font-weight: 600; font-size: 13px; color: var(--muted-foreground); width: 16px; display: inline-block; }
.inbar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.inbar i { display: block; height: 6px; background: var(--chart-1); border-radius: 100px; }
.lb-note { font-size: 12px; color: var(--muted-foreground); margin-top: 12px; }

/* podium — the one place, besides the meter, where sage marks a winner */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 12px; margin-bottom: 20px; align-items: end; }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; align-items: stretch; } }
.pod { border-radius: var(--radius-sm); padding: 16px 14px; text-align: center; background: var(--muted); }
.pod-1 { padding-top: 20px; padding-bottom: 20px; box-shadow: 0 0 0 1px var(--podium-1) inset; }
.pod-rank { font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .03em; }
.pod-1 .pod-rank { color: var(--sage-text); }
.pod-av { width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--muted-foreground); display: grid; place-items: center; font-weight: 600; font-size: 17px; margin: 8px auto 0; box-shadow: 0 0 0 2px var(--podium-23); }
.pod-1 .pod-av { width: 54px; height: 54px; font-size: 20px; color: var(--sage-text); box-shadow: 0 0 0 2px var(--podium-1); }
.pod-name { font-weight: 600; margin-top: 8px; font-size: 13.5px; }
.pod-val { font-weight: 600; font-size: 24px; margin-top: 3px; letter-spacing: -0.02em; }
.pod-1 .pod-val { font-size: 28px; color: var(--sage-text); }
.pod-metric { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }

/* agent picker */
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-md); padding: 5px 14px 5px 5px; cursor: pointer; font-weight: 500; font-size: 14px; height: 36px; }
@media (hover: hover) { .picker button:hover { border-color: var(--muted-foreground); } }
.picker button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv .total { font-weight: 700; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; color: var(--card-foreground); font-size: 15px; }
.bonus-in { width: 84px; text-align: right; padding: 4px 7px; border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); font-variant-numeric: tabular-nums; }
.bonus-in:focus-visible { outline-color: var(--ring); }
.deals { display: grid; gap: 8px; margin-top: 12px; }
.deal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px; background: var(--muted); }
label.fl { display: block; font-size: 12px; color: var(--muted-foreground); margin-top: 12px; }

/* ===== live build additions: aliases and recipes only, no new hex values ===== */
:root { --field-border: var(--muted-foreground); }
[hidden] { display: none !important; }
html { overflow: visible; }
body { caret-color: var(--foreground); scrollbar-color: var(--input) var(--background); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tabs a { text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--foreground); }
.scroll:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.prose { max-width: 75ch; }

/* header layout */
.bar2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; }
.bar2 .tabs { margin-top: 0; }
.account { position: relative; }
@media (max-width: 999px) {
  .account { order: 1; }
  #periodCtl { order: 2; flex-basis: 100%; }
}
.acct-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 3px; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-md); cursor: pointer; font-weight: 500; font-size: 14px; }
@media (hover: hover) { .acct-btn:hover { border-color: var(--muted-foreground); } }
.acct-btn .avatar { width: 28px; height: 28px; }
.acct-name { display: none; }
.acct-chev { display: none; }
@media (min-width: 560px) { .acct-name { display: inline; } .acct-chev { display: block; } .acct-btn { padding: 0 10px 0 3px; } }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); width: min(260px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-radius: 12px; padding: 14px; z-index: 6; display: grid; gap: 8px; }
.acct-menu .a-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.acct-menu .a-email { font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.acct-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--muted); color: var(--muted-foreground); white-space: nowrap; }
.loadnote { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-foreground); min-width: 0; }
.stamp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted-foreground); margin-right: auto; }
.stamp .st-main { display: inline-flex; align-items: center; gap: 6px; }
.stamp .st-fail { display: inline-flex; align-items: center; gap: 6px; color: var(--crit); }
.previewctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.previewctl select { width: auto; max-width: 100%; }

/* buttons */
.btn, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn { background: var(--primary); color: var(--primary-foreground); }
@media (hover: hover) { .btn:hover { background: color-mix(in srgb, var(--primary) 90%, var(--card)); } }
.btn:active { background: color-mix(in srgb, var(--primary) 80%, var(--card)); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
@media (hover: hover) { .btn-secondary:hover { background: color-mix(in srgb, var(--secondary) 94%, var(--foreground)); } }
.btn-secondary:active { background: color-mix(in srgb, var(--secondary) 88%, var(--foreground)); }
.btn:disabled, .btn-secondary:disabled, .btn[aria-disabled="true"], .btn-secondary[aria-disabled="true"] { background: var(--muted); color: var(--muted-foreground); cursor: default; }
.btn-link { border: 0; background: none; padding: 0; font-size: inherit; font-weight: 500; color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.btn-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted-foreground); border-radius: var(--radius-md); cursor: pointer; flex: none; }
@media (hover: hover) { .btn-icon:hover { color: var(--foreground); background: var(--muted); } }

/* switch */
.switch { position: relative; width: 36px; height: 20px; border: 1px solid var(--field-border); border-radius: 100px; background: var(--card); padding: 0; cursor: pointer; flex: none; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--field-border); }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"] .knob { left: 18px; background: var(--primary-foreground); }

/* fields */
.field-in { height: 36px; background: var(--card); border: 1px solid var(--field-border); border-radius: var(--radius-md); padding: 0 10px; width: 100%; color: var(--foreground); min-width: 0; }
select.field-in { padding-right: 6px; }
.field-in[aria-invalid="true"] { border-color: var(--crit); }
.fgroup { display: flex; align-items: center; gap: 6px; }
.fgroup .pre, .fgroup .suf { color: var(--muted-foreground); font-size: 14px; flex: none; }
.fld { display: block; margin-top: 14px; min-width: 0; }
.fld.first { margin-top: 0; }
label.fl, legend.fl { display: block; font-size: 12px; color: var(--muted-foreground); margin: 0 0 6px; padding: 0; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.hint { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; }
.ferr { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--crit); margin-top: 6px; }
.ferr svg { margin-top: 1px; }
.opt { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 14px; }
.opt input { margin: 0; width: 16px; height: 16px; }
.opts { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.bonus-in { border-color: var(--field-border); }
.bonus-cell { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; }
.bonus-cell .pre { color: var(--muted-foreground); margin-right: -4px; }
.bonus-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted-foreground); }
.bonus-state.good { color: var(--good); }
.bonus-state.crit { color: var(--crit); }
.kv .full { grid-column: 1 / -1; text-align: left; }
.kv .ferr { justify-content: flex-end; margin-top: 0; }

/* notices */
.notice { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; padding: 9px 12px; border-radius: var(--radius-md); min-width: 0; overflow-wrap: anywhere; }
.notice svg { margin-top: 3px; }
.notice > span, .notice > div { min-width: 0; }
.notice.warn { color: var(--warn); background: var(--warn-bg); }
.notice.crit { color: var(--crit); background: var(--crit-bg); }
.notice.info { background: var(--accent); color: var(--accent-foreground); }
.notice.row { align-items: center; flex-wrap: wrap; }
.notice.row svg { margin-top: 0; }
.notice .grow { flex: 1 1 auto; }
.notice.live > span { max-width: 75ch; }
.notice.warn a, .notice.crit a { color: inherit; }
#banners { display: grid; gap: 8px; margin-top: 12px; }
#banners:empty { margin-top: 0; }

/* skeleton */
.sk { display: block; background: var(--muted); border-radius: var(--radius-sm); }
.sk-hero { height: clamp(34px, 5.8vw, 60px); width: min(260px, 70%); }
.sk-val { height: 24px; width: 70%; margin-top: 3px; }
.sk-row { height: 44px; border-radius: 0; }
.sk-tile { min-height: 76px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-foreground); font-size: 13px; text-align: center; padding: 0 56px; pointer-events: none; }

/* spinner */
.spin { animation: spin 800ms linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .meter-fill { transition: none !important; } }

/* state panels (error / empty / unlinked) */
.state-panel { display: grid; gap: 10px; justify-items: start; }
.state-panel h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.state-panel p { max-width: 75ch; color: var(--muted-foreground); font-size: 14px; }
.state-panel h2 svg { color: var(--crit); }

/* sign-in: centred lockup + one card; .top is not rendered while signed out */
body[data-auth="out"] { padding-block: 0; }
body[data-auth="out"] .top, body[data-auth="boot"] .top { display: none; }
.signin { margin-top: 0; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 24px; padding-block: 24px calc(24px + 8vh); }
.signin .brand { margin-right: 0; }
.signin-card { width: min(100%, 400px); text-align: center; }
.signin-card h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.signin-card h2:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: var(--radius-sm); }
.signin-card .lead { color: var(--muted-foreground); margin-top: 8px; font-size: 14px; }
.signin-card .helper { color: var(--muted-foreground); margin-top: 16px; font-size: 12px; }
#signinNotice { margin-top: 20px; display: grid; gap: 8px; text-align: left; }
#signinNotice:empty { display: none; }
.gis-slot { min-height: 44px; margin-top: 20px; display: grid; place-items: center; }
.gis-slot .gis-status { min-height: 44px; display: grid; place-items: center; }
.gis-slot .loadnote { font-size: 14px; color: var(--foreground); }
.gis-slot .btn { min-height: 44px; height: auto; max-width: 100%; }
#gisButton, #gisButton iframe { color-scheme: light; background: transparent; }

/* hero extras */
.hero-grid > * { min-width: 0; }
.nogoal { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted-foreground); }
.dq { margin-top: 12px; }
.grid-2.single { grid-template-columns: minmax(0, 1fr); }
.content { display: grid; gap: 18px; min-width: 0; }
main { min-width: 0; }
.panel-head.start { justify-content: flex-start; }

/* tables */
.tv .scroll { margin-top: 10px; }
.who .nm { min-width: 0; }
.deal .dealtxt { min-width: 0; overflow-wrap: anywhere; }
.deal .badge { background: var(--card); }
.pay-note { font-size: 13px; color: var(--muted-foreground); }

/* people (settings) */
.people-cards { display: none; }
@media (max-width: 759px) { .people-table { display: none; } .people-cards { display: block; } }
.p-card { border-top: 1px solid var(--border); padding: 14px 0; display: grid; gap: 4px; font-size: 13.5px; }
.p-card:first-child { border-top: 0; padding-top: 0; }
.p-card .p-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.p-card .p-name { font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.p-card .p-email { font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.people-table td, .people-table th { text-align: left; }
.people-table td.wrapc { white-space: normal; overflow-wrap: anywhere; min-width: 170px; }
.people-table td.act, .people-table th.act { text-align: right; }
.status-line { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--muted-foreground); margin-bottom: 14px; }
.status-line.good { color: var(--good); }
.status-line.crit { color: var(--crit); }
.status-line svg { margin-top: 2px; }
.status-line:empty { display: none; }
details.deact { margin-top: 16px; }
details.deact summary { cursor: pointer; color: var(--primary); font-weight: 500; width: fit-content; font-size: 13.5px; }
details.deact .scroll, details.deact .people-cards { margin-top: 10px; }
.goal-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; margin-top: 14px; }
@media (max-width: 900px) { .goal-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .goal-fields { grid-template-columns: minmax(0, 1fr); } }
.goal-fields .fld { margin-top: 0; }
.goal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.goal-foot .gs { font-size: 13px; color: var(--muted-foreground); display: inline-flex; align-items: flex-start; gap: 6px; }
.goal-foot .gs.good { color: var(--good); }
.goal-foot .gs.crit { color: var(--crit); }
.month-row { max-width: 260px; }

/* dialogs */
dialog { border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); padding: 0; box-shadow: var(--shadow-sm); width: min(480px, calc(100vw - 24px)); max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dlg { padding: 20px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dlg-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; min-width: 0; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; }
.dlg-foot .grp { display: flex; gap: 8px; flex-wrap: wrap; }
.dlg-foot .note { font-size: 13px; color: var(--muted-foreground); }
.dlg .save-err { margin-top: 16px; }
.confirm-row { display: grid; gap: 12px; margin-top: 20px; font-size: 14px; }
.confirm-row .grp { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
dialog.confirm { width: min(420px, calc(100vw - 24px)); }
dialog.confirm p { color: var(--muted-foreground); font-size: 14px; margin-top: 8px; }

/* manager hours override: daily log marks, pencil, hours dialog */
.badge.ed { padding: 1px 6px; white-space: nowrap; }
tr.subtotal .badge.ed { background: var(--card); }
.btn-icon.sm { width: 28px; height: 28px; }
.hrs { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.hrs-slot { display: inline-block; width: 28px; height: 28px; flex: none; }
.log-note { font-size: 12px; color: var(--muted-foreground); margin-top: 12px; }
dialog.hours { width: min(440px, calc(100vw - 24px)); }
dialog.hours .kv { margin-bottom: 4px; }
dialog.hours .fgroup .field-in { width: 120px; flex: none; }
dialog.hours .hd-week { font-size: 13px; color: var(--muted-foreground); margin-top: 14px; }

/* tabs at 375 */
@media (max-width: 420px) { .tabs a { font-size: 13px; padding: 8px 10px; } }
.picker button .avatar { width: 26px; height: 26px; font-size: 12px; }
@media (max-width: 559px) { .panel, .hero-band { padding: 18px; } }
.chip.wrap { white-space: normal; }
.col { display: grid; gap: 18px; align-content: start; min-width: 0; }
#deals { margin-top: 0; }
.scroll { position: relative; }
@media (max-width: 420px) { .tabs { width: 100%; justify-content: space-between; } .tabs a { flex: 1 1 auto; text-align: center; } }
@media (max-width: 420px) { .tabs { gap: 0; padding: 3px; } }
.booting #periodCtl, .booting #account, .booting #bar2, .booting #previewCtl { visibility: hidden; }
@media (max-width: 440px) { .sk-wrap .sk-l2 { display: block; } }
.sk-l2 { display: none; }
#bonusPanel .panel-head { margin-bottom: 14px; }
.bn-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px 36px; }
@media (min-width: 900px) {
  .bn-grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bn-grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .bn-cell.span2 { grid-row: span 2; }
}
.bn-cell { border-top: 1px solid var(--border); padding-top: 14px; min-width: 0; }
.bn-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 10px; }
.bn-head h3 { color: var(--card-foreground); }
.bn-head .muted { font-size: 12.5px; }
.bn-fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.bn-fig .tile-val { margin-top: 0; }
.bn-fig .muted { font-size: 13px; }
.bn-cell .bonus-track { margin-top: 10px; }
.bn-cell .bonus-tick { background: var(--muted-foreground); }
.bonus-fill.ink { background: var(--chart-1); }
.bn-steps, .bn-lines { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; }
.bn-lines { margin-top: 0; font-size: 13.5px; }
.bn-step, .bn-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-width: 0; }
.bn-step > :first-child, .bn-line > :first-child { min-width: 0; overflow-wrap: anywhere; }
.bn-step > .bn-v { color: var(--muted-foreground); }
.bn-line .nm { font-weight: 500; }
.bn-line > .bn-v { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.bn-note { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--muted-foreground); max-width: 75ch; }
.bn-note svg { margin-top: 2px; }
.bn-cap { font-size: 12px; color: var(--muted-foreground); margin-top: 8px; }
.bn-cell .bonus-row { padding: 12px 0; }
.bn-cell .bonus-row:first-child { padding-top: 0; }
.bp-rule { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 18px; }
.bp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.bp-head h3 { color: var(--card-foreground); }
.bp-rule .goal-fields { margin-top: 12px; }
.bp-rule .hint { margin-top: 10px; max-width: 75ch; }
.bp-add { margin-top: 12px; }
/* Today (live): as-of stamp, Refresh, live note, podium note, compact period control */
.asof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-right: auto; min-width: 0; }
.asof .stamp { margin-right: 0; }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; background: var(--card); color: var(--foreground); }
@media (hover: hover) { .btn-outline:hover { border-color: var(--muted-foreground); } }
.btn-outline[aria-disabled="true"] { color: var(--muted-foreground); cursor: default; }
.live-note { flex: 1 1 100%; display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--muted-foreground); min-width: 0; max-width: 75ch; }
.live-note:empty { display: none; }
.live-note.crit { color: var(--crit); }
.live-note svg { margin-top: 2px; }
.podium-note { grid-column: 1 / -1; font-size: 13px; color: var(--muted-foreground); margin: 0 0 20px; }
@media (max-width: 999px) { #periodCtl { flex-wrap: wrap; row-gap: 6px; } #periodStatus:empty { display: none; } }
@media (max-width: 559px) {
  #periodLabel, .seg-x { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  #periodCtl .seg { display: flex; width: 100%; }
  #periodCtl .seg button { flex: 1 1 auto; padding: 7px 8px; }
}
/* ===== motion (DESIGN.md Motion). CSS starts motion only on the elements below; everything else is app.js's engine.
   Commit first, animate after: nothing here delays a state change, and focus rings never transition. ===== */
@keyframes m-fade  { from { opacity: 0; } }
@keyframes m-drop  { from { opacity: 0; transform: translateY(calc(var(--rise-sm) * -1)); } }
@keyframes m-sk-in { from { opacity: 0; } }
@keyframes m-sk-breath { 50% { opacity: .55; } }
@keyframes m-fresh { 0%, 35% { background-color: var(--fresh-card); } }
@keyframes m-fresh-muted { 0%, 35% { background-color: var(--fresh-muted); } }
@keyframes m-fresh-key { 0%, 35% { background-color: var(--fresh-key); } }
@keyframes m-draw  { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes m-edge  { from { box-shadow: 0 1px 0 transparent; } to { box-shadow: 0 1px 0 var(--border); } }

main[data-panel] { position: relative; }
#banners .notice, #signinNotice .notice, .ferr:not([hidden]), #saveErr:not([hidden]), #dlgFoot .confirm-row, #rateSlot .fld { animation: m-drop var(--dur-move) var(--ease-out); }
#gisStatus:not([hidden]) { animation: m-fade var(--dur-fast) var(--ease-out); }
#gisButton iframe { animation: m-fade var(--dur-move) var(--ease-out); }
#periodStatus:not(:empty) { animation: m-fade var(--dur-fast) var(--ease-out) var(--delay-skeleton) backwards; }
@media (min-width: 1000px) { #periodStatus { order: -1; } #periodCtl { padding-right: 9px; } }

.sk { animation: m-sk-in var(--dur-move) var(--ease-out) calc(var(--delay-skeleton) - var(--sk-elapsed, 0ms)) backwards,
                 m-sk-breath var(--dur-pulse) var(--ease-pulse) calc(var(--delay-skeleton) + var(--dur-move) - var(--sk-elapsed, 0ms)) infinite; }
.sk-ghosts { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sk-ghost { position: absolute; background: var(--muted); }
.rolling { position: relative; clip-path: inset(-.12em -.6em); }
.rolling .rc, .tk { display: inline-block; }
.rc { white-space: pre; }
.rc::before { content: attr(data-c); }
.rc-ghost { position: absolute; pointer-events: none; opacity: 0; }
.fresh { animation: m-fresh var(--dur-wash) linear; }
.tile.fresh, .pod.fresh, .deal.fresh, tr.subtotal td.fresh { animation-name: m-fresh-muted; }
.tile.key-metric.fresh { animation-name: m-fresh-key; }
.chart .mark, .chart .endlabel { transform-box: fill-box; transform-origin: 50% 100%; }
.stamp .st-main svg { transform-origin: 50% 50%; }
#agentGrid, #logPanel { transition: opacity var(--dur-fast) var(--ease-out); }
#agentGrid.is-holding, #logPanel.is-holding { opacity: .5; transition: opacity var(--dur-fast) var(--ease-out) var(--delay-dim); }

.tabs, .seg { position: relative; }
.tab-ind, .seg-ind { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-slide) var(--ease-in-out), width var(--dur-slide) var(--ease-in-out); }
.tab-ind { background: var(--card); }  .seg-ind { background: var(--primary); }
.tabs a, .seg button { position: relative; z-index: 1; }
.tabs.has-ind a[aria-current="page"], .seg.has-ind button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.seg.has-ind button[aria-pressed="true"] { transition-delay: 60ms; }
.ind-instant .tab-ind, .ind-instant .seg-ind { transition: none; }
.switch { transition: background-color var(--dur-fast) var(--ease-out); }
.switch .knob { transition: transform var(--dur-slide) var(--ease-in-out), background-color var(--dur-fast) var(--ease-out); }
.switch[aria-checked="true"] .knob { left: 2px; transform: translateX(16px); }

.btn, .btn-secondary, .btn-outline, .btn-icon, .acct-btn, .picker button { -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
:is(.btn, .btn-secondary, .btn-outline, .btn-icon, .acct-btn, .picker button):active { transform: scale(var(--press)); transition-duration: var(--dur-press); }
:is(.btn, .btn-secondary, .btn-outline):is(:disabled, [aria-disabled="true"]):active { transform: none; }
.seg button, .tabs a, th button, .field-in, .bonus-in { transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
tbody td { transition: background-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) { tbody tr:hover td { transition-duration: 0s; } }

.acct-menu { transform-origin: top right; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-move) var(--ease-expo), display var(--dur-fast) allow-discrete; }
.acct-menu[hidden] { opacity: 0; transform: translateY(calc(var(--rise-sm) * -1)) scale(var(--enter-scale)); transition-duration: var(--dur-fast); transition-timing-function: var(--ease-exit); }
@starting-style { .acct-menu:not([hidden]) { opacity: 0; transform: translateY(calc(var(--rise-sm) * -1)) scale(var(--enter-scale)); } }
dialog { overscroll-behavior: contain; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-move) var(--ease-expo), overlay var(--dur-exit) allow-discrete, display var(--dur-exit) allow-discrete; }
dialog:not([open]) { opacity: 0; transform: translateY(var(--rise-sm)) scale(var(--enter-scale)); transition-duration: var(--dur-exit); transition-timing-function: var(--ease-exit); }
@starting-style { dialog[open] { opacity: 0; transform: translateY(var(--rise)) scale(var(--enter-scale)); } }
dialog::backdrop { transition: background-color var(--dur-move) var(--ease-out), overlay var(--dur-exit) allow-discrete, display var(--dur-exit) allow-discrete; }
dialog:not([open])::backdrop { background-color: rgb(0 0 0 / 0); }
@starting-style { dialog[open]::backdrop { background-color: rgb(0 0 0 / 0); } }
dialog.no-exit, dialog.no-exit::backdrop { transition: none; }
.chart .tip { left: 0; top: 0; transform: translate(calc(var(--tx, 0px) - 50%), calc(var(--ty, 0px) - 100% - 9px));
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out), display var(--dur-fast) allow-discrete; }
.chart .tip[hidden] { opacity: 0; }
@starting-style { .chart .tip:not([hidden]) { opacity: 0; transform: translate(calc(var(--tx, 0px) - 50%), calc(var(--ty, 0px) - 100% - 9px + var(--rise-sm))); } }

.top #periodCtl, .top #account, #previewSel { transition: opacity var(--dur-move) var(--ease-out); }
.top #bar2 { transition: opacity var(--dur-fast) var(--ease-out); }
.booting #periodCtl, .booting #account, .booting #bar2, .booting #previewCtl { opacity: 0; }
@starting-style { .top #periodCtl, .top #account, .top #bar2, #previewSel { opacity: 0; } }
.meter-fill { transition: width var(--dur-draw) var(--ease-in-out); transform-origin: 50% 50%; }
.meter-proj { transition: left var(--dur-draw) var(--ease-in-out); }
.meter-fill.user, .meter-proj.user { transition-duration: var(--dur-enter); }
.meter-fill.first { transition: width var(--dur-hero) var(--ease-expo) 80ms; }
@media (prefers-reduced-motion: no-preference) { .ic-draw path { stroke-dasharray: 1; animation: m-draw var(--dur-move) var(--ease-out) 60ms backwards; } }

html:has(body[data-auth="in"]) { scrollbar-gutter: stable; }
.scroll { overflow-y: hidden; overscroll-behavior-x: contain; }
.tabs { overscroll-behavior-x: contain; }
@supports (animation-timeline: scroll()) { @media (min-width: 700px) {
  .top { animation: m-edge linear both; animation-timeline: scroll(root block); animation-range: 0 24px; } } }

@media (prefers-reduced-motion: reduce) {
  .sk { animation: m-sk-in 0s linear calc(var(--delay-skeleton) - var(--sk-elapsed, 0ms)) backwards; }
  .chart .tip { transition-property: opacity, display; }
  .seg.has-ind button[aria-pressed="true"] { transition-delay: 0s; }
}
/* ===== Pipeline tab (DESIGN.md "Surface: Pipeline"): recipes on the existing tokens only; no sage on this tab ===== */
@media (max-width: 420px) {
  .tabs[data-n="5"] a { padding: 8px 4px; }
  .tabs[data-n="5"] .tab-x { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (min-width: 900px) { .tiles.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Pipeline tiles (P1, P6): one column below 560px, two from 560px, four (P1) / three (P6) from 900px. Label (icon inline),
   value and notes are three row tracks shared across a row (subgrid), so values line up even when a label wraps. */
.pl-tiles { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .pl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tiles.c4.pl-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat-row.pl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pl-tiles > .tile.pl-tile { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 14px; }
@supports (grid-template-rows: subgrid) {
  .pl-tiles > .tile.pl-tile { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
}
@supports not (grid-template-rows: subgrid) { @media (min-width: 560px) { .pl-tile .tile-label { min-height: 32px; } } }
.pl-tile .tile-label { display: flex; align-items: flex-start; gap: 6px; line-height: 16px; min-width: 0; }
.pl-tile .tile-label > span { min-width: 0; }
.pl-tiles .pl-tile .tile-label svg.ic { margin-top: 0; }
.pl-tile .tile-goal { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; line-height: 1.3; min-width: 0; }
.pl-tile .tile-goal:empty { display: none; }
.pl-tile .tile-val { line-height: 1.1; }
.tiles .tile.warn { background: var(--warn-bg); }
.tile.warn svg.ic, .tile.warn .tile-label, .tile.warn .tile-val, .tile.warn .tile-goal { color: var(--warn); }
.chart .mark.open { fill: var(--card); stroke: var(--chart-1); stroke-width: 1.5px; }
.chart .mark.h { transform-origin: 0 50%; }
.chart text.hl { font-size: 13px; font-weight: 500; fill: var(--card-foreground); font-variant-numeric: normal; }
.chart text.hn { font-size: 12px; }
.chart text.hv { font-size: 14px; font-weight: 600; fill: var(--card-foreground); }
.chart text.hp { font-size: 13px; }
.chart text.hh { font-size: 12px; font-variant-numeric: normal; }
.chart text.hnote { font-variant-numeric: normal; }
.chart text.hx { font-size: 13px; font-variant-numeric: normal; }
.chart .tip.tw { white-space: normal; width: max-content; max-width: min(300px, 100%); }
.chart-pad { height: 120px; }
.stepper { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.stepper .btn-icon { width: 34px; height: 34px; color: var(--foreground); }
.stepper .btn-icon[aria-disabled="true"] { color: var(--muted-foreground); cursor: default; }
@media (hover: hover) { .stepper .btn-icon[aria-disabled="true"]:hover { color: var(--muted-foreground); background: transparent; } }
.stepper .btn-icon[aria-disabled="true"]:active { transform: none; }
.stepper-label { min-width: 100px; padding: 0 4px; text-align: center; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--card-foreground); }
.pl-head { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "t" "p" "c"; align-items: center; gap: 4px 12px; margin-bottom: 16px; }
.pl-head h2 { grid-area: t; color: var(--card-foreground); }
.pl-head .pl-cap { grid-area: p; font-size: 13px; }
.pl-ctl { grid-area: c; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
/* wide: title and caption on the left, the controls beside them on the right (Design P2 "head left / head right") */
@media (min-width: 1000px) {
  .pl-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t c" "p c"; }
  .pl-ctl { margin-top: 0; justify-content: flex-end; align-self: center; }
}
/* phone: both seg groups share the first row, the stepper fills the second (chevrons at the ends, label centred), and
   the loading note and "Back to this ..." share a third row, Back right-aligned under the stepper */
@media (max-width: 559px) {
  .pl-ctl .seg { flex: 1 1 auto; }
  .pl-ctl .seg button { flex: 1 1 auto; padding: 7px 6px; }
  .pl-ctl .stepper { display: flex; flex: 1 1 100%; justify-content: space-between; }
  .pl-ctl .stepper-label { flex: 1 1 auto; }
  .pl-ctl .btn-link { margin-left: auto; }
}
#plLoad:empty { display: none; }
#plLoad:not(:empty) { animation: m-fade var(--dur-fast) var(--ease-out) var(--delay-skeleton) backwards; }
#plFunnelBody, #plTrendBody { transition: opacity var(--dur-fast) var(--ease-out); }
#plFunnelBody.is-holding, #plTrendBody.is-holding { opacity: .5; transition: opacity var(--dur-fast) var(--ease-out) var(--delay-dim); }
.pl-fail:empty, .pl-mature:empty, .pl-decnote:empty, #plTrendNote:empty, #plWinNote:empty, #plAiHint:empty, #plDup:empty { display: none; }
.pl-fail { margin-bottom: 14px; }
.pl-mature { margin-bottom: 12px; }
.pl-decnote { margin-top: 14px; }
.pl-h3 { margin-bottom: 7px; }
.stat-row.pl-month { margin-top: 0; }
.pl-line { font-size: 14px; color: var(--card-foreground); }
.pl-cohort { font-size: 13px; margin-top: 6px; }
.pl-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 36px; margin-top: 18px; }
@media (min-width: 900px) { .pl-split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.pl-split > div { border-top: 1px solid var(--border); padding-top: 14px; min-width: 0; }
.pl-split h3 { color: var(--card-foreground); margin-bottom: 6px; }
.pl-note { font-size: 12px; color: var(--muted-foreground); margin-top: 12px; }
.pl-empty { font-size: 13px; padding: 10px 0; }
.pl-trend-table { margin-top: 16px; }
.pl-st { display: inline-flex; align-items: center; gap: 8px; }
#tab-pipeline th.l, #tab-pipeline td.l { text-align: left; }
#tab-pipeline td.wc { white-space: normal; min-width: 220px; text-align: left; }
#tab-pipeline th.wrapc, #tab-pipeline td.wrapc { white-space: normal; min-width: 180px; text-align: left; }
#tab-pipeline td .badge { margin-left: 6px; }
/* AI lender sorting: the labels keep their one line and the long Mode value wraps on the right instead */
#plAi { grid-template-columns: max-content minmax(0, 1fr); }

/* ===== Scoring tab: recipes on the existing tokens only; no sage on this tab (ink fills, hue only through .notice and .badge) ===== */
.meter-fill.ink { background: var(--chart-1); }
.meter-fill.ink.open { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--chart-1); }
.sc-ruler { display: grid; gap: 12px; min-width: 0; }
.sc-ruler .meter-scale, .sc-ruler .hint { margin-top: 0; }
.sc-rrow { display: grid; gap: 6px; min-width: 0; }
.sc-rrow .bn-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-verdict { font-size: 14px; color: var(--card-foreground); margin-top: 10px; }
.sc-mature { margin-top: 16px; }
.sc-mature:empty, .sc-open:empty, .sc-cap:empty, #tab-scoring .pl-note:empty, #scTrendNote:empty { display: none; }
.sc-open { font-size: 13px; margin-top: 12px; }
.sc-cap { font-size: 13px; margin: -8px 0 14px; }
.sc-multiples { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 36px; }
@media (min-width: 900px) { .sc-multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sc-multiples > div { min-width: 0; }
.chart .switch { stroke: var(--muted-foreground); stroke-width: 1px; }
@media (max-width: 639px) {
  .tabs[data-n="6"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 0; padding: 3px; }
  .tabs[data-n="6"] a { text-align: center; padding: 8px 4px; }
}
#tab-scoring tr.sc-a td { border-bottom: 0; }
#tab-scoring tr.sc-a td[rowspan] { border-bottom: 1px solid var(--border); }
#tab-scoring td.when { white-space: normal; min-width: 150px; text-align: left; }
#tab-scoring td.when .badge { display: block; width: fit-content; margin-top: 4px; }
#tab-scoring th.wrap { white-space: normal; max-width: 96px; }
#tab-scoring th.l, #tab-scoring td.l { text-align: left; }
#tab-scoring td.wc { white-space: normal; min-width: 220px; text-align: left; }
#tab-scoring td .badge { margin-left: 6px; }
#tab-scoring td.when .badge { margin-left: 0; }

/* ===== Weekly tab: recipes on the existing tokens only; no sage on this tab. It borrows the Funnel recipes (fn-steps, fn-appt,
   fn-track, fn-bar, fn-dash, fn-defs) and adds only layout, the sticky row heads and the selected trend row. ===== */
.wk-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-bottom: 18px; }
.wk-grid > section { margin: 0; min-width: 0; }
@media (min-width: 1200px) { .wk-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
@media (min-width: 740px) {
  #tab-weekly .wk-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #tab-weekly .wk-band { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #tab-weekly .fn-appt-cells .fn-sv { font-size: 24px; }
}
/* below 740px the strip and the band are label-left / value-right rows: the Funnel's row layout, scoped here and ending at
   739.98px, so no fractional width (739.5) falls between it and the 740px layout above (the Funnel's own ends at 739px) */
@media (max-width: 739.98px) {
  #tab-weekly .wk-strip, #tab-weekly .wk-band { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  #tab-weekly .fn-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "c v"; align-items: center; gap: 4px 12px; padding: 8px 0; }
  #tab-weekly .fn-step + .fn-step { border-left: 0; border-top: 1px solid var(--border); }
  #tab-weekly .fn-sl { grid-area: l; }
  #tab-weekly .fn-sv { grid-area: v; font-size: 18px; text-align: right; }
  #tab-weekly .fn-sc { grid-area: c; display: flex; align-items: center; gap: 8px; margin: 0; }
  #tab-weekly .fn-sc .fn-track { width: 40px; }
}
#tab-weekly .fn-sp { white-space: normal; }
#wkApptCap:empty { display: none; }
#tab-weekly .fn-track i { transform-origin: left center; }
#tab-weekly table { font-size: 14px; }
#tab-weekly td { padding: 0 8px; }
#tab-weekly thead th { white-space: nowrap; vertical-align: bottom; line-height: 16px; padding: 8px; }
#tab-weekly tbody th, #tab-weekly tbody td { height: 44px; }
#tab-weekly .wk-rowh { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: inset -1px 0 0 var(--border); text-align: left; color: var(--card-foreground); font-weight: 500; font-size: 14px; padding: 0 8px; }
#wkTrend .wk-rowh { min-width: 112px; white-space: nowrap; }
#wkSetTable .wk-rowh { min-width: 88px; max-width: 160px; white-space: normal; }
#tab-weekly thead .wk-rowh { color: var(--muted-foreground); font-size: 13px; z-index: 2; padding: 8px; }
#tab-weekly .wk-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#tab-weekly .wk-bar > span { min-width: 40px; text-align: right; }
#wkSetTable .fn-track { flex: 1 1 auto; width: auto; min-width: 32px; max-width: 120px; }
#wkSetTable tr.off .fn-track i { background: var(--muted-foreground); }
#wkSetTable tr.off .wk-rowh { color: var(--muted-foreground); }
#tab-weekly .wk-former { font-weight: 400; }
#wkTrend th.wk-key, #wkTrend td.wk-key { color: var(--card-foreground); font-weight: 600; }
#wkTrend tr.wk-sel td, #wkTrend tr.wk-sel .wk-rowh { background: var(--muted); }
#wkTrend tr.wk-sel .fn-track, #wkTrend tr.wk-sel .badge { background: var(--card); }
@media (hover: hover) { #tab-weekly tbody tr:hover .wk-rowh { background: var(--row-hover-solid); } #wkTrend tbody tr.wk-sel:hover .wk-rowh { background: var(--muted); } }
#wkTrend .badge { margin-left: 6px; }
.wk-foot { margin: 12px 0 0; font-size: 12px; color: var(--muted-foreground); }
.wk-foot:empty { display: none; }
.wk-none { margin: 0; font-size: 13px; color: var(--muted-foreground); }
/* "Back to last week" keeps its place while off, so the stepper beside it never moves; on phones it has a row of its own */
#wkBack[data-off] { visibility: hidden; }
@media (max-width: 559.98px) { #wkBack[data-off] { display: none; } }

/* ===== Funnel tab: recipes on the existing tokens only; no sage on this tab ===== */
/* head: the Pipeline head (title and caption left, controls right from 1000px); the custom range opens under it */
#fnLoad:empty { display: none; }
#fnLoad:not(:empty) { animation: m-fade 0s linear var(--delay-skeleton) backwards; } /* shown after the skeleton delay, instantly: no fade */
.fn-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 16px; }
.fn-custom .fld { margin-top: 0; width: 168px; }
.fn-custom .ferr { flex: 1 1 100%; margin-top: 0; }
#fnCustomErr { animation: none; } /* the error line appears at once: no shared .ferr drop-in */
@media (hover: hover) { .fn-custom .field-in:hover { border-color: var(--foreground); } }
@media (max-width: 639px) { .fn-custom .field-in { font-size: 16px; } }
#fnHeroBody, #fnTableBody { transition: opacity var(--dur-fast) var(--ease-out); }
#fnHeroBody.is-holding, #fnTableBody.is-holding { opacity: .5; transition: opacity var(--dur-fast) var(--ease-out) var(--delay-dim); }
.fn-hero-sub { font-size: 13px; color: var(--muted-foreground); margin-top: 8px; }
.fn-hero-sub:empty { display: none; }
/* the step strip: Team total's five steps in ruled cells under the hero; each bar is 0 to 100% of the previous step */
.fn-steps { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fn-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0 12px; }
.fn-step:first-child { padding-left: 0; }
.fn-step:last-child { padding-right: 0; }
.fn-step + .fn-step { border-left: 1px solid var(--border); }
.fn-sl { font-size: 13px; font-weight: 500; color: var(--muted-foreground); white-space: nowrap; }
.fn-sv { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--card-foreground); }
.fn-sc { display: grid; gap: 6px; margin-top: 4px; }
.fn-sc .fn-track { width: 100%; max-width: 120px; }
.fn-sp { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.fn-vm { font-size: 12px; color: var(--muted-foreground); }
#fnHeroBody .fn-vm { margin-top: 12px; }
@media (max-width: 739px) {
  .fn-steps { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .fn-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "c v"; align-items: center; gap: 4px 12px; padding: 8px 0; }
  .fn-step + .fn-step { border-left: 0; border-top: 1px solid var(--border); }
  .fn-sl { grid-area: l; }
  .fn-sv { grid-area: v; font-size: 18px; text-align: right; }
  .fn-sc { grid-area: c; display: flex; align-items: center; gap: 8px; margin: 0; }
  .fn-sc .fn-track { width: 40px; }
}
/* the Appointments band: a ruled band under the strip (no card), its five cells on the strip's tracks */
.fn-appt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.fn-appt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.fn-appt-head .muted { font-size: 13px; }
#fnApptCap:empty { display: none; }
.fn-appt-cells { margin: 0; padding: 0; border-top: 0; }
.fn-appt-cells .fn-sv { font-size: 18px; }
.fn-appt-none { font-size: 13px; color: var(--muted-foreground); }
.hero-fig.fn-fig-na { color: var(--muted-foreground); }
.fn-empty { display: grid; gap: 12px; justify-items: start; }
.fn-empty h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--card-foreground); }
.fn-notrec { margin-bottom: 12px; }
.fn-notrec:empty { display: none; }
.fn-notrec .notice > span { max-width: 75ch; }
.fn-notrec { text-wrap: pretty; }
.fn-empty .fn-notrec { margin-bottom: 0; }
/* the Funnel's seg buttons (presets, Group by) switch instantly: no colour or background transition */
#tab-funnel .seg button { transition: none; }
/* table: one-line, bottom-aligned headers; nowrap 44px body rows; a sticky row-header column with its 1px rule.
   The More columns (fn-x) and the No set on record row stay in the DOM and show only while More columns is on */
#fnTable thead th { white-space: nowrap; vertical-align: bottom; line-height: 16px; padding: 8px; }
#fnTable td { padding: 0 8px; }
#fnTable:not(.fn-more) .fn-x, #fnTable:not(.fn-more) tr.fn-noset { display: none; }
#fnTable th.fn-key, #fnTable td.fn-key { color: var(--card-foreground); font-weight: 600; }
#fnTable tr.fn-noset td.fn-key { color: var(--muted-foreground); }
.fn-bar { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.fn-track { display: block; position: relative; flex: none; width: 40px; height: 6px; background: var(--muted); border-radius: 100px; overflow: hidden; }
.fn-track i { position: absolute; inset: 0 auto 0 0; min-width: 2px; background: var(--chart-1); border-radius: 100px; }
#fnTable tr.off .fn-track i { background: var(--muted-foreground); }
.fn-dash { font-weight: 400; color: var(--muted-foreground); }
#fnTable .fn-rowh { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: inset -1px 0 0 var(--border); color: var(--card-foreground);
  font-size: 13.5px; font-weight: 400; height: 44px; padding: 0 8px; text-align: left; min-width: 132px; max-width: 200px; white-space: normal; overflow-wrap: anywhere; }
#fnTable thead .fn-rowh { z-index: 2; color: var(--muted-foreground); font-size: 13px; font-weight: 500; height: auto; padding: 8px; }
#fnTable .fn-rowh b.nm { font-weight: 600; }
#fnTable tr.off .fn-rowh { color: var(--muted-foreground); }
#fnTable .fn-former { font-weight: 400; }
#fnTable tr.subtotal .fn-rowh { background: var(--muted); font-weight: 600; }
#fnTable tbody tr:last-child .fn-rowh { border-bottom: 0; }
@media (hover: hover) {
  #fnTable tbody tr:hover .fn-rowh { background: var(--row-hover-solid); }
  #fnTable tbody tr.subtotal:hover .fn-rowh { background: var(--muted); }
}
/* the table foot (the voicemail note, then More columns) and the closed "What these mean" disclosure */
.fn-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-top: 12px; font-size: 13px; }
.fn-foot .fn-vm { font-size: 12px; color: var(--muted-foreground); }
.fn-mean .fn-defs { margin-top: 12px; }
/* definitions: terms beside their definitions; one column below 560px */
.fn-defs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; max-width: 75ch; }
.fn-defs:empty { display: none; }
.fn-defs > div { display: contents; }
.fn-defs dt { color: var(--card-foreground); font-weight: 500; }
.fn-defs dd { margin: 0; color: var(--muted-foreground); text-wrap: pretty; }
/* phone: presets as a 6-column grid (three, then two), the group seg fills its row, the custom fields share a row */
@media (max-width: 559px) {
  .pl-ctl .seg.fn-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; flex: 1 1 100%; }
  .fn-presets button:nth-child(-n+3) { grid-column: span 2; }
  .fn-presets button:nth-child(n+4) { grid-column: span 3; }
  .pl-ctl .fn-presets button { padding: 7px 6px; }
  #fnLoad { flex: 1 1 100%; }
  .fn-custom .fld { flex: 1 1 0; min-width: 0; width: auto; }
  .fn-custom .btn-secondary { flex: 1 1 100%; }
  #fnGroupLabel { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  #fnTableSec .ctl { width: 100%; }
  #fnTableSec .ctl .seg { display: flex; width: 100%; }
  #fnTableSec .ctl .seg button { flex: 1 1 auto; padding: 7px 6px; }
  .fn-defs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fn-defs dd { margin-bottom: 8px; }
}

/* ===== Knowledge Base tab (v3.2): the jc-ui-kit look through its integration variant. Every colour below reads a --kit-*
   token, and the --kit-* tokens point at the scoreboard's own tokens (Geist stays; no sage on this tab). One 12-column,
   16px-gutter grid from 1000px. Four sizes: 24/32 (h2s, article title), 18/24 (section heads, figures, Find on Home and below
   1000px; say-line 18/28), 14/20 (body, rows, controls), 12/16 (pills, meta, counts). Radii: cards 10, controls and inner
   blocks 8, rows 6, kbd and skeleton 4, pills 999. ===== */
/* seven main tabs (e.g. a manager without the Funnel and Weekly tabs) below 740px: two rows, the ::before forcing the break
   (the second holds whichever of Pipeline, Scoring, Knowledge Base and Settings show). 739.98px: no fractional gap before the 740px layouts */
@media (max-width: 739.98px) {
  .tabs[data-n="7"] { flex-wrap: wrap; width: 100%; }
  .tabs[data-n="7"]::before { content: ""; flex: 0 0 100%; order: 1; height: 0; }
  .tabs[data-n="7"] a { flex: 1 1 auto; text-align: center; }
  .tabs[data-n="7"] a[data-tab="pipeline"], .tabs[data-n="7"] a[data-tab="scoring"], .tabs[data-n="7"] a[data-tab="knowledge"], .tabs[data-n="7"] a[data-tab="settings"] { order: 2; }
}
@media (max-width: 420px) { .tabs[data-n="7"] a { padding: 8px 4px; } }
/* eight main tabs (e.g. a manager with the Funnel or the Weekly tab, not both) below 900px: rows of 4 and 4, the ::before
   forcing the break. 899.98px: no fractional width between this and the 900px layouts is left uncovered */
@media (max-width: 899.98px) {
  .tabs[data-n="8"] { flex-wrap: wrap; width: 100%; }
  .tabs[data-n="8"]::before { content: ""; flex: 0 0 100%; order: 1; height: 0; }
  .tabs[data-n="8"] a { flex: 1 1 auto; text-align: center; }
  .tabs[data-n="8"] a[data-tab="pipeline"], .tabs[data-n="8"] a[data-tab="scoring"], .tabs[data-n="8"] a[data-tab="knowledge"], .tabs[data-n="8"] a[data-tab="settings"] { order: 2; }
}
/* eight and nine tabs below 560px: tighter padding, so each row stays whole; the 420px rules after it win below 421px
   (a max-width-only cascade: no fractional width falls between the two) */
@media (max-width: 559.98px) { .tabs[data-n="8"] a, .tabs[data-n="9"] a { padding: 8px 6px; } }
@media (max-width: 420px) { .tabs[data-n="8"] a { padding: 8px 4px; } }
/* nine main tabs (a manager with the Funnel and Weekly tabs) below 900px: rows of 5 and 4, the ::before forcing the break */
@media (max-width: 899.98px) {
  .tabs[data-n="9"] { flex-wrap: wrap; width: 100%; }
  .tabs[data-n="9"]::before { content: ""; flex: 0 0 100%; order: 1; height: 0; }
  .tabs[data-n="9"] a { flex: 1 1 auto; text-align: center; }
  .tabs[data-n="9"] a[data-tab="pipeline"], .tabs[data-n="9"] a[data-tab="scoring"], .tabs[data-n="9"] a[data-tab="knowledge"], .tabs[data-n="9"] a[data-tab="settings"] { order: 2; }
}
@media (max-width: 420px) {
  .tabs[data-n="9"] a { padding: 8px 4px; }
  .tabs[data-n="7"] .tab-x, .tabs[data-n="8"] .tab-x, .tabs[data-n="9"] .tab-x { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
/* v4: an agent on the trainee list has four main tabs; below 520px they sit two by two so every tab stays whole */
@media (max-width: 519px) {
  .tabs[data-n="4"] { flex-wrap: wrap; width: 100%; }
  .tabs[data-n="4"] a { flex: 1 1 40%; text-align: center; }
}

#tab-knowledge {
  --kb-top: 0px; --kb-off: 12px;
  --kit-paper: var(--background); --kit-surface: var(--card); --kit-surface-pop: var(--card);
  --kit-paper-2: var(--muted); --kit-row-selected: var(--muted);
  --kit-paper-3: color-mix(in srgb, var(--foreground) 6%, var(--muted));
  --kit-row-hover: var(--row-hover); --kit-rule: var(--border); --kit-rule-strong: var(--input);
  --kit-ink: var(--foreground); --kit-ink-2: var(--foreground); --kit-ink-3: var(--muted-foreground); --kit-ink-4: var(--muted-foreground);
  --kit-on-ink: var(--background); --kit-ink-hover: color-mix(in srgb, var(--foreground) 86%, var(--background));
  --kit-focus: var(--foreground);
  --kit-maybe-glyph: var(--warn); --kit-maybe-label: var(--warn); --kit-maybe-tint: var(--warn-bg);
  --kit-good: var(--good); --kit-crit: var(--crit);
  --kit-tab-highlight: var(--kit-surface);
  --kit-shadow-node: 0 1px 2px rgb(0 0 0 / .06), 0 1px 1px rgb(0 0 0 / .04);
  --kit-shadow-pop: 0 2px 4px rgb(0 0 0 / .04), 0 8px 24px -4px rgb(0 0 0 / .12);
  --kit-shadow-drawer: -12px 0 32px -8px rgb(0 0 0 / .12);
  --kit-shadow-toast: 0 1px 3px rgb(0 0 0 / .06), 0 6px 16px -2px rgb(0 0 0 / .10);
  --kit-font-ui: var(--font-sans);
  --kit-h-control: 32px; --kit-h-button: 36px; --kit-h-item: 32px; --kit-h-pill: 22px;
  --kit-r-xs: 4px; --kit-r-sm: 6px; --kit-r-md: 8px; --kit-r-lg: 10px; --kit-r-xl: 14px; --kit-r-pill: 999px;
  --kit-dur-hover: 120ms;
  --kit-success-glyph: var(--good); --kit-failed-glyph: var(--crit); --kit-failed-label: var(--crit); --kit-failed-tint: var(--crit-bg);
  --kit-ease-out: cubic-bezier(0.23, 1, 0.32, 1); --kit-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --kit-dur-tab: 250ms; --kit-dur-press: 160ms; --kit-dur-expand-in: 200ms; --kit-dur-expand-out: 150ms;
  --kb-gap: 16px; --kb-gap-sec: 32px; --kb-pad: 24px; --kb-measure: 68ch; --kb-col: 488px; --kb-rail: 200px; --kb-wide: 912px; --kb-shell: minmax(var(--kb-rail), 1fr) minmax(0, var(--kb-col)) minmax(var(--kb-rail), 1fr); --kb-cr: minmax(0, var(--kb-col)) minmax(var(--kb-rail), 1fr);
  --aui-ink: var(--kit-ink); --aui-muted: var(--kit-ink-3); --aui-surface: var(--kit-surface); --aui-subtle: var(--kit-paper-2);
  --aui-border: var(--kit-rule); --aui-border-strong: var(--kit-rule-strong); --aui-focus: var(--kit-focus); --aui-radius: var(--kit-r-lg); --aui-radius-sm: var(--kit-r-sm);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #tab-knowledge { --kit-tab-highlight: var(--kit-paper-3); --kit-shadow-node: none; --kit-shadow-drawer: none; --kit-shadow-pop: 0 8px 24px rgb(0 0 0 / .5); --kit-shadow-toast: 0 6px 16px rgb(0 0 0 / .5); }
}
:root[data-theme="dark"] #tab-knowledge { --kit-tab-highlight: var(--kit-paper-3); --kit-shadow-node: none; --kit-shadow-drawer: none; --kit-shadow-pop: 0 8px 24px rgb(0 0 0 / .5); --kit-shadow-toast: 0 6px 16px rgb(0 0 0 / .5); }
@media (pointer: coarse) { #tab-knowledge { --kit-h-control: 44px; --kit-h-button: 44px; --kit-h-item: 44px; } }
@media (max-width: 639px) { #tab-knowledge { --kb-pad: 16px; } }

#tab-knowledge mark { background: var(--kit-paper-2); color: var(--kit-ink); border-radius: 2px; }
#tab-knowledge ::selection { background: var(--kit-paper-3); color: var(--kit-ink); }
#tab-knowledge :focus-visible { outline: 2px solid var(--kit-focus); outline-offset: 2px; }
#tab-knowledge .state-panel { display: grid; gap: 8px; padding: var(--kb-pad); border-radius: var(--kit-r-lg); background: var(--kit-surface); border-color: var(--kit-rule); box-shadow: var(--kit-shadow-node); }
#tab-knowledge .state-panel h2 { font-size: 18px; font-weight: 600; line-height: 24px; letter-spacing: -0.01em; color: var(--kit-ink); }
#tab-knowledge .state-panel p { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); max-width: 62ch; }
.kb-ws { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--kb-gap); min-width: 0; }
.kb-ws, #tab-knowledge .kb-kbd { font-family: var(--kit-font-ui); }
.kb-panel { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--kb-gap); min-width: 0; }
.kb-ws > [hidden], .kb-panel > [hidden] { display: none; }
.kb-panel:focus-visible { outline-offset: 4px; }
#kbBar.kb-hb ~ #kbView, #kbBar.kb-hb ~ #kbFound, #kbBar.kb-hb ~ #kbSk { margin-top: var(--kb-gap); }
#kbBar:not(.kb-hb) ~ #kbView, #kbBar:not(.kb-hb) ~ #kbFound { margin-top: 0; }

/* the kit's controls, scoped to this tab (the drawer and the toast sit inside it) */
#tab-knowledge .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--kit-h-button); padding: 0 14px; border: 0; border-radius: var(--kit-r-md); background: var(--kit-ink); color: var(--kit-on-ink);
  font-size: 14px; font-weight: 500; line-height: 20px; box-shadow: none; transition: background-color var(--kit-dur-hover) var(--ease-out), transform var(--dur-press) var(--ease-out); }
@media (hover: hover) { #tab-knowledge .btn:hover { background: var(--kit-ink-hover); } }
#tab-knowledge .btn:active { transform: scale(var(--press)); }
#tab-knowledge .btn[aria-disabled="true"], #tab-knowledge .btn:disabled { background: var(--kit-paper-3); color: var(--kit-ink-4); cursor: default; transform: none; }
#tab-knowledge .btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--kit-h-control); padding: 0 12px; border: 1px solid var(--kit-rule-strong); border-radius: var(--kit-r-md); background: transparent; color: var(--kit-ink);
  font-size: 14px; font-weight: 500; line-height: 20px; box-shadow: none; transition: background-color var(--kit-dur-hover) var(--ease-out), transform var(--dur-press) var(--ease-out); }
@media (hover: hover) { #tab-knowledge .btn-outline:hover { background: var(--kit-paper-2); } }
#tab-knowledge .btn-outline:active { background: var(--kit-paper-3); transform: scale(var(--press)); }
#tab-knowledge .btn-outline[aria-disabled="true"] { color: var(--kit-ink-4); background: transparent; cursor: default; transform: none; }
#tab-knowledge .btn-link { border: 0; background: none; padding: 0; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); text-decoration: underline; text-decoration-color: var(--kit-rule-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) { #tab-knowledge .btn-link:hover { text-decoration-color: var(--kit-ink); } }
@media (max-width: 639px) { #tab-knowledge .btn-link { display: inline-flex; align-items: center; min-height: 40px; } }
@media (pointer: coarse) { #tab-knowledge .btn-link { display: inline-flex; align-items: center; min-height: 44px; } }
#tab-knowledge .btn-icon { display: inline-grid; place-items: center; width: var(--kit-h-control); height: var(--kit-h-control); border: 0; border-radius: var(--kit-r-md); background: transparent; color: var(--kit-ink-3); transition: background-color var(--kit-dur-hover) var(--ease-out); }
@media (hover: hover) { #tab-knowledge .btn-icon:hover { background: var(--kit-paper-2); color: var(--kit-ink); } }
/* StatusPill: maybe (Check with Tyler, gap counts) and an outlined neutral (Suggested, type badges) */
#tab-knowledge .chip.warn { display: inline-flex; align-items: center; gap: 6px; height: var(--kit-h-pill); padding: 0 8px; border: 1px solid color-mix(in srgb, var(--kit-maybe-label) 30%, var(--kit-maybe-tint)); border-radius: var(--kit-r-pill);
  background: var(--kit-maybe-tint); color: var(--kit-maybe-label); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#tab-knowledge .chip.warn svg { color: var(--kit-maybe-glyph); }
#tab-knowledge .badge { display: inline-flex; align-items: center; gap: 6px; height: var(--kit-h-pill); padding: 0 8px; border: 1px solid var(--kit-rule-strong); border-radius: var(--kit-r-pill); background: transparent; color: var(--kit-ink-2); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; }
#tab-knowledge .badge svg { flex: none; color: var(--kit-ink-3); }
#tab-knowledge .panel { background: var(--kit-surface); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); box-shadow: var(--kit-shadow-node); padding: 20px; }
#tab-knowledge .meter-track { height: 6px; background: var(--kit-paper-2); border-radius: var(--kit-r-pill); }
#tab-knowledge .meter-fill.ink { background: var(--kit-ink); border-radius: var(--kit-r-pill); }
#tab-knowledge .meter-fill { transition: width var(--dur-fast) var(--ease-out); }
#tab-knowledge .kb-instant .meter-fill { transition: none; }
#tab-knowledge .notice, #tab-knowledge .notice.warn { font-size: 14px; line-height: 20px; border-radius: var(--kit-r-md); }
#tab-knowledge .notice.warn { background: var(--kit-maybe-tint); color: var(--kit-maybe-label); }
#tab-knowledge .sk { border-radius: var(--kit-r-xs); background: var(--kit-paper-3); }

/* shared type */
#tab-knowledge h2, #tab-knowledge h3, #tab-knowledge h4 { margin: 0; color: var(--kit-ink); overflow-wrap: anywhere; }
#kbHeroH, .kb-vh h2, .kb-at, #kbDrTitle { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 32px; }
.kb-h18 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 24px; }
.kb-cap { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); max-width: var(--kb-measure); }
.kb-vh .kb-cap, .kb-sech .kb-cap { display: none; }
.kb-note { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); overflow-wrap: anywhere; }
.kb-note.kb-ink, .kb-body { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-empty { display: grid; gap: 8px; justify-items: start; padding: var(--kb-pad); }
.kb-empty h3 { font-size: 14px; font-weight: 500; line-height: 20px; }
.kb-empty p { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); max-width: 62ch; }
.kb-empty .btn-outline { margin-top: 8px; }
.kb-none .kb-empty, .kb-narrow .kb-empty, .kb-queue .kb-empty, .kb-pane > .kb-empty { padding: var(--kb-pad); }
.kb-none .kb-empty { padding: 16px 12px; }
.kb-sech { display: grid; gap: 4px; }
.kb-tile { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; background: none; color: var(--kit-ink-3); }
.kb-vh > .kb-tile { display: none; }

/* the search hero (Home only) */
.kb-hero { display: grid; gap: 4px; justify-items: center; text-align: center; }
.kb-heroline { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-hsk1, .kb-hsk2 { display: none; }
.kb-hero[data-busy] > h2, .kb-hero[data-busy] > p { display: none; }
.kb-hero[data-busy] .kb-hsk1 { display: block; height: 32px; width: min(260px, 70%); }
.kb-hero[data-busy] .kb-hsk2 { display: block; height: 20px; width: min(380px, 90%); }

/* the bar: crumbs and Find, sticky under the header on the page ground (below 640px only Find sticks) */
.kb-bar { position: sticky; top: var(--kb-top); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 8px; margin-block: -8px; background: var(--kit-paper); }
.kb-crumbs { min-width: 0; }
.kb-crumbs[hidden] { display: none; }
.kb-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; }
.kb-crumbs li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
#tab-knowledge .kb-crumbs .btn-link { color: var(--kit-ink-3); text-decoration-color: transparent; min-height: var(--kit-h-item); }
@media (hover: hover) { #tab-knowledge .kb-crumbs .btn-link:hover { color: var(--kit-ink); text-decoration-color: var(--kit-rule-strong); } }
.kb-crumbs [aria-current="page"] { font-weight: 500; color: var(--kit-ink); }
.kb-sep { color: var(--kit-ink-3); }
.kb-find { position: relative; flex: 0 1 420px; min-width: 0; }
.kb-field { position: relative; }
.kb-mag { position: absolute; inset-block: 0; left: 12px; display: grid; place-items: center; color: var(--kit-ink-3); pointer-events: none; }
#kbFind { height: 44px; padding-left: 38px; border: 1px solid var(--kit-ink-3); border-radius: var(--kit-r-md); background: var(--kit-surface); color: var(--kit-ink); font-size: 18px; line-height: 24px; caret-color: var(--kit-ink); box-shadow: none; }
#kbFind::placeholder { color: var(--kit-ink-3); opacity: 1; }
#kbFind::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
#kbFind:not(:placeholder-shown) { padding-right: 44px; }
@media (hover: hover) { #kbFind:hover:not(:disabled) { border-color: var(--kit-ink); } }
.kb-clear { display: none; position: absolute; top: 50%; right: 6px; transform: translateY(-50%); }
#kbFind:not(:placeholder-shown) ~ .kb-clear { display: inline-grid; }
.kb-slash { display: none; position: absolute; top: 50%; right: 10px; transform: translateY(-50%); }
/* the kit's .btn-icon and .badge looks set display; the clear x shows only with text, the "/" hint only while empty (from 1000px, fine pointers) */
#tab-knowledge .kb-clear, #tab-knowledge .kb-slash { display: none; }
#tab-knowledge #kbFind:not(:placeholder-shown) ~ .kb-clear { display: inline-grid; }
@media (min-width: 1000px) and (hover: hover) { #tab-knowledge #kbFind:placeholder-shown ~ .kb-slash { display: inline-flex; } }
.kb-fsk { display: none; height: 44px; }
.kb-bar[data-busy] .kb-field { display: none; }
.kb-bar[data-busy] .kb-fsk { display: block; }
.kb-bar.kb-hb { justify-content: flex-start; }
.kb-bar.kb-hb .kb-find { flex: 1 1 auto; }
.kb-bar.kb-hb #kbFind, .kb-bar.kb-hb .kb-fsk { height: 48px; }
@media (max-width: 639px) {
  .kb-bar { display: contents; }
  .kb-find { position: sticky; top: var(--kb-top); z-index: 4; flex: none; padding-block: 8px; margin-block: -8px; background: var(--kit-paper); }
}
@media (min-width: 1000px) and (hover: hover) { .kb-slash { display: inline-flex; align-items: center; } #kbFind:not(:placeholder-shown) ~ .kb-slash { display: none; } }

/* the views */
.kb-view, .kb-found { display: grid; gap: var(--kb-gap); align-content: start; min-width: 0; }
#kbView[data-view="home"] { row-gap: var(--kb-gap-sec); }
.kb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.kb-card { background: var(--kit-surface); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); box-shadow: var(--kit-shadow-node); padding: var(--kb-pad); min-width: 0; }
.kb-pane { display: none; }

/* the nav list (NavItem rows; the selected row takes the Tabs highlight) */
.kb-nav { display: grid; align-content: start; gap: 2px; min-width: 0; }
.kb-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 12px 4px; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.kb-count { padding: 0 12px 4px; font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-list { display: grid; gap: 2px; border-radius: var(--kit-r-md); }
.kb-grp { display: grid; gap: 2px; }
.kb-gh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; padding: 16px 12px 4px; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
.kb-grp:first-child > .kb-gh { padding-top: 4px; }
.kb-ghn { flex: none; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-none { padding: 0; }
.kb-opt, .kb-nrow, .kb-sh { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; align-items: start; width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid transparent; border-radius: var(--kit-r-sm);
  background: none; text-align: left; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--kit-ink); cursor: pointer; transition: background-color var(--kit-dur-hover) var(--ease-out); }
.kb-opt[aria-selected="true"], .kb-nrow[aria-current], .kb-st.cur > .kb-sh { background: var(--kit-tab-highlight); border-color: var(--kit-rule); box-shadow: var(--kit-shadow-node); font-weight: 500; }
@media (hover: hover) { .kb-opt:hover, .kb-nrow:hover, .kb-sh:hover { background: var(--kit-row-hover); } .kb-opt[aria-selected="true"]:hover, .kb-nrow[aria-current]:hover, .kb-st.cur > .kb-sh:hover { background: var(--kit-tab-highlight); } }
#tab-knowledge:has(#kbFind:focus, #kbList:focus, #kbHits:focus) .kb-list[data-kbd] .kb-opt[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--kit-focus); }
.kb-og { display: inline-flex; align-items: center; height: 20px; }
.kb-ol { min-width: 0; overflow-wrap: anywhere; align-self: center; }
.kb-gw { display: inline-flex; color: var(--kit-maybe-glyph); }
.kb-gr { display: inline-flex; color: var(--kit-ink-3); }
@media (min-width: 1000px) { .kb-opt, .kb-nrow, .kb-sh { min-height: 44px; } }

/* the Article: one column of 34rem centred in its card; every block shares the column's two edges */
.kb-art { display: grid; gap: var(--kb-gap); max-width: var(--kb-measure); margin-inline: 0; min-width: 0; }
.kb-art > * { width: 100%; min-width: 0; margin: 0; }
.kb-ah { display: grid; gap: 12px; padding-bottom: var(--kb-gap); border-bottom: 1px solid var(--kit-rule); }
.kb-at { display: block; }
h3.kb-at { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 24px; }
.kb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-cat { display: inline-flex; align-items: center; gap: 6px; }
.kb-cat .ic { flex: none; }
.kb-cpa { margin-left: auto; }
.kb-asked, .kb-pos { font-variant-numeric: tabular-nums; }
.kb-sayb { padding: 16px 20px; border-radius: var(--kit-r-md); background: var(--kit-paper-2); }
.kb-say { font-size: 18px; font-weight: 400; line-height: 28px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-do { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-dol { font-weight: 500; }
.notice.kb-co { gap: 10px; padding: 12px 16px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); background: var(--kit-surface); color: var(--kit-ink-3); }
.notice.kb-co svg, .notice.kb-gapc svg { flex: none; margin-top: 2px; }
.notice.kb-gapc { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--kit-r-md); }
.kb-gch { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.kb-gct { padding-left: 24px; }
.kb-pbk { display: grid; gap: 8px; }
.kb-pbl { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
.kb-pbx { margin: 0; padding: 0; list-style: none; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); }
.kb-pbx li { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; padding: 12px 16px; font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-pbx li + li { border-top: 1px solid var(--kit-rule); }
.kb-pbx svg { margin-top: 2px; color: var(--kit-ink-3); }
.kb-rel { display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--kit-rule); }
.kb-relh { font-size: 14px; font-weight: 500; line-height: 20px; }
.kb-rel ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kb-relr { display: grid; grid-template-columns: minmax(0, 1fr) 16px; align-items: center; column-gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--kit-r-sm); background: none; text-align: left; color: var(--kit-ink); cursor: pointer; transition: background-color var(--kit-dur-hover) var(--ease-out); }
@media (hover: hover) { .kb-relr:hover { background: var(--kit-row-hover); } }
.kb-relr svg { color: var(--kit-ink-3); }
.kb-relt { display: grid; gap: 2px; min-width: 0; }
.kb-relq { font-size: 14px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.kb-relc { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-pos { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-stepnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kb-pane > .kb-empty, .kb-pane > div > .kb-empty { max-width: var(--kb-measure); margin-inline: 0; }

/* view headers: the tile, then the h2, the caption and the count */
.kb-vh { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; align-items: start; }
.kb-vht { display: grid; gap: 4px; min-width: 0; }
.kb-vm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }

/* Home: topic cards (kit node cards; one list panel below 640px), Most asked beside the Review status */
.kb-topics { display: grid; row-gap: 0; align-self: start; min-width: 0; background: var(--kit-surface); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); box-shadow: var(--kit-shadow-node); }
.kb-topics > h2 { padding: var(--kb-pad) var(--kb-pad) 8px; }
.kb-cards { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 4px; list-style: none; background: none; border: 0; border-radius: 0; box-shadow: none; }
.kb-cards > li { display: grid; min-width: 0; }
.kb-cards > li + li { border-top: 1px solid var(--kit-rule); }
.kb-tc { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px; width: 100%; min-height: 48px; padding: 8px calc(var(--kb-pad) - 4px); border: 1px solid transparent; border-radius: var(--kit-r-sm); background: none; text-align: left; color: var(--kit-ink); cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out), transform var(--kit-dur-press) var(--kit-ease-out); }
.kb-tch { display: contents; }
.kb-tct { min-width: 0; font-size: 14px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.kb-tcn { grid-column: 4; justify-self: end; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb-tcc { display: none; }
@media (hover: hover) { .kb-tc:hover { background: var(--kit-row-hover); } }
.kb-tc:active { background: var(--kit-paper-3); transform: scale(var(--press)); }
.kb-homeb { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--kb-gap); min-width: 0; }
.kb-most, .kb-rvs { display: flex; flex-direction: column; min-width: 0; background: var(--kit-surface); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); box-shadow: var(--kit-shadow-node); }
.kb-ph { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: var(--kb-pad) var(--kb-pad) 8px; }
.kb-mcol { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); white-space: nowrap; }
.kb-mal { margin: 0; padding: 0; list-style: none; }
.kb-mal li { border-top: 1px solid var(--kit-rule); }
.kb-mal li:last-child .kb-mar { border-radius: 0 0 var(--kit-r-lg) var(--kit-r-lg); }
.kb-mar { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; column-gap: 16px; width: 100%; padding: 12px var(--kb-pad); border: 0; border-radius: 0; background: none; text-align: left; color: var(--kit-ink); cursor: pointer; transition: background-color var(--kit-dur-hover) var(--ease-out); }
@media (hover: hover) { .kb-mar:hover { background: var(--kit-row-hover); } }
.kb-mq { display: grid; gap: 2px; min-width: 0; }
.kb-mqt { font-size: 14px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.kb-mqc { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-mqn { justify-self: end; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }
.kb-rvb { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; padding: 0 var(--kb-pad) var(--kb-pad); }
.kb-rvb .kb-note { margin-top: 4px; }
.kb-rvl { margin-top: 16px; font-size: 14px; line-height: 20px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }
.kb-rvb .meter-track { align-self: stretch; margin-top: 8px; }
.kb-rvb > .meter-track, .kb-rvb > .kb-note:nth-last-child(2) { margin-bottom: var(--kb-gap); }
.kb-rvb > .btn { margin-top: auto; }
.kb-big { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 24px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }

/* The call: the stepper on the ground (markers on a wire), the step card beside it; the tone panel below */
.kb-steps { margin: 0; padding: 0; list-style: none; display: grid; }
.kb-st { position: relative; min-width: 0; }
.kb-st:not(:last-child)::after { content: ""; position: absolute; z-index: 1; left: 25px; top: 33px; bottom: -9px; border-left: 1px dashed var(--kit-ink-3); pointer-events: none; }
.kb-st.done::after { border-left-style: solid; }
.kb-sh { grid-template-columns: 24px minmax(0, 1fr); align-items: center; }
.kb-stt { min-width: 0; overflow-wrap: anywhere; }
.kb-mk { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: var(--kit-r-pill); border: 1px solid var(--kit-ink-3); background: var(--kit-paper); font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-mk.cur { border-color: var(--kit-ink); background: var(--kit-ink); color: var(--kit-on-ink); font-weight: 500; }
.kb-mk.done { background: var(--kit-surface); }
.kb-mk.ink { border-color: var(--kit-ink); background: var(--kit-ink); color: var(--kit-on-ink); font-weight: 500; }
.kb-sb { padding: 4px 12px 16px 46px; }
.kb-art.kb-inl { max-width: none; margin: 0; gap: 16px; }
.kb-qgrp { display: grid; gap: 2px; margin-top: 12px; }
.kb-qlist { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.kb-tone { display: grid; gap: 12px; }
.kb-tcols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 24px; }
@media (min-width: 560px) { .kb-tcols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kb-tcols h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; font-weight: 500; line-height: 20px; }
.kb-yes { color: var(--kit-good); }
.kb-no { color: var(--kit-crit); }

/* Hand-off: the deal flow (ink markers on a wire, a vertical flow at every width), then the groups */
.kb-sec { display: grid; gap: 16px; min-width: 0; }
.kb-flow { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.kb-fn { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; align-items: start; min-width: 0; }
.kb-fn:not(:last-child)::after { content: ""; position: absolute; left: 11.5px; top: 30px; bottom: -10px; border-left: 1px solid var(--kit-ink-3); }
.kb-fnt { display: grid; gap: 4px; min-width: 0; }
.kb-fnt h4 { font-size: 14px; font-weight: 500; line-height: 20px; padding-top: 2px; }
.kb-fnt .kb-note { color: var(--kit-ink-3); }
.kb-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--kb-gap); align-items: start; min-width: 0; }
#tab-knowledge .panel.kb-group { display: flex; flex-direction: column; padding: 0 0 8px; }
.kb-group > h3 { padding: var(--kb-pad) var(--kb-pad) 8px; scroll-margin-top: var(--kb-off); }
.kb-group > .kb-rows > li { padding-inline: var(--kb-pad); border-top: 1px solid var(--kit-rule); }
.kb-group > .kb-rows:first-child > li:first-child { border-top: 0; padding-top: 8px; }
.kb-vh + .kb-sec { margin-top: 0; }

/* guidance rows: the bold lead first, ruled by hairlines */
.kb-rows { display: grid; margin: 0; padding: 0; list-style: none; min-width: 0; }
.kb-rows > li + li { border-top: 1px solid var(--kit-rule); }
.kb-row { display: grid; gap: 4px; justify-items: stretch; padding-block: 12px; min-width: 0; }
.kb-row .kb-note.kb-ink { color: var(--kit-ink-3); }
.kb-rt { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-sayb.kb-rsay { padding: 12px 16px; }
.kb-rsay p { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }

/* Documents: the checklist card (first in the DOM) and the guidance on the ground */
.kb-guide { display: grid; gap: 24px; min-width: 0; }
.kb-gsec { display: grid; gap: 4px; }
.kb-check { display: grid; gap: 12px; align-content: start; }
.kb-ckh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.kb-ckn { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }
.kb-ticks { display: grid; margin: 0; padding: 0; list-style: none; }
.kb-ticks > li + li { border-top: 1px solid var(--kit-rule); }
.kb-tick { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; min-height: 56px; padding: 12px 8px; margin-inline: -8px; border-radius: var(--kit-r-sm); cursor: pointer; transition: background-color var(--kit-dur-hover) var(--ease-out); }
@media (hover: hover) { .kb-tick:hover { background: var(--kit-row-hover); } }
.kb-tick input { width: 20px; height: 20px; margin: 0; accent-color: var(--kit-ink); cursor: pointer; }
.kb-tl { display: grid; gap: 2px; min-width: 0; }
.kb-tdo { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); overflow-wrap: anywhere; }
.kb-gapi { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--kit-maybe-label); }
.kb-gapi svg { flex: none; margin-top: 3px; }
.kb-ckf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.kb-hint { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }

/* Templates: Emails and Texts; an email's subject row and clamped body, a text's ink bubble */
.kb-tgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
#tab-knowledge .panel.kb-tcard { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kb-tcard > .kb-tfoot { margin-top: auto; padding-top: 4px; }
.kb-tn { font-size: 14px; font-weight: 500; line-height: 20px; }
.kb-subjr { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--kit-rule); }
.kb-sl { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-sv { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-tpl { font-size: 14px; line-height: 20px; color: var(--kit-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.kb-tcard .kb-tpl, .kb-art .kb-tpl { padding: 12px 14px; border-radius: var(--kit-r-md); background: var(--kit-paper-2); color: var(--kit-ink); }
.kb-mf { display: inline-block; height: 20px; padding: 2px 6px; vertical-align: top; border-radius: var(--kit-r-pill); background: var(--kit-paper-3); color: var(--kit-ink); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; -webkit-user-select: all; user-select: all; }
#tab-knowledge .kb-tpl.kb-bubble { border-radius: 8px 8px 4px 8px; }
#tab-knowledge .kb-tpl mark { background: var(--kit-paper-3); }
#tab-knowledge .kb-mf mark { background: var(--kit-surface); }
.kb-tfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.kb-fallback { height: auto; width: 100%; padding: 8px 10px; border: 1px solid var(--kit-ink-3); border-radius: var(--kit-r-md); background: var(--kit-surface); color: var(--kit-ink); font-size: 14px; line-height: 20px; resize: vertical; }
@media (max-width: 999px) { .kb-fallback { font-size: 18px; line-height: 24px; } }

/* Review: the figures and filters on the ground (nav rows from 1000px, chips below), the queue on the card */
.kb-rvside { display: grid; gap: 16px; align-content: start; min-width: 0; }
.kb-figs { display: grid; gap: 16px; }
.kb-figc { display: grid; gap: 4px; padding-inline: 12px; }
.kb-fl { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-figc .meter-track { margin-top: 8px; }
.kb-qfs { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--kit-h-button); padding: 0 12px; border: 1px solid var(--kit-rule-strong); border-radius: var(--kit-r-md); background: transparent; color: var(--kit-ink); font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out), transform var(--dur-press) var(--ease-out); }
@media (hover: hover) { .kb-chip:hover { background: var(--kit-paper-2); } }
.kb-chip[aria-pressed="true"] { background: var(--kit-ink); border-color: var(--kit-ink); color: var(--kit-on-ink); }
.kb-chip:active { transform: scale(var(--press)); }
.kb-qn { font-size: 12px; font-weight: 500; line-height: 16px; font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) {
  .kb-qfs { display: grid; gap: 2px; }
  .kb-qf.kb-chip { display: flex; align-items: center; justify-content: space-between; height: auto; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: var(--kit-r-sm); background: none; color: var(--kit-ink); font-weight: 400; transform: none; }
  .kb-qf.kb-chip:active { transform: none; }
  .kb-qf.kb-chip[aria-pressed="true"] { background: var(--kit-tab-highlight); border-color: var(--kit-rule); box-shadow: var(--kit-shadow-node); color: var(--kit-ink); font-weight: 500; }
  @media (hover: hover) { .kb-qf.kb-chip:hover { background: var(--kit-row-hover); } .kb-qf.kb-chip[aria-pressed="true"]:hover { background: var(--kit-tab-highlight); } }
  .kb-qf .kb-qn { color: var(--kit-ink-3); }
}
.kb-queue { display: grid; gap: 4px; align-content: start; }
.kb-queue .kb-gh { padding-inline: 0; }
.kb-queue > div:first-child > .kb-gh { padding-top: 0; }
.kb-qrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-block: 12px; }
.kb-qtx { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.kb-qt, .kb-qq { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-qq { font-weight: 500; }
.kb-qtg { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); overflow-wrap: anywhere; }

/* the drawer: a native modal <dialog> holding the Article, a side panel from 640px and a sheet below; only a pointer slides it */
#kbDrawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--kit-rule); border-radius: 0; overflow: hidden; opacity: 1; transform: none;
  background: var(--kit-surface); color: var(--kit-ink); box-shadow: var(--kit-shadow-drawer);
  transition: transform var(--dur-enter) var(--ease-expo), overlay var(--dur-enter) allow-discrete, display var(--dur-enter) allow-discrete; }
#kbDrawer[open] { display: flex; flex-direction: column; }
#kbDrawer:not([open]) { transform: translateX(100%); transition-duration: var(--dur-exit); transition-timing-function: var(--ease-out); }
@starting-style { #kbDrawer[open] { transform: translateX(100%); } }
#kbDrawer::backdrop { transition: background-color var(--dur-enter) var(--ease-expo), overlay var(--dur-enter) allow-discrete, display var(--dur-enter) allow-discrete; }
#kbDrawer:not([open])::backdrop { transition-duration: var(--dur-exit); transition-timing-function: var(--ease-out); }
#kbDrawer.no-exit, #kbDrawer.no-exit::backdrop { transition: none; }
@media (max-width: 639px) {
  #kbDrawer { inset: auto 0 0 0; width: 100vw; height: auto; max-height: calc(100dvh - 48px); border-left: 0; border-top: 1px solid var(--kit-rule); border-radius: var(--kit-r-xl) var(--kit-r-xl) 0 0; }
  #kbDrawer:not([open]) { transform: translateY(100%); }
  @starting-style { #kbDrawer[open] { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) {
  #kbDrawer, #kbDrawer:not([open]) { transform: none; }
  #kbDrawer { transition: opacity 160ms var(--ease-out), overlay 160ms allow-discrete, display 160ms allow-discrete; }
  #kbDrawer:not([open]) { opacity: 0; transition-duration: 100ms; }
  @starting-style { #kbDrawer[open] { opacity: 0; transform: none; } }
  #kbDrawer::backdrop { transition-duration: 160ms; }
  #kbDrawer:not([open])::backdrop { transition-duration: 100ms; }
}
.kb-dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 12px 0 20px; }
#kbDrTitle { padding-top: 4px; min-width: 0; overflow-wrap: anywhere; }
.kb-dr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-inline: 20px; padding: 12px 0 16px; border-bottom: 1px solid var(--kit-rule); font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-dr-sub:empty, .kb-dr-foot:empty { display: none; }
.kb-dr-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
.kb-dr-body .kb-art { max-width: none; }
.kb-dr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--kit-rule); background: var(--kit-surface); }

/* the toast: one at a time, bottom right (bottom, inset 12px, below 640px) */
.kb-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: grid; width: min(380px, calc(100vw - 48px)); pointer-events: none; }
.kb-toasts:empty { display: none; }
.kb-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px 12px 16px; background: var(--kit-surface-pop); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); box-shadow: var(--kit-shadow-toast); pointer-events: auto; }
.kb-tg { display: inline-flex; padding-top: 2px; }
.kb-toast.good .kb-tg { color: var(--kit-good); }
.kb-toast.crit .kb-tg, .kb-toast.crit .kb-tt, .kb-toast.crit .kb-tb { color: var(--kit-crit); }
.kb-tx { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; padding-top: 2px; }
.kb-tt { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
.kb-tb { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); overflow-wrap: anywhere; }
.kb-toast .btn-icon { margin-top: -4px; }
@media (max-width: 639px) { .kb-toasts { left: 12px; right: 12px; bottom: 12px; width: auto; } }

/* the Close screenshots (T7): a set in stored order fills its column edge to edge, wrapping when a row is full; the legend
   under a numbered caption; a template's screenshot is the media at the top of its card and opens full size in the drawer */
.kb-fig { margin: 0; }
.kb-shots { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; min-width: 0; }
/* each shot's basis and growth follow its aspect ratio, so shots sharing a row share one height and fill the row; growth is
   scaled by 100 so a lone portrait shot (ratio under 1) still takes all the free space on its line */
.kb-shots > .kb-fig { flex: calc(var(--kb-ar) * 100) 1 calc(var(--kb-ar) * 560px); min-width: 0; }
.kb-shotrow { min-width: 0; }
.kb-art > .kb-shots, .kb-row > .kb-shots, .kb-fnt > .kb-shots, .kb-ticks .kb-shots { margin-block: 4px; }
.kb-tone > .kb-shots { margin-top: 16px; }
.kb-group > .kb-rows > li.kb-shotrow, .kb-rows > li.kb-shotrow, .kb-ticks > li.kb-shotrow { padding-block: 12px; }
.kb-figleg { display: grid; gap: 4px 24px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .kb-figleg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kb-figleg li { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
.kb-fln { color: var(--kit-ink); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.kb-thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.kb-thumb { display: block; width: 100%; padding: 0; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); background: var(--kit-paper-2); overflow: hidden; cursor: zoom-in; transition: border-color var(--kit-dur-hover) var(--ease-out); }
.kb-thumb:hover { border-color: var(--kit-rule-strong); }
.kb-thumb:focus-visible { outline: 2px solid var(--kit-focus); outline-offset: 2px; }
.kb-thbox { position: relative; display: block; width: 100%; aspect-ratio: 990 / 700; }
.kb-thbox img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
#kbDrawer.kb-drfig { width: min(1032px, 100vw); }
@media (max-width: 639px) { #kbDrawer.kb-drfig { width: 100vw; } }
.kb-figbox { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); background: var(--kit-paper-2); box-shadow: var(--kit-shadow-node); }
.kb-figbox img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kb-figerr { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-figerr[hidden] { display: none; }
.kb-fig figcaption { margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }

/* T27: clips of calls, in the screenshot's look: one bordered paper box per clip in its own row after the block (as a
   steps block's screenshots), rep and title on the first line with the length at its end, the 14/20 muted caption, then
   the browser's own player at full width; the failure line takes the player's place */
.kb-clips { display: grid; gap: 12px; min-width: 0; }
.kb-clip { margin: 0; padding: 12px 16px 16px; min-width: 0; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); background: var(--kit-paper-2); box-shadow: var(--kit-shadow-node); }
.kb-cliph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; line-height: 20px; }
.kb-cliprep { font-weight: 500; color: var(--kit-ink); }
.kb-clipt { min-width: 0; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-cliplen { margin-left: auto; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-clipc { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--kit-ink-3); overflow-wrap: anywhere; }
.kb-clip audio { display: block; width: 100%; height: 40px; margin-top: 12px; }
.kb-clip audio:focus-visible { outline: 2px solid var(--kit-focus); outline-offset: 2px; }
.kb-cliperr { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-cliperr[hidden] { display: none; }
.kb-group > .kb-rows > li.kb-cliprow, .kb-rows > li.kb-cliprow, .kb-ticks > li.kb-cliprow { min-width: 0; padding-block: 12px; }

/* skeleton: Home-shaped (cards, rows below 640px); the shared .sk breathing; the note waits the same --delay-skeleton */
.kb-sk { display: grid; gap: 16px; }
.kb-skcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
#tab-knowledge .kb-skc { display: block; height: 48px; border-radius: var(--kit-r-md); }
@media (min-width: 640px) { .kb-skcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.kb-loadnote { animation: m-sk-in var(--dur-move) var(--ease-out) calc(var(--delay-skeleton) - var(--sk-elapsed, 0ms)) backwards; }
@media (prefers-reduced-motion: reduce) { .kb-loadnote { animation: m-sk-in 0s linear calc(var(--delay-skeleton) - var(--sk-elapsed, 0ms)) backwards; } }

/* ===== v4 (Run 53 T13): Training, FAQ and Review. Hue means status only (good on done/passed glyphs, crit on never-say and
   failure, maybe on waiting and being confirmed); no text is ever coloured good. Same four sizes, same radii. ===== */
/* the mode tabs (kit Tabs, segmented): equal columns, a highlight layer clipped to the selected tab; only a pointer glides */
.kb-modes { min-width: 0; }
.kb-tabs { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(88px, 1fr); padding: 2px; border-radius: var(--kit-r-md); background: var(--kit-paper-2); max-width: 100%; }
.kb-tab { position: relative; z-index: 1; height: 28px; padding: 0 14px; border: 0; border-radius: var(--kit-r-sm); background: transparent; color: var(--kit-ink-3); font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; cursor: pointer;
  transition: color var(--kit-dur-hover) var(--ease-out), transform var(--kit-dur-press) var(--kit-ease-out); }
@media (hover: hover) { .kb-tab:hover { color: var(--kit-ink-2); } }
.kb-tab:active { transform: scale(var(--press)); }
.kb-tab[aria-selected="true"] { color: transparent; }
.kb-tab:focus-visible { outline-offset: 0; }
.kb-thl { position: absolute; inset: 2px; z-index: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); pointer-events: none; border-radius: var(--kit-r-sm); background: var(--kit-tab-highlight);
  clip-path: inset(0 calc((var(--kb-n) - var(--kb-i) - 1) * 100% / var(--kb-n)) 0 calc(var(--kb-i) * 100% / var(--kb-n)) round 6px); }
.kb-thl > span { display: grid; place-items: center; padding: 0 14px; color: var(--kit-ink); font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; }
.kb-tabs.kb-glide .kb-thl { transition: clip-path var(--kit-dur-tab) var(--kit-ease-in-out); }
@media (pointer: coarse) { .kb-tab { height: var(--kit-h-item); } .kb-tab::after { content: ""; position: absolute; inset: -8px 0; } }
@media (prefers-reduced-motion: reduce) { .kb-tabs.kb-glide .kb-thl { transition: none; } .kb-tab:active { transform: none; } }
#tab-knowledge .kb-skmode { display: block; height: 28px; width: min(280px, 100%); border-radius: var(--kit-r-md); }

/* shared status parts: glyph column, StatusPill, Being confirmed, inline write errors */
.kb-gl { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 12px; height: 20px; }
.kb-gl:empty { visibility: hidden; }
.kb-gok { color: var(--kit-success-glyph); }
.kb-g3 { color: var(--kit-ink-3); }
.kb-gm, .kb-gm svg { color: var(--kit-maybe-glyph); }
.kb-gbad { color: var(--kit-failed-glyph); }
.kb-pill { display: inline-flex; align-items: center; gap: 6px; height: var(--kit-h-pill); padding: 0 8px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-pill); color: var(--kit-ink-2); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.kb-pill .kb-gl { height: 12px; }
.kb-pwait { background: var(--kit-maybe-tint); border-color: color-mix(in srgb, var(--kit-maybe-label) 30%, var(--kit-maybe-tint)); color: var(--kit-maybe-label); }
.kb-pfail { background: var(--kit-failed-tint); border-color: var(--kit-failed-tint); color: var(--kit-failed-label); }
.kb-unk { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-pend { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 16px 20px; border-radius: var(--kit-r-md); background: var(--kit-paper-2); }
.kb-pend p { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
/* T15 F6: Being confirmed, compact (a checklist row, a deal-flow node); a pending checklist row has no box and no hover */
.kb-pendc { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; align-items: start; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
.kb-tick.kb-tpend { cursor: default; }
@media (hover: hover) { .kb-tick.kb-tpend:hover { background: transparent; } }
.kb-gm { display: inline-flex; }
.kb-werr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 14px; line-height: 20px; color: var(--kit-crit); }
.kb-werr > svg { flex: none; }
.kb-werr .btn-outline { margin-left: 4px; }
.kb-werr[hidden] { display: none; }
.kb-ferr { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--kit-crit); }
.kb-crit { color: var(--kit-crit); }
.kb-m12 { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-m3 { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-h24 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 32px; }
.kb-sm.kb-empty { padding: 32px 48px; }
.kb-fade { animation: kit-content-fade 150ms var(--ease-out); }
@keyframes kit-content-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kb-fade { animation: none; } }

/* ErrorBanner (training GET failed) */
.kb-eb { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--kit-r-md); background: var(--kit-maybe-tint); }
.kb-eb p { font-size: 14px; line-height: 20px; color: var(--kit-ink-2); }
.kb-ebg { display: inline-flex; color: var(--kit-maybe-glyph); }
#tab-knowledge .kb-eb .btn-outline { border-color: var(--kit-maybe-glyph); }

/* rule badge and Rules callout */
.kb-rb { display: inline-flex; align-items: center; gap: 6px; height: var(--kit-h-pill); padding: 0 8px; border: 1px solid var(--kit-rule-strong); border-radius: var(--kit-r-pill); background: transparent; color: var(--kit-ink-2); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out), transform var(--kit-dur-press) var(--kit-ease-out); }
.kb-rb svg { color: var(--kit-crit); }
@media (hover: hover) { .kb-rb:hover { background: var(--kit-paper-2); } }
.kb-rb:active { background: var(--kit-paper-3); transform: scale(var(--press)); }
.kb-rc { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows var(--kit-dur-expand-out) var(--kit-ease-out), opacity var(--kit-dur-expand-out) var(--kit-ease-out), visibility 0s linear var(--kit-dur-expand-out); }
.kb-rc[data-open="true"] { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows var(--kit-dur-expand-in) var(--kit-ease-out), opacity var(--kit-dur-expand-in) var(--kit-ease-out), visibility 0s; }
.kb-rc.kb-instant { transition: none; }
.kb-art > .kb-rc[data-open="false"] { margin-top: calc(-1 * var(--kb-gap)); }
.kb-rcin { min-height: 0; overflow: hidden; }
.kb-rc[data-open="true"] .kb-rcin { padding: 12px 16px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); }
.kb-rcl { display: grid; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.kb-rcl li { display: grid; gap: 2px; }
.kb-rck { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-2); }
.kb-rck.kb-crit { color: var(--kit-crit); }
.kb-rct { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .kb-rc { transition: opacity 80ms linear, visibility 0s linear 80ms; }
  .kb-rc[data-open="true"] { transition: opacity 120ms linear, visibility 0s; }
}
.kb-tnh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.kb-rk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-2); }
.kb-rk.kb-crit { color: var(--kit-crit); }

/* Rules of the road rows, examples */
.kb-rrow { grid-template-columns: 14px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.kb-rbi { display: inline-flex; padding-top: 3px; }
.kb-ex { display: grid; gap: 12px; min-width: 0; }
.kb-exl { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kb-exl li { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.kb-exw { padding-top: 2px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); }
.kb-exo { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); overflow-wrap: anywhere; }
.kb-exr { padding: 12px 16px; border-radius: var(--kit-r-md); background: var(--kit-paper-2); font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }

/* the Never-say card: two columns from a 560px container */
.kb-nsay { display: grid; gap: 12px; container-type: inline-size; min-width: 0; }
.kb-nsg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 24px; }
@container (min-width: 560px) { .kb-nsg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kb-nsh { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 14px; font-weight: 500; line-height: 20px; }
.kb-nsh svg { color: var(--kit-crit); }
.kb-nsl { margin: 0; padding: 0; list-style: none; }
.kb-nsl li { padding: 8px 0; font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-nsl li + li { border-top: 1px solid var(--kit-rule); }

/* Training: picker, track home, day cards, item rows */
.kb-pick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .kb-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; } .kb-pick > * { grid-column: span 2; } .kb-pick > :last-child:nth-child(odd) { grid-column: 2 / span 2; } }
#tab-knowledge .panel.kb-pk { display: flex; flex-direction: column; gap: 4px; }
.kb-pkh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kb-pkd { margin: 12px 0 0; padding: 0; list-style: none; }
.kb-pkd li { padding: 8px 0; font-size: 14px; line-height: 20px; color: var(--kit-ink); border-top: 1px solid var(--kit-rule); }
.kb-pk > .btn { align-self: flex-start; margin-top: auto; }
.kb-pk > .kb-pkd { margin-bottom: 16px; }
.kb-thome { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.kb-thead { display: grid; gap: 12px; }
.kb-thr { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.kb-tprog { display: grid; gap: 8px; }
.kb-tpn { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }
#tab-knowledge .panel.kb-cont, #tab-knowledge .panel.kb-ckp { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kb-cont > .btn { align-self: flex-start; margin-top: auto; }
.kb-cont > .kb-m12 { margin-bottom: var(--kb-gap); }
.kb-ckp > h3 { margin-bottom: 8px; }
.kb-ckl, .kb-items { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kb-ckr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; min-height: 44px; padding: 8px 12px; margin-inline: -12px; width: calc(100% + 24px); border: 0; border-radius: var(--kit-r-sm); background: none; text-align: left; color: var(--kit-ink); font-size: 14px; line-height: 20px; cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out); }
@media (hover: hover) { .kb-ckr:hover { background: var(--kit-row-hover); } }
.kb-ckr:active { background: var(--kit-paper-3); }
.kb-ckt { min-width: 0; overflow-wrap: anywhere; }
.kb-days { display: grid; gap: 16px; min-width: 0; }
#tab-knowledge .panel.kb-day { display: grid; gap: 8px; padding: var(--kb-pad) var(--kb-pad) 8px; }
.kb-dayh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.kb-dayn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-dayn .kb-gl { height: 16px; }
.kb-items > li + li { border-top: 1px solid var(--kit-rule); }
.kb-irow { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 16px; column-gap: 10px; align-items: start; width: calc(100% + 24px); min-height: 44px; margin-inline: -12px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--kit-r-sm); background: none; text-align: left; color: var(--kit-ink); cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out); }
.kb-irow > svg { align-self: center; color: var(--kit-ink-3); }
@media (hover: hover) { .kb-irow:hover { background: var(--kit-row-hover); } }
.kb-irow:active { background: var(--kit-paper-3); }
.kb-it { min-width: 0; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.kb-ik { padding-top: 2px; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); white-space: nowrap; }
.kb-rail { min-width: 0; }
@media (max-width: 999px) { .kb-irow { min-height: 48px; } }

/* the lesson: crumbs, the card (Article column), Never say, the path nav in the left rail from 1000px */
.kb-lgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.kb-lesson .kb-meta > span:not([class]) { font-variant-numeric: tabular-nums; }
.kb-tab-n { font-variant-numeric: tabular-nums; }
.kb-lcap { margin-top: 0; }
.kb-lsg { display: grid; gap: 4px; min-width: 0; }
.kb-relp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.kb-lsg .kb-gapc { margin: 4px 0 8px; }
.kb-lfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: var(--kb-gap); border-top: 1px solid var(--kit-rule); }
.kb-lfl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
.kb-lfr { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-doneln { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
.kb-doneln .btn-link { margin-left: 8px; }
.kb-lnav { display: none; }
.kb-lnd { display: grid; gap: 2px; }
.kb-lnd + .kb-lnd { margin-top: 12px; }
.kb-lnh { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 12px; background: var(--kit-paper); font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); }
.kb-lnc { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-prow { grid-template-columns: 12px minmax(0, 1fr) auto; width: 100%; margin-inline: 0; }
.kb-lnav .kb-items > li + li { border-top: 0; }
.kb-prow[aria-current="page"] { background: var(--kit-tab-highlight); border-color: var(--kit-rule); box-shadow: var(--kit-shadow-node); font-weight: 500; }
@media (hover: hover) { .kb-prow[aria-current="page"]:hover { background: var(--kit-tab-highlight); } }

/* the quiz: one fieldset per question; options are native radios in label rows */
.kb-quiz { display: grid; gap: 24px; min-width: 0; }
.kb-qi { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.kb-qi legend { display: grid; gap: 4px; padding: 0; margin-bottom: 8px; }
.kb-qn { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-qq { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-qos { display: grid; gap: 4px; }
.kb-qo { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-sm); color: var(--kit-ink); font-size: 14px; line-height: 20px; cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out); }
.kb-qo input { width: 16px; height: 16px; margin: 0; accent-color: var(--kit-ink); }
.kb-qot { min-width: 0; overflow-wrap: anywhere; }
@media (hover: hover) { .kb-qo:hover { background: var(--kit-row-hover); } }
.kb-qo:has(:checked) { background: var(--kit-tab-highlight); box-shadow: var(--kit-shadow-node); }
.kb-qo:has(:focus-visible) { outline: 2px solid var(--kit-focus); outline-offset: 2px; }
.kb-qo input:focus-visible { outline: none; }
.kb-qi[data-done] .kb-qo { cursor: default; }
@media (max-width: 999px) { .kb-qo { min-height: 48px; } }
.kb-qfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.kb-qcount { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-qres { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 16px 20px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); }
.kb-qres.fail { background: var(--kit-failed-tint); border-color: var(--kit-failed-tint); }
.kb-qres .kb-gl { height: 24px; }
.kb-qrx { display: grid; gap: 2px; min-width: 0; }
.kb-qrt { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 24px; color: var(--kit-ink); }
.kb-qres.fail .kb-qrt { color: var(--kit-failed-label); }
.kb-qrl { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-qres.fail .kb-qrl { color: var(--kit-ink); }
@media (max-width: 639px) { .kb-qres { grid-template-columns: 12px minmax(0, 1fr); row-gap: 12px; } .kb-qres > .btn, .kb-qres > .btn-outline { grid-column: 2; justify-self: start; } }

/* the drill */
.kb-drm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.kb-drc { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-drb { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-drf { display: grid; gap: 16px; min-height: 120px; align-content: start; padding: 24px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-md); }
.kb-drbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-drfoot { display: grid; gap: 8px; }
.kb-drg { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-drdone { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* the checkpoint */
.kb-crl { margin: 0; padding: 0; list-style: none; }
.kb-crl li { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 12px 0; }
.kb-crl li + li { border-top: 1px solid var(--kit-rule); }
.kb-crx { display: grid; gap: 2px; min-width: 0; }
.kb-crt { font-size: 14px; line-height: 20px; color: var(--kit-ink); overflow-wrap: anywhere; }
.kb-sga { display: grid; gap: 12px; justify-items: start; padding-top: 20px; border-top: 1px solid var(--kit-rule); }
.kb-sgl { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; align-items: start; font-size: 14px; line-height: 20px; color: var(--kit-ink); }
.kb-sgl > svg { color: var(--kit-ink-3); margin-top: 2px; }
.kb-sgl > .kb-gl { width: 16px; }

/* Your training (trainee FAQ Home) */
.kb-ytl { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink); font-variant-numeric: tabular-nums; }
.kb-yt .meter-track { align-self: stretch; margin: 8px 0 12px; }
.kb-yt .kb-ckl { align-self: stretch; margin-bottom: 24px; }
.kb-yt .kb-ckr { margin-inline: -12px; }

/* Review: the roster (a plain table in the GroupTable look; the frame alone scrolls sideways) */
#tab-knowledge .panel.kb-ros { padding: 0; min-width: 0; }
.kb-rosh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 20px 20px 12px; }
.kb-rosk { font-size: 14px; line-height: 20px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-rosf { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 0 0 var(--kit-r-lg) var(--kit-r-lg); }
.kb-rtab { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; color: var(--kit-ink); }
.kb-rtab thead th { height: 36px; padding: 0 12px; text-align: left; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); white-space: nowrap; box-shadow: inset 0 -1px 0 var(--kit-rule); background: var(--kit-surface); }
.kb-rtab td, .kb-rtab tbody th { height: 56px; padding: 8px 12px; text-align: left; vertical-align: middle; border-top: 1px solid var(--kit-rule); font-weight: 400; }
.kb-rtab tbody tr:first-child > * { border-top: 0; }
.kb-rtab .kb-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-rtab th[scope="row"], .kb-rtab thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--kit-surface); }
.kb-rosf.kb-scrolled th[scope="row"], .kb-rosf.kb-scrolled thead th:first-child { box-shadow: inset -1px 0 0 var(--kit-rule-strong); }
.kb-rosf.kb-scrolled thead th:first-child { box-shadow: inset -1px 0 0 var(--kit-rule-strong), inset 0 -1px 0 var(--kit-rule); }
.kb-rnm { display: block; font-weight: 500; overflow-wrap: anywhere; }
.kb-rem { display: block; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); overflow-wrap: anywhere; }
.kb-rpg { display: grid; gap: 6px; min-width: 120px; font-variant-numeric: tabular-nums; }
.kb-rpg + .kb-rpg { margin-top: 8px; }
.kb-rcl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.kb-rcl + .kb-rcl { margin-top: 8px; }
.kb-raud { font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
.kb-rdt { flex-basis: 100%; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); font-variant-numeric: tabular-nums; }
.kb-rwhy { flex-basis: 100%; font-size: 12px; line-height: 16px; color: var(--kit-ink-3); }
#tab-knowledge .kb-skt { display: block; height: 16px; width: 80%; }

/* the sign-off dialog: the page's dialog.confirm geometry, the kit layer inside */
#kbSignDlg .kb-sdl { margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--kit-ink-3); }
.kb-sdn { display: block; margin-top: 16px; margin-bottom: 4px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-2); }
#kbSignNote { width: 100%; height: auto; resize: vertical; font-size: 14px; line-height: 20px; }
#kbSignDlg .kb-werr { margin-top: 12px; }

/* the skeleton, trainee-shaped */
#tab-knowledge .kb-sktitle { display: block; height: 32px; width: min(260px, 70%); }
#tab-knowledge .kb-skmeter { display: block; height: 6px; width: 100%; }
.kb-skrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#tab-knowledge .kb-sk8, #tab-knowledge .kb-sk4 { display: block; height: 160px; border-radius: var(--kit-r-lg); }
#tab-knowledge .kb-skday { height: 120px; }

.kb-tct { text-wrap: balance; }
.kb-tcc { max-width: 62ch; }

/* Hallmark redesign 2026-12-01; system: DESIGN.md */
/* ===== KB redesign (2026-12-01): say first, door lists, On this page, the welcome-video slot. No new motion; every
   press has its reduce path below. ===== */
#kbHeroH, .kb-vh h2, .kb-at, .kb-h18, .kb-h24 { text-wrap: balance; }
.kb-say, .kb-body, .kb-note, .kb-co p, .kb-ul li, .kb-mqt, .kb-ckt { text-wrap: pretty; }
/* Most asked from one section: the per-row section label says nothing new */
.kb-mal1 .kb-mqc { display: none; }

/* the disclosure: a note behind its say-line, a reference term; native details, the chevron turns at once */
.kb-more { min-width: 0; }
.kb-more > summary { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; min-height: 32px; border-radius: var(--kit-r-sm); list-style: none; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kit-ink-3); cursor: pointer; overflow-wrap: anywhere; }
.kb-more > summary::-webkit-details-marker { display: none; }
.kb-more > summary > svg { flex: none; }
.kb-more[open] > summary > svg { transform: rotate(90deg); }
@media (hover: hover) { .kb-more > summary:hover { color: var(--kit-ink); } }
.kb-more > summary:active { color: var(--kit-ink); transform: scale(var(--press)); }
.kb-more > summary ~ * { margin-top: 8px; }
@media (max-width: 999px) { .kb-more > summary { min-height: 44px; } }

/* On this page: a closed details under the head below 1000px, the sticky right rail from 1000px (shell rules below) */
.kb-toc { min-width: 0; }
.kb-tocl { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kb-jump { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--kit-r-sm); background: none; text-align: left; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--kit-ink-3); cursor: pointer; overflow-wrap: anywhere;
  transition: background-color var(--kit-dur-hover) var(--ease-out); }
@media (hover: hover) { .kb-jump:hover { background: var(--kit-row-hover); color: var(--kit-ink); } }
.kb-jump:active { background: var(--kit-paper-3); color: var(--kit-ink); transform: scale(var(--press)); }
@media (min-width: 1000px) { .kb-jump { min-height: 32px; padding: 6px 12px; } }

/* defs groups: a setter group keeps term and note side by side from 640px; a reference term opens its note */
.kb-defs .kb-def { gap: 4px; }
@media (min-width: 640px) { .kb-defs .kb-def:not(:has(> .kb-more)) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--kb-gap); align-items: baseline; } }
.kb-defs .kb-def:has(> .kb-more) { padding-block: 2px; }
.kb-def > .kb-more > summary { min-height: 44px; }
.kb-def > .kb-more > .kb-note { margin-top: 0; padding: 0 0 12px 22px; }

/* Training home: Start here, a plain band (not a card) with its head row and the slot */
.kb-start { display: grid; align-content: start; gap: 12px; min-width: 0; }
.kb-starth { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }

/* the welcome-video slot: the framed empty state in one 72px row; nothing in it is focusable */
.kb-vid { margin: 0; min-width: 0; }
.kb-vid > .kb-est { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-content: center; align-items: center; min-height: 72px; padding: 16px var(--kb-pad); }
.kb-vid .kb-est__tile { grid-row: 1 / span 2; }
.kb-vid .kb-est .kb-est__tile + .kb-est__title { margin-top: 0; } /* outranks the port's tile + title gap: the slot stays one 72px row */
.kb-vid .kb-est .kb-est__text { margin: 0; }

/* SOURCE affectUI Empty State (empty-state), https://www.affectui.com/r/empty-state.json, fetched 2026-12-01, MIT licence
   (free item; the upstream file header is kept in this note). Ported to plain CSS: ui-est is kb-est and the ui-est locals
   are kb-est locals that read the aui bridge on #tab-knowledge; no fallback colours, no dark block (the bridge follows the
   theme), no own typeface (the tab face), no tile shadow. Brand: left-aligned, padding from kb-pad, title 14/500, text
   14/20, a 32px tile with a 16px lucide glyph in place of the Hugeicons one, the framed fill on paper-2 with a dashed
   strong rule; child selectors carry the root class so the older kb-empty type rules do not override them; bare keeps
   the context padding; the small-screen frame padding is folded into kb-pad. Upstream header: "Empty State, a single
   self-contained file. What a list, table or panel shows while there is nothing in it." No upstream motion. */
.kb-est {
  --kb-est-title: var(--aui-ink);
  --kb-est-text: var(--aui-muted);
  --kb-est-icon: var(--aui-muted);
  --kb-est-tile: var(--aui-surface);
  --kb-est-tile-line: var(--aui-border);
  --kb-est-tile-radius: var(--aui-radius-sm);
  --kb-est-frame: var(--aui-subtle);
  --kb-est-line: var(--aui-border-strong);
  --kb-est-radius: var(--aui-radius);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0; box-sizing: border-box; min-width: 0; padding: var(--kb-pad); border: 1px dashed var(--kb-est-line); border-radius: var(--kb-est-radius); background: var(--kb-est-frame); font-size: 14px; line-height: 20px; text-align: left;
}
.kb-est[data-bare] { border: 0; background: none; }
.kb-est[data-tall] { justify-content: center; min-height: 100%; }
.kb-est .kb-est__tile { display: grid; place-items: center; flex: none; box-sizing: border-box; width: 32px; height: 32px; border: 1px solid var(--kb-est-tile-line); border-radius: var(--kb-est-tile-radius); background: var(--kb-est-tile); color: var(--kb-est-icon); }
.kb-est .kb-est__tile > svg { display: block; width: 16px; height: 16px; }
.kb-est .kb-est__title { max-width: 100%; margin: 0; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--kb-est-title); overflow-wrap: anywhere; }
.kb-est .kb-est__tile + .kb-est__title { margin-top: var(--kb-gap); }
.kb-est .kb-est__text { max-width: var(--kb-measure); margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--kb-est-text); text-wrap: balance; overflow-wrap: anywhere; }
.kb-est .kb-est__action { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--kb-gap); }
.kb-est .kb-est__action .btn-outline { margin-top: 0; }

/* SOURCE affectUI Kbd (kbd), https://www.affectui.com/r/kbd.json, fetched 2026-12-01, MIT licence (affectUI lists it with
   its free open-source items). Ported to plain CSS: ui-kbd is kb-kbd on a real kbd element and the ui-kbd locals are
   kb-kbd locals that read the aui bridge; the md size (22px), 12px text, kit surface fill, rule edge, strong-rule depth
   line, the xs radius, the tab face (grouped with kb-ws above); one key only, so there are no keys, glyph or screen-reader
   spans and no platform detection, and the half-pixel nudge of the keys span has nothing to move; the show and hide rules
   of kb-slash are unchanged; no dark block (the bridge follows the theme). Upstream header: "Kbd, a single self-contained
   file. A key chip for shortcuts in menus, tooltips and help lists." No upstream motion. */
.kb-kbd {
  --kb-kbd-bg: var(--aui-surface);
  --kb-kbd-ink: var(--aui-muted);
  --kb-kbd-line: var(--aui-border);
  --kb-kbd-depth: var(--aui-border-strong);
  --kb-kbd-radius: var(--kit-r-xs);
  --kb-kbd-h: 22px;
  --kb-kbd-pad: 6px;
  flex: none; align-items: center; justify-content: center; box-sizing: border-box; min-width: var(--kb-kbd-h); height: var(--kb-kbd-h); margin: 0; padding: 0 var(--kb-kbd-pad); border-radius: var(--kb-kbd-radius); background: var(--kb-kbd-bg);
  box-shadow: inset 0 0 0 1px var(--kb-kbd-line), inset 0 -1px 0 var(--kb-kbd-depth); color: var(--kb-kbd-ink); font-size: 12px; font-weight: 500; font-style: normal; line-height: 1; letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; user-select: none;
}
@media (forced-colors: active) { .kb-kbd { border: 1px solid CanvasText; } }

@media (prefers-reduced-motion: reduce) { .kb-tc:active, .kb-jump:active, .kb-more > summary:active { transform: none; } }

/* ===== KB round 2 (2026-12-01): the knowledge-base frame. One centred axis. Home, Training and Review sit on the
   912 column; every other FAQ page sits in the docs shell from 1000px (sections rail, 488 reading column, On this
   page rail) and in one centred 488 column below it. No subgrid: nested grids repeat the shell tracks over the same
   width, so their lines coincide. ===== */
.kb-panel > * { width: min(100%, var(--kb-wide)); justify-self: center; }
#kbModes:not([hidden]) { display: grid; justify-items: center; }
#kbView[data-view="training"] { width: 100%; }
#kbView[data-view="training"] > :not(.kb-lgrid) { width: min(100%, var(--kb-wide)); justify-self: center; }
.kb-panel:has(> #kbSide:not([hidden])) > * { width: min(100%, var(--kb-col)); }
.kb-lgrid { width: min(100%, var(--kb-col)); justify-self: center; }
/* the article: one card, groups split by a rule */
.kb-groups { gap: 0; background: var(--kit-surface); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); box-shadow: var(--kit-shadow-node); }
.kb-groups:empty { display: none; }
#tab-knowledge .kb-groups > .panel.kb-group { background: none; border: 0; border-radius: 0; box-shadow: none; }
#tab-knowledge .kb-groups > .panel.kb-group + .panel.kb-group { border-top: 1px solid var(--kit-rule); }
/* the sections rail; below 1000px a one-line control opens the list in flow */
.kb-side { min-width: 0; }
.kb-sidet { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px; align-items: center; column-gap: 10px; width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--kit-ink-3); border-radius: var(--kit-r-md); background: var(--kit-surface); color: var(--kit-ink); font-size: 14px; font-weight: 500; line-height: 20px; text-align: left; cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out); }
.kb-sidet > .kb-tile { grid-column: 1; }
.kb-sidev { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-sidet > svg { grid-column: 3; transform: rotate(90deg); }
.kb-sidet[aria-expanded="true"] > svg { transform: rotate(-90deg); }
@media (hover: hover) { .kb-sidet:hover { background: var(--kit-row-hover); } }
.kb-sidet:active { background: var(--kit-paper-3); }
.kb-sideb { margin-top: 8px; padding: 4px; border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); background: var(--kit-surface); }
.kb-sideb[hidden] { display: none; }
.kb-sgh { padding: 16px 12px 4px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--kit-ink-3); }
.kb-sideg:first-child > .kb-sgh { padding-top: 4px; }
.kb-sidel { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kb-sidei { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; column-gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px; border: 0; border-radius: var(--kit-r-sm); background: none; color: var(--kit-ink-2); font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; cursor: pointer;
  transition: background-color var(--kit-dur-hover) var(--ease-out); }
.kb-sidex { min-width: 0; overflow-wrap: anywhere; }
@media (hover: hover) { .kb-sidei:hover { background: var(--kit-row-hover); } .kb-sidei[aria-current="page"]:hover { background: var(--kit-row-selected); } }
.kb-sidei[aria-current="page"] { background: var(--kit-row-selected); color: var(--kit-ink); font-weight: 500; }
.kb-sidei[aria-current="page"] > .kb-tile { color: var(--kit-ink); }
.kb-jump { position: relative; }
.kb-jump[aria-current="true"] { color: var(--kit-ink); font-weight: 500; }
.kb-sidei[aria-current="page"]::before, .kb-jump[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; border-left: 2px solid var(--kit-ink); }
@media (forced-colors: active) {
  .kb-sidei[aria-current="page"]::before, .kb-jump[aria-current="true"]::before { border-left-color: CanvasText; }
  .kb-sidet { border-color: ButtonText; }
}
/* below 640px the bar is display: contents, so the crumbs and the search are panel items: they keep the column */
@media (max-width: 639px) {
  .kb-panel > #kbBar > * { width: min(100%, var(--kb-wide)); justify-self: center; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbBar > * { width: min(100%, var(--kb-col)); }
}
/* from 640px: Home doors as even 2-up one-line cards (odd last card spans the row), Training home 2-up, skeletons to match */
@media (min-width: 640px) {
  .kb-bar:not(.kb-hb) .kb-find { flex: 1 1 240px; }
  .kb-topics { row-gap: 12px; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .kb-topics > h2 { padding: 0; }
  .kb-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--kb-gap); padding: 0; }
  .kb-cards > li { grid-column: span 2; }
  .kb-cards > li + li { border-top: 0; }
  .kb-cards > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kb-tc { min-height: 64px; padding: 12px var(--kb-pad); border: 1px solid var(--kit-rule); border-radius: var(--kit-r-lg); background: var(--kit-surface); box-shadow: var(--kit-shadow-node); }
  #tab-knowledge .kb-skc { height: 64px; border-radius: var(--kit-r-lg); }
  .kb-skrow:has(> .kb-sk4) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-thome { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-thome > * { grid-column: 1 / -1; }
  .kb-thome > .kb-cont, .kb-thome > .kb-ckp { grid-column: auto; }
}
@media (min-width: 1000px) {
  /* panes and lists */
  .kb-pane { display: block; }
  .kb-narrow { display: none; }
  .kb-nav { position: sticky; top: var(--kb-off); max-height: calc(100dvh - var(--kb-off) - 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--kit-rule-strong) transparent; }
  .kb-nav .kb-gh { position: sticky; top: 0; z-index: 1; background: var(--kit-paper); }
  #kbFound .kb-nohit > .kb-nav { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #kbFound .kb-nohit > .kb-pane { grid-column: 1 / -1; }
  #kbBar:not(.kb-hb) #kbFind, #kbBar:not(.kb-hb) .kb-fsk { height: 40px; font-size: 14px; line-height: 20px; }
  .kb-grid:has(> .kb-nav) { grid-template-columns: var(--kb-cr); column-gap: var(--kb-gap-sec); }
  .kb-grid:has(> .kb-nav) > .kb-pane { grid-column: 1; grid-row: 1; }
  .kb-grid:has(> .kb-nav) > .kb-nav { grid-column: 2; grid-row: 1; }
  .kb-grid:has(> .kb-callns) { grid-template-rows: auto 1fr; }
  .kb-grid:has(> .kb-callns) > .kb-nav { grid-row: 1 / span 2; }
  .kb-grid > .kb-callns { grid-column: 1; grid-row: 2; align-self: start; }
  .kb-rv { grid-template-columns: minmax(0, 1fr) minmax(0, var(--kb-col)); column-gap: var(--kb-gap-sec); }
  .kb-homeb:not(.one) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the docs shell */
  .kb-panel:has(> #kbSide:not([hidden])) { grid-template-columns: var(--kb-shell); column-gap: var(--kb-gap-sec); }
  .kb-panel:has(> #kbSide:not([hidden])) > * { width: auto; justify-self: stretch; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbBar { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: var(--kb-shell); column-gap: var(--kb-gap-sec); align-items: center; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbBar > .kb-find { grid-column: 1; grid-row: 1; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbBar > .kb-crumbs { grid-column: 2; grid-row: 1; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbSide { grid-column: 1; grid-row: 2; align-self: start; position: sticky; top: var(--kb-off); max-height: calc(100dvh - var(--kb-off) - 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: auto; scrollbar-width: thin; scrollbar-color: var(--kit-rule-strong) transparent; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbView, .kb-panel:has(> #kbSide:not([hidden])) > #kbFound { grid-column: 2 / -1; grid-row: 2; grid-template-columns: var(--kb-cr); column-gap: var(--kb-gap-sec); row-gap: 0; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbView > *, .kb-panel:has(> #kbSide:not([hidden])) > #kbFound > * { grid-column: 1; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbView > * + *, .kb-panel:has(> #kbSide:not([hidden])) > #kbFound > * + * { margin-top: var(--kb-gap); }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbView > .sr + *, .kb-panel:has(> #kbSide:not([hidden])) > #kbFound > .sr + * { margin-top: 0; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbView > .kb-grid:has(> .kb-nav), .kb-panel:has(> #kbSide:not([hidden])) > #kbFound > .kb-grid:has(> .kb-nav) { grid-column: 1 / -1; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbFound > .kb-nohit > .kb-pane { grid-column: 1; }
  .kb-panel:has(> #kbSide:not([hidden])) > #kbView > .kb-toc { grid-column: 2; grid-row: 1 / span 8; margin-top: 0; align-self: start; position: sticky; top: var(--kb-off); max-height: calc(100dvh - var(--kb-off) - 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--kit-rule-strong) transparent; }
  .kb-toc > .kb-more > summary { flex-direction: row-reverse; min-height: 24px; padding: 0 12px; font-size: 12px; line-height: 16px; }
  .kb-toc > .kb-more > summary ~ * { margin-top: 0; }
  .kb-sidet { display: none; }
  .kb-sideb { margin-top: 0; padding: 0; border: 0; border-radius: 0; background: none; }
  .kb-sidei { min-height: var(--kit-h-item); }
  #tab-knowledge .kb-toc :focus-visible, #tab-knowledge .kb-nav :focus-visible, #tab-knowledge .kb-lnav :focus-visible, #kbSide :focus-visible { outline-offset: -2px; }
  /* the lesson: the path nav in the left rail, the lesson in the reading column */
  .kb-lgrid { width: auto; justify-self: stretch; grid-template-columns: var(--kb-shell); column-gap: var(--kb-gap-sec); row-gap: 0; }
  .kb-lgrid > * { grid-column: 2; }
  .kb-lgrid > * + * { margin-top: var(--kb-gap); }
  .kb-lgrid > .kb-lnav { display: block; grid-column: 1; grid-row: 1 / span 6; margin-top: 0; align-self: start; position: sticky; top: var(--kb-off); max-height: calc(100dvh - var(--kb-off) - 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--kit-rule-strong) transparent; }
}
/* KB round 2, fix round E (2026-12-01) */
/* a heading that receives focus programmatically (a landing target) shows no ring; controls keep theirs */
#tab-knowledge :is(h2, h3, h4)[tabindex="-1"]:focus-visible { outline: none; }
/* a step screenshot is a button that opens it full size (the box is position: relative, overflow: hidden) */
.kb-zoom { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: none; cursor: zoom-in; }
#tab-knowledge .kb-zoom:focus-visible { outline-offset: -2px; }
@media (hover: hover) { .kb-figbox:has(> .kb-zoom:hover) { border-color: var(--kit-rule-strong); } }
#kbDrawer .kb-zoom, .kb-figbox:has(> .kb-figerr:not([hidden])) > .kb-zoom { display: none; }
@media (max-width: 639px) { .kb-zoom { display: none; } }
/* Review: the roster and the block after it split by a section gap */
#kbView[data-view="review"] > .kb-ros + * { margin-top: 16px; }
/* KB round 2, fix round F (2026-12-01): one Never-say group on the Training home (the full-width rail) flows its list
   across both columns once the box is 560px wide; rows align across the columns, rules sit between rows only. The call
   view and the lesson keep one column; two groups keep their side-by-side grid. */
@container (min-width: 560px) {
  .kb-rail .kb-nsg > :only-child { grid-column: 1 / -1; }
  .kb-rail .kb-nsg > :only-child > .kb-nsl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .kb-rail .kb-nsg > :only-child > .kb-nsl > li:nth-child(2) { border-top: 0; }
}
