/* ==========================================================================
   ui.css — the redesign's component kit (Phase 1, 2026-10-17; B1 2026-10-22)
   --------------------------------------------------------------------------
   Layers, in order: pack tokens + components (below) · KIT (the approved
   mock kit, k- classes, tokenized — see its palette → token table) · SHELL
   v33.3 (aside, top bar, phone header + Options sheet, chevron/info, door).
   Pages built against the mock use the KIT classes; the pack classes stay
   for the pages still on the Phase 1–3 layout.
   Built from the owner's design pack (~/Desktop/ui_handoff: tokens.css +
   components.css, "Ledger" desktop + "M1" phone), adapted to the rulings in
   docs/REDESIGN-PROPOSAL.md:
     · D1 pack blue · D2 always-explicit theme, default dark, saved per person
       (the pre-paint script writes data-theme; no OS fallback, no ?theme=)
     · D9 900px, one rendered shell: ui.js sets html[data-shell=desktop|phone]
   Loaded ONLY by pages rebuilt on the new shell, never with app.css (the two
   give .card .field .row .badge .modal .toast .tabs .seg different meanings).
   Global resets are scoped with :where(html[data-shell]) — zero specificity,
   so the pack's own cascade is unchanged. Hover rules sit inside
   @media (hover:hover) so a tap never leaves a ring stuck on a phone.
   ========================================================================== */

/* ---------- tokens (light) ---------- */
:root[data-shell]{
  color-scheme: light;

  /* ---- surfaces -------------------------------------------------------- */
  --bg-backdrop:#e3e8f0;           /* = --outer  : behind a centred phone column */
  --bg-page:#f1f4f9;               /* = --ground : page, sticky top bar, sticky strips */
  --bg-sidebar:#e9eef6;            /* = --side   : desktop sidebar */
  --surface:#ffffff;               /* = --card   : cards, popovers, dialogs, sheets */
  --surface-sunken:#f3f6fb;        /* = --card2  : inset panels, tiles, phone fields */
  --surface-hero:linear-gradient(180deg,#ffffff 0%,#f4f8fe 100%); /* = --hero : featured card */
  --chip-bg:#ffffff;               /* = --chip   : raised chips, notices, theme segment */
  --scrim:rgba(20,30,50,.38);      /* = --scrim  : modal + sheet backdrop */

  /* ---- lines ----------------------------------------------------------- */
  --border:#e3e8f1;                /* = --line       : every hairline divider */
  --border-field:#cfd8e6;          /* = --field-line : input borders */
  --border-idle:#c3cede;           /* = --idle-ring  : no-data ring, dashed tags, grab handle, scrollbar */

  /* ---- text ------------------------------------------------------------ */
  --text:#1d1d1f;                  /* = --text  */
  --text-secondary:#3a4352;        /* = --text2 : sidebar items, user chip */
  --text-muted:#56606f;            /* = --muted : meta, placeholders, table headers */
  --text-label:#2c5da9;            /* = --label : UPPERCASE card titles */
  --accent:#2c5da9;                /* = --accent: links, icons, focus ring */

  /* ---- selection / navigation ----------------------------------------- */
  --selected-bg:#2c5da9;           /* = --tab-on-bg : selected pill/tab/chip/segment */
  --selected-fg:#ffffff;           /* = --tab-on-tx */
  --tab-fg:#56606f;                /* = --tab-off   : unselected tab text */
  --nav-selected-bg:#ffffff;       /* = --nav-on-bg : selected sidebar item ("lifted" white chip) */
  --nav-selected-fg:#2c5da9;       /* = --nav-on-tx */

  /* ---- buttons --------------------------------------------------------- */
  --primary-bg:#2c5da9;            /* = --primary    (NOT redefined in dark) */
  --primary-fg:#ffffff;            /* = --primary-tx (NOT redefined in dark) */
  --tint-bg:#eaf2fb;               /* = --quiet     : soft buttons, count badges */
  --tint-fg:#2c5da9;               /* = --quiet-tx  */
  --tint-bg-hover:#d3e4f8;         /* = --quiet-hov */
  --add-bg:var(--tint-bg);         /* = --plus-bg  (light falls back to tint) */
  --add-fg:var(--tint-fg);         /* = --plus-fg  */
  --add-bg-hover:var(--tint-bg-hover); /* = --plus-hov */
  --danger-solid:#b3261e;          /* = --danger    : solid destructive button */
  --danger-solid-fg:#ffffff;       /* = --danger-tx */
  --pair1-bg:#2c5da9; --pair1-fg:#ffffff;   /* = --p1-bg/--p1-tx : solid tag, variant 1 */
  --pair2-bg:#a9cff2; --pair2-fg:#0f2c57;   /* = --p2-bg/--p2-tx : solid tag, variant 2 */

  /* ---- interaction ----------------------------------------------------- */
  --hover-bg:rgba(44,93,169,.13);  /* = --hov      : hover wash */
  --hover-ring:rgba(44,93,169,.34);/* = --hov-ring : hover ring */
  --disclosure-ring:#7eb3e0;       /* = --disc-ring : round chevron disc ring, tick circle, field hover */
  --disclosure-bg:#eaf2fb;         /* = --disc-bg   */
  --disclosure-fg:#2c5da9;         /* = --disc-chev */
  --highlight-row-bg:#dbe8f8;      /* = --ro-hot-bg   : highlighted row in a hover read-out */
  --highlight-row-line:#2c5da9;    /* = --ro-hot-line */
  --highlight-row-fg:#1d3f7a;      /* = --ro-hot-tx   */

  /* ---- elevation ------------------------------------------------------- */
  --shadow-card:0 1px 2px rgba(22,44,88,.06),0 10px 28px rgba(44,93,169,.10);  /* = --glow */
  --shadow-pop:0 0 0 1px rgba(44,93,169,.10),0 18px 44px rgba(22,44,88,.18);   /* = --pop  */
  --shadow-chip:0 0 0 1px rgba(44,93,169,.13),0 1px 2px rgba(22,44,88,.05);    /* = --chip-edge */
  --shadow-sheet:0 -10px 40px rgba(0,0,0,.3);                                  /* bottom sheet (same both themes) */
  --shadow-float:0 10px 30px rgba(8,20,48,.28);                                /* floating pill (same both themes) */

  /* ---- status: fg = text, ring = stroke, bg = pill tint, surface = card tint */
  --danger-fg:#b3261e;  --danger-ring:#dc3d33;  --danger-bg:#fde9e7;  --danger-surface:#fdeeec;  /* = --red*   */
  --warning-fg:#8a5a00; --warning-ring:#dc9200; --warning-bg:#fcf1d9; --warning-surface:#fdf5e3; /* = --amber* */
  --success-fg:#1a7a3c; --success-ring:#2ea659; --success-bg:#cfe9d9;   /* item 36 (2026-10-28): deeper light green */                            /* = --green* */

  /* ---- category tints (bg / fg) — separate from status colours --------- */
  --cat-green-bg:#dcf5e3;   --cat-green-fg:#17703a;
  --cat-orange-bg:#ffe8d1;  --cat-orange-fg:#a34a05;
  --cat-slate-bg:#e9edf3;   --cat-slate-fg:#46546b;
  --cat-indigo-bg:#e6eafb;  --cat-indigo-fg:#3a4ea8;
  --cat-magenta-bg:#f8e6f3; --cat-magenta-fg:#8f2f78;
  --cat-sand-bg:#f1ece6;    --cat-sand-fg:#6b5640;
  --cat-gold-bg:#f6ecd3;    --cat-gold-fg:#7a5410;
  --cat-plum-bg:#e6d2e1;    --cat-plum-fg:#64305a;
  --cat-violet-bg:#efe9fb;  --cat-violet-fg:#5b3fb0;    /* also the ID pill */

  /* ---- 4-colour tag set: text / tint / solid swatch ------------------- */
  --tag-pink-fg:#b3266e;   --tag-pink-bg:#fce7f1;   --tag-pink-solid:#c0347d;
  --tag-violet-fg:#5b3fb0; --tag-violet-bg:#efe9fb; --tag-violet-solid:#5b3fb0;
  --tag-blue-fg:#1d6fb8;   --tag-blue-bg:#e3f2fd;   --tag-blue-solid:#1f68b3;
  --tag-gray-fg:#3a3a3c;   --tag-gray-bg:#f0f3f8;   --tag-gray-solid:#6e6e73;
  /* the *-solid values are not redefined for dark in the reference */

  /* ---- data viz (values used by the chart blocks) --------------------- */
  --chart-grid:#dfe5ee;                 /* = --grid */
  --chart-band:rgba(44,93,169,.07);     /* = --ch-night : shaded time band */
  --tooltip-bg:rgba(255,255,255,.96);   /* = --ch-tip-bg (+ backdrop-filter:blur(8px)) */
  --data-blue:#1e6ab6;                  /* data-blue text */
  --series-primary:#185FA5;             /* primary line, left axis */
  --series-secondary:#BA7517;           /* secondary line, right axis */
  --series-orange:#e3650c; --series-purple:#6a3fe0; --series-green:#1a7f37; --series-ink:#111111; /* 4-metric chart */
  --series-on-fg:#ffffff;               /* = --ch-on-tx : text on a chip filled with a series colour */
  --event-1:var(--pair1-bg);            /* = --ch-p1 */
  --event-2:#7eb3e0;                    /* = --ch-p2 */
  --event-manual:var(--warning-ring);   /* = --ch-manual */
  --target-line:var(--success-ring);    /* = --ch-target */
  /* 12-colour categorical palette (named items, legends) */
  --pal-1:#2c5da9; --pal-2:#ba7517; --pal-3:#1a7f37; --pal-4:#6a3fe0; --pal-5:#b8336a;  --pal-6:#0b7e8e;
  --pal-7:#c4302b; --pal-8:#5f8a12; --pal-9:#5b6b85; --pal-10:#9a7b00; --pal-11:#a2309f; --pal-12:#0f8f6a;

  /* ---- type (no webfonts: system stack only) --------------------------- */
  --font-sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --fs-body-desktop:14.5px;   /* line-height 1.45 */
  --fs-body-phone:15px;       /* line-height 1.45 */
  --fs-input-phone:16px;      /* never below 16px on phones (iOS focus zoom) */

  /* ---- radii (literals in the reference) ------------------------------- */
  --r-pill:999px;   /* pills, chips, segments, counts, soft buttons */
  --r-hero:26px;    /* featured card, dialog, sheet top */
  --r-card:22px;    /* card */
  --r-stat:20px;    /* stat card, paired reading card */
  --r-pop:18px;     /* popover, tile tabs, ring hit area */
  --r-lg:16px;      /* inset panel, large primary button, "show more" bar */
  --r-md:14px;      /* input, primary/ghost/danger button, search, notice, toast, tooltip */
  --r-sm:12px;      /* sidebar item, popover item, focus radius, square icon button */
  --r-id:9px;       /* ID pill, org mark */
  --r-badge:8px;    /* small square badge */
  --r-tag:6px;      /* dashed tag */

  /* ---- spacing in use (most common first: 8 10 6 4 9 5 14 12 18 16) ---- */
  --gap-card:18px;          /* desktop gap between cards / grid columns */
  --gap-card-phone:16px;    /* phone gap between cards */
  --pad-card:22px 24px;     /* desktop card (20px sides at <=1360px) */
  --pad-card-phone:16px;
  --gutter-phone:16px;      /* phone side gutter -> 358px cards in a 390px column */

  /* ---- layout ---------------------------------------------------------- */
  --sidebar-w:256px;        /* includes 1px right border; never collapses on desktop */
  --topbar-h:64px;
  --page-max:1120px;        /* includes 40px side padding -> 1040px content column */
  --phone-max:760px;        /* LAYOUT-SPEC §5: phone column at most 760, centred, 16px gutters */

  /* ---- motion ---------------------------------------------------------- */
  --t-control:background-color .12s,color .12s,box-shadow .12s,border-color .12s;
  --t-chevron:transform .15s;
  --t-toast:opacity .2s;
  --t-sheet:transform .2s;
  --t-tooltip:opacity .08s linear;
}

/* ---------- tokens (dark) ---------- */
:root[data-shell][data-theme="dark"]{
  color-scheme: dark;
  --bg-backdrop:#03060e; --bg-page:#070d1c; --bg-sidebar:#050a17;
  --surface:#0e1830; --surface-sunken:#132040;
  --surface-hero:linear-gradient(180deg,#101c3a 0%,#0c152b 100%);
  --chip-bg:#132040; --scrim:rgba(2,5,12,.62);
  --border:#1c2a4a; --border-field:#2a3b62; --border-idle:#34476e;
  --text:#e6edf3; --text-secondary:#c3cfe0; --text-muted:#93a4bf; --text-label:#6d9ee6; --accent:#7eb3e0;
  --selected-bg:#17284f; --selected-fg:#9ccbf5; --tab-fg:#7389b0;
  --nav-selected-bg:#17284f; --nav-selected-fg:#9ccbf5;
  --tint-bg:#12203f; --tint-fg:#8fc0f0; --tint-bg-hover:#1d3466;
  --add-bg:#223664; --add-fg:#9ccbf5; --add-bg-hover:#2a4278;
  --danger-solid:#f4574b; --danger-solid-fg:#16090a;
  --pair1-bg:#2f67bd; --pair1-fg:#ffffff; --pair2-bg:#93c4f2; --pair2-fg:#0a1f44;
  --hover-bg:rgba(126,179,224,.16); --hover-ring:rgba(126,179,224,.42);
  --disclosure-ring:#4a6fa5; --disclosure-bg:#1e2638; --disclosure-fg:#7eb3e0;
  --highlight-row-bg:#1f3a6e; --highlight-row-line:#a9d2f7; --highlight-row-fg:#e6edf3;
  --shadow-card:0 0 0 1px rgba(126,179,224,.07),0 10px 34px rgba(24,60,140,.28),inset 0 1px 0 rgba(255,255,255,.035);
  --shadow-pop:0 0 0 1px rgba(126,179,224,.12),0 18px 44px rgba(0,0,0,.55);
  --shadow-chip:none;
  --danger-fg:#ff7a70;  --danger-ring:#f4574b;  --danger-bg:#3a1a1c;  --danger-surface:#2b1622;
  --warning-fg:#f2b63c; --warning-ring:#f2b63c; --warning-bg:#33290f; --warning-surface:#241f17;
  --success-fg:#5fd68a; --success-ring:#3fc472; --success-bg:#12301f;
  --cat-green-bg:#0f3a22;   --cat-green-fg:#74e39a;
  --cat-orange-bg:#42240c;  --cat-orange-fg:#ffab5c;
  --cat-slate-bg:#222c40;   --cat-slate-fg:#b4c0d6;
  --cat-indigo-bg:#1f2850;  --cat-indigo-fg:#aab8f4;
  --cat-magenta-bg:#3a1d34; --cat-magenta-fg:#e9a6d8;
  --cat-sand-bg:#302a24;    --cat-sand-fg:#d4c2ab;
  --cat-gold-bg:#3b2f12;    --cat-gold-fg:#e8c06a;
  --cat-plum-bg:#3a1d34;    --cat-plum-fg:#e9a6d8;
  --cat-violet-bg:#2a2350;  --cat-violet-fg:#c3b2f5;
  --tag-pink-fg:#f5a3cd;   --tag-pink-bg:#3a1a2c;
  --tag-violet-fg:#c3b2f5; --tag-violet-bg:#2a2350;
  --tag-blue-fg:#8fc7f5;   --tag-blue-bg:#132a44;
  --tag-gray-fg:#c2c6cc;   --tag-gray-bg:#1e2430;
  --chart-grid:#1f2d4d; --chart-band:rgba(0,0,0,.34);
  --tooltip-bg:rgba(14,24,48,.97); --data-blue:#6fb6f2;
  --series-primary:#57a0ff; --series-secondary:#e6a94a;
  --series-orange:#f5772f; --series-purple:#9670ff; --series-green:#72b548; --series-ink:#ffffff;
  --series-on-fg:#0a1428; --event-2:#93c4f2;
  --pal-1:#57a0ff; --pal-2:#e6a94a; --pal-3:#72b548; --pal-4:#9670ff; --pal-5:#f07aa9;  --pal-6:#45c8dc;
  --pal-7:#f4716c; --pal-8:#a9d14a; --pal-9:#9fb0c8; --pal-10:#e0c23a; --pal-11:#e07ae0; --pal-12:#43d6a8;
}

/* ==========================================================================
   components.css  —  starter stylesheet for the shell and core components
   --------------------------------------------------------------------------
   Requires tokens.css (load it first). Class names are generic; map them
   onto your app's markup or rename freely. Every number below is an exact
   value from the reference; comments say where a value applies.

   Contents
     0  Base / reset / focus
     1  Layout switch (desktop shell <-> phone shell)
     2  Desktop shell: sidebar, top bar, page
     3  Phone shell: column, header, meta, pill strip, tile tabs, sections
     4  Cards
     5  Buttons, links, icon buttons, disclosure disc
     6  Pills (section tabs), chips, badges, tags, status pills
     7  Segmented control
     8  Banners / notices / message boxes
     9  Inputs: field, label, select trigger, tick, stepper, on/off
    10  Data table (desktop) + grid rows
    11  List rows (phone entity row, simple row, menu entry)
    12  Status dots and rings, progress ring, stat tiles
    13  Popover / menu, hover pop-up (chart read-out)
    14  Bottom sheet (phone), modal (desktop), toast, floating pill
    15  Empty states, "show all" bar
    16  Breakpoints
   ========================================================================== */


/* ---------- 0. Base / reset / focus ------------------------------------- */
:where(html[data-shell]) *,:where(html[data-shell]) *::before,:where(html[data-shell]) *::after{box-sizing:border-box}
html[data-shell],:where(html[data-shell]) body{margin:0}
html[data-shell]{background:var(--bg-page);-webkit-text-size-adjust:100%}
:where(html[data-shell]) body{
  background:var(--bg-page);color:var(--text);
  font:var(--fs-body-desktop)/1.45 var(--font-sans);
  -webkit-font-smoothing:antialiased;
}
:where(html[data-shell]) svg{display:block}
:where(html[data-shell]) i,:where(html[data-shell]) em{font-style:normal}                    /* no italics anywhere */
:where(html[data-shell]) button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;
  text-align:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
:where(html[data-shell]) a{color:inherit;text-decoration:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
:where(html[data-shell]) input,:where(html[data-shell]) textarea,:where(html[data-shell]) select{font-family:inherit;touch-action:manipulation}
.num{font-variant-numeric:tabular-nums}
.mono{font-family:var(--font-mono);letter-spacing:-.01em}
.muted{color:var(--text-muted)}
.sp{flex:1}                                 /* flexible spacer */

/* Focus: one ring everywhere. Rows use an inset ring. */
:where(html[data-shell]) button:focus-visible,:where(html[data-shell]) input:focus-visible,:where(html[data-shell]) textarea:focus-visible,:where(html[data-shell]) a:focus-visible,:where(html[data-shell]) [tabindex]:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px}
.row:focus-visible,:where(html[data-shell]) tr:focus-visible,.list-row:focus-visible{outline-offset:-2px}
:where(html[data-shell]) [role="dialog"]:focus,.sheet:focus,.modal:focus{outline:none}  /* containers focused by script */

/* Every interactive control animates the same four properties */
.nav-item,.nav-sub-item,.pill,.tab span,.tile-tab,.chip,.toggle,.btn-primary,.btn-soft,.btn-pill,.btn-mini,.btn-danger,.icon-btn,.disc,.seg button,.field,.select-btn,.tick i,.row,.list-row,.pop-item,.search input,.user-chip,.more-bar,:where(html[data-shell]) tr.is-click td{transition:var(--t-control)}

@media (prefers-reduced-motion:reduce){.spin{animation:none!important}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes flash{0%,55%{box-shadow:0 0 0 2.5px var(--accent)}100%{box-shadow:0 0 0 2.5px transparent}}
.flash{animation:flash 2.6s ease-out}       /* scroll-to highlight */


/* ---------- 1. Layout switch — replaced: ui.js renders ONE shell and sets
   html[data-shell=desktop|phone]; see the end of this file. ---------- */

/* ---------- 2. Desktop shell ("Ledger") --------------------------------- */
.app{display:grid;grid-template-columns:var(--sidebar-w) 1fr;min-height:100vh}
.main{min-width:0}

/* 2.1 Sidebar: org switcher (top) / nav (scrolls) / footer (pinned) */
.sidebar{background:var(--bg-sidebar);border-right:1px solid var(--border);position:sticky;top:0;
  height:100vh;display:flex;flex-direction:column}
.sidebar-org{position:relative;padding:10px 12px 4px}
.org-btn{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:var(--r-md)}
@media (hover:hover){.org-btn:hover{background:var(--surface);box-shadow:0 0 0 1.5px var(--hover-ring)}}
.org-mark{width:28px;height:28px;border-radius:var(--r-id);background:var(--primary-bg);color:var(--primary-fg);
  display:grid;place-items:center;font-size:12px;font-weight:700;letter-spacing:.01em;flex:none}
.org-name{flex:1;font-weight:700;letter-spacing:-.01em}
.org-sub{display:block;font-size:12px;font-weight:500;color:var(--text-muted);letter-spacing:0}
.org-btn .updown{color:var(--text-muted)}  /* 12x14 up/down chevron, stroke 1.4 */
.sidebar-org .pop{left:12px;right:12px;top:58px}

.nav{flex:1;overflow:auto;padding:4px 12px;scrollbar-width:thin;scrollbar-color:var(--border-idle) transparent}
.nav-item{display:flex;align-items:center;gap:11px;width:100%;height:32px;padding:0 10px;border-radius:var(--r-sm);
  color:var(--text-secondary);font-size:14px;font-weight:500}
.nav-item svg{flex:none;color:var(--text-muted)}          /* 16px outline icons, stroke 1.3 */
@media (hover:hover){.nav-item:hover{background:var(--hover-bg);color:var(--text);box-shadow:inset 0 0 0 1px var(--hover-ring)}}
@media (hover:hover){.nav-item:hover svg{color:var(--accent)}}
.nav-item.is-active,.nav-item[aria-current="page"]{background:var(--nav-selected-bg);color:var(--nav-selected-fg);
  font-weight:700;box-shadow:var(--shadow-chip)}
.nav-item.is-active svg,.nav-item[aria-current="page"] svg{color:var(--nav-selected-fg)}
@media (hover:hover){.nav-item.is-active:hover,.nav-item[aria-current="page"]:hover{background:var(--nav-selected-bg);
  color:var(--nav-selected-fg);box-shadow:0 0 0 2px var(--hover-ring)}}
.nav-item .chev{transition:var(--t-chevron)}               /* 10x10 chevron right */
.nav-item[aria-expanded="true"] .chev{transform:rotate(90deg)}
.nav-group-label{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-muted);padding:11px 10px 3px}

/* nested sub-list with a vertical rail */
.nav-sub{margin:0 0 2px 20px;padding-left:9px;border-left:1px solid var(--border);display:none}
.nav-sub.is-open{display:block}
.nav-sub-item{display:flex;align-items:center;gap:9px;width:100%;height:32px;padding:0 8px;border-radius:var(--r-sm);
  font-size:13px;font-weight:500;color:var(--text-secondary);white-space:nowrap}
@media (hover:hover){.nav-sub-item:hover{background:var(--hover-bg);color:var(--text);box-shadow:inset 0 0 0 1px var(--hover-ring)}}
.nav-sub-item.is-active{background:var(--nav-selected-bg);color:var(--nav-selected-fg);font-weight:700;box-shadow:var(--shadow-chip)}
@media (hover:hover){.nav-sub-item.is-active:hover{box-shadow:0 0 0 2px var(--hover-ring)}}
.nav-sub-item .meta{margin-left:auto;font-size:12px;font-weight:500;color:var(--text-muted)}
@media (hover:hover){.nav-sub-item:hover .meta{color:var(--text-secondary)}}

.sidebar-foot{border-top:1px solid var(--border);padding:6px 12px 8px}
.sidebar-foot .theme-row{display:flex;align-items:center;gap:8px;padding:4px 4px 0 4px;font-size:12.5px;color:var(--text-muted)}
.sidebar-foot .link{font-size:12.5px;font-weight:600;line-height:1.2}

/* 2.2 Top bar */
.topbar{position:sticky;top:0;z-index:20;height:var(--topbar-h);background:var(--bg-page);border-bottom:1px solid var(--border)}
.topbar-inner,.page{max-width:var(--page-max);margin:0 auto;padding-left:40px;padding-right:40px}
.topbar-inner{height:100%;display:flex;align-items:center;gap:14px}
.search{position:relative;flex:1;max-width:560px}
.search input{width:100%;height:40px;border:0;border-radius:var(--r-md);background:var(--surface);box-shadow:var(--shadow-chip);
  color:var(--text);font:inherit;padding:0 14px 0 40px}
.search input::placeholder{color:var(--text-muted);opacity:1}
@media (hover:hover){.search input:hover{box-shadow:0 0 0 1.5px var(--hover-ring)}}
.search > svg{position:absolute;left:14px;top:12.5px;color:var(--accent)}  /* 15px magnifier, stroke 1.4 */
.search .pop{left:0;right:0;top:48px;max-height:calc(100vh - 70px);overflow:auto}
.user-chip{display:flex;align-items:center;gap:9px;padding:4px 10px 4px 4px;border-radius:var(--r-pill);
  font-size:13.5px;font-weight:600;color:var(--text-secondary)}
@media (hover:hover){.user-chip:hover{background:var(--surface);box-shadow:0 0 0 1.5px var(--hover-ring)}}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--surface);box-shadow:var(--shadow-chip);
  display:grid;place-items:center;font-size:12.5px;font-weight:700;color:var(--accent);flex:none}

/* 2.3 Page */
.page{padding-top:22px;padding-bottom:80px}
.page-title{font-size:26px;font-weight:700;letter-spacing:-.015em;margin:0;display:flex;align-items:center;gap:11px}
.page-meta{color:var(--text-muted);font-size:13px;margin-top:4px}
.page-meta b{font-size:14.5px;font-weight:600;color:var(--text)}
.page-meta .sep{display:inline-block;width:1px;height:13px;margin:0 11px;background:var(--border-idle);vertical-align:-2px}
.head-row{display:flex;align-items:flex-start;gap:16px}     /* title block (flex:1) + primary action */
.head-row > :first-child{flex:1;min-width:0}
.facts{display:flex;flex-wrap:wrap;gap:6px 5px;margin-top:11px;font-size:12px;color:var(--text-muted)}
.facts > span{padding:3px 10px;border-radius:var(--r-pill);background:var(--chip-bg);box-shadow:var(--shadow-chip);white-space:nowrap}
.facts b{font-weight:600;color:var(--text)}
.sticky-strip{position:sticky;top:var(--topbar-h);z-index:15;background:var(--bg-page);margin:-22px 0 4px;padding:14px 0 10px}

/* grids: main + side rail */
.grid-detail{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:var(--gap-card);align-items:start}
.grid-overview{display:grid;grid-template-columns:minmax(0,2.1fr) minmax(0,1fr);gap:var(--gap-card);align-items:start;margin-top:20px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gap-card);align-items:stretch}
.grid-detail > *,.grid-overview > *,.grid-2 > *,.stack{min-width:0}
.stack{display:flex;flex-direction:column;gap:var(--gap-card)}
.mt{margin-top:var(--gap-card)}


/* ---------- 3. Phone shell ("M1") --------------------------------------- */
.phone{max-width:var(--phone-max);margin:0 auto;min-height:100vh;min-height:100dvh;background:var(--bg-page);position:relative;
  font-size:var(--fs-body-phone);overflow-x:hidden;overflow-x:clip;   /* clip: not a scroll container, so the pill strip stays sticky */
  padding:env(safe-area-inset-top) env(safe-area-inset-right) calc(40px + env(safe-area-inset-bottom)) env(safe-area-inset-left)}
/* solid cover for the status-bar area so content never shows behind the notch */
.safe-top{position:fixed;top:0;left:50%;transform:translateX(-50%);width:100%;max-width:var(--phone-max);
  height:env(safe-area-inset-top);background:var(--bg-page);z-index:6;pointer-events:none}

/* header: [home 44] [centred title] [options 44]. Not sticky. */
.phone-header{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:4px;padding:10px 12px 0}
.phone-header .icon-btn{width:44px;height:44px;border-radius:50%;background:none;color:var(--accent)} /* 26px glyph, stroke 1.8 */
.phone-title{justify-self:center;min-height:44px;display:flex;align-items:center;gap:8px;margin:0;
  font-size:23px;font-weight:700;letter-spacing:-.01em;white-space:nowrap}
button.phone-title{padding:0 6px}                 /* title as an entity switcher */
.phone-title .chev{color:var(--text-muted)}       /* 16px down chevron, stroke 2 */
.phone-back{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin:-6px 0 -4px;padding:0 8px;
  font-size:14.5px;font-weight:600;color:var(--accent)}

.phone-meta{text-align:center;padding:0 16px}
.phone-meta .line{color:var(--text-muted);font-size:12.5px;margin-top:1px}
.phone-meta .lead{font-weight:600;font-size:14.5px}
.phone-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:9px}
.phone-chips > span{font-size:12px;color:var(--text-muted);padding:3px 10px;border-radius:var(--r-pill);
  background:var(--chip-bg);box-shadow:var(--shadow-chip);white-space:nowrap}
.phone-chips b{color:var(--text);font-weight:600}

/* sticky horizontally scrolling pill strip */
.tabs-wrap{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--bg-page);margin-top:2px;display:flow-root}
.tabs-wrap::after{content:"";position:absolute;right:0;top:0;bottom:0;width:38px;pointer-events:none;display:none;
  background:linear-gradient(90deg,transparent,var(--bg-page) 85%)}       /* "more ->" fade, only while it overflows */
.tabs{display:flex;gap:2px;justify-content:space-between;padding:2px 12px 8px;overflow:visible}
.tab{flex:none;height:44px;display:flex;align-items:center;scroll-snap-align:center}  /* the 44px tap target */
.tab span{display:block;padding:8px 11px;border-radius:var(--r-pill);font-size:15.5px;font-weight:600;
  color:var(--tab-fg);white-space:nowrap}
.tab[aria-selected="true"] span{background:var(--selected-bg);color:var(--selected-fg);box-shadow:var(--shadow-card)}
.tab .count{font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--tint-fg)}
.tab[aria-selected="true"] .count{color:inherit}
/* JS adds .scrolls when scrollWidth > clientWidth + 1. The strip is padded
   inside and pulled back with negative margins so the selected pill's glow
   is not clipped by overflow. */
.tabs-wrap.scrolls::after{display:block}
.tabs-wrap.scrolls .tabs{justify-content:flex-start;gap:4px;overflow-x:auto;scrollbar-width:none;
  -webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;
  padding:30px 40px 34px 12px;margin-top:-6px;margin-bottom:-14px}
.tabs-wrap.scrolls .tabs::-webkit-scrollbar{display:none}
.tabs-wrap.scrolls .tab span{padding:8px 15px}

/* equal-width tile tabs (segmented, 2-3 items; optional count line) */
.tile-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px 12px 8px}
.tile-tabs.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.tile-tab{min-height:54px;border-radius:var(--r-pop);display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:1px;padding:4px 2px;color:var(--tab-fg);box-shadow:inset 0 0 0 1.5px var(--border-idle)}
.tile-tab.single{min-height:46px}
.tile-tab b{font-size:15px;font-weight:600;line-height:1.2;white-space:nowrap}
.tile-tab small{font-size:13px;font-weight:700;line-height:1.2;color:var(--tint-fg);font-variant-numeric:tabular-nums;white-space:nowrap}
.tile-tab[aria-selected="true"]{background:var(--selected-bg);color:var(--selected-fg);box-shadow:var(--shadow-card)}
.tile-tab[aria-selected="true"] small{color:inherit}

/* body panel + section label above a card */
.panel{padding:6px var(--gutter-phone) 0}
.section{display:flex;justify-content:space-between;align-items:center;margin:30px 2px 8px;min-height:28px}
.section:first-child{margin-top:14px}
.section h2,.section-label{margin:0;font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label)}
.section h2 small{font-size:12px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--text-muted);margin-left:6px}
.phone .card{padding:var(--pad-card-phone)}
.phone .card + .card{margin-top:var(--gap-card-phone)}
.phone .card.card--flush{padding:0 0 4px}            /* list card: rows carry their own padding */
.phone .card.card--hero{padding:16px 16px 6px}
.phone .card-head{min-height:44px;margin:-6px -6px 4px 0}  /* 44px header row; a 44px "+" sits at the right */
.phone .card-foot{margin:0 0 -10px;padding-top:0}         /* two 44px links at either end */
.phone .link{min-height:44px}


/* ---------- 4. Cards ---------------------------------------------------- */
.card{background:var(--surface);border-radius:var(--r-card);box-shadow:var(--shadow-card);padding:var(--pad-card)}  /* no border */
.card--hero{background:var(--surface-hero);border-radius:var(--r-hero)}
.card--flush{padding:0 0 4px}                 /* list card: rows carry their own padding */
/* A list run edge to edge under a card's header (Money › Commission & Fees):
   the card keeps its padding; the tail bleeds back out over it. */
.card > .flush-tail{margin:14px -24px -22px;border-top:1px solid var(--line)}
.phone .card > .flush-tail{margin:14px -16px -16px}
.card--bare{background:none;box-shadow:none;padding:0;border-radius:0}
.card--warning{background:var(--warning-surface);box-shadow:inset 0 0 0 1.5px var(--warning-ring)}
.card--warning .card-title{color:var(--warning-fg)}
.card--danger{background:var(--danger-surface);box-shadow:inset 0 0 0 1.5px var(--danger-ring)}
.card--danger .card-title{color:var(--danger-fg)}
.card-head{display:flex;align-items:center;gap:10px;min-height:32px;margin:-6px 0 12px}
.card-head.ruled{border-bottom:1px solid var(--border);padding-bottom:8px;margin-bottom:12px}
.card-title{font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label)}
.card-title small{font-size:12px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--text-muted);margin-left:6px}
/* phone: in-card titles are sentence case */
.phone .card-title{font-size:16px;letter-spacing:0;text-transform:none;color:var(--text)}
.phone .card-title small{font-size:12.5px;margin-left:8px}
.card-foot{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--border);margin-top:6px;padding-top:6px}
.inset{background:var(--surface-sunken);border-radius:var(--r-lg);padding:14px 16px 10px}  /* sunk panel, no shadow */
.block-title{font-size:18px;font-weight:700;letter-spacing:-.01em;line-height:1.2}


/* ---------- 5. Buttons, links, icon buttons, disclosure disc ------------ */
.btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 18px;
  border-radius:var(--r-md);background:var(--primary-bg);color:var(--primary-fg);font-size:14px;font-weight:700;white-space:nowrap}
@media (hover:hover){.btn-primary:hover{filter:brightness(1.14);box-shadow:0 0 0 3px var(--hover-ring)}}
.btn-primary--lg{height:46px;padding:0 28px;border-radius:var(--r-lg);font-size:15px}   /* page-header CTA, sign-in */
.btn-primary:disabled,.btn-primary[aria-disabled="true"]{opacity:.45;cursor:default;filter:none;box-shadow:none}
.phone .btn-primary{min-height:46px;height:auto;padding:0 20px;border-radius:var(--r-lg);font-size:15px}
.phone .btn-primary:disabled{opacity:1;background:var(--surface-sunken);color:var(--text-muted);box-shadow:inset 0 0 0 1.5px var(--border)}
.btn-block{display:flex;width:100%}

/* secondary = tinted fill (there is no grey outline secondary) */
.btn-soft{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 17px;
  border-radius:var(--r-md);background:var(--tint-bg);color:var(--tint-fg);font-size:14px;font-weight:700;white-space:nowrap}
@media (hover:hover){.btn-soft:hover{background:var(--tint-bg-hover)}}
.btn-soft.on-tint{background:var(--surface);box-shadow:var(--shadow-chip)}   /* on an amber card / grey bar / sheet footer */
@media (hover:hover){.btn-soft.on-tint:hover{background:var(--tint-bg);box-shadow:0 0 0 1.5px var(--hover-ring)}}
.btn-soft.is-destructive{color:var(--danger-fg)}                          /* "Remove..." in a row of soft buttons */
.phone .btn-soft{min-height:46px;height:auto;padding:0 18px;border-radius:var(--r-lg);font-size:15px}

.btn-pill{display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 16px;border-radius:var(--r-pill);
  background:var(--tint-bg);color:var(--tint-fg);font-size:13.5px;font-weight:700}         /* "Actions v" in the top bar */
@media (hover:hover){.btn-pill:hover{background:var(--tint-bg-hover)}}
.btn-mini{position:relative;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border-radius:var(--r-pill);
  background:var(--tint-bg);color:var(--tint-fg);font-size:13px;font-weight:600}
@media (hover:hover){.btn-mini:hover{background:var(--tint-bg-hover)}}
.btn-mini[aria-disabled="true"]{background:var(--surface-sunken);color:var(--text-muted)}
.phone .btn-mini::after{content:"";position:absolute;left:min(0px,calc((100% - 44px) / 2));right:min(0px,calc((100% - 44px) / 2));top:min(-5px,calc((100% - 44px) / 2));bottom:min(-5px,calc((100% - 44px) / 2))}  /* 44px hit area */

.btn-danger{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 18px;
  border-radius:var(--r-md);background:var(--danger-solid);color:var(--danger-solid-fg);font-size:14px;font-weight:700}
@media (hover:hover){.btn-danger:hover{filter:brightness(1.08);box-shadow:0 0 0 3px var(--danger-bg)}}
.btn-danger:disabled{opacity:.45}
.phone .btn-danger{min-height:46px;border-radius:var(--r-lg);font-size:15px}

.btn-outline-accent{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;
  border-radius:var(--r-md);background:var(--surface);box-shadow:inset 0 0 0 1.5px var(--accent);color:var(--accent);
  font-size:14px;font-weight:700}

.link{display:inline-flex;align-items:center;gap:5px;min-height:32px;color:var(--accent);font-size:14px;font-weight:500}
@media (hover:hover){.link:hover{text-decoration:underline;text-underline-offset:3px}}
.link.strong{font-size:13px;font-weight:600}             /* in card headers, notices, footers */
.link:disabled,.link[aria-disabled="true"]{color:var(--text-muted);cursor:default;text-decoration:none}
.link .go{transition:none}
@media (hover:hover){.link:hover .go{transform:translateX(2px)}}

/* round icon button: add (+), close (x), prev/next */
.icon-btn{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;flex:none;
  background:var(--tint-bg);color:var(--tint-fg)}
@media (hover:hover){.icon-btn:hover{background:var(--tint-bg-hover)}}
.icon-btn:disabled{opacity:.42;pointer-events:none}
.icon-btn--add{background:var(--add-bg);color:var(--add-fg)}
@media (hover:hover){.icon-btn--add:hover{background:var(--add-bg-hover)}}
.icon-btn--add.ringed{border:1.5px solid var(--disclosure-ring)}   /* phone compact summary-card "+" (30px) */
.icon-btn svg{transition:var(--t-chevron)}
.icon-btn[aria-expanded="true"] svg{transform:rotate(45deg)}   /* + becomes x while its form is open */
.icon-btn--square{border-radius:var(--r-sm);background:var(--chip-bg);box-shadow:var(--shadow-chip);color:var(--accent)}
@media (hover:hover){.icon-btn--square:hover{background:var(--tint-bg);box-shadow:0 0 0 1.5px var(--hover-ring)}}
/* phone: 44px tap target around a 30-34px visual */
.tap44{width:44px;height:44px;display:grid;place-items:center;flex:none}

/* round chevron disc: "go" / "expand" affordance */
.disc{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;flex:none;
  background:var(--disclosure-bg);border:1.5px solid var(--disclosure-ring);color:var(--disclosure-fg)}
.disc--sm{width:24px;height:24px}
.disc--xs{width:20px;height:20px}
.disc svg{transition:var(--t-chevron)}                 /* desktop 10x10 "M3.5 2l3 3-3 3" stroke 1.5; phone 8x12 stroke 2 */
[aria-expanded="true"] > .disc svg,.disc[aria-expanded="true"] svg{transform:rotate(90deg)}
@media (hover:hover){.row:hover .disc,.disc:hover{background:var(--disclosure-fg);border-color:var(--disclosure-fg);color:var(--surface)}}


/* ---------- 6. Pills, chips, badges, tags ------------------------------- */
/* desktop section pills / tabs under the page header */
.pills{display:flex;gap:4px;flex-wrap:wrap;margin:20px 0 22px}
.pill{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 15px;border-radius:var(--r-pill);
  color:var(--tab-fg);font-size:15.5px;font-weight:600;white-space:nowrap}
@media (hover:hover){.pill:hover{background:var(--hover-bg);color:var(--text)}}
.pill.is-on,.pill[aria-selected="true"]{background:var(--selected-bg);color:var(--selected-fg);box-shadow:var(--shadow-card)}
@media (hover:hover){.pill.is-on:hover,.pill[aria-selected="true"]:hover{box-shadow:var(--shadow-card),0 0 0 2.5px var(--hover-ring)}}
.pill .n{min-width:22px;height:20px;padding:0 8px;border-radius:var(--r-pill);display:grid;place-items:center;
  font-size:12px;font-weight:700;background:var(--tint-bg);color:var(--tint-fg)}
.pill.is-on .n,.pill[aria-selected="true"] .n{background:rgba(255,255,255,.12);color:inherit}

/* filter / toggle chip (outline off, filled on). Phone gets a 44px hit area. */
.chip{position:relative;display:inline-flex;align-items:center;gap:5px;height:34px;padding:0 14px;border-radius:var(--r-pill);
  color:var(--text-muted);font-size:13.5px;font-weight:600;white-space:nowrap;box-shadow:inset 0 0 0 1.5px var(--border)}
.chip .c{font-weight:700;font-variant-numeric:tabular-nums}
@media (hover:hover){.chip:hover{background:var(--hover-bg);color:var(--text);box-shadow:inset 0 0 0 1.5px var(--hover-ring)}}
.chip.is-on,.chip[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg);box-shadow:none}
@media (hover:hover){.chip.is-on:hover,.chip[aria-pressed="true"]:hover{box-shadow:0 0 0 2.5px var(--hover-ring)}}
.chip:disabled,.chip[aria-disabled="true"]{box-shadow:none;border:1.5px dashed var(--border-idle);color:var(--text-muted)}
.phone .chip{padding:0 12px}
.phone .chip.compact{padding:0 7px;font-size:12.5px}   /* 4+ chips that must fit one 326px row */
.phone .chip::after{content:"";position:absolute;left:min(0px,calc((100% - 44px) / 2));right:min(0px,calc((100% - 44px) / 2));top:min(-5px,calc((100% - 44px) / 2));bottom:min(-5px,calc((100% - 44px) / 2))}
.chips{display:flex;flex-wrap:wrap;gap:10px 8px}
/* labelled filter group: UPPERCASE label + raised chips */
.filter-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.filter-group .label{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-right:4px}
.filter-group .chip{background:var(--chip-bg);box-shadow:var(--shadow-chip)}
.filter-group .chip.is-on{background:var(--selected-bg);color:var(--selected-fg);box-shadow:var(--shadow-card)}
.filter-bar{display:flex;flex-wrap:wrap;gap:10px 22px}

/* category-tinted chip: one style serves every category via --k-bg/--k-fg */
[data-cat="green"]{--k-bg:var(--cat-green-bg);--k-fg:var(--cat-green-fg)}
[data-cat="orange"]{--k-bg:var(--cat-orange-bg);--k-fg:var(--cat-orange-fg)}
[data-cat="slate"]{--k-bg:var(--cat-slate-bg);--k-fg:var(--cat-slate-fg)}
[data-cat="indigo"]{--k-bg:var(--cat-indigo-bg);--k-fg:var(--cat-indigo-fg)}
[data-cat="magenta"]{--k-bg:var(--cat-magenta-bg);--k-fg:var(--cat-magenta-fg)}
[data-cat="sand"]{--k-bg:var(--cat-sand-bg);--k-fg:var(--cat-sand-fg)}
[data-cat="gold"]{--k-bg:var(--cat-gold-bg);--k-fg:var(--cat-gold-fg)}
[data-cat="plum"]{--k-bg:var(--cat-plum-bg);--k-fg:var(--cat-plum-fg)}
[data-cat="violet"]{--k-bg:var(--cat-violet-bg);--k-fg:var(--cat-violet-fg)}
[data-cat]{--k-ring:color-mix(in srgb,var(--k-fg) 38%,transparent)}
/* BN-50: a custom property cannot fall back by repetition — below iOS 16.2 (no color-mix) it takes a plain rgba */
@supports not (color:color-mix(in srgb,red,blue)){[data-cat]{--k-ring:rgba(120,120,140,.38)}#page{--rp-l4:rgba(47,107,214,.09)}}
.chip[data-cat]{color:var(--k-fg);box-shadow:inset 0 0 0 1.5px var(--k-ring)}
@media (hover:hover){.chip[data-cat].is-on,.chip[data-cat][aria-pressed="true"],.chip[data-cat]:hover{
  background:var(--k-bg);color:var(--k-fg);box-shadow:inset 0 0 0 1.5px var(--k-fg)}}
/* non-interactive category label */
.cat{display:inline-block;font-size:12px;font-weight:600;line-height:1.5;padding:1px 8px;border-radius:var(--r-pill);
  background:var(--k-bg,var(--surface-sunken));color:var(--k-fg,var(--text-muted));white-space:nowrap}

/* count badges */
.count{font-size:12px;font-weight:700;line-height:20px;padding:0 8px;border-radius:var(--r-pill);
  background:var(--tint-bg);color:var(--tint-fg);font-variant-numeric:tabular-nums}
.count.zero{background:var(--surface-sunken);color:var(--text-muted);font-weight:600}
.count.alert{background:var(--danger-bg);color:var(--danger-fg)}

/* status pill (verdict) */
.status-pill{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;line-height:1.4;letter-spacing:.05em;text-transform:uppercase;
  padding:2px 9px;border-radius:var(--r-pill);white-space:nowrap;background:var(--surface-sunken);color:var(--text-muted)}
.status-pill.lower{text-transform:none;letter-spacing:0;font-weight:600}
.status-pill.red{background:var(--danger-bg);color:var(--danger-fg)}
.status-pill.amber{background:var(--warning-bg);color:var(--warning-fg)}
.status-pill.green{background:var(--success-bg);color:var(--success-fg)}
.status-pill.blue{background:var(--tint-bg);color:var(--tint-fg)}
.status-pill.outline{background:none;box-shadow:inset 0 0 0 1px var(--border-idle)}
.inset .status-pill:not(.red):not(.amber):not(.green):not(.blue){background:var(--surface)}  /* stay visible on sunk panels */
.phone .status-pill.lower{font-size:12.5px}           /* phone entity-card status ("Active") */

/* warning chip under a list-row title ("17/18 checks"), leads with a 12px warning icon */
.warn-chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;line-height:1.45;padding:2px 9px;
  border-radius:var(--r-pill);background:var(--warning-bg);color:var(--warning-fg);white-space:nowrap}
.warn-chip svg{flex:none}

/* small solid square badge (a short code such as "P1"); .alt = second pair; .zero = outline */
.badge{display:inline-grid;place-items:center;height:24px;min-width:34px;padding:0 7px;border-radius:var(--r-badge);
  font-size:12px;font-weight:700;background:var(--pair1-bg);color:var(--pair1-fg);white-space:nowrap}
.badge.alt{background:var(--pair2-bg);color:var(--pair2-fg)}
.badge.zero{background:none;color:var(--text-muted);box-shadow:inset 0 0 0 1.5px var(--border-idle)}

/* coloured label pill from the 4-colour tag set (pink / violet / blue / gray) */
.tag-pill{display:inline-flex;align-items:center;height:28px;padding:3px 12px;border-radius:var(--r-pill);font-size:13.5px;font-weight:700;
  line-height:1.15;white-space:nowrap;background:var(--tag-gray-bg);color:var(--tag-gray-fg)}
.tag-pill.pink{background:var(--tag-pink-bg);color:var(--tag-pink-fg)}
.tag-pill.violet{background:var(--tag-violet-bg);color:var(--tag-violet-fg)}
.tag-pill.blue{background:var(--tag-blue-bg);color:var(--tag-blue-fg)}

/* dashed annotation tag ("Admin", "New") */
.tag{font-size:12px;font-weight:600;color:var(--text-muted);border:1px dashed var(--border-idle);border-radius:var(--r-tag);
  padding:0 6px;line-height:18px;white-space:nowrap}
/* identifier pill */
.id-pill{display:inline-block;font-size:15px;font-weight:800;letter-spacing:.01em;line-height:1.25;padding:2px 7px;border-radius:var(--r-id);
  background:var(--cat-violet-bg);color:var(--cat-violet-fg);overflow-wrap:anywhere;
  box-shadow:inset 0 0 0 1.5px rgba(124,92,214,.38);box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--cat-violet-fg) 38%,transparent)}
@media (hover:hover){a.id-pill:hover{box-shadow:inset 0 0 0 1.5px var(--accent)}}
.phone .id-pill{font-size:15.5px}


/* ---------- 7. Segmented control (Light | Dark, 2-4 way choices) -------- */
.seg{display:inline-flex;gap:4px}
.seg button{display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 10px;border-radius:var(--r-pill);font-size:13px;font-weight:600;
  color:var(--tab-fg);background:var(--chip-bg);box-shadow:var(--shadow-chip)}
@media (hover:hover){.seg button:hover{color:var(--accent);box-shadow:0 0 0 2px var(--hover-ring)}}
.seg button.is-on,.seg button[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg);box-shadow:var(--shadow-card)}
@media (hover:hover){.seg button.is-on:hover,.seg button[aria-pressed="true"]:hover{box-shadow:var(--shadow-card),0 0 0 2.5px var(--hover-ring)}}
.phone .seg{display:flex;gap:8px}
.phone .seg button{flex:1;height:44px;font-size:13.5px;background:transparent;box-shadow:none;border:1.5px solid var(--border);color:var(--text-muted)}
.phone .seg button.is-on,.phone .seg button[aria-pressed="true"]{background:var(--selected-bg);border-color:var(--selected-bg);color:var(--selected-fg)}


/* ---------- 8. Banners / notices / message boxes ------------------------
   Tone = text colour + thin inset ring. Never a filled colour block.     */
.notice{display:inline-flex;align-items:center;gap:9px;min-height:36px;padding:2px 14px;border-radius:var(--r-md);
  background:var(--chip-bg);box-shadow:var(--shadow-chip);font-size:12.5px;color:var(--text-muted);margin:-4px 0 14px}
.notice > svg{flex:none;color:var(--warning-ring)}       /* 14px (desktop) / 16px (phone) warning triangle */
.notice b{color:var(--text);font-weight:600}
.notice .link{font-size:12.5px;font-weight:600;min-height:32px}   /* the 9px gap spaces it */
/* two-line notice: bold first line, 12px muted second line, link (and optional count) at the right */
.notice.two-line{align-items:flex-start;padding:0 14px;max-width:100%}
.notice.two-line > svg{margin-top:11px}
.notice.two-line .nb{padding:9px 0;min-width:0;line-height:18px}
.notice.two-line .nb > span{display:block}
.notice.two-line .nb > span + span{margin-top:1px;font-size:12px;color:var(--text-muted)}
.notice.two-line .link{flex:none;min-height:36px;margin-left:6px;white-space:nowrap}
.notice.danger{color:var(--danger-fg);box-shadow:inset 0 0 0 1px var(--danger-ring)}
.notice.danger > svg{color:var(--danger-ring)}
.notice.danger b{color:var(--danger-fg)}
.notice.warning{color:var(--warning-fg);box-shadow:inset 0 0 0 1px var(--warning-ring)}
.notice.info{color:var(--accent);box-shadow:inset 0 0 0 1px var(--hover-ring)}
.notice.info > svg{color:var(--accent)}
.notice .spin{animation:spin 1.2s linear infinite}
.phone .notice{display:flex;align-items:flex-start;margin:10px 16px 0;padding:9px 14px}
.phone .notice > svg{margin-top:1px}
.phone .notice.info{box-shadow:inset 0 0 0 1px var(--disclosure-ring)}
.phone .notice.danger > svg{color:var(--danger-fg)}   /* phone static banner: icon takes the text colour */

/* phone collapsible one-line banner (button header + hidden body) */
.banner{margin:8px 16px 0;border-radius:var(--r-md);background:var(--chip-bg);box-shadow:var(--shadow-chip);color:var(--text-muted);font-size:12.5px}
.banner:first-of-type{margin-top:12px}
.banner + .banner{margin-top:6px}
.banner-head{display:flex;align-items:center;gap:9px;width:100%;min-height:44px;padding:0 8px 0 14px}
.banner-head > svg{flex:none;color:var(--warning-ring)}
.banner-head .tx{flex:1;min-width:0;padding:6px 0;line-height:1.3}
.banner-head .tx b{color:var(--text);font-weight:600}
.banner-body{display:none;padding:2px 14px 12px 39px}    /* 39 = 14 pad + 16 icon + 9 gap */
.banner.is-open .banner-body{display:block}
.banner.is-open .banner-head .disc svg{transform:rotate(90deg)}
.banner.danger{box-shadow:inset 0 0 0 1.5px var(--danger-ring)}
.banner.danger .banner-head > svg{color:var(--danger-ring)}
.banner.danger .tx,.banner.danger .tx b,.banner.danger .banner-body{color:var(--danger-fg)}

/* inline warning box */
.warn-box{display:flex;gap:10px;border:1px solid var(--warning-ring);background:var(--warning-bg);border-radius:var(--r-md);
  padding:10px 12px;font-size:13.5px;color:var(--text)}
.warn-box > svg{flex:none;color:var(--warning-fg)}
/* form result message */
.msg{border-radius:var(--r-lg);padding:12px 14px;font-size:13.5px;color:var(--text)}
.msg .t{font-size:14.5px;font-weight:600}
.msg.error{background:var(--danger-surface);box-shadow:inset 0 0 0 1.5px var(--danger-ring)}   .msg.error .t{color:var(--danger-fg)}
.msg.warning{background:var(--warning-surface);box-shadow:inset 0 0 0 1.5px var(--warning-ring)} .msg.warning .t{color:var(--warning-fg)}
.msg.success{background:var(--surface);box-shadow:var(--shadow-card),inset 0 0 0 1.5px var(--success-ring)} .msg.success .t{color:var(--success-fg)}


/* ---------- 9. Inputs --------------------------------------------------- */
.field-label{display:block;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-bottom:8px}
.field{display:block;width:100%;height:40px;padding:0 12px;border:1px solid var(--border-field);border-radius:var(--r-md);
  background:var(--surface);color:var(--text);font:inherit;-webkit-appearance:none;appearance:none}
.field::placeholder{color:var(--text-muted);opacity:1}
@media (hover:hover){.field:hover{border-color:var(--disclosure-ring)}}
.field:focus{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:2px}
.field[readonly]{background:var(--surface-sunken)}
textarea.field{height:68px;padding:9px 12px;resize:vertical}
.phone .field{height:auto;min-height:46px;padding:10px 12px;font-size:16px;line-height:1.4;background:var(--surface-sunken)}
.phone .field:focus{outline-offset:1px}
.phone textarea.field{min-height:76px}
.hint{font-size:13px;line-height:1.5;color:var(--text-muted);margin-top:7px;text-wrap:pretty}
.field-error{font-size:12.5px;color:var(--danger-fg);margin-top:8px}
.field-stack > * + *{margin-top:16px}
:root[data-theme="dark"] input[type=date],:root[data-theme="dark"] input[type=time]{color-scheme:dark}
/* (OS-theme rule removed: the theme is always explicit — D2) */

/* custom select trigger (opens a .pop list, not a native picker) */
.select-btn{display:inline-flex;align-items:center;justify-content:space-between;gap:10px;height:40px;min-width:260px;padding:0 14px;
  border:1px solid var(--border-field);border-radius:var(--r-md);background:var(--surface-sunken);color:var(--text);font-weight:600}
@media (hover:hover){.select-btn:hover{border-color:var(--accent);box-shadow:0 0 0 1.5px var(--hover-ring)}}
.select-btn[aria-expanded="true"]{border-color:var(--accent)}
.select-btn svg{color:var(--text-muted)}
.filter-bar .select-btn{background:var(--chip-bg);border-color:transparent;box-shadow:var(--shadow-chip);min-width:216px;font-size:14px}
.phone .select-btn{min-height:48px;height:auto;min-width:0;width:100%;font-size:16px;padding:0 12px 0 14px}

/* round tick (mark done) — 36px (desktop) / 44px (phone) hit, 26px circle */
.tick{width:36px;height:36px;display:grid;place-items:center;flex:none}
.phone .tick{width:44px;height:44px}
.tick i{width:26px;height:26px;border-radius:50%;border:2px solid var(--disclosure-ring);display:grid;place-items:center;color:transparent}
@media (hover:hover){.tick:hover i{border-color:var(--accent);background:var(--hover-bg)}}
.tick[aria-pressed="true"] i{background:var(--accent);border-color:var(--accent);color:var(--surface)}  /* 13px tick, stroke 1.8 */
@media (hover:hover){.tick[aria-pressed="true"]:hover i{box-shadow:0 0 0 3px var(--hover-ring)}}
.tick[aria-disabled="true"] i{border-style:dashed;border-color:var(--border-idle)}
/* square check (multi-select list) */
.check{width:20px;height:20px;border-radius:6px;border:1.5px solid var(--disclosure-ring);background:var(--surface);display:grid;place-items:center;color:transparent;flex:none}
.is-checked > .check,.check.is-on{background:var(--primary-bg);border-color:var(--primary-bg);color:var(--primary-fg)}

/* number stepper */
.stepper{display:inline-flex;align-items:center;height:38px;border:1px solid var(--border-field);border-radius:var(--r-sm);background:var(--surface-sunken)}
.stepper button{width:34px;height:36px;color:var(--accent);font-size:17px;font-weight:600;border-radius:10px}
@media (hover:hover){.stepper button:hover{background:var(--tint-bg-hover)}}
.stepper button:focus-visible{outline-offset:-3px}
.stepper input{width:56px;border:0;background:none;text-align:center;font-size:14.5px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--text)}
.phone .stepper{height:46px;border-radius:var(--r-md)}
.phone .stepper button{width:44px;height:44px}
.phone .stepper input{font-size:16px}

/* on/off pill. Desktop off = raised chip; phone off = outline. 34px on both. */
.onoff{display:inline-flex;align-items:center;justify-content:center;height:34px;min-width:52px;padding:0 13px;border-radius:var(--r-pill);font-size:13.5px;font-weight:600;color:var(--text-muted);
  background:var(--chip-bg);box-shadow:var(--shadow-chip)}
.onoff[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg);font-weight:700;box-shadow:none}
.phone .onoff{min-width:58px;background:transparent;box-shadow:none;border:1.5px solid var(--border)}
.phone .onoff[aria-pressed="true"]{background:var(--selected-bg);border-color:var(--selected-bg)}


/* ---------- 10. Data table (desktop) + grid rows ------------------------ */
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);text-align:left;
  padding:0 10px 10px 0;border-bottom:1px solid var(--border);white-space:nowrap}
.table td{padding:11px 10px 11px 0;border-bottom:1px solid var(--border);vertical-align:middle}
.table tr:last-child > td{border-bottom:0}
.table th:first-child,.table td:first-child{padding-left:8px}
.table .r{text-align:right;font-variant-numeric:tabular-nums}
.table td.r{font-weight:700}
.table td.muted{color:var(--text-muted);font-weight:500;font-size:12.5px}   /* short notes column */
.table .name{display:flex;align-items:center;gap:10px;font-weight:700;white-space:nowrap}  /* status ring + bold name */
.table .go{color:var(--text-muted)}                         /* trailing 10px chevron */
.table tr.is-click{cursor:pointer}
@media (hover:hover){.table tr.is-click:hover td{background:var(--hover-bg)}}     /* flat band, no rounded ends */
@media (hover:hover){.table tr.is-click:hover .name,.table tr.is-click:hover .go{color:var(--accent)}}
.table tr.group td{font-size:14px;font-weight:700;padding:22px 0 8px 8px;vertical-align:bottom}
.table tbody tr.group:first-child td{padding-top:10px}
.table tr.group td small{font-size:12px;font-weight:600;color:var(--text-muted);margin-left:8px}
.empty-cell,.table td.empty-cell{color:var(--text-muted);font-weight:500}   /* shows an em dash "—" */

/* grid "table" rows (expand in place) */
.grid-head{display:grid;column-gap:14px;padding:0 10px 8px;border-bottom:1px solid var(--border);
  font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted)}
.row{display:grid;column-gap:14px;align-items:center;width:100%;min-height:60px;padding:11px 10px;border-radius:var(--r-md);text-align:left}
.row + .row{border-top:1px solid var(--border)}
@media (hover:hover){.row:hover{background:var(--hover-bg)}}
.row[aria-expanded="true"]{background:var(--surface-sunken)}
.row-group + .row-group{border-top:1.5px solid var(--border-idle)}
.big-num{font-size:22px;font-weight:700;letter-spacing:-.01em;line-height:1;font-variant-numeric:tabular-nums}
.big-num small{font-size:13px;font-weight:600;color:var(--text-muted);letter-spacing:0}


/* ---------- 11. List rows ----------------------------------------------- */
/* phone entity row: ring + title/subtitle + two right-aligned counters */
.list-row{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:9px 14px 9px 16px}
.list-row + .list-row{border-top:1px solid var(--border)}
.list-row .body{flex:1;min-width:0}
.list-row .title{display:block;font-size:15.5px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.list-row .sub{display:block;font-size:12.5px;color:var(--text-muted)}
.list-row .chips{gap:5px;margin-top:5px}
.counters{display:flex;gap:2px;flex:none}
.counter{display:block;width:38px;text-align:center}
.counter .n{display:block;font-size:17px;font-weight:700;line-height:1.15;font-variant-numeric:tabular-nums}
.counter .k{display:block;font-size:12px;color:var(--text-muted)}
.counter.red .n{color:var(--danger-fg)} .counter.amber .n{color:var(--warning-fg)}
.counter.zero .n{color:var(--text-muted);font-weight:600}
/* dated row */
.date-row{display:flex;align-items:center;gap:10px;min-height:66px;padding:10px 14px 10px 16px}
.date-row + .date-row{border-top:1px solid var(--border)}
.date-row .title{font-size:17px;font-weight:700;letter-spacing:-.01em}
.date-row .meta{font-size:13px;color:var(--text-muted)}
/* desktop simple label/value row */
.kv-row{display:flex;align-items:center;gap:10px;padding:11px 0;font-size:14px;font-weight:500}
.kv-row + .kv-row{border-top:1px solid var(--border)}
.kv-row .v{margin-left:auto;font-size:15px;font-weight:700;font-variant-numeric:tabular-nums}
/* checklist item */
.item{display:flex;align-items:flex-start;gap:10px;padding:11px 0}
.item + .item{border-top:1px solid var(--border)}
.item .title{font-size:14.5px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.item .meta{display:flex;flex-wrap:wrap;gap:4px 8px;margin-top:5px;font-size:12px;color:var(--text-muted)}
.item.is-done .title{text-decoration:line-through;color:var(--text-muted);font-weight:500}
.item.is-later{opacity:.55}
/* sheet / menu entry tile */
.entry{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:48px;padding:0 10px 0 14px;
  border-radius:var(--r-md);background:var(--surface-sunken);font-size:15px;font-weight:600}
.entry + .entry{margin-top:6px}
.entry small{margin-left:auto;text-align:right;font-size:12.5px;font-weight:500;color:var(--text-muted)}
.entry.is-current{box-shadow:inset 0 0 0 1.5px var(--accent)}
/* key-value grid inside a card-per-item */
.kv-grid{display:grid;grid-template-columns:86px 1fr;gap:7px 8px}
.kv-grid dt{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted)}
.kv-grid dd{margin:0;font-size:14px;font-weight:600}


/* ---------- 12. Status dots and rings ----------------------------------- */
.dot{--dc:var(--success-ring);width:10px;height:10px;border-radius:50%;background:var(--dc);flex:none}
.dot.red{--dc:var(--danger-ring)} .dot.amber{--dc:var(--warning-ring)} .dot.green{--dc:var(--success-ring)} .dot.idle{--dc:var(--border-idle)}
.dot.hollow{width:12px;height:12px;background:none;border:3px solid var(--dc)}   /* the default status mark */
.dot.hollow-lg{width:14px;height:14px;background:none;border:3.5px solid var(--dc)}

/* ring with a number inside (phone list row: 48px / 5px) */
.ring-sm{width:48px;height:48px;border-radius:50%;border:5px solid var(--border-idle);display:grid;place-items:center;flex:none;
  font-size:14.5px;font-weight:700;line-height:1;text-align:center;font-variant-numeric:tabular-nums}
.ring-sm small{display:block;font-size:12px;font-weight:600;color:var(--text-muted)}
/* large KPI ring (66px / 6.5px) with value + caption below */
.ring{display:flex;flex-direction:column;align-items:center;text-align:center}
.ring .c{width:66px;height:66px;border-radius:50%;border:6.5px solid var(--border-idle);display:grid;place-items:center;
  align-content:center;font-size:22px;font-weight:700;line-height:1.05;font-variant-numeric:tabular-nums}
.ring .c small{display:block;font-size:12px;font-weight:600;color:var(--text-muted)}
.ring .v{font-size:14.5px;font-weight:700;margin-top:7px;white-space:nowrap;font-variant-numeric:tabular-nums}
.ring .w{font-size:12.5px;line-height:1.25;color:var(--text-muted)}
.ring-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
button.ring{border-radius:var(--r-pop);padding:10px 0}
@media (hover:hover){button.ring:hover{background:var(--hover-bg);box-shadow:inset 0 0 0 1px var(--hover-ring)}}
button.ring[aria-pressed="true"]{background:var(--tint-bg)}
/* status -> ring colour + value colour */
.red > .ring-sm,.ring-sm.red,.ring.red .c{border-color:var(--danger-ring)}
.amber > .ring-sm,.ring-sm.amber,.ring.amber .c{border-color:var(--warning-ring)}
.green > .ring-sm,.ring-sm.green,.ring.green .c{border-color:var(--success-ring)}
.ring.red .v{color:var(--danger-fg)} .ring.amber .v{color:var(--warning-fg)}   /* green (OK) value stays --text */

/* progress ring (SVG 48px, r=20, stroke 4.5): see markup in the handoff doc */
.progress-ring{position:relative;width:48px;height:48px;flex:none}
.progress-ring .track{fill:none;stroke:var(--border-idle);stroke-width:4.5;opacity:.55}
.progress-ring .arc{fill:none;stroke:var(--accent);stroke-width:4.5;stroke-linecap:round}
.progress-ring b{position:absolute;inset:0;display:grid;place-items:center;font-size:18px;font-weight:700}

/* stat tiles */
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tile{border-radius:var(--r-lg);background:var(--surface-sunken);padding:8px 10px 9px}
.tile .k{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted)}
.tile .n{font-size:24px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.tile .n small{font-size:13px;font-weight:600;color:var(--text-muted);letter-spacing:0}
.tile.emph{background:var(--tint-bg)}
/* hero KPI number */
.kpi{font-size:44px;font-weight:700;letter-spacing:-.025em;line-height:1;font-variant-numeric:tabular-nums}
.kpi small{font-size:13px;font-weight:600;color:var(--text-muted);letter-spacing:0}
.kpi.zero{color:var(--text-muted);font-weight:600}


/* ---------- 13. Popover / menu, hover pop-up ---------------------------- */
.pop{position:absolute;z-index:30;display:none;background:var(--surface);border-radius:var(--r-pop);box-shadow:var(--shadow-pop);padding:8px}
.pop.is-open{display:block}
.pop-head{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label);padding:8px 10px 4px}
.pop-item{display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:6px 10px;border-radius:var(--r-sm);font-size:14px;font-weight:600}
@media (hover:hover){.pop-item:hover{background:var(--hover-bg)}}
.pop-item.is-selected{background:var(--tint-bg);color:var(--tint-fg)}
.pop-item small{margin-left:auto;font-size:12px;font-weight:500;color:var(--text-muted)}
.pop-note{font-size:12px;color:var(--text-muted);padding:8px 10px;border-top:1px solid var(--border);margin-top:4px}
.anchor{position:relative}
.anchor > .pop{top:calc(100% + 8px);right:0;width:230px}

/* hover pop-up (desktop chart read-out). Held 60px from the cursor, flips side
   at the plot's midpoint, pinned to plot top + 6px, never takes clicks. */
.hover-card{position:absolute;z-index:5;pointer-events:none;opacity:0;transition:var(--t-tooltip);
  background:var(--tooltip-bg);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  border-radius:var(--r-md);box-shadow:var(--shadow-pop);padding:13px 18px 15px;font-size:13.5px;font-variant-numeric:tabular-nums}
.hover-card.is-on{opacity:1}
.hover-card .hc-head{text-align:center;font-size:14px;font-weight:500;color:var(--text-muted);
  padding:0 8px 9px;margin-bottom:11px;border-bottom:1px solid var(--border)}
.hover-card .hc-head b{font-weight:700;color:var(--text)}
.hover-card .hc-cols{display:flex}
.hover-card .hc-left{display:flex;flex-direction:column;align-items:center;gap:10px;padding:0 16px 0 2px}
.hover-card .hc-right{border-left:1px solid var(--border);padding-left:16px;display:grid;gap:6px}
.hover-card .hc-row{display:grid;grid-template-columns:minmax(0,1fr) 56px 44px;column-gap:8px;align-items:center}
.hover-card .hc-row.is-dim{opacity:.45}
.hc-pill{display:inline-flex;align-items:center;height:26px;padding:0 11px;border-radius:var(--r-pill);
  background:var(--surface-sunken);box-shadow:inset 0 0 0 1px var(--border);font-size:13px;font-weight:700}
.hc-pill.is-on{background:var(--selected-bg);color:var(--selected-fg);box-shadow:none}
.hc-pill.is-hot{background:var(--highlight-row-bg);color:var(--highlight-row-fg);box-shadow:inset 0 0 0 1.5px var(--highlight-row-line)}
.hc-ring{width:48px;height:48px;border-radius:50%;border:4.5px solid currentColor;display:grid;place-items:center}
.hc-ring small{font-size:10.5px;font-weight:700;color:var(--text-muted)}


/* ---------- 14. Sheet, modal, toast, floating pill ---------------------- */
/* phone bottom sheet */
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:20;display:none}
.scrim.is-on{display:block}
.sheet{position:fixed;left:50%;bottom:0;z-index:21;width:100%;max-width:var(--phone-max);max-height:82vh;max-height:82dvh;overflow-y:auto;
  transform:translate(-50%,105%);visibility:hidden;transition:transform .2s,visibility 0s .2s;
  background:var(--surface);border-radius:var(--r-hero) var(--r-hero) 0 0;box-shadow:var(--shadow-sheet);
  padding:8px 16px calc(18px + env(safe-area-inset-bottom))}
.sheet.is-on{transform:translate(-50%,0);visibility:visible;transition:transform .2s}
.sheet-grab{width:40px;height:5px;border-radius:3px;background:var(--border-idle);margin:4px auto 10px}
.sheet h3{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label);margin:16px 2px 6px}
.sheet .close-bar{display:flex;align-items:center;justify-content:center;width:100%;min-height:46px;margin-top:12px;
  border-radius:var(--r-lg);background:var(--surface-sunken);font-size:15px;font-weight:600;color:var(--tint-fg)}
.scrim.stacked{z-index:22} .sheet.stacked{z-index:23}
/* full-height form sheet: pinned header + scrolling body + pinned footer */
.sheet.full{display:flex;flex-direction:column;padding:0;overflow:hidden;max-height:none;
  height:94vh;height:calc(100dvh - max(26px, env(safe-area-inset-top) + 10px))}
.sheet-head{flex:none;display:flex;flex-direction:column;justify-content:center;min-height:60px;box-sizing:border-box;padding:10px 10px 10px 18px;border-bottom:1px solid var(--border)}   /* title centred between the top edge and the divider (owner 2026-10-24) */
.sheet-head .eyebrow{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label)}
.sheet-head h2{margin:0;font-size:18px;font-weight:700;letter-spacing:-.01em;line-height:1.25}
.sheet-body{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 16px 18px}
.sheet-foot{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:10px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface)}
/* footer buttons never touch (owner 2026-10-24): one 10px gap, Cancel 1 part, the action 2 parts; the status line sits above them */
.sheet-foot>.status{flex:1 1 100%;font-size:12.5px;color:var(--text-muted)}.sheet-foot>.status:empty{display:none}.sheet-foot>.status.error{color:var(--danger-fg);font-weight:600}
.sheet-foot>.btn-soft{flex:1 1 0;min-width:0}.sheet-foot>.btn-primary,.sheet-foot>.btn-danger{flex:2 1 0;min-width:0}
body.lock,html.lock{overflow:hidden}         /* lock page scroll while any sheet or modal is open */
/* POPUP SCROLL LOCK (owner 2026-10-26; shared.js): html.k-scroll-lock while ANY popup is open — the page keeps its place, the gutter stays put, popup scrollers never chain to the page */
html.k-scroll-lock,html.k-scroll-lock body{overflow:hidden!important;overscroll-behavior:none}
html.k-scroll-lock{scrollbar-gutter:stable}
.modal,.modal-body,.md .pane,.sheet,.k-menu,.pop,.k-cs-pop,.k-datepick,.modal-back{overscroll-behavior:contain}

/* desktop modal (centred window) */
.modal-scrim{position:fixed;inset:0;z-index:65;background:var(--scrim)}
.modal{position:fixed;inset:0;margin:auto;z-index:70;width:min(600px,calc(100vw - 48px));height:fit-content;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);
  display:flex;flex-direction:column;overflow:hidden;background:var(--surface);border-radius:var(--r-hero);box-shadow:var(--shadow-pop)}
.modal.wide{width:min(1020px,calc(100vw - 48px));height:min(760px,calc(100vh - 48px));height:min(760px,calc(100dvh - 48px))}   /* two-pane: inputs left, choices right */
.modal-head{display:flex;flex-shrink:0;align-items:center;gap:12px;min-height:68px;box-sizing:border-box;padding:12px 22px 12px 28px;border-bottom:1px solid var(--border)}   /* title centred between the top edge and the divider (owner 2026-10-24) */
.modal-head .eyebrow{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label)}
.modal-head h2{margin:0;font-size:18px;font-weight:700;letter-spacing:-.01em}
.modal-body{flex:0 1 auto;min-height:0;overflow:auto;padding:18px 28px 20px}   /* basis auto, not 1/0: with .modal height:fit-content Safari collapsed a 0-basis body to ~0 (New Transfer, 2026-10-26) */
.modal-body > section + section{border-top:1px solid var(--border);margin-top:18px;padding-top:18px}
.modal-foot{display:flex;align-items:center;gap:10px;padding:12px 22px 14px 28px;border-top:1px solid var(--border)}
.modal-foot .status{flex:1;font-size:12.5px;color:var(--text-muted)}
.modal-foot .status.error{color:var(--danger-fg);font-weight:600}

/* toast (inverted). Desktop: centred on the content area, not the viewport. */
.toast{position:fixed;left:calc(50% + var(--sidebar-w) / 2);bottom:26px;transform:translateX(-50%);z-index:50;
  background:var(--text);color:var(--bg-page);font-size:13px;padding:10px 16px;border-radius:var(--r-md);
  opacity:0;pointer-events:none;transition:var(--t-toast)}
.toast.is-on{opacity:1}
.phone .toast,.toast.phone-toast{left:50%;bottom:calc(22px + env(safe-area-inset-bottom));z-index:30;
  max-width:min(340px,calc(100vw - 32px));width:max-content;text-align:center}

/* floating "new content" pill */
.float-pill{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom));z-index:28;
  display:flex;width:max-content;max-width:min(340px,calc(100vw - 56px));background:var(--surface);
  border:1.5px solid rgba(47,107,214,.65);border:1.5px solid color-mix(in srgb,var(--accent) 65%,transparent);border-radius:var(--r-lg);box-shadow:var(--shadow-float)}

/* inline confirm (replaces native confirm()) */
.confirm .q{font-size:14.5px;font-weight:600;margin-bottom:8px}
.confirm .acts{display:flex;gap:10px}
.confirm .acts > *{flex:1 1 auto;min-width:132px}
.confirm-danger{background:var(--danger-surface);box-shadow:inset 0 0 0 1.5px var(--danger-ring);border-radius:var(--r-lg);padding:14px 16px}
.confirm-danger .q{font-size:15px;font-weight:700}


/* ---------- 15. Empty states, "show all" bar ---------------------------- */
.empty{font-size:13px;color:var(--text-muted);padding:4px 0 10px}
.phone .empty{font-size:13.5px;padding:0 6px 8px 0}
.no-match{text-align:center;padding:34px 24px;font-size:14px;color:var(--text-muted)}
.empty-box{text-align:center;padding:26px 8px 12px}
.empty-box h3{font-size:16px;margin:0 0 6px}
.empty-box p{font-size:13.5px;color:var(--text-muted);max-width:62ch;margin:0 auto}
.more-bar{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;border-radius:var(--r-lg);
  box-shadow:inset 0 0 0 1.5px var(--border);font-size:14px;font-weight:600;color:var(--tint-fg)}
@media (hover:hover){.more-bar:hover{background:var(--hover-bg);box-shadow:inset 0 0 0 1.5px var(--hover-ring)}}
.card .more-bar{max-width:260px;margin:12px auto 0}
.phone .more-bar{min-height:46px;font-size:14.5px}
.phone .card .more-bar{max-width:none}


/* ---------- 16. Breakpoints ---------------------------------------------- */
@media (max-width:1360px){
  .card{padding-left:20px;padding-right:20px}
  .card > .flush-tail{margin-left:-20px;margin-right:-20px}
}
@media (max-width:1180px){
  .grid-2{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:1100px){
  .grid-detail,.grid-overview{grid-template-columns:minmax(0,1fr)}   /* side rail drops under main */
}
@media (max-width:360px){
  .phone-title{font-size:20px;gap:5px}
  .tab span,.tabs-wrap.scrolls .tab span{padding:8px;font-size:13.5px}
  .tabs{padding:2px 6px 8px;gap:0}
  .tile-tabs{padding:4px 8px 8px;gap:5px}
  .tile-tab b{font-size:14px}
  .list-row{gap:9px;padding-left:12px;padding-right:10px}
  .list-row .ring-sm{width:46px;height:46px}
  .list-row .title{font-size:14.5px}
  .counter{width:auto;min-width:32px}
  .ring .c{width:56px;height:56px;border-width:5px;font-size:19px}
  .block-title{font-size:17px}
}


/* ==========================================================================
   Additions for this app (not in the pack) — Phase 1
   ========================================================================== */

/* One rendered shell (D9, LAYOUT-SPEC §1): /layout.js stamps html[data-layout]
   (and data-shell) in <head> from the saved override, else the one breakpoint
   constant it owns. The phone column sits on the backdrop. */
html[data-shell="phone"],:where(html[data-shell="phone"]) body{background:var(--bg-backdrop)}
.app,.phone{visibility:visible}
html[data-shell][data-booting] .app,html[data-shell][data-booting] .phone{visibility:hidden}

/* iOS focus zoom: every field reads ≥16px in the phone layout or on a touch
   screen, including a desktop layout forced onto a phone (pack H§12, LAYOUT-SPEC §5). */
html[data-layout="phone"] input,html[data-layout="phone"] select,html[data-layout="phone"] textarea{font-size:16px!important}
@media (pointer:coarse){
  :where(html[data-shell]) input,:where(html[data-shell]) select,:where(html[data-shell]) textarea{font-size:16px!important}
}
/* No-JavaScript fallback (§1): without data-layout the width decides — desktop
   rules at min-width 900, the phone floor below it. */
@media not all and (min-width:900px){
  :root:not([data-layout]) input,:root:not([data-layout]) select,:root:not([data-layout]) textarea{font-size:16px!important}
}

/* Names shared.js still reads inline (dialog dividers, chips) — aliased to the
   pack tokens so nothing it draws on a shell page renders transparent. */
:root[data-shell]{--card:var(--surface);--line:var(--border);--primary:var(--primary-bg);
  --red:var(--danger-fg);--green:var(--success-fg);--muted:var(--text-muted);--ink:var(--text)}

/* Pack fix: a pressed filter chip reads selected (the pack styles only .is-on
   inside a filter group, and its raised background then hid aria-pressed text). */
.filter-group .chip[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg);box-shadow:var(--shadow-card)}
.user-chip .nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-chip .tag{flex:none}

/* Pack fixes: a count inside a pill-strip tab carries no tinted badge (H§6.4),
   and stacked banners key on their wrapper, not on element type. */
.tab .count{background:none;padding:0}
.banners > .banner:first-child{margin-top:12px}

/* Wide tables scroll inside their card with a sticky first column (§6.1). */
.table-scroll{overflow-x:auto;margin:0 -4px;padding:0 4px}
.table-scroll .table th:first-child,.table-scroll .table td:first-child{position:sticky;left:0;z-index:1;background:var(--surface)}
.table td.wrap{white-space:normal;overflow-wrap:anywhere}
.table tr.is-open > td{border-bottom:0}
.table tr.detail > td{padding:4px 8px 22px}
.table tr.detail .kv{display:grid;grid-template-columns:max-content 1fr;gap:6px 18px;font-size:13px}
.table tr.detail .kv dt{color:var(--text-muted);font-weight:600}
.table tr.detail .kv dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.table .when{color:var(--text-muted);white-space:nowrap}
.table .by{color:var(--text-secondary);white-space:nowrap}
.table .by b{color:var(--text);font-weight:600}

/* Phone feed row: one log entry (type chip at the right, what, then
   "time · by Name"). Taps expand it in place. */
.feed-row{display:block;width:100%;padding:12px 14px 12px 16px;text-align:left}
.feed-row + .feed-row{border-top:1px solid var(--border)}
.feed-row .fr-top{display:flex;align-items:center;gap:8px;min-height:24px}
.feed-row .fr-place{font-size:15.5px;font-weight:700;color:var(--accent);min-width:0;overflow-wrap:anywhere}
.feed-row .fr-top .cat,.feed-row .fr-top .status-pill{margin-left:auto;flex:none}
.feed-row .fr-body{font-size:15px;font-weight:600;margin-top:6px;overflow-wrap:anywhere}
.feed-row .fr-meta{font-size:13px;color:var(--text-muted);margin-top:4px}
.feed-row .fr-meta b{color:var(--text-secondary);font-weight:600}
.feed-row .fr-detail{margin-top:10px;font-size:13.5px}
.feed-row .fr-detail .kv{display:grid;grid-template-columns:max-content 1fr;gap:4px 14px}
.feed-row .fr-detail dt{color:var(--text-muted);font-weight:600}
.feed-row .fr-detail dd{margin:0;font-weight:600;overflow-wrap:anywhere}

/* Date fields: iOS collapses an empty appearance:none date input and centres
   its value. */
input[type=date].field{display:block;min-height:40px}
input[type=date].field::-webkit-date-and-time-value{text-align:left}
.filter-bar input[type=date].field{width:160px;display:inline-block;background:var(--chip-bg);border-color:transparent;box-shadow:var(--shadow-chip)}

/* A native select styled as the pack's select trigger (keyboard, screen
   readers and the phone picker for free). */
select.select-btn{appearance:none;-webkit-appearance:none;cursor:pointer;color:var(--text);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14' viewBox='0 0 12 14' fill='none' stroke='%2393a4bf' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l3-3 3 3M3 9l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;padding-right:34px}

/* Search field in the top bar: a page search until global search lands. */
.search input:disabled{opacity:.6;cursor:not-allowed}

/* ---------- Phase 2 — Overview (2026-10-17) ------------------------------
   Additions for the Overview page pattern. No new tokens: everything reads the
   pack's existing ones. */
.stat-groups{display:grid;gap:16px}
.stat-group-label{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin:0 2px 8px}
a.tile,button.tile{display:block;color:inherit;text-align:left;width:100%}
@media (hover:hover){a.tile:hover,button.tile:hover{background:var(--hover-bg);box-shadow:inset 0 0 0 1px var(--hover-ring)}}
.stat-card .tile .n{font-size:22px;line-height:1.1;white-space:nowrap}
.tile .n.zero{color:var(--text-muted);font-weight:600}
.tile .k .tag{display:table;margin:4px 0 2px;text-transform:none;letter-spacing:0;font-weight:600;white-space:normal;max-width:100%}
/* The view-as bar (shared.js viewAsBanner) is fixed at the top: the shell's
   sticky parts sit below it (--vab is its height, set by the banner). */
:where(html[data-shell]) .sidebar{top:var(--vab,0px);height:calc(100vh - var(--vab,0px))}
:where(html[data-shell]) .topbar{top:var(--vab,0px)}
:where(html[data-shell]) .sticky-strip{top:calc(var(--topbar-h) + var(--vab,0px))}
:where(html[data-shell]) .tabs-wrap{top:calc(env(safe-area-inset-top,0px) + var(--vab,0px))}
.tiles.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.tiles.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}   /* four tiles read 2 × 2 */
.phone .tile .n{font-size:20px;white-space:nowrap}
.phone .tiles.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
.table tfoot td{border-top:1.5px solid var(--border-idle);border-bottom:0;padding-top:11px;font-weight:700}
.table tfoot td:first-child{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted)}
.table td .muted,.table td small.muted{color:var(--text-muted);font-weight:500}
@media (hover:hover){.table-scroll .table tr.is-click:hover td:first-child{background:linear-gradient(var(--hover-bg),var(--hover-bg)),var(--surface)}}
@media (min-width:1101px) and (max-width:1360px){.ov-fac .col-lastcash{display:none}}
@media (max-width:1100px){.grid-overview > .ov-rail{order:-1}}
.q-row{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:2px;align-items:center;padding:10px 0;color:inherit}
.q-row + .q-row{border-top:1px solid var(--border)}
.q-row .t{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.q-row .m{grid-column:1;font-size:12.5px;color:var(--text-muted);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.q-row .a{grid-column:2;grid-row:1/span 2;justify-self:end;display:flex;gap:4px;align-items:center}
.q-row .acts{grid-column:1/-1;display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}   /* a row's actions on their own line (phone lists) */
@media (hover:hover){a.q-row:hover .t{color:var(--accent)}}
.phone .card--flush .q-row{padding:12px 14px 12px 16px}
.banner-body .q-row{padding:9px 0}
a.kv-row{color:inherit}
@media (hover:hover){a.kv-row:hover .v{color:var(--accent)}}
.counter.money{width:auto;min-width:76px;text-align:right}
.counter.money + .counter.money{margin-left:10px}
.phone .tiles.cols-2 > :last-child:nth-child(odd){grid-column:1/-1}
.counter.money .n{font-size:15px}
.counter.money .k{text-align:right}
@media (max-width:360px){.counter.money{min-width:64px}.counter.money .n{font-size:14px}}
.table a.name{color:inherit}
@media (hover:hover){.table tr.is-click:hover a.name{color:var(--accent)}}
.ov-fold-head{display:flex;align-items:center;gap:10px;width:100%;min-height:32px;text-align:left}
.ov-note{font-size:12.5px;color:var(--text-muted);margin-top:10px}
.ov-xpand td{background:var(--surface-sunken);font-size:13px}
/* the one chart frame (ui.js chartFrame — stackChart, lineChart; pack §9.3) */
.k-chart{position:relative}
.k-chart-plot{position:relative}
.k-chart svg{width:100%;height:auto;overflow:visible;display:block}
.k-chart .k-hit{fill:transparent}
.k-chart .k-xh{pointer-events:none}
/* desktop crosshair: --text 0.8, dashed 2 2, .5 — phone (slider): solid 1.4 at .9 */
.k-xv{stroke:var(--text);stroke-width:.8;stroke-dasharray:2 2;opacity:.5;vector-effect:non-scaling-stroke}
.k-xv.is-scrub{stroke-width:1.4;stroke-dasharray:none;opacity:.9}
.k-xhz{stroke:var(--text);stroke-width:.8;stroke-dasharray:2 2;opacity:.35;vector-effect:non-scaling-stroke}
.k-xd{stroke:var(--surface);stroke-width:2}
.k-chart svg g[data-i]{transition:opacity .12s}
.k-chart svg.k-sel g[data-i]:not(.is-on){opacity:.4}
.k-chart .tip{transition:opacity .12s}
.k-chart.is-hover .tip,.k-chart svg.k-sel .tip{opacity:0}
/* where the slider drives the line (phone; desktop layout on a touch-only screen) the peak
   label stays in its band — dimmed with the other bars, full when the peak is the day shown */
.k-chart.is-ph svg.k-sel .tip{opacity:.4}
.k-chart.is-ph svg.k-sel .tip.is-on{opacity:1}
.k-chart-sw{display:inline-block;flex:none;width:9px;height:9px;border-radius:3px;margin-right:7px}
/* desktop read-out: the pack .hover-card, beside the cursor, never takes clicks */
.k-chart .hover-card{top:0;left:0;min-width:176px;padding:10px 14px 12px;font-size:13px;border-radius:var(--r-lg)}
.k-chart .hover-card .hc-head{padding:0 4px 7px;margin-bottom:8px;font-size:13px;white-space:nowrap}
.k-chart .hover-card .hc-right{border-left:0;padding-left:0;gap:5px}
.k-chart .hover-card .hc-row{grid-template-columns:minmax(0,1fr) auto;column-gap:18px}
.k-chart .hc-name{display:flex;align-items:center;white-space:nowrap;color:var(--text-secondary)}
.k-chart .hc-row b{text-align:right;font-weight:700;white-space:nowrap}
.k-chart .hc-row.is-total{border-top:1px solid var(--border);padding-top:6px;margin-top:1px}
.k-chart .hc-row.is-total .hc-name{color:var(--text);font-weight:600}
/* phone read-out strip (above the plot) + scrub slider (below it) */
.chart-readout{background:var(--surface-sunken);border-radius:14px 14px 0 0;padding:7px 12px 4px;font-size:14px;font-variant-numeric:tabular-nums}
.chart-readout .cr-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;min-height:22px}
.chart-readout .rl{font-weight:600}
.chart-readout .rv{font-weight:700;white-space:nowrap}
.chart-readout .rv small{font-size:12px;font-weight:600;color:var(--text-muted)}
/* pack §9.3: rows on a 1fr · value · share grid, min 29px; a row is a button that isolates its series */
.chart-readout .cr-rows{display:grid;grid-template-columns:minmax(0,1fr) minmax(50px,max-content) 36px;column-gap:8px;font-size:13px;color:var(--text-secondary);padding:2px 0 3px}
.chart-readout .cr-row{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(50px,auto) 36px;grid-template-columns:subgrid;column-gap:8px;align-items:center;min-height:29px;
  margin:0 -6px;padding:0 6px;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;text-align:left;white-space:nowrap}
button.cr-row{position:relative;cursor:pointer;touch-action:manipulation}
button.cr-row::after{content:"";position:absolute;left:0;right:0;top:calc((100% - 44px) / 2);bottom:calc((100% - 44px) / 2)}   /* 44px ring, any layout (touch desktop too) */
button.cr-row:focus-visible{outline:2px solid var(--text-label);outline-offset:-2px}
.chart-readout .cr-n{display:flex;align-items:center;min-width:0;overflow:hidden;text-overflow:ellipsis}
.chart-readout .cr-v{color:var(--text);font-weight:700;text-align:right}
.chart-readout .cr-p{font-size:11.5px;font-weight:600;color:var(--text-muted);text-align:right}
.chart-readout .cr-row.is-dim{opacity:.55}
.chart-readout .cr-row.is-iso{background:var(--k-tint);color:var(--tint-fg);box-shadow:inset 0 0 0 1.5px var(--tint-fg)}
.chart-readout .cr-row.is-iso .cr-v,.chart-readout .cr-row.is-iso .cr-p{color:var(--tint-fg)}
.chart-readout .cr-row.is-off{opacity:.45}
.k-chart-plot [data-s]{transition:opacity .12s}
.k-chart-plot [data-s].is-iso-off{opacity:.15}
.k-chart.is-ph .k-chart-plot{background:var(--surface-sunken);border-radius:0 0 14px 14px;padding:2px 0 8px}
.k-chart.is-ph.is-line .k-chart-plot{padding:8px 0}
.chart-caption{font-size:12px;color:var(--text-muted);margin-top:6px}
.scrub{display:block;height:44px;margin:8px 0 2px;padding:0;box-sizing:border-box;touch-action:pan-x;-webkit-appearance:none;appearance:none;background:transparent;cursor:pointer}
.scrub:focus-visible{outline:none}
.scrub::-webkit-slider-runnable-track{height:6px;border-radius:3px;background:var(--border-idle)}
.scrub::-webkit-slider-thumb{-webkit-appearance:none;width:46px;height:30px;margin-top:-12px;border-radius:999px;background:var(--selected-bg);border:2px solid var(--selected-fg);box-sizing:border-box;box-shadow:0 0 0 1px rgba(22,44,88,.3),0 2px 8px rgba(22,44,88,.28)}
.scrub:active::-webkit-slider-thumb,.scrub.is-drag::-webkit-slider-thumb,.scrub:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px var(--hover-ring),0 2px 8px rgba(22,44,88,.28)}
.scrub::-moz-range-track{height:6px;border-radius:3px;background:var(--border-idle)}
.scrub::-moz-range-thumb{width:46px;height:30px;border-radius:999px;background:var(--selected-bg);border:2px solid var(--selected-fg);box-sizing:border-box;box-shadow:0 0 0 1px rgba(22,44,88,.3),0 2px 8px rgba(22,44,88,.28)}
/* desktop layout: the strip + slider only on a touch-only screen (no hover there) */
.k-chart.is-dk .chart-readout,.k-chart.is-dk .scrub{display:none}
@media (hover:none) and (pointer:coarse){
  .k-chart.is-dk .chart-readout,.k-chart.is-dk .scrub{display:block}
  .k-chart.is-dk svg.k-sel .tip{opacity:.4}
  .k-chart.is-dk svg.k-sel .tip.is-on{opacity:1}
  .k-chart.is-dk .k-chart-plot{background:var(--surface-sunken);border-radius:0 0 14px 14px;padding:2px 0 8px}
  .k-chart.is-dk .hover-card{display:none}
}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* class bars (A/B/C, pack §9.4) */
.bar-list{display:grid;gap:4px;margin-top:14px}
.bar-row{display:grid;grid-template-columns:96px minmax(0,1fr) 92px 140px;column-gap:10px;align-items:center;min-height:30px;color:inherit}
.bar-track{height:14px;border-radius:7px;background:var(--surface-sunken);box-shadow:inset 0 0 0 1px var(--border);overflow:hidden}
.bar-fill{display:block;height:100%;background:var(--k-fg)}
.bar-val{text-align:right;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.bar-delta{font-size:12px;font-weight:600;color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.phone .bar-row{grid-template-columns:auto minmax(0,1fr) auto;row-gap:4px}
.phone .bar-row .bar-track{grid-column:1/-1;grid-row:2}
.phone .bar-row .bar-delta{grid-column:1/-1;grid-row:3}
/* the shared order-state badge (shared.js ledgerBadge) on the shell */
:where(html[data-shell]) .txn-badge{display:inline-flex;align-items:center;font-size:12px;font-weight:600;line-height:1.4;padding:2px 9px;border-radius:var(--r-pill);background:var(--surface-sunken);color:var(--text-muted);white-space:nowrap}
:where(html[data-shell]) .txn-badge.tb-paid{background:var(--success-bg);color:var(--success-fg)}
:where(html[data-shell]) .txn-badge.tb-await{background:var(--warning-bg);color:var(--warning-fg)}

/* ---------- Phase 3 — Money (2026-10-17) -------------------------------- */
.modal-body.two-pane{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,380px);padding:0}
.two-pane > .pane{min-height:0;overflow:auto;padding:18px 24px 20px}
.two-pane > .pane-r{background:var(--surface-sunken);border-left:1px solid var(--border)}
.md-foot{flex-wrap:wrap}
.md.shake{animation:md-shake .3s}
@keyframes md-shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
@media (prefers-reduced-motion:reduce){.md.shake{animation:none}}
.kv-row.resulting{border-top:1.5px solid var(--border-idle);margin-top:4px;font-weight:700}
.kv-row.resulting .v{font-size:17px}
button.kv-row{width:100%;text-align:left;color:inherit;font:inherit;font-size:14px;font-weight:500;background:none;border:0;cursor:pointer}
@media (hover:hover){button.kv-row:hover .v{color:var(--accent)}}
.kv-row .v.muted{color:var(--text-muted);font-weight:600}
.row-acts{display:flex;flex-wrap:wrap;gap:8px}
.list-foot{font-size:12.5px;color:var(--text-muted);margin:12px 2px 0;font-variant-numeric:tabular-nums}
.table tr.detail td{background:var(--surface-sunken);padding-top:14px;padding-bottom:16px}
.bal-det{gap:24px}
.phone .grid-2{grid-template-columns:minmax(0,1fr)}
.bal-item + .bal-item{border-top:1px solid var(--border)}
.bal-item > .list-row{width:100%;text-align:left;color:inherit;font:inherit;background:none;border:0}
.ic-box{margin:10px 0}
#shell-pill{display:none;padding:10px 16px;gap:10px;align-items:center;font-size:14px;font-weight:600}
#shell-pill.is-on{display:flex}
/* The shared status chip (shared.js statusChip) on the shell: the pack's
   status-pill look, so a state reads by colour AND word. */
:where(html[data-shell]) .badge.low,:where(html[data-shell]) .badge.ok,:where(html[data-shell]) .badge.out{display:inline-flex;align-items:center;height:auto;min-width:0;
  padding:2px 9px;border-radius:var(--r-pill);font-size:12px;font-weight:600;line-height:1.4;box-shadow:none}
:where(html[data-shell]) .badge.low{background:var(--warning-bg);color:var(--warning-fg)}
:where(html[data-shell]) .badge.ok{background:var(--success-bg);color:var(--success-fg)}
:where(html[data-shell]) .badge.out{background:var(--surface-sunken);color:var(--text-muted)}
html[data-layout="phone"] .modal-body.two-pane{grid-template-columns:1fr}html[data-layout="phone"] .two-pane > .pane-r{border-left:0;border-top:1px solid var(--border)}
@media not all and (min-width:900px){:root:not([data-layout]) .modal-body.two-pane{grid-template-columns:1fr}}

/* Print: the desktop column on white, chrome hidden (proposal Phase 1). A
   printed page is narrower than 900px, so the phone shell is never printed. */
@media print{
  :root[data-shell],:root[data-shell][data-theme="dark"]{
    --bg-page:#fff;--bg-backdrop:#fff;--bg-sidebar:#fff;--surface:#fff;--surface-sunken:#fff;
    --text:#000;--text-secondary:#222;--text-muted:#444;--border:#ccc;--shadow-card:none;--shadow-chip:none;--shadow-pop:none;color-scheme:light}
  .sidebar,.topbar,.k-topbar,.k-aside,.phone-header,.tabs-wrap,.scrim,.sheet,.toast,.no-print,.more-bar{display:none!important}
  .app{display:block!important}
  .card{box-shadow:none;border:1px solid var(--border)}
  .table thead{display:table-header-group}
  .table tr{break-inside:avoid}
}
/* ==========================================================================
   KIT — the mock kit (docs/mocks/kit/kit.css, v33.3) ported as the component
   layer (B1, 2026-10-22). k- class names kept so the approved fragments map
   1:1. Every palette colour is a token; light values are the mock's own
   dark → light MAP (docs/mocks/build.mjs). The POS section joins in B6.
   Palette → token (use these when porting a fragment's inline colours):
     #070d1c                → --bg-page
     #050a17                → --bg-sidebar
     #0e1830                → --surface
     #132040                → --k-sunken
     #1c2a4a                → --k-line
     #1f2d4d                → --chart-grid
     #34476e                → --border-idle
     #4a6fa5                → --disclosure-ring
     #e6edf3                → --text
     #c3cfe0                → --text-secondary
     #93a4bf                → --text-muted
     #7389b0                → --tab-fg
     #6d9ee6                → --text-label
     #8fc0f0                → --tint-fg
     #9ccbf5                → --selected-fg
     #17284f                → --selected-bg
     #12203f                → --k-tint
     #2f67bd                → --pair1-bg
     #6a3fe0                → --k-violet
     #3f80d6                → --k-blue
     #33290f                → --warning-bg
     #f2b63c                → --k-amber
     #3a1a1c                → --danger-bg
     #ff7a70                → --danger-fg
     #ff9a8f                → --k-red-soft
     #12301f                → --success-bg
     #5fd68a                → --success-fg
     #3fc472                → --success-ring
     #0f3a22                → --cat-green-bg
     #74e39a                → --cat-green-fg
     #1f2850                → --cat-indigo-bg
     #aab8f4                → --cat-indigo-fg
     #8c9cf2                → --k-indigo
     #42240c                → --cat-orange-bg
     #ffab5c                → --cat-orange-fg
     #ff9d4d                → --k-orange
     #2a2350                → --cat-violet-bg
     #c3b2f5                → --cat-violet-fg
     #a78bfa                → --k-purple
     #222c40                → --cat-slate-bg
     #1e2638                → --k-slate-bg
     #b4c0d6                → --cat-slate-fg
     #3a1a2c                → --k-pink-bg
     #f5a3cd                → --k-pink-fg
     #132a44                → --tag-blue-bg
     #8fc7f5                → --tag-blue-fg
     #6fb6f2                → --k-sky
     #8fd3f5                → --k-cyan
     #0b3433                → --k-teal-bg
     #5ee0cf                → --k-teal-2
     #2dd4bf                → --k-teal
     #3b2f12                → --k-gold-bg
     #e8c06a                → --k-gold-fg
     #57a0ff                → --k-series
     rgba(126,179,224,.07)  → --k-glow-ring
     rgba(24,60,140,.28)    → --k-glow
     rgba(242,182,60,.35)   → --k-amber-ring
   ========================================================================== */
:root[data-shell]{--k-class-bd:rgba(15,23,42,.42);--k-group-bg:#f2f4f8;--k-group-fg:#5b6577;--k-sel-bg:#e4eefc;--k-sel-bar:#2c5da9;--k-sel-fg:#1d4b8f;--k-line-card:#ffffff;--k-line-card-bd:#d5dde9;--k-sunken:#f4f6fa;--k-band-bg:#e6ebf4;--k-line:#d5dde9;--k-tint:#eaf1fb;--k-code-bg:#ede9f8;--k-code-fg:#563fa9;--k-code-bd:#b5a9d9;--k-violet:#6a3fe0;--k-blue:#7aa6e6;--k-amber:#a66a00;--k-red-soft:#b3261e;--k-indigo:#5b6fd6;--k-orange:#c45e0a;--k-purple:#7c5cd6;--k-slate-bg:#e9edf3;--k-pink-bg:#fbe7f1;--k-pink-fg:#b0317a;--k-sky:#1d6fb8;--k-cyan:#1d6fb8;--k-teal-bg:#dcf7f1;--k-teal-2:#0f766e;--k-teal:#0f766e;--k-gold-bg:#fbf0d4;--k-gold-fg:#8a6a00;--k-series:#2563eb;--k-glow-ring:rgba(44,93,169,.10);--k-glow:rgba(44,93,169,.10);--k-amber-ring:rgba(220,146,0,.45)}
:root[data-shell][data-theme="dark"]{--k-class-bd:rgba(255,255,255,.45);--k-group-bg:#0d1730;--k-group-fg:#8a9ab8;--k-sel-bg:#17305c;--k-sel-bar:#6ea2f0;--k-sel-fg:#cfe2ff;--k-line-card:#0e1830;--k-line-card-bd:#243659;--k-sunken:#132040;--k-band-bg:#132040;--k-line:#1c2a4a;--k-tint:#12203f;--k-code-bg:#2a234d;--k-code-fg:#c0b2f0;--k-code-bd:#4a3f86;--k-violet:#6a3fe0;--k-blue:#3f80d6;--k-amber:#f2b63c;--k-red-soft:#ff9a8f;--k-indigo:#8c9cf2;--k-orange:#ff9d4d;--k-purple:#a78bfa;--k-slate-bg:#1e2638;--k-pink-bg:#3a1a2c;--k-pink-fg:#f5a3cd;--k-sky:#6fb6f2;--k-cyan:#8fd3f5;--k-teal-bg:#0b3433;--k-teal-2:#5ee0cf;--k-teal:#2dd4bf;--k-gold-bg:#3b2f12;--k-gold-fg:#e8c06a;--k-series:#57a0ff;--k-glow-ring:rgba(126,179,224,.07);--k-glow:rgba(24,60,140,.28);--k-amber-ring:rgba(242,182,60,.35)}
/* ---------- page header: title · ONE context line · actions ---------- */
.k-page-head{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.k-page-head>.k-head-text{display:flex;flex-direction:column;gap:4px;min-width:0}
.k-title{margin:0;font-size:30px;font-weight:760;letter-spacing:-.01em;color:var(--text);line-height:1.15}
.k-context{display:flex;gap:10px;align-items:center;color:var(--text-muted);font-size:13.5px;flex-wrap:wrap}
.k-context b{color:var(--text)}
.k-context .is-amber{color:var(--k-amber)}.k-context .is-red{color:var(--danger-fg)}.k-context .is-green{color:var(--success-fg)}
.k-dot{width:8px;height:8px;border-radius:50%;background:var(--success-ring);display:inline-block;flex:none}
.k-dot.is-amber{background:var(--k-amber)}.k-dot.is-red{background:var(--danger-fg)}.k-dot.is-muted{background:var(--border-idle)}.k-dot.is-blue{background:var(--k-blue)}
.k-actions{margin-left:auto;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.k-crumbs{display:flex;gap:6px;align-items:center;font-size:12.5px;color:var(--tab-fg)}
.k-crumbs a{color:var(--tint-fg);font-weight:650}.k-crumbs .sep::before{content:"/";color:var(--border-idle)}

/* phone header: 44px home/back · centered 22px title · 44px options */
.k-phead{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;height:54px}
.k-phead>a,.k-phead>button{width:44px;height:44px;display:grid;place-items:center;border:0;background:transparent;color:var(--tint-fg);padding:0}
.k-phead>button{justify-self:end}
.k-phead-title{text-align:center;font-size:22px;font-weight:760;color:var(--text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.k-psub{text-align:center;font-size:13.5px;color:var(--text-muted);margin-top:-8px}

/* ---------- buttons ---------- */
.k-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 18px;border-radius:999px;border:0;font:inherit;font-size:14px;font-weight:700;background:var(--surface);box-shadow:inset 0 0 0 1px var(--border-idle);color:var(--text-secondary);cursor:pointer;white-space:nowrap;text-decoration:none;box-sizing:border-box}   /* round 2 §22: white + hairline — a grey button never sits on grey */
.k-btn svg{width:15px;height:15px;flex:none}
.k-btn.is-primary{background:var(--pair1-bg);color:#fff;box-shadow:none}
.k-btn.is-secondary{background:var(--surface);box-shadow:inset 0 0 0 1px var(--border-idle);color:var(--text-secondary)}
.k-btn.is-danger{background:var(--danger-bg);color:var(--danger-fg);box-shadow:none}
.k-btn.is-ghost{background:transparent;color:var(--tint-fg);box-shadow:none}
.k-btn.sm{padding:5px 12px;font-size:12.5px}
.k-btn.block{display:flex;width:100%;min-height:50px;border-radius:14px;font-size:16px}
.k-btn[disabled],.k-btn.is-disabled{opacity:.45;cursor:not-allowed}
.k-btn:focus-visible{outline:2px solid var(--text-label);outline-offset:2px}
.k-link{font-size:12.5px;font-weight:700;color:var(--k-series);white-space:nowrap}

/* ---------- KPI chips (Overview anatomy): icon tile · label · figure (+ small unit) · ONE basis line ---------- */
/* LAYOUT-SPEC §4: a KPI row fits its column — tiles wrap (auto-fit) instead of
   squeezing labels to "S.."; at full width the row keeps its 5 (c4: 4, c3: 3) columns. */
.k-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,max(168px,calc((100% - 48px) / 5))),1fr));gap:12px}
.k-kpis.c4{grid-template-columns:repeat(auto-fill,minmax(min(100%,max(168px,calc((100% - 36px) / 4))),1fr))}.k-kpis.c3{grid-template-columns:repeat(auto-fill,minmax(min(100%,max(168px,calc((100% - 24px) / 3))),1fr))}
.k-kpis.is-phone{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.k-kpi{background:var(--surface);border-radius:20px;padding:16px 16px 14px;display:flex;flex-direction:column;gap:6px;color:var(--text);box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);min-width:0;text-decoration:none}
.k-kpis.is-phone .k-kpi{border-radius:18px;padding:14px;gap:4px;box-shadow:none}
.k-kpi.wide{grid-column:1 / -1}
.k-kpi-head{display:flex;align-items:center;gap:8px;min-width:0}
.k-kpi-icon{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex:none;background:var(--tag-blue-bg);color:var(--k-series)}
.k-kpi-icon svg{width:15px;height:15px}
.k-kpi-icon.is-blue{background:var(--tag-blue-bg);color:var(--k-series)}
.k-kpi-icon.is-green{background:var(--cat-green-bg);color:var(--success-ring)}
.k-kpi-icon.is-amber{background:var(--warning-bg);color:var(--k-amber)}
.k-kpi-icon.is-orange{background:var(--cat-orange-bg);color:var(--k-orange)}
.k-kpi-icon.is-teal{background:var(--k-teal-bg);color:var(--k-teal)}
.k-kpi-icon.is-red{background:var(--danger-bg);color:var(--danger-fg)}
.k-kpi-icon.is-indigo{background:var(--cat-indigo-bg);color:var(--cat-indigo-fg)}
.k-kpi-dot{width:8px;height:8px;border-radius:3px;background:var(--k-series);flex:none}
.k-kpi-dot.is-green{background:var(--success-ring)}.k-kpi-dot.is-amber{background:var(--k-amber)}.k-kpi-dot.is-orange{background:var(--k-orange)}.k-kpi-dot.is-teal{background:var(--k-teal)}.k-kpi-dot.is-red{background:var(--danger-fg)}
.k-kpi-label{font-size:12.5px;font-weight:650;color:var(--text-muted);white-space:normal;overflow-wrap:anywhere;line-height:1.25;min-width:0}
.k-kpi-fig{font-size:25px;font-weight:760;letter-spacing:-.01em;line-height:1.2;font-variant-numeric:tabular-nums;white-space:nowrap}
.k-kpis.is-phone .k-kpi-fig{font-size:22px}
.k-unit{font-size:14px;font-weight:500;color:var(--text-muted);margin-left:4px;letter-spacing:0}
.k-kpi-basis{font-size:12px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k-delta{display:inline-flex;align-items:center;gap:4px;line-height:1.2;padding:2px 8px;border-radius:999px;font-weight:700;font-size:12px;font-variant-numeric:tabular-nums}
.k-delta.up{background:var(--success-bg);color:var(--success-fg)}.k-delta.down{background:var(--danger-bg);color:var(--danger-fg)}
.k-delta .arr{font-size:10px}
/* BN-46 (OQ-V6): aging fills — waiting amber (31–60 a deeper amber), overdue red (90+ a deeper red); never orange */
.f-amber2{background:#b7791f}
html[data-theme="dark"] .f-amber2{background:#c98a1e}
.f-red2{background:#8f1f18;background:color-mix(in srgb,var(--danger-fg) 62%,#000)}
html[data-theme="dark"] .f-red2{background:#a3241b;background:color-mix(in srgb,var(--danger-fg) 70%,#7a0d0d)}
.k-delta-vs{display:inline-block;margin-left:6px;font-size:11px;font-weight:600;color:var(--text-muted);white-space:nowrap}

/* ---------- card: header line = title · preview · actions / info / chevron ---------- */
.k-card{background:var(--surface);border-radius:22px;padding:20px 22px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);min-width:0;box-sizing:border-box}
.k-card.is-phone{border-radius:18px;padding:16px}
.k-card.is-attn{box-shadow:0 0 0 1px var(--k-amber-ring)}
.k-card-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap;min-width:0}
.k-card-head.is-folded{margin-bottom:0}
.k-card-title{font-size:12.5px;letter-spacing:.09em;font-weight:750;color:var(--text-label);text-transform:uppercase;white-space:nowrap}
.k-card-preview{font-size:12.5px;color:var(--text-muted);font-variant-numeric:tabular-nums;min-width:0}
.k-card-preview b{color:var(--text)}
.k-card-actions{margin-left:auto;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.k-grid{display:grid;gap:18px}
.k-grid.r21{grid-template-columns:2.1fr 1fr}.k-grid.r12{grid-template-columns:1fr 2.1fr}.k-grid.r11{grid-template-columns:1fr 1fr}
.k-stack{display:flex;flex-direction:column;gap:18px}
.k-stack.is-phone{gap:14px}

/* ---------- filters (one row above the table) ---------- */
.k-filters{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12.5px;margin:4px 0 16px}
.k-filter-label{font-size:11.5px;color:var(--tab-fg);letter-spacing:.06em;font-weight:700;text-transform:uppercase;margin-right:2px}
.k-filter-sep{width:1px;height:22px;background:var(--k-line);margin:0 14px;flex:none}
.k-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;font-weight:700;font-size:12.5px;background:var(--k-sunken);box-shadow:inset 0 0 0 1px var(--k-line);color:var(--text-muted);white-space:nowrap;border:0;font-family:inherit;cursor:pointer}
.k-chip.is-on,.k-chip[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg);box-shadow:none}   /* 57b: the class chips press via aria-pressed */
.k-chip b{font-variant-numeric:tabular-nums}
.k-chip .is-amber,.k-chip.is-amber{color:var(--k-amber)}.k-chip .is-red{color:var(--k-red-soft)}.k-chip .is-green{color:var(--success-fg)}.k-chip .is-blue{color:var(--tint-fg)}
.k-search{display:flex;align-items:center;gap:8px;background:var(--k-sunken);box-shadow:inset 0 0 0 1px var(--k-line);border-radius:12px;padding:7px 12px;color:var(--text-muted);font-size:13px;min-width:200px}
.k-search svg{width:14px;height:14px;flex:none}

/* ---------- tables ---------- */
.k-table{width:100%;border-collapse:collapse;font-size:13px}
.k-table.fixed{table-layout:fixed}
.k-table th{text-align:left;font-size:11.5px;letter-spacing:.07em;color:var(--text-muted);font-weight:700;padding:0 6px 9px;white-space:nowrap;border-bottom:1px solid var(--chart-grid);text-transform:uppercase}
.k-table td{padding:7px 6px;border-top:1px solid var(--k-line);vertical-align:middle;line-height:1.25}
.k-table tbody tr:first-child td{border-top:0}
.k-table th.num,.k-table td.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.k-table td.sub,.k-table .sub{display:block;font-size:11.5px;color:var(--text-muted);font-weight:400}
.k-table .muted{color:var(--tab-fg)}
.k-table a.k-rowlink,.k-rowlink{color:var(--text);font-weight:700;white-space:nowrap}
.k-table tr.is-selected td{background:var(--k-sel-bg)}
.k-table tr.is-selected td:first-child{box-shadow:inset 3px 0 0 var(--k-sel-bar)}   /* round 2 §22: the §14 selection colour, never the tint */
.k-table tr.k-group td{padding:12px 6px 6px;border-top:0}
.k-group-label{display:flex;align-items:center;gap:8px;font-size:12px;letter-spacing:.07em;font-weight:750;color:var(--text-secondary);text-transform:uppercase}
.k-group-label>a,.k-group-label>b,.k-group-label>span:not(.k-group-meta){white-space:nowrap;flex:none}   /* 'CLASS A' never splits [f3-10] */
.k-group-label .k-group-meta{letter-spacing:0;text-transform:none;font-weight:500;color:var(--text-muted);font-variant-numeric:tabular-nums}
.k-sort{color:var(--text-label)}
.k-pager{display:flex;align-items:center;gap:12px;margin-top:12px;font-size:12.5px;color:var(--text-muted);flex-wrap:wrap}
.k-pager b{color:var(--text)}
.k-pager-btns{margin-left:auto;display:inline-flex;gap:4px}
.k-pager-btns a{padding:5px 12px;border-radius:999px;background:var(--k-sunken);color:var(--text-muted);font-weight:700}
.k-pager-btns a.is-on{background:var(--selected-bg);color:var(--selected-fg)}

/* ---------- totals (small table, right-aligned under the table) ---------- */
.k-totals{display:flex;flex-direction:column;align-items:flex-end;gap:4px;margin-top:10px;padding-top:10px;border-top:1.5px solid var(--border-idle);font-size:13.5px}
.k-totals-window{font-size:12.5px;color:var(--text-muted);margin-bottom:4px;font-variant-numeric:tabular-nums}
.k-totals table{border-collapse:collapse}
.k-totals th{font-size:11.5px;letter-spacing:.07em;font-weight:700;color:var(--text-muted);text-align:right;padding:2px 14px 2px 0;text-transform:uppercase;white-space:nowrap}
.k-totals td{font-weight:650;min-width:100px;text-align:right;padding:2px 0;font-variant-numeric:tabular-nums;white-space:nowrap}
.k-totals tr.is-net td{font-size:15px;font-weight:800;color:var(--text)}
.k-totals tr.is-sub th,.k-totals tr.is-sub td{color:var(--tab-fg);font-weight:600}
.k-totals-pills{display:flex;gap:8px;align-items:center;margin-top:6px;flex-wrap:wrap;justify-content:flex-end}

/* ---------- state pills: green paid · amber waiting/Held · red unpaid/problem · blue info ---------- */
.k-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:999px;font-size:11.5px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums;background:var(--k-slate-bg);color:var(--cat-slate-fg);line-height:1.35}
.k-pill.lg{padding:6px 12px;font-size:12.5px}
.k-pill.is-green{background:var(--success-bg);color:var(--success-fg)}
.k-pill.is-amber{background:var(--warning-bg);color:var(--k-amber)}
.k-pill.is-red{background:var(--danger-bg);color:var(--k-red-soft)}
.k-pill.is-blue{background:var(--k-tint);color:var(--tint-fg)}
.k-pill.is-orange{background:var(--cat-orange-bg);color:var(--cat-orange-fg)}
.k-pill.is-teal{background:var(--k-teal-bg);color:var(--k-teal-2)}
.k-pill.is-muted{background:var(--k-slate-bg);color:var(--cat-slate-fg)}
.k-pill-ring{width:8px;height:8px;border-radius:50%;border:2px solid currentColor;box-sizing:border-box;flex:none}
.k-pill-fill{width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}

/* ---------- tab strip ---------- */
.k-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:2px 0}
.k-tabs a,.k-tabs button{padding:7px 14px;border-radius:999px;font-weight:650;background:transparent;color:var(--tab-fg);border:0;font:inherit;font-weight:650;cursor:pointer;white-space:nowrap}
.k-tabs [aria-current="page"],.k-tabs [aria-selected="true"]{background:var(--selected-bg);color:var(--selected-fg)}
.k-tabs.is-phone{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:6px;font-size:13.5px}
.k-tabs.is-phone a,.k-tabs.is-phone button{flex:none;padding:7px 13px;background:var(--surface)}
.k-tabs.is-phone [aria-current="page"]{background:var(--selected-bg);font-weight:700}

/* ---------- period segmented picker 7 · 30 · 60 Days · All + range + Compare ---------- */
.k-period{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.k-range{font-size:13px;color:var(--text-muted);font-variant-numeric:tabular-nums}
.k-range b{color:var(--text)}
/* THE segmented switch (owner 2026-10-24): one bordered pill holding every option, equal-width
   slots, a highlight (the ::before thumb) that slides to the pressed option like a real switch.
   Markup: <div class="k-seg [is-phone]" role="group" aria-label="…"><button aria-pressed="true|false">…
   (or .is-on). Two to six options. --n / --i come from :has(); ui.js keeps the slide when a page
   re-draws the seg on click. is-phone stretches to the row; desktop shrinks to its options. */
.k-seg{--n:2;--i:0;position:relative;isolation:isolate;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:stretch;
  width:max-content;min-width:max-content;box-sizing:border-box;background:var(--k-sunken);border:1px solid var(--border-idle);border-radius:999px;padding:3px;gap:0}   /* never squeezes its labels (min-width) */
.k-seg::before{content:"";position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc((100% - 6px) / var(--n));border-radius:999px;
  background:var(--selected-bg);box-shadow:var(--shadow-card);transform:translateX(calc(var(--i) * 100%));transition:transform .22s cubic-bezier(.3,.7,.2,1);pointer-events:none}
.k-seg:not(:has(>[aria-pressed="true"],>.is-on))::before{display:none}
.k-seg>button,.k-seg>a{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;box-sizing:border-box;
  border:0;background:transparent;color:var(--tab-fg);font:inherit;font-weight:650;padding:7px 18px;border-radius:999px;cursor:pointer;white-space:nowrap;text-align:center;text-decoration:none}
.k-seg>[aria-pressed="true"],.k-seg>.is-on{background:transparent;color:var(--selected-fg);font-weight:700;box-shadow:none}
@media (hover:hover){.k-seg>button:not([aria-pressed="true"]):not(:disabled):hover,.k-seg>a:not(.is-on):hover{color:var(--text)}}
.k-seg>:disabled{opacity:.45;cursor:not-allowed}
.k-seg:has(>:nth-child(3)){--n:3}.k-seg:has(>:nth-child(4)){--n:4}.k-seg:has(>:nth-child(5)){--n:5}.k-seg:has(>:nth-child(6)){--n:6}
.k-seg:has(>:nth-child(2):is([aria-pressed="true"],.is-on)){--i:1}.k-seg:has(>:nth-child(3):is([aria-pressed="true"],.is-on)){--i:2}
.k-seg:has(>:nth-child(4):is([aria-pressed="true"],.is-on)){--i:3}.k-seg:has(>:nth-child(5):is([aria-pressed="true"],.is-on)){--i:4}
.k-seg:has(>:nth-child(6):is([aria-pressed="true"],.is-on)){--i:5}
.k-seg.is-slide::before{animation:k-seg-slide .22s cubic-bezier(.3,.7,.2,1)}
@keyframes k-seg-slide{from{transform:translateX(calc(var(--from, 0) * 100%))}}
@media (prefers-reduced-motion:reduce){.k-seg::before{transition:none}.k-seg.is-slide::before{animation:none}}
.k-seg.is-phone{width:auto}
.k-seg.is-phone>button,.k-seg.is-phone>a{padding:0 14px;font-size:14px}
/* phone: a switch in a card head takes its own row under the title (the head never squeezes the title into broken words) */
.k-phone .k-card-head:has(>.k-card-actions>.k-seg.is-phone){flex-wrap:wrap}
.k-phone .k-card-actions:has(>.k-seg.is-phone){flex:1 1 100%;margin-left:0;justify-content:flex-start}
.k-switch{border:0;background:var(--surface);color:var(--selected-fg);font:inherit;font-weight:700;padding:4px 4px 4px 12px;border-radius:999px;display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.k-switch[aria-checked="false"]{color:var(--text-muted)}
.k-track{width:34px;height:20px;border-radius:999px;background:var(--border-idle);position:relative;display:block;flex:none}
.k-track::after{content:"";position:absolute;top:50%;left:2px;width:16px;height:16px;margin-top:-8px;border-radius:50%;background:#fff}
[aria-checked="true"]>.k-track{background:var(--pair1-bg)}
[aria-checked="true"]>.k-track::after{left:16px}

/* ---------- legend + swatches (fill classes double as stacked-bar segments) ---------- */
.k-legend{display:inline-flex;align-items:center;gap:12px;font-size:12px;color:var(--text-muted);font-weight:600;flex-wrap:wrap}
.k-legend>span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.k-sw{width:9px;height:9px;border-radius:2px;display:inline-block;flex:none;background:var(--border-idle)}
.f-green{background:var(--success-ring)}.f-blue{background:var(--k-blue)}.f-amber{background:var(--k-amber)}.f-red{background:var(--danger-fg)}.f-muted{background:var(--border-idle)}
.f-teal{background:var(--k-teal)}.f-indigo{background:var(--k-indigo)}.f-orange{background:var(--k-orange)}.f-purple{background:var(--k-purple)}.f-sky{background:var(--k-sky)}
.f-a,.f-k,.f-u{background:var(--success-ring)}.f-b,.f-l,.f-v{background:var(--k-indigo)}.f-c,.f-m,.f-w{background:var(--k-orange)}
/* R41: class fills D–J (K onward cycles) — the class's own --cls-<x>-fg */
.f-d,.f-n,.f-x{background:var(--cls-d-fg)}.f-e,.f-o,.f-y{background:var(--cls-e-fg)}.f-f,.f-p,.f-z{background:var(--cls-f-fg)}.f-g,.f-q{background:var(--cls-g-fg)}.f-h,.f-r{background:var(--cls-h-fg)}.f-i,.f-s{background:var(--cls-i-fg)}.f-j,.f-t{background:var(--cls-j-fg)}

/* ---------- stacked bar (horizontal composition; rounded at the two ends only) ---------- */
.k-bar{display:flex;width:100%;height:8px;border-radius:999px;background:var(--k-sunken);overflow:hidden;gap:1px}
.k-bar.lg{height:12px}
.k-bar>span{display:block;min-width:2px}
.k-bar-row{display:flex;align-items:center;gap:10px;font-size:12.5px}
.k-bar-row .k-bar{flex:1}
/* vertical stacked column chart: flat joins, only the top of the top segment rounded */
.k-cols{display:flex;align-items:flex-end;gap:6px;height:160px;border-bottom:1px solid var(--chart-grid);position:relative}
.k-col{flex:1;display:flex;flex-direction:column-reverse;min-width:0;height:100%;justify-content:flex-start}
.k-col>span{display:block;width:100%}
.k-col>span:last-child{border-radius:4px 4px 0 0}
.k-axis{display:flex;gap:6px;font-size:11px;color:var(--tab-fg);margin-top:6px}
.k-axis>span{flex:1;text-align:center}
.k-pop{position:relative;display:inline-flex;flex-direction:column;gap:3px;background:var(--surface);color:var(--text-secondary);border:1px solid var(--chart-grid);border-radius:12px;padding:9px 12px;font-size:12.5px;line-height:1.4;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);font-variant-numeric:tabular-nums;z-index:2}
.k-pop b{color:var(--text)}

/* ---------- identity: monogram tile · initials avatar · A/B/C class square · batch-code pill ---------- */
.k-mono{width:28px;height:28px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:10.5px;flex:none;background:var(--k-tint);color:var(--tint-fg);line-height:1}
.k-mono.lg{width:40px;height:40px;border-radius:12px;font-size:13px}
.k-mono.xl{width:52px;height:52px;border-radius:15px;font-size:0}   /* owner 2026-11-01 (chooser ruling 4): the main door's tile — the LMP gradient square alone, bigger, no letters */
.k-mono.sm{width:22px;height:22px;border-radius:7px;font-size:10px}
.k-mono.xs{width:18px;height:18px;border-radius:5px;font-size:8.5px}
.k-avatar{width:30px;height:30px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:11.5px;flex:none;background:var(--cat-violet-bg);color:var(--cat-violet-fg);line-height:1}
.k-avatar.sm{width:24px;height:24px;font-size:10px}.k-avatar.lg{width:40px;height:40px;font-size:13px}
.fac-cot{background:var(--k-pink-bg);color:var(--k-pink-fg)}
.fac-zna{background:var(--tag-blue-bg);color:var(--tag-blue-fg)}
.fac-bb{background:var(--cat-violet-bg);color:var(--cat-violet-fg)}
.fac-pk{background:var(--k-gold-bg);color:var(--k-gold-fg)}
/* The owner's square is the violet gradient everywhere (owner 2026-10-30; the baseline's teal LP tile is retired) */
.fac-lp,.fac-lmp{background:linear-gradient(135deg,var(--pair1-bg),var(--k-violet));color:#fff}
.k-class{width:20px;height:20px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:11px;flex:none;line-height:1;box-shadow:inset 0 0 0 1px var(--k-class-bd,rgba(15,23,42,.42))}   /* owner 2026-10-30: every class square carries a hairline — dark in light mode, light in dark mode. owner 2026-11-01 (round 3 §53): flex centring, not grid — the owner's iPhone left the letter in the top half of the square (older WebKit does not centre a bare text node in an inline-grid; the iOS 27 Simulator and Chromium do) */
.k-class.is-sm{width:16px;height:16px;border-radius:5px;font-size:9.5px;vertical-align:-3px;margin-right:5px}   /* round 3 item 3: the square inside a sub line */
.k-chip.is-sq{padding-left:8px;padding-right:8px}.k-chip.is-sq .k-class{margin:0}   /* round 3 item 7: a class chip is the square alone */
/* R41 (owner 2026-10-22): a class is ANY letter. One fixed colour per letter, everywhere:
   A green · B indigo · C orange · D red · E purple (orchid) · F teal · G pink · H gold · I sky ·
   J slate; K onward cycles the ten (the letter still tells them apart). Kit: kit.css .k-class.is-d…j. */
:root[data-shell]{--cls-a-bg:var(--success-bg);--cls-a-fg:var(--success-fg);--cls-b-bg:var(--cat-indigo-bg);--cls-b-fg:var(--cat-indigo-fg);--cls-c-bg:var(--cat-orange-bg);--cls-c-fg:var(--cat-orange-fg);
  --cls-d-bg:#fddcdb;--cls-d-fg:#c4181a;--cls-e-bg:#f4e8fb;--cls-e-fg:#8a2fb5;--cls-f-bg:#dcf7f1;--cls-f-fg:#0f766e;--cls-g-bg:#fbe7f1;--cls-g-fg:#b0317a;
  --cls-h-bg:#fbf0d4;--cls-h-fg:#8a6a00;--cls-i-bg:#e3f2fd;--cls-i-fg:#1d6fb8;--cls-j-bg:#e9edf3;--cls-j-fg:#46546b}
:root[data-shell][data-theme="dark"]{--cls-d-bg:#3a1a1c;--cls-d-fg:#ff7a70;--cls-e-bg:#33203f;--cls-e-fg:#d08cf5;--cls-f-bg:#0b3433;--cls-f-fg:#2dd4bf;--cls-g-bg:#3a1a2c;--cls-g-fg:#f5a3cd;
  --cls-h-bg:#3b2f12;--cls-h-fg:#e8c06a;--cls-i-bg:#132a44;--cls-i-fg:#8fd3f5;--cls-j-bg:#222c40;--cls-j-fg:#b4c0d6}
.k-class.is-a,.k-class.is-k,.k-class.is-u{background:var(--cls-a-bg);color:var(--cls-a-fg)}
.k-class.is-b,.k-class.is-l,.k-class.is-v{background:var(--cls-b-bg);color:var(--cls-b-fg)}
.k-class.is-c,.k-class.is-m,.k-class.is-w{background:var(--cls-c-bg);color:var(--cls-c-fg)}
.k-class.is-d,.k-class.is-n,.k-class.is-x{background:var(--cls-d-bg);color:var(--cls-d-fg)}
.k-class.is-e,.k-class.is-o,.k-class.is-y{background:var(--cls-e-bg);color:var(--cls-e-fg)}
.k-class.is-f,.k-class.is-p,.k-class.is-z{background:var(--cls-f-bg);color:var(--cls-f-fg)}
.k-class.is-g,.k-class.is-q{background:var(--cls-g-bg);color:var(--cls-g-fg)}
.k-class.is-h,.k-class.is-r{background:var(--cls-h-bg);color:var(--cls-h-fg)}
.k-class.is-i,.k-class.is-s{background:var(--cls-i-bg);color:var(--cls-i-fg)}
.k-class.is-j,.k-class.is-t{background:var(--cls-j-bg);color:var(--cls-j-fg)}
/* Round 3 item 15 (owner 2026-10-29): THE batch-id chip — the purple pair the owner picked (light + dark),
   one standard wherever a batch id is a chip. Blue stays for links and actions. */
.k-code{display:inline-flex;align-items:center;padding:1px 8px;border-radius:999px;background:var(--k-code-bg);color:var(--k-code-fg);box-shadow:inset 0 0 0 1px var(--k-code-bd);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:700;white-space:nowrap;text-decoration:none}
a.k-code:hover{filter:brightness(.96)}
:root[data-shell][data-theme="dark"] a.k-code:hover{filter:brightness(1.15)}
.k-ident{display:flex;align-items:center;gap:9px;min-width:0;color:var(--text)}
.k-ident>span:last-child{min-width:0;line-height:1.25}
.k-ident .sub{display:block;font-size:11.5px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- banded date-group header (Cash Received pattern) ---------- */
.k-band{display:flex;align-items:baseline;gap:10px;background:var(--k-band-bg);border-radius:10px;padding:9px 12px;border-left:3px solid var(--text-label)}
.k-band-date{font-size:15px;font-weight:800;color:var(--text);letter-spacing:-.005em;font-variant-numeric:tabular-nums}
.k-band-year{font-size:12px;font-weight:650;color:var(--text-muted)}
.k-band-total{margin-left:auto;display:flex;align-items:baseline;gap:8px}
.k-band-total>span{font-size:11px;letter-spacing:.08em;font-weight:700;color:var(--text-muted);text-transform:uppercase}
.k-band-total>b{font-size:14.5px;font-weight:800;color:var(--text);font-variant-numeric:tabular-nums}
.k-table td.k-band-cell{padding:4px 0 8px;border-top:0}

/* ---------- dashed "needs" tag (data the app does not capture yet) ---------- */
.k-needs{font-size:11.5px;border:1px dashed var(--disclosure-ring);border-radius:6px;padding:0 6px;color:var(--tint-fg);white-space:nowrap;font-weight:600;display:inline-block;line-height:1.5}
.k-needs-box{border:1px dashed var(--disclosure-ring);border-radius:14px;padding:12px 14px;color:var(--text-secondary);font-size:12.5px;display:flex;flex-direction:column;gap:6px}
.k-needs-what{font-size:12px;color:var(--text-muted)}

/* ---------- empty state ---------- */
/* ONE empty state [f3-46]: muted, compact, left-aligned — the same as 'No note yet.' (no big centred icon block) */
.k-empty{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:2px;padding:10px 0 6px;color:var(--text-muted);font-size:12.5px}
.k-empty-icon{display:none}
.k-empty-icon svg{width:18px;height:18px}
.k-empty b{color:var(--text-secondary);font-size:13.5px;font-weight:600}
.empty-box{text-align:left!important;padding:10px 0 6px!important}
.empty-box h3{font-size:13.5px!important;font-weight:600;color:var(--text-secondary);margin:0 0 2px!important}
.empty-box p{font-size:12.5px!important;margin:0!important}

/* ---------- notices ---------- */
.k-note{border-radius:12px;padding:10px 12px;font-size:12.5px;line-height:1.45;background:var(--k-tint);color:var(--text-secondary)}
.k-note.is-amber{background:var(--warning-bg);color:var(--k-gold-fg)}
.k-note.is-red{background:var(--danger-bg);color:var(--k-red-soft)}
.k-note.is-green{background:var(--success-bg);color:var(--cat-green-fg)}

/* ---------- desktop dialog (drawn open) and phone bottom sheet ---------- */
.k-backdrop{background:rgba(10,16,30,.72);background:color-mix(in srgb,var(--bg-sidebar) 72%,transparent);border-radius:18px;padding:28px;display:grid;place-items:center}
.k-backdrop.is-phone{padding:60px 0 0;border-radius:0;place-items:end center}
.k-dialog{width:560px;max-width:100%;box-sizing:border-box;background:var(--surface);border:1px solid var(--chart-grid);border-radius:22px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);display:flex;flex-direction:column;color:var(--text);text-align:left}
.k-dialog.wide{width:760px}
.k-dialog-head{display:flex;align-items:center;gap:12px;padding:18px 22px 12px}
.k-dialog-title{font-size:18px;font-weight:760;margin:0;line-height:1.25}
.k-dialog-sub{font-size:12.5px;color:var(--text-muted)}
.k-close{margin-left:auto;width:32px;height:32px;border-radius:50%;background:var(--k-sunken);box-shadow:inset 0 0 0 1px var(--k-line);color:var(--text-muted);display:grid;place-items:center;border:0;cursor:pointer;flex:none;font-size:16px;line-height:1}
.k-dialog-body{display:flex;flex-direction:column;gap:14px;padding:6px 22px 18px}
.k-dialog-foot{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 22px;border-top:1px solid var(--k-line)}
.k-dialog-foot .k-foot-note{margin-right:auto;font-size:12px;color:var(--text-muted)}
.k-sheet{width:390px;max-width:100%;box-sizing:border-box;background:var(--surface);border-radius:26px 26px 0 0;padding:8px 16px 18px;display:flex;flex-direction:column;gap:14px;color:var(--text);box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow)}
.k-sheet-grab{width:40px;height:5px;border-radius:3px;background:var(--border-idle);margin:4px auto 2px;flex:none}
.k-sheet-title{font-size:18px;font-weight:760;text-align:center;margin:0}
.k-sheet-sub{font-size:13px;color:var(--text-muted);text-align:center;margin-top:-10px}
.k-sheet-foot{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.k-sheet .k-input,.k-sheet .k-select,.k-sheet .k-textarea{font-size:16px;min-height:48px}
.k-confirm{background:var(--k-sunken);box-shadow:inset 0 0 0 1px var(--k-line);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:6px;font-size:13.5px}
.k-confirm-row{display:flex;justify-content:space-between;gap:12px;font-variant-numeric:tabular-nums}
.k-confirm-row>span:first-child{color:var(--text-muted)}
.k-confirm-row.is-total{border-top:1px solid var(--border-idle);padding-top:6px;font-weight:800}
.k-confirm-row.is-amber>span{color:var(--k-gold-fg)}   /* round 2 §2f: the overpayment row */
html[data-shell="phone"] .k-sl-ctl>.k-input{min-height:44px;height:44px}

/* ---------- fields ---------- */
.k-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.k-label{font-size:12.5px;font-weight:650;color:var(--text-muted);min-height:20px;display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}   /* round 2 §2b: labels with and without an ⓘ sit at one height */
.k-label .req{color:var(--k-red-soft);margin-left:2px}
.k-hint{font-size:12px;color:var(--tab-fg)}
.k-err{font-size:12px;color:var(--danger-fg);font-weight:600}
/* a dialog/sheet error scrolled into view stops clear of the pinned footer [f2-08] */
:is(.k-sheet,.sheet,.k-dialog,.modal) [role="alert"]{scroll-margin-bottom:140px;scroll-margin-top:72px}
:is(.k-dialog,.modal):not(.k-sheet) [role="alert"]{scroll-margin-bottom:12px}
.k-input,.k-select,.k-textarea{width:100%;box-sizing:border-box;background:var(--k-sunken);border:1px solid var(--border-idle);border-radius:12px;padding:10px 12px;color:var(--text);font:inherit;font-size:14.5px;min-height:42px;display:flex;align-items:center;gap:8px}
.k-input.is-error,.k-select.is-error{border-color:var(--danger-fg)}
/* Round 3 item 5: iOS draws a date input as a wide, short pill unless appearance is reset — same height and width as the text boxes. */
input.k-input:is([type=date],[type=time]){display:block;-webkit-appearance:none;appearance:none;height:42px;min-height:42px;width:100%;max-width:100%;line-height:20px;text-align:left}
input.k-input:is([type=date],[type=time])::-webkit-date-and-time-value{text-align:left;height:20px;line-height:20px}
html[data-shell="phone"] input.k-input:is([type=date],[type=time]){height:44px;min-height:44px}
.k-input:focus-visible,.k-select:focus-visible,.k-textarea:focus-visible,.k-input.is-focus{outline:2px solid var(--text-label);outline-offset:1px}
.k-input .pre,.k-input .post{color:var(--tab-fg);flex:none}
.k-input.is-placeholder,.k-placeholder{color:var(--tab-fg)}
.k-textarea{min-height:80px;align-items:flex-start;resize:vertical}
.k-select{position:relative;padding-right:34px;cursor:pointer}
.k-select::after{content:"";position:absolute;right:14px;top:50%;width:7px;height:7px;border-right:2px solid var(--tint-fg);border-bottom:2px solid var(--tint-fg);transform:translateY(-70%) rotate(45deg)}
.k-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.k-row.c3{grid-template-columns:1fr 1fr 1fr}
.k-sheet .k-row{grid-template-columns:1fr}
.k-sheet .k-row.keep{grid-template-columns:1fr 1fr}
.k-check{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text-secondary);cursor:pointer}
.k-box{width:18px;height:18px;border-radius:5px;border:1.5px solid var(--disclosure-ring);display:inline-grid;place-items:center;flex:none;box-sizing:border-box;line-height:0;font-size:0;vertical-align:middle}
.k-box svg{width:12px;height:12px;display:block}
.k-box.is-on{background:var(--pair1-bg);border-color:var(--pair1-bg);color:#fff}
.k-toggle{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text-secondary);border:0;background:transparent;font:inherit;padding:0;cursor:pointer;text-align:left}
.k-stepper{display:inline-flex;align-items:center;background:var(--k-sunken);border:1px solid var(--border-idle);border-radius:12px;overflow:hidden}
.k-stepper button{width:36px;height:38px;border:0;background:transparent;color:var(--tint-fg);font:inherit;font-size:18px;font-weight:700;cursor:pointer}
.k-stepper span{min-width:44px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}
/* round 2 item 32 (owner 2026-10-28): every stepper takes a typed number too */
.k-stepper input.k-qin{width:52px;min-width:0;height:38px;text-align:center;border:0;background:transparent;color:var(--text);font:inherit;font-weight:700;font-variant-numeric:tabular-nums;padding:0;-moz-appearance:textfield;box-sizing:border-box}
.k-stepper input.k-qin::-webkit-inner-spin-button,.k-stepper input.k-qin::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.k-stepper input.k-qin:disabled{opacity:.5}
.k-lsheet .k-stepper input.k-qin{height:44px;width:60px;font-size:16px}
.k-lines{display:flex;flex-direction:column;gap:8px}
.k-line{display:flex;align-items:center;gap:10px;background:var(--k-line-card);border:1px solid var(--k-line-card-bd);border-radius:12px;padding:8px 10px;font-size:13.5px}   /* round 2 §14: bordered card, not a grey fill */
.k-line .k-line-main{flex:1;min-width:0}
/* round 2 §13: ONE line renderer (Shell.saleLine) for Direct Sale, Transfer, Settle … */
.k-line.k-sl{flex-direction:column;align-items:stretch;gap:8px;padding:10px 12px}
.k-sl-top{display:flex;gap:8px;align-items:flex-start}
.k-sl-top .k-line-main .sub{margin-top:2px}
.k-sl-x{width:28px;height:28px;border-radius:50%;border:0;background:transparent;color:var(--text-muted);font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 28px;margin:-4px -6px 0 0}
@media (hover:hover){.k-sl-x:hover{background:var(--hover-bg);color:var(--text)}}
.k-sl-ctl{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.k-sl-ctl>.k-input,.k-sl-ctl>input.k-input{flex:1;min-width:110px;box-sizing:border-box;min-height:40px;height:40px;padding-top:0;padding-bottom:0}
.k-sl-foot{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:12.5px;color:var(--text-muted)}
.k-sl-foot b{color:var(--text);font-size:14px}
.k-table td.k-sl-cell{vertical-align:middle}
.k-table .k-sl-x{margin:0}
.k-line .k-line-main .sub{display:block;font-size:11.5px;color:var(--text-muted)}

/* ---------- app bottom tabs (Sell app · Field console) ---------- */
.k-apptabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;background:var(--surface);border-radius:16px;padding:4px}
.k-apptabs a{min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:12px;color:var(--tab-fg);font-size:11px;font-weight:650}
.k-apptabs a svg{width:18px;height:18px}
.k-apptabs a[aria-current="page"]{background:var(--selected-bg);color:var(--selected-fg);font-weight:750}

/* ================= v31 platform additions (P-5 · A7 · M-rules · shell) ================= */
/* P-5 checkbox / radio / toggle: the mark is drawn, never a text glyph, so it sits dead centre at any line-height.
   Checkbox: <span class="k-box is-on"><svg viewBox="0 0 16 16"…><path d="M3.5 8.4 6.6 11.4 12.5 4.9"/></svg></span>
   (proto normalize() converts any <span class="k-box …">✓</span> to this). Radio: <span class="k-radio is-on"></span>. */
.k-radio{width:18px;height:18px;border-radius:50%;border:1.5px solid var(--disclosure-ring);display:inline-grid;place-items:center;flex:none;box-sizing:border-box;line-height:0;vertical-align:middle}
.k-radio.is-on{border-color:var(--pair1-bg)}
.k-radio.is-on::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--pair1-bg);display:block}

/* A7 custom date range: the shown range is a tappable chip that opens a From–To picker (desktop popover · phone sheet) */
.k-range-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border-idle);background:var(--surface);color:var(--text-muted);font:inherit;font-size:13px;padding:5px 12px;border-radius:999px;cursor:pointer;white-space:nowrap;font-variant-numeric:tabular-nums}
.k-range-chip b{color:var(--text);font-weight:700}
.k-range-chip svg{width:14px;height:14px;flex:none;color:var(--tint-fg)}
.k-range-chip:hover,.k-range-chip[aria-expanded="true"]{border-color:var(--text-label)}
.k-range-chip:focus-visible{outline:2px solid var(--text-label);outline-offset:2px}
.k-range.k-has-chip{position:relative}
.k-datepick{background:var(--surface);border:1px solid var(--chart-grid);border-radius:18px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);padding:16px;display:flex;flex-direction:column;gap:14px;color:var(--text);font-size:13px;width:560px;max-width:100%;box-sizing:border-box;text-align:left}
.k-datepick.is-pop{position:absolute;z-index:8;top:calc(100% + 8px);left:0}
.k-datepick-presets{display:flex;gap:6px;flex-wrap:wrap}
.k-datepick-months{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.k-datepick.is-phone{width:100%;padding:0;border:0;box-shadow:none;background:transparent}
.k-datepick.is-phone .k-datepick-months{grid-template-columns:1fr}
.k-cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px 0;text-align:center;font-variant-numeric:tabular-nums}
.k-cal-title{grid-column:1 / -1;font-weight:750;font-size:13.5px;padding-bottom:6px;text-align:left}
.k-cal-dow{font-size:11px;letter-spacing:.06em;font-weight:700;color:var(--tab-fg);padding:4px 0}
.k-cal-d{height:32px;display:grid;place-items:center;color:var(--text-secondary);font-size:13px}
.k-cal-d.is-out{color:transparent}
.k-cal-d.is-in{background:var(--selected-bg);color:var(--selected-fg)}
.k-cal-d.is-from,.k-cal-d.is-to{background:var(--pair1-bg);color:#fff;font-weight:750}
.k-cal-d.is-from{border-radius:999px 0 0 999px}.k-cal-d.is-to{border-radius:0 999px 999px 0}
.k-cal-d.is-later{color:var(--border-idle)}
.is-phone .k-cal-d{height:40px;font-size:14px}
.k-datepick-foot{display:flex;align-items:center;gap:10px;justify-content:flex-end}
.k-datepick-foot .k-foot-note{margin-right:auto;font-size:12px;color:var(--text-muted)}

/* account menu (desktop header avatar) + workspace popover (aside org block) */
.k-acct{position:relative;display:inline-flex}
.k-acct-btn{display:inline-flex;align-items:center;gap:10px;border:0;background:transparent;color:inherit;font:inherit;font-weight:650;padding:4px 8px 4px 4px;border-radius:999px;cursor:pointer}
.k-acct-btn:hover,.k-acct-btn[aria-expanded="true"]{background:var(--k-sunken)}
.k-acct-btn svg{width:14px;height:14px;color:var(--text-muted)}
.k-menu{position:absolute;z-index:9;top:calc(100% + 8px);right:0;min-width:270px;background:var(--surface);border:1px solid var(--chart-grid);border-radius:16px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);padding:8px;display:flex;flex-direction:column;gap:2px;color:var(--text);font-size:13.5px;font-weight:500;text-align:left}
.k-menu.is-up{top:auto;bottom:calc(100% + 8px);left:0;right:auto}
.k-menu.is-static{position:relative;top:auto;right:auto}
.k-menu.is-fixed{position:fixed;top:auto;right:auto;z-index:120}
/* Round 3 item 10: the shell search dropdown — record links, grouped. */
.k-search-pop{max-height:min(70vh,560px);overflow:auto;min-width:320px;max-width:min(480px,calc(100vw - 16px));padding:6px}
.k-search-g{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);padding:8px 10px 3px}
.k-search-it{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:10px;text-decoration:none;color:var(--text);font-weight:600;min-width:0}
.k-search-it:hover,.k-search-it.is-on{background:var(--k-sunken)}
.k-search-it .sub{font-size:12px;color:var(--text-muted);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.k-search-it .k-code{flex:none}
.k-search-foot{font-size:12px;color:var(--text-muted);padding:8px 10px 4px;border-top:1px solid var(--k-line);margin-top:4px}   /* round 2 §10: placed from the button, never from the sticky bar */
.k-menu-head{padding:8px 10px 10px;border-bottom:1px solid var(--k-line);margin-bottom:4px;color:var(--text-muted);font-size:12.5px}
.k-menu-head b{display:block;color:var(--text);font-size:14px;margin-top:2px}
.k-menu-item{display:flex;align-items:center;gap:10px;min-height:38px;padding:0 10px;border-radius:10px;color:var(--text);cursor:pointer;white-space:nowrap}
.k-menu-item:hover{background:var(--k-sunken)}
.k-menu-item.is-current{box-shadow:inset 0 0 0 1.5px var(--text-label)}
.k-menu-item .sub{margin-left:auto;font-size:12px;color:var(--text-muted)}
.k-menu-item.is-danger{color:var(--k-red-soft)}
.k-menu-sep{height:1px;background:var(--k-line);margin:4px 6px}
.k-menu-theme{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:40px;padding:0 10px}
.k-minseg{display:inline-flex;background:var(--k-sunken);border:1px solid var(--border-idle);border-radius:999px;padding:3px}
.k-minseg button,.k-minseg span{border:0;background:transparent;color:var(--text-muted);font:inherit;font-size:12.5px;font-weight:650;padding:4px 10px;border-radius:999px;cursor:pointer}
.k-minseg .is-on{background:var(--selected-bg);color:var(--selected-fg)}

/* View-as banner (read-only console viewed by the owner) */
.k-viewas{display:flex;align-items:center;gap:10px;background:var(--warning-bg);color:var(--k-gold-fg);border-radius:12px;padding:8px 12px;font-size:13px;font-weight:650}
.k-viewas .k-btn{margin-left:auto;background:var(--k-gold-bg);color:var(--k-amber)}

/* ---------- phone (M-rules). proto.mjs adds class="k-phone" to every phone fragment root ---------- */
/* M-3 one-line horizontal scroll strip with a right-edge fade, for tab strips and filter chips */
.k-scroll,.k-tabs.is-phone,.k-filters.is-phone{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;gap:6px;padding-right:28px;-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}
.k-scroll::-webkit-scrollbar,.k-tabs.is-phone::-webkit-scrollbar,.k-filters.is-phone::-webkit-scrollbar{display:none}
.k-scroll>*,.k-tabs.is-phone>*,.k-filters.is-phone>*{flex:none}
.k-filters.is-phone{margin:0}
/* M-3 period picker on phone: 7D · 30D · 60D · All (normalize() shortens "N Days" inside a phone Period seg) */
.k-seg.is-phone>button,.k-seg.is-phone>a{white-space:nowrap;min-height:40px}
/* M-2 minimum sizes · M-4 buttons never wrap · M-5 tap targets ≥ 40 px */
.k-phone .k-btn{white-space:nowrap;min-height:40px}
.k-phone .k-btn.block{min-height:50px}   /* owner 2026-10-31: a full-width button is 50px everywhere on the phone (the Field Today card's New Field Sale read 40px) */
.k-phone .k-btn.sm{min-height:40px;padding:8px 14px;font-size:13px}
.k-phone .k-chip,.k-phone .k-tabs a,.k-phone .k-tabs button,.k-phone a.k-pill,.k-phone button.k-pill,.k-phone .k-range-chip{min-height:40px;box-sizing:border-box}
.k-phone .k-chip{font-size:13px;padding:6px 14px}
/* V32-4 text centred in every phone control (owner 2026-10-21): M-5 gave these min-height:40px while some stayed
   display:block, so the text sat ~6-8 px high. Flex-centre them and drop vertical padding (min-height sets the box).
   The last selector covers inline-styled legacy anchors that carry their own min-height and no display. Lint:
   scratchpad/v32lint/run.sh measures |top gap - bottom gap| on every phone control (> 2 px = fail). */
.k-phone .k-tabs a,.k-phone .k-tabs button,.k-phone .k-chip,.k-phone a.k-pill,.k-phone button.k-pill,.k-phone .k-range-chip,.k-seg.is-phone button,.k-phone .k-seg button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding-top:0;padding-bottom:0;min-height:40px;box-sizing:border-box}
.k-phone a[style*="min-height"]:not([style*="display"]):not([class]),.k-phone span[role="button"][style*="min-height"]:not([style*="display"]){display:inline-flex;align-items:center;justify-content:center;gap:6px}
.k-phone .k-pill{display:inline-flex;align-items:center;justify-content:center}
.k-phone .k-pill{font-size:12px}
.k-phone .k-table th{font-size:11.5px}
.k-phone .k-table td{font-size:13px}
.k-phone .k-table td.sub,.k-phone .k-table .sub,.k-phone .k-line .k-line-main .sub,.k-phone .k-ident .sub{font-size:12px}
.k-phone .k-needs{font-size:12px}
.k-phone .k-axis{font-size:11px}
.k-phone .k-legend{font-size:12px}
.k-phone .k-hint,.k-phone .k-kpi-basis{font-size:12px}
.k-phone .k-apptabs a{font-size:12px;text-align:center;line-height:1.15}
.k-phone .k-band-total>span{font-size:11px}
/* M-7 KPI chips: figure + unit on one line, one basis line with ellipsis */
.k-phone .k-kpi-fig{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* M-8 card header: title + one short preview that truncates, never a second line */
.k-phone .k-card-head{flex-wrap:nowrap}
.k-phone .k-card-preview{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}
/* M-6 stacked list row (phone replacement for a wide table): name/document left · figure right · one muted line */
.k-prow{display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 0;border-top:1px solid var(--k-line)}
.k-prow:first-child{border-top:0}
.k-prow-main{flex:1;min-width:0}
.k-prow-main>b,.k-prow-main>a,.k-prow-main>.k-prow-name{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;color:var(--text)}
.k-prow-main>.sub{display:block;font-size:12px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k-prow-fig{flex:none;white-space:nowrap;text-align:right;font-weight:750;font-variant-numeric:tabular-nums}
.k-prow-fig .sub{display:block;font-size:12px;color:var(--text-muted);font-weight:500}
/* M-4 one primary per section + "⋯ More" (header slot or beside the primary) opening an action sheet */
.k-actbar{display:flex;gap:8px;align-items:stretch}
.k-actbar>.k-btn{flex:1 1 auto;min-width:0}   /* owner 2026-11-03: the action fills the bar, ⋯ sits at the right edge */
/* Phone action dock (item 64, owner 2026-11-03: "Close out … seems to just refresh the page"). ONE kit bar for
   the phone's bottom actions (invoices + transfers records), fixed to the viewport with the page's 16px gutters;
   .k-dock-pad keeps the page's end clear of it. The root cause of the dead bar was NOT the bar: a close-out
   history row opened <a class="k-prow"> and closed with </div>, so the parser kept the link open and every tap
   on the bar was a tap on that same-page link (WebKit follows the link; Chromium happened to click the button).
   tests/phone_input_font.mjs now asserts no page nests a button, card, row or dock inside a link. */
.k-dock{position:fixed;left:0;right:0;bottom:0;z-index:12;margin:0 auto;max-width:var(--phone-max);box-sizing:border-box;padding:10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));background:var(--bg-page);box-shadow:0 -1px 0 var(--k-line)}
.k-dock-pad{height:calc(70px + env(safe-area-inset-bottom))}
.k-actbar>.k-btn.block{flex:1;min-width:0}
html[data-shell] .k-actbar>.k-btn.block{min-height:50px}   /* round 3 item 6: a page-header action is 50px on phone even when it stands alone (New Transfer read 41px) */
.k-more-btn{width:44px;height:44px;min-width:44px;border-radius:50%;border:0;background:var(--surface);box-shadow:inset 0 0 0 1px var(--border-idle);color:var(--text-secondary);display:grid;place-items:center;cursor:pointer;flex:none;padding:0;font:inherit;font-size:20px;font-weight:800;line-height:1;letter-spacing:.04em}
.k-actbar>.k-more-btn{height:auto;min-height:50px;border-radius:14px;width:50px}
.k-phead.has-more{grid-template-columns:44px 1fr 44px 44px}
.k-phead.has-more>.k-more-btn{justify-self:end;background:transparent;color:var(--tint-fg)}
.k-more-scrim{position:absolute;inset:0;background:rgba(10,16,30,.6);background:color-mix(in srgb,var(--bg-sidebar) 60%,transparent);z-index:6}
.k-more-sheet{position:absolute;left:0;right:0;bottom:0;z-index:7;background:var(--surface);border-radius:26px 26px 0 0;padding:8px 16px 18px;display:flex;flex-direction:column;gap:8px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow)}
.k-more-sheet.is-static{position:relative}
.k-more-sheet h3{font-size:13px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:var(--text-label);margin:8px 4px 2px}
.k-more-item{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 16px;border-radius:16px;background:var(--k-sunken);color:var(--text);font-size:16px;font-weight:600;cursor:pointer;border:0;font-family:inherit;text-align:left;width:100%;box-sizing:border-box}
.k-more-item.is-danger{color:var(--k-red-soft)}
.k-more-item .sub{margin-left:auto;font-size:12.5px;color:var(--text-muted);font-weight:500}

/* role-less shell pages (sign in · seat chooser) */
.k-door{min-height:860px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;padding:40px 16px;box-sizing:border-box}
.k-door.is-phone{min-height:780px;justify-content:flex-start;padding:56px 16px 28px}
.k-door-card{width:420px;max-width:100%;box-sizing:border-box;background:var(--surface);border-radius:24px;padding:28px;display:flex;flex-direction:column;gap:16px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow)}
.k-door.is-phone .k-door-card{padding:22px 18px;border-radius:22px}
.k-door-brand{display:flex;align-items:center;gap:12px}
.k-door-brand b{font-size:20px;font-weight:780}
.k-door-brand .sub{display:block;font-size:13px;color:var(--text-muted);font-weight:500}
.k-door-cap{font-size:11.5px;letter-spacing:.08em;font-weight:750;color:var(--tab-fg);text-transform:uppercase;text-align:center}
.k-seat{display:flex;align-items:center;gap:12px;min-height:64px;padding:10px 14px;border-radius:16px;background:var(--k-sunken);color:var(--text);box-sizing:border-box}
.k-seat:hover{box-shadow:inset 0 0 0 1.5px var(--text-label)}
.k-seat.is-current{box-shadow:inset 0 0 0 1.5px var(--text-label)}
.k-seat-main{flex:1;min-width:0}
.k-seat-main b{display:block;font-size:15.5px}
.k-seat-main .sub{display:block;font-size:12.5px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}


/* ==========================================================================
   SHELL v33.3 (B1, 2026-10-22) — the mock's aside, top bar and phone header
   (proto.mjs aside()/sheet()), the account + workspace menus (kit .k-menu),
   one chevron and one info control (BASELINE §2.6), the period picker on a
   phone, the door, and the shared.js dialog kit on a kit page.
   ========================================================================== */
:root[data-shell]{--page-max:1180px}
/* [hidden] always hides (fold bodies, door cards, ⋯ More sheets carry display rules) */
:where(html[data-shell]) [hidden]{display:none!important}

/* ---- desktop: aside 256 · top bar 64 · column 1180 (28 40 48) ---- */
.app.k-app-desk{display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);min-height:100vh}
.k-aside{background:var(--bg-sidebar);border-right:1px solid var(--k-line);padding:14px 12px;gap:2px;overflow-y:auto;
  scrollbar-width:thin;scrollbar-color:var(--border-idle) transparent}
.k-ws{display:flex;margin:0 0 10px}
.k-ws-btn{flex:1;gap:10px;padding:6px 8px;border-radius:12px;text-align:left;min-width:0}
.k-ws-btn .k-mono{width:32px;height:32px;border-radius:9px;font-size:12px}
.k-ws-name{display:flex;flex-direction:column;line-height:1.2;flex:1;min-width:0}
.k-ws-name b{font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k-ws-name span{font-size:12.5px;color:var(--text-muted);font-weight:500}
.k-ws-btn>svg{color:var(--text-muted);flex:none}
.k-ws .k-menu{left:0;right:auto;top:calc(100% + 2px);min-width:100%}
.k-menu .k-menu-item{width:100%;text-align:left;font:inherit;font-size:13.5px;border:0;background:transparent}
.k-menu-item.is-note{color:var(--text-muted);cursor:default}
.k-menu-item .k-mono{flex:none}
.k-nav{display:flex;flex-direction:column;gap:2px;flex:1;min-height:0}
.k-nav-item{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:12px;color:var(--text-secondary);font-weight:560;font-size:14.5px;line-height:1.3}
.k-nav-item svg{flex:none}
.k-nav-item[aria-current="page"],.k-fac-item[aria-current="page"]{background:var(--selected-bg);color:var(--selected-fg);font-weight:650}
@media (hover:hover){.k-nav-item:not([aria-current]):hover,.k-fac-item:not([aria-current]):hover{background:var(--hover-bg);color:var(--text)}}
.k-nav-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.k-nav-badge{margin-left:auto;font-size:12px;font-weight:700;color:var(--k-amber)}
.k-nav-group{font-size:11.5px;letter-spacing:.09em;font-weight:700;color:var(--tab-fg);padding:14px 10px 6px;text-transform:uppercase}
.k-fac-item{display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:10px;font-size:13.5px;color:var(--text-secondary)}
.k-fac-tail{margin-left:auto;display:flex;align-items:center;gap:6px;color:var(--text-muted);font-size:12.5px;white-space:nowrap}
.k-fac-dot{width:9px;height:9px;border-radius:50%;border:2.5px solid var(--border-idle);flex:none;box-sizing:border-box}
.k-fac-dot.is-amber{border-color:var(--k-amber)}.k-fac-dot.is-red{border-color:var(--danger-fg)}.k-fac-dot.is-green{border-color:var(--success-ring)}
.fac-field{background:var(--tag-blue-bg);color:var(--k-cyan)}
.k-topbar{display:flex;align-items:center;gap:16px;padding:0 40px;border-bottom:1px solid var(--k-line)}
.k-search-box{display:flex;align-items:center;gap:10px;width:440px;max-width:60%;height:42px;background:var(--surface);border-radius:14px;padding:0 14px;color:var(--text-muted);font-size:14px}
.k-search-box svg{flex:none}
.k-search-box input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--text);font:inherit;font-size:14px}
.k-search-box input:focus-visible{outline:none}
.k-search-box input::placeholder{color:var(--text-muted);opacity:1}
.k-search-box:focus-within{box-shadow:0 0 0 2px var(--text-label)}
.k-topbar-acct{margin-left:auto}
.k-acct-btn:focus-visible{outline:2px solid var(--text-label);outline-offset:2px}
/* LAYOUT-SPEC §4 (amended R55, owner 2026-10-24): content opens at 1120 and the
   ↔ control (--content-f, 0..1, set in <head> by layout.js) widens it up to the
   FULL column; the column is CENTRED in the space beside the sidebar. 100% is
   the .main column, so the page follows the browser; on a column narrower than
   1120 it simply fills it. --page-w is the page box (1120 + 80 padding). The top
   bar's search lines up with the centred content's left edge. */
.app.k-app-desk .main{--page-w:calc(1200px + max(0px, 100% - 1200px) * var(--content-f, 0))}
.app.k-app-desk .page{max-width:var(--page-w);margin:0 auto;padding:28px 40px 48px}
.app.k-app-desk .k-topbar{padding-left:max(40px, calc((100% - var(--page-w)) / 2 + 40px));padding-right:max(40px, calc((100% - var(--page-w)) / 2 + 40px))}
/* Prose never runs the whole width of a widened page (R55): explanations,
   notes and page sub-lines stop at a readable measure. */
.app.k-app-desk .k-page :where(p,.k-psub,.k-note,.k-empty-sub){max-width:88ch}
.k-page{display:flex;flex-direction:column;gap:18px;min-width:0}

/* ---- phone: k-phead (home · centred title · options) + Options sheet ---- */
.k-phone-shell{padding:env(safe-area-inset-top) env(safe-area-inset-right) calc(28px + env(safe-area-inset-bottom)) env(safe-area-inset-left)}
.k-phone-shell>.k-phead{padding:10px 16px 0;box-sizing:content-box}
.k-phead h1.k-phead-title{margin:0;line-height:1.2}
.k-phead>a,.k-phead>button{color:var(--tint-fg);border-radius:50%}
.k-phone-shell .k-page{gap:14px;padding:0 16px}
.k-phone-shell .k-psub{margin-top:-8px}
.k-opt-sheet h3{font-size:13px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:var(--text-label);margin:18px 4px 8px}
.k-opt{display:flex;align-items:center;gap:12px;width:100%;min-height:50px;padding:0 14px 0 14px;border-radius:14px;background:var(--k-sunken);
  color:var(--text);font-size:16px;font-weight:600;text-align:left}   /* round 2 §9: 48px rows, icon + left-aligned label, no chevron */
.k-opt>.k-nav-icon{flex:0 0 auto}
.k-opt>.k-nav-icon svg{width:20px;height:20px}
.k-opt+.k-opt{margin-top:6px}
.k-opt.is-current{box-shadow:inset 0 0 0 1.5px var(--text-label)}
.k-opt-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.k-opt-tag{font-size:12.5px;font-weight:600;color:var(--text-muted);border:1px solid var(--border-idle);border-radius:999px;padding:2px 10px;margin-right:4px;white-space:nowrap}
.k-opt .k-mono{width:24px;height:24px;font-size:10px}
.k-minseg.k-opt-seg{display:flex;width:100%;margin-bottom:6px}
.k-minseg.k-opt-seg button{flex:1;padding:0 8px;font-size:14px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;text-align:center}
.k-minseg button{text-align:center}
.k-opt-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:var(--text-muted);padding:14px 2px 0}
.k-opt-foot b{color:var(--text)}
.k-opt-signout{padding:0 14px;min-height:40px;border-radius:999px;background:var(--k-sunken);color:var(--text-secondary);font-weight:650;flex:none}
.k-opt-sheet .close-bar,.k-gsheet .close-bar{background:var(--k-sunken)}
.k-minseg button[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg)}
.k-gsheet{display:flex;flex-direction:column;gap:12px}
.k-gsheet .k-sheet-title{font-size:18px;font-weight:760;text-align:center;margin:0}
.k-gsheet .k-sheet-sub{margin-top:-6px}
.k-gsheet .k-more-sheet{background:transparent;box-shadow:none;padding:0;border-radius:0}
.k-gsheet .k-sheet-foot .k-btn.block{min-height:50px}

/* ---- ONE chevron (folds only) and ONE info button (explanations) ---- */
.chev-btn{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--disclosure-ring);color:var(--tint-fg);
  cursor:pointer;flex:none;box-sizing:border-box;vertical-align:middle;transition:transform .15s;background:transparent;position:relative}
.chev-btn svg{width:14px;height:14px;display:block}
.chev-btn.lg{width:34px;height:34px}.chev-btn.lg svg{width:15px;height:15px}
.chev-btn.open,.chev-btn[aria-expanded="true"]{transform:rotate(90deg)}
.k-phone .chev-btn:not(.lg)::after{content:"";position:absolute;inset:-8px}      /* M-5: ≥40 px hit, 28 px drawn */
.info-btn{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--k-tint);color:var(--tint-fg);
  cursor:help;flex:none;box-sizing:border-box;vertical-align:middle;margin-left:6px;position:relative}
.info-btn svg{width:14px;height:14px;display:block}
.k-phone .info-btn::after{content:"";position:absolute;inset:-12px}
@media (hover:hover){.info-btn:hover{color:var(--text)}.chev-btn:hover{background:var(--hover-bg)}}
.k-tip{position:fixed;z-index:950;max-width:300px;background:var(--surface);color:var(--text-secondary);border:1px solid var(--chart-grid);
  border-radius:12px;padding:10px 12px;font-size:12.5px;line-height:1.4;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow)}

/* ---- period picker: phone stack, real calendar buttons ---- */
.k-period.is-phone{flex-direction:column;align-items:stretch;gap:8px}
.k-period.is-phone>.k-range{align-self:flex-end}   /* round 2 §3b (owner 2026-10-26): the date chip right-aligned under the segment */
.k-range-chip:focus-visible{outline:2px solid var(--text-label)}
.k-datepick.is-pop{z-index:30;width:560px;max-width:calc(100vw - 32px)}
button.k-cal-d{border:0;background:transparent;font:inherit;padding:0;cursor:pointer;width:100%;border-radius:0}
button.k-cal-d:disabled{cursor:default}
@media (hover:hover){button.k-cal-d:not(:disabled):not(.is-from):not(.is-to):hover{background:var(--hover-bg)}}
.k-datepick .k-input{font:inherit;font-size:14px;color-scheme:inherit}
.k-datepick .k-err:empty{display:none}
html[data-shell="phone"] .k-datepick .k-input{font-size:16px}

/* ---- single-date calendar (owner 2026-11-05): every date box opens the app's own calendar, never the browser's ---- */
.k-date-btn{display:flex;align-items:center;gap:8px;width:100%;text-align:left;cursor:pointer;font:inherit;color:var(--text);font-variant-numeric:tabular-nums}
.k-date-btn svg{width:16px;height:16px;flex:none;color:var(--tint-fg)}
.k-date-btn .k-date-val.is-empty{color:var(--text-muted)}
.k-date-btn:disabled{opacity:.55;cursor:not-allowed}
.k-date-btn[aria-expanded="true"]{outline:2px solid var(--text-label);outline-offset:1px}
.k-datepick.k-d1{gap:12px;font-size:14px}
.k-datepick.k-d1.is-float{position:fixed;z-index:640;width:340px;max-width:calc(100vw - 16px);padding:16px 16px 14px}
.k-datepick.k-d1.is-sheet{position:fixed;z-index:620;left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:var(--phone-max);
  border-radius:var(--r-hero) var(--r-hero) 0 0;padding:8px 16px calc(16px + env(safe-area-inset-bottom));border:0;background:var(--surface);box-shadow:0 -10px 34px var(--k-glow)}
.k-d1-head{display:flex;align-items:center;gap:8px}
.k-d1-title{flex:1;text-align:center;font-size:15px;font-weight:750}
.k-d1-head .k-dp-nav{width:34px;height:34px;font-size:20px;border:0;cursor:pointer}
.k-d1 .k-cal{gap:3px 0}
.k-d1 .k-cal-dow{font-size:11.5px}
.k-d1 .k-cal-d{height:40px;font-size:14.5px;border-radius:999px}
.k-d1.is-sheet .k-cal-d{height:44px;font-size:16px}
.k-d1 .k-cal-d:disabled{color:var(--border-idle)}
.k-d1 .k-cal-d.is-today:not(.is-sel){box-shadow:inset 0 0 0 1.5px var(--text-label);color:var(--text);font-weight:700}
.k-d1 .k-cal-d.is-act:not(.is-sel){background:var(--hover-bg);color:var(--text)}
.k-d1 .k-cal-d.is-sel{background:var(--pair1-bg);color:var(--pair1-fg);font-weight:750}
.k-d1-foot{display:flex;gap:8px;justify-content:flex-end}
.k-d1-foot:empty{display:none}
.k-d1.is-sheet .k-d1-foot .k-btn{flex:1;min-height:44px}
.k-d1 .k-cs-title{text-align:center}

/* ---- the door (sign in · seat chooser, kit/shell.mjs) ---- */
.k-door{min-height:100vh;min-height:100dvh;background:var(--bg-page)}
html[data-shell]:has(> body.k-door-page),:where(html[data-shell]) body.k-door-page{background:var(--bg-page)}
html[data-shell="phone"] .k-door{justify-content:flex-start;padding:56px 16px 28px}
html[data-shell="phone"] .k-door-card{padding:22px 18px;border-radius:22px}
.k-door a,.k-door .k-linkbtn{color:var(--text-label);font-weight:650}
.k-linkbtn{border:0;background:transparent;font:inherit;font-size:13px;padding:6px 0;cursor:pointer}
.k-door-links{display:flex;justify-content:space-between;gap:12px;font-size:13px;flex-wrap:wrap}
.k-door-who{font-size:13.5px;color:var(--text-muted)}
.k-door-who b{color:var(--text)}
.k-door-card input.k-input{font:inherit;font-size:15px}
.k-door-card input.k-input::placeholder{color:var(--tab-fg);opacity:1}
.k-door-card .k-btn.block{min-height:50px}
a.k-seat,button.k-seat{width:100%;border:0;font:inherit;text-align:left;cursor:pointer;color:var(--text)}
.k-seat .chev-btn{pointer-events:none}
.k-seat[disabled]{opacity:.6;cursor:default}
.k-seats{display:flex;flex-direction:column;gap:8px}
.k-door-head{display:flex;align-items:center;gap:8px}
.k-door-head b{font-size:20px}
.k-door-head .k-door-count{margin-left:auto;font-size:13px;color:var(--text-muted);white-space:nowrap;flex:none}
html[data-shell="phone"] .k-door-head b{font-size:18px}   /* owner 2026-11-01: "Choose a workspace · N workspaces" stays on one line on the phone */

/* ---- shared.js dialog kit + toast on a kit page (appForm/appConfirm, e.g.
        the first-sign-in Set Password) ---- */
:root[data-shell] .modal-back{position:fixed;inset:0;z-index:400;background:var(--scrim);display:flex;align-items:center;justify-content:center;padding:16px}
:root[data-shell] .modal-back>.modal{position:relative;inset:auto;margin:0;width:100%;height:auto;max-height:calc(100vh - 32px);overflow:auto;display:block;
  padding:22px 24px;border-radius:22px!important;background:var(--surface);box-shadow:var(--shadow-pop);z-index:auto}
:root[data-shell] .modal-back h2{font-size:18px;font-weight:760}
:root[data-shell] .modal-back .field{display:flex;flex-direction:column;gap:6px;height:auto;padding:0;border:0;background:none;margin-top:12px;border-radius:0}
:root[data-shell] .modal-back .field label{font-size:12.5px;font-weight:650;color:var(--text-muted)}
:root[data-shell] .modal-back .dlg-input{width:100%;min-height:44px;background:var(--k-sunken);border:1px solid var(--border-idle);border-radius:12px;padding:10px 12px;color:var(--text);font:inherit}
:root[data-shell] .modal-back .row{display:flex;gap:10px;margin-top:18px;padding:0;background:none;min-height:0;border:0}
:root[data-shell] .modal-back .btn{display:inline-flex;align-items:center;justify-content:center;text-align:center;min-height:46px;border-radius:14px;font-weight:700;background:var(--k-sunken);color:var(--text-secondary);padding:0 16px}
:root[data-shell] .modal-back .btn.green{background:var(--pair1-bg);color:#fff}
:root[data-shell] .modal-back .btn.danger{background:var(--danger-solid);color:var(--danger-solid-fg)}
:root[data-shell] #toast.toast.show{opacity:1}
:root[data-shell] #toast.toast.err{background:var(--danger-solid);color:var(--danger-solid-fg)}
.k-door-page #toast.toast,html[data-shell="phone"] #toast.toast{left:50%}

/* ==========================================================================
   B1 GAP PASS (2026-10-22) — the components the B3 pages patched locally.
   ========================================================================== */
/* disabled controls (a soon / not-allowed action stays visible, never live) */
.k-btn[aria-disabled="true"]{opacity:.45;cursor:not-allowed}
.k-more-item[disabled],.k-more-item[aria-disabled="true"],.k-more-item.is-disabled{opacity:.5;cursor:not-allowed}

/* KPI icon + phone dot: every tone (Shell.kpis defaults to blue) */
.k-kpi-icon.is-violet{background:var(--cat-violet-bg);color:var(--cat-violet-fg)}
.k-kpi-icon.is-slate{background:var(--k-slate-bg);color:var(--cat-slate-fg)}
.k-kpi-icon.is-sky{background:var(--tag-blue-bg);color:var(--k-sky)}
.k-kpi-dot{display:inline-block}
.k-kpi-dot.is-blue{background:var(--k-blue)}.k-kpi-dot.is-indigo{background:var(--k-indigo)}.k-kpi-dot.is-violet{background:var(--k-violet)}
.k-kpi-dot.is-slate{background:var(--cat-slate-fg)}.k-kpi-dot.is-sky{background:var(--k-sky)}
/* a ring in a second meaning colour (Not sold = slate tile, red ring) — icon, dot or pill */
.k-outline-red{box-shadow:inset 0 0 0 1.5px var(--danger-fg)}
.k-outline-amber{box-shadow:inset 0 0 0 1.5px var(--k-amber)}
.k-outline-green{box-shadow:inset 0 0 0 1.5px var(--success-ring)}
.k-outline-blue{box-shadow:inset 0 0 0 1.5px var(--k-series)}
.k-pill.k-outline-red{box-shadow:inset 0 0 0 1px var(--danger-fg)}

/* pill tones: violet (Field payment), indigo (Deposit), slate */
.k-pill.is-violet{background:var(--cat-violet-bg);color:var(--cat-violet-fg)}
.k-pill.is-indigo{background:var(--cat-indigo-bg);color:var(--cat-indigo-fg)}
.k-pill.is-slate{background:var(--k-slate-bg);color:var(--cat-slate-fg)}

/* KPI (i) slot + a linked tile with its own inner links (cover-link pattern) */
.k-kpi-head .info-btn{margin-left:auto}
.k-kpi.is-link{position:relative}
.k-kpi-cover{position:absolute;inset:0;border-radius:inherit;z-index:0}
.k-kpi-cover:focus-visible{outline:2px solid var(--text-label);outline-offset:2px}
.k-kpi.is-link .info-btn,.k-kpi.is-link .k-kpi-basis a,.k-kpi.is-link .k-kpi-fig a{position:relative;z-index:1}
.k-kpi-basis a{color:var(--tint-fg);font-weight:650}
.k-kpi-fig .k-class{vertical-align:middle;margin-right:4px}
.k-kpi-fig .k-class+*{margin-left:0}

/* totals, 3 columns: label · basis · value */
.k-totals td.k-totals-basis,.k-totals tr.is-net td.k-totals-basis{min-width:0;padding:2px 18px 2px 0;color:var(--tab-fg);font-weight:600;font-size:12.5px;text-align:right}
.k-totals td.k-totals-basis a{color:var(--tint-fg)}
.k-phone .k-totals td.k-totals-basis{white-space:normal;padding-right:10px}

/* stacked bar spacer (pads a row to the shared max) */
.k-bar>.f-gap{background:transparent}

/* the one stacked-column chart (Shell.stackChart) */
.k-stackchart svg{width:100%;height:auto;display:block}
.k-stackchart .g{stroke:var(--chart-grid)}
.k-stackchart .g.is-zero{stroke:var(--border-field)}
.k-stackchart text{fill:var(--tab-fg);font-size:11px}
.k-stackchart .s-blue{fill:var(--k-blue)}.k-stackchart .s-purple{fill:var(--k-purple)}.k-stackchart .s-teal{fill:var(--k-teal)}
.k-stackchart .s-indigo{fill:var(--k-indigo)}.k-stackchart .s-sky{fill:var(--k-sky)}.k-stackchart .s-green{fill:var(--success-ring)}
.k-stackchart .s-amber{fill:var(--k-amber)}.k-stackchart .s-red{fill:var(--danger-fg)}.k-stackchart .s-orange{fill:var(--k-orange)}
.k-stackchart .s-violet{fill:var(--k-violet)}.k-stackchart .s-muted{fill:var(--border-idle)}
.k-stackchart .s-zero{fill:var(--chart-grid)}
.k-stackchart .tip rect{fill:var(--k-sunken);stroke:var(--border-idle)}
.k-stackchart .tip .t1{fill:var(--text);font-weight:700;font-size:11.5px}
.k-stackchart .tip .t2{fill:var(--text-secondary)}
.k-stackchart+.k-legend{margin-top:10px}
.k-stackchart svg text.k-vlab{font-size:10px;font-weight:700;fill:var(--text-secondary)}
.k-chart.is-ph .tip rect{fill:var(--surface)}

/* phone header: monogram tile beside the title + ⋯ More slot (title stays centred) */
.k-phead-title.has-tile{display:flex;align-items:center;justify-content:center;gap:8px}
.k-phead-title.has-tile .k-mono{flex:none}
.k-phead-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.k-phead.has-more{grid-template-columns:88px minmax(0,1fr) 44px 44px}
.k-phead.has-more>a:first-child{justify-self:start}
.k-phead.has-more>.k-more-btn{width:44px;height:44px;min-width:44px;border-radius:50%;font-size:20px}

/* light mode: the selected nav item and the Compare switch use a soft tint
   (the light twin of the dark mock's navy chip), so the coloured nav icon and
   the switch label stay readable — a solid blue fill swallowed both. */
:root[data-shell]{--k-on-bg:var(--k-tint);--k-on-fg:var(--tint-fg)}
:root[data-shell][data-theme="dark"]{--k-on-bg:var(--selected-bg);--k-on-fg:var(--selected-fg)}
.k-nav-item[aria-current="page"],.k-fac-item[aria-current="page"]{background:var(--k-on-bg);color:var(--k-on-fg)}
.k-switch{color:var(--k-on-fg)}

/* ==========================================================================
   POS + APP SHELL (B6, 2026-10-22) — the Sell app (sell.html) and the Field
   console (field.html) share these. Ported from docs/mocks/kit/kit.css
   "v32 POS pattern" + the proto app shell, every colour a token (palette
   table above). Behaviour lives in public/pos.js (window.Pos).
   ========================================================================== */
/* app shell — desktop: brand · top tabs · account menu; phone: k-phead + bottom tabs */
.k-app{background:var(--bg-page);color:var(--text);min-height:100vh;display:flex;flex-direction:column}
.k-app-head{display:flex;align-items:center;gap:16px;padding:12px 24px;border-bottom:1px solid var(--k-line);background:var(--bg-sidebar);position:sticky;top:0;z-index:15}
.k-app-brand{display:flex;align-items:center;gap:10px;flex:none;min-width:0}
.k-app-brand b{font-size:15.5px;font-weight:780;display:block;line-height:1.2}
.k-app-brand .sub{display:block;font-size:12.5px;color:var(--text-muted);font-weight:500;line-height:1.2}
.k-app-tabs{display:flex;gap:4px;margin:0 auto}
.k-app-tabs a{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px;border-radius:12px;color:var(--text-muted);font-weight:650;white-space:nowrap;text-decoration:none}
.k-app-tabs a svg{width:17px;height:17px;flex:none}
.k-app-tabs a[aria-current="page"]{background:var(--selected-bg);color:var(--selected-fg);font-weight:750}
.k-app-who{display:flex;align-items:center;gap:10px;flex:none;position:relative}
.k-app-main{flex:1;padding:22px 28px 40px;display:flex;flex-direction:column;gap:16px;max-width:calc(1176px + max(0px, 100% - 1176px) * var(--content-f, 0));box-sizing:border-box;width:100%;margin:0 auto}
.k-papp{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;background:var(--bg-page);color:var(--text);max-width:var(--phone-max);margin:0 auto;padding:0 env(safe-area-inset-right) 0 env(safe-area-inset-left)}
.k-papp-body{flex:1;padding:calc(6px + env(safe-area-inset-top)) 16px 16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.k-papp-foot{position:sticky;bottom:0;z-index:15;padding:8px 12px calc(12px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:8px;background:var(--bg-page);box-shadow:0 -1px 0 var(--k-line)}
.k-papp .k-phead{grid-template-columns:64px 1fr 64px}
.k-papp .k-phead>button:first-child{justify-self:start;width:auto;display:inline-flex;align-items:center;gap:4px;color:var(--tint-fg)}
.k-papp .k-phead>button:first-child .k-caret{font-size:12px}
.k-papp .k-psub b{color:var(--text)}
.k-apptabs a{text-decoration:none}
.k-acct-pop{position:absolute;right:0;top:calc(100% + 8px);z-index:40;min-width:240px}
/* search with keyboard hint */
.k-pos-search{display:flex;align-items:center;gap:10px;min-height:46px;padding:0 14px;border-radius:14px;background:var(--k-sunken);border:1px solid var(--border-idle);color:var(--text-muted);font-size:15px;box-sizing:border-box}
.k-pos-search svg{width:17px;height:17px;flex:none;color:var(--tint-fg)}
.k-pos-search input{flex:1;min-width:0;border:0;background:transparent;color:var(--text);font:inherit;outline:0;padding:0;height:44px}
.k-pos-search input::placeholder{color:var(--text-muted)}
.k-pos-search kbd{margin-left:auto;font:inherit;font-size:12px;font-weight:700;color:var(--text-muted);border:1px solid var(--border-idle);border-radius:6px;padding:1px 7px}
/* LMP | COT two-way source switch (never a mixed list) */
.k-src{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:var(--surface);border-radius:14px;padding:4px}
.k-src button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border:0;border-radius:11px;background:transparent;color:var(--text-muted);font:inherit;font-size:15px;font-weight:700;cursor:pointer;padding:0 10px;white-space:nowrap}
.k-src-dot{width:10px;height:10px;border-radius:3px;flex:none}
.k-src button b{font-weight:650;font-size:12.5px;color:var(--tab-fg);font-variant-numeric:tabular-nums}
.k-src button[aria-selected="true"]{background:var(--selected-bg);color:var(--selected-fg)}
.k-src button[aria-selected="true"] b{color:var(--selected-fg)}
/* catalog: group label + rows (class square · name · price · in-stock; tap = +1, › = line sheet) */
.k-cat-group{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--text);margin:16px 0 0;padding:8px 12px;border-radius:10px;background:var(--k-group-bg)}   /* round 2 §29: a class band, air between classes */
.k-cat-group:first-child{margin-top:0}
html[data-shell="desktop"] .k-cat-group{margin-top:24px}
html[data-shell="desktop"] .k-cat-group:first-child{margin-top:0}
.k-cat-group.is-a{background:var(--cls-a-bg)}.k-cat-group.is-b{background:var(--cls-b-bg)}.k-cat-group.is-c{background:var(--cls-c-bg)}.k-cat-group.is-d{background:var(--cls-d-bg)}.k-cat-group.is-e{background:var(--cls-e-bg)}
.k-cat-group+.k-cat{margin-top:8px}
/* item 37 (2026-10-28): the class band and its list are one connected block; the gap sits between classes */
.k-cat-grp{display:flex;flex-direction:column}
html[data-shell="phone"] .k-cat-grp{box-shadow:0 0 0 1px var(--k-line);border-radius:16px}   /* owner 2026-10-31: each class reads as its own card on the phone */
.k-cat-grp .k-cat-group,html[data-shell="desktop"] .k-cat-grp .k-cat-group{margin:0;border-radius:12px 12px 0 0}
.k-cat-grp .k-cat-group+.k-cat{margin-top:0;border-radius:0 0 16px 16px}
.sl-src .k-mono.xs{margin-right:2px}
.k-cat-group .sub{margin-left:auto;letter-spacing:0;text-transform:none;font-weight:600;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.k-cat{display:flex;flex-direction:column;background:var(--surface);border-radius:16px;padding:0 6px 0 12px}
.k-cat-row{display:flex;align-items:center;gap:10px;min-height:56px;border-top:1px solid var(--k-line);position:relative}
.k-cat-row:first-child{border-top:0}
.k-cat-hit{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:56px;border:0;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer;padding:0;-webkit-tap-highlight-color:transparent}
.k-cat-name{flex:1;min-width:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k-cat-name .sub{display:block;font-size:12px;font-weight:500;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k-cat-price{flex:none;font-weight:750;font-variant-numeric:tabular-nums;text-align:right}
.k-cat-stock{flex:none;min-width:52px;text-align:right;font-size:12.5px;color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.k-cat-stock.is-low{color:var(--k-amber)}
.k-cat-row.is-in::before{content:"";position:absolute;left:-12px;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:var(--pair1-bg)}
.k-cat-row.is-out{opacity:.5}
.k-cat-row>.chev-btn{flex:none;cursor:pointer;position:relative}
.k-cat.is-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;background:transparent;padding:0}
.k-cat.is-grid .k-cat-row{border:0;background:var(--surface);border-radius:14px;padding:0 8px 0 12px;min-height:64px}
.k-cat.is-grid .k-cat-row.is-in{box-shadow:inset 0 0 0 1.5px var(--pair1-bg)}
.k-cat.is-grid .k-cat-row.is-in::before{display:none}
.k-cat.is-grid .k-cat-hit{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"c n n" "p p s";column-gap:10px;row-gap:6px;padding:12px 0;align-items:center}
.k-cat.is-grid .k-class{grid-area:c}.k-cat.is-grid .k-cat-name{grid-area:n}
.k-cat.is-grid .k-cat-price{grid-area:p;text-align:left;font-size:16px}.k-cat.is-grid .k-cat-stock{grid-area:s}
/* order bar: "3 units · $3,400 · Review ›" */
.k-orderbar{display:flex;align-items:center;gap:10px;min-height:56px;padding:0 8px 0 16px;border-radius:16px;background:var(--pair1-bg);color:#fff;border:0;font:inherit;width:100%;box-sizing:border-box;cursor:pointer;box-shadow:0 10px 34px var(--k-glow)}
.k-orderbar .k-orderbar-units{font-size:14px;font-weight:650;white-space:nowrap}
.k-orderbar .k-orderbar-total{font-size:18px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.k-orderbar .k-orderbar-go{margin-left:auto;display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 14px;border-radius:12px;background:var(--selected-bg);color:var(--selected-fg);font-weight:750;white-space:nowrap}
:root[data-shell][data-theme="dark"] .k-orderbar .k-orderbar-go{color:#fff}
.k-orderbar.is-empty{background:var(--k-sunken);color:var(--text-muted);box-shadow:none;cursor:default}
.k-orderbar.is-empty .k-orderbar-go{display:none}
/* order sheet / panel */
.k-order{display:flex;flex-direction:column;gap:12px}
.k-order-head{display:flex;align-items:center;gap:10px}
.k-order-head h2{font-size:18px;font-weight:760;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.k-order-head .sub{margin-left:auto;font-size:13px;color:var(--text-muted);white-space:nowrap}
.k-order-empty{font-size:13.5px;color:var(--text-muted)}
.k-oline{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:14px;background:var(--k-sunken)}
.k-oline-top{display:flex;align-items:center;gap:10px}
.k-oline-name{flex:1;min-width:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.k-oline-name .sub{display:block;font-size:12px;font-weight:500;color:var(--text-muted)}
.k-oline-sum{flex:none;font-weight:800;font-variant-numeric:tabular-nums}
.k-oline-x{flex:none;width:32px;height:32px;border-radius:50%;border:0;background:var(--surface);color:var(--k-red-soft);font:inherit;font-size:15px;font-weight:800;display:inline-grid;place-items:center;cursor:pointer;padding:0;position:relative}
.k-oline-x::after{content:"";position:absolute;inset:-5px}
.k-oline-mid{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.k-oline-mid .k-stepper{background:var(--surface)}
.k-oline-price{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 12px;border-radius:12px;background:var(--surface);border:1px solid var(--border-idle);font:inherit;font-weight:700;font-variant-numeric:tabular-nums;box-sizing:border-box;color:var(--text);cursor:pointer}
.k-oline-price .sub{font-size:12px;font-weight:500;color:var(--text-muted)}
.k-oline-price.is-missing{border-color:var(--k-amber);color:var(--k-amber)}
/* The price typed on the line (owner 2026-10-29): same shape as the price button it replaced; 16px so iOS never zooms */
.k-oline-pin{display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 10px 0 12px;border-radius:12px;background:var(--surface);border:1px solid var(--border-idle);box-sizing:border-box;cursor:text}
.k-oline-pin .pre{font-weight:700;color:var(--text-muted)}
.k-oline-pin input{width:68px;min-width:0;border:0;background:transparent;font:inherit;font-size:16px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--text);padding:0;outline:0}
.k-oline-pin input::placeholder{color:var(--text-muted);font-weight:500}
.k-oline-pin .sub{font-size:12px;font-weight:500;color:var(--text-muted);white-space:nowrap}
.k-oline-pin:focus-within{border-color:var(--text-label);box-shadow:0 0 0 2px var(--selected-bg)}
.k-oline-pin.is-missing{border-color:var(--k-amber)}.k-oline-pin.is-missing .pre{color:var(--k-amber)}
.k-oline-batch{border:0;background:transparent;padding:0 2px;font:inherit;font-size:12.5px;font-weight:650;color:var(--accent);cursor:pointer;white-space:nowrap}
/* Order line, owner 2026-10-30: name = link to the batch id · one row Qty · Price · Comm with small headers */
.sheet.k-gsheet.is-tall{max-height:calc(100dvh - max(26px, env(safe-area-inset-top) + 10px))}
.k-oline-nm{background:none;border:0;padding:0;margin:0;font:inherit;font-weight:700;color:var(--text);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:var(--text-muted);cursor:pointer;text-align:left;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.k-oline-nm:hover{text-decoration-color:var(--accent)}
.k-oline-bid{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--text-muted);padding:6px 10px;border-radius:10px;background:var(--surface);border:1px solid var(--border-idle);width:max-content;max-width:100%}
.k-oline-bid .sub{color:var(--text-muted)}
.k-oline-grid{display:grid;grid-template-columns:auto minmax(0,1fr) 84px;gap:8px 8px;align-items:start}
.k-oline-cell{display:flex;flex-direction:column;gap:4px;min-width:0}
.k-oline-lab{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-label);line-height:1;padding-left:8px}
.k-oline-grid .k-stepper{min-width:0;height:40px;box-sizing:border-box;background:var(--surface)}
.k-oline-grid .k-stepper button{width:32px;height:38px;font-size:17px}
.k-oline-grid .k-stepper input.k-qin,.k-oline-grid .k-stepper :is(input,span){width:44px;min-width:44px;flex:none;height:38px;font-size:16px}
.k-oline-grid .k-oline-pin{padding:0 8px 0 10px;gap:3px;display:flex;width:100%;box-sizing:border-box}
.k-oline-grid .k-oline-pin input{flex:1 1 auto;width:40px;min-width:40px}
.k-stepper.is-over{border-color:var(--k-red-soft);box-shadow:0 0 0 2px rgba(220,61,51,.28);box-shadow:0 0 0 2px color-mix(in srgb,var(--k-red-soft) 28%,transparent)}
.k-stepper.is-over input.k-qin{color:var(--k-red-soft)}
.k-oline-over{font-size:12.5px;font-weight:650;color:var(--k-red-soft)}
/* the Comm (Commission) dropdown: the price box's height and dark surface on every device (the phone 44px field rule yields here) */
html .k-oline-cell.is-pros button.k-cs.k-select,.k-oline-cell.is-pros select.k-oline-pros{min-height:40px;height:40px;padding:0 6px 0 9px;font-size:14px;font-weight:700;width:100%;box-sizing:border-box;background:var(--surface);border:1px solid var(--border-idle);border-radius:12px}
html .k-oline-cell.is-pros button.k-cs.k-select::before{margin-left:4px}
.k-oline-other{width:100%;box-sizing:border-box;min-height:40px;height:40px;padding:0 8px 0 10px;background:var(--surface)}
.k-oline-other input{min-width:0;width:100%;font-size:16px}
/* Phone search in the Options sheet (owner 2026-10-30) */
.k-opt-search{width:100%;max-width:none;margin:4px 0 8px;box-sizing:border-box;background:var(--k-sunken);border:1px solid var(--k-line-card-bd)}   /* owner 2026-11-01 (round 3 §51): a box, not a line of text, against the sheet */
.k-opt-search:focus-within{border-color:var(--text-label)}
.k-search-pop.is-inline{position:static;box-shadow:none;border:1px solid var(--border-idle);border-radius:14px;margin:-4px 0 10px;max-height:min(50vh,420px);overflow:auto}
/* ONE timeline (owner 2026-10-30): table on desktop, stacked rows on phone */
.k-tl{font-size:13px}
.k-tl .k-tl-when{white-space:nowrap;color:var(--text-muted);font-variant-numeric:tabular-nums}
.k-tl .k-tl-time{color:var(--text-muted);margin-left:4px}
.k-tl .k-tl-main{min-width:0}
.k-tl .k-tl-main .sub{display:block;font-size:12px;color:var(--text-muted);margin-top:2px}
.k-tl-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--text-label);margin-right:8px;vertical-align:1px}
.k-tl-dot.is-green{background:var(--success-ring,#2fbf71)}.k-tl-dot.is-amber{background:var(--k-amber)}.k-tl-dot.is-red{background:var(--k-red-soft)}.k-tl-dot.is-blue{background:var(--k-blue)}
.k-tl.is-phone{display:flex;flex-direction:column}
.k-tl.is-phone .k-tl-row{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:9px 0;border-top:1px solid var(--k-line)}
.k-tl.is-phone .k-tl-row:first-child{border-top:0}
.k-tl.is-phone .k-tl-when{grid-column:1/-1;font-size:12px;color:var(--text-muted)}
.k-tl.is-phone .k-tl-main{min-width:0;line-height:1.35}
.k-tl.is-phone .k-tl-amt{align-self:end;white-space:nowrap;font-weight:700}
/* In transit (owner 2026-10-30): one line per transfer on desktop; class totals under each list */
.tx-intransit{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto auto auto;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--k-line)}
.tx-intransit:first-child{border-top:0}
.tx-intransit .tx-it-id{display:flex;align-items:center;gap:8px;min-width:0;white-space:nowrap}
.tx-intransit .tx-it-cell{white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--text-secondary)}
.tx-cls-tot{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding:10px 0 2px;margin-top:6px;border-top:1.5px solid var(--text);font-size:13px}
.tx-cls-tot .k-class{margin-right:4px}
.tx-cls-tot b{font-variant-numeric:tabular-nums}
.tx-cls-tot .tx-cls-all{margin-left:auto;font-weight:800}
.k-oline-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.k-oline-acts .k-btn.block{min-height:50px;font-size:15px}   /* BN-50 (ruling 18): Back / Cancel sale 50 px */
.k-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.k-presets>span{grid-column:1/-1;font-size:12.5px;font-weight:650;color:var(--text-muted)}
.k-presets>span.is-need{color:var(--k-amber)}
.k-presets button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 8px;border-radius:999px;border:1px solid var(--border-idle);background:transparent;color:var(--text-secondary);font:inherit;font-size:13px;font-weight:700;cursor:pointer;box-sizing:border-box}
.k-presets button[aria-pressed="true"]{background:var(--selected-bg);border-color:var(--text-label);color:var(--selected-fg)}
.k-presets .k-input{grid-column:1/-1}
.k-paywith{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.k-paywith button{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:52px;border-radius:14px;border:1px solid var(--border-idle);background:var(--k-sunken);color:var(--text-secondary);font:inherit;font-size:14px;font-weight:700;cursor:pointer;padding:4px 6px;box-sizing:border-box;white-space:nowrap;min-width:0}
.k-paywith button .sub{font-size:11.5px;font-weight:550;color:var(--text-muted);max-width:100%;overflow:hidden;text-overflow:ellipsis}
.k-paywith button[aria-pressed="true"]{background:var(--selected-bg);border-color:var(--text-label);color:var(--selected-fg)}
.k-paywith button[aria-pressed="true"] .sub{color:var(--selected-fg)}
.k-paywith button[disabled]{opacity:.45;cursor:not-allowed}
.k-ototals{display:flex;flex-direction:column;gap:6px;padding:12px 2px 0;border-top:1px solid var(--k-line);font-size:14px}
.k-ototals>div{display:flex;justify-content:space-between;gap:12px;color:var(--text-muted)}
.k-ototals>div b{color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap}
.k-ototals>div.is-total{font-size:17px;color:var(--text);font-weight:750}
.k-order-foot{display:flex;flex-direction:column;gap:12px}
.sheet .k-order-foot{position:sticky;bottom:-18px;z-index:1;background:var(--surface);padding:0 0 4px;box-shadow:0 -12px 14px -6px var(--surface)}
.k-complete{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:50px;border:0;border-radius:16px;background:var(--pair1-bg);color:#fff;font:inherit;font-size:17px;font-weight:800;cursor:pointer;box-sizing:border-box;white-space:nowrap;font-variant-numeric:tabular-nums}
.k-complete[disabled]{background:var(--k-sunken);color:var(--tab-fg);cursor:not-allowed}
.k-ord-why{font-size:12.5px;color:var(--k-amber);text-align:center;margin-top:-4px}
.k-ord-confirm{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:14px;background:var(--surface);box-shadow:inset 0 0 0 1px var(--k-line)}
.k-ord-confirm .q{font-weight:700}
.k-ord-confirm .acts{display:grid;grid-template-columns:1fr 2fr;gap:8px}
.k-ord-confirm .acts .k-btn{min-height:50px}
.k-ord-err{font-size:13px;color:var(--danger-fg);font-weight:600}
/* desktop two-pane POS */
.k-pos{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:20px;align-items:start}
.k-pos-cat{display:flex;flex-direction:column;gap:12px;min-width:0}
.k-pos-order{background:var(--surface);border-radius:20px;padding:18px;display:flex;flex-direction:column;gap:12px;box-shadow:0 0 0 1px var(--k-glow-ring),0 10px 34px var(--k-glow);position:sticky;top:84px;max-height:calc(100vh - 104px);overflow-y:auto}
/* line sheet: Quantity − / + left, Price (each) right */
.k-lsheet{display:flex;flex-direction:column;gap:12px}
.k-lsheet-grid{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:start}
/* 2026-11-05: the price input is a flex item with min-width:auto, so at 375px it kept its intrinsic width and ran past
   its box (measured 35px). Let it shrink inside its .k-input. */
.k-lsheet-grid .k-input{min-width:0}.k-lsheet-grid .k-input input{min-width:0;width:100%}
.k-lsheet .k-stepper{height:44px;box-sizing:border-box}
.k-lsheet .k-stepper button{height:44px;width:44px}
.k-lsheet .k-input{height:44px;box-sizing:border-box;font-size:16px}
.k-lsheet-acts{display:grid;grid-template-columns:1fr 2fr;gap:10px;margin-top:4px}
.k-lsheet-acts .k-btn{min-height:50px}   /* owner 2026-11-01 (item 59): one 50px height for every full-width action button */
.k-dlg{position:fixed;inset:0;margin:auto;z-index:70;width:min(460px,calc(100vw - 48px));height:fit-content;max-height:calc(100vh - 48px);overflow-y:auto;background:var(--surface);border-radius:20px;padding:18px 20px 20px;box-shadow:var(--shadow-sheet, 0 20px 60px rgba(0,0,0,.4));box-sizing:border-box}
/* tap-to-add feedback: toast with Undo, one pulse, the › shows the count */
.k-toast{position:fixed;left:50%;transform:translateX(-50%);bottom:24px;z-index:80;display:flex;align-items:center;gap:10px;min-height:48px;width:max-content;max-width:min(560px,calc(100vw - 24px));padding:0 6px 0 16px;border-radius:14px;background:var(--k-on-bg);color:var(--text);border:1px solid var(--border-idle);box-shadow:0 10px 34px var(--k-glow);font-size:14px;font-weight:650;box-sizing:border-box;animation:k-toast-in .16s ease-out}
.k-toast-msg{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.k-toast-undo{flex:none;min-height:40px;padding:0 14px;border:0;border-radius:10px;background:transparent;color:var(--k-on-fg);font:inherit;font-size:14px;font-weight:800;cursor:pointer}
.k-toast.is-err{background:var(--danger-bg);color:var(--danger-fg);border-color:var(--danger-fg)}
@keyframes k-toast-in{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes k-pulse{0%{transform:scale(1)}40%{transform:scale(1.03)}100%{transform:scale(1)}}
@keyframes k-pulse-badge{0%{transform:scale(1)}40%{transform:scale(1.25)}100%{transform:scale(1)}}
.k-orderbar.is-pulse,.k-oline.is-pulse{animation:k-pulse .32s ease-out}
.k-cat-row.is-full .k-cat-stock{color:var(--selected-fg);font-weight:700;min-width:0}
.k-cat-row.is-full .k-cat-hit{cursor:default}
.chev-btn.is-count{background:var(--pair1-bg);border-color:var(--pair1-bg);color:#fff}
.chev-btn.is-count b{font-size:13px;font-weight:800;line-height:1}
.chev-btn.is-pulse{animation:k-pulse-badge .32s ease-out}
.k-cat-row.is-full .chev-btn.is-count{background:var(--selected-bg);color:var(--selected-fg);box-shadow:inset 0 0 0 1.5px var(--pair1-bg)}
@media (prefers-reduced-motion:reduce){.k-toast,.k-orderbar.is-pulse,.k-oline.is-pulse,.chev-btn.is-pulse{animation:none}}
/* sale state chip text (Held amber · paid green · unpaid red · awaiting blue) */
.k-state{font-weight:650;white-space:nowrap}
.k-state.is-held{color:var(--k-amber)}.k-state.is-paid{color:var(--success-fg)}.k-state.is-unpaid{color:var(--danger-fg)}.k-state.is-awaiting{color:var(--k-sky)}.k-state.is-muted{color:var(--text-muted)}
.k-stepper button{display:inline-grid;place-items:center;padding:0}

/* ==========================================================================
   LAYOUT-SPEC §4–§5 — width behaviour shared by every page (shell step, 2026-10-22)
   ========================================================================== */
/* Wide tables scroll sideways INSIDE their card (ui.js wraps each table once). */
.k-tscroll{overflow-x:auto;max-width:100%;min-width:0;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:thin}
/* Rows of chips, filters, pills and buttons wrap on desktop instead of overflowing. */
:where(html[data-layout="desktop"]) :where(.k-filters,.k-chips,.k-card-head,.k-page-head,.k-actbar,.head-row,.filter-bar){flex-wrap:wrap}
/* Long headers wrap instead of clipping. */
:where(html[data-shell]) :where(.k-page-head h1,.k-page-head h2,.k-card-head h2,.k-card-head h3,.k-card-title){overflow-wrap:break-word;min-width:0}
/* Grid and flex children may shrink below their content (the classic overflow). */
.k-page>*{min-width:0;max-width:100%}

/* Phone (§5): 44px hit areas without changing the visual size — a transparent,
   absolutely positioned ::after pad grows each tappable to at least 44x44 (the
   insets resolve against the control's own box). Controls that use ::after
   for drawing opt out (.k-select, .k-radio, .k-nopad). */
:where(html[data-layout="phone"]) :where(button,a[href],[role="button"],[role="tab"],[role="switch"],summary,label.tick,label.k-chip,label.k-search,.k-search):where(:not(.k-select,.k-radio,.k-nopad)){position:relative;touch-action:manipulation}
:where(html[data-layout="phone"]) :where(button,a[href],[role="button"],[role="tab"],[role="switch"],summary,label.tick,label.k-chip,label.k-search,.k-search):where(:not(.k-select,.k-radio,.k-nopad))::after{
  content:"";position:absolute;top:min(0px,calc((100% - 44px) / 2));bottom:min(0px,calc((100% - 44px) / 2));
  left:min(0px,calc((100% - 44px) / 2));right:min(0px,calc((100% - 44px) / 2))}
:where(html[data-layout="phone"]) :where(input,select,textarea){touch-action:manipulation}
html[data-layout="phone"] .k-phone-shell .k-page{padding-left:16px;padding-right:16px}

/* The ↔ content-width control (§4): desktop only, at 1100px and wider, drawn
   only where it can change something (ui.js sets [hidden] otherwise). */
/* Owner 2026-11-01: the Page width control is the LAST item of the left sidebar — a styled slider
   under Light | Dark. Default 1120 px → Full = the whole column beside the sidebar. */
.k-aside-width{display:flex;flex-direction:column;gap:6px;padding:4px 10px 8px}   /* owner 2026-11-05: sits in the top-right menu under Theme */
.k-aside-width.is-off{opacity:.45}
.k-aw-head{display:flex;align-items:baseline;justify-content:space-between;font-size:12.5px;color:var(--text-muted)}
.k-aw-head b{font-size:12px;font-weight:650;color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap}
.k-aw-range{-webkit-appearance:none;appearance:none;width:100%;height:18px;margin:2px 0 0;cursor:pointer;outline:0;background:transparent}   /* owner 2026-11-01: no 44px grab area on desktop */
.k-aw-range::-webkit-slider-runnable-track{height:6px;border-radius:999px;background:linear-gradient(90deg,var(--accent) calc(var(--p,0) * 100%),var(--k-line) 0)}
.k-aw-range::-moz-range-track{height:6px;border-radius:999px;background:linear-gradient(90deg,var(--accent) calc(var(--p,0) * 100%),var(--k-line) 0)}
.k-aw-range:disabled{cursor:default}
.k-aw-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin-top:-6px;border-radius:50%;background:var(--surface);box-shadow:0 0 0 2px var(--accent),0 2px 6px rgba(0,0,0,.25);transition:transform .12s}
.k-aw-range::-moz-range-thumb{width:18px;height:18px;border:0;border-radius:50%;background:var(--surface);box-shadow:0 0 0 2px var(--accent),0 2px 6px rgba(0,0,0,.25)}
.k-aw-range:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--accent),0 0 0 6px rgba(47,107,214,.25);box-shadow:0 0 0 2px var(--accent),0 0 0 6px color-mix(in srgb,var(--accent) 25%,transparent)}
@media (hover:hover){.k-aw-range:not(:disabled):hover::-webkit-slider-thumb{transform:scale(1.12)}}
.k-aw-ends{display:flex;justify-content:space-between}
.k-wc-snap{font:inherit;font-size:11.5px;font-weight:650;color:var(--text-muted);background:transparent;border:0;padding:2px 6px;border-radius:6px;cursor:pointer;user-select:none}
.k-wc-snap.is-on{color:var(--accent)}
@media (hover:hover){.k-wc-snap:hover{color:var(--text);background:var(--hover-bg)}}
html[data-layout="phone"] .k-aside-width{display:none}
/* Clipped text (§6): figure, basis and sub lines carry money context, so they
   wrap instead of ending in "…". Names in fixed slots keep their ellipsis
   (tests/layout_gate.mjs ELLIPSIS_BY_DESIGN lists them). */
.k-kpi-basis,.k-phone .k-card-preview,.k-ident .sub,.k-prow-main>.sub,.k-cat-name .sub,.k-seat-main .sub,.k-paywith button .sub,.k-cat-group .sub,
.k-phone .k-kpi-fig{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
/* 900–1100 px desktops (§4): grid and stack children shrink to their track;
   the sidebar nav takes its own height and the aside scrolls (short windows);
   the app header's tabs scroll instead of pushing the page wider. */
:where(.k-grid,.k-stack,.grid-2,.grid-detail,.grid-overview)>*{min-width:0}
.k-stack{min-width:0}
.k-aside .k-nav{flex:1 0 auto}
.k-app-tabs{min-width:0;overflow-x:auto;scrollbar-width:none}
.k-app-tabs::-webkit-scrollbar{display:none}
.k-app-brand{flex:0 1 auto}
/* A KPI figure wraps at its space (figure · unit) rather than spilling out of
   its tile; a figure too long for the tile on its own breaks last. */
.k-kpi-fig{white-space:normal;overflow-wrap:anywhere}
.k-kpi-fig .num,.k-kpi-fig b{white-space:nowrap}
/* Long card titles and "needs" markers wrap rather than push the page wider. */
.k-card-title{white-space:normal;overflow-wrap:normal;word-break:normal;min-width:min-content}   /* wrap between words only — never 'PRODUCTIO/N'; the preview beside it ellipsizes instead */
.k-needs{white-space:normal;max-width:100%;overflow-wrap:anywhere}
/* Fixed-layout tables squeeze their columns at 900–1100 px: headers wrap
   inside their column instead of spilling over the next one. */
.k-table.fixed th{white-space:normal;overflow-wrap:normal;word-break:normal;hyphens:none;vertical-align:bottom}
.k-table th .k-nowrap{white-space:nowrap}   /* f1-07: a short header never splits ('PRODUCED ▾', '1ST SALE') */   /* wrap at spaces only — never 'COMMISSI/ON' */

/* ==========================================================================
   Owner critique 2026-10-24 — shared fixes (one renderer, every page)
   ========================================================================== */
/* Horizontal strips scroll on x ONLY: a strip is never a vertical scroller (the
   phone ::after hit pads used to make it a few px tall, so it wobbled up and
   down). touch-action keeps the strip's sideways pan AND lets a vertical swipe
   that starts on it scroll the page. New strips: class k-xscroll (or k-scroll). */
.k-scroll,.k-xscroll,.k-tabs.is-phone,.k-filters.is-phone,.tabs-wrap.scrolls .tabs,.k-app-tabs,.k-filters[style*="overflow-x"]{
  overflow-y:hidden;overscroll-behavior-x:contain;overscroll-behavior-y:auto;touch-action:pan-x pan-y}
.k-xscroll{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.k-xscroll::-webkit-scrollbar{display:none}
.k-xscroll>*{flex:none}

/* Batch picker (Shell.batchPicker): class square · product · batch code · units ·
   price, one checkbox per batch, grouped by class then A–Z, search when long. */
.k-bpick{display:flex;flex-direction:column;gap:8px;min-width:0}
.k-bpick-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.k-bpick-top .k-search{flex:1 1 220px;min-width:0}
.k-bpick-top .k-search input{border:0;background:transparent;color:var(--text);font:inherit;outline:0;flex:1;min-width:0;padding:0}
.k-bpick-count{font-size:12.5px;color:var(--text-muted);margin-left:auto;font-variant-numeric:tabular-nums}
.k-bpick-chips{display:flex;gap:6px;flex-wrap:wrap;align-items:center}   /* round 2 §2c: class chips */
.k-bpick-chips .k-chip{gap:5px;padding:4px 10px}
.k-bpick-chips .k-chip .k-class{width:18px;height:18px;font-size:10px}
.k-bpick-chips .k-chip[aria-pressed="true"]{background:var(--selected-bg);color:var(--selected-fg,#fff)}
html[data-shell="phone"] .k-bpick-chips{margin:8px 0 10px}
.k-bpick-group.is-fold{cursor:pointer;user-select:none}   /* round 2 §2d: folded class groups above 12 batches */
.k-bpick-group .k-bpick-chev{margin-left:8px;display:inline-flex;transition:transform .15s}
.k-bpick-group .k-bpick-chev svg{width:14px;height:14px}
.k-bpick-group.is-open .k-bpick-chev{transform:rotate(90deg)}
.k-bpick-list{display:flex;flex-direction:column;border:1px solid var(--k-line);border-radius:14px;overflow:hidden;overflow-y:auto;max-height:340px;background:var(--surface);overscroll-behavior:contain}
.k-bpick-group{display:flex;align-items:center;gap:8px;padding:7px 12px;font-size:11.5px;font-weight:750;letter-spacing:.05em;text-transform:uppercase;color:var(--k-group-fg);background:var(--k-group-bg);position:sticky;top:0;z-index:1}   /* round 2 §14: neutral header, never the selected colour */
.k-bpick-group .sub{margin-left:auto;letter-spacing:0;text-transform:none;font-weight:600;color:var(--text-muted)}
.k-bpick-row{display:flex;align-items:center;gap:10px;padding:9px 12px;min-height:48px;box-sizing:border-box;cursor:pointer;border-top:1px solid var(--k-line);position:relative}
.k-bpick-group+.k-bpick-row{border-top:0}
.k-bpick-row input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.k-bpick-row .k-box{color:transparent}
.k-bpick-row input:checked+.k-box{background:var(--pair1-bg);border-color:var(--pair1-bg);color:#fff}
.k-bpick-row input:focus-visible+.k-box{outline:2px solid var(--text-label);outline-offset:2px}
.k-bpick-row:has(input:checked){background:var(--k-sel-bg);box-shadow:inset 3px 0 0 var(--k-sel-bar)}   /* round 2 §14 (approved 2026-10-26): a true blue tint + left bar */
.k-bpick-row:has(input:checked) .k-bpick-main b{color:var(--k-sel-fg)}
@media (hover:hover){.k-bpick-row:hover{background:var(--hover-bg)}}
.k-bpick-row.is-off{cursor:not-allowed;opacity:.5}
.k-bpick-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.k-bpick-main b{font-weight:700;color:var(--text);overflow-wrap:anywhere}
.k-bpick-main .sub{font-size:12px;color:var(--text-muted);overflow-wrap:anywhere}
.k-bpick-main .k-code{font-variant-numeric:tabular-nums}
.k-bpick-fig{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-variant-numeric:tabular-nums;text-align:right}
.k-bpick-fig b{font-weight:700;color:var(--text)}
.k-bpick-fig .sub{font-size:12px;color:var(--text-muted)}
.k-bpick-empty{padding:16px 12px;color:var(--text-muted);font-size:13px;text-align:center}
html[data-shell="phone"] .k-bpick-list{max-height:none}
html[data-shell="phone"] .k-bpick-top .k-search input{font-size:16px}
html[data-shell="phone"] .k-bpick-row{min-height:56px}

/* ==========================================================================
   Custom select (Shell.select, R55 owner 2026-10-24): ONE dropdown on every
   device. The native <select> stays underneath (hidden, the source of truth);
   button.k-cs draws the field, .k-cs-pop the menu (desktop popover / phone
   bottom sheet). API: ui.js header "CUSTOM SELECT".
   ========================================================================== */
select.k-cs-native{position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;max-width:none!important;
  padding:0!important;margin:0!important;border:0!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%)!important;overflow:hidden!important}
button.k-cs{font:inherit;text-align:left;cursor:pointer;color:var(--text);min-width:0;-webkit-tap-highlight-color:transparent}
button.k-cs:disabled,button.k-cs.is-off{cursor:not-allowed;opacity:.55}
.k-cs-val{display:block;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.k-cs-val .k-class{display:inline-flex;vertical-align:-4px;margin-right:7px}
.k-cs-badges .k-class{margin-right:4px}
.k-cs-badges{margin-right:4px}
.k-cs-ph{color:var(--text-muted)}
button.k-cs.k-select{width:100%;text-align:left}
button.k-cs-fill{display:flex;align-items:center;width:100%;min-height:0;border:0;background:transparent;padding:0;color:inherit}
button.k-cs-inline{display:inline-flex;align-items:center;border:0;background:transparent;padding:0;color:var(--text);font-weight:700;max-width:170px}
.k-chip.is-on button.k-cs-inline{color:var(--selected-fg)}
button.k-cs-inline:focus-visible,button.k-cs-fill:focus-visible{outline:2px solid var(--text-label);outline-offset:2px;border-radius:6px}
/* The arrow is drawn with ::before (ordered last) so the phone's ::after hit pad stays free. */
button.k-cs-chev::before{content:"";order:2;flex:none;width:6px;height:6px;margin:0 2px 0 8px;border-right:2px solid var(--text-label);border-bottom:2px solid var(--text-label);transform:translateY(-25%) rotate(45deg)}
.k-cs-pop{position:fixed;z-index:620;display:flex;flex-direction:column;overflow:hidden;background:var(--surface);color:var(--text);border-radius:14px;font-size:14px;
  box-shadow:0 0 0 1px var(--k-glow-ring),0 14px 40px rgba(0,0,0,.28)}
.k-cs-list{overflow-y:auto;flex:1;min-height:0;padding:4px;overscroll-behavior:contain;outline:0}
/* Suggestion list (ui.js COMBOBOX; owner 2026-11-05): head = what the list is + how many match; a tile per row
   (the cultivar code in the info tint, else initials); the typed letters marked. Phone: in the form under its field. */
.k-cb-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px 7px;border-bottom:1px solid var(--k-line);
  font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-label);flex:none}
.k-cb-n{font-variant-numeric:tabular-nums;letter-spacing:0;font-weight:700;color:var(--tint-fg);background:var(--tint-bg);border-radius:999px;padding:2px 8px;text-transform:none}
.k-cb-opt{gap:11px;min-height:40px}
.k-cb-tile{flex:none;width:28px;height:28px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:800;
  letter-spacing:.02em;line-height:1;background:var(--k-sunken);color:var(--text-muted);box-shadow:inset 0 0 0 1px var(--border-idle)}
.k-cb-tile.is-code{background:var(--tint-bg);color:var(--tint-fg);box-shadow:none}
.k-cb-opt mark{background:transparent;color:inherit;font-weight:800;text-decoration:underline;text-decoration-color:var(--tint-fg);text-decoration-thickness:2px;text-underline-offset:3px}
.k-cb-opt.is-active .k-cb-tile:not(.is-code){color:var(--text)}
.k-cb-opt.is-current{font-weight:700}.k-cb-opt.is-current::after{content:"";flex:none;width:9px;height:5px;margin:0 4px 3px auto;border-left:2px solid var(--tint-fg);border-bottom:2px solid var(--tint-fg);transform:rotate(-45deg)}
.k-cb-pop.is-inline{position:relative;z-index:auto;left:auto;top:auto;bottom:auto;width:100%;max-width:none;min-width:0;max-height:none;margin-top:6px;box-sizing:border-box;
  font-size:16px;box-shadow:0 0 0 1px var(--border-idle),0 10px 28px rgba(0,0,0,.18)}
.k-cb-pop.is-inline .k-cs-list{max-height:min(264px,46vh);padding:4px}
.k-cb-pop.is-inline .k-cb-opt{min-height:48px;padding:8px 10px;border-radius:12px}
.k-cb-pop.is-inline .k-cb-tile{width:32px;height:32px;border-radius:9px;font-size:11.5px}
:root[data-theme="dark"] .k-cb-pop.is-inline{box-shadow:0 10px 28px rgba(0,0,0,.35)}
.k-cs-opt{display:flex;align-items:center;gap:10px;min-height:36px;padding:7px 10px;border-radius:9px;cursor:pointer;color:var(--text);box-sizing:border-box;user-select:none;-webkit-user-select:none}
.k-cs-opt.is-active{background:var(--hover-bg)}
.k-cs-opt[aria-selected="true"]{font-weight:700}
.k-cs-opt.is-off{opacity:.45;cursor:not-allowed}
.k-cs-txt{flex:1;min-width:0;overflow-wrap:anywhere}
.k-cs-sub{display:block;font-size:12px;color:var(--text-muted);font-weight:500;margin-top:1px}   /* round 2 §18: two-line option rows */
.k-cs-tick{flex:none;color:var(--tint-fg);display:grid}
.k-cs-tick svg{width:15px;height:15px}
.k-cs-opt .k-box{color:transparent}
.k-cs-opt .k-box.is-on{color:#fff}
.k-cs-grp{padding:9px 10px 4px;font-size:11.5px;font-weight:750;letter-spacing:.05em;text-transform:uppercase;color:var(--text-label)}
.k-cs-grp:first-child{padding-top:5px}
.k-cs-search{display:flex;align-items:center;gap:8px;flex:none;margin:8px 8px 2px;padding:0 10px;height:36px;border-radius:10px;background:var(--k-sunken);color:var(--text-muted)}
.k-cs-search svg{width:15px;height:15px;flex:none}
.k-cs-search input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--text);font:inherit;outline:0;padding:0}
.k-cs-search:focus-within{box-shadow:0 0 0 2px var(--text-label)}
.k-cs-none{padding:12px;color:var(--text-muted);text-align:center;font-size:13px}
.k-cs-foot{display:flex;align-items:center;gap:10px;justify-content:flex-end;flex:none;padding:8px;border-top:1px solid var(--k-line)}
.k-cs-count{margin-right:auto;font-size:12.5px;color:var(--text-muted);font-variant-numeric:tabular-nums}
.k-class.is-other{background:transparent;color:var(--text-secondary);box-shadow:inset 0 0 0 1.5px var(--disclosure-ring)}
/* phone: a bottom sheet, 48px rows, 16px type (no iOS zoom) */
.k-cs-scrim{position:fixed;inset:0;z-index:610;background:var(--scrim)}
.k-cs-pop.is-sheet{left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:var(--phone-max);max-height:80vh;max-height:80dvh;border-radius:var(--r-hero) var(--r-hero) 0 0;
  padding:6px 12px calc(12px + env(safe-area-inset-bottom));font-size:16px;outline:0;box-shadow:var(--shadow-sheet)}
.k-cs-title{text-align:center;font-weight:750;font-size:15px;padding:0 8px 8px;color:var(--text)}
.k-cs-pop.is-sheet .k-cs-list{padding:0}
.k-cs-pop.is-sheet .k-cs-opt{min-height:48px;padding:10px 12px;border-radius:12px}
.k-cs-pop.is-sheet .k-cs-search{height:44px;margin:2px 0 8px}
.k-cs-pop.is-sheet .k-cs-search input{font-size:16px}
.k-cs-pop.is-sheet .k-cs-foot{padding:10px 0 0;border-top:0}
.k-cs-pop.is-sheet .k-cs-foot .k-btn{flex:1;min-height:46px}
.k-cs-pop.is-sheet .k-cs-count{flex:1}
body.k-cs-lock{overflow:hidden}
html[data-layout="phone"] button.k-cs.k-select{min-height:44px;font-size:16px}
/* FIELD PARITY (owner 2026-11-05: "the calendar textbox doesn't match the height of a regular textbox").
   A date box (button.k-date-btn) and a dropdown box (button.k-cs.k-select) are buttons drawn as fields, so
   they take a text box's height the same three ways a text box gets it:
   1. type size — every input reads 16px on the phone layout and on any touch screen (the iOS focus-zoom
      floor above), which makes a text box 45.2px there; the two buttons follow it;
   2. a bottom sheet's 48px floor (.k-sheet .k-input) — the phone dropdown rule above out-ranked it;
   3. a class square inside a dropdown box (Classes) is centred in the row, never stretches the box.
   tests/date_picker.mjs measures all three against the text boxes in the same form. */
html[data-layout="phone"] .k-date-btn{font-size:16px}
@media (pointer:coarse){ :where(html[data-shell]) :is(.k-date-btn,button.k-cs.k-select){font-size:16px} }
html[data-layout] .k-sheet :is(.k-date-btn,button.k-cs.k-select){min-height:48px;font-size:16px}
/* the class square: the value is a centred row [square][words] (never a nudged inline square — it sat 4px low on
   the owner's iPhone and stretched the box); the words keep their "…" */
button.k-cs.k-select .k-cs-val{display:flex;align-items:center;gap:7px}
button.k-cs.k-select .k-cs-val::before{content:"\200b";width:0;margin-right:-7px}   /* one line's height even when the row holds only squares */
button.k-cs.k-select .k-cs-val .k-class,button.k-cs.k-select .k-cs-badges .k-class{vertical-align:0;margin-top:0;margin-bottom:0}
button.k-cs.k-select .k-cs-val>.k-class{margin-right:0}
button.k-cs.k-select .k-cs-badges{display:flex;align-items:center;flex:none;margin-right:0}
button.k-cs.k-select .k-cs-badges:empty{display:none}
button.k-cs.k-select .k-cs-badges .k-class:last-child{margin-right:0}
button.k-cs.k-select :is(.k-cs-t,.k-cs-ph){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ==========================================================================
   VISUAL REVIEW 2026-10-24 — shared fixes (docs/VISUAL-REVIEW-ISSUES.md).
   One rule per root cause; every page picks it up. Ids in brackets.
   ========================================================================== */
/* Dark selection reads as selected: the same solid accent fill as light mode
   (segments, tabs, chips, period switch, Light|Dark) [f1-24 f3-06 f4-04] */
:root[data-shell][data-theme="dark"]{--selected-bg:#2f67bd;--selected-fg:#ffffff}
.k-seg>[aria-pressed="true"],.k-seg>.is-on{color:var(--selected-fg)}
/* a count inside the active sub-nav item stays readable on the fill [f1-34] */
.nav-sub-item.is-active :is(.count,.k-count,.k-nav-count,b,span:last-child:not(:first-child)),.k-nav-item[aria-current="page"] :is(.k-nav-count,.count),
.k-tabs [aria-current="page"] :is(.count,.k-count,b),.k-tabs [aria-selected="true"] :is(.count,.k-count,b),.k-chip.is-on :is(.count,.k-count){color:inherit;opacity:.85}

/* One focus ring: a field wrapper draws it; the bare input inside never adds a
   second square outline (text, money, %, time, date) [f1-04 f3-08 f4-05] */
:where(html[data-shell]) :is(.k-input,.field,.k-search,.k-affix,.k-money,.st-dlg .k-input) :is(input,textarea,select):is(:focus,:focus-visible){outline:none!important;box-shadow:none!important}
:is(.k-input,.k-affix,.k-money,.field):has(>input,>textarea):focus-within{outline:2px solid var(--text-label);outline-offset:1px}
input.k-input:is(:focus,:focus-visible),textarea.k-input:is(:focus,:focus-visible),input.field:is(:focus,:focus-visible){outline:2px solid var(--text-label);outline-offset:1px;box-shadow:none}
:where(html[data-shell]) input:is([type="time"],[type="date"])::-webkit-calendar-picker-indicator{opacity:.55;cursor:pointer}
:where(html[data-shell]) input:is([type="time"],[type="date"])::-webkit-datetime-edit-fields-wrapper{padding:0}
/* read-only figures are a summary value, never a focused-looking input [f4-30 f3-44] */
:is(.k-input,input.field)[readonly]:not(.k-dp-in),.st-ro{background:transparent;border-color:transparent;padding-left:0;box-shadow:none;outline:none!important;cursor:default}

/* Cards in a row keep their own height (no tall empty cards) [f1-11] */
.k-grid{align-items:start}

/* KPI rows: tiles fill each row (5 → 3 + 2 with the last row stretched; never
   a tile alone beside an empty slot); figures and labels never break mid-word
   [f1-12 f2-01 f2-13 f2-28 f3-12 f4-25] */
.k-kpis:not(.is-phone){display:flex;flex-wrap:wrap}
.k-kpis:not(.is-phone)>.k-kpi{flex:1 1 172px;min-width:min(100%,172px)}
.k-kpis:not(.is-phone)>.k-kpi.wide{flex-basis:100%}
.k-kpis.is-phone>.k-kpi:last-child:nth-child(odd){grid-column:1 / -1}
.k-kpi-label{overflow-wrap:normal;word-break:normal}
.k-kpi-fig .num,.k-kpi-fig b,.k-kpi-fig{overflow-wrap:normal;word-break:keep-all}
/* the label row holds its height: an (i) badge never pushes the figure down [f2-27] */
.k-kpi-head{min-height:28px}
.k-kpis.is-phone .k-kpi-head{min-height:20px;height:20px}
.k-kpi-head .info-btn{width:18px;height:18px;flex:none}

/* Card head on a phone: title (+ ⓘ, chevron) on one row, the summary on its own
   full-width line beneath — never a squeezed 4-line column [f1-18 f3-47 f3-53 f4-16] */
html[data-shell="phone"] .k-card-head{flex-wrap:wrap;row-gap:4px}
html[data-shell="phone"] .k-card-head>.k-card-title{flex:0 1 auto;white-space:normal;overflow-wrap:normal;word-break:normal}
html[data-shell="phone"] .k-card-head>.k-card-preview{order:20;flex:1 1 100%;white-space:normal;overflow-wrap:normal}
html[data-shell="phone"] .k-card-head>:is(.k-card-actions,.chev-btn){order:10}
/* desktop: a folded card's chevron stays in the header row; the summary wraps at its separators */
.k-card-head>.k-card-preview{min-width:0;flex:0 1 auto}

/* ONE fold header: ⓘ beside the title, the chevron at the right edge,
   vertically centred, on every collapsible card [f2-14 f4-33] */
.k-card-head>.chev-btn{order:30;margin-left:auto}
.k-card-head:has(>.k-card-actions)>.chev-btn{margin-left:0}
.k-card-head>.k-card-actions{order:25}
.k-card-head>.info-btn{order:1}.k-card-head>.k-card-title{order:0}.k-card-head>.k-card-preview{order:2}
html[data-shell="phone"] .k-card-head>.k-card-preview{order:40}

/* Chart legends: above the chart, right-aligned, wrapping right-aligned [f1-16 f2-15 f3-16 f4-17] */
.k-legend{justify-content:flex-end;row-gap:4px}
.k-legend.is-row{display:flex;width:100%;margin:0 0 8px}
html[data-shell="phone"] .k-legend{gap:4px 10px}

/* Bars: a zero part draws nothing (no 2px stub that reads as "a little") [f1-40] */
.k-bar>span[style^="flex:0 "],.k-bar>span[style*=";flex:0 "],.k-bar>span[style*="width:0%"],.k-bar>span[style*="width: 0%"]{display:none}

/* Table headers: bottom-aligned on one baseline; numeric columns right-aligned
   head and cells alike (ui.js marks the head); the ⓘ inside a head never lifts it
   [f1-07 f2-23 f4-18] */
.k-table th{vertical-align:bottom}
.k-table th .info-btn{width:16px;height:16px;vertical-align:-3px;display:inline-grid;margin-left:4px;line-height:0}
.k-table th.num{text-align:right}

/* Card search: one height and type size; the placeholder fits [f2-18 f3-09] */
/* html[data-shell] prefix: outranks a page's own .xx-search rule, so every card search is this one box */
html[data-shell] :is(.k-search,.mn-search){display:flex;align-items:center;gap:8px;height:36px;min-height:36px;padding:0 12px;border-radius:12px;background:var(--k-sunken);color:var(--text-muted);box-sizing:border-box}
html[data-shell] :is(.k-card-actions,.k-filters,.k-card-head,.k-toolbar) :is(.k-search,.mn-search){min-width:268px}
html[data-shell] :is(.k-search,.mn-search) input{flex:1;min-width:0;height:100%;font-size:14px;border:0;background:transparent;color:var(--text);font-family:inherit;outline:0;padding:0;text-overflow:ellipsis}
html[data-shell] :is(.k-search,.mn-search) input::placeholder{color:var(--text-muted);opacity:1}
html[data-shell="phone"] :is(.k-search,.mn-search){height:44px;min-height:44px}
html[data-shell="phone"] :is(.k-search,.mn-search) input{font-size:16px}
html[data-shell="phone"] :is(.k-card-actions,.k-filters,.k-card-head,.k-toolbar) :is(.k-search,.mn-search){min-width:0;flex:1 1 100%}

/* Page toolbar: one control height for the date chip, period switch, Compare
   and buttons; the row centres [f2-12 f3-48 f4-20] */
:root{--control-h:36px}
html[data-shell="desktop"] .k-page-head{align-items:center}
html[data-shell="desktop"] .k-actions{align-items:center;justify-content:flex-end;row-gap:10px}
html[data-shell="desktop"] .k-actions .k-seg{height:var(--control-h);padding:2px}
html[data-shell="desktop"] .k-actions .k-seg::before{top:2px;bottom:2px;left:2px;width:calc((100% - 4px) / var(--n))}
html[data-shell="desktop"] .k-actions .k-seg>button,html[data-shell="desktop"] .k-actions .k-seg>a{padding-top:0;padding-bottom:0;font-size:13.5px}
html[data-shell="desktop"] .k-actions :is(.k-range-chip,.k-switch,.k-btn:not(.sm)){min-height:var(--control-h);height:var(--control-h);box-sizing:border-box}
html[data-shell="desktop"] .k-actions .k-btn:not(.sm){padding-top:0;padding-bottom:0}
/* the head never strands one control on its own row: the title block takes
   its line, the controls wrap as one right-aligned group [f1-10 f2-13 f2-20 f3-11] */
/* section tab strips scroll sideways, never wrap to a second row [f3-11] */
html[data-shell="desktop"] .k-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
html[data-shell="desktop"] .k-tabs::-webkit-scrollbar{display:none}

/* Filter rows on a phone: one sideways strip, never a chip cut off with no way
   to reach it [f1-23 f4-44] */
html[data-shell="phone"] .k-filters{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
  -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);padding-right:24px}
html[data-shell="phone"] .k-filters::-webkit-scrollbar{display:none}
html[data-shell="phone"] .k-filters>*{flex:none}
html[data-shell="phone"] .k-filters .k-chip:not(.is-on){background:var(--k-sunken)}

/* Two-option switches: one size (the shared bordered switch), never clipped [f1-15 f3-49 f2-38] */
html[data-shell="desktop"] .k-card .k-seg{padding:2px}
html[data-shell="desktop"] .k-card .k-seg::before{top:2px;bottom:2px;left:2px;width:calc((100% - 4px) / var(--n))}
html[data-shell="desktop"] .k-card .k-seg>button,html[data-shell="desktop"] .k-card .k-seg>a{padding:4px 12px;font-size:12.5px}
html[data-shell="phone"] .k-card .k-seg:not(.is-phone){max-width:100%;overflow-x:auto;scrollbar-width:none}

/* Phone: a closed sheet is never a scroller the page can measure (the page
   ended in ~1,000px of blank under the last card) [f2-09 f4-09] */
.sheet:not(.is-on){overflow:hidden!important;max-height:0!important}

/* Sheets: one shell. Grab handle, centred title + context line, ONE scroll area,
   the footer pinned as the last thing in the sheet — nothing renders after it
   [f1-02 f1-03 f3-44 f4-41 f2-05 f4-07 f2-37] */
.k-gsheet:has(.k-sheet-foot){overflow:hidden;padding-bottom:0}
.k-gsheet:has(.k-sheet-foot)>.k-gsheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:0 -16px;padding:0 16px}
.k-gsheet:has(.k-sheet-foot)>.k-gsheet-body .k-sheet-foot{position:sticky;bottom:0;z-index:2;margin:12px -16px 0;padding:10px 16px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface);box-shadow:none}
.k-gsheet:has(.k-sheet-foot)>.k-gsheet-body .k-sheet-foot>.k-btn{flex:none}
.k-gsheet:has(.k-sheet-foot)>.k-sheet-title{flex:none}
html[data-shell] :is(.k-gsheet,.sheet,.modal,.k-dialog) .k-bpick-list{max-height:none!important;overflow:hidden}
.k-gsheet .k-sheet-sub{text-align:center;font-size:13px;color:var(--text-muted)}
/* the money dialog on a phone = the same sheet */
.sheet.md-sheet{height:auto;max-height:calc(100dvh - max(26px, env(safe-area-inset-top) + 10px));border-radius:var(--r-hero) var(--r-hero) 0 0}
.md-sheet>.sheet-head{border-bottom:0;padding:6px 16px 4px;min-height:0;text-align:center;align-items:center}
.md-sheet>.sheet-head .sheet-grab{margin:2px auto 10px}
.md-sheet>.sheet-head h2{font-size:18px;font-weight:760}
.md-sub{font-size:13px;color:var(--text-muted);font-weight:500;margin-top:3px;line-height:1.35}
.modal-head .md-sub{font-size:12.5px}
.md-sheet>.sheet-body{padding-top:8px}
.md-sheet>.sheet-foot{flex-direction:column;align-items:stretch;gap:8px}
.md-sheet>.sheet-foot>.btn-primary,.md-sheet>.sheet-foot>.btn-danger,.md-sheet>.sheet-foot>.btn-soft{flex:none;width:100%;min-height:50px;border-radius:14px;font-size:16px}
.md-sheet .md-confirm .acts{flex-direction:column}
.md-sheet .md-confirm .acts>*{width:100%;min-height:50px}
.md .field-label,.k-dialog .field-label,.sheet .field-label,.modal .field-label{text-transform:none;letter-spacing:0;font-size:12.5px;font-weight:650;margin-bottom:6px}
/* desktop dialogs: one header — title, context line under it, a divider */
.k-dialog-head{border-bottom:1px solid var(--k-line);padding:16px 22px 14px;min-height:64px;box-sizing:border-box}
.k-dialog-head+.k-dialog-body{padding-top:16px}
.k-dialog-head .k-dialog-sub{margin-top:3px}
.k-label .req,.field-label .req{margin-left:2px}
/* validation messages sit in the pinned footer, where the press was [f2-08] */
.sheet-foot>.status:not(:empty),.k-sheet-foot>.k-err:not(:empty){display:block}

/* Toasts never sit on top of an open popover or sheet: desktop bottom-right,
   phone above an open sheet (top of the screen) [f1-06 f4-08] */
html[data-shell="desktop"] .toast:not(.phone-toast){left:auto;right:28px;transform:none}
body:has(.sheet.is-on,.k-sheet,.k-cs-pop.is-sheet,.k-datepick.is-phone,.modal.md) :is(.toast,.k-toast){top:calc(12px + env(safe-area-inset-top));bottom:auto!important}   /* !important: pos.js sets an inline bottom over the order bar; with top that stretched the toast into a tall panel */
html[data-layout="desktop"] .k-toast{left:28px;transform:none;animation-name:k-toast-in-l}
html[data-layout="desktop"] .k-toast.is-col{transform:translateX(-50%);animation-name:k-toast-in}   /* ui.js centres it on the product column [f4-08] */
@keyframes k-toast-in-l{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* Workspace menu: inside the sidebar, its focus ring never clipped [f1-26] */
#ws-pop{min-width:100%;width:max-content;max-width:min(360px,calc(100vw - 24px));box-sizing:border-box;overflow:visible}
#ws-pop :is(button,a){outline-offset:-2px}

/* Custom dropdown panel in dark: one step lighter surface, a border, elevation [f2-40] */
:root[data-theme="dark"] .k-cs-pop{background:#15223f;border:1px solid var(--border-field);box-shadow:0 18px 44px rgba(0,0,0,.6)}

/* Info callouts run the card's full width [f4-11] */
.app.k-app-desk .k-page :is(.k-note,.notice,.k-callout){max-width:none}

/* Empty states: one muted, compact style [f3-46] — see .k-empty above */

/* A batch-code chip keeps its own width on a phone row [f3-13] */
.k-code{width:auto;max-width:max-content;align-self:flex-start;flex:none}
/* a class badge and its number never part at a line end [f3-05] */
.k-pair{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}

/* Summary lists (label · value): the value column is never pushed off-screen;
   long labels wrap instead [f3-03] */
.k-totals th{white-space:normal;overflow-wrap:normal;max-width:60vw}
.k-totals td{min-width:max-content}
html[data-shell="phone"] .k-totals{align-items:stretch}
html[data-shell="phone"] .k-totals table{width:100%}
html[data-shell="phone"] .k-totals th{text-align:left;padding-right:10px}

/* Pager: hidden on a one-page list; page numbers follow the total [f1-21 f4-23]. Owner 2026-11-05: only a LONE PAGE
   NUMBER hides — the phone draws no numbers, so page 1 of a longer list is a lone "Next ›" and must stay. */
.k-pager-btns:not(:has(a:nth-child(2))):has(a.is-on){display:none}

/* Quantity steppers: one look — rounded, centred glyphs, the ring on the whole
   control, a value box that never overlaps the buttons [f4-28] */
.k-stepper{border-radius:999px;min-width:124px;justify-content:space-between}
.k-stepper button{display:grid;place-items:center;width:38px;flex:none;padding:0}
.k-stepper :is(input,span){min-width:44px;flex:1 1 auto;width:48px;text-align:center;border:0;background:transparent;font:inherit;font-weight:700;color:var(--text);padding:0;outline:none}
.k-stepper:focus-within,.stepper:focus-within{outline:2px solid var(--text-label);outline-offset:1px}
.stepper{border-radius:999px;min-width:124px;justify-content:space-between;overflow:hidden}
.stepper button{display:grid;place-items:center;flex:none;padding:0;border-radius:50%}
.stepper input{flex:1 1 auto;min-width:40px;padding:0;outline:none!important;box-shadow:none!important}
.k-stepper input:focus,.k-stepper input:focus-visible{outline:none!important;box-shadow:none!important}

/* Read-only terms in a form read as values, not dashed inputs [f3-44] */
.st-ro{border-style:solid}

/* Range brush / scrubber: a slim track with a 20px round thumb [f1-17 f2-43 f3-37] */
.scrub::-webkit-slider-thumb{width:20px!important;height:20px!important;margin-top:-7px!important;border-radius:50%!important;background:var(--surface)!important;border:2px solid var(--series-primary)!important}
.scrub::-moz-range-thumb{width:20px!important;height:20px!important;border-radius:50%!important;background:var(--surface)!important;border:2px solid var(--series-primary)!important}

/* Date-range picker: From/To are text chips the calendar drives (no native
   picker); in-range days a light fill, the two ends solid [f1-05 f2-07 f3-45 f4-31] */
.k-dp-in{cursor:pointer;font-variant-numeric:tabular-nums;caret-color:transparent}
.k-cal-d.is-in{background:rgba(47,107,214,.16)!important;background:color-mix(in srgb,var(--selected-bg) 16%,transparent)!important;color:var(--text)!important}
.k-cal-d.is-from,.k-cal-d.is-to{background:var(--selected-bg)!important;color:var(--selected-fg)!important}

/* Aging amber reads amber in light mode; the 90+ swatch is the 90+ red [f2-30] */
:root[data-shell]:not([data-theme="dark"]) :is(.f-amber,.k-sw.f-amber,.k-kpi-dot.is-amber,.k-dot.is-amber){background:#e3a21a}

/* Header ⓘ tip: start-aligned under the icon (ui.js flips it above when it would
   cover the next card's title) [f4-42] */
.k-tip{max-width:320px}

/* Section header monogram aligns with the title line, not the whole block [f1-35] */
/* a section band's monogram sits on the title line, not the middle of title + description [f1-35] */
.k-page .ov-band>.k-mono{align-self:flex-start;margin-top:1px}
/* the count on the active settings sub-nav item [f1-34] */
.st-nav a.is-on .num,.st-nav a[aria-current] .num{color:inherit;opacity:.85;background:transparent}
/* Phone charts: the fixed read-out panel is the one place a day's figures show
   (no floating callout repeating it over the bars) [f1-17] */
.k-chart.is-ph .k-chart-plot svg .tip{display:none}
.scrub{height:32px}
.k-datepick-cal{position:relative}
.k-dp-pager{position:absolute;top:-4px;right:0;display:flex;gap:4px;z-index:1}
.k-dp-nav{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;color:var(--tint-fg);font-size:18px;line-height:1;background:var(--k-sunken)}
.k-dp-nav:disabled{opacity:.35;cursor:default}
/* card link rows (ui.js polish): bottom-right, "X →" [f1-14 f3-31 f3-32 f4-12] */
.k-card-foot-links{display:flex;justify-content:flex-end;align-items:center;gap:14px;flex-wrap:wrap;margin-top:12px}
.k-card>.k-card-foot-link{display:flex;justify-content:flex-end;margin-top:12px;margin-left:auto;width:max-content}
/* a table that scrolls sideways keeps its status/action column pinned and shows an
   edge cue; a day-group header stays within the visible width [f2-02 f3-10 f4-02] */
:is(.k-tscroll,.k-xs).is-x{position:relative}
:is(.k-tscroll,.k-xs).is-x .k-table:not(.k-nopin) tr>:last-child:not([colspan]){position:sticky;right:0;z-index:1;background:var(--surface);box-shadow:-12px 0 12px -10px rgba(10,30,70,.28)}
/* the scroll cue [f3-10 f4-02]: a column running under the pinned last column FADES out (never a hard cut like 'LAST SAL' / 'V'), until the scroller reaches its end */
:is(.k-tscroll,.k-xs).is-x .k-table tr>:last-child:not([colspan])::before{content:"";position:absolute;top:0;bottom:0;right:100%;width:36px;pointer-events:none;background:linear-gradient(to right,transparent,var(--surface) 85%)}
:is(.k-tscroll,.k-xs).is-x .k-table tr.is-selected>:last-child::before{background:linear-gradient(to right,transparent,var(--k-sel-bg) 85%)}
:is(.k-tscroll,.k-xs).is-x.at-end .k-table tr>:last-child:not([colspan]){box-shadow:none}
:is(.k-tscroll,.k-xs).is-x.at-end .k-table tr>:last-child:not([colspan])::before{display:none}
/* mid-width hook for page tables: a low-priority column (By, Lines, Fee note…) tagged k-lowpri steps out below 1180px of desktop viewport [f4-02] */
@media (max-width:1179px){html[data-shell="desktop"] .k-table .k-lowpri{display:none}}
:is(.k-tscroll,.k-xs).is-x .k-table tr>[colspan]>*{position:sticky;left:0;max-width:var(--tsw,100%);box-sizing:border-box}
:is(.k-tscroll,.k-xs).is-x .k-table tr.is-selected>:last-child{background:var(--k-sel-bg)}
.k-phone .info-btn::after{inset:min(-12px,calc((100% - 44px) / 2))}
.k-act-btns{display:inline-flex;align-items:center;gap:8px;flex-wrap:nowrap;margin-left:auto}
html[data-shell="desktop"] .k-actions{gap:10px}
html[data-shell="desktop"] .k-actions .k-seg>button,html[data-shell="desktop"] .k-actions .k-seg>a{padding-left:14px;padding-right:14px}
/* desktop page head: the title block and the page's buttons share the first row;
   the period controls (date · switch · Compare) follow as one right-aligned unit,
   on the same row when there is room, else on the next [f1-10 f2-13 f2-20 f3-11 f4-20] */
html[data-shell="desktop"] .k-page-head{align-items:center;row-gap:12px}
html[data-shell="desktop"] .k-page-head>.k-actions{display:contents}
html[data-shell="desktop"] .k-page-head>:not(.k-actions){flex:1 1 auto;order:0}
html[data-shell="desktop"] .k-page-head>.k-actions>*{order:1}
html[data-shell="desktop"] .k-page-head>.k-actions>:is(span,div):has(.k-period){order:2;margin-left:auto;flex:0 1 auto;width:auto;max-width:100%;min-width:0}
html[data-shell="desktop"] .k-page-head>.k-actions>.k-act-btns{margin-left:auto}
button.k-link.k-csv-link,.k-csv-link{background:none;border:0;padding:0;font:inherit;font-size:12.5px;font-weight:700;color:var(--k-series);cursor:pointer;white-space:nowrap}
/* phone KPI pairs: no tile spans mid-row; only an odd last tile takes the row [f1-12 f2-28 f3-12] */
.k-kpis.is-phone>.k-kpi.wide:not(:last-child){grid-column:auto}
/* a two-option switch inside a card on a phone is compact, not a full-width bar [f1-15] */
html[data-shell="phone"] .k-card .k-seg.is-phone:not(:has(>:nth-child(3))){width:max-content;max-width:100%;padding:2px}
html[data-shell="phone"] .k-card .k-seg.is-phone:not(:has(>:nth-child(3)))::before{top:2px;bottom:2px;left:2px;width:calc((100% - 4px) / var(--n))}
html[data-shell="phone"] .k-card .k-seg.is-phone:not(:has(>:nth-child(3)))>:is(button,a){min-height:34px;padding:0 16px;font-size:13.5px}
.k-nowrap{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.k-nowrap>.info-btn{margin-left:0}
/* every period toolbar (page head or a tab's own row): one control height,
   date chip · switch · Compare on one line [f3-11 f3-48 f2-12] */
html[data-shell="desktop"] .k-period{gap:10px}
html[data-shell="desktop"] .k-period .k-seg{height:var(--control-h);padding:2px}
html[data-shell="desktop"] .k-period .k-seg::before{top:2px;bottom:2px;left:2px;width:calc((100% - 4px) / var(--n))}
html[data-shell="desktop"] .k-period .k-seg>button{padding:0 14px;font-size:13.5px}
html[data-shell="desktop"] .k-period :is(.k-range-chip,.k-switch){min-height:var(--control-h);height:var(--control-h);box-sizing:border-box}
/* desktop inline confirm keeps the step-1 footer layout: the question at the left,
   compact Back / Confirm at the right [f2-37] */
.modal .md-confirm{display:flex;align-items:center;gap:10px 14px;flex-wrap:wrap}
/* round 2 §2g: the confirm table on top of a money dialog (desktop: centred card; phone: sheet on top) */
.md-confirm-pop{position:fixed;inset:0;z-index:95;background:rgba(0,0,0,.38);background:color-mix(in srgb,var(--text) 38%,transparent);display:flex;align-items:center;justify-content:center;padding:16px}
.md-confirm-card{background:var(--surface);color:var(--text);border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.35);padding:18px 20px;width:min(100%,520px);max-height:100%;overflow:auto;display:flex;flex-direction:column;gap:12px}
.md-confirm-card h3{margin:0;font-size:17px}
.md-confirm-card .md-sub{color:var(--text-muted);font-size:13px;margin-top:-6px}
/* Confirm sale lines (owner 2026-10-30): square · product · Qty · Price · Total, totals in the foot */
.sl-cf-lines{margin:10px 0 6px;font-size:13.5px;font-variant-numeric:tabular-nums}
.sl-cf-lines th{padding:0 4px 7px;border-bottom:1px solid var(--k-line)}
.sl-cf-lines td{padding:8px 4px;border-top:0;border-bottom:1px solid var(--k-line)}
.sl-cf-lines th.num,.sl-cf-lines td.num{text-align:right;white-space:nowrap}
.sl-cf-lines tfoot th,.sl-cf-lines tfoot td{border-top:1.5px solid var(--text);border-bottom:0;padding-top:9px;font-weight:800;font-size:15px;color:var(--text);text-transform:none;letter-spacing:0}
.sl-cf-prod{display:inline-flex;align-items:center;gap:8px;font-weight:650;color:var(--text)}
.sl-cf-prod>span{display:flex;flex-direction:column;min-width:0}
.sl-cf-prod .sub{font-size:12px;font-weight:500;color:var(--text-muted);white-space:normal}
.md-confirm-card .md-rows+.sl-cf-lines{margin-top:4px}
.md-rows{width:100%;border-collapse:collapse;font-size:13.5px;font-variant-numeric:tabular-nums}
.md-rows th{white-space:normal;overflow-wrap:anywhere;text-align:left;font-weight:600;color:var(--text-muted);padding:7px 0;border-top:1px solid var(--k-line);vertical-align:top}
.md-rows td{white-space:normal;overflow-wrap:anywhere;text-align:right;font-weight:650;padding:7px 0 7px 12px;border-top:1px solid var(--k-line)}
.md-rows tr:first-child th,.md-rows tr:first-child td{border-top:0}
.md-rows tr.is-sub th,.md-rows tr.is-sub td{color:var(--text-muted);font-weight:500}
.md-rows tr.is-net th,.md-rows tr.is-net td,.md-rows tr.is-total th,.md-rows tr.is-total td{border-top:1.5px solid var(--text);font-weight:800;font-size:15px;color:var(--text)}
.md-rows tr.is-amber th,.md-rows tr.is-amber td{color:var(--k-amber)}
.md-rows tr.is-red th,.md-rows tr.is-red td{color:var(--k-red-soft)}
.md-rows tr.is-green td{color:var(--success-fg)}
.md-confirm-card .acts{display:flex;gap:10px;justify-content:flex-end;margin-top:4px}
.md-confirm-card .status{display:block;font-size:12.5px}
.md-confirm-card .status.error{color:var(--k-red-soft)}
.md-confirm-pop.is-sheet{align-items:flex-end;padding:0}
.md-confirm-pop.is-sheet .md-confirm-card{width:100%;border-radius:18px 18px 0 0;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
.md-confirm-pop.is-sheet .acts{flex-direction:column}
.md-confirm-pop.is-sheet .acts>*{width:100%;min-height:50px}
.modal .md-confirm .q{flex:1 1 320px;margin:0;font-size:14px;line-height:1.4}
.modal .md-confirm .acts{flex:none;margin-left:auto}
.modal .md-confirm .acts>*{flex:none;min-width:0}
.modal .md-confirm>.status{flex:1 1 100%;margin-top:0!important}
.modal .md-confirm>.status:empty{display:none!important}
.modal .md-confirm.confirm-danger{padding:10px 14px}
/* the small kit modal (Change Password, simple forms) on a phone = the same
   bottom sheet as every form: grab handle, centred title, action over Cancel [f4-07] */
html[data-shell="phone"] .modal:not(.wide){inset:auto 0 0 0;margin:0 auto;width:100%;max-width:var(--phone-max);height:auto;max-height:calc(100dvh - 26px);border-radius:var(--r-hero) var(--r-hero) 0 0}
html[data-shell="phone"] .modal:not(.wide) .modal-head{flex-direction:column;justify-content:center;min-height:0;padding:8px 16px 10px;border-bottom:0;position:relative}
html[data-shell="phone"] .modal:not(.wide) .modal-head::before{content:"";width:40px;height:5px;border-radius:3px;background:var(--border-idle);margin:2px auto 10px}
html[data-shell="phone"] .modal:not(.wide) .modal-head h2{text-align:center}
html[data-shell="phone"] .modal:not(.wide) .modal-head>.icon-btn{display:none}
html[data-shell="phone"] .modal:not(.wide) .modal-body{padding:4px 16px 12px}
html[data-shell="phone"] .modal:not(.wide) .modal-foot{flex-direction:column;align-items:stretch;gap:8px;padding:10px 16px calc(14px + env(safe-area-inset-bottom))}
html[data-shell="phone"] .modal:not(.wide) .modal-foot>.status{order:0}
html[data-shell="phone"] .modal:not(.wide) .modal-foot>:is(.btn-primary,.btn-danger){order:1;width:100%;min-height:50px;border-radius:14px;font-size:16px}
html[data-shell="phone"] .modal:not(.wide) .modal-foot>.btn-soft{order:2;width:100%;min-height:50px;border-radius:14px;font-size:16px}
.k-period-sw{display:inline-flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0;max-width:100%}
html[data-shell="desktop"] .k-period .k-seg>button{padding:0 12px}
html[data-shell="desktop"] .k-period .k-switch{padding:2px 4px 2px 10px;gap:6px}
html[data-shell="desktop"] .k-period .k-range-chip{padding-left:12px;padding-right:12px}
html[data-shell="desktop"] .k-page-head .k-period{justify-content:flex-end}
/* INV-01 stock ledger (Shell.stockLedger) — Facility › Statements and Inventory › LMP Inventory */
.k-sl-sub{font-size:12.5px;color:var(--text-muted)}
.k-sl-err{color:var(--danger-fg);font-size:13px;padding:6px 0}
.k-sl-roll{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--k-line);font-size:13.5px}
.k-sl-roll>span:first-child{flex:1;min-width:0}
.k-sl-roll>b{white-space:nowrap;font-variant-numeric:tabular-nums}
.k-sl-roll .sub{display:block;font-size:12px;color:var(--text-muted);font-weight:400}
.k-sl-roll.is-total{border-top:1px solid var(--chart-grid)}
.k-sl-roll.is-aside{border-top:1px dashed var(--k-line);color:var(--text-muted)}
.k-sl-roll.is-aside>b{color:var(--text-muted);font-weight:600}
.k-sl-neg{color:var(--k-red-soft)}
.k-sl-note{font-size:12.5px;color:var(--text-muted);text-align:right}
.k-sl-more{background:none;border:0;padding:8px 0 0;color:var(--accent);font:inherit;font-size:13px;font-weight:650;cursor:pointer;text-decoration:underline}
.k-sl-wrap{overflow-x:auto}
.k-sl-line{display:flex;gap:10px;align-items:center;padding:10px 0;border-top:1px solid var(--k-line);min-width:0}
.k-sl-line>.k-sl-main{flex:1;min-width:0}
.k-sl-line .sub{display:block;font-size:12px;color:var(--text-muted);overflow-wrap:anywhere}
.k-sl-end{text-align:right;white-space:nowrap}
.k-sl-end .sub{display:block;font-size:12px;color:var(--text-muted);text-align:right}

/* ONE two-option switch size on a phone, and a sort switch inside a sideways chip
   strip comes FIRST so it is never cut at the strip's edge [f3-49] */
html[data-shell="phone"] .k-seg>button,html[data-shell="phone"] .k-seg>a{font-size:14px;min-height:40px}
html[data-shell="phone"] .k-filters>.k-seg{order:-1;flex:none}
/* The batch picker inside a dialog or sheet is part of the ONE dialog scroll — never a
   nested scroll box that cuts a row in half [f2-37] */
:is(.modal,.md,.sheet,.k-sheet,.k-dialog,.mf-dlg) .k-bpick-list{max-height:none;overflow-y:visible}

/* Sell app: Incoming transfers under the Sell tab's header (owner 2026-10-30) — empty slot takes no room */
.sl-incoming{display:none;flex-direction:column;gap:12px;margin-bottom:12px}
.sl-incoming.is-on{display:flex}
/* Phone keyboard: no shell-side lift since item 62 (owner 2026-11-01) — Safari pans the page itself; see ui.js. */

/* ===== UI round A (owner 2026-11-04, desktop only; the phone keeps its stacked card) =====
   An order line is ONE row: class · name (its batch link under it) · Qty · Price · [Comm] · TOTAL · remove.
   Rows are white in light mode with a hairline, no gray fill. pos.js adds .is-row above the caller's rowAt width. */
html:not([data-shell=phone]) .k-oline.is-row{display:grid;grid-template-columns:20px minmax(0,1fr) auto auto auto 32px;gap:6px 12px;align-items:center;padding:8px 12px 8px 14px;background:var(--surface);box-shadow:0 0 0 1px var(--k-line)}
html:not([data-shell=phone]) .k-oline.is-row.has-comm{grid-template-columns:20px minmax(0,1fr) auto auto auto auto 32px}
html:not([data-shell=phone]) .k-oline.is-row>.k-oline-top,html:not([data-shell=phone]) .k-oline.is-row>.k-oline-grid{display:contents}
html:not([data-shell=phone]) .k-oline.is-row>.k-oline-top>.k-class{grid-column:1;grid-row:1}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-name{grid-column:2;grid-row:1;white-space:normal}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-name .k-oline-nm{white-space:nowrap}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-name .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-name .k-oline-batch{padding:0;font-size:12px}
html:not([data-shell=phone]) .k-oline.is-row>.k-oline-grid>.k-oline-cell:nth-child(1){grid-column:3;grid-row:1}
html:not([data-shell=phone]) .k-oline.is-row>.k-oline-grid>.k-oline-cell:nth-child(2){grid-column:4;grid-row:1}
html:not([data-shell=phone]) .k-oline.is-row>.k-oline-grid>.k-oline-cell.is-pros{grid-column:5;grid-row:1}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-sum{grid-column:5;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:64px}
html:not([data-shell=phone]) .k-oline.is-row.has-comm .k-oline-sum{grid-column:6}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-sum .k-oline-tot{height:40px;display:inline-flex;align-items:center;font-weight:800;font-variant-numeric:tabular-nums;padding-left:2px}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-x{grid-column:6;grid-row:1}
html:not([data-shell=phone]) .k-oline.is-row.has-comm .k-oline-x{grid-column:7}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-pin .sub{display:none}   /* the box IS the target price — no "ea · at Target" */
html:not([data-shell=phone]) .k-oline.is-row .k-oline-bid,html:not([data-shell=phone]) .k-oline.is-row .k-oline-over{grid-column:1 / -1}
/* the Sell app splits the page evenly from 1100px; the card is titled Pending Order */
@media (min-width:1100px){html:not([data-shell=phone]) .k-pos{grid-template-columns:minmax(0,0.92fr) minmax(0,1.08fr)}}   /* "split the difference": the order card a touch wider than half */
/* a Direct Sale's Pending Order header: a hairline and 18px above it, under the A–E cards */
html:not([data-shell=phone]) .sf-olines .k-order-head{margin-top:18px;padding-top:18px;border-top:1px solid var(--k-line);margin-bottom:12px}
/* dialog head: the title gets room under it before the LP line */
.modal.wide .modal-head{align-items:flex-start;padding-top:16px;padding-bottom:14px}
.modal.wide .modal-head .k-dialog-sub,.modal.wide .modal-head .md-sub{margin-top:8px}
/* New Transfer: the Pending Transfer block and its table — blue caps headers, white rows, "Total" */
html:not([data-shell=phone]) .fx-pend-head{display:flex;align-items:baseline;gap:10px;margin:18px 0 10px;padding-top:18px;border-top:1px solid var(--k-line)}
html:not([data-shell=phone]) .fx-pend-head h2{font-size:16px;font-weight:800;margin:0}
html:not([data-shell=phone]) .fx-pend-head .sub{margin-left:auto;font-size:12.5px;color:var(--text-muted)}
.fx-lines .k-table th{color:var(--text-label);font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
/* batch picker as class cards (New Transfer): coloured class header, rows in a ringed card, B–E folded */
.k-bpick.is-cards .k-bpick-group{margin-top:10px;border-radius:12px;font-weight:800}
.k-bpick.is-cards .k-bpick-group.is-open{border-radius:12px 12px 0 0}
.k-bpick.is-cards .k-bpick-group:first-child{margin-top:0}
.k-bpick.is-cards .k-bpick-group.is-a{background:var(--cls-a-bg);color:var(--cls-a-fg)}.k-bpick.is-cards .k-bpick-group.is-b{background:var(--cls-b-bg);color:var(--cls-b-fg)}
.k-bpick.is-cards .k-bpick-group.is-c{background:var(--cls-c-bg);color:var(--cls-c-fg)}.k-bpick.is-cards .k-bpick-group.is-d{background:var(--cls-d-bg);color:var(--cls-d-fg)}
.k-bpick.is-cards .k-bpick-group.is-e{background:var(--cls-e-bg);color:var(--cls-e-fg)}
.k-bpick.is-cards .k-bpick-group .sub{color:inherit;opacity:.9}
.k-bpick.is-cards .k-bpick-card{box-shadow:0 0 0 1px var(--k-line);border-radius:0 0 12px 12px;overflow:hidden;background:var(--surface)}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-pin{min-width:108px;box-sizing:border-box}
html:not([data-shell=phone]) .k-oline.is-row .k-oline-pin input{width:72px}

/* the Sell app's order card is narrower than the Direct Sale dialog: compact controls so the one row fits at 1100px */
html:not([data-shell=phone]) .k-pos .k-oline.is-row{gap:6px 8px;padding:8px 10px 8px 12px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-stepper{height:36px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-stepper button{width:28px;height:36px;font-size:16px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-stepper input.k-qin{width:40px;height:36px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-pin{min-width:92px;height:36px;min-height:36px;padding:0 8px 0 10px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-pin input{width:60px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-cell.is-pros{min-width:76px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-cell.is-pros .k-cs{min-width:76px;min-height:36px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-sum{min-width:56px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-sum .k-oline-tot{height:36px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-x{width:28px;height:28px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-name{min-width:72px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-name .k-oline-nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block;text-align:left}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-cell.is-pros .k-cs,html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-cell.is-pros{width:76px;min-width:76px;max-width:76px}
html:not([data-shell=phone]) .k-pos .k-oline.is-row .k-oline-cell.is-pros .k-cs-val{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Item 38 (2026-11-06): a partner's name for an LMP batch — its arrival — is plain text, never a code chip. */
.k-ref{display:inline-block;max-width:100%;color:var(--text-muted);font-size:12px;font-weight:500;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
/* D1 (2026-11-06): the facility record's folded side cards sit in a narrow column — their summary takes its own
   full-width line under the title (as on a phone), never running under the chevron or past the card edge. */
.fx-fold .k-card-head{flex-wrap:wrap;row-gap:4px}
.fx-fold .k-card-head>.k-card-preview{order:40;flex:1 1 100%;white-space:normal;overflow-wrap:normal}
/* Item 18 (owner 2026-11-06): every full-width Sell app button is 50px — Complete sale, the confirm sheet's pair
   (Confirm sale · Back, and every Pos.confirmRows sheet), New sale. The order bar keeps its 56px frame. */
.k-complete{min-height:50px;height:50px}
.md-confirm-pop .acts>button{min-height:50px;height:50px;box-sizing:border-box}
/* Item 3 (2026-11-06): a facility below zero — the owner owes it — reads in green. */
.ov-owes,.fx-owes{color:var(--success-fg)}
/* S23 (owner ruling 2026-11-06): in View as, every commit button reads greyed — "View only". Forms still open, so the owner
   sees exactly what the person sees; a submit is stopped before it is sent (shared.js api). */
html.is-viewas :is(.k-complete,.k-btn.is-primary,.k-btn.is-danger,.btn-primary,.btn-danger,[data-ci="yes"]){opacity:.45;cursor:not-allowed;filter:saturate(.4)}
/* Owner 2026-11-06: the (i) explanations show on the owner's own sign-in only. Everyone else keeps the same box —
   visibility, never display — so not one pixel of layout moves when they are hidden. */
html:not([data-tips="on"]) .info-btn{visibility:hidden;pointer-events:none}
/* G07 (owner ruling 2026-11-06, mock round B; red in both apps): the connection-lost bar. */
.k-lost{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border-radius:12px;background:var(--danger-bg,rgba(220,38,38,.08));border-left:3px solid var(--danger-fg);font-size:13px;color:var(--text)}
.k-lost-text{flex:1;min-width:0}
.k-lost-text b{color:var(--danger-fg)}
.k-lost-note{font-size:12px;color:var(--text-muted);margin-top:6px}
.k-ord-err:has(.k-lost){color:inherit;font-weight:500}

/* AV-1 (fix batch 3): a No charge sale line — reads "No charge", never $0.00 (Shell.linesTable, sale record, field
   console). The control is a chip-sized toggle beside the line's price. */
.k-nc, .sl-nc { color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.k-nc-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-field); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.k-nc-btn[aria-pressed="true"] { background: var(--selected-bg); border-color: var(--accent); color: var(--selected-fg); }
.k-nc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.k-oline-cell.is-nc { align-self: end; }
/* Desktop one-row order line: the toggle sits under the Price box (row 2), its empty label hidden. */
html:not([data-shell=phone]) .k-oline.is-row>.k-oline-grid>.k-oline-cell.is-nc { grid-column: 4; grid-row: 2; justify-self: start; align-self: start; }
html:not([data-shell=phone]) .k-oline.is-row .k-oline-cell.is-nc>.k-oline-lab { display: none; }
