
/* ═══════════════════════════════════════════════════════════════════════════
   THE ADMIN KIT

   One stylesheet for every Firm Admin and Klonza Admin screen, on Klonza's
   rule book (src/brand/tokens.ts): its colours, its eight text sizes (in rem),
   its corners and its switch widths, one of each part. A screen names a
   colour or a size from here (var(--k-*) or var(--kz-*)) or it does not get
   one: a typed hex or px size is a bug (test/typed-values.test.ts).

   Admin always wears Klonza's own pair, whatever the firm's colours (owner,
   12 Nov 2026): every --k-accent-* and --k-second-* value is the rule book's
   orange with navy words on it, never white. A firm shows itself by its name,
   letter and logo. Words in the orange use --k-accent-text, never --k-accent,
   and success is green in both looks.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --kz-navy-50: #F2F4F8;
  --kz-navy-100: #E1E6EF;
  --kz-navy-200: #C3CBDB;
  --kz-navy-400: #7586A6;
  --kz-navy-600: #3F5478;
  --kz-navy-700: #2B3D5F;
  --kz-navy-800: #1B2A47;
  --kz-navy-900: #0E1B33;
  --kz-ember: #FF7A45;
  --kz-ember-deep: #B9461C;
  --kz-ember-soft: #FFEEE6;
  --kz-white: #FFFFFF;
  --kz-paper: #FFFFFF;
  --kz-paper-warm: #FBFBF9;
  --kz-on-paper: #0E1B33;
  --kz-on-paper-muted: #5B667D;
  --kz-paper-line: #C9CACA;
  --kz-paper-line-soft: #E4E1D9;
  --kz-on-photo: #FFFFFF;
  --kz-photo-shade: rgba(0, 0, 0, 0.4);
  --kz-photo-shade-strong: rgba(0, 0, 0, 0.78);
  --kz-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --kz-text-12: 12px;
  --kz-text-13: 13px;
  --kz-text-14: 14px;
  --kz-text-16: 16px;
  --kz-text-18: 18px;
  --kz-text-20: 20px;
  --kz-text-24: 24px;
  --kz-text-32: 32px;
  --kz-rem-12: 0.75rem;
  --kz-rem-13: 0.8125rem;
  --kz-rem-14: 0.875rem;
  --kz-rem-16: 1rem;
  --kz-rem-18: 1.125rem;
  --kz-rem-20: 1.25rem;
  --kz-rem-24: 1.5rem;
  --kz-rem-32: 2rem;
  --kz-corner-work: 14px;
  --kz-corner-soft: 24px;
  --kz-corner-small: 10px;
  --kz-corner-pill: 999px;
  --kz-button-h: 44px;
  --kz-button-h-phone: 50px;
  --kz-field-h: 44px;
  --kz-field-h-phone: 48px;
  --kz-field-text-phone: 16px;
  --kz-switch-phone: 768px;
  --kz-switch-wide: 1024px;
  color-scheme: light;
  --kz-ink: #0E1B33;
  --kz-muted: #5B667D;
  --kz-line: #E4E1D9;
  --kz-field: #8A93A6;
  --kz-ground: #F4F3EE;
  --kz-surface: #FFFFFF;
  --kz-brand: #0E1B33;
  --kz-on-brand: #FFFFFF;
  --kz-brand-text: #0E1B33;
  --kz-accent: #B9461C;
  --kz-on-accent: #FFFFFF;
  --kz-accent-soft: #FFEEE6;
  --kz-focus: #B9461C;
  --kz-success: #177A41;
  --kz-success-soft: #E5F4EB;
  --kz-warning: #9A5300;
  --kz-warning-soft: #FDF0DC;
  --kz-danger: #B42318;
  --kz-danger-soft: #FCE7E5;
  --kz-info: #1F56C2;
  --kz-info-soft: #E6EEFB;
  --kz-flame: #FF7A45;
  --kz-on-flame: #0E1B33;
  --kz-flame-hover: #FF956A;
  --kz-flame-text: #B9461C;
  --kz-flame-soft: #FFEEE6;
  --kz-on-flame-soft: #B9461C;
  --kz-chip: #EEECE6;
  --kz-hover: #F9F8F6;
  --kz-hair: rgba(14, 27, 51, 0.07);
  --kz-shadow: 0 1px 2px rgba(14, 27, 51, 0.04), 0 8px 20px -10px rgba(14, 27, 51, 0.07);
  --kz-shadow-sm: 0 1px 0 rgba(14, 27, 51, 0.07), 0 6px 14px -8px rgba(14, 27, 51, 0.22);
  --kz-shadow-lift: 0 2px 4px rgba(14, 27, 51, 0.05), 0 14px 28px -12px rgba(14, 27, 51, 0.12);
  --kz-shadow-pop: 0 24px 60px -12px rgba(14, 27, 51, 0.35);
  --kz-art: drop-shadow(0 8px 12px rgba(14, 27, 51, 0.22));
  --kz-dim: rgba(14, 27, 51, 0.42);
  --kz-band: #0E1B33;
  --kz-on-band: #FFFFFF;
  --kz-on-band-soft: #C3CBDB;
  --kz-on-band-muted: #9CA9C1;
  --kz-band-good: #5CD08F;
  --kz-surface-rgb: 255, 255, 255;
  --kz-ink-rgb: 14, 27, 51;
  /* The firm's own two colours: Klonza's pair until a screen reads the firm's look. */
  --firm-main: #0E1B33;
  --firm-on-main: #FFFFFF;
  --firm-main-hover: #303B50;
  --firm-main-text: #0E1B33;
  --firm-main-text-rgb: 14, 27, 51;
  --firm-main-text-dark: #5A84D2;
  --firm-main-text-dark-rgb: 90, 132, 210;
  --firm-main-soft: #E4E6E9;
  --firm-on-main-soft: #0E1B33;
  --firm-main-panel-dark: #101B2F;
  --firm-on-main-muted: #CACDD2;
  --firm-second: #FF7A45;
  --firm-on-second: #0E1B33;
  --firm-second-text: #D43C00;
  --firm-second-text-dark: #FF7A45;
  --firm-second-soft: #FFF0EB;
  --firm-on-second-soft: #CA3900;
  --firm-second-on-main: #FF7A45;
  --firm-on-second-on-main: #0E1B33;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --kz-ink: #EEF1F6;
    --kz-muted: #A3ADC0;
    --kz-line: #26334C;
    --kz-field: #5D6A84;
    --kz-ground: #0A1222;
    --kz-surface: #111B2E;
    --kz-brand: #1B2A47;
    --kz-on-brand: #FFFFFF;
    --kz-brand-text: #C3CBDB;
    --kz-accent: #FF7A45;
    --kz-on-accent: #0E1B33;
    --kz-accent-soft: #3A2216;
    --kz-focus: #FF7A45;
    --kz-success: #5CD08F;
    --kz-success-soft: #0F2A1D;
    --kz-warning: #F2B260;
    --kz-warning-soft: #2E2111;
    --kz-danger: #FF9B90;
    --kz-danger-soft: #35191A;
    --kz-info: #8EB3FF;
    --kz-info-soft: #14243F;
    --kz-flame: #FF7A45;
    --kz-on-flame: #0E1B33;
    --kz-flame-hover: #FF956A;
    --kz-flame-text: #FF7A45;
    --kz-flame-soft: #3A2216;
    --kz-on-flame-soft: #FF7A45;
    --kz-chip: #1C273D;
    --kz-hover: #182339;
    --kz-hair: rgba(255, 255, 255, 0.07);
    --kz-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 12px 28px -10px rgba(0, 0, 0, 0.55);
    --kz-shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 16px -10px rgba(0, 0, 0, 0.5);
    --kz-shadow-lift: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 18px 36px -12px rgba(0, 0, 0, 0.7);
    --kz-shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
    --kz-art: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
    --kz-dim: rgba(0, 0, 0, 0.62);
    --kz-band: #070C16;
    --kz-on-band: #FFFFFF;
    --kz-on-band-soft: #C3CBDB;
    --kz-on-band-muted: #9CA9C1;
    --kz-band-good: #5CD08F;
    --kz-surface-rgb: 17, 27, 46;
    --kz-ink-rgb: 238, 241, 246;
  }
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --kz-ink: #EEF1F6;
    --kz-muted: #A3ADC0;
    --kz-line: #26334C;
    --kz-field: #5D6A84;
    --kz-ground: #0A1222;
    --kz-surface: #111B2E;
    --kz-brand: #1B2A47;
    --kz-on-brand: #FFFFFF;
    --kz-brand-text: #C3CBDB;
    --kz-accent: #FF7A45;
    --kz-on-accent: #0E1B33;
    --kz-accent-soft: #3A2216;
    --kz-focus: #FF7A45;
    --kz-success: #5CD08F;
    --kz-success-soft: #0F2A1D;
    --kz-warning: #F2B260;
    --kz-warning-soft: #2E2111;
    --kz-danger: #FF9B90;
    --kz-danger-soft: #35191A;
    --kz-info: #8EB3FF;
    --kz-info-soft: #14243F;
    --kz-flame: #FF7A45;
    --kz-on-flame: #0E1B33;
    --kz-flame-hover: #FF956A;
    --kz-flame-text: #FF7A45;
    --kz-flame-soft: #3A2216;
    --kz-on-flame-soft: #FF7A45;
    --kz-chip: #1C273D;
    --kz-hover: #182339;
    --kz-hair: rgba(255, 255, 255, 0.07);
    --kz-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 12px 28px -10px rgba(0, 0, 0, 0.55);
    --kz-shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 16px -10px rgba(0, 0, 0, 0.5);
    --kz-shadow-lift: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 18px 36px -12px rgba(0, 0, 0, 0.7);
    --kz-shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
    --kz-art: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
    --kz-dim: rgba(0, 0, 0, 0.62);
    --kz-band: #070C16;
    --kz-on-band: #FFFFFF;
    --kz-on-band-soft: #C3CBDB;
    --kz-on-band-muted: #9CA9C1;
    --kz-band-good: #5CD08F;
    --kz-surface-rgb: 17, 27, 46;
    --kz-ink-rgb: 238, 241, 246;
  }
}

:root {
    /* ── The rule book's colours under the Admin's names ───────────────── */
    --k-ink: var(--kz-ink);
    --k-text: var(--kz-ink);
    --k-muted: var(--kz-muted);
    --k-line: var(--kz-line);
    --k-hair: var(--kz-hair);
    --k-ground: var(--kz-ground);
    --k-surface: var(--kz-surface);
    --k-field: var(--kz-field);         /* input borders, 3:1 on the card */
    --k-chip: var(--kz-chip);
    --k-hover: var(--kz-hover);
    --k-green: var(--kz-success);
    --k-green-soft: var(--kz-success-soft);
    --k-amber: var(--kz-warning);
    --k-amber-soft: var(--kz-warning-soft);
    --k-red: var(--kz-danger);
    --k-red-soft: var(--kz-danger-soft);
    --k-blue: var(--kz-info);
    --k-blue-soft: var(--kz-info-soft);

    /* Owner, 12 Nov 2026 (option A): Admin is always Klonza's orange and
       navy, the main action the logo's orange with navy words on it. A firm
       shows itself by its name, letter and logo only; its own colours paint
       its flyers, pages and app, never Admin. */
    --k-accent: var(--kz-flame);
    --k-accent-hover: var(--kz-flame-hover);
    --k-accent-deep: var(--kz-flame-hover);
    --k-on-accent: var(--kz-on-flame);
    --k-accent-text: var(--kz-flame-text);
    --k-accent-soft: var(--kz-flame-soft);
    --k-on-accent-soft: var(--kz-on-flame-soft);
    --k-second: var(--kz-flame);
    --k-on-second: var(--kz-on-flame);
    --k-second-hover: var(--kz-flame-hover);
    --k-second-text: var(--kz-flame-text);
    --k-second-soft: var(--kz-flame-soft);
    --k-on-second-soft: var(--kz-on-flame-soft);
    --k-focus: var(--kz-focus);
    --k-action: linear-gradient(135deg, var(--kz-flame-hover) 0%, var(--kz-flame) 100%);
    --k-flame: var(--kz-flame);
    --k-flame-soft: var(--kz-flame-soft);
    --k-flame-text: var(--kz-flame-text);

    /* ── The menu and the hero: the navy band, in both looks ───────────── */
    --k-hero: linear-gradient(155deg, var(--kz-navy-900) 0%, var(--kz-navy-800) 100%);
    --k-nav-text: color-mix(in srgb, var(--kz-muted) 62%, var(--kz-ink));
    --k-nav-bg: color-mix(in srgb, var(--kz-surface) 55%, var(--kz-ground));
    --k-nav-on-bg: var(--kz-surface);
    --k-nav-on-text: var(--kz-ink);
    --k-pill-bg: color-mix(in srgb, var(--kz-band-good) 20%, transparent);
    --k-pill-text: var(--kz-band-good);
    --k-ink-2: color-mix(in srgb, var(--kz-band) 88%, var(--kz-on-band));   /* menu hover */
    --k-ink-3: color-mix(in srgb, var(--kz-band) 80%, var(--kz-on-band));   /* menu active */
    --k-ink-text: var(--kz-on-band-soft);
    --k-ink-muted: var(--kz-on-band-muted);

    /* ── Shadows and the dim behind a pop-up ───────────────────────────── */
    --k-shadow: var(--kz-shadow);
    --k-shadow-sm: var(--kz-shadow-sm);
    --k-dim: var(--kz-dim);

    /* ── Type: the rule book's eight sizes, in rem (14px is 0.875rem at the browser's own 16px), so a person who
       raises their browser's text size gets larger words in Admin too ──── */
    --k-font: var(--kz-font);
    --k-mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --k-32: var(--kz-rem-32); --k-24: var(--kz-rem-24); --k-20: var(--kz-rem-20); --k-18: var(--kz-rem-18);
    --k-16: var(--kz-rem-16); --k-14: var(--kz-rem-14); --k-13: var(--kz-rem-13); --k-12: var(--kz-rem-12);

    /* ── Corners: the work screens' 14px for cards, 10px inside them ──── */
    --k-r: var(--kz-corner-work);
    --k-card-r: var(--kz-corner-work);
    --k-r-sm: var(--kz-corner-small);
    --k-menu-w: 232px;
}

/* ── The dark look: each staff member picks Automatic (the computer's own
   setting, the default), Light or Dark; the page carries data-theme from the
   server, so there is no flash of the other look. The rule book turns its own
   colours; only the hero and the menu's words are the Admin's. Screen only:
   a page printed in the dark look prints light, as the rule book does. ── */
@media screen {
    :root[data-theme="dark"] {
    --k-hero: linear-gradient(160deg, var(--kz-navy-800) 0%, var(--kz-surface) 100%);
    --k-nav-text: var(--kz-muted);
    --k-nav-on-bg: var(--kz-flame);
    --k-nav-on-text: var(--kz-on-flame);
    }
}
@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
    --k-hero: linear-gradient(160deg, var(--kz-navy-800) 0%, var(--kz-surface) 100%);
    --k-nav-text: var(--kz-muted);
    --k-nav-on-bg: var(--kz-flame);
    --k-nav-on-text: var(--kz-on-flame);
    }
}


* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--k-font);
    font-size: var(--k-14);
    line-height: 1.5;
    background: var(--k-ground);
    color: var(--k-text);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'ss01', 'cv11';
}
a { color: var(--k-accent-text); }
a:hover { color: var(--k-text); }
h1, h2, h3, h4 { color: var(--k-text); letter-spacing: -0.01em; }
/* A long word with no spaces (a 120-letter name) breaks inside its box, never pushes the page sideways (firm walk FA10). */
h1, h2, h3, h4, .page-title, .k-crumbs a { overflow-wrap: anywhere; }
/* In a table on a computer a long word still breaks inside its cell, but the column keeps room for a whole word: with
   "anywhere" the table took a name's column for one letter wide and broke names letter by letter beside an email (UI
   audit step 3, module 2). On a phone, where a table's rows stand as cards, a long word breaks anywhere as before. */
td a, td b { overflow-wrap: break-word; }
@media (max-width: 768px) { td a, td b { overflow-wrap: anywhere; } }
/* And in a sentence, a list or a flash line: an 80-letter name on a person's own page (firm walk FC6). */
p, li, .k-help, .k-flash, .card-title { overflow-wrap: anywhere; }
h2 { font-size: var(--k-18); font-weight: 600; }
h3 { font-size: var(--k-16); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--k-line); }
code { font-family: var(--k-mono); font-size: 0.92em; }
.mono { font-family: var(--k-mono); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
td.num, th.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num b, .money b { white-space: nowrap; overflow-wrap: normal; }
/* A tile's figure breaks only at a space, never inside a number. */
.stat-value, .k-kpi b, .k-stat b { overflow-wrap: normal; word-break: normal; }
small, .k-help { font-size: var(--k-13); color: var(--k-muted); }

*:focus-visible { outline: 2px solid var(--k-focus); outline-offset: 2px; }

/* ═══ THE MENU ═══════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--k-menu-w);
    background: var(--k-ink);
    color: var(--k-ink-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    height: 100dvh;
    z-index: 50;
    transition: transform .2s ease-in-out, width .15s;
}
.sidebar a { color: inherit; text-decoration: none; }
.sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 14px 10px;
}
.ws-mark {
    width: 28px; height: 28px; flex: none; border-radius: var(--k-r-sm);
    background: var(--k-accent); color: var(--k-on-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--kz-white) 18%, transparent);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--k-14);
    overflow: hidden;
}
.ws-mark img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .ws-mark { color: var(--k-on-accent); }
.ws-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.ws-name b { font-size: var(--k-14); font-weight: 600; color: var(--kz-on-band); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-name span { font-size: var(--k-12); color: var(--k-ink-muted); }
.nav-search-hint {
    display: flex; align-items: center; gap: 8px;
    margin: 4px 12px 8px; height: 36px; padding: 0 10px;
    border-radius: var(--k-r-sm); border: 0; cursor: pointer;
    background: var(--k-ink-2); color: var(--k-ink-muted);
    font: 400 var(--k-13) var(--k-font); text-align: left; width: calc(100% - 24px);
}
.nav-search-hint span { flex: 1; }
.nav-search-hint kbd { font-family: var(--k-mono); font-size: var(--k-12); }
/* A phone has no Ctrl K (full walk KA68). */
@media (hover: none) and (pointer: coarse) { .nav-search-hint kbd { display: none; } }
.nav-search-hint:hover { color: var(--kz-on-band); }
.nav-collapse-btn {
    background: none; border: none; color: var(--k-ink-muted);
    cursor: pointer; font-size: var(--k-13); padding: 4px 6px; border-radius: var(--k-r-sm);
}
.nav-collapse-btn:hover { color: var(--kz-on-band); background: var(--k-ink-2); }

.sidebar-nav { flex: 1; min-height: 0; list-style: none; overflow-y: auto; padding: 0 12px 12px; scrollbar-width: thin; scrollbar-color: var(--k-ink-3) transparent; }
.sidebar-nav ul { list-style: none; }
.sidebar-section-title, .nav-sec {
    font-size: var(--k-12); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--k-ink-muted); padding: 14px 10px 6px; pointer-events: none;
}
.sidebar-nav li a {
    display: flex; align-items: center; gap: 10px;
    height: 34px; padding: 0 10px; border-radius: var(--k-r-sm);
    font-size: var(--k-14); color: var(--k-ink-text);
}
.sidebar-nav li a i { width: 16px; text-align: center; font-size: var(--k-13); opacity: .7; }
.sidebar-nav li a span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav li a:hover { background: var(--k-ink-2); color: var(--kz-on-band); }
.sidebar-nav li a.active { background: var(--k-ink-3); color: var(--kz-on-band); font-weight: 500; box-shadow: none; }
.sidebar-nav li a.active i { opacity: 1; color: color-mix(in srgb, var(--k-accent) 45%, var(--kz-on-band)); }
.nav-badge {
    font-variant-numeric: tabular-nums; font-size: var(--k-12); line-height: 20px; height: 20px;
    padding: 0 6px; border-radius: 4px;
    background: var(--k-second); color: var(--k-on-second);
}
.super-pill {
    font-size: var(--k-12); font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
    padding: 1px 6px; border-radius: 4px;
    background: var(--k-second) !important; color: var(--k-on-second) !important;
}
.sidebar-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px 14px; border-top: 1px solid var(--k-ink-2);
}
.sidebar-footer .avatar {
    width: 28px; height: 28px; border-radius: 50%; flex: none;
    background: var(--k-ink-3); color: var(--k-ink-text);
    display: inline-flex; align-items: center; justify-content: center; font-size: var(--k-12); font-weight: 600;
}
.sidebar-footer .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.sidebar-footer .who b { font-size: var(--k-13); font-weight: 500; color: var(--kz-on-band); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who span { font-size: var(--k-12); color: var(--k-ink-muted); }
.sidebar-footer .out { color: var(--k-ink-muted); font-size: var(--k-13); padding: 6px; border-radius: var(--k-r-sm); }
.sidebar-footer .out:hover { color: var(--kz-on-band); background: var(--k-ink-2); }
.user-info { display: flex; align-items: center; gap: 8px; font-size: var(--k-13); }

/* Collapsed menu: icons only, label on hover. "[" toggles it. */
body.nav-collapsed .sidebar { width: 62px; }
body.nav-collapsed .main-content { margin-left: 62px; width: calc(100% - 62px); }
body.nav-collapsed .ws-name,
body.nav-collapsed .nav-search-hint span,
body.nav-collapsed .nav-search-hint kbd,
body.nav-collapsed .sidebar-nav a span,
body.nav-collapsed .nav-badge,
body.nav-collapsed .nav-sec,
body.nav-collapsed .sidebar-section-title,
body.nav-collapsed .super-pill,
body.nav-collapsed .sidebar-footer .who { display: none; }
body.nav-collapsed .sidebar-header { flex-direction: column; padding: 14px 0 8px; }
body.nav-collapsed .nav-search-hint { width: 38px; margin: 4px auto 8px; justify-content: center; padding: 0; }
body.nav-collapsed .sidebar-nav { padding: 0 8px 12px; }
body.nav-collapsed .sidebar-nav li a { justify-content: center; padding: 0; }
body.nav-collapsed .nav-collapse-btn { transform: rotate(180deg); }
body.nav-collapsed .sidebar-footer { flex-direction: column; padding: 10px 0 14px; }
body.nav-collapsed .sidebar-nav li a { position: relative; }
body.nav-collapsed .sidebar-nav li a:hover::after {
    content: attr(data-label); position: absolute; left: 100%; margin-left: 10px;
    background: var(--k-text); color: var(--k-surface); padding: 4px 10px; border-radius: var(--k-r-sm);
    font-size: var(--k-12); white-space: nowrap; z-index: 60; pointer-events: none;
}

/* ═══ PAGE FRAME ═════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--k-menu-w);
    width: calc(100% - var(--k-menu-w));
    padding: 0;
}
.header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 20px 32px 4px;
    background: transparent;
    border: 0;
}
.page-title { font-size: var(--k-24); font-weight: 600; letter-spacing: -0.02em; color: var(--k-text); }
.user-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header.header-bare { display: none; }
.admin-page { padding: 20px 32px 48px; }
.k-page { padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 24px; max-width: 1480px; }
.admin-page .page-header, .page-header {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.admin-page .page-header h1, .admin-page > h1, .page-header h1 {
    font-size: var(--k-24); font-weight: 600; letter-spacing: -0.02em; margin: 0;
}
.k-eyebrow { font-size: var(--k-12); letter-spacing: 0.06em; text-transform: uppercase; color: var(--k-muted); }
.k-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.k-head h1 { font-size: var(--k-32); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.k-head .k-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.k-lede { font-size: var(--k-16); color: var(--k-muted); max-width: 760px; }

/* Flash messages and alerts */
.k-flash { margin: 12px 32px 0; padding: 12px 16px; border-radius: var(--k-r); font-size: var(--k-14); }
.k-flash.ok, .alert-success { background: var(--k-green-soft); color: var(--k-green); }
.k-flash.bad, .alert-danger { background: var(--k-red-soft); color: var(--k-red); }
.alert { padding: 12px 16px; border-radius: var(--k-r); margin-bottom: 16px; font-size: var(--k-14); border: 0; }
.alert-warning { background: var(--k-amber-soft); color: var(--k-amber); }
.alert-info { background: var(--k-blue-soft); color: var(--k-blue); }

/* ═══ HUB TABS: related screens inside one page ══════════════════════════ */
.hub-tabs, .k-tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin: 0 32px 20px; padding: 0;
    border-bottom: 1px solid var(--k-line);
}
.admin-page .hub-tabs, .k-page .k-tabs { margin-left: 0; margin-right: 0; }
.hub-tab, .k-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 12px; margin-bottom: -1px;
    font-size: var(--k-14); color: var(--k-muted); text-decoration: none;
    background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
}
.hub-tab:hover, .k-tab:hover { color: var(--k-text); border-color: var(--k-line); }
.hub-tab.active, .k-tab.on { color: var(--k-text); border-bottom-color: var(--k-text); font-weight: 500; background: none; }
.hub-tab .n, .k-tab .n { font-variant-numeric: tabular-nums; font-size: var(--k-12); color: var(--k-amber); }
.tab-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--k-line); margin-bottom: 20px; }
.tab-nav button, .tab-nav a {
    padding: 10px 12px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
    cursor: pointer; font: 400 var(--k-14) var(--k-font); color: var(--k-muted); text-decoration: none;
}
.tab-nav button:hover, .tab-nav a:hover { color: var(--k-text); }
.tab-nav button.active, .tab-nav a.active { color: var(--k-text); border-bottom-color: var(--k-text); font-weight: 500; }

/* ═══ SURFACES ═══════════════════════════════════════════════════════════ */
.card, .k-panel {
    background: var(--k-surface);
    border: 1px solid var(--k-line);
    border-radius: var(--k-r);
    box-shadow: none;
    margin-bottom: 24px;
    overflow: hidden;
}
.k-panel { margin-bottom: 0; }
.card:has(table) { overflow-x: auto; overflow-y: visible; }
.card-header {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px; border-bottom: 1px solid var(--k-line);
}
.card-title { font-size: var(--k-16); font-weight: 600; color: var(--k-text); }
.card-body { padding: 20px; }
.k-pad { padding: 20px; }

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px; background: var(--k-line); border: 1px solid var(--k-line);
    border-radius: var(--k-r); overflow: hidden; margin-bottom: 24px;
}
.stat-card { background: var(--k-surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; border: 0; border-radius: 0; box-shadow: none; }
.stat-title { font-size: var(--k-12); letter-spacing: .06em; text-transform: uppercase; color: var(--k-muted); font-weight: 400; margin: 0; }
.stat-value { font-family: var(--k-font); font-size: var(--k-24); font-weight: 500; color: var(--k-text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-change { font-size: var(--k-13); color: var(--k-muted); margin: 0; }
.stat-change.positive { color: var(--k-green); }
.stat-change.negative { color: var(--k-red); }

/* ═══ TABLES: search, filters, saved views, CSV, then rows ═══════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--k-surface); font-size: var(--k-14); }
th, td { padding: 12px 16px; text-align: left; }
th {
    font-size: var(--k-12); font-weight: 500; color: var(--k-muted);
    text-transform: none; letter-spacing: 0;
    background: var(--k-surface); border-bottom: 1px solid var(--k-line);
    white-space: nowrap;
}
td { border-bottom: 1px solid color-mix(in srgb, var(--k-line) 60%, var(--k-surface)); color: var(--k-text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
/* A row's own label (a th in the body: a fact, a bill line) wraps like its value; only column heads stay on one line. */
table.k-cards tbody th { white-space: normal; }
table td details > summary.k-help { white-space: nowrap; cursor: pointer; }
/* A line of money's words (a bill, a statement) read like any line, at every width; the figure is beside them. */
table.k-cards tbody th:has(+ td.num) { font-size: var(--k-14); font-weight: 400; color: var(--k-text); background: none; border-bottom: 1px solid var(--k-hair); }
table.k-cards tbody tr:last-child > th:has(+ td.num) { border-bottom: none; }
tbody tr:hover td { background: var(--k-hover); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 10px 16px; background: var(--k-surface); }
.admin-table td { padding: 12px 16px; font-size: var(--k-14); }
.admin-table-compact th, .admin-table-compact td { padding: 9px 10px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--k-r-sm); font-size: var(--k-13); color: var(--k-text); text-decoration: none;
}
.pagination a { border: 1px solid var(--k-line); background: var(--k-surface); }
.pagination a:hover { border-color: var(--k-field); }
.pagination .active, .pagination a.active { background: var(--k-text); border-color: var(--k-text); color: var(--k-surface); }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-bar input[type="text"], .filter-bar input[type="search"] { min-width: 220px; }

/* ═══ BUTTONS: one primary per screen ════════════════════════════════════ */
.btn, .btn-sm {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 500 var(--k-14)/1 var(--k-font);
    border-radius: var(--k-r-sm); border: 1px solid var(--k-line);
    background: var(--k-surface); color: var(--k-text);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
/* Their sizes are under "Buttons: round" below. .btn-success wears the main look and .btn-warning the second:
   four looks only (Pack B, 27 Nov 2026), so no page brings a fifth. */
.btn:hover, .btn-sm:hover { border-color: var(--k-field); color: var(--k-text); }
.btn-primary, .btn.primary, .btn-success { background: var(--k-accent); border-color: var(--k-accent); color: var(--k-on-accent); }
.btn-primary:hover, .btn.primary:hover, .btn-success:hover { background: var(--k-accent-hover); border-color: var(--k-accent-hover); color: var(--k-on-accent); }
.btn-secondary, .btn-warning { background: var(--k-surface); border-color: var(--k-line); color: var(--k-text); }
.btn-secondary:hover, .btn-warning:hover { background: var(--k-hover); border-color: var(--k-field); color: var(--k-text); }
.btn-danger { background: var(--k-surface); border-color: color-mix(in srgb, var(--k-red) 30%, var(--k-surface)); color: var(--k-red); }
.btn-danger:hover { background: var(--k-red); border-color: var(--k-red); color: var(--k-surface); }
.btn-quiet, .btn.quiet { background: transparent; border-color: transparent; color: var(--k-accent-text); }
.btn[disabled], .btn-sm[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }

/* ═══ FORMS: labelled, with help text under the field ════════════════════ */
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="search"], input[type="tel"],
input[type="url"], input[type="password"], input:not([type]), select, textarea, .form-control {
    font: 400 var(--k-14) var(--k-font);
    color: var(--k-text);
    /* The colour alone, never the background shorthand: on a select.form-control the class would win over select's
       own rule and wipe its arrow (UI audit step 3: 74 pick-lists in 12 files looked like text boxes). */
    background-color: var(--k-surface);
    border: 1px solid var(--k-field);
    border-radius: var(--k-r-sm);
    padding: 0 12px;
    min-height: 40px;
    max-width: 100%;
}
textarea, textarea.form-control { padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 88px; }
.form-control { display: block; width: 100%; }
select[multiple] { padding: 6px; }
input:focus, select:focus, textarea:focus, .form-control:focus {
    outline: 2px solid color-mix(in srgb, var(--k-accent) 35%, transparent);
    outline-offset: 0;
    border-color: var(--k-accent-text);
    box-shadow: none;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--k-muted) 75%, var(--k-surface)); }
label, .form-label { font-size: var(--k-13); font-weight: 500; color: var(--k-text); }
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
fieldset { border: 0; min-width: 0; }
legend { font-size: var(--k-14); font-weight: 500; margin-bottom: 6px; }
.form-group label + .form-control, .form-group label + input, .form-group label + select, .form-group label + textarea { margin-top: 0; }
.k-field { display: grid; gap: 6px; margin-bottom: 16px; }
.k-field .help, .form-text { font-size: var(--k-13); font-weight: 400; color: var(--k-muted); }

.k-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.k-chip {
    display: inline-flex; align-items: center; gap: 6px; position: relative;
    height: 32px; padding: 0 12px; border-radius: var(--k-r-sm);
    border: 1px solid var(--k-line); background: var(--k-surface);
    font-size: var(--k-13); font-weight: 500; color: var(--k-muted);
    cursor: pointer; user-select: none;
}
.k-chip input { position: absolute; opacity: 0; pointer-events: none; }
.k-chip:hover { border-color: var(--k-field); }
.k-chip:has(input:checked), .k-chip.on { background: var(--k-text); border-color: var(--k-text); color: var(--k-surface); }
.k-chip input:focus-visible + span { outline: 2px solid var(--k-focus); outline-offset: 3px; border-radius: 3px; }

.k-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--k-r); background: color-mix(in srgb, var(--k-line) 70%, var(--k-ground)); }
.k-seg > * {
    border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: var(--k-r-sm);
    display: inline-flex; align-items: center;
    font: 500 var(--k-13) var(--k-font); color: var(--k-muted); text-decoration: none; cursor: pointer;
}
.k-seg > .on, .k-seg > .active, .k-seg label:has(input:checked), .k-seg > label.on:not(:has(input)) {
    background: var(--k-surface); color: var(--k-text); box-shadow: 0 1px 2px var(--kz-hair);
}
.k-seg label { display: inline-flex; align-items: center; cursor: pointer; }
/* The page a list is on, among its page numbers: dark, never the flame (one orange button a page). */
.btn.k-page-on { background: var(--k-text); border-color: var(--k-text); color: var(--k-surface); cursor: default; }

/* ═══ STATUS: the same few words, the same look, everywhere ══════════════ */
.status-badge, .badge, .tag {
    display: inline-flex; align-items: center; gap: 6px;
    height: 22px; padding: 0 8px; border-radius: 4px;
    font-size: var(--k-12); font-weight: 500; letter-spacing: 0; text-transform: none;
    white-space: nowrap; vertical-align: middle;
    background: var(--k-ground); color: var(--k-muted);
}
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-status, .status-inactive, .badge-secondary, .tag.neutral { background: var(--k-ground); color: var(--k-muted); }
.status-active, .status-success, .badge-success, .tag.ok { background: var(--k-green-soft); color: var(--k-green); }
.status-pending, .status-warning, .badge-warning, .tag.warn { background: var(--k-amber-soft); color: var(--k-amber); }
.status-danger, .badge-danger, .tag.bad { background: var(--k-red-soft); color: var(--k-red); box-shadow: none; }
.status-info, .badge-info, .tag.info { background: var(--k-blue-soft); color: var(--k-blue); }

/* ═══ SMALL PARTS ════════════════════════════════════════════════════════ */
.progress-bar { height: 6px; background: var(--k-line); border-radius: 3px; overflow: hidden; }
.progress-bar-fill, .progress-fill { height: 100%; background: var(--k-accent-text); border-radius: 3px; transition: width .3s; }
.chart-container { position: relative; height: 300px; width: 100%; }
.modal-overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--k-ink) 55%, transparent); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-content { background: var(--k-surface); border-radius: var(--k-r); padding: 24px; max-width: 420px; width: 92%; box-shadow: var(--kz-shadow-pop); }
.k-empty { border: 1px dashed var(--k-field); border-radius: var(--k-r); padding: 28px; display: flex; flex-direction: column; gap: 6px; color: var(--k-muted); }
.k-empty b { font-size: var(--k-16); color: var(--k-text); font-weight: 600; }

/* Folded blocks: the summary still says the answer. */
.k-fold { border: 1px solid var(--k-line); border-radius: var(--k-r); background: var(--k-surface); margin-bottom: 16px; }
.k-fold > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: var(--k-14); list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.k-fold > summary::-webkit-details-marker { display: none; }
.k-fold > summary::before { content: "\25B8"; color: var(--k-muted); font-size: var(--k-12); }
.k-fold[open] > summary::before { content: "\25BE"; }
.k-fold > summary .k-fold-value { font-weight: 400; color: var(--k-muted); font-size: var(--k-13); }
.k-fold > .k-fold-body { padding: 0 18px 16px; }

.k-split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.k-stack { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 16px; }
.k-work { display: grid; grid-template-columns: 1fr minmax(300px, 380px); gap: 16px; align-items: start; }

/* Count cards for a dashboard. */
.action-inbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--k-line); border: 1px solid var(--k-line); border-radius: var(--k-r); overflow: hidden; margin: 0 32px 24px; }
.inbox-card { display: flex; align-items: center; gap: 12px; background: var(--k-surface); padding: 14px 16px; text-decoration: none; color: var(--k-text); border: 0; }
.inbox-card:hover { background: var(--k-hover); }
.inbox-card .count { font-variant-numeric: tabular-nums; font-size: var(--k-24); font-weight: 500; min-width: 2.4rem; text-align: right; }
.inbox-card .label { font-size: var(--k-13); color: var(--k-muted); line-height: 1.3; }
.inbox-card.kind-warning .count { color: var(--k-amber); }
.inbox-card.kind-danger .count { color: var(--k-red); }

/* ═══ HOME: the to-do list ═══════════════════════════════════════════════ */
.k-todo a, .k-todo > div {
    display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 20px; align-items: center;
    padding: 16px 20px; border-top: 1px solid color-mix(in srgb, var(--k-line) 60%, var(--k-surface));
    text-decoration: none; color: var(--k-text);
}
.k-todo a:hover { background: var(--k-hover); color: var(--k-text); }
.k-todo .n { font-variant-numeric: tabular-nums; font-size: var(--k-24); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.k-todo .n.warn { color: var(--k-amber); }
.k-todo .n.bad { color: var(--k-red); }
.k-todo .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.k-todo .t b { font-size: var(--k-14); font-weight: 500; }
.k-todo .t span { font-size: var(--k-13); color: var(--k-muted); }
.k-todo .go { font-size: var(--k-13); font-weight: 500; color: var(--k-accent-text); }
.k-cols { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.k-cols > .main { flex: 999 1 520px; min-width: 0; }
.k-cols > .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* An invoice in Klonza Admin on a phone: Record a payment comes first, above the long invoice (16 Nov 2026, journey F9). */
@media (max-width: 768px) { .k-cols > .side:has(.k-record-pay) { order: -1; } }
.k-dark { background: var(--k-ink); color: var(--k-ink-text); border-radius: var(--k-r); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.k-dark .k-eyebrow { color: var(--k-ink-muted); }
.k-list > div { display: flex; gap: 14px; padding: 8px 0; font-size: var(--k-14); }
.k-list .when { width: 76px; flex: none; font-variant-numeric: tabular-nums; font-size: var(--k-13); color: var(--k-muted); }

/* ═══ MODULES: on/off switches ═══════════════════════════════════════════ */
.k-switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: var(--k-r); border: 0; background: var(--k-field); cursor: pointer; }
.k-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--kz-white); box-shadow: 0 1px 2px var(--kz-dim); transition: left .15s; }
.k-switch.on, .k-switch[aria-checked="true"] { background: var(--k-accent-text); }
.k-switch.on::after, .k-switch[aria-checked="true"]::after { left: 21px; }
.k-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid color-mix(in srgb, var(--k-line) 60%, var(--k-surface)); }
.k-row .t b { display: block; font-size: var(--k-14); font-weight: 500; }
.k-row .t span { font-size: var(--k-13); color: var(--k-muted); }
.k-lock { font-size: var(--k-12); color: var(--k-muted); display: inline-flex; align-items: center; gap: 6px; }
.k-banner { margin: 0 32px 16px; padding: 12px 16px; border-radius: var(--k-r); background: var(--k-blue-soft); color: var(--k-blue); font-size: var(--k-14); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.k-banner a { color: inherit; font-weight: 500; }

/* ═══ QUICK JUMP (⌘K) ════════════════════════════════════════════════════ */
.nav-palette-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--k-ink) 55%, transparent); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.nav-palette-backdrop.open { display: flex; }
.nav-palette { width: min(520px, 92vw); background: var(--k-surface); border-radius: var(--k-r); box-shadow: var(--kz-shadow-pop); overflow: hidden; }
.nav-palette input { width: 100%; border: 0; outline: 0; min-height: 52px; padding: 0 18px; font-size: var(--k-16); border-bottom: 1px solid var(--k-line); border-radius: 0; }
.nav-palette input:focus { outline: 0; }
.nav-palette-results { max-height: 46vh; overflow-y: auto; list-style: none; padding: 6px; }
.nav-palette-results li a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--k-r-sm); color: var(--k-text); text-decoration: none; font-size: var(--k-14); }
.nav-palette-results li a .group-hint { margin-left: auto; font-size: var(--k-12); color: var(--k-muted); }
.nav-palette-results li a:hover, .nav-palette-results li.selected a { background: var(--k-accent-soft); }
.nav-palette-empty { padding: 14px 18px; color: var(--k-muted); font-size: var(--k-14); }
/* A page found by an older name says so under its name. */
.nav-palette-results li a .nav-palette-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-palette-results li a .was-hint { font-size: var(--k-12); color: var(--k-muted); }
.nav-palette-results li.nav-palette-empty a { display: inline; padding: 0; color: var(--k-accent-text); font-weight: 600; background: none; }


/* ═══ PHONES: nothing scrolls sideways, targets stay 40px+ ═══════════════ */
/* The Look page's logo: a preview box, a real button to choose it, then save (journey F12). */
.k-logopick { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.k-logo-preview { width: 160px; height: 96px; flex: none; display: grid; place-items: center; border-radius: var(--k-r-sm); background: var(--kz-white); box-shadow: 0 0 0 1px var(--k-line); padding: 8px; overflow: hidden; }
/* Sized in pixels: a percentage of a grid cell grows with the picture, and a square logo spilled out of the box. */
.k-logo-preview img { max-width: 144px; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.k-logo-letter { width: 56px; height: 56px; border-radius: var(--k-r); display: grid; place-items: center; background: var(--k-hero); color: var(--kz-on-band); font-weight: 700; font-size: var(--k-24); }
.k-logopick-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; flex: 1 1 220px; }
.k-filebtn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
/* One styled file picker (live walk F6, D7): the label is the button; the browser's own box stays for the keyboard only. */
.k-filepick { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.k-filepick:has(.k-fileinput:focus-visible) .k-filebtn { outline: 2px solid var(--k-accent-text); outline-offset: 2px; }
.k-filepick[data-sending] .k-filebtn { opacity: .6; pointer-events: none; }
.k-filefield { display: inline-flex; min-width: 0; max-width: 100%; }
.k-filefield .k-filenames { overflow-wrap: anywhere; min-width: 0; }
.k-filefield .k-filebtn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
/* Any other file box in the Admin wears the kit's button, never the browser's plain grey one. */
input[type="file"]:not(.k-sr) { font: inherit; font-size: var(--k-14); color: var(--k-muted); }
input[type="file"]:not(.k-sr)::file-selector-button { font: inherit; font-weight: 600; color: var(--k-text); background: var(--k-surface); border: 1px solid var(--k-field); border-radius: 999px; padding: 8px 16px; margin-right: 12px; cursor: pointer; }
input[type="file"]:not(.k-sr)::file-selector-button:hover { border-color: var(--k-text); }
.k-logopick:has(#logoFile:focus-visible) .k-filebtn { outline: 2px solid var(--k-accent-text); outline-offset: 2px; }
/* A box whose choices can be long: its words end in "..." before the arrow, never under it. */
select.k-select-fit { width: 100%; max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding-right: 36px; }
.k-phonebar { display: none; }
.k-phonebrand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--k-text); text-decoration: none; }
.k-phonebrand-words { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.k-phonebrand-words b { font-size: var(--k-14); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-phonebrand-words span { font-size: var(--k-13); color: var(--k-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-menu-toggle { display: none; font-size: var(--k-20); background: none; border: 0; color: var(--k-text); cursor: pointer; width: 40px; height: 40px; border-radius: var(--k-r-sm); }
/* The rule book's wide switch (1024): no page draws these between 900 and 1024 any other way (Pack C release 2). */
@media (max-width: 1024px) {
    .k-split, .k-work { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar, body.nav-collapsed .sidebar { width: var(--k-menu-w); transform: translateX(-100%); padding: 12px 14px 10px; }
    .sidebar.active { transform: translateX(0); box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--k-ink) 45%, transparent); }
    .sidebar .sidebar-header { gap: 8px; padding: 0 0 8px; }
    .sidebar .ws-chip { padding: 7px 10px; }
    .sidebar .nav-search-hint { height: 34px; margin: 0 0 6px; }
    .sidebar .sidebar-nav { padding: 0 0 10px; }
    .sidebar .sidebar-nav > li > a { height: 33px; }
    .sidebar #sideNav > li.nav-item.nav-divider { margin-top: 4px; padding-top: 4px; }
    .sidebar .k-look { margin: 4px 0 8px; }
    .sidebar .sidebar-footer { padding: 8px 4px 0; }
    /* clip after hidden: clip cuts what is wider than the screen without making main-content a scroll box, so the
       phone's top bar really stays on screen (UI audit, 26 Nov 2026). A browser without clip keeps hidden. */
    .main-content, body.nav-collapsed .main-content { margin-left: 0; width: 100%; overflow-x: hidden; overflow-x: clip; }
    body.nav-collapsed .ws-name, body.nav-collapsed .sidebar-nav a span, body.nav-collapsed .nav-sec,
    body.nav-collapsed .nav-search-hint span, body.nav-collapsed .sidebar-footer .who { display: revert; }
    .nav-collapse-btn { display: none; }
    .mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .header, .header.header-bare { display: flex; justify-content: flex-start; padding: 8px 14px; background: var(--k-ground); }
    /* The phone's top bar: the firm's logo (or letter) and name, the page's name, the menu (owner, 16 Nov 2026, journey decision 7). */
    .k-phonebar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; padding: 8px 8px 8px 16px; background: var(--k-ground); border-bottom: 1px solid color-mix(in srgb, var(--k-line) 70%, transparent); }
    .header .page-title { font-size: var(--k-18); margin-right: auto; }
    .admin-page, .k-page { padding: 12px 16px 48px; }
    .hub-tabs, .k-tabs { margin: 0 16px 16px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .admin-page .hub-tabs { margin-left: 0; margin-right: 0; }
    .hub-tab, .k-tab { white-space: nowrap; }
    .k-flash, .k-banner, .action-inbox { margin-left: 16px; margin-right: 16px; }
    .btn, .btn-sm, .hub-tab, .k-chip, .k-seg > * { min-height: 40px; }
    input, select, textarea, .form-control { min-height: var(--kz-field-h-phone); font-size: var(--kz-field-text-phone); }
    .filter-bar, .admin-page .page-header { flex-direction: column; align-items: stretch; }
    .filter-bar > *, .filter-bar input, .filter-bar select { width: 100%; }
    .k-head h1 { font-size: var(--k-24); }
    .k-todo a { grid-template-columns: 64px minmax(0, 1fr); }
    .k-todo .go { display: none; }
    .card { overflow-x: visible; }
    .card:has(table) { overflow-x: auto; overflow-y: visible; }
    table.k-cards, table.k-cards thead { display: block; }
    table.k-cards thead { display: none; }
    table.k-cards tbody, table.k-cards tr, table.k-cards td { display: block; width: 100%; }
    table.k-cards tr { border: 1px solid var(--k-line); border-radius: var(--k-r); margin-bottom: 10px; padding: 10px 12px; background: var(--k-surface); }
    table.k-cards td { border: 0; padding: 4px 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
    table.k-cards td::before { content: attr(data-label); font-size: var(--k-12); text-transform: uppercase; letter-spacing: .06em; color: var(--k-muted); flex: 0 0 5.5rem; }
    table.k-cards td[data-label=""]::before, table.k-cards td:not([data-label])::before { display: none; }
    table.k-cards td.num { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
@media print {
    .sidebar, .header, .hub-tabs, .mobile-menu-toggle, .k-phonebar { display: none !important; }
    .main-content { margin: 0; width: 100%; }
}

/* ═══ HUB HEADER: the menu item's tabs, above the screen ═════════════════ */
.k-hubhead { padding: 20px 32px 0; display: flex; flex-direction: column; gap: 6px; }
.k-hubhead .hub-tabs { margin: 0; }
.k-hubhead .k-hubtitle { margin-top: 18px; }
.header.header-tools { display: none; }
.has-hub .admin-page .page-header h1, .has-hub .admin-page > h1 { font-size: var(--k-24); }
.has-hub .admin-page { padding-top: 20px; }
@media (max-width: 768px) {
    .header.header-tools { display: flex; }
    .k-hubhead { padding: 4px 16px 0; }
    .k-hubhead .hub-tabs { margin: 0; }
}
.hub-tabs-sub { border-bottom: 0; gap: 2px; margin-bottom: 16px; }
.hub-tabs-sub .hub-tab { border: 0; border-radius: var(--k-r-sm); padding: 6px 10px; font-size: var(--k-13); margin: 0; }
.hub-tabs-sub .hub-tab.active { background: var(--k-surface); box-shadow: inset 0 0 0 1px var(--k-line); }

/* Screens built without .admin-page / .k-page still get the page margins. */
.page-body { padding: 0 32px 48px; }
.page-body:has(> .admin-page), .page-body:has(> .k-page) { padding: 0; }
@media (max-width: 768px) {
    .page-body { padding: 0 16px 48px; }
    .page-body:has(> .admin-page), .page-body:has(> .k-page) { padding: 0; }
}

/* ═══ MENU GROUPS ════════════════════════════════════════════════════════ */
.nav-group-block { list-style: none; }
.nav-group-list { list-style: none; }
.nav-item { position: relative; }
body.nav-collapsed .nav-sec { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   THE PREMIUM LOOK (Look A, 12 Nov 2026)

   Laid over the kit above, so every screen gets it: a warm light ground, a
   light menu whose page is a white raised pill, white cards with a soft
   shadow, Inter with tight big titles, figures in the same type as the words.
   ═══════════════════════════════════════════════════════════════════════════ */

body { background: var(--k-ground); color: var(--k-text); font-size: var(--k-14); }
h1, h2, h3, h4 { letter-spacing: -0.02em; }
h2 { font-weight: 700; }
.ph { flex: none; vertical-align: middle; }
.ph-dt { fill: var(--k-flame); opacity: .25; }

/* ── The menu ──────────────────────────────────────────────────────────── */
.sidebar {
    background: var(--kz-band);
    border-right: 1px solid color-mix(in srgb, var(--kz-on-band) 8%, transparent);
    color: var(--kz-on-band-soft);
    padding: 18px 14px 12px;
}
.sidebar-header { flex-direction: column; align-items: stretch; gap: 12px; padding: 0 0 12px; }
.k-brand { display: inline-flex; padding: 2px 10px; align-self: flex-start; }
.k-brand .k-logo { height: 22px; width: auto; }
.sidebar .k-brand .k-logo-navy, .sidebar .k-brand .k-logo-light { display: none; }
.sidebar .k-brand .k-logo-paper, .sidebar .k-brand .k-logo-dark { display: block; }
.ws-chip, .sidebar .ws-chip {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 0 2px;
    border-radius: var(--k-r); background: color-mix(in srgb, var(--kz-on-band) 6%, transparent); border: 1px solid color-mix(in srgb, var(--kz-on-band) 9%, transparent); color: var(--kz-on-band); box-shadow: none;
}
.sidebar .ws-mark, .ws-mark {
    width: 30px; height: 30px; border-radius: var(--k-r-sm); box-shadow: none;
    background: var(--k-hero); color: var(--kz-on-band); font-size: var(--k-13); font-weight: 700;
}
/* A logo sits on white, never on the dark tile: a dark logo vanished on it. */
.sidebar .ws-mark:has(img), .ws-mark:has(img) { background: var(--kz-white); padding: 3px; box-shadow: 0 0 0 1px var(--k-line); }
.ws-mark img { object-fit: contain; }
body:not(.nav-collapsed) .sidebar .ws-chip.has-wordmark { justify-content: space-between; }
body:not(.nav-collapsed) .sidebar .ws-chip.has-wordmark .ws-mark { width: auto; height: 32px; max-width: 136px; padding: 4px 8px; border-radius: 8px; display: inline-flex; align-items: center; }
body:not(.nav-collapsed) .sidebar .ws-chip.has-wordmark .ws-mark img { height: 100%; width: auto; max-width: 120px; object-fit: contain; }
body:not(.nav-collapsed) .sidebar .ws-chip.has-wordmark .ws-name b { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ws-name b, .sidebar .ws-name b { color: var(--kz-on-band); font-weight: 600; font-size: var(--k-14); }
.ws-name span, .sidebar .ws-name span { color: var(--kz-on-band-muted); }
.sidebar-nav { padding: 2px 0 8px; scrollbar-color: color-mix(in srgb, var(--kz-on-band) 14%, transparent) transparent; }
.sidebar-nav li a {
    height: 37px; padding: 0 10px; border-radius: var(--k-r-sm); gap: 9px;
    font-size: var(--k-14); font-weight: 500; color: var(--kz-on-band-soft);
}
.sidebar-nav li a .ph { opacity: 1; color: var(--kz-on-band-muted); }
.sidebar-nav li a i { color: var(--kz-on-band-muted); opacity: 1; }
.sidebar-nav li a:hover { background: color-mix(in srgb, var(--kz-on-band) 6%, transparent); color: var(--kz-on-band); }
.sidebar-nav li a:hover .ph, .sidebar-nav li a:hover i { color: var(--kz-on-band); }
.k-logo-dark { display: none; }
/* The light logo on paper whatever the screen's look: the dark one only on a dark screen. */
@media screen {
    :root[data-theme="dark"] .k-logo-light { display: none; }
    :root[data-theme="dark"] .k-logo-dark { display: inline; }
}
@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .k-logo-light { display: none; }
    :root:not([data-theme="light"]) .k-logo-dark { display: inline; }
}
.sidebar-nav li a.active {
    background: linear-gradient(180deg, var(--kz-flame-hover) 0%, var(--kz-flame) 100%); color: var(--kz-on-flame); font-weight: 700;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kz-white) 28%, transparent), 0 4px 12px color-mix(in srgb, var(--kz-flame) 28%, transparent);
}
.sidebar-nav li a.active .ph, .sidebar-nav li a.active i, .sidebar-nav li a.active svg { color: var(--kz-on-flame); }
.sidebar-footer { color: var(--kz-on-band-soft); border-top: 1px solid color-mix(in srgb, var(--kz-on-band) 8%, transparent); border-top-color: color-mix(in srgb, var(--kz-on-band) 8%, transparent); padding: 12px 4px 0; }
.k-look, .sidebar .k-look {
    display: flex; gap: 2px; padding: 3px; margin: 0 0 10px; border-radius: var(--k-r);
    background: color-mix(in srgb, var(--kz-on-band) 5%, transparent); border: 1px solid color-mix(in srgb, var(--kz-on-band) 8%, transparent); color: var(--kz-on-band-soft);
}
.k-look button, .sidebar .k-look button {
    flex: 1; height: 30px; border: 0; border-radius: var(--k-r-sm); background: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: var(--kz-on-band-muted);
}
.k-look button:hover, .sidebar .k-look button:hover { color: var(--kz-on-band); }
.k-look button.on, .sidebar .k-look button.on { background: color-mix(in srgb, var(--kz-on-band) 12%, transparent); color: var(--kz-on-band); box-shadow: none; }
.sidebar-footer .avatar { background: var(--k-hero); color: var(--kz-on-band); }
.sidebar-footer .who b { color: var(--kz-on-band); }
.sidebar-footer .who span { color: var(--kz-on-band-muted); }
.sidebar-footer .out, .sidebar-footer .out:hover { color: var(--kz-on-band-muted); background: none; border: 0; cursor: pointer; display: inline-flex; }
.sidebar-footer .out:hover { color: var(--kz-on-band); background: color-mix(in srgb, var(--kz-on-band) 6%, transparent); }

.nav-search-hint, .sidebar .nav-search-hint {
    width: 100%; margin: 0 0 10px; height: 38px; padding: 0 12px; gap: 10px; border-radius: var(--k-r);
    background: color-mix(in srgb, var(--kz-on-band) 4%, transparent); border: 1px solid color-mix(in srgb, var(--kz-on-band) 9%, transparent); border-color: color-mix(in srgb, var(--kz-on-band) 9%, transparent); color: var(--kz-on-band-muted); font-weight: 500;
}
.nav-search-hint:hover, .sidebar .nav-search-hint:hover { background: color-mix(in srgb, var(--kz-on-band) 7%, transparent); color: var(--kz-on-band); }
.nav-search-hint kbd, .sidebar .nav-search-hint kbd { font-family: var(--k-font); font-size: var(--k-12); font-weight: 600; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--kz-on-band) 8%, transparent); color: var(--kz-on-band-muted); }
.nav-palette { border-radius: var(--k-r); }
.nav-palette-results li a .ph { color: var(--k-muted); }
[hidden] { display: none !important; }

/* ── The page's top: a small label, a big tight title, its "?" ─────────── */
.header { padding: 32px 38px 10px; align-items: flex-end; }
.k-titlebox { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.k-titleline { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: var(--k-32); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.k-eyebrow { font-size: var(--k-12); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--k-muted); }
.k-eyebrow a { color: inherit; text-decoration: none; }
.k-eyebrow a:hover { color: var(--k-text); }
.k-eyebrow a { display: inline-flex; align-items: center; gap: 2px; }
.k-back { transform: rotate(180deg); margin-left: -4px; }
/* The way back above a title ("< Leads and CRM") reads small, but takes a 44px place to tap on a phone (UI audit step 3,
   module 2: it was 18 pixels tall). The place reaches over the space around it, never over another button. */
@media (max-width: 768px) {
    .k-eyebrow a { position: relative; }
    .k-eyebrow a::after { content: ''; position: absolute; left: -8px; right: -8px; top: -13px; bottom: -13px; }
}
body.is-home .header { display: none; }

.k-about { position: relative; }
.k-about > summary {
    list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--k-surface); color: var(--k-muted); box-shadow: var(--k-shadow-sm);
}
.k-about > summary::-webkit-details-marker { display: none; }
.k-about > summary:hover, .k-about[open] > summary { color: var(--k-text); }
/* Closed, the note takes no room: current Chrome still lays out a closed <details>' inside, and the note's box,
   hung from the "?" at the end of the title, ran past a phone's edge (Commission report). */
.k-about:not([open]) > .k-about-body { display: none; }
.k-about-body {
    position: absolute; z-index: 40; top: 38px; left: 0; width: min(440px, 80vw);
    background: var(--k-surface); border-radius: var(--k-r); box-shadow: var(--k-shadow), 0 0 0 1px var(--k-hair);
    padding: 14px 16px; font-size: var(--k-14); font-weight: 400; letter-spacing: 0; color: var(--k-text); line-height: 1.55;
}

/* The pages inside a menu item, as pills; then a page's own tabs, underlined. */
.k-sectabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 8px 38px 18px; padding: 4px; width: fit-content; max-width: calc(100% - 76px);
    border-radius: var(--k-r); background: color-mix(in srgb, var(--k-line) 65%, var(--k-ground)); }
/* One line at any width: a row longer than the page scrolls sideways, never wraps (journey F14); the page's own tabs too. */
.k-sectabs::-webkit-scrollbar, .hub-tabs::-webkit-scrollbar, .k-tabs::-webkit-scrollbar { display: none; }
.hub-tabs, .k-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.hub-tab, .k-tab { white-space: nowrap; flex: none; }
.k-more-right { mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.k-more-left { mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.k-more-left.k-more-right { mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
/* With its arrows, a row uses sticky left and right buttons to scroll both ways (live walk D1). */
.k-has-more.k-more-right { mask-image: none; }
.k-has-more.k-more-left { mask-image: none; }
.k-tabmore, .k-tabless { position: sticky; z-index: 3; flex: none; align-self: center; width: 30px; height: 30px; border-radius: 999px;
    border: 1px solid var(--k-hair); background: var(--k-surface); color: var(--k-text); font-size: var(--k-20); line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; }
.k-tabmore { right: -4px; margin-left: auto; box-shadow: -10px 0 10px 6px color-mix(in srgb, var(--k-line) 65%, var(--k-ground)); }
.k-tabless { left: -4px; margin-right: auto; box-shadow: 10px 0 10px 6px color-mix(in srgb, var(--k-line) 65%, var(--k-ground)); }
.hub-tabs .k-tabmore, .k-tabs .k-tabmore { right: 0; box-shadow: -12px 0 12px 6px var(--k-ground); }
.hub-tabs .k-tabless, .k-tabs .k-tabless { left: 0; box-shadow: 12px 0 12px 6px var(--k-ground); }
.k-tabmore[hidden], .k-tabless[hidden] { display: none; }
.k-sectab { flex: none; }
.k-sectab { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--k-r-sm);
    font-size: var(--k-14); font-weight: 500; color: var(--k-nav-text); text-decoration: none; white-space: nowrap; }
.k-sectab:hover { color: var(--k-text); }
.k-sectab.active { background: var(--k-surface); color: var(--k-text); font-weight: 600; box-shadow: var(--k-shadow-sm); }
.hub-tabs, .k-tabs { margin: 0 0 20px; border-bottom: 1px solid var(--k-line); }
.hub-tab, .k-tab { font-weight: 500; color: var(--k-muted); }
.hub-tab.active, .k-tab.on { color: var(--k-text); border-bottom-color: var(--k-flame); font-weight: 600; }

.page-body { padding: 4px 38px 56px; }
.page-body:has(> .admin-page), .page-body:has(> .k-page) { padding: 4px 38px 56px; }
.admin-page, .k-page { padding: 0; max-width: 1320px; }
.k-flash { margin: 0 38px 16px; border-radius: var(--k-r); font-weight: 500; }

/* ── Surfaces ──────────────────────────────────────────────────────────── */
.card, .k-panel, .k-fold {
    border: 1px solid var(--k-line); border-radius: var(--k-card-r);
    background: var(--k-surface); box-shadow: var(--k-shadow);
}
.card { margin-bottom: 20px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--k-hair); }
.card-title { font-size: var(--k-16); font-weight: 700; letter-spacing: -0.01em; }
.card-body, .k-pad { padding: 22px 24px; }
.stats-grid { gap: 14px; background: none; border: 0; border-radius: 0; overflow: visible; }
.stat-card { border-radius: var(--k-r); background: color-mix(in srgb, var(--k-ground) 60%, var(--k-surface)); padding: 16px 18px; }
.card .stat-card { background: var(--k-ground); }
.stats-grid > .stat-card:only-child, .stats-grid:not(.card .stats-grid) > .stat-card { background: var(--k-surface); box-shadow: var(--k-shadow); }
.stat-title { font-size: var(--k-13); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--k-muted); }
.stat-value { font-family: var(--k-font); font-size: var(--k-24); font-weight: 800; letter-spacing: -0.03em; }
@media (max-width: 640px) {
    .stats-grid:has(> .stat-card:nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
    .stats-grid:has(> .stat-card:nth-child(2)) .stat-card { padding: 12px 14px; border-radius: var(--k-r); }
    .stats-grid:has(> .stat-card:nth-child(2)) .stat-title { font-size: var(--k-12); line-height: 1.3; }
    /* A figure never breaks in the middle ("₦54,000,00" over "0", UI audit 26 Nov 2026): it stays on one line and its
       size follows the tile's own width, so ₦171,505,580 fits a two-up tile on a 360px phone. A phone that does not
       know container units (iOS 15, older Chrome) drops the clamp and keeps the plain 0.875rem before it, which fits too
       (1.0625rem did not: ₦171,505,580 is 118px at 17px, and a tile inside a card has 106px inside it at 360px). */
    .stats-grid:has(> .stat-card:nth-child(2)) .stat-card { container-type: inline-size; }
    .stats-grid:has(> .stat-card:nth-child(2)) .stat-value { font-size: var(--k-14); font-size: clamp(0.8125rem, 13cqi, 1.25rem); white-space: nowrap; overflow-wrap: normal; }
    .stats-grid:has(> .stat-card:nth-child(2)) .stat-value small { white-space: normal; }
}

table { background: transparent; }
th { background: transparent; font-size: var(--k-12); font-weight: 600; color: var(--k-muted); padding-top: 14px; }
td { border-bottom: 1px solid var(--k-hair); }
th, td { padding-left: 20px; padding-right: 20px; }
tbody tr:hover td { background: color-mix(in srgb, var(--k-ground) 55%, var(--k-surface)); }
.card > table thead th:first-child, .card > .table-responsive table thead th:first-child { padding-left: 24px; }
.card > table td:first-child { padding-left: 24px; }

/* ── Buttons: round, one main action; four looks, three sizes (Pack B, 27 Nov 2026, drawing m11) ──
   Main (orange), second (white with a line), danger (white, red words and a soft red line, filled red when
   pointed at), quiet (words only). On a computer, where a mouse is precise: the main button 44px (the rule book's
   --kz-button-h), every other 36px, a small one 30px, words 14px (13px small). A phone has its own sizes, further down. */
.btn, .btn-sm { border-radius: 999px; font-weight: 600; border-color: var(--k-hair); box-shadow: 0 1px 2px var(--kz-hair); }
.btn { height: 36px; padding: 0 18px; font-size: var(--k-14); }
.btn-primary, .btn.primary, .btn-success { height: var(--kz-button-h); padding: 0 20px; font-size: var(--k-14); }
.btn-sm, .btn-sm.primary { height: 30px; padding: 0 12px; font-size: var(--k-13); }
/* The page's one orange button is its main action (one-flame keeps a single one), so it takes the main size even
   where the page drew it small: Orders' "Record a sale" is the approved drawing's main action. In a table row, the
   day picker and Ask Klo it stays small. */
.btn-sm.primary, .btn-sm.btn-primary { height: var(--kz-button-h); padding: 0 20px; font-size: var(--k-14); }
:is(td, .k-dates-pop, .klo-dock) :is(.btn-sm.primary, .btn-sm.btn-primary) { height: 30px; padding: 0 12px; font-size: var(--k-13); }
.btn-secondary, .btn:not(.btn-primary):not(.primary):not(.btn-danger):not(.btn-success):not(.btn-quiet):not(.quiet):not(.k-page-on) { background: var(--k-surface); border-color: var(--k-line); }
.btn-danger { border-color: color-mix(in srgb, var(--k-red) 30%, var(--k-surface)); }
.btn-primary, .btn.primary, .btn-success, .btn-primary:hover, .btn.primary:hover, .btn-success:hover {
    background: var(--k-action); border-color: transparent; color: var(--k-on-accent);
    box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--k-accent) 70%, transparent);
}
.btn-primary:hover, .btn.primary:hover, .btn-success:hover { filter: brightness(1.04); }
.btn-quiet, .btn.quiet { box-shadow: none; }
.btn-quiet:hover, .btn.quiet:hover { border-color: transparent; background: var(--k-hover); color: var(--k-accent-text); }
.btn .ph, .btn-sm .ph { margin: 0 -2px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="search"], input[type="tel"],
input[type="url"], input[type="password"], input:not([type]), select, textarea, .form-control {
    border-radius: var(--k-r-sm); min-height: var(--kz-field-h); background-color: var(--k-surface); max-width: 100%; min-width: 0;
}
select {
    appearance: none; -webkit-appearance: none;
    padding-right: 36px !important;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.form-group { min-width: 0; max-width: 100%; }
.form-group > select, .form-group > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { width: 100%; max-width: 100%; }
label, .form-label { font-weight: 600; }
/* A tick box and its words sit on one line, the box never stretched or cut. */
input[type="checkbox"], input[type="radio"] {
    width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0;
    accent-color: var(--k-ink); vertical-align: middle; cursor: pointer;
}
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
    display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer;
    line-height: 1.4; min-width: 0; white-space: normal; background: none;
}
.form-group:has(> label > input[type="checkbox"]), .form-group:has(> label > input[type="radio"]) { flex-direction: row; flex-wrap: wrap; align-items: center; }

.tag, .status-badge, .badge { border-radius: 999px; height: 24px; padding: 0 10px; font-weight: 600; }

/* ── Empty states, folds, notes ────────────────────────────────────────── */
.k-empty { border: 0; border-radius: var(--k-card-r); background: var(--k-surface); box-shadow: var(--k-shadow); padding: 28px; position: relative; min-height: 92px; justify-content: center; }
.k-empty::before {
    display: none;
    content: ''; position: absolute; left: 22px; top: 50%; margin-top: -26px; width: 52px; height: 52px;
    /* An empty list shows the tray things arrive in, never the shared "?" (live walk K11). */
    background: var(--k-empty-art, url("/admin/art/inbox.d17b839bda.webp")) center / contain no-repeat;
    filter: var(--kz-art);
}
.card .k-empty, .k-fold .k-empty { box-shadow: none; background: color-mix(in srgb, var(--k-ground) 60%, var(--k-surface)); }
.k-fold { margin-bottom: 16px; }
.k-fold > summary { padding: 16px 22px; font-size: var(--k-16); font-weight: 700; align-items: center; transition: background .12s ease; }
.k-fold > summary::before, .k-fold[open] > summary::before { content: none; }
.k-menu:not([open]) > .k-menu-list { display: none; }
.k-fold > summary .k-fold-value { flex: 1; font-size: var(--k-14); font-weight: 400; color: var(--k-muted); }
.k-fold > summary:has(> .k-fold-value) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; row-gap: 2px; align-items: center;
}
.k-fold > summary:has(> .k-fold-value) > span:first-child { grid-column: 1; min-width: 0; }
.k-fold > summary:has(> .k-fold-value) > .k-fold-value { grid-column: 1; min-width: 0; }
.k-fold > summary:has(> .k-fold-value) > .k-fold-value:empty { display: none; }
.k-fold > summary:has(> .k-fold-value) > .k-edit,
.k-fold > summary:has(> .k-fold-value):not(:has(.k-edit)):not(.btn):not(.btn-sm)::after {
    grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-left: 0;
}
@media (max-width: 768px) {
    .k-fold > summary { padding: 14px 16px; }
    .k-fold > .k-fold-body { padding: 14px 16px 16px; }
    .k-fold .k-fold > summary { padding: 12px 14px; }
}
.k-fold > summary .k-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--k-line); font-size: var(--k-13); font-weight: 600; color: var(--k-text); background: var(--k-surface); }
.k-fold[open] > summary .k-edit .k-edit-open { display: none; }
.k-fold:not([open]) > summary .k-edit .k-edit-close { display: none; }
.k-fold > summary:not(:has(.k-edit)):not(.btn):not(.btn-sm)::after {
    content: ''; margin-left: auto; flex: none;
    width: 8px; height: 8px; border-right: 2px solid var(--k-muted); border-bottom: 2px solid var(--k-muted);
    transform: rotate(45deg); transition: transform .15s ease, border-color .15s ease;
    margin-right: 4px; margin-top: -2px;
}
.k-fold[open] > summary:not(:has(.k-edit)):not(.btn):not(.btn-sm)::after {
    transform: rotate(225deg); margin-top: 3px; border-color: var(--k-text);
}
.k-fold > summary:not(.btn):not(.btn-sm):hover {
    background: color-mix(in srgb, var(--k-hover) 65%, transparent);
    border-radius: var(--k-r);
}
.k-fold[open] > summary:not(.btn):not(.btn-sm):hover {
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.k-fold > .k-fold-body { padding: 4px 22px 20px; border-top: 1px solid var(--k-hair); padding-top: 18px; }
.k-fold-help { font-size: var(--k-13); color: var(--k-muted); margin-bottom: 12px; max-width: 760px; }

/* A row of fields or buttons on one line, wrapping on a narrow screen. */
.k-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 0; border: 0; margin: 4px 0 12px; }
.k-row > .form-group { flex: 1 1 200px; margin-bottom: 0; }
.k-row > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .k-row > select { flex: 1 1 180px; min-width: 0; }
.k-row > .k-help { flex: 1 1 100%; }
.k-row > .card { flex: 1 1 280px; margin: 0; }
.k-row > label:has(> input[type="checkbox"]) { align-self: center; }

/* A switch with its words: the box is drawn as a small toggle, the words beside it. */
.k-plainset { border: 0; margin: 0; padding: 0; min-width: 0; max-width: 100%; }
label.k-switch, label.k-switch:has(> input[type="checkbox"]) {
    position: static; width: auto; height: auto; min-width: 0; max-width: 100%; flex: 0 1 auto; flex-wrap: wrap; border-radius: 0; background: none; cursor: pointer;
    display: flex; align-items: center; gap: 12px; padding: 8px 0; margin: 2px 0;
    font-size: var(--k-14); font-weight: 500; color: var(--k-text);
}
label.k-switch::after { content: none; }
label.k-switch input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; position: relative; flex: none;
    width: 42px; height: 24px; border-radius: var(--k-r); background: var(--k-field); transition: background .15s;
}
label.k-switch input[type="checkbox"]::before {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--k-surface); box-shadow: 0 1px 2px var(--kz-dim); transition: left .15s;
}
label.k-switch input[type="checkbox"]:checked { background: var(--k-ink); }
label.k-switch input[type="checkbox"]:checked::before { left: 21px; }
label.k-switch input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }

/* Headings inside a form card keep their distance from what came before. */
.card-body > h3:not(:first-child), form > h3:not(:first-child), .card-body > h2:not(:first-child) { margin-top: 22px; }
.card-body > h3 + .k-help, .card-body > h2 + .k-help { margin: 4px 0 10px; }

/* Fields inside a table fill their cell, never wider than the table. */
td > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), td > select { width: 100%; min-width: 5rem; }
.card { overflow: visible; }
.card:has(table) { overflow-x: auto; overflow-y: visible; }
td > .k-help { display: block; margin-top: 4px; }
td a:not(.btn):not(.btn-sm) { color: var(--k-text); font-weight: 600; text-decoration: none; }
td a:not(.btn):not(.btn-sm):hover { color: var(--k-accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* A row's "more" menu: rarely used moves, each confirmed on its own page. */
.k-menu-cell { width: 1%; text-align: right; }
.k-menu { position: relative; display: inline-block; }
.k-menu > summary { list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: var(--k-r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--k-muted); }
.k-menu > summary::-webkit-details-marker { display: none; }
.k-menu > summary:hover, .k-menu[open] > summary { background: color-mix(in srgb, var(--k-line) 60%, transparent); color: var(--k-text); }
.k-menu-list { position: absolute; right: 0; top: 40px; z-index: 30; min-width: 190px; padding: 6px; border-radius: var(--k-r);
    background: var(--k-surface); box-shadow: var(--k-shadow), 0 0 0 1px var(--k-hair); display: flex; flex-direction: column; text-align: left; }
.k-menu-list a { padding: 9px 12px; border-radius: var(--k-r-sm); color: var(--k-text) !important; font-weight: 500 !important; text-decoration: none !important; white-space: nowrap; }
.k-menu-list a:hover { background: color-mix(in srgb, var(--k-line) 50%, transparent); }
/* A row menu may hold buttons too (a move posted by the row's own form). */
.k-menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: var(--k-r-sm); background: none; color: var(--k-text); font: 500 var(--k-14) var(--k-font); white-space: nowrap; cursor: pointer; }
.k-menu-list button:hover { background: color-mix(in srgb, var(--k-line) 50%, transparent); }
/* A number box in a table row: as wide as its number, never the column's whole width. */
input.k-num-in { width: 9ch; min-width: 0; }
/* Quick views on the left, the page's main button on the right, on one line. */
.k-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.k-viewbar > .k-views { margin: 0; }
/* The first thing to type, in an empty state: a box and its button on one line. */
.k-inline-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.k-inline-add input:not([type=hidden]) { flex: 1 1 240px; min-width: 0; min-height: 44px; }
.k-empty-acts form.k-inline-add { display: flex; flex-wrap: nowrap; width: 100%; max-width: 560px; }
/* A closed calendar or More menu takes no room at all. Current Chrome still lays out a closed <details>' inside
   (content-visibility), so without this the calendar's buttons had boxes below the bar (the walk read them as a second row). */
.k-dates:not([open]) > .k-dates-pop, .k-more:not([open]) > .k-more-list { display: none; }
@media (max-width: 768px) {
    .k-empty-acts form.k-inline-add { flex-wrap: wrap; }
    .k-empty-acts form.k-inline-add > * { flex: 1 1 100%; }
    /* A phone's filter bar: choices two to a row, the page's own button on a row of its own. */
    .k-filterbar > .k-fb-select { flex: 1 1 calc(50% - 5px); }
    .k-filterbar > .btn { flex: 1 1 100%; }
}
.k-confirm { max-width: 620px; display: flex; flex-direction: column; gap: 14px; font-size: var(--k-16); }

/* ═══ HOME ═══════════════════════════════════════════════════════════════ */
.k-art { flex: none; display: block; object-fit: contain; filter: var(--kz-art); }
.k-art-dark { display: none; }
@media screen {
    :root[data-theme="dark"] .k-art-light { display: none; }
    :root[data-theme="dark"] .k-art-dark { display: block; }
}
@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .k-art-light { display: none; }
    :root:not([data-theme="light"]) .k-art-dark { display: block; }
}
.k-hero .k-hero-art, .k-stat-art, .k-hero-art { display: none; }
.k-need .k-art { width: 44px; height: 44px; margin: -4px 0; }
.k-kpi .top, .k-stat .top { align-items: center; }
.k-kpi .top .k-art, .k-stat .top .k-art { display: none; }
.k-stat-icon {
    width: 34px; height: 34px; border-radius: var(--k-r-sm);
    background: var(--k-accent-soft); color: var(--k-accent-text);
    display: inline-grid; place-items: center; flex: none;
}
.k-stat-icon .ph { color: var(--k-accent-text); }

.k-home { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; max-width: 1380px; }
.k-home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.k-home-head h1 { font-size: var(--k-24); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.k-home-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.k-home-head .btn-primary, .k-home-head .btn-secondary { height: 40px; padding: 0 16px; font-size: var(--k-14); border-radius: var(--k-r-sm); }
.k-live-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--k-surface); border: 1px solid var(--k-line);
    padding: 0 13px; height: 38px; border-radius: 999px;
    font-size: var(--k-13); font-weight: 500; color: var(--k-muted);
    text-decoration: none; box-shadow: var(--k-shadow-sm);
}
.k-live-pill:hover { color: var(--k-text); border-color: var(--k-field); }
.k-live-pill b { color: var(--k-text); font-weight: 700; }
.k-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--k-green); box-shadow: 0 0 0 3px var(--k-green-soft); flex: none; }
.nav-group-label {
    font-size: var(--k-12); font-weight: 700; letter-spacing: 0.09em;
    /* 12px words in the 15.75px line the 10.5px ones took, so the menu below stays where it was (Pack C release 2). */
    text-transform: uppercase; color: var(--kz-on-band-muted); line-height: 1.3125;
    padding: 12px 12px 4px; list-style: none; user-select: none;
}
.sidebar-nav > .nav-group-label:first-child { padding-top: 4px; }
.nav-group-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%;
    padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit;
    text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-align: left;
}
.nav-group-btn:hover { color: var(--kz-on-band-soft); }
.nav-group-caret { width: 13px; height: 13px; opacity: .75; transition: transform .18s ease; flex: none; }
.nav-group-btn.is-folded .nav-group-caret { transform: rotate(-90deg); }
.sidebar-nav li.super-folded { display: none; }
.sidebar-toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .nav-collapse-btn {
    width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
    color: var(--kz-on-band-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    flex: none; transition: background .15s, color .15s;
}
.sidebar .nav-collapse-btn:hover { background: color-mix(in srgb, var(--kz-on-band) 8%, transparent); color: var(--kz-on-band); }
.nav-fold-row {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px;
    margin: 0 0 8px; border-radius: var(--k-r-sm); border: 0; background: transparent; color: var(--kz-on-band-muted);
    font-size: var(--k-14); font-weight: 500; cursor: pointer; transition: background .15s, color .15s;
}
.nav-fold-row:hover { background: color-mix(in srgb, var(--kz-on-band) 6%, transparent); color: var(--kz-on-band); }
.sidebar-nav li a .nav-badge {
    margin-left: auto; flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: color-mix(in srgb, var(--kz-flame) 18%, transparent); color: var(--kz-flame-hover); border: 1px solid color-mix(in srgb, var(--kz-flame) 28%, transparent);
    font-size: var(--k-12); font-weight: 700;
    display: inline-grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums;
}
.sidebar-nav li a.active .nav-badge { background: var(--kz-band); color: var(--kz-on-band); border-color: transparent; }
@media (min-width: 769px) {
    .sidebar { transition: width .18s cubic-bezier(.2, .8, .2, 1), padding .18s ease; }
    .main-content { transition: margin-left .18s cubic-bezier(.2, .8, .2, 1), width .18s cubic-bezier(.2, .8, .2, 1); }
    body.nav-collapsed .sidebar { width: 68px; padding: 18px 10px 14px; overflow: visible; }
    body.nav-collapsed .main-content { margin-left: 68px; width: calc(100% - 68px); }
    body.nav-collapsed .k-brand,
    body.nav-collapsed .ws-name,
    body.nav-collapsed .nav-search-hint span,
    body.nav-collapsed .nav-search-hint kbd,
    body.nav-collapsed .sidebar-nav a span,
    body.nav-collapsed .nav-group-label,
    body.nav-collapsed .nav-fold-row span,
    body.nav-collapsed .k-look,
    body.nav-collapsed .sidebar-footer .who { display: none; }
    body.nav-collapsed .sidebar-header { gap: 10px; padding: 0 0 10px; align-items: center; }
    body.nav-collapsed .sidebar-toprow { justify-content: center; width: 100%; }
    body.nav-collapsed .ws-chip { justify-content: center; padding: 6px; margin: 0 auto; width: 42px; height: 42px; }
    body.nav-collapsed .nav-search-hint { width: 42px; height: 38px; margin: 0 auto 10px; justify-content: center; padding: 0; }
    body.nav-collapsed .sidebar-nav { padding: 2px 0 10px; overflow-x: visible; overflow-y: auto; }
    body.nav-collapsed .sidebar-nav li.super-folded { display: block; }
    body.nav-collapsed .sidebar-nav li a { width: 44px; height: 40px; margin: 0 auto; justify-content: center; padding: 0; position: relative; }
    body.nav-collapsed .sidebar-nav li a .nav-badge {
        display: block; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
        min-width: 8px; padding: 0; font-size: 0; border-radius: 50%;
        background: var(--kz-flame); border: 1.5px solid var(--kz-band);
    }
    body.nav-collapsed .nav-fold-row { width: 44px; height: 38px; margin: 0 auto 8px; justify-content: center; padding: 0; }
    body.nav-collapsed .nav-collapse-btn svg,
    body.nav-collapsed .nav-fold-row svg { transform: rotate(180deg); }
    body.nav-collapsed .sidebar-footer { flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 2px; }
}
@media (max-width: 768px) {
    .nav-collapse-btn, .nav-fold-row { display: none !important; }
}
.k-home-top { display: grid; grid-template-columns: 1.42fr 1fr; gap: 16px; align-items: stretch; }
.k-home-top.solo { grid-template-columns: 1fr; }
.k-hero {
    position: relative; overflow: hidden; border-radius: var(--k-card-r); padding: 0; min-height: 215px;
    background: var(--k-hero); color: var(--kz-on-band); border: 1px solid color-mix(in srgb, var(--kz-on-band) 10%, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kz-on-band) 8%, transparent), var(--kz-shadow-lift);
    display: flex; flex-direction: column; justify-content: space-between; text-decoration: none;
}
.k-hero::after { display: none; }
.k-hero:hover { color: var(--kz-on-band); }
.k-hero-head { padding: 20px 22px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.k-hero small { font-size: var(--k-13); font-weight: 600; color: var(--kz-on-band-soft); display: flex; align-items: center; gap: 8px; }
.k-hero b { font-size: var(--k-32); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; display: block; margin-top: 4px; }
.k-hero .pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
    font-size: var(--k-12); font-weight: 700; background: color-mix(in srgb, var(--kz-band-good) 18%, transparent); color: var(--kz-band-good); border: 1px solid color-mix(in srgb, var(--kz-band-good) 32%, transparent); position: relative; z-index: 1; white-space: nowrap; }
.k-hero .pill.down { background: color-mix(in srgb, var(--kz-flame) 18%, transparent); color: var(--kz-flame-hover); border-color: color-mix(in srgb, var(--kz-flame) 30%, transparent); }
.k-hero .pill.flat { background: color-mix(in srgb, var(--kz-on-band) 10%, transparent); color: var(--kz-on-band-soft); border-color: color-mix(in srgb, var(--kz-on-band) 16%, transparent); }
.k-hero-chart { padding: 0 22px; height: 62px; display: flex; align-items: flex-end; }
.k-hero-well {
    margin-top: auto; padding: 12px 22px; border-top: 1px solid color-mix(in srgb, var(--kz-on-band) 9%, transparent);
    background: color-mix(in srgb, var(--kz-band) 45%, transparent);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
    position: relative; z-index: 1;
}
.k-hero-well > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.k-hero-well span { font-size: var(--k-12); font-weight: 500; color: var(--kz-on-band-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-hero-well span i { font-style: normal; }
.k-mob-lbl { display: none; }
.k-hero-well strong, .k-hero-well b { font-size: var(--k-14); font-weight: 700; color: var(--kz-on-band); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.25; margin: 0; }
.k-needs { padding: 0; margin: 0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.k-needs-head { padding: 14px 20px 11px; border-bottom: 1px solid var(--k-hair); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.k-needs-title, .k-glance-title { font-size: var(--k-12); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--k-muted); margin: 0; }
.k-needs-badge { background: var(--k-accent-soft); color: var(--k-accent-text); font-size: var(--k-12); font-weight: 700; padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-needs-list { display: flex; flex-direction: column; flex: 1; }
.k-need { display: flex; align-items: flex-start; gap: 11px; padding: 12px 20px; border-bottom: 1px solid var(--k-hair); color: var(--k-text); text-decoration: none; font-size: var(--k-14); }
.k-need:last-child { border-bottom: 0; }
.k-need:hover { color: var(--k-text); background: var(--k-hover); }
.k-need-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kz-flame); flex: none; margin-top: 5px; }
.k-need-dot.bad { background: var(--k-red); }
.k-need .t { flex: 1; min-width: 0; line-height: 1.35; }
.k-need .t b { display: block; font-size: var(--k-14); font-weight: 700; color: var(--k-text); }
.k-need .t span { display: block; font-size: var(--k-12); color: var(--k-muted); margin-top: 2px; font-weight: 400; }
.k-need .go { font-size: var(--k-13); font-weight: 700; color: var(--k-accent-text); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; align-self: center; }
.k-needs-foot {
    background: color-mix(in srgb, var(--k-ground) 45%, var(--k-surface));
    border-top: 1px solid var(--k-hair);
    padding: 10px 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    font-size: var(--k-12); font-weight: 600; color: var(--k-muted);
}
.k-needs-foot a { color: var(--k-text); font-weight: 700; text-decoration: none; white-space: nowrap; flex: none; }
.k-needs-foot a:hover { text-decoration: underline; }
.k-allclear { display: flex; align-items: center; gap: 12px; padding: 18px 20px; color: var(--k-muted); font-size: var(--k-14); }
.k-allclear .ph { color: var(--k-green); }
.k-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.k-kpi, .k-stat { margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: var(--k-text); overflow: hidden; transition: transform .15s, border-color .15s; }
.k-kpi:not(.k-home-card):not(:has(> .k-kpi-body)), .k-stat:not(.k-home-card):not(:has(> .k-kpi-body)) {
    padding: 16px 20px; gap: 6px; background: var(--k-surface); border-radius: var(--k-card-r); box-shadow: var(--k-shadow); min-width: 0;
}
.page-body .k-banner, .admin-page .k-banner, .k-page .k-banner { margin-left: 0; margin-right: 0; }
.k-kpi:hover, .k-stat:hover { color: var(--k-text); transform: translateY(-1px); }
.k-kpi-body { padding: 16px 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.k-kpi .top, .k-stat .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.k-kpi small, .k-stat small { font-size: var(--k-13); font-weight: 600; color: var(--k-muted); }
.k-kpi .ph, .k-stat .ph { color: var(--k-text); }
.k-kpi .k-stat-icon .ph, .k-stat .k-stat-icon .ph { color: var(--k-accent-text); }
.k-kpi b, .k-stat b { font-size: var(--k-24); font-weight: 800; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15; }
.k-kpi-sub { font-size: var(--k-12); color: var(--k-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k-kpi-pill { font-size: var(--k-12); font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.k-kpi-pill.ok { background: var(--k-green-soft); color: var(--k-green); }
.k-kpi-pill.accent { color: var(--k-accent-text); background: var(--k-accent-soft); }
.k-thumb-stack { display: inline-flex; align-items: center; }
.k-thumb-stack img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; border: 2px solid var(--k-surface); margin-left: -7px; }
.k-thumb-stack img:first-child { margin-left: 0; }
.k-credit-meter { height: 7px; width: 100%; background: color-mix(in srgb, var(--k-line) 80%, var(--k-surface)); border-radius: 999px; overflow: hidden; display: flex; margin-top: 8px; }
.k-credit-meter i { display: block; height: 100%; }
.k-credit-meter i.gen { background: var(--kz-info); }
.k-credit-meter i.bon { background: var(--kz-flame); }
.k-kpi em, .k-stat em { font-style: normal; font-size: var(--k-13); font-weight: 600; color: var(--k-green); }
.k-kpi em.quiet, .k-stat em.quiet { color: var(--k-muted); font-weight: 500; }
.k-stat-foot {
    margin-top: auto; padding: 10px 20px; border-top: 1px solid var(--k-hair);
    background: color-mix(in srgb, var(--k-ground) 45%, var(--k-surface));
    font-size: var(--k-12); font-weight: 600; color: var(--k-muted);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.k-kpi-go { color: var(--k-text); font-weight: 700; white-space: nowrap; }
.k-feed { padding: 6px 22px; margin: 0; }
.k-feed-title { padding: 16px 0 6px; }
.k-fd { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--k-hair); font-size: var(--k-14); color: var(--k-text); text-decoration: none; }
.k-fd:last-child { border-bottom: 0; }
.k-fd:hover { color: var(--k-text); }
.k-fd .who { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: var(--k-13); font-weight: 700; background: var(--k-chip); color: var(--k-text); }
.k-fd .who.k { background: var(--k-hero); color: var(--kz-on-band); }
.k-fd .what { flex: 1; min-width: 0; }
.k-fd .at { margin-left: auto; color: var(--k-muted); font-size: var(--k-13); white-space: nowrap; }
.k-glance { padding: 18px 22px 8px; margin: 0; }
.k-glance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 24px; }
.k-glance-grid a, .k-glance-grid > div { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--k-hair); color: var(--k-text); text-decoration: none; font-size: var(--k-14); }
.k-glance-grid .ph { color: var(--k-muted); }
.k-glance-grid .v { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.k-glance-grid a:hover .l { text-decoration: underline; text-underline-offset: 3px; }


/* Lists: a head with search and the main button; a row opens from anywhere on it. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.k-listhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.k-listhead .filter-bar { margin-bottom: 0; flex: 1 1 520px; }
.k-listhead .card-title { margin: 0; }
table.k-rows tbody tr { position: relative; }
table.k-rows tbody tr:hover { background: var(--k-hover); }
a.k-rowlink::after { content: ''; position: absolute; inset: 0; }
table.k-rows td form, table.k-rows td .btn, table.k-rows td a:not(.k-rowlink), table.k-rows td input, table.k-rows td select, table.k-rows td button { position: relative; z-index: 1; }
td a.k-rowlink { color: var(--k-text); }
tr.k-opens { cursor: pointer; }
tr.k-opens:hover { background: var(--k-hover); }
tr.k-opens td:first-child a:not(.btn) b, tr.k-opens td:first-child a:not(.btn) { text-decoration: underline; text-decoration-color: var(--k-line); text-underline-offset: 4px; }
td a.k-rowlink b { text-decoration: underline; text-decoration-color: var(--k-line); text-underline-offset: 4px; }
/* Forms in parts: two fields side by side on a computer, one on a phone. */
.k-form { display: flex; flex-direction: column; gap: 16px; }
.k-form .card-title { margin: 6px 0 0; }
.k-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 16px; }
.k-two > * { min-width: 0; }
.k-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.k-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
/* Choosing one: a card per choice. */
.k-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.k-choice { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--k-line); border-radius: var(--k-r); background: var(--k-surface); cursor: pointer; }
.k-choice input { margin-top: 3px; accent-color: var(--k-accent); }
.k-choice span { display: flex; flex-direction: column; gap: 3px; }
.k-choice small { color: var(--k-muted); font-size: var(--k-13); line-height: 1.4; }
.k-choice:has(input:checked) { border-color: var(--k-accent); box-shadow: 0 0 0 1px var(--k-accent); }
/* Permissions, under headings. */
.k-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.k-permgroup { border: 1px solid var(--k-line); border-radius: var(--k-r); padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.k-permgroup legend { font-weight: 700; font-size: var(--k-14); padding: 0 6px; }
.k-tick { display: flex; gap: 8px; align-items: flex-start; font-size: var(--k-14); line-height: 1.4; cursor: pointer; }
.k-tick input { margin-top: 3px; accent-color: var(--k-accent); flex: none; }
.k-canlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.k-canlist ul { margin: 6px 0 0 18px; padding: 0; color: var(--k-muted); font-size: var(--k-14); line-height: 1.5; }
/* Roles, as cards. */
.k-rolegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.k-rolecard { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--k-card-r); background: var(--k-surface); box-shadow: var(--k-shadow); color: var(--k-text); text-decoration: none; }
.k-rolecard:hover { color: var(--k-text); box-shadow: 0 0 0 1px var(--k-accent); }
.k-rolecard-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.k-rolecard small { color: var(--k-muted); font-size: var(--k-13); line-height: 1.4; }
.k-personhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
    .k-home-top { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { padding-top: 18px; }
    .header { padding: 10px 16px; background: var(--k-ground); }
    body.is-home .header { display: none; }
    .page-title { font-size: var(--k-20); }
    .k-sectabs { margin: 4px 16px 12px; max-width: calc(100% - 32px); overflow-x: auto; flex-wrap: nowrap; }
    /* 36px to see, 44px to tap (UI audit step 3: the row measured 32): the tap reaches into the row's own padding. */
    .k-sectab { height: 36px; padding: 0 12px; font-size: var(--k-13); position: relative; }
    .k-sectab::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
    /* The page's name once on a phone (UI audit step 3): the bar at the top says it, so the heading is read out only. */
    body.has-tabbar .header .page-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
    body.has-tabbar .header:not(:has(.k-eyebrow, .k-about)) { padding: 0; min-height: 0; }
    .page-body, .page-body:has(> .admin-page), .page-body:has(> .k-page) { padding: 4px 16px 64px; }
    .k-flash { margin: 0 16px 14px; }
    .k-home { gap: 12px; padding-top: 2px; }
    .k-home-head { gap: 10px; align-items: flex-start; }
    .k-home-head h1 { font-size: var(--k-24); line-height: 1.15; margin-top: 2px; }
    .k-live-pill { display: none; }
    .k-home-actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
    /* On a phone Home's head buttons take the kit's sizes like every other (Pack B): 50px main, 44px other. */
    .k-home-head .btn-primary, .k-home-head .btn-secondary { width: 100%; justify-content: center; height: auto; padding: 0 12px; }
    .k-home-head .btn-primary { font-size: var(--k-16); }
    .k-home-head .btn-secondary { font-size: var(--k-16); }
    .k-startcard-line .k-step-sub { display: none; }
    .k-startcard .k-steps-segs { width: 130px; }
    .k-startcard .k-step-acts .btn { width: 100%; justify-content: center; min-height: 38px; font-size: var(--k-13); }
    .k-hero { min-height: 0; }
    .k-hero-head { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px 8px; }
    .k-hero small { white-space: nowrap; }
    .k-hero b { font-size: var(--k-32); }
    .k-hero-chart { padding: 0 18px; height: 48px; }
    .k-hero-chart.is-flat { height: 14px; }
    .k-hero-well { padding: 10px 18px; gap: 8px; }
    .k-desk-lbl { display: none; }
    .k-mob-lbl { display: inline; }
    .k-needs-head, .k-need, .k-needs-foot, .k-kpi-body, .k-stat-foot { padding-left: 16px; padding-right: 16px; }
    .k-kpi b, .k-stat b { font-size: var(--k-24); }
    /* Under the note on a phone, never beneath it (live walk D13: the chip sat on top of the line). */
    .k-hero svg.k-trend { position: static; align-self: flex-end; margin-top: 10px; max-width: 100%; opacity: .5; }
    .k-about-body { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
}

/* ── Parts any Admin page may use: Klonza Admin first (13 Nov 2026) ─────── */
.k-paneltabs { margin: 0 0 4px; }
.k-panel-body { display: flex; flex-direction: column; gap: 20px; }
.k-panel-body[hidden] { display: none; }
.k-panel-body > .card, .k-page > .card { margin-bottom: 0; }
.k-bar { height: 8px; border-radius: 999px; background: var(--k-line); overflow: hidden; min-width: 96px; }
.k-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--k-accent); }
.k-bar.warn > span { background: var(--k-amber); }
.k-bar.bad > span { background: var(--k-red); }
.k-bar.ok > span { background: var(--k-green); }
.k-formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 18px; align-items: start; }
.k-formgrid .form-group { margin: 0; }
.k-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.k-inline > input:not([type="hidden"]), .k-inline > select { flex: 1 1 180px; min-width: 0; }
.k-inline > .k-help { flex-basis: 100%; }
.k-section { display: flex; flex-direction: column; gap: 12px; }
.k-section + .k-section { border-top: 1px solid var(--k-hair); padding-top: 20px; }
.k-section h3 { font-size: var(--k-14); font-weight: 700; }
.k-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 24px; margin: 0; }
.k-dl > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.k-dl dt { font-size: var(--k-13); color: var(--k-muted); font-weight: 500; }
.k-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.k-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.k-fact { border-radius: var(--k-r); background: var(--k-surface); box-shadow: var(--k-shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; text-decoration: none; color: var(--k-text); }
a.k-fact:hover { color: var(--k-text); transform: translateY(-1px); }
.k-fact small { font-size: var(--k-13); font-weight: 500; color: var(--k-muted); display: flex; align-items: center; gap: 6px; }
.k-fact b { font-size: var(--k-24); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.k-fact span { font-size: var(--k-13); color: var(--k-muted); }
.k-fact.warn b { color: var(--k-amber); }
.k-fact.bad b { color: var(--k-red); }
.k-idline { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; color: var(--k-muted); font-size: var(--k-14); }
.k-idline .mono { color: var(--k-text); }
.k-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.k-toolbar .k-chips { flex: 1 1 auto; }
a.k-chip { text-decoration: none; color: var(--k-text); }
a.k-chip .n { color: var(--k-muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
a.k-chip.on .n { color: inherit; opacity: .75; }
.k-names { font-size: var(--k-13); color: var(--k-muted); }
.k-home-top:not(.solo) { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .k-home-top:not(.solo) { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    /* A list on a phone: each row is its own card, its first cell its title. */
    .card:has(> table.k-cards) { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
    .card:has(> table.k-cards) > .card-header { padding: 4px 2px 10px; border: 0; }
    .card:has(> table.k-cards) > .card-body { padding: 8px 2px; }
    table.k-cards tr { border: 0; border-radius: var(--k-r); box-shadow: var(--k-shadow); padding: 14px 16px; margin-bottom: 12px; }
    .card > table.k-cards td:first-child, table.k-cards td { padding-left: 0; padding-right: 0; }
    table.k-cards td:first-child { padding-bottom: 8px; display: block; font-size: var(--k-16); }
    table.k-cards td:first-child::before { display: none; }
    table.k-cards td { display: block; position: relative; padding-left: 7.5rem; min-height: 26px; }
    table.k-cards td::before { position: absolute; left: 0; top: 7px; width: 7rem; overflow-wrap: break-word; line-height: 1.25; }
    table.k-cards td:first-child, table.k-cards td[data-label=""], table.k-cards td:not([data-label]) { padding-left: 0; }
    .card-body table.k-cards tr, .k-section table.k-cards tr { box-shadow: none; border: 1px solid var(--k-hair); }
    /* A table of facts (each row a th, then its value) stays one card of lines on a phone: a card for each
       fact, with the label's own underline, was what "About them" and a bill's lines looked like. */
    table.k-cards tr:has(> th:first-child) { border: 0; border-bottom: 1px solid var(--k-hair); border-radius: 0; box-shadow: none; background: none; padding: 10px 0; margin: 0; }
    table.k-cards tr:has(> th:first-child):last-child { border-bottom: 0; }
    table.k-cards tr > th:first-child { display: block; width: auto; border: 0; padding: 0 0 2px; text-align: left; font-size: var(--k-12); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--k-muted); background: none; }
    table.k-cards tr:has(> th:first-child) > td { padding: 0; min-height: 0; }
    table.k-cards tr:has(> th:first-child) > td::before { display: none; }
    /* A line of money (a bill) keeps its figure on the right of its words; a 3-cell row (Chart of accounts) stacks. */
    table.k-cards tr:has(> th:first-child + td.num) { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
    table.k-cards tr > th:first-child:has(+ td.num) { flex: 1 1 auto; min-width: 0; text-transform: none; letter-spacing: 0; font-size: var(--k-14); font-weight: 400; color: var(--k-text); padding: 0; }
    table.k-cards tr:has(> th:first-child + td.num) > td.num { flex: none; width: auto; text-align: right; white-space: nowrap; }
    table.k-cards tr:has(> th:first-child + td.num + td) { display: block; }
    table.k-cards tr:has(> th:first-child + td.num + td) > th:first-child { display: block; font-size: var(--k-12); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--k-muted); padding: 0 0 2px; }
    table.k-cards tr:has(> th:first-child + td.num + td) > td.num { text-align: left; white-space: normal; }
    /* Its card stays a card: a list's card gives way to the cards of its rows, a table of facts has none. */
    .card:has(> table.k-cards > tbody > tr > th:first-child) { background: var(--k-surface); box-shadow: var(--k-shadow); border-radius: var(--k-r); }
    .card[class="card"]:has(> table.k-cards > tbody > tr > th:first-child) { padding: 4px 16px; }
    .k-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .k-fact { padding: 14px; border-radius: var(--k-r); }
    .k-paneltabs { margin: 0 -16px 4px; padding: 0 16px; }
    .k-inline > *, .k-inline > button { flex: 1 1 100%; }
    .k-fact b { font-size: var(--k-18); }
    .k-toolbar > form, .k-toolbar > .btn, .k-toolbar > .btn-sm { width: 100%; }
    .k-toolbar > form .btn-sm { width: 100%; }
}
@media (max-width: 720px) {
    table.k-cards td:has(form), table.k-cards td:has(details.k-fold) {
        display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-left: 0;
    }
    table.k-cards td:has(form)::before, table.k-cards td:has(details.k-fold)::before {
        position: static; width: auto; flex: none;
    }
    table.k-cards td form {
        display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; max-width: 100%;
    }
    table.k-cards td form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    table.k-cards td form select,
    table.k-cards td form textarea,
    table.k-cards td form .btn,
    table.k-cards td form .btn-sm {
        flex: none; width: 100%; max-width: 100%;
    }
}

/* ═══ ROOM TO BREATHE (owner, 15 Nov 2026: "Check for spacing on all pages. Nothing should look cramped") ══
   One scale: 8, 12, 16, 24, 32. A plain card (its class is "card" and nothing else) gives room to what
   sits straight inside it: a heading, a phone number, a note, tick boxes, a form. The parts that pad
   themselves (a card header or body, a table, a padded block) still run from edge to edge, so a list
   keeps its full width and its rows their own padding. */
.card[class="card"] { padding: 20px 24px; }
.card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section) { margin-left: -24px; margin-right: -24px; }
.card[class="card"] > :is(table, .table-responsive) { width: calc(100% + 48px); max-width: none; }
.card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section):is(:first-child, input[type="hidden"]:first-child + *) { margin-top: -20px; }
.card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section):last-child { margin-bottom: -20px; }
.card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section) + :not(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section, input[type="hidden"]) { margin-top: 16px; }
.card[class="card"] > :not(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section, input[type="hidden"]) + :is(table, .table-responsive) { margin-top: 14px; }
.card[class="card"] > :not(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section, input[type="hidden"]) + :not(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section, input[type="hidden"]) { margin-top: 12px; }
.card[class="card"] > :is(h1, h2, h3, h4, .card-title) + :not(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section, input[type="hidden"]):not([hidden]) { margin-top: 6px; }
.card[class="card"] > span.card-title { display: block; }
/* A form's first heading sits at the top, even with the form's hidden security field in front of it. */
:is(form, .card-body) > input[type="hidden"]:first-child + :is(h2, h3),
:is(form, .card-body) > input[type="hidden"]:first-child + input[type="hidden"] + :is(h2, h3) { margin-top: 0; }
/* A card laid out as a row (a figure and its buttons) pads itself too. */
.card.k-row { padding: 16px 24px; margin-bottom: 20px; }
/* A bar of filters drawn as a card pads itself the same way. */
.card.filter-bar { padding: 16px 24px; }
/* Inside a card's body, an empty note or a fold keeps its distance from the words above it. */
.card-body > * + :is(.k-empty, .k-fold, form), .k-pad > * + :is(.k-empty, .k-fold) { margin-top: 12px; }
/* A long address in an empty note wraps instead of running past the card. */
.k-empty b, .k-empty span, .k-empty p { overflow-wrap: anywhere; }
/* A line of links, a note or a heading on the page itself keeps its distance from the card under it. */
.admin-page > :is(p, .k-help, .k-lede):not(:last-child), .k-page > :is(p, .k-help, .k-lede):not(:last-child) { margin-bottom: 16px; }
.admin-page > :is(h2, h3):not(:first-child), .k-page > :is(h2, h3):not(:first-child) { margin-top: 28px; }
.admin-page > :is(h2, h3), .k-page > :is(h2, h3) { margin-bottom: 12px; }
@media (max-width: 768px) {
    .card[class="card"] { padding: 16px; }
    .card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section) { margin-left: -16px; margin-right: -16px; }
    .card[class="card"] > :is(table, .table-responsive) { width: calc(100% + 32px); }
    .card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section):is(:first-child, input[type="hidden"]:first-child + *) { margin-top: -16px; }
    .card[class="card"] > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section):last-child { margin-bottom: -16px; }
    /* A list card on a phone has no card around it (each row is its own card): its words line up with the rows. */
    .card[class="card"]:has(> table.k-cards) { padding: 4px 0 0; border: 0; background: transparent; box-shadow: none; }
    .card[class="card"]:has(> table.k-cards) > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section) { margin: 0; width: 100%; }
    .card[class="card"]:has(> table.k-cards) > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section):is(:first-child, input[type="hidden"]:first-child + *) { margin-top: 0; }
    .card[class="card"]:has(> table.k-cards) > :is(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section):last-child { margin-bottom: 0; }
    .card[class="card"]:has(> table.k-cards) > :not(table, .table-responsive, .card-header, .card-body, .k-pad, .k-section, input[type="hidden"]) + table.k-cards { margin-top: 12px; }
    .card.k-row, .card.filter-bar { padding: 14px 16px; }
    .k-sectabs { margin-top: 10px; }
}

/* ═══ TYPE (owner, 15 Nov 2026, of Home's "Needs you today": "It's the font there that might be an issue") ══
   One scale and clear weights in Inter. Page titles 800; section and card titles 700; the title of a list
   item 600 at 15px; the line under it 400, a step smaller, in the muted colour with room between its lines;
   small upper-case labels 600 with tracking; figures in even columns. The font is loaded with its optical
   sizes (opsz 14 to 32), so big titles tighten and small words open up. */
:root { --k-item: var(--kz-rem-16); --k-item-sub: var(--kz-rem-13); }
body { font-optical-sizing: auto; font-kerning: normal; }
h1, .page-title, .k-home-head h1 { font-weight: 800; }
h2, h3, .card-title, .k-fold > summary { font-weight: 700; }
/* A list item's title, then the line under it. */
.k-need .t, .k-todo .t b, .k-row .t b { font-size: var(--k-item); font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; color: var(--k-text); }
.k-need .t span, .k-todo .t span, .k-row .t span { display: block; margin-top: 2px; font-size: var(--k-item-sub); font-weight: 400; line-height: 1.45; letter-spacing: 0; color: var(--k-muted); }
.k-need { padding: 13px 20px; }
@media (max-width: 768px) { .k-need { padding: 13px 16px; } }
/* Keep bulleted and numbered lists indented inside cards on every page so bullets never sit on the border. */
:is(.card, .card-body, .k-how-body, .k-section, .admin-page, .k-page) :is(ul, ol):not(.sidebar-nav, .nav-palette-results, .k-plain, .k-firstrun-steps) {
    padding-left: 20px;
}
.k-steps ol { padding-left: 0 !important; }
.k-allclear span { font-weight: 600; color: var(--k-text); }
/* The line under a title or a field. */
.k-help, small, .form-text, .k-field .help { line-height: 1.5; }
/* Small labels above things: upper case, 600, tracked. */
.k-eyebrow, .k-needs-title, .k-glance-title { font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
table.k-cards td::before { font-weight: 600; letter-spacing: .06em; }
/* Figures line up. */
.k-need .n, .k-todo .n, .stat-value, .k-kpi b, .k-fact b, .k-hero b, .money, .num, .k-list .when { font-variant-numeric: tabular-nums; }
.k-todo .n { font-weight: 800; }

/* ═══ A CONVERSATION (owner, 15 Nov 2026: the chat, the question and the answer sat on top of each other) ═══
   Each message is a block of its own: who said it above in small letters, then their words. Klo's lines are
   tinted, a right answer is green; "Answered by" is a small quiet line with room above; "Wrong answer" is a
   small button set apart, its form opening under it. */
.k-turn { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.k-turn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: var(--k-13); color: var(--k-muted); }
.k-msg { max-width: 760px; padding: 12px 16px; border-radius: var(--k-r); background: color-mix(in srgb, var(--k-ground) 75%, var(--k-surface)); }
.k-msg-klo { background: color-mix(in srgb, var(--k-accent) 7%, var(--k-surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-accent) 16%, transparent); }
.k-msg-right { background: var(--k-green-soft, color-mix(in srgb, var(--k-green) 10%, var(--k-surface))); }
.k-msg-who { font-size: var(--k-12); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--k-muted); margin-bottom: 4px; }
.k-msg-words { font-size: var(--k-item); line-height: 1.55; color: var(--k-text); white-space: pre-line; overflow-wrap: anywhere; }
.k-turn-by { font-size: var(--k-13); color: var(--k-muted); margin-top: 2px; }
.k-turn-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.k-wrong > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--k-line); background: var(--k-surface); font-size: var(--k-13); font-weight: 600; color: var(--k-text); }
.k-wrong > summary::-webkit-details-marker { display: none; }
.k-wrong > summary:hover { border-color: var(--k-muted); }
.k-wrong[open] > summary { margin-bottom: 12px; }
.card > .k-msg + .k-turn-by { margin-top: 8px; }
/* Lines in a card's body (a list of chats, notes, emails) keep a little room between them. */
.card-body > :is(p, .k-help) + :is(p, .k-help, ul, ol, form, details) { margin-top: 10px; }
@media (max-width: 768px) { .k-turn { padding: 16px; } .k-msg { padding: 10px 14px; } }

/* ═══ THE EXCELLENCE KIT (owner, 16 Nov 2026: "Yes to the look"; the bar is design/excellence-15nov/STANDARD.md) ═══
   Empty states with their own picture and a next step; a first-run card; a one-line intro; quick views as tabs
   with counts; one filter bar on one line; days picked from a calendar; a "More" menu. Drawn by src/admin/parts.ts. */

/* Empty states: the picture on the left, one line, real buttons. The old "?" is gone from these. */
.k-empty.k-empty-pic { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 26px; align-items: center; padding: 30px 34px; min-height: 0; }
.k-empty.k-empty-pic::before { content: none; }
.k-empty-pic .k-empty-art { width: 112px; height: 112px; filter: var(--kz-art); }
.k-empty-words { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.k-empty-pic .k-empty-title { font-size: var(--k-18); font-weight: 700; letter-spacing: -0.01em; color: var(--k-text); }
.k-empty-line { color: var(--k-muted); font-size: var(--k-14); line-height: 1.55; max-width: 60ch; }
.k-empty-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.k-empty-acts form { display: inline-flex; margin: 0; }
.k-empty-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: var(--k-r);
    background: color-mix(in srgb, var(--k-accent) 8%, var(--k-surface)); color: var(--k-muted); font-size: var(--k-13); line-height: 1.5; max-width: 60ch; }
.k-empty-tip .ph { color: var(--k-accent-text); flex: none; margin-top: 1px; }
.k-empty.k-empty-small { grid-template-columns: 72px minmax(0, 1fr); gap: 18px; padding: 22px 26px; }
.k-empty-small .k-empty-art { width: 72px; height: 72px; }
.k-empty-small .k-empty-title { font-size: var(--k-16); }
.card .k-empty.k-empty-pic, .k-fold .k-empty.k-empty-pic { background: color-mix(in srgb, var(--k-ground) 50%, var(--k-surface)); }
.card-body > .k-empty.k-empty-pic:only-child { margin: 0; }
:is(.admin-page, .k-page, .page-body) > .k-empty.k-empty-pic { margin-bottom: 20px; }

/* The first-run card (mockup 5a): the first step big, its picture on the right, three steps under it. */
.k-firstrun { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.k-firstrun-card { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: center; padding: 40px 44px;
    border-radius: var(--k-card-r); background: var(--k-surface); box-shadow: var(--k-shadow); position: relative; overflow: hidden; }
.k-firstrun-card::after { content: ''; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--k-accent) 16%, transparent) 0%, transparent 70%); pointer-events: none; }
.k-firstrun-words { display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; z-index: 1; }
.k-firstrun-words h2 { font-size: var(--k-24); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.k-firstrun-words p { color: var(--k-muted); font-size: var(--k-16); line-height: 1.55; margin: 0; max-width: 56ch; }
.k-firstrun-art { display: grid; place-items: center; position: relative; z-index: 1; }
.k-firstrun-art .k-empty-art { width: 200px; height: 200px; filter: var(--kz-art); }
.k-firstrun-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.k-firstrun-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: var(--k-r); background: var(--k-surface); box-shadow: var(--k-shadow); }
.k-firstrun-steps i { font-style: normal; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--k-accent-soft); color: var(--k-accent-text); font-weight: 700; font-size: var(--k-14); }
.k-firstrun-steps b { display: block; font-size: var(--k-16); font-weight: 700; }
.k-firstrun-steps span { display: block; color: var(--k-muted); font-size: var(--k-14); line-height: 1.5; margin-top: 2px; }

/* The page's own line under its title: one line, two at most; more behind "How it works". */
.k-intro { margin: -2px 0 18px; }
/* The page's line and its main buttons on one row: the line on the left, the buttons top right. */
.k-headrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.k-headrow > .k-intro { margin: 0; flex: 1 1 360px; min-width: 0; }
.k-headacts { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 768px) { .k-headacts { width: 100%; } .k-headacts .btn { flex: 1 1 auto; } }
.k-intro-line { margin: 0; color: var(--k-muted); font-size: var(--k-16); line-height: 1.55; max-width: 72ch; }
/* A page's own grey lines at the top (Payroll, Commission, Papers): a size up, and about 70 letters a line, never the
   whole width of the page (live walk D18). */
.admin-page > p.k-help, .k-page > p.k-help { font-size: var(--k-14); line-height: 1.55; max-width: 66ch; }
.k-intro-more { color: var(--k-accent-text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.k-intro-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.k-how { margin-top: 10px; max-width: 760px; }
.k-how > summary { display: none; }
.k-how:not([open]) { display: none; }
.k-how-body { padding: 16px 20px; border-radius: var(--k-r); background: var(--k-surface); box-shadow: var(--k-shadow); color: var(--k-text); font-size: var(--k-14); line-height: 1.6; }
.k-how-body > * + * { margin-top: 8px; }
.k-how-body ul, .k-how-body ol { margin: 0; padding-left: 20px; }

/* Quick views as tabs with counts (mockup 6): always one horizontal line, never wrapping onto two clunky rows. */
.k-views { display: inline-flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: var(--k-r); max-width: 100%;
    background: color-mix(in srgb, var(--k-line) 65%, var(--k-ground)); }
.k-views::-webkit-scrollbar { display: none; }
.k-view { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--k-r-sm); white-space: nowrap; flex: none;
    border: 0; background: none; font-family: inherit; cursor: pointer;
    font-size: var(--k-14); font-weight: 500; color: var(--k-nav-text); text-decoration: none; }
.k-view:hover { color: var(--k-text); }
.k-view.on, .k-view.active { background: var(--k-surface); color: var(--k-text); font-weight: 600; box-shadow: var(--k-shadow-sm); }
.k-view .n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
    font-size: var(--k-12); font-weight: 700; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--k-line) 80%, var(--k-surface)); color: var(--k-muted); }
.k-view.on .n, .k-view.active .n { background: var(--k-accent); color: var(--k-on-accent); }
/* Strictly ONE filled grey tab bar per screen: when a page already has .hub-tabs or .k-sectabs, any inner .k-views
   (such as liveFilter's .k-chipbar or CRM's work-queue filter chips) renders as compact outline filter pills, never a second tab bar. */
:is(.page-body:has(.hub-tabs), .k-sectabs ~ .page-body) .k-views,
.page-body:has(.k-views:not(.k-chipbar)) .k-views.k-chipbar {
    background: transparent; padding: 0; gap: 6px; border-radius: 0; margin: 0 0 12px;
}
:is(.page-body:has(.hub-tabs), .k-sectabs ~ .page-body) .k-views .k-view,
.page-body:has(.k-views:not(.k-chipbar)) .k-views.k-chipbar .k-view {
    height: 32px; padding: 0 12px; border-radius: 999px; font-size: var(--k-13);
    background: var(--k-surface); border: 1px solid var(--k-line); box-shadow: none;
}
:is(.page-body:has(.hub-tabs), .k-sectabs ~ .page-body) .k-views .k-view.on,
:is(.page-body:has(.hub-tabs), .k-sectabs ~ .page-body) .k-views .k-view.active,
.page-body:has(.k-views:not(.k-chipbar)) .k-views.k-chipbar .k-view.on {
    background: var(--k-text); color: var(--k-surface); border-color: var(--k-text);
}
:is(.page-body:has(.hub-tabs), .k-sectabs ~ .page-body) .k-views .k-view.on .n,
:is(.page-body:has(.hub-tabs), .k-sectabs ~ .page-body) .k-views .k-view.active .n,
.page-body:has(.k-views:not(.k-chipbar)) .k-views.k-chipbar .k-view.on .n {
    background: color-mix(in srgb, currentColor 18%, transparent); color: inherit;
}

/* One filter bar on one line: search grows, the choices and the days keep their size, "⋯" at the end. */
.k-filterbar { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; flex-wrap: nowrap; min-width: 0; }
.k-filterbar-only { justify-content: flex-end; }
.k-fb-search { flex: 1 1 260px; min-width: 0; position: relative; display: flex; align-items: center; margin: 0; font-weight: 400; }
.k-fb-search .ph { position: absolute; left: 14px; color: var(--k-muted); pointer-events: none; }
.k-fb-search input { width: 100%; padding-left: 42px; min-height: var(--kz-field-h); border-radius: var(--k-r-sm); }
.k-fb-select { flex: 0 1 200px; min-width: 0; min-height: var(--kz-field-h); border-radius: var(--k-r-sm); }
.k-fb-act { flex: none; margin-left: auto; }
.k-fb-tick { flex: none; white-space: nowrap; font-size: var(--k-14); }
.k-askbar .btn { flex: none; min-height: 44px; }
.k-fb-act form { margin: 0; }
.k-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* "More": the downloads and settings a page needs now and then. */
.k-more { position: relative; flex: none; }
.k-more > summary { list-style: none; cursor: pointer; width: 44px; height: 44px; border-radius: var(--k-r); display: grid; place-items: center;
    border: 1px solid var(--k-line); background: var(--k-surface); color: var(--k-text); }
.k-more > summary::-webkit-details-marker { display: none; }
.k-more > summary:hover, .k-more[open] > summary { border-color: var(--k-field); }
.k-more-list { position: absolute; right: 0; top: 50px; z-index: 40; min-width: 240px; padding: 6px; border-radius: var(--k-r);
    background: var(--k-surface); box-shadow: var(--k-shadow), 0 0 0 1px var(--k-hair); display: flex; flex-direction: column;
    max-width: calc(100vw - 16px); translate: var(--k-more-shift, 0) 0; }
/* A "More" button in the left half of the screen opens its menu to the right, so the whole menu is on the screen (the
   frame's script says which side, and nudges a menu still past an edge back in: UI audit step 3, module 2). */
.k-more.k-more-start > .k-more-list { left: 0; right: auto; }
/* With no script yet (or none), a phone's page buttons start at its left edge with More first: it opens to the right. */
@media (max-width: 768px) { .k-headacts > .k-more:first-child > .k-more-list { left: 0; right: auto; } }
.k-more-list a span, .k-more-list .k-more-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.k-more-list a, .k-more-list .k-more-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--k-r-sm); background: none; color: var(--k-text); font: 500 var(--k-14) var(--k-font); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.k-more-list a:hover, .k-more-list .k-more-item:hover { background: color-mix(in srgb, var(--k-line) 55%, transparent); }
.k-more-list a .ph, .k-more-list .k-more-item .ph { color: var(--k-muted); }
.k-more-list .k-more-post { margin: 0; }
/* An item for a phone only: the page's own row folded into the menu there (the WhatsApp chat's header). */
.k-more-list .k-phone-item { display: none; }
@media (max-width: 768px) { .k-more-list .k-phone-item { display: flex; } .k-more-list form.k-phone-item { display: block; } }
@media (min-width: 769px) { .k-more.k-phone-only { display: none; } }
.k-more-form { padding: 12px; gap: 10px; min-width: 260px; }
.k-more-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--k-13); font-weight: 600; }
.k-more-form select { width: 100%; }
.k-more-list hr { border: 0; border-top: 1px solid var(--k-hair); margin: 6px 4px; }

/* Days, from a calendar (mockup 8). */
.k-dates { position: relative; flex: none; }
.k-dates > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
    border-radius: var(--k-r); border: 1px solid var(--k-field); background: var(--k-surface); color: var(--k-text); font-size: var(--k-14); font-weight: 500; white-space: nowrap; }
.k-dates > summary::-webkit-details-marker { display: none; }
/* On a phone nothing a button or a day box says runs past its card (page sweep SW37: "See the AI buyers they
   practise with", the Journal's "1 to 17 November"): a long button wraps, a day box ends in "...". */
@media (max-width: 768px) {
    .k-dates { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .k-dates > summary { width: 100%; max-width: 100%; }
    .k-dates > summary [data-dates-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .btn, .btn-sm { white-space: normal; height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; max-width: 100%; text-align: center; font-size: var(--k-16); }
    /* A phone's button sizes (Pack B, drawing m11): the main button 50px with 16px words, every other 44px with 16px,
       a small one 36px to look at with 14px words and a 44px place to tap (an invisible ::after over and under it).
       Long words still wrap, so these are the least height, never a fixed one. */
    .btn-primary, .btn.primary, .btn-success { height: auto; min-height: var(--kz-button-h-phone); font-size: var(--k-16); }
    .btn-sm, .btn-sm.primary { height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: var(--k-14); }
    .btn-sm.primary, .btn-sm.btn-primary { min-height: var(--kz-button-h-phone); padding: 8px 20px; font-size: var(--k-16); }
    :is(td, .k-dates-pop, .klo-dock) :is(.btn-sm.primary, .btn-sm.btn-primary) { min-height: 36px; padding: 6px 12px; font-size: var(--k-14); }
    :where(.btn-sm) { position: relative; }
    .btn-sm::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(44px, 100%); transform: translateY(-50%); }
}
.k-dates > summary .ph { color: var(--k-muted); }
.k-dates[open] > summary { border-color: var(--k-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k-accent) 22%, transparent); }
.k-dates-pop { position: absolute; right: 0; top: 52px; z-index: 45; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px;
    padding: 14px; border-radius: var(--k-r); background: var(--k-surface); box-shadow: var(--k-shadow), 0 0 0 1px var(--k-hair); width: max-content; max-width: min(560px, calc(100vw - 32px)); }
.k-date-one .k-dates-pop { left: 0; right: auto; }
.k-dates-quick { display: flex; flex-direction: column; gap: 2px; }
.k-dates-quick button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: var(--k-r-sm); font: 500 var(--k-14) var(--k-font); color: var(--k-text); cursor: pointer; }
.k-dates-quick button:hover { background: color-mix(in srgb, var(--k-line) 55%, transparent); }
.k-dates-quick button.on { background: var(--k-accent-soft); color: var(--k-accent-text); font-weight: 600; }
.k-dates-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.k-dates-own { display: flex; flex-direction: column; gap: 8px; }
.k-dates-own label { display: flex; flex-direction: column; gap: 4px; font-size: var(--k-13); }
.k-dates-act { display: flex; justify-content: flex-end; gap: 8px; }
.k-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: var(--k-14); }
.k-cal-head button { width: 32px; height: 32px; border-radius: var(--k-r-sm); border: 1px solid var(--k-line); background: var(--k-surface); color: var(--k-text); cursor: pointer; display: grid; place-items: center; font-size: var(--k-18); line-height: 1; }
.k-cal { border-collapse: separate; border-spacing: 2px; width: auto; background: none; margin-top: 6px; }
.k-cal th { padding: 4px 0; text-align: center; font-size: var(--k-12); color: var(--k-muted); font-weight: 600; background: none; border: 0; }
.k-cal td { padding: 0; border: 0; }
.k-cal tbody tr:hover td { background: none; }
.k-cal button { width: 38px; height: 34px; border: 0; border-radius: var(--k-r-sm); background: none; color: var(--k-text); font: 500 var(--k-14) var(--k-font); cursor: pointer; font-variant-numeric: tabular-nums; }
.k-cal button:hover { background: color-mix(in srgb, var(--k-line) 60%, transparent); }
.k-cal button.out { color: color-mix(in srgb, var(--k-muted) 55%, transparent); }
.k-cal button.in { background: color-mix(in srgb, var(--k-accent) 14%, var(--k-surface)); }
.k-cal button.end { background: var(--k-accent); color: var(--k-on-accent); font-weight: 700; }
.k-cal button.today:not(.end) { box-shadow: inset 0 0 0 1px var(--k-field); }
.k-cal button[disabled] { opacity: .35; cursor: not-allowed; }

/* Add a person (Leads and CRM): the form in parts, where they came from as pills. */
.k-addperson { max-width: 760px; }
.k-addperson fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.k-addperson legend { font-weight: 600; margin-bottom: 8px; }
.k-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.k-pills label.k-pill { position: relative; display: inline-flex; align-items: center; gap: 0; cursor: pointer; font-weight: 500; }
.k-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.k-pill span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-surface); color: var(--k-text); font-size: var(--k-14); }
.k-pill input:checked + span { border-color: var(--k-accent); background: var(--k-accent-soft); color: var(--k-accent-text); font-weight: 600; }
.k-pill input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--k-accent) 30%, transparent); }
/* Billing: the plan strip, Add modules as cards, "Your new plan" beside them (src/billing/billing-picker.ts). */
.k-plan { display: flex; align-items: center; gap: 18px; padding: 18px 24px; flex-wrap: wrap; }
.k-plan .k-art { width: 56px; height: 56px; }
.k-plan-words { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.k-plan-words b { font-size: var(--k-16); }
.k-plan-words span { color: var(--k-muted); font-size: var(--k-14); }
.k-plan .tag { white-space: nowrap; }
.k-picker { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.k-picker-cards h2 { font-size: var(--k-18); font-weight: 700; margin: 0 0 4px; }
.k-mod-group { margin: 22px 0 10px; font-size: var(--k-12); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--k-muted); }
.k-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.k-picker label.k-mod { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px 18px 18px 16px; border-radius: var(--k-r);
  background: var(--k-surface); box-shadow: var(--k-shadow); cursor: pointer; font-weight: 400; border: 1px solid transparent; white-space: normal; }
.k-picker label.k-mod:hover { border-color: var(--k-line); }
.k-picker label.k-mod.on { border-color: var(--k-accent); background: color-mix(in srgb, var(--k-accent) 7%, var(--k-surface)); }
.k-picker label.k-mod.have { cursor: default; }
.k-mod-art { width: 44px; height: 44px; }
.k-mod-words { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 30px; }
.k-mod-words b { font-size: var(--k-16); font-weight: 700; line-height: 1.3; }
.k-mod-line { color: var(--k-muted); font-size: var(--k-13); line-height: 1.5; }
.k-mod-needs { align-self: flex-start; font-size: var(--k-12); font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--k-chip); color: var(--k-text); margin-top: 2px; }
.k-mod-price { font-size: var(--k-13); font-weight: 600; color: var(--k-accent-text); margin-top: 4px; }
.k-mod-on { position: absolute; top: 18px; right: 18px; font-size: var(--k-12); font-weight: 600; color: var(--k-green); }
.k-picker label.k-mod input[type="checkbox"] { position: absolute; top: 18px; right: 18px; width: 22px; height: 22px; accent-color: var(--k-accent); }
.k-plan-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.k-plan-mod { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 18px; border-radius: var(--k-r);
  background: var(--k-surface); box-shadow: var(--k-shadow); border: 1px solid var(--k-hair); }
.k-plan-mod.is-paused { opacity: .82; background: color-mix(in srgb, var(--k-surface) 75%, var(--k-bg)); }
.k-plan-mod-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.k-plan-mod-top b { font-size: var(--k-16); font-weight: 700; line-height: 1.3; }
.k-plan-mod-foot { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.k-pick-sum { position: sticky; top: 20px; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.k-pick-sum h2 { font-size: var(--k-18); font-weight: 700; margin: 0; }
.k-pick-added { display: flex; flex-wrap: wrap; gap: 6px; }
.k-pick-added i { font-style: normal; font-size: var(--k-12); font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--k-accent-soft); color: var(--k-accent-text); }
.k-pick-lines { display: flex; flex-direction: column; gap: 6px; font-size: var(--k-14); color: var(--k-muted); }
.k-pick-lines div, .k-pick-total { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.k-pick-lines b { color: var(--k-text); }
.k-pick-total { border-top: 1px solid var(--k-hair); padding-top: 12px; align-items: baseline; }
.k-pick-total b { font-size: var(--k-24); font-weight: 800; letter-spacing: -0.02em; }
.k-pick-more { font-size: var(--k-13); color: var(--k-green); font-weight: 600; }
.k-pick-sum .btn { width: 100%; }
.k-pick-sum .btn[disabled] { opacity: .5; }
.k-sub { font-size: var(--k-14); font-weight: 700; margin: 14px 0 4px; }
.k-year .k-help { max-width: 72ch; }
.k-credits { display: flex; flex-direction: column; gap: 14px; }
.k-credits-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.k-credits-head p { margin: 4px 0 0; color: var(--k-muted); font-size: var(--k-14); }
.k-fold-help > summary { cursor: pointer; font-size: var(--k-14); font-weight: 600; color: var(--k-accent-text); width: fit-content; }
.k-fold-help[open] > summary { margin-bottom: 6px; }
.k-support { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.k-support p { margin: 2px 0 0; }
.k-support-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
@media (max-width: 768px) { .k-credits-head, .k-support { grid-template-columns: 40px minmax(0, 1fr); } .k-credits-head > .tag, .k-support-form { grid-column: 1 / -1; } }
.k-parts { width: 100%; max-width: 560px; }
.k-parts td { padding: 8px 0; }
.k-parts td:last-child { text-align: right; font-weight: 600; }
@media (max-width: 1100px) { .k-picker { grid-template-columns: 1fr; } .k-pick-sum { position: static; } }

/* Home for a firm just starting (mockup 4): the steps, the next one lit, "Need a hand?" beside them. */
.k-start-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.k-start-head h1 { font-size: var(--k-32); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; margin: 0; text-wrap: balance; }
.k-start-head .k-eyebrow { color: var(--k-accent-text); }
.k-start-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.k-steps { padding: 0; margin: 0; overflow: hidden; }
.k-steps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 24px 28px 12px; }
.k-steps-head h2 { font-size: var(--k-18); font-weight: 700; margin: 0; }
.k-steps-head span { color: var(--k-muted); font-size: var(--k-14); }
.k-steps-head b { color: var(--k-text); }
.k-steps-bar { display: none; height: 8px; margin: 0 28px 16px; border-radius: 999px; background: color-mix(in srgb, var(--k-line) 80%, var(--k-surface)); overflow: hidden; }
.k-steps-bar i { display: block; height: 100%; border-radius: 999px; background: var(--k-action); }
.k-steps-segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(16px, 1fr)); gap: 6px; margin: 0 28px 18px; }
.k-startcard .k-steps-segs { margin: 8px 0 0; max-width: 340px; }
.k-steps-segs i { display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--k-line) 85%, var(--k-surface)); }
.k-steps-segs i.on { background: var(--k-accent); box-shadow: 0 1px 4px color-mix(in srgb, var(--kz-flame) 35%, transparent); }
.k-steps ol { list-style: none; margin: 0; padding: 0; }
.k-step { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 28px; border-top: 1px solid var(--k-hair); }
.k-step.next { background: color-mix(in srgb, var(--k-accent) 7%, var(--k-surface)); box-shadow: inset 4px 0 0 var(--k-accent); }
.k-step-art { width: 56px; height: 56px; }
.k-step-words { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.k-step-words b { font-size: var(--k-16); font-weight: 700; }
.k-step-words > span { color: var(--k-muted); font-size: var(--k-14); line-height: 1.5; overflow-wrap: anywhere; }
.k-step-addr { color: var(--k-text); font-weight: 600; }
.k-step-next { font-size: var(--k-12); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--k-accent-text); }
.k-step-optional { font-size: var(--k-12); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--k-muted); }
.k-steps-more { margin: 0; padding: 18px 28px 6px; border-top: 1px solid var(--k-hair); font-size: var(--k-14); font-weight: 700; color: var(--k-muted); }
.k-steps-optional .k-step:first-child { border-top: 0; }
.k-step.done .k-step-words b { text-decoration: line-through; color: var(--k-muted); }
.k-step.done .k-step-art { opacity: .6; }
.k-step-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.k-step-done { display: inline-flex; align-items: center; gap: 6px; color: var(--k-green); font-weight: 600; font-size: var(--k-14); }
.k-start-side { display: flex; flex-direction: column; gap: 20px; }
.k-start-glance { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.k-start-glance h2 { font-size: var(--k-16); font-weight: 700; margin: 0 0 6px; }
.k-start-glance a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--k-hair); color: var(--k-text); text-decoration: none; font-size: var(--k-14); }
.k-start-glance a b { font-variant-numeric: tabular-nums; }
.k-hand { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.k-hand h2 { font-size: var(--k-18); font-weight: 700; margin: 0; }
.k-hand p { margin: 0; color: var(--k-muted); font-size: var(--k-14); line-height: 1.55; }
.k-hand .k-empty-acts { margin-top: 4px; }
.k-hand-support { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--k-hair); padding-top: 14px; margin-top: 6px; }
.k-hand-support b { display: block; font-size: var(--k-14); }
.k-hand-support span { display: block; color: var(--k-muted); font-size: var(--k-13); }
.k-hand-support form { margin: 0; flex: none; }
.k-start-alarms { display: flex; flex-direction: column; padding: 6px; margin-bottom: 20px; }
.k-start-alarm { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--k-r); color: var(--k-text); text-decoration: none; }
.k-start-alarm:hover { background: color-mix(in srgb, var(--k-line) 45%, transparent); }
.k-start-alarm > b { font-size: var(--k-18); font-weight: 800; color: var(--k-amber); font-variant-numeric: tabular-nums; }
.k-start-alarm.bad > b { color: var(--k-red); }
.k-start-alarm span { display: flex; flex-direction: column; font-weight: 600; }
.k-start-alarm small { font-weight: 400; color: var(--k-muted); font-size: var(--k-13); }
.k-startcard { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 20px; margin-bottom: 0;
    box-shadow: var(--k-shadow); }
.k-startcard-icon { width: 38px; height: 38px; border-radius: var(--k-r-sm); background: var(--k-accent-soft); color: var(--k-accent-text); display: grid; place-items: center; flex: none; }
.k-startcard-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.k-startcard .k-steps-segs { margin: 0; width: 220px; max-width: 100%; }
.k-startcard-line { font-size: var(--k-14); color: var(--k-text); margin-top: 2px; line-height: 1.35; }
.k-startcard-line b { font-size: var(--k-14); font-weight: 700; display: inline; }
.k-startcard-line .k-step-sub { color: var(--k-muted); font-size: var(--k-13); font-weight: 400; display: inline; }
@media (max-width: 768px) {
    .k-startcard { grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
    .k-startcard .k-step-acts { grid-column: 1 / -1; justify-content: flex-start; }
    .k-startcard-line .k-step-sub { display: none; }
}
@media (max-width: 1100px) { .k-start-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .k-start-head h1 { font-size: var(--k-24); }
    .k-step { grid-template-columns: 44px minmax(0, 1fr); padding: 18px; gap: 14px; }
    .k-step-art { width: 44px; height: 44px; }
    .k-step-acts { grid-column: 1 / -1; justify-content: flex-start; }
    .k-step-acts .btn { flex: 1 1 auto; }
    .k-steps-head { padding: 20px 18px 10px; } .k-steps-bar { margin: 0 18px 14px; }
}
@media (max-width: 1100px) {
    .k-firstrun-card { grid-template-columns: minmax(0, 1fr) 160px; padding: 32px; }
    .k-firstrun-art .k-empty-art { width: 150px; height: 150px; }
}
@media (max-width: 900px) {
    .k-filterbar { flex-wrap: wrap; }
    .k-fb-search { flex: 1 1 100%; }
    .k-fb-select { flex: 1 1 0; }
}
@media (max-width: 768px) {
    .k-empty.k-empty-pic { grid-template-columns: 1fr; gap: 12px; padding: 24px 20px; }
    .k-empty-pic .k-empty-art { width: 84px; height: 84px; }
    .k-empty.k-empty-small { grid-template-columns: 56px minmax(0, 1fr); }
    .k-empty-small .k-empty-art { width: 56px; height: 56px; }
    .k-empty-acts .btn { flex: 1 1 100%; }
    .k-firstrun-card { grid-template-columns: 1fr; padding: 26px 22px; gap: 8px; }
    .k-firstrun-art { order: -1; justify-items: start; }
    .k-firstrun-art .k-empty-art { width: 96px; height: 96px; }
    .k-firstrun-steps { grid-template-columns: 1fr; }
    .k-views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .k-filterbar > .k-dates { flex: 1 1 0; min-width: 0; }
    .k-filterbar > .k-dates > summary { width: 100%; }
    .k-filterbar > .k-dates > summary .k-caret { margin-left: auto; }
    .k-dates-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-width: none; grid-template-columns: 1fr; max-height: calc(100vh - 32px); overflow: auto; }
    .k-dates-quick { flex-direction: row; flex-wrap: wrap; }
    .k-cal button { width: 40px; height: 40px; }
    .k-more-list { right: 0; }
}

/* A Klonza support visit: one line across the top of every Admin page, with the way out (16 Nov 2026). */
.k-support-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 16px; border-radius: var(--k-r); background: var(--k-blue-soft); color: var(--k-blue); }
.k-support-bar .k-support-words { flex: 1 1 260px; min-width: 0; font-size: var(--k-14); line-height: 1.45; }
.k-support-bar .k-support-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--k-blue); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--k-blue) 22%, transparent); }
.k-support-bar form { margin: 0; }
/* Home: letting Klonza support in, one quiet line once Getting started is done (16 Nov 2026). */
.k-home-support { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: var(--k-14); color: var(--k-muted); }
.k-home-support svg { flex: none; }
.k-home-support a { font-weight: 600; }
.k-support-pointer { margin: 0; }

/* ── Sidebar Sub-Menus & Menu 1 Hairline Dividers ── */
#sideNav > li.nav-item.nav-divider {
    margin-top: 6px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--kz-on-band) 9%, transparent);
}
@media (max-height: 830px) and (min-width: 769px) {
    .sidebar-nav li > a { height: 34px; }
    #sideNav > li.nav-item.nav-divider { margin-top: 4px; padding-top: 4px; }
}
.sidebar-nav li a > svg { flex: none; }
.sidebar-nav li a > span:not(.nav-sub-caret) { flex: 1 1 auto; min-width: 0; }
.sidebar-nav li a .nav-sub-caret {
    flex: none !important; margin-left: auto; width: 18px; height: 18px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--kz-on-band-muted); overflow: visible;
    transform: rotate(-90deg);
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), color .15s ease, background .15s ease;
}
.sidebar-nav li.has-sub > a .nav-sub-caret + .nav-badge { margin-left: 2px; }
.sidebar-nav li.has-sub.is-open > a:not(.active) { background: color-mix(in srgb, var(--kz-on-band) 4%, transparent); color: var(--kz-on-band); }
.sidebar-nav li a .nav-sub-caret svg { width: 13px; height: 13px; color: inherit !important; }
.sidebar-nav li a .nav-sub-caret:hover { background: color-mix(in srgb, var(--kz-on-band) 9%, transparent); color: var(--kz-on-band); }
.sidebar-nav li.is-open > a .nav-sub-caret { transform: rotate(0deg); color: var(--kz-on-band-soft); }
.sidebar-nav li.has-sub:not(.is-open) > a.active .nav-sub-caret { color: var(--kz-on-flame); }

.nav-sub {
    list-style: none; margin: 3px 0 6px 20px; padding: 0 0 0 11px;
    border-left: 1.5px solid color-mix(in srgb, var(--kz-on-band) 13%, transparent);
    display: flex; flex-direction: column; gap: 2px;
}
.nav-sub[hidden] { display: none !important; }
.nav-sub li { margin: 0; padding: 0; }
.sidebar-nav li .nav-sub a.nav-sub-link {
    display: flex; align-items: center; gap: 8px; min-height: 32px; height: auto; width: 100%;
    padding: 4px 10px; margin: 0; border-radius: var(--k-r-sm);
    font-size: var(--k-13); font-weight: 500; color: var(--kz-on-band-muted); text-decoration: none;
    transition: background .14s ease, color .14s ease;
}
.sidebar-nav li .nav-sub a.nav-sub-link:hover { background: color-mix(in srgb, var(--kz-on-band) 6%, transparent); color: var(--kz-on-band); }
.sidebar-nav li .nav-sub a.nav-sub-link.on {
    background: var(--kz-flame); color: var(--kz-on-flame); font-weight: 700;
    box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--kz-flame) 45%, transparent);
}
.sidebar-nav li .nav-sub a.nav-sub-link .nav-sub-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: color-mix(in srgb, var(--kz-flame) 18%, transparent); color: var(--kz-flame-hover); border: 1px solid color-mix(in srgb, var(--kz-flame) 28%, transparent);
    font-size: var(--k-12); font-weight: 700;
    display: inline-grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums; flex: none;
}
.sidebar-nav li .nav-sub a.nav-sub-link.on .nav-sub-badge { background: var(--kz-band); color: var(--kz-on-band); border-color: transparent; }
@media (min-width: 769px) {
    body:not(.nav-collapsed) .sidebar-nav li.has-sub.is-open > a.active {
        background: color-mix(in srgb, var(--kz-on-band) 8%, transparent); color: var(--kz-on-band); font-weight: 600; box-shadow: none;
    }
    body:not(.nav-collapsed) .sidebar-nav li.has-sub.is-open > a.active > svg { color: var(--kz-flame); }
    body:not(.nav-collapsed) .sidebar-nav li.has-sub.is-open > a.active .nav-badge {
        background: color-mix(in srgb, var(--kz-flame) 22%, transparent); color: var(--kz-flame-hover); border-color: color-mix(in srgb, var(--kz-flame) 36%, transparent);
    }
    body:not(.nav-collapsed) .k-sectabs.in-sidebar,
    body:not(.nav-collapsed) .hub-tabs.in-sidebar { display: none !important; }
    body.nav-collapsed .nav-sub,
    body.nav-collapsed .nav-sub-caret { display: none !important; }
}
/* A computer: the section row gives way to the page's own tabs (the menu shows the section). Filter chips are not tabs. */
@media (min-width: 769px) {
    .k-sectabs.in-sidebar:has(~ .page-body .hub-tabs, ~ .page-body .k-views:not(.k-chipbar), ~ .page-body .k-chips) { display: none !important; }
    .k-sectabs.k-sectabs-phone { display: none !important; }
}
.k-plainset { border: 0; margin: 0; padding: 0; min-width: 0; }
.k-plainset[disabled] input, .k-plainset[disabled] select, .k-plainset[disabled] textarea { background: transparent; border-color: transparent; color: inherit; padding-left: 0; opacity: .75; cursor: not-allowed; }
/* Record-level tabs (e.g. Estate detail, Buyer detail): sleek single-row segmented pill bar */
.hub-tabs:not(.in-sidebar) {
    display: flex; gap: 4px; padding: 4px; margin: 0 0 18px; border-bottom: 0;
    border-radius: var(--k-r); width: fit-content; max-width: 100%;
    background: color-mix(in srgb, var(--k-line) 65%, var(--k-ground));
}
.hub-tabs:not(.in-sidebar) .hub-tab {
    border: 0; border-radius: var(--k-r-sm); height: 34px; padding: 0 13px;
    display: inline-flex; align-items: center; font-size: var(--k-14); font-weight: 500;
}
.hub-tabs:not(.in-sidebar) .hub-tab.active {
    background: var(--k-surface); color: var(--k-text); font-weight: 600; box-shadow: var(--k-shadow-sm);
}

/* ── Flagship Spaced-Out Home A (Airy 3-Card Layout, Balanced Desktop Proportions) ── */
.k-hero { min-height: 0; }
.k-hero-head b { letter-spacing: -0.02em; }
.k-hero-head b .k-curr { margin-right: 0.06em; font-weight: 700; }
.k-hero-mainlink { display: flex; flex-direction: column; flex: 1; color: var(--kz-on-band); text-decoration: none; }
.k-hero-mainlink:hover { color: var(--kz-on-band); }
.k-hero-chart.is-flat {
    display: flex; align-items: center; padding: 0 24px; flex: 1; min-height: 36px;
}
.k-hero-flatline {
    width: 100%; border-top: 1.5px dashed color-mix(in srgb, var(--kz-on-band) 14%, transparent);
}
.k-hero-well-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: auto; }
/* Five figures (UI audit step 3, finding 11: commission and withdrawals are two figures, each opening its own page). */
.k-hero-well-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: auto; }
.k-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.k-kpi-pill.info { background: var(--k-blue-soft); color: var(--k-blue); }

.k-home-card {
    padding: 24px 26px 20px; display: flex; flex-direction: column; gap: 8px;
}
.k-home-card b { font-size: var(--k-32); margin-top: 4px; }
.k-home-card .k-credit-meter { margin-top: 10px; }
.k-home-card-foot {
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--k-hair);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: var(--k-13); font-weight: 500; color: var(--k-muted);
}

@media (min-width: 901px) {
    .page-body:has(> .k-home) { padding: clamp(28px, 3.8vh, 46px) 44px clamp(32px, 4vh, 52px); }
    .k-home { gap: clamp(24px, 3vh, 36px); max-width: 1380px; }
    .k-home .k-startcard { padding: 17px 24px; }
    .k-home .k-home-top { gap: 24px; min-height: clamp(276px, 32vh, 364px); }
    .k-home:not(:has(.k-startcard)) .k-home-top { min-height: clamp(306px, 36vh, 396px); }
    .k-home .k-hero-head { padding: 26px 28px 8px; }
    .k-home .k-hero b { font-size: var(--k-32); margin-top: 6px; }
    .k-home .k-hero-chart { padding: 0 28px; }
    .k-home .k-hero-well { padding: 16px 28px; }
    .k-home .k-needs-head { padding: 17px 24px 13px; }
    .k-home .k-need { padding: 16px 24px; }
    .k-home .k-needs-foot { padding: 12px 24px; }
    .k-kpis-3 { gap: 24px; }
    .k-home-card { padding: 26px 28px 22px; min-height: clamp(214px, 24.5vh, 284px); }
    .k-home:not(:has(.k-startcard)) .k-home-card { min-height: clamp(232px, 27vh, 308px); }
    .k-home-card b { font-size: var(--k-32); }
}

@media (max-width: 1040px) {
    .k-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .k-kpis-3 { grid-template-columns: 1fr; gap: 14px; }
    .k-home-card { padding: 18px 20px 16px; min-height: 0; }
    .k-home-card b { font-size: var(--k-24); }
    .k-hero-well-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .k-hero-well-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .k-hero-well-5 > div:last-child { grid-column: 1 / -1; }
}

/* ── Grouped switch tables & WhatsApp template card gallery ────────────── */
.k-switch-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.k-switch-group { border: 1px solid var(--k-line); border-radius: var(--k-r); background: color-mix(in srgb, var(--k-ground) 32%, var(--k-surface)); overflow: hidden; }
.k-switch-group-head { padding: 12px 18px; font-size: var(--k-12); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--k-muted); border-bottom: 1px solid var(--k-hair); background: color-mix(in srgb, var(--k-ground) 60%, var(--k-surface)); }
label.k-switch.k-switch-row,
label.k-switch.k-switch-row:has(> input[type="checkbox"]) {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 15px 18px; margin: 0; border-top: 1px solid var(--k-hair); background: var(--k-surface);
    transition: background .12s ease;
}
.k-switch-group > label.k-switch.k-switch-row:first-of-type,
.k-switch-list > label.k-switch.k-switch-row:first-of-type { border-top: 0; }
label.k-switch.k-switch-row:hover { background: color-mix(in srgb, var(--k-hover) 55%, var(--k-surface)); }
label.k-switch.k-switch-row > .k-switch-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
label.k-switch.k-switch-row > .k-switch-copy b { font-size: var(--k-14); font-weight: 600; color: var(--k-text); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
label.k-switch.k-switch-row > .k-switch-copy .k-help { font-weight: 400; line-height: 1.45; margin: 0; }
.k-switch-list { border: 1px solid var(--k-line); border-radius: var(--k-r); overflow: hidden; background: var(--k-surface); }

.wa-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 18px; align-items: start; }
.wa-tpl-card { border: 1px solid var(--k-line); border-radius: var(--k-card-r); background: var(--k-surface); box-shadow: var(--k-shadow-sm, var(--k-shadow)); display: flex; flex-direction: column; overflow: hidden; }
.wa-tpl-card[hidden] { display: none !important; }
.wa-tpl-head { padding: 16px 20px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--k-hair); }
.wa-tpl-head-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wa-tpl-head-title b { font-size: var(--k-16); font-weight: 700; color: var(--k-text); }
.wa-tpl-head-title small { font-size: var(--k-12); color: var(--k-muted); font-weight: 500; }
.wa-tpl-stage {
    padding: 16px 20px; background: color-mix(in srgb, var(--k-ground) 72%, var(--k-surface));
    display: flex; flex-direction: column; gap: 8px;
}
.wa-tpl-bubble {
    background: var(--k-surface); border: 1px solid var(--k-line);
    border-radius: var(--k-r) var(--k-r) var(--k-r) 4px; padding: 14px 16px 11px;
    font-size: var(--k-14); line-height: 1.65; color: var(--k-text); white-space: pre-line; overflow-wrap: anywhere;
    box-shadow: var(--kz-shadow);
}
.wa-tpl-bubble mark {
    background: color-mix(in srgb, var(--k-accent) 13%, transparent); color: var(--k-text);
    padding: 1px 3px; border-radius: 4px; font-weight: 600;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.wa-tpl-bubble-time { display: block; text-align: right; font-size: var(--k-12); color: var(--k-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.wa-tpl-vars { padding: 13px 20px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--k-hair); background: var(--k-surface); }
.wa-tpl-vars .tag { font-size: var(--k-12); height: 24px; padding: 0 9px; }
.wa-tpl-card > details.k-fold { margin: 0; border: 0; border-top: 1px solid var(--k-hair); border-radius: 0; box-shadow: none; }
.wa-tpl-card > details.k-fold > summary { padding: 13px 20px; font-size: var(--k-13); font-weight: 600; color: var(--k-muted); border-radius: 0 !important; }
.wa-tpl-card > details.k-fold > summary .k-edit { height: 30px; padding: 0 13px; font-size: var(--k-12); }
.wa-tpl-card > details.k-fold > .k-fold-body { padding: 16px 20px 18px; background: var(--k-surface); }

/* ── Shared UX cognitive-load helpers: liveFilter, conditional fields, fold stacks, and split review ── */
:is(tr, details.k-fold, .card, .form-group, [data-filter-item], [data-show-when])[hidden] { display: none !important; }
.k-chipbar + .k-livebar, .k-views + .k-filterbar { margin-top: -4px; }
.k-live-empty {
    padding: 18px 20px; margin: 10px 0; border-radius: var(--k-r);
    border: 1px dashed var(--k-line); background: var(--k-surface); text-align: center;
}
.k-fold-stack { display: flex; flex-direction: column; gap: 10px; }
.k-fold-stack > details.k-fold { margin: 0; }
.k-split-review { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1080px) {
    .k-split-review { grid-template-columns: minmax(0, 1fr) minmax(380px, 46%); }
    .k-split-sticky { position: sticky; top: 20px; }
}
.k-insert-chip {
    display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
    border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-surface);
    color: var(--k-text); font: 600 var(--k-12) var(--k-font); cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}
/* A blank to put in a message ({first name}) or a quick link: the words' own letters, never a typewriter's (UI audit
   step 3, module 2), and a 36px place to tap on a phone. */
@media (max-width: 768px) { .k-insert-chip { height: auto; min-height: 36px; } }
.k-insert-chip:hover { border-color: var(--k-accent); background: var(--k-accent-soft); color: var(--k-accent-text); }
.k-flash.ok { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.k-flash-acts { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.k-flash-undo { margin: 0; display: inline-flex; }
.k-flash-btn { min-height: 32px; height: 32px; padding: 0 12px; font-size: var(--k-13); border-radius: var(--k-r-sm); background: var(--k-surface); }
.k-linkbtn { border: 0; background: none; padding: 0; color: var(--k-accent-text); font: 600 var(--k-13) var(--k-font); text-decoration: underline; cursor: pointer; }
.k-live-math {
    padding: 10px 14px; border-radius: var(--k-r-sm); border: 1px solid var(--k-hair);
    background: color-mix(in srgb, var(--k-ground) 65%, var(--k-surface));
    font-size: var(--k-13); color: var(--k-text); font-variant-numeric: tabular-nums;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}

/* ── Shared Server Table Pagination & 10-to-200 Rows-Per-Page Bar ────────── */
.k-pager {
    display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap;
    padding: 12px 18px; border-top: 1px solid var(--k-line);
    background: color-mix(in srgb, var(--k-ground) 42%, var(--k-surface));
}
.card-body > .k-pager {
    margin: 4px -20px -20px; padding: 12px 20px;
}
.k-pager-info { font-size: var(--k-13); color: var(--k-muted); font-variant-numeric: tabular-nums; }
.k-pager-info b { color: var(--k-text); font-weight: 700; }
.k-pager-controls { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-left: auto; }
.k-per-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.k-per-lbl { font-size: var(--k-13); font-weight: 600; color: var(--k-muted); margin: 0; white-space: nowrap; }
.k-pager input.k-per-input {
    width: 82px !important; min-height: 36px; height: 36px; padding: 0 10px !important;
    border-radius: var(--k-r-sm); border: 1px solid var(--k-field); background: var(--k-surface);
    color: var(--k-text); font-size: var(--k-14); font-weight: 600; text-align: center;
    font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.k-pager input.k-per-input::-webkit-outer-spin-button,
.k-pager input.k-per-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.k-per-range { font-size: var(--k-12); color: var(--k-muted); white-space: nowrap; }
.k-pager .k-per-btn { min-height: 36px; height: 36px; padding: 0 14px; border-radius: var(--k-r-sm); }
.k-pager-btns { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.k-pg {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px;
    border-radius: var(--k-r-sm); border: 1px solid var(--k-line); background: var(--k-surface);
    color: var(--k-text); font-size: var(--k-13); font-weight: 600; text-decoration: none;
    font-variant-numeric: tabular-nums; transition: background .14s, border-color .14s;
}
.k-pg:hover { background: var(--k-hover); border-color: var(--k-field); }
.k-pg.on { background: var(--k-ink); color: var(--k-surface); border-color: var(--k-ink); }
@media screen { :root[data-theme="dark"] .k-pg.on { background: var(--k-accent); color: var(--k-on-accent); border-color: var(--k-accent); } }
.k-pg-gap { padding: 0 4px; color: var(--k-muted); font-size: var(--k-13); }
/* Under a list's own card (Orders, Receipts: drawing m2) the foot is plain words and buttons, not a bar of its own. */
.card + .k-pager { margin-top: -10px; padding: 0 4px 4px; border-top: 0; background: none; }
/* A phone's foot (drawing m1): "Showing 25 of 148" and "Show 25 more", which adds the next rows under the list. */
.k-pager-phone { display: none; }
@media (max-width: 768px) {
    .k-pager, .card + .k-pager { margin-top: 0; padding: 6px 2px 0; border-top: 0; background: none; flex-wrap: nowrap; }
    .card + .k-pager { margin-top: -18px; }
    .card-body > .k-pager { margin: 4px 0 0; padding: 6px 0 0; }
    /* The page numbers and the rows box are a computer's; a list that fits in one go needs no foot. */
    .k-pager-info, .k-pager-controls, .k-pager-one { display: none; }
    .k-pager-phone { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; }
    .k-pager-count { font-size: var(--k-13); font-weight: 500; color: var(--k-muted); font-variant-numeric: tabular-nums; }
    .k-pager-count b { font-weight: 500; color: inherit; }
    .k-pager-more {
        display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; margin-left: auto;
        color: var(--k-text); font-size: var(--k-14); font-weight: 600; text-decoration: none; white-space: nowrap;
    }
    .k-pager[aria-busy="true"] .k-pager-more { opacity: .55; }
}

/* ── Typing on a phone never zooms the page (UI audit, 26 Nov 2026) ─────────
   A phone zooms in on a box whose words are under 16px. The base rule above
   (14px) outranks the phone rule near the top, and screens set their own
   small sizes (the Leads board's stage box, the inbox and chat search boxes,
   the quick replies search), so the size is set here last, for every box
   a person types or picks in. Their height is at least 48px, unless a screen
   keeps a compact box of its own (a toolbar search). A computer is unchanged. */
@media (max-width: 768px) {
    input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="color"]),
    select, textarea, .form-control { font-size: var(--k-16) !important; }
    input[type="text"], input[type="email"], input[type="number"], input[type="date"],
    input[type="datetime-local"], input[type="time"], input[type="search"], input[type="tel"],
    input[type="url"], input[type="password"], input:not([type]), select, textarea, .form-control,
    .k-fb-search input, .k-fb-select, .k-inline-add input:not([type=hidden]) { min-height: var(--kz-field-h-phone); }
    .nav-palette input { min-height: 52px; }
}

/* ═══ ONE POP-UP (Pack B, 27 Nov 2026, drawings m9 and m12) ════════════════
   Every pop-up in Admin is a <dialog> opened with showModal: parts.ts popup()
   and the frame's own "are you sure?" box. The page behind cannot be used,
   focus stays inside, Escape closes it, and so does a click on the dim page
   around it. Always a title, an X and two buttons, the safe one first. On a
   computer it is a box in the middle; on a phone a sheet from the bottom. It
   names its colours from the kit only, so the dark look needs nothing more. */
.k-pop {
    padding: 0; border: 0; margin: auto;
    width: 460px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto;
    border-radius: var(--k-r); background: var(--k-surface); color: var(--k-text);
    box-shadow: var(--kz-shadow-pop), 0 0 0 1px var(--k-hair);
}
/* The page dimmed behind a pop-up. An older browser gives ::backdrop none of the page's custom properties, so
   the rule book's light dim is written out after the token as its fallback (a named exception in
   test/typed-values.test.ts): there it is the light dim in either look, never no dim at all. */
.k-pop::backdrop { background: var(--kz-dim, rgba(14, 27, 51, 0.42)); }
/* Drawn open by the server (an address that opens it) until the frame's script makes it a real pop-up, or with no script at all. */
.k-pop[open]:not(:modal) { position: fixed; inset: 0; z-index: 100; box-shadow: 0 0 0 100vmax var(--k-dim); }
.k-pop [hidden] { display: none !important; }
.k-pop-in { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; }
.k-pop-grab { display: none; }
.k-pop-hd { display: flex; align-items: flex-start; gap: 12px; }
.k-pop-title { flex: 1; min-width: 0; margin: 0; font-size: var(--k-20); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--k-text); }
.k-pop-x {
    flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; margin: -4px -6px 0 0; padding: 0;
    border-radius: 50%; border: 1px solid var(--k-line); background: var(--k-surface); color: var(--k-text);
    cursor: pointer; text-decoration: none;
}
.k-pop-x:hover { background: var(--k-hover); border-color: var(--k-field); color: var(--k-text); }
.k-pop-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.k-pop-line, .k-pop-body > p { margin: 0; font-size: var(--k-16); line-height: 1.5; color: var(--k-muted); }
.k-pop-acts { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.k-pop-acts .btn, .k-pop-acts .btn-sm { height: var(--kz-button-h); min-height: var(--kz-button-h); padding: 0 20px; font-size: var(--k-14); }
/* The action of an "are you sure?" that takes something away: the kit's danger colour, filled. */
.k-pop-acts .btn-danger.k-pop-red, .k-pop-acts .btn-danger.k-pop-red:hover {
    background: var(--k-red); border-color: var(--k-red); color: var(--k-surface); box-shadow: none;
}
.k-pop-acts .btn-danger.k-pop-red:hover { filter: brightness(1.08); }
/* A day picker in a pop-up opens its calendar inside the pop-up, across its whole width, never floating out of it
   (a pop-up scrolls, so a floating calendar was cut off at its edge). */
.k-pop :has(> .k-dates[open]) { grid-column: 1 / -1; }
.k-pop .k-dates[open] { width: 100%; }
.k-pop .k-dates-pop { position: static; width: auto; max-width: none; margin-top: 8px; grid-template-columns: 1fr; gap: 8px; box-shadow: none; border: 1px solid var(--k-line); }
.k-pop .k-dates-quick { flex-direction: row; flex-wrap: wrap; }
@keyframes k-pop-up { from { transform: translateY(28px); } to { transform: none; } }
@media (max-width: 768px) {
    .k-pop {
        width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0;
        border-radius: var(--k-r) var(--k-r) 0 0; box-shadow: var(--kz-shadow-pop);
    }
    .k-pop[open]:not(:modal) { inset: auto 0 0 0; }
    .k-pop[open] { animation: k-pop-up .2s ease-out; }
    .k-pop-in { padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); }
    .k-pop-grab { display: block; width: 40px; height: 4px; border-radius: 999px; margin: 0 auto 2px; background: color-mix(in srgb, var(--k-field) 45%, var(--k-surface)); }
    .k-pop-x { width: 44px; height: 44px; margin: -6px -6px 0 0; }
    .k-pop-acts { flex-wrap: nowrap; }
    .k-pop-acts .btn, .k-pop-acts .btn-sm { flex: 1 1 0; min-width: 0; height: auto; min-height: 50px; font-size: var(--k-16); }
    :root:has(.k-pop[open]:modal) { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .k-pop[open] { animation: none; } }

/* ═══ NOTHING PAST A PHONE'S EDGE (Pack B, release 2, 27 Nov 2026, drawing m10) ═══
   Tab rows swipe, the boxes round them may shrink, tags wrap, a wide box
   scrolls in its place. A computer keeps everything as it was, its tab rows
   with their arrows. test/phone-pages.test.ts opens every page to keep it so. */
@media (max-width: 768px) {
    /* A row of tabs longer than the phone is swiped. The rest of its tabs sit behind a soft fade on the side that
       has more (the frame's script says which: k-more-left, k-more-right), never behind an arrow over a word. */
    :is(.hub-tabs, .k-tabs, .k-views, .k-sectabs) > :is(.k-tabmore, .k-tabless) { display: none; }
    .k-has-more.k-more-right { mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
    .k-has-more.k-more-left { mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
    .k-has-more.k-more-left.k-more-right { mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
    /* The boxes round a tab row (up to three deep: its own box, a card and its body) may be narrower than the row.
       A flex or grid item grows to fit what is in it, so a long row made its whole box, and the page with it, wider
       than the phone: the row ran past the edge with no way to reach its end (Orders' "Paid in full", Short-let
       bookings' "Confirmed & in-house"). Three deep covers every page; test/phone-pages.test.ts names one that needs more. */
    .main-content :has(> :is(.hub-tabs, .k-tabs, .k-views), > * > :is(.hub-tabs, .k-tabs, .k-views), > * > * > :is(.hub-tabs, .k-tabs, .k-views)) { min-width: 0; }
    /* A tag longer than its place wraps inside its pill, never past the phone's edge (a WhatsApp reminder's
       template words, "Confirmed by ..." on Money in). A short tag looks as it did. */
    .main-content .tag { flex-shrink: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; height: auto; min-height: 24px; padding-top: 3px; padding-bottom: 3px; }
}

/* A wide table, or anything else too wide for its place, scrolls inside its own box (k-scrollx), never past the
   phone's edge, with the tab rows' soft fade on the side that has more (the frame's script says which). */
.k-scrollx { overflow-x: auto; max-width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; }
@media print { .k-scrollx { overflow: visible; mask-image: none !important; } }

/* ═══ FILTERS ON A PHONE (Pack B, release 2, drawings m10 and m9) ═══════════
   parts.ts filterBar and liveFilter, and the Leads board's own bar. On a phone
   with the frame's script (html.k-js, set first thing in the page's head, so
   a page whose scripts never ran keeps its fields in the bar), a bar is one
   search box and one Filters button; the choices open in the kit's sheet (the
   script moves the bar's own fields in while it is open), and what is chosen
   shows as chips under the bar. A computer, and a phone with no script, keep
   the bar exactly as it was: the button, the chips and the empty sheet are
   never shown there. */
.k-fb-open, .k-fb-chips { display: none; }
.k-fb-sheet .k-pop-body { gap: 0; }
.k-fb-fields { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.k-fb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; font-weight: 400; }
.k-fb-label { font-size: var(--k-14); font-weight: 600; color: var(--k-text); line-height: 1.3; }
.k-fb-sheet .k-fb-field > select, .k-fb-sheet .k-fb-field > input { width: 100%; max-width: none; flex: none; min-height: var(--kz-field-h-phone); }
.k-fb-sheet .k-fb-field > .k-dates, .k-fb-sheet .k-fb-field > .k-dates > summary { width: 100%; max-width: none; }
.k-fb-sheet .k-fb-field > .k-dates > summary { height: 48px; }
.k-fb-sheet .k-fb-field > .k-dates > summary .k-caret { margin-left: auto; }
@media (max-width: 768px) {
    .k-js .k-filterbar:has(> .k-fb-open) { flex-wrap: wrap; }
    .k-js .k-filterbar:has(> .k-fb-open) > .k-fb-search { flex: 1 1 160px; min-width: 0; }
    /* "More" in the same row is as tall as the search box and Filters beside it. */
    .k-js .k-filterbar:has(> .k-fb-open) > .k-more > summary { width: 48px; height: 48px; }
    /* The choices live in the sheet; their place in the bar is empty. */
    .k-js .k-filterbar:has(> .k-fb-open) > [data-fb-field] { display: none; }
    .k-js .k-fb-open {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
        height: 48px; padding: 0 14px; border-radius: var(--k-r); border: 1px solid var(--k-field);
        background: var(--k-surface); color: var(--k-text); font: 600 var(--k-16) var(--k-font); cursor: pointer;
    }
    .k-js .k-fb-open .ph { color: var(--k-text); }
    .k-js .k-fb-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
        background: var(--k-text); color: var(--k-surface); font-size: var(--k-12); font-weight: 700; font-variant-numeric: tabular-nums; }
    .k-js .k-fb-n[hidden] { display: none; }
    .k-js .k-fb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 100%; min-width: 0; }
    .k-js .k-fb-chips[hidden] { display: none; }
    .k-js .k-fb-chip {
        position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; max-width: 100%;
        padding: 0 6px 0 12px; border: 0; border-radius: 999px; background: var(--k-chip); color: var(--k-text);
        font: 500 var(--k-14) var(--k-font); text-decoration: none; cursor: pointer;
    }
    .k-js .k-fb-chip > span { min-width: 0; overflow-wrap: anywhere; }
    .k-js .k-fb-chip .ph { flex: none; width: 24px; height: 24px; padding: 3px; border-radius: 50%; color: var(--k-text); }
    /* A report's days, never empty: said on a chip that opens the sheet to change them, with no X. */
    .k-js .k-fb-chip.k-fb-fixed { padding: 0 12px 0 6px; }
    /* A 44px place to tap, over and under a chip 36px tall (32 before the UI audit's step 3, module 2). */
    .k-js .k-fb-chip::after, .k-js .k-fb-clearall::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
    .k-js .k-fb-clearall { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; border: 0; background: none;
        color: var(--k-accent-text); font: 600 var(--k-14) var(--k-font); text-decoration: none; cursor: pointer; }
}

/* ═══ LISTS WITH PAGES: TWO LINES A ROW ON A PHONE (Pack B, release 3, 27 Nov 2026, drawings m1 and m2) ═════════
   A table marked k-twoline (see parts.ts) is one line a row on a computer, nothing wrapping: a cell's lines
   (cellLines: k-l1, and k-l2 under it) stay one line each, and long words (k-cut) end in "...", giving way first
   when the table is short of room (down to 6rem, then the card scrolls). On a phone it is one box of rows, each two lines and
   one tap, its a.k-rowlink covering the whole row: "who" and "amount" on line one, "what" and "tag" on line two, read
   from each cell's data-role. A cell with no role takes no room there; a k-phone-only cell shows only there. */
table.k-twoline th, table.k-twoline td { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
table.k-twoline th:first-child, table.k-twoline td:first-child { padding-left: 20px; }
table.k-twoline th:last-child, table.k-twoline td:last-child { padding-right: 20px; }
table.k-twoline .k-l1, table.k-twoline .k-l2,
table.k-cards .k-l1, table.k-cards .k-l2 { display: block; }
table.k-cards .k-l1 { font-weight: 600; color: var(--k-text); }
table.k-twoline .k-l2,
table.k-cards .k-l2 { margin-top: 2px; font-size: var(--k-13); color: var(--k-muted); }
/* Words that may be long (a name, an estate): kept to one line, ending in "...". */
table.k-twoline .k-cut {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;
    white-space: normal; word-break: break-all; min-width: 6rem; max-width: var(--k-cut, 15rem);
}
table.k-twoline .k-phone-only { display: none; }
table.k-twoline a.k-rowlink:focus-visible { outline: none; }
table.k-twoline a.k-rowlink:focus-visible::after { outline: 2px solid var(--k-accent); outline-offset: -2px; }
@media (max-width: 768px) {
    .card:has(> table.k-twoline) { overflow: hidden; }
    table.k-twoline, table.k-twoline > tbody { display: block; }
    table.k-twoline > thead { display: none; }
    /* Each line splits on its own: the name gives way to the amount on line one, the words to the tag on line two. */
    table.k-twoline > tbody > tr {
        display: flex; flex-wrap: wrap; align-items: center; align-content: center; position: relative;
        min-height: 68px; padding: 11px 14px; border-top: 1px solid var(--k-line); background: var(--k-surface);
    }
    /* The break between the lines: a whole line wide, so what follows it starts line two (and nothing of 0px joins it). */
    table.k-twoline > tbody > tr::before { content: ''; order: 3; flex: 0 0 100%; height: 3px; }
    table.k-twoline > tbody > tr:first-child { border-top: 0; }
    table.k-twoline > tbody > tr:hover, table.k-twoline > tbody > tr:active { background: var(--k-hover); }
    table.k-twoline > tbody > tr > td { display: none; }
    table.k-twoline > tbody > tr > td[data-role] {
        display: block; flex: none; min-width: 0; padding: 0; border: 0; background: none;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    table.k-twoline > tbody > tr > td[data-role] .k-l1 { display: block; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-line-clamp: none; }
    /* A link or bold name inside it is cut with it, never wider than its cell (a 40-letter buyer's name on Buyers). */
    table.k-twoline > tbody > tr > td[data-role] .k-l1 > :is(a, b), table.k-twoline > tbody > tr > td[data-role] .k-l1 > a > b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    table.k-twoline > tbody > tr > td[data-role] .k-l2,
    table.k-twoline > tbody > tr > td[data-role] br { display: none; }
    table.k-twoline .k-desk-only { display: none !important; }
    table.k-twoline > tbody > tr > td[data-role] .k-phone-only { display: inline; }
    table.k-twoline > tbody > tr > td[data-role="who"] { order: 1; flex: 1 1 1px; font-size: var(--k-item); font-weight: 600; color: var(--k-text); text-align: left; }
    table.k-twoline > tbody > tr > td[data-role="amount"] { order: 2; margin-left: auto; padding-left: 10px; font-size: var(--k-item); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
    table.k-twoline > tbody > tr > td[data-role="what"] { order: 4; flex: 1 1 1px; font-size: var(--k-item-sub); color: var(--k-muted); text-align: left; }
    table.k-twoline > tbody > tr > td[data-role="tag"] { order: 5; margin-left: auto; padding-left: 10px; max-width: 60%; font-size: var(--k-item-sub); color: var(--k-muted); }
    table.k-twoline > tbody > tr > td[data-role] > .k-help { display: inline; margin: 0; font-size: inherit; }
    /* The cell with the row's link takes no room; its link still covers the whole row (the row is its box). */
    table.k-twoline > tbody > tr > td:has(a.k-rowlink):not([data-role]) { display: block; order: 0; flex: none; position: static; width: 0; height: 0; padding: 0; border: 0; overflow: hidden; }
    /* Nothing in a shown cell is a tap of its own: the row is one tap. */
    table.k-twoline > tbody > tr > td[data-role] :is(a, button) { position: static; color: inherit; text-decoration: none; }
}

/* ═══ FIRM ADMIN'S MENU BY THE JOB (owner, 27 Nov 2026, drawings m7 and m14) ═══
   Ten rows in three parts, each part under a small heading; an open row shows its pages, each old sub-menu under
   its old name where that helps. Made to fit a laptop's 800px with a row open: the look sits behind a small button
   beside who is signed in, and on a short screen the firm's chip gives its room to the rows (the firm's name is on
   Home and in the browser's tab).
   On a phone a bar at the foot (Home, Today, Messages, Sales, Menu) and the Menu as the kit's sheet. */
.nav-part {
    list-style: none; user-select: none; font-size: var(--k-12); font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--kz-on-band-muted); padding: 14px 10px 6px;
    line-height: 1.3125;
}
.nav-block-head {
    list-style: none; user-select: none; font-size: var(--k-12); font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--kz-on-band-muted); padding: 14px 10px 5px; line-height: 1.25;
}
.nav-sub > .nav-block-head:first-child { padding-top: 6px; }
.sidebar-nav.k-rows { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav.k-rows > li { flex: none; }
.sidebar-nav.k-rows > li.nav-item > a { height: 34px; }
.sidebar-nav.k-rows .nav-sub { margin: 6px 0 12px 20px; gap: 4px; }
.sidebar-nav.k-rows li .nav-sub a.nav-sub-link { min-height: 31px; padding: 4px 12px; }
.sidebar-footer .k-lookmore { position: relative; flex: none; }
.sidebar-footer .k-lookmore > summary { list-style: none; width: 32px; height: 32px; border-radius: 8px; }
.sidebar-footer .k-lookmore > summary::-webkit-details-marker { display: none; }
.sidebar-footer .k-lookpop { position: absolute; left: auto; right: -40px; top: auto; bottom: calc(100% + 8px); min-width: 0; width: auto; padding: 4px; z-index: 70; }
.sidebar-footer .k-lookpop .k-look { margin: 0; background: var(--k-ground); border: 1px solid var(--k-line); color: var(--k-muted); }
.sidebar-footer .k-lookpop .k-look button { width: 40px; height: 34px; flex: none; color: var(--k-muted); }
.sidebar-footer .k-lookpop .k-look button:hover { color: var(--k-text); }
.sidebar-footer .k-lookpop .k-look button.on { background: var(--k-surface); color: var(--k-text); box-shadow: var(--k-shadow-sm); }
body.nav-collapsed .sidebar-footer .k-lookpop { left: 0; right: auto; }
/* Folded to icons, the look still opens its three choices (the folded menu hides the look picker it had in place). */
body.nav-collapsed .sidebar-footer .k-lookpop .k-look { display: flex; }
/* THE FOLDED MENU: a row's pages in a small list beside its icon (layout.ts, "THE FOLDED MENU"), never only its first. */
.nav-flyout-head { display: none; }
@media (min-width: 769px) {
    body.nav-collapsed .sidebar-nav li.nav-item.is-flyout > ul.nav-sub {
        display: flex !important; position: fixed; left: 76px; z-index: 80; width: 240px; max-height: calc(100vh - 16px); overflow-y: auto;
        margin: 0; padding: 6px; gap: 1px; border: 1px solid color-mix(in srgb, var(--kz-on-band) 12%, transparent); border-radius: var(--k-r);
        background: var(--kz-band); box-shadow: var(--kz-shadow-pop);
    }
    body.nav-collapsed .sidebar-nav li.is-flyout .nav-flyout-head { display: block; list-style: none; padding: 6px 10px 4px; color: var(--kz-on-band); font-size: var(--k-13); font-weight: 700; }
    body.nav-collapsed .sidebar-nav li.is-flyout .nav-block-head { display: block; }
    body.nav-collapsed .sidebar-nav li.is-flyout .nav-sub a { width: 100%; height: auto; min-height: 30px; margin: 0; padding: 4px 10px; justify-content: flex-start; }
    body.nav-collapsed .sidebar-nav li.is-flyout .nav-sub a span { display: inline; }
    body.nav-collapsed .sidebar-nav li.is-flyout .nav-sub a:hover::after { display: none; }
}
body.nav-collapsed .nav-part, body.nav-collapsed .nav-block-head { display: none; }
@media (min-width: 769px) and (max-height: 860px) {
    body.has-tabbar .sidebar { padding-top: 14px; }
    body.has-tabbar .sidebar .ws-chip { display: none; }
    body.has-tabbar .sidebar-header { gap: 8px; padding-bottom: 8px; }
    body.has-tabbar .nav-search-hint { margin-bottom: 6px; }
    /* 31px, not 32: eleven rows since Analytics has its own (30 Nov 2026), and the menu still fits a laptop with a row open. */
    .sidebar-nav.k-rows > li.nav-item > a { height: 31px; }
    .sidebar-nav.k-rows .nav-sub { margin: 5px 0 10px 20px; gap: 3px; }
    .sidebar-nav.k-rows li .nav-sub a.nav-sub-link { min-height: 29px; padding: 4px 12px; }
    .sidebar-nav.k-rows .nav-part { padding: 11px 10px 4px; }
    .sidebar-nav.k-rows .nav-block-head { padding: 11px 10px 4px; }
    .sidebar-nav.k-rows .nav-sub > .nav-block-head:first-child { padding-top: 5px; }
}
.k-tabbar { display: none; }
@media (max-width: 768px) {
    body.has-tabbar .sidebar { display: none; }
    /* The bar at the foot: over the page, under Ask Klo and every pop-up; the page keeps room for it under its last line. */
    .k-tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
        background: var(--k-surface); border-top: 1px solid var(--k-line); box-shadow: 0 -6px 18px var(--kz-hair);
    }
    .k-tabbar-item {
        position: relative; flex: 1 1 0; min-width: 0; min-height: 54px; padding: 6px 2px 4px; margin: 0;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        border: 0; border-radius: var(--k-r); background: none; cursor: pointer; text-decoration: none;
        color: var(--k-muted); font: 600 var(--k-12)/1.1 var(--k-font);
    }
    .k-tabbar-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .k-tabbar-item.on { color: var(--k-flame-text); }
    .k-tabbar-item:active { background: var(--k-hover); }
    .k-tabbar-badge {
        position: absolute; top: 3px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px;
        border-radius: 999px; background: var(--k-flame); color: var(--kz-on-flame); font-size: var(--k-12); font-weight: 700;
        display: inline-grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums;
    }
    body.has-tabbar .main-content { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    /* Ask Klo stays in the top bar, now at its right end (the menu button gave way to the bar's Menu); opened, it
       sits above the bar, never under it. */
    body.has-tabbar .klo-dock:not([open]) { right: 8px; }
    body.has-tabbar .klo-dock[open] { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .k-tabbar { display: none !important; } }
.k-menusheet .k-pop-acts:empty { display: none; }
.k-menusheet .k-pop-title { font-size: var(--k-20); }
.k-menusheet-sub { display: block; margin-top: 2px; font-size: var(--k-14); font-weight: 500; letter-spacing: 0; color: var(--k-muted); }
.k-menu { display: flex; flex-direction: column; min-width: 0; }
.k-menu-view { display: flex; flex-direction: column; min-width: 0; }
.k-menu-find {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; margin: 0 0 4px;
    border: 1px solid var(--k-line); border-radius: var(--k-r); background: var(--k-ground); color: var(--k-muted);
    font: 500 var(--k-16) var(--k-font); text-align: left; cursor: pointer;
}
.k-menu-rows, .k-menu-links { list-style: none; margin: 0; padding: 0; }
.k-menu-row {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 2px; margin: 0;
    border: 0; border-bottom: 1px solid var(--k-line); background: none; color: var(--k-text);
    font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.k-menu-rows > li:last-child > .k-menu-row { border-bottom: 0; }
.k-menu-rowwords { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.k-menu-rowwords b { font-size: var(--k-16); font-weight: 700; letter-spacing: -0.01em; }
.k-menu-rowwords span { font-size: var(--k-14); color: var(--k-muted); }
.k-menu-row.on .k-menu-rowwords b, .k-menu-link.on { color: var(--k-flame-text); }
.k-menu-row > svg, .k-menu-link > svg { flex: none; color: var(--k-muted); }
.k-menu-back {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0; margin: 0;
    border: 0; background: none; color: var(--k-flame-text); font: 600 var(--k-16) var(--k-font); cursor: pointer;
}
.k-menu-title { margin: 2px 0 6px; font-size: var(--k-20); font-weight: 800; letter-spacing: -0.02em; }
.k-menu-head { margin: 14px 0 0; font-size: var(--k-12); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--k-muted); }
.k-menu-link {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 2px;
    border-bottom: 1px solid var(--k-line); color: var(--k-text); text-decoration: none; font-size: var(--k-16);
}
.k-menu-link > span { flex: 1; min-width: 0; }
.k-menu-link.on { font-weight: 700; }
.k-menu-links > li:last-child > .k-menu-link { border-bottom: 0; }
.k-menu-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--k-line); }
.k-menu-foot .avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: var(--k-hero); color: var(--kz-on-band); font-size: var(--k-12); font-weight: 700; }
.k-menu-foot .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.k-menu-foot .who b { font-size: var(--k-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-menu-foot .who span { font-size: var(--k-12); color: var(--k-muted); }
.k-menu-foot form { margin: 0; }
.k-menu-foot .k-look { margin: 0; flex: none; background: var(--k-ground); border: 1px solid var(--k-line); color: var(--k-muted); }
.k-menu-foot .k-look button { width: 40px; height: 40px; flex: none; color: var(--k-muted); }
.k-menu-foot .k-look button.on { background: var(--k-surface); color: var(--k-text); box-shadow: var(--k-shadow-sm); }
.k-menu-foot .out { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--k-r); background: none; color: var(--k-muted); cursor: pointer; }
.k-menu-foot .out:hover { background: var(--k-hover); color: var(--k-text); }
/* The row a link points at (Today's rows open the withdrawal, the commission line or the refund itself): scrolled
   to with room above, and marked, by the address's #id or, after the frame swapped the page in, by .k-hit. */
tr[id], [id].k-hit { scroll-margin-top: 96px; }
tr[id]:target > td, tr.k-hit > td { background: var(--k-accent-soft); }
tr[id]:target, tr.k-hit { outline: 2px solid var(--k-accent); outline-offset: -2px; }

/* ═══ ONE LIST OF CONVERSATIONS (UI audit step 3, module 1, finding 5): the WhatsApp inbox, the help desk, Mail and
   the team chat draw their list with admin/conversations.ts, on the WhatsApp list's design. A face, the name and the
   time; the last line and the unread count; small tags under them. Bold with its time in the accent: they wrote last
   and wait for an answer. The same on a phone: one column, each row one tap at least 64px tall. */
.k-convos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.k-convo { min-width: 0; }
.k-convo[hidden], .k-convo-hd[hidden] { display: none !important; }
.k-convo-link {
    display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; min-height: 64px;
    padding: 12px 14px; color: var(--k-text); text-decoration: none; border-bottom: 1px solid var(--k-hair);
}
.k-convo-link:hover { background: var(--k-hover); color: var(--k-text); }
.k-convo.on .k-convo-link { background: var(--k-accent-soft); }
.k-convo-link:focus-visible { outline: 2px solid var(--k-focus); outline-offset: -2px; }
.k-face {
    width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
    font-size: var(--k-14); font-weight: 700; line-height: 1; letter-spacing: .02em;
    background: var(--k-chip); color: var(--k-text);
}
.k-face.sq { border-radius: var(--k-r-sm); }
/* Six faces, each a pair the rule book already reads well (a tag's soft fill and its words), light and dark alike. */
.k-face.t0 { background: var(--k-blue-soft); color: var(--k-blue); }
.k-face.t1 { background: var(--k-green-soft); color: var(--k-green); }
.k-face.t2 { background: var(--k-amber-soft); color: var(--k-amber); }
.k-face.t3 { background: var(--k-red-soft); color: var(--k-red); }
.k-face.t4 { background: var(--k-accent-soft); color: var(--k-accent-text); }
.k-face.t5 { background: var(--k-chip); color: var(--k-text); }
.k-convo-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.k-convo-top, .k-convo-bottom { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; min-width: 0; }
.k-convo-name { font-size: var(--k-14); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.k-convo-when { flex: none; font-size: var(--k-12); color: var(--k-muted); }
.k-convo-last { flex: 1; min-width: 0; font-size: var(--k-13); color: var(--k-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-convo.waiting .k-convo-name, .k-convo.waiting .k-convo-last { font-weight: 700; color: var(--k-text); }
.k-convo.waiting .k-convo-when { color: var(--k-accent-text); font-weight: 600; }
.k-convo-n {
    flex: none; align-self: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-grid; place-items: center; background: var(--k-accent); color: var(--k-on-accent);
    font-size: var(--k-12); font-weight: 700; font-variant-numeric: tabular-nums;
}
.k-convo-mark {
    flex: none; align-self: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
    display: inline-grid; place-items: center; background: var(--k-accent-soft); color: var(--k-accent-text);
    font-size: var(--k-12); font-weight: 700;
}
.k-convo-tags { display: flex; gap: 4px; flex-wrap: wrap; }
/* A row's own small actions (the help desk's Assign to me, Mark done) sit beside its link, never inside it. */
.k-convo.has-acts { display: flex; align-items: stretch; border-bottom: 1px solid var(--k-hair); }
.k-convo.has-acts > .k-convo-link { flex: 1; min-width: 0; border-bottom: 0; }
.k-convo-acts { flex: none; display: flex; align-items: center; padding-right: 6px; }
.k-convo-tags .tag { font-size: var(--k-12); }
.k-convo-hd {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 4px;
    font-size: var(--k-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--k-muted);
}
/* The day said once above its messages, the same in the team chat and on WhatsApp. */
.k-day { align-self: center; margin: 8px 0; display: flex; justify-content: center; }
.k-day span { font-size: var(--k-12); color: var(--k-muted); background: var(--k-surface); border: 1px solid var(--k-line); padding: 3px 10px; border-radius: 999px; }
@media (max-width: 768px) {
    .k-convo-link { padding: 12px; min-height: 68px; }
}

