/* ═══════════════════════════════════════════════════════════════════════════
   REVU THEME — a drop-in replacement for stacked-pages gen-kit/theme.css
   ═══════════════════════════════════════════════════════════════════════════
   Visual language lifted from the Revu UI Kit design-system sheets 1-12.
   Token NAMES are the framework's existing contract (gen-kit/theme.css), so
   this file swaps in without touching a single component.

   THREE INDEPENDENT AXES, all set on <html>:
     data-density = compact | default | roomy      (size scale)
     data-width   = centered | expanded            (content measure)
     data-theme   = light   | dark                 (palette)

   Density and theme are orthogonal: every size token is redefined per density,
   every colour token per theme. Nothing else in the sheet hard-codes either.
   ═════════════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────────────────
   1. PALETTE — light (Revu sheet 1: Solid Colors)
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:        #0052FF;
  --primary-hover:  #0041CC;
  --primary-soft:   #D6E2FF;   /* sheet 1 — #0052FF @ light tint */
  --primary-tint:   #EEF3FF;
  --primary-dark:   #003BB8;
  --accent:         #F6B354;
  --accent-dark:    #B4761D;
  --on-primary:     #FFFFFF;

  /* Surfaces */
  --page-bg:        #F5F5FA;   /* sheet 1 — Grey color */
  --card-bg:        #FFFFFF;
  --border:         #ECECF2;
  --border-subtle:  #F4F4F8;
  --sunken-bg:      #F1F1F6;

  /* Text — sheet 6/7 */
  --text-primary:   #000000;
  --text-secondary: #5F646D;
  --text-muted:     #8083A3;
  --text-placeholder:#8083A3;

  /* Semantic — sheet 1 secondary colours */
  --success:        #81DE4A;  --success-ink: #4E9C22;
  --warning:        #F6B354;  --warning-ink: #B4761D;
  --error:          #F66254;  --error-ink:   #C93E31;
  --info:           #0052FF;  --info-ink:    #0052FF;

  /* Status badges — sheet 10 (Tags) */
  --sb-emerald-bg:#EBF9E2; --sb-emerald-text:#4E9C22; --sb-emerald-dot:#81DE4A;
  --sb-amber-bg:  #FDF0DE; --sb-amber-text:  #B4761D; --sb-amber-dot:  #F6B354;
  --sb-rose-bg:   #FDE0DD; --sb-rose-text:   #C93E31; --sb-rose-dot:   #F66254;
  --sb-sky-bg:    #D6E2FF; --sb-sky-text:    #0052FF; --sb-sky-dot:    #0052FF;
  --sb-slate-bg:  #F1F1F6; --sb-slate-text:  #5F646D; --sb-slate-dot:  #8083A3;
  --sb-indigo-bg: #E7E4FF; --sb-indigo-text: #4B3FCB; --sb-indigo-dot: #6E6BFF;

  /* Alert tints */
  --alert-err-bg:#FDF3F2; --alert-err-border:#FAD5D1; --alert-err-text:#C93E31;
  --alert-warn-bg:#FEF8EF;--alert-warn-border:#FAE4C6;--alert-warn-text:#B4761D;
  --alert-info-bg:#EEF3FF;--alert-info-border:#CFDDFF;--alert-info-text:#0052FF;
  --alert-ok-bg: #F2FBEC; --alert-ok-border: #D6F0C4; --alert-ok-text: #4E9C22;

  /* Interaction */
  --hover-bg:       #FAFAFD;
  --hover-strong:   #EFEFF5;
  --focus-ring:     rgba(0,82,255,.16);
  --skeleton-from:  #F1F1F6;
  --skeleton-to:    #E4E4EE;
  --scrim:          rgba(15,17,25,.45);

  /* Shadows — sheet 2 (#999BA8) */
  --sh-card:    0 1px 2px rgba(153,155,168,.10);
  --sh-raised:  0 2px 4px rgba(153,155,168,.08), 0 12px 28px -14px rgba(153,155,168,.45);
  --sh-modal:   0 32px 64px -16px rgba(15,17,25,.28);
  --sh-drawer:  -12px 0 48px -16px rgba(15,17,25,.28);
  --sh-dropdown:0 12px 28px -8px rgba(153,155,168,.45);
  --sh-toast:   0 12px 32px -8px rgba(15,17,25,.22);

  /* Typography */
  --font-sans: "Roboto Flex", Inter, system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;

  /* Radii — Revu is notably rounder than the indigo preset */
  --r-button: 10px;
  --r-card:   16px;
  --r-panel:  14px;
  --r-modal:  20px;
  --r-badge:  999px;
  --r-input:  12px;
  --r-avatar: 999px;
  --r-avatar-brand: 12px;
  --r-nav-item: 12px;
  --r-thumb:  12px;
  --r-check:  7px;

  /* Motion */
  --t-fast: 90ms; --t-base: 140ms; --t-slow: 220ms;
  --ease: cubic-bezier(.2,.8,.3,1);

  /* Sidebar — Revu keeps it LIGHT, unlike the indigo preset's dark rail */
  --sidebar-bg:          var(--page-bg);
  --sidebar-text:        var(--text-primary);
  --sidebar-section:     var(--text-muted);
  --sidebar-active-bg:   #EAEAF1;
  --sidebar-active-bar:  var(--primary);
  --sidebar-hover-bg:    #EDEDF3;
  --sidebar-badge-bg:    var(--primary-soft);
  --sidebar-badge-text:  var(--primary);
}

/* ───────────────────────────────────────────────────────────────────────────
   2. PALETTE — dark (Revu sheets 9-12 right-hand columns)
   ─────────────────────────────────────────────────────────────────────────── */
:root[data-theme="dark"],
[data-theme="dark"] {
  --primary:        #0052FF;
  --primary-hover:  #2E6BFF;
  --primary-soft:   #16244A;
  --primary-tint:   #0F1832;
  --on-primary:     #FFFFFF;

  --page-bg:        #08080C;
  --card-bg:        #131319;
  --border:         #24242E;
  --border-subtle:  #1B1B23;
  --sunken-bg:      #1B1B23;

  --text-primary:   #FFFFFF;
  --text-secondary: #A0A3B1;
  --text-muted:     #6E7183;
  --text-placeholder:#5C5F70;

  --success-ink:#8FE45C; --warning-ink:#F6B354; --error-ink:#FF7B6E;

  --sb-emerald-bg:#14260C; --sb-emerald-text:#8FE45C;
  --sb-amber-bg:  #2B1F0A; --sb-amber-text:  #F6B354;
  --sb-rose-bg:   #2E1310; --sb-rose-text:   #FF7B6E;
  --sb-sky-bg:    #101F44; --sb-sky-text:    #6E9BFF;
  --sb-slate-bg:  #1E1E27; --sb-slate-text:  #A0A3B1;
  --sb-indigo-bg: #1B1740; --sb-indigo-text: #9E97FF;

  --alert-err-bg:#1E100E; --alert-err-border:#3A1B17; --alert-err-text:#FF7B6E;
  --alert-warn-bg:#1E1608;--alert-warn-border:#3A2C11;--alert-warn-text:#F6B354;
  --alert-info-bg:#0D1631;--alert-info-border:#1B2A56;--alert-info-text:#6E9BFF;
  --alert-ok-bg: #101E09; --alert-ok-border: #1E3714; --alert-ok-text: #8FE45C;

  --hover-bg:     #17171F;
  --hover-strong: #1E1E27;
  --focus-ring:   rgba(0,82,255,.32);
  --skeleton-from:#1B1B23; --skeleton-to:#24242E;
  --scrim:        rgba(0,0,0,.66);

  --sh-card:   0 1px 2px rgba(0,0,0,.40);
  --sh-raised: 0 2px 4px rgba(0,0,0,.30), 0 12px 28px -14px rgba(0,0,0,.80);
  --sh-modal:  0 32px 64px -16px rgba(0,0,0,.72);
  --sh-drawer: -12px 0 48px -16px rgba(0,0,0,.72);
  --sh-dropdown:0 12px 28px -8px rgba(0,0,0,.66);

  --sidebar-active-bg: #1E1E27;
  --sidebar-hover-bg:  #17171F;
  --sidebar-badge-bg:  #16244A;
  --sidebar-badge-text:#6E9BFF;
}

/* ───────────────────────────────────────────────────────────────────────────
   2b. COLOUR SCHEME — the one fill Revu tells you to change (sheet 1:
       "Change these fills to setup primary and accent colors").
       Set on <html data-scheme="…">. Independent of density, width and theme.

       `sky` follows the primary deliberately: filter chips, selected rows and
       the info tone all read as "the brand", so leaving them blue while the
       primary went green would split the accent in two.
   ─────────────────────────────────────────────────────────────────────────── */
:root, [data-scheme="blue"] {
  --primary:#0052FF; --primary-hover:#0041CC; --primary-soft:#D6E2FF;
  --primary-tint:#EEF3FF; --primary-dark:#003BB8;
  --sb-sky-bg:#D6E2FF; --sb-sky-text:#0052FF; --sb-sky-dot:#0052FF;
  --focus-ring:rgba(0,82,255,.16);
}
[data-scheme="violet"] {
  --primary:#6E6BFF; --primary-hover:#5754E6; --primary-soft:#E2E1FF;
  --primary-tint:#F2F2FF; --primary-dark:#4B48C7;
  --sb-sky-bg:#E2E1FF; --sb-sky-text:#4B48C7; --sb-sky-dot:#6E6BFF;
  --focus-ring:rgba(110,107,255,.20);
}
[data-scheme="emerald"] {
  --primary:#00A15C; --primary-hover:#00854B; --primary-soft:#CDF0DF;
  --primary-tint:#ECFAF3; --primary-dark:#00693C;
  --sb-sky-bg:#CDF0DF; --sb-sky-text:#00693C; --sb-sky-dot:#00A15C;
  --focus-ring:rgba(0,161,92,.20);
}
[data-scheme="amber"] {
  --primary:#D9820C; --primary-hover:#B96C06; --primary-soft:#FBE8CB;
  --primary-tint:#FEF6EA; --primary-dark:#95560A;
  --sb-sky-bg:#FBE8CB; --sb-sky-text:#95560A; --sb-sky-dot:#D9820C;
  --focus-ring:rgba(217,130,12,.22);
}
[data-scheme="crimson"] {
  --primary:#E0344B; --primary-hover:#C0223A; --primary-soft:#FBD8DE;
  --primary-tint:#FEF0F2; --primary-dark:#9B1A2C;
  --sb-sky-bg:#FBD8DE; --sb-sky-text:#9B1A2C; --sb-sky-dot:#E0344B;
  --focus-ring:rgba(224,52,75,.20);
}
[data-scheme="ink"] {
  --primary:#1A1A22; --primary-hover:#33333F; --primary-soft:#E6E6EC;
  --primary-tint:#F4F4F7; --primary-dark:#000000;
  --sb-sky-bg:#E6E6EC; --sb-sky-text:#33333F; --sb-sky-dot:#5F646D;
  --focus-ring:rgba(26,26,34,.20);
}

/* dark mode lifts every scheme's primary so it stays legible on #08080C */
:root[data-theme="dark"][data-scheme="blue"],
[data-theme="dark"][data-scheme="blue"]    { --primary-hover:#2E6BFF; --primary-soft:#16244A; --primary-tint:#0F1832; }
:root[data-theme="dark"][data-scheme="violet"],
[data-theme="dark"][data-scheme="violet"]  { --primary:#8582FF; --primary-hover:#9E9CFF; --primary-soft:#241F4F; --primary-tint:#171436; }
:root[data-theme="dark"][data-scheme="emerald"],
[data-theme="dark"][data-scheme="emerald"] { --primary:#12BE71; --primary-hover:#2FD489; --primary-soft:#0C3323; --primary-tint:#0A2419; }
:root[data-theme="dark"][data-scheme="amber"],
[data-theme="dark"][data-scheme="amber"]   { --primary:#F0980F; --primary-hover:#FFAE33; --primary-soft:#3A2708; --primary-tint:#251906; }
:root[data-theme="dark"][data-scheme="crimson"],
[data-theme="dark"][data-scheme="crimson"] { --primary:#FF5268; --primary-hover:#FF7286; --primary-soft:#3D1119; --primary-tint:#2A0C12; }
:root[data-theme="dark"][data-scheme="ink"],
[data-theme="dark"][data-scheme="ink"]     { --primary:#E6E6EC; --primary-hover:#FFFFFF; --primary-soft:#26262F; --primary-tint:#1B1B23;
                                             --on-primary:#0B0B10; }

/* ───────────────────────────────────────────────────────────────────────────
   3. DENSITY — the size scale. THE ONLY PLACE SIZES ARE DECLARED.
      Every component below reads these; none hard-codes a px size.
   ─────────────────────────────────────────────────────────────────────────── */

/* DEFAULT — Revu as drawn. Comfortable reading, 8-20 rows in view. */
:root,
[data-density="default"] {
  --fs-display:28px; --fs-h1:24px; --fs-h2:20px; --fs-h3:18px;
  --fs-body:16px;    --fs-sm:15px; --fs-micro:13px; --fs-stat:34px; --fs-stat-sm:24px;
  --lh-body:1.55;    --lh-tight:1.25;

  --ctl-h:48px;      --ctl-h-sm:40px;  --ctl-h-xs:32px;
  --ctl-px:20px;     --ctl-px-sm:14px;
  --ipt-h:52px;      --ipt-px:16px;
  --nav-h:48px;      --tab-h:44px;
  --topbar-h:100px;  --topbar-h-sub:64px;
  --row-py:18px;     --row-px:20px;    --head-py:20px;
  --icon-nav:20px;   --icon-inline:18px; --icon-ctl:20px;
  --icon-stat:22px;  --icon-hero:26px; --icon-activity:15px;
  --avatar:40px;     --avatar-lg:48px; --avatar-sm:32px;
  --thumb:56px;      --thumb-lg:72px;

  --sp-page:32px;    --sp-card:24px;   --sp-card-tight:20px;
  --sp-section-gap:24px; --sp-card-gap:24px; --sp-field-gap:20px;
  --sp-button-gap:8px;   --sp-action-row-gap:12px;
  --sp-panel-hdr-x:24px; --sp-panel-hdr-y:18px;

  --sidebar-w:260px; --sidebar-w-collapsed:76px;
  --rail-w:360px;    --drawer-w:520px;
}

/* COMPACT — dense admin work. 200-row tables, dispatch boards, back office. */
[data-density="compact"] {
  --fs-display:22px; --fs-h1:19px; --fs-h2:17px; --fs-h3:15px;
  --fs-body:14px;    --fs-sm:13px; --fs-micro:11px; --fs-stat:26px; --fs-stat-sm:19px;
  --lh-body:1.45;    --lh-tight:1.2;

  --ctl-h:34px;      --ctl-h-sm:30px;  --ctl-h-xs:26px;
  --ctl-px:13px;     --ctl-px-sm:10px;
  --ipt-h:36px;      --ipt-px:11px;
  --nav-h:34px;      --tab-h:32px;
  --topbar-h:60px;   --topbar-h-sub:46px;
  --row-py:9px;      --row-px:12px;    --head-py:10px;
  --icon-nav:17px;   --icon-inline:15px; --icon-ctl:16px;
  --icon-stat:17px;  --icon-hero:20px; --icon-activity:13px;
  --avatar:26px;     --avatar-lg:34px; --avatar-sm:22px;
  --thumb:36px;      --thumb-lg:48px;

  --sp-page:18px;    --sp-card:16px;   --sp-card-tight:12px;
  --sp-section-gap:14px; --sp-card-gap:14px; --sp-field-gap:12px;
  --sp-button-gap:6px;   --sp-action-row-gap:8px;
  --sp-panel-hdr-x:16px; --sp-panel-hdr-y:11px;

  --sidebar-w:216px; --sidebar-w-collapsed:60px;
  --rail-w:300px;    --drawer-w:460px;

  --r-button:8px; --r-card:10px; --r-panel:9px; --r-input:8px;
  --r-nav-item:8px; --r-thumb:8px; --r-modal:14px; --r-check:5px;
}

/* ROOMY — presentation, kiosk, low-volume high-stakes records. */
[data-density="roomy"] {
  --fs-display:34px; --fs-h1:28px; --fs-h2:23px; --fs-h3:20px;
  --fs-body:17px;    --fs-sm:16px; --fs-micro:14px; --fs-stat:42px; --fs-stat-sm:28px;
  --lh-body:1.65;    --lh-tight:1.3;

  --ctl-h:56px;      --ctl-h-sm:46px;  --ctl-h-xs:38px;
  --ctl-px:26px;     --ctl-px-sm:18px;
  --ipt-h:60px;      --ipt-px:20px;
  --nav-h:56px;      --tab-h:52px;
  --topbar-h:124px;  --topbar-h-sub:78px;
  --row-py:26px;     --row-px:26px;    --head-py:24px;
  --icon-nav:22px;   --icon-inline:20px; --icon-ctl:22px;
  --icon-stat:26px;  --icon-hero:32px; --icon-activity:17px;
  --avatar:48px;     --avatar-lg:60px; --avatar-sm:38px;
  --thumb:72px;      --thumb-lg:96px;

  --sp-page:44px;    --sp-card:32px;   --sp-card-tight:26px;
  --sp-section-gap:32px; --sp-card-gap:32px; --sp-field-gap:26px;
  --sp-button-gap:10px;  --sp-action-row-gap:16px;
  --sp-panel-hdr-x:32px; --sp-panel-hdr-y:24px;

  --sidebar-w:300px; --sidebar-w-collapsed:88px;
  --rail-w:400px;    --drawer-w:600px;

  --r-button:12px; --r-card:20px; --r-panel:18px; --r-input:14px;
  --r-nav-item:14px; --r-thumb:16px; --r-modal:24px; --r-check:9px;
}

/* ───────────────────────────────────────────────────────────────────────────
   4. WIDTH — content measure. Archetype caps come from screen-archetypes.yaml.
   ─────────────────────────────────────────────────────────────────────────── */
.stage             { --content-max: 1280px; }   /* dashboard, list — default */
.stage[data-archetype="list"],
.stage[data-archetype="dashboard"],
.stage[data-archetype="hub"]      { --content-max: 1280px; }
.stage[data-archetype="detail"]   { --content-max: 1120px; }
/* ⭐ record: a page about ONE record with a rail beside its content. The rail takes 200–240px of the measure, so the
   content column beside it would be a third narrower than a plain detail page's; this archetype gives the whole
   page the room back. (`detail` stays the cap for a record page with no rail.) */
.stage[data-archetype="record"]   { --content-max: 1480px; }
.stage[data-archetype="form"]     { --content-max: 820px; }
.stage[data-archetype="settings"] { --content-max: 960px; }
/* ⭐ auth is an archetype like any other. It was missing, so a stage carrying it
   fell back to 1280 SILENTLY — 460px is the form column's measure and it lived
   only in .auth-form, where no page could reach it. */
.stage[data-archetype="auth"]     { --content-max: 460px; }

/* ⭐ BOTH HALVES — same convention and same reason as [data-nav] below. */
:root[data-width="expanded"] .stage,
[data-width="expanded"] .stage { --content-max: none; }

.stage      { padding: var(--sp-page); }
.stage-inner{ max-width: var(--content-max); margin-inline: auto; width: 100%; }

/* ───────────────────────────────────────────────────────────────────────────
   5. BASE
   ─────────────────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin:0; font-family:var(--font-sans); font-size:var(--fs-body);
  line-height:var(--lh-body); color:var(--text-primary); background:var(--page-bg);
  -webkit-font-smoothing:antialiased; overflow:hidden;
}
h1,h2,h3,h4,p,figure { margin:0; }
a { color:inherit; text-decoration:none; }
button,input,select,textarea { font:inherit; color:inherit; }
img { display:block; max-width:100%; }
[hidden],[x-cloak] { display:none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; }
.muted { color:var(--text-secondary); }
.dim   { color:var(--text-muted); }
.truncate{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nowrap{ white-space:nowrap; }
/* Present to a screen reader, absent to the eye. The family had no such utility and its
   upload target paid for it: fleet/vehicles/new draws a `.drop` div that says "click to
   choose" with no <input type=file> behind it, so it chooses nothing. `file-drop` puts a
   real input inside a <label> and hides it with this — one declared utility rather than
   the same seven declarations inlined by every component that needs them. */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px;
          overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:999px; border:3px solid var(--page-bg); }
::-webkit-scrollbar-track { background:transparent; }

:focus-visible { outline:2px solid var(--primary); outline-offset:2px; border-radius:4px; }

/* Type helpers */
.t-display{ font-size:var(--fs-display); font-weight:700; letter-spacing:-.02em; line-height:var(--lh-tight); }
.t-h1{ font-size:var(--fs-h1); font-weight:700; letter-spacing:-.015em; line-height:var(--lh-tight); }
.t-h2{ font-size:var(--fs-h2); font-weight:700; letter-spacing:-.01em; line-height:var(--lh-tight); }
.t-h3{ font-size:var(--fs-h3); font-weight:600; line-height:var(--lh-tight); }
.t-body{ font-size:var(--fs-body); }
.t-sm{ font-size:var(--fs-sm); }
.t-micro{ font-size:var(--fs-micro); }
.t-stat{ font-size:var(--fs-stat); font-weight:700; letter-spacing:-.02em; line-height:1.05;
         font-variant-numeric:tabular-nums; }
.t-stat-sm{ font-size:var(--fs-stat-sm); font-weight:700; line-height:1.1;
         font-variant-numeric:tabular-nums; }
.eyebrow{ font-size:var(--fs-micro); font-weight:600; color:var(--text-muted);
          text-transform:uppercase; letter-spacing:.07em; }

/* ───────────────────────────────────────────────────────────────────────────
   6. BUTTONS — sheet 9 (Buttons Styles)
   ─────────────────────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:var(--sp-button-gap);
  height:var(--ctl-h); padding:0 var(--ctl-px); border-radius:var(--r-button);
  font-size:var(--fs-body); font-weight:600; line-height:1; border:1px solid transparent;
  background:none; cursor:pointer; white-space:nowrap; text-align:center;
  transition:background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
             color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active{ transform:translateY(1px); }
.btn:disabled,.btn[aria-disabled="true"]{ opacity:.45; cursor:not-allowed; transform:none; }
.btn .ic{ width:var(--icon-ctl); height:var(--icon-ctl); flex:none; }

.btn-pri{ background:var(--primary); color:var(--on-primary); }
.btn-pri:hover:not(:disabled){ background:var(--primary-hover); }
.btn-soft{ background:var(--primary-soft); color:var(--primary); }
.btn-soft:hover:not(:disabled){ background:var(--primary-soft); filter:brightness(.96); }
.btn-sec{ background:var(--card-bg); color:var(--text-primary); border-color:var(--border); }
.btn-sec:hover:not(:disabled){ background:var(--hover-bg); border-color:var(--text-muted); }
.btn-ghost{ background:transparent; color:var(--text-secondary); }
.btn-ghost:hover:not(:disabled){ background:var(--hover-strong); color:var(--text-primary); }
.btn-dark{ background:var(--text-primary); color:var(--card-bg); }
.btn-dark:hover:not(:disabled){ background:var(--text-primary); filter:brightness(1.25); }
.btn-danger{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.btn-danger:hover:not(:disabled){ background:var(--sb-rose-bg); filter:brightness(.95); }
.btn-danger-solid{ background:var(--error); color:#fff; }
.btn-danger-solid:hover:not(:disabled){ background:var(--error); filter:brightness(.92); }

.btn-sm{ height:var(--ctl-h-sm); padding:0 var(--ctl-px-sm); font-size:var(--fs-sm); }
.btn-xs{ height:var(--ctl-h-xs); padding:0 10px; font-size:var(--fs-micro); }
.btn-block{ width:100%; }
.btn-start{ justify-content:flex-start; }

/* icon-only */
.btn-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--ctl-h); height:var(--ctl-h); padding:0; flex:none;
  border-radius:var(--r-button); border:none; background:transparent;
  color:var(--text-primary); cursor:pointer;
  transition:background var(--t-fast) var(--ease);
}
.btn-icon:hover{ background:var(--hover-strong); }
.btn-icon.sm{ width:var(--ctl-h-sm); height:var(--ctl-h-sm); }
.btn-icon.xs{ width:var(--ctl-h-xs); height:var(--ctl-h-xs); }
.btn-icon.bordered{ border:1px solid var(--border); background:var(--card-bg); border-radius:var(--r-input); }
.btn-icon.bordered:hover{ background:var(--hover-bg); border-color:var(--text-muted); }
.btn-icon .ic{ width:var(--icon-ctl); height:var(--icon-ctl); }

/* segmented control */
.seg{ display:inline-flex; border:1px solid var(--border); border-radius:var(--r-button);
      overflow:hidden; background:var(--card-bg); }
.seg > button{
  height:var(--ctl-h-sm); padding:0 var(--ctl-px-sm); border:none; background:transparent;
  color:var(--text-secondary); font-size:var(--fs-sm); font-weight:600; cursor:pointer;
  display:inline-flex; align-items:center; gap:6px;
  transition:background var(--t-fast), color var(--t-fast);
}
.seg > button + button{ border-left:1px solid var(--border); }
.seg > button:hover:not(.on){ background:var(--hover-bg); color:var(--text-primary); }
.seg > button.on{ background:var(--text-primary); color:var(--card-bg); }
.seg > button .ic{ width:var(--icon-inline); height:var(--icon-inline); }

/* ───────────────────────────────────────────────────────────────────────────
   7. TAGS · BADGES · PILLS — sheet 10
   ─────────────────────────────────────────────────────────────────────────── */
.tag{
  display:inline-flex; align-items:center; gap:6px; height:var(--ctl-h-xs);
  padding:0 calc(var(--ctl-px-sm) + 2px); border-radius:var(--r-badge);
  font-size:var(--fs-sm); font-weight:600; line-height:1; white-space:nowrap;
  border:1px solid transparent; background:var(--sb-slate-bg); color:var(--sb-slate-text);
}
.tag .ic{ width:var(--icon-inline); height:var(--icon-inline); }
.tag-dot{ width:8px; height:8px; border-radius:999px; flex:none; background:currentColor; }
.tag-emerald{ background:var(--sb-emerald-bg); color:var(--sb-emerald-text); }
.tag-emerald .tag-dot{ background:var(--sb-emerald-dot); }
.tag-amber{ background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.tag-amber .tag-dot{ background:var(--sb-amber-dot); }
.tag-rose{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.tag-rose .tag-dot{ background:var(--sb-rose-dot); }
.tag-sky{ background:var(--sb-sky-bg); color:var(--sb-sky-text); }
.tag-sky .tag-dot{ background:var(--sb-sky-dot); }
.tag-slate{ background:var(--sb-slate-bg); color:var(--sb-slate-text); }
.tag-slate .tag-dot{ background:var(--sb-slate-dot); }
.tag-indigo{ background:var(--sb-indigo-bg); color:var(--sb-indigo-text); }
.tag-indigo .tag-dot{ background:var(--sb-indigo-dot); }
.tag-solid{ background:var(--primary); color:#fff; }
.tag-outline{ background:var(--card-bg); border-color:var(--border); color:var(--text-primary); }
.tag-close{ opacity:.6; cursor:pointer; }
.tag-close:hover{ opacity:1; }

.badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:calc(var(--fs-micro) + 13px); height:calc(var(--fs-micro) + 13px);
  padding:0 7px; border-radius:var(--r-badge);
  font-size:var(--fs-micro); font-weight:700; line-height:1;
  background:var(--sb-slate-bg); color:var(--sb-slate-text);
}
.badge-primary{ background:var(--primary-soft); color:var(--primary); }
.badge-amber{ background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.badge-rose{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.badge-on-dark{ background:rgba(255,255,255,.22); color:#fff; }

/* ───────────────────────────────────────────────────────────────────────────
   8. TABS — sheet 10 (Tab Title). Black = "where I am", blue = "what to click".
   ─────────────────────────────────────────────────────────────────────────── */
.tabs{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.tab{
  display:inline-flex; align-items:center; gap:8px; height:var(--tab-h);
  padding:0 var(--ctl-px); border:none; border-radius:var(--r-button);
  background:transparent; color:var(--text-secondary);
  font-size:var(--fs-body); font-weight:600; cursor:pointer; white-space:nowrap;
  transition:background var(--t-fast), color var(--t-fast);
}
.tab:hover:not(.on){ background:var(--hover-strong); color:var(--text-primary); }
.tab.on{ background:var(--text-primary); color:var(--card-bg); }
.tab.on .badge{ background:rgba(255,255,255,.22); color:#fff; }

/* horizontal tab bar — used when a record has <=5 section groups.
   Always real links to real routes (never ?tab=, never in-page anchors). */
.tabbar{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.tabbar .tab{ text-decoration:none; }

/* vertical section nav — hub floorplan (6+ groups). Also real links. */
.anchor-nav{ display:flex; flex-direction:column; gap:2px; position:sticky; top:0; }
.anchor-nav .anchor{ text-decoration:none; }
.anchor{
  display:flex; align-items:center; gap:12px; height:var(--nav-h);
  padding:0 var(--ctl-px-sm); border-radius:var(--r-nav-item);
  font-size:var(--fs-sm); font-weight:600; color:var(--text-secondary); cursor:pointer;
  transition:background var(--t-fast), color var(--t-fast);
}
.anchor:hover{ background:var(--hover-strong); color:var(--text-primary); }
.anchor.on{ background:var(--card-bg); color:var(--text-primary); box-shadow:var(--sh-card); }
.anchor .ic{ width:var(--icon-inline); height:var(--icon-inline); flex:none; }
.anchor .badge{ margin-left:auto; }

/* ───────────────────────────────────────────────────────────────────────────
   9. FORM CONTROLS — sheets 11 (Padded inputs) + 12 (General Controls)
   ─────────────────────────────────────────────────────────────────────────── */
.field{ display:block; }
.label{ display:block; font-size:var(--fs-sm); font-weight:600; margin-bottom:8px; }
.help{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:8px; }
.help-err{ color:var(--error-ink); }

.ipt{
  display:block; width:100%; height:var(--ipt-h); padding:0 var(--ipt-px);
  border:1px solid var(--border); border-radius:var(--r-input);
  background:var(--card-bg); color:var(--text-primary); font-size:var(--fs-body);
  outline:none; transition:border-color var(--t-fast), box-shadow var(--t-fast);
}
/* ⭐ THE SMALL FIELD. The family WRITES this class — `me/inbox`'s search is
   `class="ipt ipt-sm" style="height:var(--ctl-h-sm)"` — and then declares it
   nowhere, so the class did nothing and the inline height did all the work.
   Declared here at exactly the height the screen inlines, so a caller writes the
   class alone and the surface's own density still governs. 2026-09-03. */
.ipt-sm{ height:var(--ctl-h-sm); }
.ipt::placeholder{ color:var(--text-placeholder); }
.ipt:hover:not(:focus){ border-color:var(--text-muted); }
.ipt:focus{ border-color:var(--primary); box-shadow:0 0 0 3px var(--focus-ring); }
.ipt:disabled{ background:var(--sunken-bg); color:var(--text-muted); cursor:not-allowed; }
textarea.ipt{ height:auto; min-height:calc(var(--ipt-h) * 2.4); padding:var(--ipt-px);
              line-height:var(--lh-body); resize:vertical; }
.ipt-err{ border-color:var(--error); background:var(--alert-err-bg); }
.ipt-ok { border-color:var(--success); }

select.ipt{
  appearance:none; padding-right:calc(var(--ipt-px) + 22px); cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238083A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 7 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right var(--ipt-px) center;
}
[data-theme="dark"] select.ipt{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236E7183' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 7 5 5 5-5'/%3E%3C/svg%3E");
}

/* input with a leading/trailing affordance */
.ipt-wrap{ position:relative; }
.ipt-wrap .ipt-lead,.ipt-wrap .ipt-trail{
  position:absolute; top:50%; transform:translateY(-50%);
  width:var(--icon-ctl); height:var(--icon-ctl); color:var(--text-muted); pointer-events:none;
}
.ipt-wrap .ipt-lead{ left:var(--ipt-px); }
.ipt-wrap .ipt-trail{ right:var(--ipt-px); }
.ipt-wrap.has-lead .ipt{ padding-left:calc(var(--ipt-px) * 2 + var(--icon-ctl)); }
.ipt-wrap.has-trail .ipt{ padding-right:calc(var(--ipt-px) * 2 + var(--icon-ctl)); }

/* checkbox / radio / switch — sheet 12 */
.cbx,.rdo{
  appearance:none; width:calc(var(--fs-body) + 8px); height:calc(var(--fs-body) + 8px);
  flex:none; background:var(--sunken-bg); border:none; cursor:pointer; position:relative;
  transition:background var(--t-fast);
}
.cbx{ border-radius:var(--r-check); }
.rdo{ border-radius:999px; }
.cbx:hover,.rdo:hover{ background:var(--skeleton-to); }
.cbx:checked{ background:var(--primary); }
.cbx:checked::after{
  content:''; position:absolute; left:34%; top:16%;
  width:26%; height:52%; border:solid #fff; border-width:0 2.5px 2.5px 0;
  transform:rotate(45deg);
}
.rdo:checked{ background:var(--primary); }
.rdo:checked::after{
  content:''; position:absolute; inset:0; margin:auto;
  width:34%; height:34%; border-radius:999px; background:#fff;
}
.rdo.danger:checked{ background:var(--error); }
.choice{ display:flex; align-items:center; gap:12px; cursor:pointer; font-size:var(--fs-body); }

.switch{
  appearance:none; width:calc(var(--fs-body) * 2.6); height:calc(var(--fs-body) * 1.5);
  border-radius:999px; background:var(--text-primary); position:relative; cursor:pointer;
  flex:none; border:none; transition:background var(--t-base) var(--ease);
}
.switch::after{
  content:''; position:absolute; top:12%; left:5%;
  width:calc(var(--fs-body) * 1.14); height:calc(var(--fs-body) * 1.14);
  border-radius:999px; background:#fff; transition:transform var(--t-base) var(--ease);
}
.switch:checked{ background:var(--primary); }
.switch:checked::after{ transform:translateX(calc(var(--fs-body) * 1.16)); }

/* counter / stepper — sheet 11 */
.stepper{ display:inline-flex; align-items:center; gap:12px; }
.stepper button{
  width:var(--icon-ctl); height:var(--icon-ctl); border-radius:999px; border:none;
  background:transparent; color:var(--text-primary); cursor:pointer; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
}
.stepper button:hover{ color:var(--primary); }

/* ───────────────────────────────────────────────────────────────────────────
   10. SURFACES
   ─────────────────────────────────────────────────────────────────────────── */
.card{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card); }
.card-pad{ padding:var(--sp-card); }
.card-raised{ box-shadow:var(--sh-raised); }
.card-bordered{ box-shadow:none; border:1px solid var(--border); }
.panel{ background:var(--card-bg); border-radius:var(--r-panel); box-shadow:var(--sh-card); overflow:hidden; }
.panel-hdr{
  display:flex; align-items:center; gap:12px;
  padding:var(--sp-panel-hdr-y) var(--sp-panel-hdr-x);
  border-bottom:1px solid var(--border);
}
.panel-hdr .t-h3{ flex:1; min-width:0; }
.panel-body{ padding:var(--sp-card); }
.divider{ height:1px; background:var(--border); border:none; margin:0; }

/* notice / alert */
.notice{
  display:flex; align-items:flex-start; gap:12px;
  padding:var(--sp-card-tight); border-radius:var(--r-panel);
  border:1px solid transparent; font-size:var(--fs-body);
}
.notice .ic{ width:var(--icon-ctl); height:var(--icon-ctl); flex:none; margin-top:2px; }
.notice-info{ background:var(--alert-info-bg); border-color:var(--alert-info-border); color:var(--alert-info-text); }
.notice-warn{ background:var(--alert-warn-bg); border-color:var(--alert-warn-border); color:var(--alert-warn-text); }
.notice-err { background:var(--alert-err-bg);  border-color:var(--alert-err-border);  color:var(--alert-err-text); }
.notice-ok  { background:var(--alert-ok-bg);   border-color:var(--alert-ok-border);   color:var(--alert-ok-text); }
.notice-locked{ opacity:.6; border-style:dashed; }
.notice-body{ flex:1; min-width:0; color:var(--text-secondary); }
.notice-title{ font-weight:600; color:var(--text-primary); }

/* ───────────────────────────────────────────────────────────────────────────
   11. TABLE — list-report content
   ─────────────────────────────────────────────────────────────────────────── */
.tbl{ width:100%; border-collapse:separate; border-spacing:0; font-size:var(--fs-body); }
.tbl th{
  padding:var(--head-py) var(--row-px); text-align:left;
  font-size:var(--fs-sm); font-weight:600; color:var(--text-primary);
  border-bottom:1px solid var(--border); white-space:nowrap; background:var(--card-bg);
  position:sticky; top:0; z-index:2;
}
.tbl td{
  padding:var(--row-py) var(--row-px);
  border-bottom:1px solid var(--border-subtle); vertical-align:middle;
}
.tbl tbody tr{ transition:background var(--t-fast); }
.tbl tbody tr.clickable{ cursor:pointer; }
.tbl tbody tr:hover{ background:var(--hover-bg); }
.tbl tbody tr.selected{ background:var(--primary-tint); }
.tbl tbody tr:last-child td{ border-bottom:none; }
.tbl .col-check{ width:calc(var(--row-px) * 2 + 24px); padding-right:0; }
.tbl .col-act{ width:calc(var(--ctl-h) + var(--row-px)); text-align:right; }
.th-sort{ display:inline-flex; align-items:center; gap:7px; cursor:pointer; }
.th-sort:hover{ color:var(--primary); }
.th-sort .ic{ width:var(--icon-inline); height:var(--icon-inline); opacity:.55; }
.th-sort.sorted .ic{ opacity:1; color:var(--primary); }

/* screen-archetypes.yaml: "below_1280 → hide low-priority columns".
   Mark a column .col-lo and it drops out before the table starts to crush.
   In centered mode the stage is narrower, so the breakpoint is on the table. */
@container stage (max-width: 1180px){ .col-lo{ display:none; } }
@media (max-width:1380px){ :root[data-width="centered"] .col-lo{ display:none; } }
@media (max-width:1180px){ .col-lo{ display:none; } }

/* the identity cell — thumb + title + subtitle */
.ident{ display:flex; align-items:center; gap:calc(var(--row-px) * .8); min-width:0; }
.ident-thumb{ width:var(--thumb); height:var(--thumb); border-radius:var(--r-thumb);
              object-fit:cover; background:var(--sunken-bg); flex:none; }
.ident-body{ min-width:0; }
.ident-title{ font-size:var(--fs-body); font-weight:600; line-height:1.3;
              white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ident-sub{ font-size:var(--fs-sm); color:var(--text-secondary); line-height:1.3; margin-top:1px;
            overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-density="compact"] .ident-sub{ display:none; }
[data-density="compact"] .ident-sub.always{ display:block; }

/* avatar stack */
.avstack{ display:flex; align-items:center; }

/* ⭐ The auth art panel centres its stack, and the family wrote it inline at the call
   site because the component had no way to say it. Declared, so `avatar-stack`'s
   `align: center` has a class behind it. 2026-09-03. */
.avstack-center{ justify-content:center; }
.avstack img{ width:var(--avatar); height:var(--avatar); border-radius:999px;
              border:2.5px solid var(--card-bg); object-fit:cover; }
.avstack img + img{ margin-left:calc(var(--avatar) * -.35); }
.av{ width:var(--avatar); height:var(--avatar); border-radius:999px; object-fit:cover; flex:none; }
.av-lg{ width:var(--avatar-lg); height:var(--avatar-lg); border-radius:999px; object-fit:cover; flex:none; }
.av-sm{ width:var(--avatar-sm); height:var(--avatar-sm); border-radius:999px; object-fit:cover; flex:none; }

/* ── ROW LIST — Revu's other list renderer (contacts, projects, tasks) ─────
   Not a table: no column headers, each row is its own card with a gap. Reads
   as a list of THINGS rather than a grid of VALUES. Preferred when a row has
   an identity worth looking at (a person, a vehicle, a job) and 3-5 facts
   rather than 8 comparable columns. */
.rowlist{ display:flex; flex-direction:column; gap:10px; }
.rowitem{ display:flex; align-items:center; gap:var(--sp-card-tight);
          background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
          padding:var(--sp-card-tight) var(--sp-card); cursor:pointer;
          transition:box-shadow var(--t-base), transform var(--t-base); }
.rowitem:hover{ box-shadow:var(--sh-raised); transform:translateY(-1px); }
.rowitem-body{ min-width:0; flex:1; }
.rowitem-title{ font-size:var(--fs-h3); font-weight:600; line-height:1.25; }
.rowitem-sub{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:3px; }
.rowitem-facts{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
/* the pill-wrapped datum Revu uses on its contact and project rows */
.datum{ display:inline-flex; align-items:center; gap:8px; height:var(--ctl-h-sm);
        padding:0 var(--ctl-px-sm); border-radius:var(--r-badge);
        border:1px solid var(--border); background:var(--card-bg);
        font-size:var(--fs-sm); color:var(--text-secondary); white-space:nowrap; }
.datum .ic{ color:var(--text-muted); }
.datum-plain{ border-color:transparent; background:var(--sunken-bg); }
@media (max-width:900px){ .rowitem{ flex-wrap:wrap; } }

/* attention queue (core/ui/components/desktop/AttentionQueue.js): the table of what waits on the viewer above 600 wide, the same items as cards below (a phone).
   Four columns and a row button do not fit 420 wide: they scrolled sideways and the button covered the second column. */
.aq-narrow{ display:none; padding:var(--sp-card-tight); }
.aq-card{ flex-wrap:wrap; cursor:default; }
.aq-card .rowitem-body{ flex:1 1 100%; }
@container stage (max-width:600px){ .aq-wide{ display:none; } .aq-narrow{ display:flex; } }
@media (max-width:600px){ .aq-wide{ display:none; } .aq-narrow{ display:flex; } }

/* progress bar — sheet 12 */
.bar{ height:6px; border-radius:999px; overflow:hidden; background:var(--sunken-bg); width:100%; }
.bar > span{ display:block; height:100%; border-radius:999px; background:var(--primary); }
.bar-emerald > span{ background:var(--sb-emerald-dot); }
.bar-amber > span{ background:var(--sb-amber-dot); }
.bar-rose > span{ background:var(--sb-rose-dot); }
.bar-slate > span{ background:var(--sb-slate-dot); }

/* pagination — sheet 12 */
.pager{ display:flex; align-items:center; justify-content:space-between; gap:12px;
        padding:var(--sp-panel-hdr-y) var(--sp-panel-hdr-x); border-top:1px solid var(--border); }
.pg{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:var(--ctl-h); min-width:var(--ctl-h); padding:0 var(--ctl-px-sm);
  border:1px solid var(--border); border-radius:var(--r-input);
  background:var(--card-bg); color:var(--text-primary);
  font-size:var(--fs-body); font-weight:600; cursor:pointer;
  transition:background var(--t-fast), border-color var(--t-fast);
}
.pg:hover:not(.off):not(.on){ background:var(--hover-bg); border-color:var(--text-muted); }
.pg.on{ background:var(--primary); color:#fff; border-color:var(--primary); }
.pg.off{ opacity:.4; cursor:not-allowed; }
.pg-nums{ display:flex; align-items:center; gap:6px; }

/* ───────────────────────────────────────────────────────────────────────────
   12. RECORD DISPLAY — kv pairs, highlights, stat rows
   ─────────────────────────────────────────────────────────────────────────── */
.kv{ padding:calc(var(--sp-field-gap) * .8) 0; border-bottom:1px solid var(--border); }
.kv:last-child{ border-bottom:none; }
.kv-label{ font-size:var(--fs-sm); color:var(--text-secondary); margin-bottom:5px; }

/* ⭐ RECORD PAGES: detail grids that read at a glance. A label is small, upper-case and heavy, so it stops
   competing with the value; a value's glyph sits in a tinted chip in the primary colour, so the key facts
   of the record are the first thing the eye lands on. Scoped to the record archetype — a kv grid in a drawer
   or a dialog keeps the family's quieter default. */
.stage[data-archetype="record"] .kv-label{ font-size:var(--fs-micro); font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-secondary); }
.stage[data-archetype="record"] .kv-value{ gap:10px; }
.stage[data-archetype="record"] .kv-value > .ic{ flex:none; box-sizing:content-box; width:var(--icon-inline); height:var(--icon-inline); padding:6px; border-radius:var(--r-button); background:var(--primary-tint); color:var(--primary); }
.stage[data-archetype="record"] .panel-hdr .t-h3{ font-weight:700; }
.kv-value{ font-size:var(--fs-body); font-weight:600; display:flex; align-items:center; gap:8px; }
.kv-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:calc(var(--sp-card) * 1.6); }
.kv-grid-1{ grid-template-columns:minmax(0,1fr); }
.kv-grid-3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
.kv-grid-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.kv-hint{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:4px;
          font-weight:400; line-height:var(--lh-body); }

/* highlight strip — the 3-5 facts (PAGE-SHAPE §2) */
.highlights{ display:grid; gap:var(--sp-card-gap);
             grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.highlight{ background:var(--card-bg); border-radius:var(--r-panel);
            padding:var(--sp-card-tight); box-shadow:var(--sh-card); }
.highlight-label{ display:flex; align-items:center; gap:7px;
                  font-size:var(--fs-sm); color:var(--text-secondary); margin-bottom:6px; }
.highlight-label .ic{ width:var(--icon-inline); height:var(--icon-inline); }
.highlight-value{ font-size:var(--fs-h3); font-weight:600; }

/* stat rows — the Revu profile rail */
.stat-row{ display:flex; align-items:flex-start; gap:12px;
           padding:calc(var(--sp-field-gap) * .85) 0; border-bottom:1px solid var(--border); }
.stat-row:last-child{ border-bottom:none; }
.stat-row-body{ flex:1; min-width:0; }
.stat-row-label{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:3px; }
.trend-up{ color:var(--success-ink); }
.trend-down{ color:var(--error-ink); }

/* stat / KPI tile — dashboard */
.tile{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
       padding:var(--sp-card); display:flex; flex-direction:column; gap:10px;
       cursor:pointer; transition:box-shadow var(--t-base), transform var(--t-base); }
.tile:hover{ box-shadow:var(--sh-raised); transform:translateY(-2px); }
.tile-static{ cursor:default; }
.tile-static:hover{ box-shadow:var(--sh-card); transform:none; }
.tile-hdr{ display:flex; align-items:center; gap:10px; font-size:var(--fs-sm);
           color:var(--text-secondary); }
.tile-hdr .ic{ width:var(--icon-inline); height:var(--icon-inline); }
.tile-foot{ display:flex; align-items:center; gap:8px; font-size:var(--fs-sm);
            color:var(--text-secondary); margin-top:auto; padding-top:6px; }

/* card tile for grid list views */
.rec-card{ background:var(--card-bg); border-radius:var(--r-card); overflow:hidden;
           box-shadow:var(--sh-card); cursor:pointer; display:block;
           transition:box-shadow var(--t-base), transform var(--t-base); }
.rec-card:hover{ box-shadow:var(--sh-raised); transform:translateY(-2px); }
.rec-card-media{ width:100%; aspect-ratio:16/10; object-fit:cover; background:var(--sunken-bg); }
.rec-card-body{ padding:var(--sp-card-tight); }

/* quick-links / launchpad tile */
.launch{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
         padding:var(--sp-card); display:flex; flex-direction:column; gap:12px;
         cursor:pointer; transition:box-shadow var(--t-base), transform var(--t-base);
         min-height:100%; }
.launch:hover{ box-shadow:var(--sh-raised); transform:translateY(-3px); }
.launch-mark{ width:calc(var(--icon-hero) * 1.9); height:calc(var(--icon-hero) * 1.9);
              border-radius:var(--r-panel); display:flex; align-items:center; justify-content:center;
              flex:none; }
.launch-mark .ic{ width:var(--icon-hero); height:var(--icon-hero); }

/* timeline */
.tl{ position:relative; padding-left:calc(var(--icon-ctl) + 20px); }
.tl::before{ content:''; position:absolute; top:10px; bottom:10px;
             left:calc((var(--icon-ctl) + 12px) / 2 - 1px); width:2px; background:var(--border); }
.tl-item{ position:relative; padding-bottom:var(--sp-card); }
.tl-item:last-child{ padding-bottom:0; }
.tl-dot{ position:absolute; left:calc((var(--icon-ctl) + 20px) * -1); top:0;
         width:calc(var(--icon-ctl) + 12px); height:calc(var(--icon-ctl) + 12px);
         border-radius:999px; display:flex; align-items:center; justify-content:center;
         background:var(--card-bg); box-shadow:0 0 0 2px var(--border) inset; }
.tl-dot .ic{ width:var(--icon-activity); height:var(--icon-activity); color:var(--text-secondary); }
.tl-title{ font-size:var(--fs-body); font-weight:600; }
.tl-meta{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:3px; }

/* ───────────────────────────────────────────────────────────────────────────
   13. SHELL — sidebar · topbar · stage · footer
   ─────────────────────────────────────────────────────────────────────────── */
.shell{ display:flex; height:100vh; overflow:hidden; }

.sidebar{
  width:var(--sidebar-w); flex:none; background:var(--sidebar-bg);
  border-right:1px solid var(--border); display:flex; flex-direction:column;
  position:relative; transition:width var(--t-slow) var(--ease);
}
/* ⭐ BOTH HALVES, `:root[…]` THEN `[…]` — the family's own convention, as
   [data-theme] and [data-scheme] are written. The root half wins specificity at
   the root; the bare half is what lets the axis NEST, so a surface can pin its
   own. nav and width were the only two written against :root ALONE, so a sidebar
   could not be collapsed for one surface. Measured and fixed 2026-09-03.
   ⛔ AND `.brand-word` MATCHED NOTHING — the mark's class is `.brandmark-word`
   (see .brandmark, below), so the wordmark overflowed a 60px rail with no error,
   correct DOM, and nothing obviously wrong in the rule. Both names are listed;
   the short one stays for a caller that already writes it. */
:root[data-nav="collapsed"] .sidebar,
[data-nav="collapsed"] .sidebar{ width:var(--sidebar-w-collapsed); }
:root[data-nav="collapsed"] .sidebar .nav-label,
:root[data-nav="collapsed"] .sidebar .nav-group,
:root[data-nav="collapsed"] .sidebar .brand-word,
:root[data-nav="collapsed"] .sidebar .brandmark-word,
:root[data-nav="collapsed"] .sidebar .nav .badge,
:root[data-nav="collapsed"] .sidebar .user-name,
[data-nav="collapsed"] .sidebar .nav-label,
[data-nav="collapsed"] .sidebar .nav-group,
[data-nav="collapsed"] .sidebar .brand-word,
[data-nav="collapsed"] .sidebar .brandmark-word,
[data-nav="collapsed"] .sidebar .nav .badge,
[data-nav="collapsed"] .sidebar .user-name{ display:none; }
:root[data-nav="collapsed"] .sidebar .nav,
[data-nav="collapsed"] .sidebar .nav{ justify-content:center; padding:0; }

.brand{ display:flex; align-items:center; gap:12px;
        padding:var(--sp-card-tight) var(--ctl-px-sm) 4px; }

/* ── brandmark — the one APPLICATION-WIDE visual partial ──────────────────
   Every surface renders it identically, which is exactly why it may live at
   pages/_private/partials while a sidebar or a tab bar may not. */
.brandmark{ display:inline-flex; align-items:center; gap:12px; }
.brandmark-icon{ border-radius:var(--r-avatar-brand); flex:none; display:flex;
                 align-items:center; justify-content:center;
                 background:linear-gradient(135deg,#6E6BFF 0%,#0052FF 45%,#F66254 100%); }
.brandmark-icon span{ width:38%; height:38%; border-radius:999px; background:rgba(255,255,255,.92); }
.brandmark-word{ font-weight:700; letter-spacing:-.02em; }
.brandmark-sm .brandmark-icon{ width:28px; height:28px; }
.brandmark-sm .brandmark-word{ font-size:var(--fs-h3); }
.brandmark-md .brandmark-icon{ width:calc(var(--icon-nav) * 2.2); height:calc(var(--icon-nav) * 2.2); }
.brandmark-md .brandmark-word{ font-size:var(--fs-h1); }
.brandmark-lg .brandmark-icon{ width:60px; height:60px; border-radius:16px; }
.brandmark-lg .brandmark-word{ font-size:var(--fs-display); }

.nav-scroll{ flex:1; overflow-y:auto; overflow-x:hidden; padding-bottom:var(--sp-card-tight); }
.nav-group{ font-size:var(--fs-sm); color:var(--sidebar-section);
            padding:0 var(--ctl-px-sm); margin:var(--sp-card-tight) 0 6px; }
.nav{
  display:flex; align-items:center; gap:12px; height:var(--nav-h);
  padding:0 var(--ctl-px-sm); margin:0 8px; border-radius:var(--r-nav-item);
  font-size:var(--fs-body); font-weight:600; color:var(--sidebar-text);
  cursor:pointer; position:relative; transition:background var(--t-fast);
}
.nav:hover{ background:var(--sidebar-hover-bg); }
.nav.on{ background:var(--sidebar-active-bg); }
.nav.on::after{
  content:''; position:absolute; right:-9px; top:6px; bottom:6px; width:4px;
  border-radius:999px; background:var(--sidebar-active-bar);
}
.nav .ic{ width:var(--icon-nav); height:var(--icon-nav); flex:none; }
.nav .badge{ margin-left:auto; }
.nav-label{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav .av-sm{ width:calc(var(--icon-nav) * 1.5); height:calc(var(--icon-nav) * 1.5); }

.sidebar-foot{ border-top:1px solid var(--border); padding:var(--ctl-px-sm);
               display:flex; align-items:center; gap:12px; }
.user-name{ flex:1; min-width:0; font-size:var(--fs-body); font-weight:600;
            overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.main{ 
  flex:1; 
  min-width:0; 
  display:flex; 
  flex-direction:column; 
  /* background:var(--card-bg);  */
}

.topbar{
  min-height:var(--topbar-h); flex:none; display:flex; align-items:center;
  gap:var(--sp-button-gap); padding:14px var(--sp-page);
  border-bottom:1px solid var(--border); background:var(--card-bg);
}
/* the overflow menu anchors to its own button, so a topbar that grows with
   breadcrumbs + facts cannot push it out of alignment */
.act-wrap{ position:relative; display:inline-flex; }
.act-wrap .popover{ position:absolute; top:calc(100% + 8px); right:0; z-index:40; }
.topbar-title{ flex:1; min-width:0; }
.topbar-sub{ display:flex; align-items:center; gap:10px; margin-top:4px;
             font-size:var(--fs-sm); color:var(--text-secondary); flex-wrap:wrap; }
.topbar-sub .sep{ width:4px; height:4px; border-radius:999px; background:var(--text-muted); flex:none; }

/* `.subbar` was REMOVED 2026-09-03, and with it the `page.subbar` hook the family's own
   topbar declared. INVENTORY §3.6 called it "declared and unwired rather than dead" — a
   real hook that no page sets — and §4.4 then took the decision that the fifteen unwired
   classes are not in the component set. `topbar` ships as ONE bar (INVENTORY §2a), so a
   second bar under it had no component to belong to and no caller to set it. Removing the
   rule closes the hook rather than leaving an address a page could still write to and get
   nothing back from. A page that later needs a second bar gets a component, decided then.
   ⚠️ CORRECTED 2026-09-03: an earlier note here said `--topbar-h-sub` is now read by
   nothing. ⛔ THAT WAS WRONG — `kit/portals.html` reads it, so the token is LIVE and the
   three declarations are load-bearing, not residue. `.subbar` was not its only consumer.
   The declarations stay because they are used; `src/…/shell/topbar.html:53` still
   emits `page.subbar` as raw HTML, which a page would have to style itself, so the hook
   without the class is inert rather than broken. That file is the family's own template and
   is outside this boundary. */

.scroller{ flex:1; overflow-y:auto; background:var(--page-bg); }

.pagefoot{
  display:flex; align-items:center; gap:calc(var(--sp-page) * .8);
  padding:var(--sp-card-tight) var(--sp-page); flex-wrap:wrap;
  font-size:var(--fs-body);
}
.pagefoot a{ color:var(--text-secondary); }
.pagefoot a:hover{ color:var(--text-primary); text-decoration:underline; }

/* breadcrumb */
.crumbs{ display:flex; align-items:center; gap:8px; font-size:var(--fs-sm);
         color:var(--text-secondary); flex-wrap:wrap; }
.crumbs a:hover{ color:var(--primary); text-decoration:underline; }
.crumbs .ic{ width:var(--icon-inline); height:var(--icon-inline); opacity:.5; }

/* two-column record layout */
.rec-layout{ display:grid; grid-template-columns:minmax(0,1fr) var(--rail-w);
             gap:var(--sp-card-gap); align-items:start; }
.hub-layout{ display:grid; grid-template-columns:240px minmax(0,1fr);
             gap:var(--sp-card-gap); align-items:start; }
[data-density="compact"] .hub-layout{ grid-template-columns:200px minmax(0,1fr); }
.stack{ display:flex; flex-direction:column; gap:var(--sp-section-gap); }
.stack-sm{ display:flex; flex-direction:column; gap:var(--sp-card-gap); }

@media (max-width:1200px){
  .rec-layout{ grid-template-columns:minmax(0,1fr); }
  .hub-layout{ grid-template-columns:minmax(0,1fr); }
}

/* ───────────────────────────────────────────────────────────────────────────
   14. OVERLAYS — dialog · drawer · popover · toast
   ─────────────────────────────────────────────────────────────────────────── */
.scrim{ position:fixed; inset:0; background:var(--scrim); z-index:60; }
.dialog-wrap{ position:fixed; inset:0; z-index:61; display:flex;
              align-items:center; justify-content:center; padding:var(--sp-page);
              pointer-events:none; }
.dialog{
  background:var(--card-bg); border-radius:var(--r-modal); box-shadow:var(--sh-modal);
  width:100%; max-height:86vh; display:flex; flex-direction:column;
  pointer-events:auto; overflow:hidden;
}
.dialog-sm{ max-width:440px; }
.dialog-md{ max-width:600px; }
.dialog-lg{ max-width:840px; }
.dialog-hdr{ display:flex; align-items:flex-start; gap:12px;
             padding:var(--sp-card) var(--sp-card) var(--sp-card-tight); }
.dialog-hdr-bordered{ border-bottom:1px solid var(--border); padding-bottom:var(--sp-card); }
/* Symmetric, plainly: body needs its own breathing room against BOTH
   dividers, not a clever asymmetry reasoned from what a neighbor
   "already provides" — two earlier versions of this rule each tried a
   different asymmetric shortcut (zero top, then zero bottom) and both
   left one edge of the content touching its divider with no gap at all.
   The header's own padding and the footer's own padding are each a
   SEPARATE, legitimate gap on their own side of the line (lede-to-line
   inside the header; line-to-buttons inside the footer) — body having
   its own matching var(--sp-card) on top AND bottom isn't "double
   padding", it's the same pattern applied consistently on both sides. */
.dialog-body{ padding:var(--sp-card); overflow-y:auto; flex:1; }
.dialog-body-pad{ padding:var(--sp-card); }
.dialog-foot{ display:flex; align-items:center; gap:var(--sp-action-row-gap);
              padding:var(--sp-card); border-top:1px solid var(--border); }
.dialog-icon{ width:calc(var(--icon-hero) * 1.7); height:calc(var(--icon-hero) * 1.7);
              border-radius:var(--r-panel); display:flex; align-items:center;
              justify-content:center; flex:none; }
.dialog-icon .ic{ width:var(--icon-hero); height:var(--icon-hero); }

.drawer{ position:fixed; top:0; right:0; bottom:0; width:var(--drawer-w); max-width:100vw;
         background:var(--card-bg); box-shadow:var(--sh-drawer); z-index:61;
         display:flex; flex-direction:column; }
.drawer-md{ width:calc(var(--drawer-w) * 1.4); }
.drawer-lg{ width:calc(var(--drawer-w) * 1.85); }
.drawer-hdr{ display:flex; align-items:center; gap:12px; flex:none;
             padding:var(--sp-card-tight) var(--sp-card); border-bottom:1px solid var(--border); }
.drawer-body{ flex:1; overflow-y:auto; padding:var(--sp-card); }
.drawer-foot{ flex:none; display:flex; align-items:center; justify-content:flex-end; gap:var(--sp-action-row-gap);
              padding:var(--sp-card); border-top:1px solid var(--border); }
.drawer-foot .btn{ min-width:120px; justify-content:center; }

.popover{ background:var(--card-bg); border-radius:var(--r-panel); box-shadow:var(--sh-dropdown);
          border:1px solid var(--border); padding:8px; min-width:240px; z-index:62; }
.menu-item{ display:flex; align-items:center; gap:12px; width:100%;
            height:var(--ctl-h-sm); padding:0 12px; border:none; background:none;
            border-radius:var(--r-nav-item); font-size:var(--fs-sm); font-weight:500;
            color:var(--text-primary); cursor:pointer; text-align:left;
            transition:background var(--t-fast); }
.menu-item:hover{ background:var(--hover-strong); }
.menu-item .ic{ width:var(--icon-inline); height:var(--icon-inline); flex:none;
                color:var(--text-secondary); }
.menu-item.danger{ color:var(--error-ink); }
.menu-item.danger .ic{ color:var(--error-ink); }
.menu-sep{ height:1px; background:var(--border); margin:6px 0; }
.menu-label{ font-size:var(--fs-micro); color:var(--text-muted); padding:8px 12px 4px;
             text-transform:uppercase; letter-spacing:.07em; font-weight:600; }

/* A KEY CAP. The family declares it in the portals screen's own <style> block
   and `cmd-palette` carried a second copy, because the palette draws sixteen of
   them and nothing else did. It is here rather than in either because a
   keyboard shortcut is not page decoration: the palette is application chrome
   that a real portal draws on every page, and a shortcut list belongs beside
   it. ⭐ Every literal the family wrote has a token: the cap is `--ctl-h-xs`
   scaled, so it shrinks with the density axis instead of standing still. */
.kbd{ display:inline-flex; align-items:center; justify-content:center;
      min-width:calc(var(--ctl-h-xs) * .85); height:calc(var(--ctl-h-xs) * .85);
      padding:0 calc(var(--ctl-px-sm) * .6); border-radius:calc(var(--r-button) * .6);
      background:var(--sunken-bg); border:1px solid var(--border); border-bottom-width:2px;
      font-family:var(--font-mono); font-size:var(--fs-micro);
      color:var(--text-secondary); font-weight:600; }

.toast{ display:flex; align-items:flex-start; gap:12px; background:var(--card-bg);
        border-radius:var(--r-panel); box-shadow:var(--sh-toast); padding:var(--sp-card-tight);
        border:1px solid var(--border); min-width:320px; max-width:420px; }
/* A toast's mark is a SMALLER dialog-icon. kit/dialogs writes width:36px;height:36px
   over .dialog-icon's own calc(var(--icon-hero) * 1.7); --icon-hero is 26px at default
   density, so * 1.385 is 36.0px — the same mark, now on the density axis. Declared here
   rather than as a `toast-mark` class so the toast composes `icon-circle` like everything
   else that draws this idea. */
.toast .dialog-icon{ width:calc(var(--icon-hero) * 1.385);
                     height:calc(var(--icon-hero) * 1.385); }

/* A HEADING icon: the 36px tinted glyph beside the title of a FORM dialog, a picker or a drawer (2026-10-12; plans/feature-phr-core-updates.md W5).
   The same mark as a toast's, so it follows the density axis. It does NOT make the dialog a "decision": the header keeps its border and its close button.
   A decision dialog uses the full-size .dialog-icon. */
.dialog-icon-sm{ width:calc(var(--icon-hero) * 1.385); height:calc(var(--icon-hero) * 1.385);
                 border-radius:var(--r-panel); display:flex; align-items:center; justify-content:center; flex:none; }
.dialog-icon-sm .ic{ width:calc(var(--icon-hero) * 0.77); height:calc(var(--icon-hero) * 0.77); }

/* ── RECORD PICKER (2026-10-12; plans/feature-phr-core-updates.md W6) ─────────────────────────────────────────────────────────────────────────────
   The field (what is chosen + a button) lives in the form; the dialog is a NATIVE <dialog>, so it opens in the browser's top layer and works the same inside
   a form, a drawer or another dialog — no z-index to win, no transformed ancestor to break `position:fixed`. It wears the kit's own dialog classes
   (.dialog, .dialog-hdr, .dialog-body, .dialog-foot); only the shell around them is here. */
.picker-selection{ display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.picker-chip{ display:flex; align-items:center; gap:10px; padding:8px 12px; border:1px solid var(--border); border-radius:var(--r-panel);
              background:var(--card-bg); }
.picker-chip .picker-pos{ min-width:20px; text-align:center; font-weight:600; font-variant-numeric:tabular-nums; color:var(--text-muted, inherit); }
.picker-chip .picker-chip-actions{ display:flex; gap:2px; margin-left:auto; }
.picker-chip .picker-chip-actions button{ min-width:28px; min-height:28px; border:0; background:transparent; border-radius:var(--r-panel); cursor:pointer; color:inherit; }
.picker-chip .picker-chip-actions button:hover:not(:disabled){ background:var(--hover-bg); }
.picker-chip .picker-chip-actions button:disabled{ opacity:.35; cursor:default; }
dialog.picker-native{ border:0; padding:0; margin:0; background:transparent; color:inherit; max-width:100vw; max-height:100vh; width:100vw; height:100vh; overflow:visible; }
dialog.picker-native[open]{ display:flex; align-items:flex-start; justify-content:center; padding:8vh var(--sp-page) 0; }
dialog.picker-native::backdrop{ background:var(--scrim); }
dialog.picker-native .dialog{ max-height:80vh; }
.picker-row{ display:flex; align-items:center; gap:12px; padding:12px; border-radius:var(--r-panel); cursor:pointer; }
.picker-row:hover{ background:var(--hover-bg); }
.picker-row.is-disabled{ cursor:not-allowed; opacity:.55; }
.picker-row.is-disabled:hover{ background:transparent; }

/* The row-level confirm — a tinted strip carrying a question and two small buttons,
   for a row action where a modal would be heavier than the decision. kit/dialogs draws
   it with the whole rule inline on a `.row gap-sm`; the tone's ground and border-colour
   stay inline because the component maps them from `tone`, so only the geometry is here. */
.inline-confirm{ padding:var(--sp-button-gap) var(--sp-action-row-gap);
                 border:1px solid; border-radius:var(--r-panel); }

/* ───────────────────────────────────────────────────────────────────────────
   15. STATES — empty · loading · error
   ─────────────────────────────────────────────────────────────────────────── */
.empty{ display:flex; flex-direction:column; align-items:center; text-align:center;
        gap:12px; padding:calc(var(--sp-page) * 1.8) var(--sp-page); }
.empty-mark{ width:calc(var(--icon-hero) * 2.4); height:calc(var(--icon-hero) * 2.4);
             border-radius:999px; background:var(--sunken-bg); display:flex;
             align-items:center; justify-content:center; margin-bottom:4px; }
.empty-mark .ic{ width:var(--icon-hero); height:var(--icon-hero); color:var(--text-muted); }
.empty-title{ font-size:var(--fs-h2); font-weight:700; }
.empty-body{ font-size:var(--fs-body); color:var(--text-secondary); max-width:44ch; }

.skel{ background:linear-gradient(90deg,var(--skeleton-from),var(--skeleton-to),var(--skeleton-from));
       background-size:200% 100%; animation:shimmer 1.4s linear infinite; border-radius:6px; }
@keyframes shimmer{ 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }
.skel-line{ height:calc(var(--fs-body) * .9); }
.skel-title{ height:calc(var(--fs-h2) * .9); }

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
  .skel{ animation:none; }
}

/* ───────────────────────────────────────────────────────────────────────────
   16. UTILITIES — a deliberately small set
   ─────────────────────────────────────────────────────────────────────────── */
.row{ display:flex; align-items:center; gap:var(--sp-button-gap); }
.row-wrap{ flex-wrap:wrap; }
.col{ display:flex; flex-direction:column; }
.gap-sm{ gap:var(--sp-button-gap); }
.gap-md{ gap:var(--sp-action-row-gap); }
.gap-lg{ gap:var(--sp-card-gap); }
.grow{ flex:1; min-width:0; }
.push{ margin-left:auto; }
.grid2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-card-gap); }
.grid3{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--sp-card-gap); }
.grid4{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--sp-card-gap); }
.grid-auto{ display:grid; gap:var(--sp-card-gap);
            grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.fields{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
         gap:var(--sp-field-gap); }
.fields-1{ grid-template-columns:minmax(0,1fr); }
.span2{ grid-column:1 / -1; }
/* ⭐ A SPAN OF EXACTLY N COLUMNS — 2026-09-08. `.span2` is 1 / -1, which is EVERY column,
   and the sheet had no way to say "two of the four". A three-pane editor is 1 : 2 : 1 and
   could not be expressed: the middle pane took the whole row and the two rails fell under
   it. Named `.span-2` rather than overloading `.span2`, whose meaning is full-width and is
   used by every two-column form. */
.span-2{ grid-column:span 2; }
.span-3{ grid-column:span 3; }
@media (max-width:900px){
  .grid3,.grid4,.grid2,.fields{ grid-template-columns:minmax(0,1fr); }
  .span-2,.span-3{ grid-column:auto; }
}
.ic{ width:var(--icon-inline); height:var(--icon-inline); flex:none; }
.sticky-top{ position:sticky; top:0; }


/* ── nested sample scopes (the kit page renders scales side by side) ────── */
[data-density]:not(:root),
[data-theme]:not(:root){ color:var(--text-primary); }
.sample{ background:var(--page-bg); border-radius:var(--r-card);
         padding:var(--sp-card); border:1px solid var(--border); }


/* ── colour scheme picker (display menu) ───────────────────────────────── */
.scheme-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:10px; }
.scheme{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:9px 4px;
         border:1px solid transparent; border-radius:var(--r-nav-item); background:transparent;
         cursor:pointer; font-size:var(--fs-micro); font-weight:600; color:var(--text-secondary);
         transition:background var(--t-fast), border-color var(--t-fast); }
.scheme:hover{ background:var(--hover-strong); }
.scheme span{ width:24px; height:24px; border-radius:999px; display:block;
              box-shadow:0 0 0 1px rgba(0,0,0,.08) inset; }
.scheme.on{ border-color:var(--primary); background:var(--primary-tint); color:var(--text-primary); }
.seg-block{ width:100%; margin-bottom:10px; }
.seg-block > button{ flex:1; justify-content:center; }


/* ── bulk action bar (list floorplan) ──────────────────────────────────── */
.bulkbar{ position:sticky; bottom:var(--sp-card); z-index:5; margin:0 auto;
          display:flex; align-items:center; gap:var(--sp-action-row-gap);
          background:var(--text-primary); color:var(--card-bg);
          border-radius:var(--r-button); padding:10px 14px; box-shadow:var(--sh-modal);
          width:fit-content; }
.bulkbar .btn-sec{ background:transparent; color:var(--card-bg);
                   border-color:rgba(255,255,255,.28); }
.bulkbar .btn-sec:hover{ background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.5); }

/* ═══════════════════════════════════════════════════════════════════════════
   17. THE OTHER REVU SCREEN FAMILIES
   Kanban, chat, mail and the activity feed. All density-aware like everything
   else — nothing below hard-codes a size.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── kanban ─────────────────────────────────────────────────────────────── */
.board{ display:flex; gap:var(--sp-card-gap); align-items:flex-start;
        overflow-x:auto; padding-bottom:var(--sp-card); }
.board-col{ flex:0 0 300px; display:flex; flex-direction:column; gap:10px; }
[data-density="compact"] .board-col{ flex-basis:250px; }
[data-density="roomy"]   .board-col{ flex-basis:340px; }
.board-hdr{ display:flex; align-items:center; gap:8px; padding:0 4px 2px; }
.board-hdr .t-h3{ flex:1; min-width:0; }
.board-drop{ display:flex; flex-direction:column; gap:10px; min-height:70px;
             border-radius:var(--r-card); padding:2px; }
.kcard{ background:var(--card-bg); border-radius:var(--r-panel); box-shadow:var(--sh-card);
        padding:var(--sp-card-tight); display:flex; flex-direction:column; gap:10px;
        cursor:grab; transition:box-shadow var(--t-base), transform var(--t-base); }
.kcard:hover{ box-shadow:var(--sh-raised); transform:translateY(-2px); }
.kcard-title{ font-size:var(--fs-body); font-weight:600; line-height:1.35; }
.kcard-foot{ display:flex; align-items:center; gap:8px; font-size:var(--fs-sm);
             color:var(--text-secondary); }
.kcard-add{ display:flex; align-items:center; justify-content:center; gap:8px;
            border:2px dashed var(--border); border-radius:var(--r-panel);
            padding:var(--sp-card-tight); color:var(--text-secondary);
            font-size:var(--fs-sm); font-weight:600; cursor:pointer;
            transition:border-color var(--t-fast), color var(--t-fast); }
.kcard-add:hover{ border-color:var(--primary); color:var(--primary); }

/* ── split view: master list + reader (mail, chat) ──────────────────────── */
.split{ display:grid; grid-template-columns:var(--split-w, 380px) minmax(0,1fr);
        gap:0; background:var(--card-bg); border-radius:var(--r-card);
        box-shadow:var(--sh-card); overflow:hidden; height:calc(100vh - var(--topbar-h) - var(--sp-page) * 3); }
[data-density="compact"] .split{ --split-w:320px; }
[data-density="roomy"]   .split{ --split-w:430px; }
.split-master{ border-right:1px solid var(--border); display:flex; flex-direction:column; min-width:0; }
.split-detail{ display:flex; flex-direction:column; min-width:0; }
.split-hdr{ padding:var(--sp-panel-hdr-y) var(--sp-panel-hdr-x);
            border-bottom:1px solid var(--border); display:flex; align-items:center;
            gap:10px; flex:none; }
.split-body{ flex:1; overflow-y:auto; }
@media (max-width:1100px){ .split{ grid-template-columns:minmax(0,1fr); }
                           .split-master{ border-right:none; border-bottom:1px solid var(--border); } }

.mailrow{ display:flex; gap:12px; padding:var(--sp-card-tight) var(--sp-panel-hdr-x);
          border-bottom:1px solid var(--border-subtle); cursor:pointer;
          transition:background var(--t-fast); }
.mailrow:hover{ background:var(--hover-bg); }
.mailrow.on{ background:var(--primary-tint); box-shadow:inset 3px 0 0 var(--primary); }
.mailrow.unread .mailrow-from{ font-weight:700; }
.mailrow.unread .mailrow-subj{ color:var(--text-primary); font-weight:600; }
.mailrow-from{ font-size:var(--fs-body); font-weight:500; }
.mailrow-subj{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:2px; }
.mailrow-snip{ font-size:var(--fs-sm); color:var(--text-muted); margin-top:2px;
               overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── chat ───────────────────────────────────────────────────────────────── */
.chat-stream{ flex:1; overflow-y:auto; padding:var(--sp-card);
              display:flex; flex-direction:column; gap:14px; }
.bubble{ max-width:64%; padding:12px 16px; border-radius:var(--r-card);
         font-size:var(--fs-body); line-height:var(--lh-body); }
.bubble-them{ align-self:flex-start; background:var(--sunken-bg); color:var(--text-primary);
              border-bottom-left-radius:6px; }
.bubble-me{ align-self:flex-end; background:var(--primary); color:var(--on-primary);
            border-bottom-right-radius:6px; }
.bubble-meta{ font-size:var(--fs-micro); color:var(--text-muted); margin-top:5px; }
.bubble-me + .bubble-meta{ align-self:flex-end; }
.chat-day{ align-self:center; font-size:var(--fs-micro); color:var(--text-muted);
           background:var(--sunken-bg); padding:4px 12px; border-radius:999px; }
.composer{ flex:none; border-top:1px solid var(--border); padding:var(--sp-card-tight);
           display:flex; align-items:flex-end; gap:10px; }

/* ── activity feed ──────────────────────────────────────────────────────── */
.post{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
       padding:var(--sp-card); }
.post-hdr{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.post-media{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:14px; }
.post-media img{ width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:var(--r-panel);
                 background:var(--sunken-bg); }
.post-actions{ display:flex; align-items:center; gap:var(--sp-card);
               margin-top:14px; padding-top:12px; border-top:1px solid var(--border-subtle); }
.post-action{ display:inline-flex; align-items:center; gap:8px; font-size:var(--fs-sm);
              font-weight:600; color:var(--text-secondary); background:none; border:none;
              cursor:pointer; padding:0; transition:color var(--t-fast); }
.post-action:hover{ color:var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   18. THE QUERY-SHAPED RENDERERS
   Calendar, gantt, map and pivot. Unlike row/table/card these cannot be a
   client-side toggle — each needs a DIFFERENT QUERY (a date window, a start+end
   pair, coordinates, an aggregation), so each is its own route with its own
   loader. Density-aware like everything else.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── calendar — Revu calendar1, month grid ──────────────────────────────── */
.cal{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
      overflow:hidden; }
.cal-head{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr));
           border-bottom:1px solid var(--border); }
.cal-head div{ padding:var(--sp-panel-hdr-y) var(--sp-card-tight); text-align:center;
               font-size:var(--fs-sm); font-weight:600; color:var(--text-secondary); }
.cal-grid{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.cal-day{ min-height:132px; border-right:1px solid var(--border);
          border-bottom:1px solid var(--border); padding:10px;
          display:flex; flex-direction:column; gap:6px; }
[data-density="compact"] .cal-day{ min-height:96px; padding:7px; }
[data-density="roomy"]   .cal-day{ min-height:170px; padding:14px; }
.cal-grid > .cal-day:nth-child(7n){ border-right:none; }
.cal-grid > .cal-day:nth-last-child(-n+7){ border-bottom:none; }
.cal-num{ font-size:var(--fs-sm); font-weight:600; text-align:right; color:var(--text-primary); }
.cal-day.out .cal-num{ color:var(--text-muted); }
.cal-day.out{ background:var(--page-bg); }
.cal-day.today .cal-num{ display:inline-flex; align-items:center; justify-content:center;
   width:26px; height:26px; border-radius:999px; background:var(--primary); color:var(--on-primary);
   margin-left:auto; }
.cal-ev{ display:flex; align-items:center; gap:7px; padding:5px 10px; border-radius:999px;
         background:var(--sunken-bg); font-size:var(--fs-sm); font-weight:600;
         cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
         transition:filter var(--t-fast); }
.cal-ev:hover{ filter:brightness(.96); }
.cal-ev .dot{ width:8px; height:8px; border-radius:999px; flex:none; }
.cal-ev.sky{ background:var(--sb-sky-bg); color:var(--sb-sky-text); }
.cal-ev.amber{ background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.cal-ev.rose{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.cal-ev.emerald{ background:var(--sb-emerald-bg); color:var(--sb-emerald-text); }
.cal-more{ display:flex; align-items:center; gap:7px; font-size:var(--fs-sm);
           color:var(--text-secondary); cursor:pointer; padding:2px 4px; }
.cal-more:hover{ color:var(--primary); }
@media (max-width:900px){ .cal-day{ min-height:84px; } .cal-ev{ font-size:var(--fs-micro); } }

/* ── gantt — Revu gantt1, lanes × days ──────────────────────────────────── */
.gantt{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
        overflow:hidden; }
.gantt-scroll{ overflow-x:auto; }
.gantt-inner{ min-width:960px; }
.gantt-row{ display:grid; grid-template-columns:var(--lane-w,220px) repeat(7,minmax(0,1fr));
            border-bottom:1px solid var(--border); }
[data-density="compact"] .gantt-row{ --lane-w:180px; }
[data-density="roomy"]   .gantt-row{ --lane-w:260px; }
.gantt-row:last-child{ border-bottom:none; }
.gantt-row.head > *{ padding:var(--sp-card-tight) var(--sp-card-tight); text-align:center; }
.gantt-lane{ padding:var(--sp-card-tight); font-size:var(--fs-body); font-weight:600;
             border-right:1px solid var(--border); display:flex; align-items:center;
             min-height:64px; }
[data-density="compact"] .gantt-lane{ min-height:46px; }
.gantt-cells{ grid-column:2 / -1; display:grid; grid-template-columns:repeat(7,minmax(0,1fr));
              position:relative; }
.gantt-cell{ border-right:1px solid var(--border-subtle); }
.gantt-cell:last-child{ border-right:none; }
.gantt-cell.today{ background:var(--primary-tint); }
.gantt-date{ font-size:var(--fs-sm); color:var(--text-secondary); }
.gantt-day{ font-size:var(--fs-body); font-weight:600; margin-top:2px; }
.gantt-row.head .today .gantt-date,
.gantt-row.head .today .gantt-day{ color:var(--primary); }
.gantt-bar{ position:absolute; top:50%; transform:translateY(-50%); height:38px;
            border-radius:999px; display:flex; align-items:center; gap:10px;
            padding:0 16px 0 5px; font-size:var(--fs-sm); font-weight:600;
            cursor:pointer; overflow:hidden; white-space:nowrap;
            transition:filter var(--t-fast), transform var(--t-fast); }
[data-density="compact"] .gantt-bar{ height:30px; padding:0 12px 0 4px; }
[data-density="roomy"]   .gantt-bar{ height:46px; padding:0 20px 0 6px; }
.gantt-bar:hover{ filter:brightness(.97); transform:translateY(-50%) scale(1.005); }
.gantt-bar img,.gantt-bar .mark{ width:28px; height:28px; border-radius:999px; flex:none;
            object-fit:cover; display:flex; align-items:center; justify-content:center; }
[data-density="compact"] .gantt-bar img,[data-density="compact"] .gantt-bar .mark{ width:22px; height:22px; }
.gantt-bar.sky{ background:var(--sb-sky-bg); color:var(--sb-sky-text); }
.gantt-bar.amber{ background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.gantt-bar.rose{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.gantt-bar.emerald{ background:var(--sb-emerald-bg); color:var(--sb-emerald-text); }
.gantt-bar.slate{ background:var(--sb-slate-bg); color:var(--sb-slate-text); }

/* ── map — a schematic, not a tile service ─────────────────────────────── */
.map{ position:relative; background:var(--card-bg); border-radius:var(--r-card);
      box-shadow:var(--sh-card); overflow:hidden; }
.map-canvas{ position:relative; width:100%; aspect-ratio:4/3; min-height:520px;
             background:var(--sunken-bg); }
.map-canvas svg{ position:absolute; inset:0; width:100%; height:100%; }
.pin{ position:absolute; transform:translate(-50%,-100%); cursor:pointer; z-index:2;
      display:flex; flex-direction:column; align-items:center; gap:4px; }
.pin-dot{ width:34px; height:34px; border-radius:999px 999px 999px 4px; transform:rotate(45deg);
          display:flex; align-items:center; justify-content:center;
          box-shadow:var(--sh-raised); border:2.5px solid var(--card-bg);
          transition:transform var(--t-base); }
.pin-dot .ic{ transform:rotate(-45deg); color:#fff; width:16px; height:16px; }
.pin:hover .pin-dot{ transform:rotate(45deg) scale(1.14); }
.pin-label{ font-size:var(--fs-micro); font-weight:700; background:var(--card-bg);
            padding:2px 8px; border-radius:999px; box-shadow:var(--sh-card); white-space:nowrap; }
.pin.emerald .pin-dot{ background:var(--sb-emerald-dot); }
.pin.amber   .pin-dot{ background:var(--sb-amber-dot); }
.pin.rose    .pin-dot{ background:var(--sb-rose-dot); }
.pin.sky     .pin-dot{ background:var(--sb-sky-dot); }
.map-cluster{ position:absolute; transform:translate(-50%,-50%); z-index:1;
              width:56px; height:56px; border-radius:999px; display:flex; flex-direction:column;
              align-items:center; justify-content:center; cursor:pointer;
              background:var(--primary); color:var(--on-primary);
              box-shadow:0 0 0 8px color-mix(in srgb, var(--primary) 22%, transparent); }
 /* horizontal, centred along the bottom: a vertical legend in a corner sits
    exactly where a depot cluster wants to be */
.map-legend{ position:absolute; left:50%; transform:translateX(-50%);
             bottom:var(--sp-card-tight);
             background:var(--card-bg); border-radius:999px; box-shadow:var(--sh-raised);
             padding:8px 16px; display:flex; align-items:center; gap:var(--sp-card-tight);
             z-index:3; flex-wrap:wrap; justify-content:center; max-width:calc(100% - 32px); }
.map-tools{ position:absolute; right:var(--sp-card-tight); top:var(--sp-card-tight);
            display:flex; flex-direction:column; gap:6px; z-index:3; }
.map-tools button{ width:38px; height:38px; border-radius:var(--r-input); border:1px solid var(--border);
                   background:var(--card-bg); display:flex; align-items:center; justify-content:center;
                   cursor:pointer; box-shadow:var(--sh-card); }
.map-tools button:hover{ background:var(--hover-bg); }
.map-tools .ic{ width:var(--icon-inline); height:var(--icon-inline);
                color:var(--text-primary); }

/* ── pivot — a cross-tab, not a table ──────────────────────────────────── */
.pivot{ width:100%; border-collapse:separate; border-spacing:0; font-size:var(--fs-body); }
.pivot th, .pivot td{ padding:var(--row-py) var(--row-px); text-align:right; white-space:nowrap;
                      border-bottom:1px solid var(--border-subtle); }
.pivot thead th{ background:var(--card-bg); border-bottom:1px solid var(--border);
                 font-size:var(--fs-sm); font-weight:600; position:sticky; top:0; z-index:2; }
.pivot .rowhead{ text-align:left; font-weight:600; position:sticky; left:0;
                 background:var(--card-bg); z-index:1; border-right:1px solid var(--border); }
.pivot thead .rowhead{ z-index:3; }
.pivot tbody tr:hover td{ background:var(--hover-bg); }
.pivot tbody tr:hover .rowhead{ background:var(--hover-bg); }
.pivot .total,.pivot tfoot td{ font-weight:700; background:var(--sunken-bg); }
.pivot tfoot td{ border-bottom:none; border-top:1px solid var(--border); }
.pivot .num-cell{ font-variant-numeric:tabular-nums; position:relative; }
/* the heat wash is a background, so the number stays fully legible on top */
.heat{ position:absolute; inset:2px; border-radius:6px; z-index:0; }
.pivot .num-cell span{ position:relative; z-index:1; }
.pivot-wrap{ overflow:auto; max-height:70vh; background:var(--card-bg);
             border-radius:var(--r-card); box-shadow:var(--sh-card); }

/* the renderer switch — LINKS, because each of these is its own route */
.render-switch{ display:inline-flex; border:1px solid var(--border); border-radius:var(--r-button);
                overflow:hidden; background:var(--card-bg); }
.render-switch a{ display:inline-flex; align-items:center; gap:7px; height:var(--ctl-h-sm);
                  padding:0 var(--ctl-px-sm); font-size:var(--fs-sm); font-weight:600;
                  color:var(--text-secondary); transition:background var(--t-fast), color var(--t-fast); }
.render-switch a + a{ border-left:1px solid var(--border); }
.render-switch a:hover:not(.on){ background:var(--hover-bg); color:var(--text-primary); }
.render-switch a.on{ background:var(--text-primary); color:var(--card-bg); }
.render-switch .ic{ width:var(--icon-inline); height:var(--icon-inline); }

/* ═══════════════════════════════════════════════════════════════════════════
   19. THE REST OF THE KIT
   Auth · help centre · directory · person profile · file manager · reports
   charts · two-pane settings. All density-aware.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── the Revu gradient — its one piece of decoration, used deliberately ──── */
.revu-gradient{
  background:
    radial-gradient(120% 90% at 12% 18%, #F66254 0%, transparent 55%),
    radial-gradient(110% 90% at 88% 22%, #0052FF 0%, transparent 58%),
    radial-gradient(120% 110% at 70% 95%, #F66254 0%, transparent 55%),
    linear-gradient(140deg, #4B3FCB 0%, #0052FF 45%, #6E6BFF 100%);
  position:relative; isolation:isolate;
}
/* the fine grain Revu overlays on every gradient panel */
.revu-gradient::after{
  content:''; position:absolute; inset:0; z-index:-1; opacity:.30; pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ── auth — the split screen (registed1/3/4) ────────────────────────────── */
.auth{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:100vh; }
.auth-form{ display:flex; flex-direction:column; align-items:center;
            padding:var(--sp-page); background:var(--card-bg); overflow-y:auto; }
/* brand, form and footer share one centred column so they align on the same
   left edge AND the block sits centred in the pane — hugging the padding edge
   is what made a 1000px half look unbalanced */
.auth-form > *{ width:100%; max-width:460px; }
.auth-body{ margin:auto 0; padding:var(--sp-page) 0; }
.auth-foot{ font-size:var(--fs-body); color:var(--text-secondary); flex:none; }
.auth-art{ position:relative; display:flex; flex-direction:column; align-items:center;
           justify-content:center; gap:var(--sp-page); padding:var(--sp-page);
           color:#fff; overflow:hidden; }
.auth-art h2{ font-size:var(--fs-h1); font-weight:700; text-align:center;
              max-width:26ch; line-height:1.25; }
/* the art panel paints its own text white; anything on a card inside it must
   go back to the normal ink or it disappears against the card */
.auth-art .card{ color:var(--text-primary); }
.auth-dots{ display:flex; align-items:center; gap:8px; }
.auth-dots i{ width:8px; height:8px; border-radius:999px; background:rgba(255,255,255,.5); }
.auth-dots i.on{ width:22px; border-radius:999px; background:#fff; }
.auth-or{ display:flex; align-items:center; gap:var(--sp-card-tight);
          color:var(--text-muted); font-size:var(--fs-sm); }
.auth-or::before,.auth-or::after{ content:''; height:1px; background:var(--border); flex:1; }
.qr{ width:220px; height:220px; margin:0 auto; border-radius:var(--r-panel);
     border:1px solid var(--border); padding:14px; background:#fff; }
@media (max-width:980px){ .auth{ grid-template-columns:minmax(0,1fr); } .auth-art{ display:none; } }

/* ── help centre (support1/2/4) ─────────────────────────────────────────── */
.help-hero{ padding:calc(var(--sp-page) * 2) var(--sp-page); text-align:center; color:#fff; }
.help-hero h1{ font-size:calc(var(--fs-display) * 1.5); font-weight:700; letter-spacing:-.03em; }
.help-search{ max-width:760px; margin:var(--sp-card) auto 0; position:relative; }
.help-search .ipt{ height:calc(var(--ipt-h) * 1.3); font-size:var(--fs-h3);
                   padding-left:calc(var(--ipt-px) * 2 + 24px); border:none;
                   box-shadow:var(--sh-raised); }
.help-search .ic{ position:absolute; left:var(--ipt-px); top:50%; transform:translateY(-50%);
                  width:24px; height:24px; color:var(--text-muted); }
.help-prod{ display:flex; align-items:flex-start; gap:var(--sp-card-tight); }
.help-prod-icon{ width:52px; height:52px; border-radius:var(--r-panel); flex:none;
                 border:1px solid var(--border); display:flex; align-items:center;
                 justify-content:center; background:var(--card-bg); }
.help-art{ display:flex; align-items:flex-start; gap:var(--sp-card-tight);
           padding:var(--sp-card-tight) 0; border-bottom:1px solid var(--border);
           cursor:pointer; }
.help-art:last-child{ border-bottom:none; }
.help-art-icon{ width:52px; height:52px; border-radius:var(--r-panel); flex:none;
                border:1px solid var(--border); display:flex; align-items:center;
                justify-content:center; }
.help-cta{ border-radius:var(--r-card); padding:var(--sp-page); color:#fff;
           display:flex; align-items:center; gap:var(--sp-card); flex-wrap:wrap; }
.help-toc{ position:sticky; top:var(--sp-page); display:flex; flex-direction:column;
           border-left:2px solid var(--border); }
.help-toc a{ padding:9px var(--sp-card-tight); font-size:var(--fs-body);
             color:var(--text-secondary); margin-left:-2px; border-left:2px solid transparent; }
.help-toc a:hover{ color:var(--text-primary); }
.help-toc a.on{ color:var(--primary); font-weight:600; border-left-color:var(--primary); }
.prose p{ line-height:var(--lh-body); margin-bottom:var(--sp-card-tight); }
.prose ol,.prose ul{ margin:0 0 var(--sp-card-tight); padding-left:22px; line-height:var(--lh-body); }
.prose li{ margin-bottom:8px; }
.prose .callout{ border:1px solid var(--border); border-radius:var(--r-panel);
                 padding:var(--sp-card); margin-bottom:var(--sp-card-tight); }

/* ── directory card (contacts4) ─────────────────────────────────────────── */
.dir-card{ background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
           padding:var(--sp-card); display:flex; flex-direction:column; align-items:center;
           gap:10px; text-align:center; position:relative; cursor:pointer;
           transition:box-shadow var(--t-base), transform var(--t-base); }
.dir-card:hover{ box-shadow:var(--sh-raised); transform:translateY(-2px); }
.dir-card .av-xl{ width:96px; height:96px; border-radius:999px; object-fit:cover; }
[data-density="compact"] .dir-card .av-xl{ width:72px; height:72px; }
.dir-social{ display:flex; align-items:center; gap:var(--sp-card-tight);
             margin-top:6px; color:var(--sb-sky-dot); }
.dir-social a{ display:flex; }
.dir-social .ic{ width:20px; height:20px; }

/* ── person profile cover (profile3/5) ──────────────────────────────────── */
.cover{ height:180px; border-radius:var(--r-card) var(--r-card) 0 0; }
[data-density="compact"] .cover{ height:130px; }
/* ⛔ position + z-index are load-bearing here, not decoration.
   .revu-gradient sets `position:relative; isolation:isolate`, which makes the
   cover a STACKING CONTEXT — painted in the positioned-descendants phase, i.e.
   AFTER a static in-flow sibling. A plain negative margin therefore slides the
   avatar UNDER the gradient. Positioning the avatar puts it in the same phase,
   where later-in-tree wins. */
.cover-av{ position:relative; z-index:1;
           width:132px; height:132px; border-radius:999px; object-fit:cover;
           border:5px solid var(--card-bg); margin-top:-72px; }
[data-density="compact"] .cover-av{ width:100px; height:100px; margin-top:-54px; }

/* ── file manager (filemanager3) ────────────────────────────────────────── */
/* `.storage`, `.storage-top` and `.storage-split` were REMOVED 2026-09-03. INVENTORY §3.6
   listed them among the fifteen selectors the family draws on nothing, and §3.6's own note
   explains why they are dead rather than merely unwired: fleet/documents DOES draw its
   usage meter, as a `tile` with a `bar` — which ships as `storage-meter` — so these three
   are an earlier shape the family abandoned and replaced. Deleting is the reversible half
   of the choice; `git log` is the archive (R19). */
.filetype{ width:48px; height:48px; border-radius:var(--r-panel); flex:none;
           display:flex; align-items:center; justify-content:center;
           font-size:var(--fs-sm); font-weight:700; }
[data-density="compact"] .filetype{ width:36px; height:36px; }

/* ── report charts ──────────────────────────────────────────────────────── */
.grouped{ display:flex; align-items:flex-end; gap:10px; height:230px; padding-top:10px; }
.grouped-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:10px; height:100%; }
.grouped-pair{ flex:1; display:flex; align-items:flex-end; justify-content:center; gap:5px; width:100%; }
.grouped-pair span{ width:9px; border-radius:999px; }
/* The value axis beside the bars, and the period label under each column. fleet/reports
   draws both with the whole rule inline — the axis on a `.col`, the label on `.chart-lbl`,
   which is page-local to fleet/dashboard and so invisible from here. Declared with the
   screen's own values.
   ⚠️ THE 10px AND 34px ARE DELIBERATELY NOT TOKENS. `.grouped` above fixes its own
   geometry — 230px tall, 10px padding-top, 10px gap — so an axis that scaled with density
   would drift off the bars it labels at every density but one. It matches `.grouped`'s
   padding-top exactly; the 34px clears the column's label row. */
.grouped-axis{ display:flex; flex-direction:column; justify-content:space-between;
               text-align:right; width:calc(var(--ctl-h) * .92); padding:10px 0 34px;
               font-size:var(--fs-micro); color:var(--text-muted); }
.grouped-lbl{ font-size:var(--fs-micro); color:var(--text-muted); }
.ring{ width:200px; height:200px; border-radius:999px; display:flex; align-items:center;
       justify-content:center; flex-direction:column; flex:none; }
.ring-hole{ width:132px; height:132px; border-radius:999px; background:var(--card-bg);
            display:flex; flex-direction:column; align-items:center; justify-content:center; }
.chip-legend{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; }
.chip-legend span{ display:inline-flex; align-items:center; gap:8px; padding:6px 14px;
                   border-radius:999px; border:1px solid var(--border);
                   font-size:var(--fs-sm); font-weight:600; background:var(--card-bg); }
.chip-legend i{ width:9px; height:9px; border-radius:999px; }
.choropleth path{ transition:opacity var(--t-fast); cursor:pointer; }
.choropleth path:hover{ opacity:.75; }

/* ── two-pane settings (projsetts2) ─────────────────────────────────────── */
.settings2{ display:grid; grid-template-columns:340px minmax(0,1fr);
            background:var(--card-bg); border-radius:var(--r-card);
            box-shadow:var(--sh-card); overflow:hidden; }
[data-density="compact"] .settings2{ grid-template-columns:280px minmax(0,1fr); }
.settings2-nav{ border-right:1px solid var(--border); display:flex; flex-direction:column; }
.settings2-body{ padding:var(--sp-card); }
.set-item{ display:flex; align-items:flex-start; gap:var(--sp-card-tight);
           padding:var(--sp-card-tight); margin:0 var(--sp-card-tight);
           border-radius:var(--r-panel); cursor:pointer; transition:background var(--t-fast); }
.set-item:hover{ background:var(--hover-bg); }
.set-item.on{ background:var(--primary-tint); }
.set-item.on .set-item-title{ color:var(--primary); }
.set-item .ic{ width:var(--icon-ctl); height:var(--icon-ctl); margin-top:2px;
               color:var(--text-secondary); }
.set-item.on .ic{ color:var(--primary); }
.set-item-title{ font-weight:600; font-size:var(--fs-body); }
.set-item-sub{ font-size:var(--fs-sm); color:var(--text-secondary); margin-top:2px; }
/* The nav column's three bands and the body's save row. fleet/vehicles/JM-4021/settings
   draws every one of them with the rule inline; the values here are that screen's, moved
   to where their `.settings2*` siblings already live. The portrait's 104px reads
   `--thumb-lg * 1.45` — 104.4px at default density, and on the axis. */
.settings2-head{ padding:var(--sp-card); text-align:center;
                 border-bottom:1px solid var(--border); }
.settings2-portrait{ width:calc(var(--thumb-lg) * 1.45); height:calc(var(--thumb-lg) * 1.45);
                     border-radius:var(--r-avatar); object-fit:cover; }
.settings2-list{ padding:var(--sp-card-tight) 0; flex:1; }
.settings2-foot{ padding:var(--sp-card-tight); border-top:1px solid var(--border); }
.settings2-save{ margin-top:var(--sp-page); padding-top:var(--sp-card);
                 border-top:1px solid var(--border); }
/* A `set-item` is a real route now, not an Alpine `@click` — so it needs what the family
   already gives `.tabbar .tab` and `.anchor-nav .anchor` for the same reason. */
.settings2-nav .set-item{ text-decoration:none; color:inherit; }
@media (max-width:900px){ .settings2{ grid-template-columns:minmax(0,1fr); }
                          .settings2-nav{ border-right:none; border-bottom:1px solid var(--border); } }

/* ── task row with a leading flag (taks2) ───────────────────────────────── */
.taskrow{ display:flex; align-items:center; gap:var(--sp-card-tight);
          background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card);
          padding:var(--sp-card-tight) var(--sp-card); cursor:pointer;
          transition:box-shadow var(--t-base); }
.taskrow:hover{ box-shadow:var(--sh-raised); }
.taskrow.done .taskrow-title{ color:var(--text-muted); text-decoration:line-through; }
.taskrow-title{ font-size:var(--fs-body); font-weight:600; flex:1; min-width:0; }
.flagmark{ width:var(--icon-ctl); height:var(--icon-ctl); flex:none; }

/* ⭐ ALIGNMENT, DECLARED. The family centres a row and a heading in several places and
   wrote the style inline at each call site, so no component could say it and every page
   carried a style attribute. 2026-09-03. */
.justify-center{ justify-content:center; }
.justify-end{ justify-content:flex-end; }
.justify-between{ justify-content:space-between; }
.text-center{ text-align:center; }
.text-end{ text-align:right; }

/* ───────────────────────────────────────────────────────────────────────
   RESPONSIVE — 2026-11-19. The desktop shell narrows instead of breaking.
     ≤1000px  the sidebar becomes its icon rail (the same rules as data-nav="collapsed"), giving the page the room
     ≤900px   the topbar wraps: the title takes its own row and the actions sit below it, so nothing is squeezed to a sliver
              a table's row buttons keep their icon only (each carries a `title`, so the name is still there on hover and for a screen reader)
   A column that can drop (.col-lo) already does, at 1180px.
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width:1000px){
  .sidebar{ width:var(--sidebar-w-collapsed); }
  .sidebar .nav-label, .sidebar .nav-group, .sidebar .brand-word, .sidebar .brandmark-word,
  .sidebar .nav .badge, .sidebar .user-name{ display:none; }
  .sidebar .nav{ justify-content:center; padding:0; }
}
@media (max-width:900px){
  .topbar{ flex-wrap:wrap; row-gap:10px; }
  .topbar-title{ flex:1 1 100%; }
  .tbl .col-act .btn{ font-size:0; gap:0; padding-left:6px; padding-right:6px; min-width:0; }
  .tbl .col-act .btn .ic{ margin:0; }
  .tbl .col-act .btn:not(:has(.ic)){ font-size:var(--fs-sm); }   /* a button with no glyph keeps its words */
  .tbl .col-act .row{ gap:4px; }
  .tbl .col-act{ width:auto; white-space:nowrap; }
}
@media (max-width:900px){
  .panel{ overflow-x:auto; }   /* a table wider than its card scrolls inside the card, never the page */
  .stack, .stack-sm, .list, .hub-layout > *, .rec-layout > *{ min-width:0; }   /* a wide table inside one cannot widen its column */
  .stack > *, .stack-sm > *{ min-width:0; }
  /* the record's section rail sits ABOVE its content, not beside it (the compact-density rule below the 1200px query would otherwise keep two columns) */
  :root[data-density] .hub-layout, [data-density] .hub-layout, .hub-layout{ grid-template-columns:minmax(0,1fr); }
  .hub-layout > .anchor-nav{ position:static; }
  .row.push, .row.gap-md{ flex-wrap:wrap; }   /* a toolbar's controls wrap instead of overflowing */
}
@media (max-width:560px){
  :root{ --sp-page:14px; }
  .topbar .btn{ flex:1 1 auto; justify-content:center; }
  .scroller .tbl{ min-width:0; }
}


/* ===== fleetline: S2 ===== */
/* ActionCard: the card's own next action, a verb at the right of the foot line, before the arrow. */
.tile-foot .tile-action{ margin-left:auto; font-weight:600; color:var(--primary); }
.tile-foot .tile-action + .push{ margin-left:0; }
/* Pivot: `.pivot .num-cell span` (position:relative) outranks `.heat`, so the heat wash lost its absolute position and drew nothing. The wash stays a layer under the number. */
.pivot .num-cell span.heat{ position:absolute; z-index:0; }
/* A panel that holds a table scrolls sideways when the table is wider than the screen, instead of cutting its last columns and the row's button off (`.panel` is overflow:hidden). */
.panel:has(> .tbl){ overflow-x:auto; }
/* The table never squeezes below what keeps its text on a line or two (a cell of the "Why" column would wrap to four lines at 800px): narrower than that the panel scrolls, and the row's button stays at the
   right edge on its own (sticky), so the action is reachable without scrolling sideways. */
.panel:has(> .tbl) > .tbl{ min-width:680px; }
.panel:has(> .tbl) > .tbl th.col-act, .panel:has(> .tbl) > .tbl td.col-act{ position:sticky; right:0; background:var(--card-bg); z-index:1; }
/* A cell that holds a line and the line under it ("Gearbox rebuild" over "WO-2388 · serious") keeps room for both, so it never wraps to four lines beside wide neighbours. */
.tbl td.cell-wide{ min-width:200px; }
/* ===== /fleetline: S2 ===== */

/* ===== fleetline: S1 ===== */
/* The page header (topbar) wraps instead of squeezing its title: the title keeps at least 340px, and when the actions do not fit beside it (a profile with six buttons) they drop to a row below,
   the way the 900px rule already does for a narrow window. Seen on the person record at 1280px: the title column was 185px wide and the facts stacked one per line. */
.topbar{ flex-wrap:wrap; row-gap:10px; }
.topbar-title{ flex:1 1 340px; }
/* A list row on a phone: the title takes the rest of the first line beside the picture and the facts and the state drop to their own line, so a plate is not broken at its hyphen ('JM-' / '2877 KJ'). */
@media (max-width:520px){
  .rowitem-body{ flex:1 1 calc(100% - 72px); }
  .rowitem-facts{ flex:1 1 100%; }
}
/* The highlight strip carries the kit's five tiles in ONE row at 1280px: the page's content column is 946px wide there (the sidebar is 256px) and five tiles of the family's 180px minimum
   need 996px, so the fifth dropped to a row of its own. 160px lets five fit from about 900px; a narrower column wraps as before. */
.highlights{ grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
/* ===== /fleetline: S1 ===== */

/* ===== fleetline: S4 ===== */
/* The five components of a short, touch-first flow (ActionTile, ContextBar, DraftBanner, QuickEntry, CheckRun): the kit's tokens, targets of at least 56px (72px for a tile) so they can be hit with a glove. */
.flow-column{ display:flex; flex-direction:column; gap:var(--sp-card-gap); width:100%; max-width:760px; margin-inline:auto; }
/* A list row inside a narrow flow column (a job with its dates and its state): the title keeps the line beside the picture and the facts drop to their own line, as the phone rule does, up to 900px; at 700px the title was squeezed to one word a line. */
@media (max-width:900px){
  .flow-column .rowitem-body{ flex:1 1 calc(100% - 72px); }
  .flow-column .rowitem-facts{ flex:1 1 100%; }
}

/* A grid of ActionTiles: two wide when there is room, one on a phone. */
.action-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap:var(--sp-card-gap); }

/* ActionTile */
.action-tile{ display:flex; align-items:center; gap:16px; min-height:88px; padding:var(--sp-card-tight) var(--sp-card); background:var(--card-bg); color:var(--text-primary);
              border-radius:var(--r-card); box-shadow:var(--sh-card); text-decoration:none; transition:box-shadow var(--t-base), transform var(--t-base); }
a.action-tile{ cursor:pointer; }
a.action-tile:hover{ box-shadow:var(--sh-raised); transform:translateY(-2px); }
a.action-tile:active{ transform:translateY(1px); }
a.action-tile:focus-visible{ outline:3px solid var(--primary); outline-offset:2px; }
.action-tile-chip{ flex:none; width:56px; height:56px; border-radius:var(--r-card); display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); }
.action-tile-emerald .action-tile-chip{ background:var(--sb-emerald-bg); color:var(--sb-emerald-text); }
.action-tile-amber .action-tile-chip{ background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.action-tile-rose .action-tile-chip{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.action-tile-sky .action-tile-chip{ background:var(--sb-sky-bg); color:var(--sb-sky-text); }
.action-tile-slate .action-tile-chip{ background:var(--sb-slate-bg); color:var(--sb-slate-text); }
.action-tile-indigo .action-tile-chip{ background:var(--sb-indigo-bg); color:var(--sb-indigo-text); }
.action-tile-body{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.action-tile-label{ font-size:var(--fs-h3); font-weight:700; line-height:var(--lh-tight); }
.action-tile-sub{ font-size:var(--fs-sm); color:var(--text-secondary); }
.action-tile-bar{ display:block; width:100%; margin-top:4px; }
.action-tile-go{ flex:none; color:var(--text-muted); }
.action-tile-primary{ background:var(--primary); color:var(--on-primary); }
.action-tile-primary .action-tile-chip{ background:rgba(255,255,255,.18); color:#fff; }
.action-tile-primary .action-tile-sub, .action-tile-primary .action-tile-go{ color:rgba(255,255,255,.88); }
.action-tile-off{ opacity:.6; box-shadow:none; border:1px dashed var(--border); cursor:not-allowed; }

/* ContextBar */
.context-bar{ display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; padding:12px var(--sp-card-tight); background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card); }
.context-back{ display:inline-flex; align-items:center; gap:4px; min-height:48px; padding:0 16px 0 8px; border-radius:var(--r-button); background:var(--sunken-bg); color:var(--text-primary); font-weight:600; text-decoration:none; }
.context-back:hover{ background:var(--hover-strong); }
.context-back:focus-visible{ outline:3px solid var(--primary); outline-offset:2px; }
.context-body{ display:flex; flex-direction:column; flex:1 1 160px; min-width:0; }
.context-title{ font-size:var(--fs-h3); font-weight:700; line-height:var(--lh-tight); }
.context-step{ font-size:var(--fs-sm); color:var(--text-secondary); }
.context-facts{ display:flex; flex-wrap:wrap; gap:8px; }
.context-fact{ display:inline-flex; align-items:center; gap:6px; height:var(--ctl-h-xs); padding:0 12px; border-radius:var(--r-badge); background:var(--sunken-bg); font-size:var(--fs-sm); font-weight:600; white-space:nowrap; }
.context-next{ display:inline-flex; align-items:center; gap:6px; flex-basis:100%; font-size:var(--fs-sm); color:var(--text-secondary); }

/* DraftBanner */
.draft-banner{ display:flex; align-items:center; flex-wrap:wrap; gap:16px; padding:var(--sp-card-tight) var(--sp-card); border-radius:var(--r-card); background:var(--alert-info-bg); border:1px solid var(--alert-info-border); }
.draft-banner-chip{ flex:none; width:48px; height:48px; border-radius:var(--r-card); display:grid; place-items:center; background:var(--card-bg); color:var(--primary); }
.draft-banner-text{ flex:1 1 200px; min-width:0; display:flex; flex-direction:column; gap:2px; }
.draft-banner-title{ font-weight:700; font-size:var(--fs-body); }
.draft-banner-body{ font-size:var(--fs-sm); color:var(--text-secondary); }
.draft-banner-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-left:auto; }
.draft-banner{ position:relative; }
.draft-banner-discard{ display:inline-flex; margin:0; }
.draft-banner-discard summary{ list-style:none; cursor:pointer; display:inline-flex; align-items:center; }
.draft-banner-discard summary::-webkit-details-marker{ display:none; }
.draft-banner-confirm{ position:absolute; left:var(--sp-card-tight); right:var(--sp-card-tight); top:calc(100% - 6px); z-index:20; display:flex; flex-direction:column; gap:12px; padding:var(--sp-card-tight);
                       background:var(--card-bg); border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--sh-dropdown); }
@media (min-width:640px){ .draft-banner-confirm{ left:auto; width:360px; } }
.draft-banner-ask{ margin:0; font-weight:600; }
.draft-banner-btn{ min-height:56px; padding:0 24px; }

/* QuickEntry */
.quick-entry{ display:flex; flex-direction:column; gap:var(--sp-section-gap); }
.quick-fields{ display:flex; flex-direction:column; gap:var(--sp-field-gap); }
.quick-field{ display:flex; flex-direction:column; gap:8px; }
.quick-label{ font-size:var(--fs-body); font-weight:600; }
.quick-input{ height:auto; min-height:max(var(--ipt-h), 60px); font-size:var(--fs-h3); }
.quick-box{ position:relative; display:flex; align-items:center; }
.quick-box .quick-input{ padding-right:76px; }
.quick-unit{ position:absolute; right:18px; font-weight:600; color:var(--text-secondary); pointer-events:none; }
.quick-note{ display:flex; align-items:center; gap:6px; font-size:var(--fs-sm); color:var(--text-secondary); }
.quick-note-err{ color:var(--error-ink); font-weight:600; }
.quick-field-err .ipt{ border-color:var(--error); background:var(--alert-err-bg); }
.quick-choices{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.quick-choice{ position:relative; }
.quick-choice input{ position:absolute; opacity:0; pointer-events:none; }
.quick-choice label{ display:flex; align-items:center; gap:12px; min-height:76px; padding:12px 18px; border:2px solid var(--border); border-radius:var(--r-card); background:var(--card-bg); cursor:pointer; font-weight:600; transition:border-color var(--t-fast), background var(--t-fast); }
.quick-choice label:hover{ border-color:var(--text-muted); }
.quick-choice input:checked + label{ border-color:var(--primary); background:var(--primary-tint); color:var(--primary); }
.quick-choice-emerald input:checked + label{ border-color:var(--sb-emerald-dot); background:var(--sb-emerald-bg); color:var(--sb-emerald-text); }
.quick-choice-amber input:checked + label{ border-color:var(--sb-amber-dot); background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.quick-choice-rose input:checked + label{ border-color:var(--sb-rose-dot); background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.quick-choice input:focus-visible + label{ box-shadow:0 0 0 3px var(--focus-ring); }
.quick-choice-text{ display:flex; flex-direction:column; gap:2px; }
.quick-choice-hint{ font-size:var(--fs-sm); font-weight:400; color:var(--text-secondary); }
.quick-actions{ display:flex; flex-wrap:wrap; gap:12px; }
.quick-btn{ min-height:60px; padding:0 28px; }
.quick-actions .quick-btn{ flex:1 1 180px; }
.quick-actions .btn-pri{ flex:2 1 240px; }
/* alone in a column (the result page's way home) a large button is as wide as the column and as tall as a button, never stretched */
.flow-column > .quick-btn{ flex:none; }
.flow-column [data-component] > .quick-btn{ display:flex; width:100%; }

/* CheckRun */
.check-run{ display:flex; flex-direction:column; gap:14px; }
.check-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.check-count{ font-size:var(--fs-h3); font-weight:700; }
.check-failed{ display:inline-flex; align-items:center; gap:6px; font-weight:600; color:var(--sb-rose-text); }
.check-strip{ display:flex; gap:3px; }
.check-seg{ flex:1 1 0; height:20px; min-width:4px; border-radius:5px; background:var(--sunken-bg); border:1px solid var(--border); }
.check-seg-primary{ background:var(--primary); border-color:transparent; }
.check-seg-emerald{ background:var(--sb-emerald-dot); border-color:transparent; }
.check-seg-rose{ background:var(--sb-rose-dot); border-color:transparent; }
.check-seg-amber{ background:var(--sb-amber-dot); border-color:transparent; }
.check-seg-slate{ background:var(--sb-slate-dot); border-color:transparent; }
.check-seg-here{ outline:3px solid var(--primary); outline-offset:1px; }
.check-card{ display:flex; flex-direction:column; gap:16px; padding:var(--sp-card); background:var(--card-bg); border-radius:var(--r-card); box-shadow:var(--sh-card); }
.check-title{ font-size:var(--fs-h1); font-weight:700; line-height:var(--lh-tight); }
.check-hint{ font-size:var(--fs-body); color:var(--text-secondary); }
.check-critical{ align-self:flex-start; display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:var(--r-badge); background:var(--sb-rose-bg); color:var(--sb-rose-text); font-size:var(--fs-sm); font-weight:600; }
.check-critical-tag{ font-size:var(--fs-sm); font-weight:600; color:var(--sb-rose-text); }
.check-answers{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:12px; }
.check-answer{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:104px; padding:12px; border-radius:var(--r-card); border:2px solid transparent; font:inherit; font-size:var(--fs-h3); font-weight:700; cursor:pointer; text-align:center; transition:transform var(--t-fast) var(--ease), border-color var(--t-fast); }
.check-answer:active{ transform:scale(.98); }
.check-answer:focus-visible{ outline:3px solid var(--primary); outline-offset:2px; }
.check-answer-emerald{ background:var(--sb-emerald-bg); color:var(--sb-emerald-text); }
.check-answer-rose{ background:var(--sb-rose-bg); color:var(--sb-rose-text); }
.check-answer-amber{ background:var(--sb-amber-bg); color:var(--sb-amber-text); }
.check-answer-slate{ background:var(--sb-slate-bg); color:var(--sb-slate-text); }
.check-answer-primary{ background:var(--primary-soft); color:var(--primary); }
.check-answer-chosen{ border-color:currentColor; }
.check-nav{ display:flex; justify-content:space-between; align-items:center; }
.check-previous{ display:inline-flex; align-items:center; min-height:48px; padding:0 16px 0 6px; border-radius:var(--r-button); color:var(--text-secondary); font-weight:600; text-decoration:none; }
.check-previous:hover{ background:var(--hover-strong); color:var(--text-primary); }
.check-note summary{ display:flex; align-items:center; min-height:44px; cursor:pointer; font-weight:600; color:var(--text-secondary); }
.check-error{ display:flex; align-items:center; gap:6px; font-weight:600; color:var(--error-ink); }
.check-failed-list{ margin:0; padding-left:20px; display:flex; flex-direction:column; gap:6px; }
.check-card .quick-btn{ width:100%; }
@media (max-width:520px){
  .action-tile{ padding:var(--sp-card-tight) 16px; gap:12px; }
  .check-card{ padding:16px; }
  .check-title{ font-size:var(--fs-h2); }
  /* Pass and Fail side by side, big; Not applicable is a full-width row under them: three stacked 104px buttons would push Pass off a phone screen */
  .check-answers{ grid-template-columns:1fr 1fr; }
  .check-answer-slate{ grid-column:1 / -1; min-height:64px; flex-direction:row; }
  .draft-banner-actions{ margin-left:0; width:100%; }
  .draft-banner-actions .draft-banner-btn{ flex:1; }
}
/* ===== /fleetline: S4 ===== */

/* ===== fleetline: S6 ===== */
/* The sign-in screens (kit auth/*): the title is one and a half display sizes and the line under it sits 10px below, exactly as the kit writes them inline. */
.auth-title{ font-size:calc(var(--fs-display) * 1.5); }
.auth-lede{ margin-top:10px; }
/* A segmented control whose segments are LINKS (a choice that changes which records load is a route, so the Updates page's Mine / My area / Whole facility are anchors): the same look as the button segments. */
.seg > a{
  height:var(--ctl-h-sm); padding:0 var(--ctl-px-sm); border:none; background:transparent;
  color:var(--text-secondary); font-size:var(--fs-sm); font-weight:600; cursor:pointer; text-decoration:none;
  display:inline-flex; align-items:center; gap:6px;
  transition:background var(--t-fast), color var(--t-fast);
}
.seg > a + a{ border-left:1px solid var(--border); }
.seg > a:hover:not(.on){ background:var(--hover-bg); color:var(--text-primary); }
.seg > a.on{ background:var(--text-primary); color:var(--card-bg); }
/* An API key shown once (Me › Profile › API keys): one long unbroken secret, wrapped where it must, selected with one click so it is copied whole. */
.issued-key{ word-break:break-all; user-select:all; cursor:text; }
/* ===== /fleetline: S6 ===== */
/* ===== /fleetline: S11 file viewer ===== */
/* The dialog the `file viewer` behaviour in controllers.js builds on first use: a PDF or an image shown where it is, with Previous / Next, Download and Open in a new tab. */
.file-viewer{ width:min(1100px,96vw); height:min(88vh,860px); max-width:none; max-height:none; padding:0; border:0; overflow:hidden;
              border-radius:var(--r-modal); background:var(--card-bg); box-shadow:var(--sh-modal); color:inherit; }
.file-viewer[open]{ display:flex; flex-direction:column; }
.file-viewer::backdrop{ background:var(--scrim); }
.file-viewer-bar{ display:flex; align-items:center; gap:var(--sp-button-gap); flex-wrap:wrap; padding:var(--sp-card-tight) var(--sp-card); border-bottom:1px solid var(--border); }
.file-viewer-title{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-viewer-body{ position:relative; flex:1 1 auto; min-height:0; display:flex; background:var(--sunken-bg); }
.file-viewer-stage{ flex:1 1 auto; min-width:0; display:flex; align-items:center; justify-content:center; padding:var(--sp-button-gap); }
.file-viewer-image{ max-width:100%; max-height:100%; object-fit:contain; border-radius:var(--r-thumb); }
.file-viewer-pdf{ width:100%; height:100%; border:0; background:var(--card-bg); }
.file-viewer-note{ padding:var(--sp-card); text-align:center; color:var(--text-secondary); }
.file-viewer-nav{ position:absolute; top:50%; transform:translateY(-50%); z-index:1; }
.file-viewer-nav.prev{ left:var(--sp-button-gap); }
.file-viewer-nav.next{ right:var(--sp-button-gap); }
@media (max-width:640px){
  .file-viewer{ width:100vw; height:100dvh; max-width:100vw; border-radius:0; }
  .file-viewer-bar{ flex-wrap:nowrap; padding:var(--sp-button-gap); }
  .file-viewer-label{ display:none; }
}
/* A FileCard that opens the viewer: the name is a link stretched over the whole card, the download stays its own control above it. */
.file-card{ position:relative; }
.file-card:hover{ background:var(--hover-bg); }
.file-card .stretch::after{ content:''; position:absolute; inset:0; border-radius:var(--r-panel); }
.file-card .btn-icon{ position:relative; z-index:1; }
/* A file's thumbnail in FileGallery's grid. */
.file-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:var(--sp-button-gap); }
.file-thumb{ display:block; aspect-ratio:4/3; overflow:hidden; border-radius:var(--r-thumb); background:var(--sunken-bg); border:2px solid transparent; }
.file-thumb:hover, .file-thumb:focus-visible{ border-color:var(--primary); }
.file-thumb img{ display:block; width:100%; height:100%; object-fit:cover; }
/* ===== /fleetline: S11 file viewer end ===== */
