/* ════════════════════════════════════════════════════════════════════════════
   Gestano — canonical application stylesheet (the design system).
   Distilled from the 7 Artifact mockups (seed/) — ONE token set, ONE component
   vocabulary, imported by base.html. Mobile-first; the dark sidebar shell + warm
   off-white surface + deep-green accent are the brand signature.

   Layout map:
     .app   = sidebar(232px) + main grid          (mobile: sidebar → off-canvas drawer)
     .side  = dark nav rail (brand / company / nav / user)
     .main  = .mobilebar (mobile) + optional .topbar + .content

   Sections (search the ═══ banners):
     SELF-HOSTED WEBFONTS · DESIGN TOKENS (:root) · APP SHELL (sidebar · nav · main ·
     status bar) · BUTTONS · PAGE PRIMITIVES (KPIs · panels · bars · pills/badges) ·
     LIST ARCHETYPE (toolbar · sortable tables) · FORMS (· detail cards · alerts · login) ·
     RESPONSIVE · RELATION HUB (tabbed detail card · standing/type pills · ckdrop pickers).
   ════════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════════
   SELF-HOSTED WEBFONTS (perf: no render-blocking Google Fonts fetch — woff2 served
   from /static/fonts; font-display:swap). Families (FND-09, redesign F1): Figtree (body, tables,
   amounts — tabular figures), Familjen Grotesk (headings, key amounts), both latin + latin-ext so
   Maltese/Italian names (Xagħra, Żebbuġ) never fall back. IBM Plex Mono = codes only.
   ════════════════════════════════════════════════════════════════════════════ */
@font-face { font-family:'Figtree'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/figtree-latin-400-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/figtree-latin-ext-400-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/figtree-latin-500-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/figtree-latin-ext-500-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/figtree-latin-600-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/figtree-latin-ext-600-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/figtree-latin-700-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/figtree-latin-ext-700-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-400-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-ext-400-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-500-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-ext-500-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-600-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-ext-600-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-700-normal.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Familjen Grotesk'; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/familjen-grotesk-latin-ext-700-normal.woff2') format('woff2'); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/ibm-plex-mono-v20-latin-regular.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/ibm-plex-mono-v20-latin-500.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/ibm-plex-mono-v20-latin-600.woff2') format('woff2'); }

/* ──────────────────────────────────────────────────────────────────────
   Design tokens (:root) now live in tokens.css (linked BEFORE this file in
   base.html). app.css is a pure CONSUMER of the tokens — update a value in
   tokens.css, never here. See tokens.css header.
   ────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; }
/* The HTML `hidden` attribute must always win — component display rules (e.g.
   .form-grid { display:grid }) otherwise override the UA [hidden]{display:none}
   and re-show hidden tab panels. Global guard, high specificity. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: var(--text-body);
  /* Amounts line up (DSN-02): Figtree's tabular figures app-wide — WE MEASURED IT, 2026-11-20,
     scripts/verify_fonts_browser.py ("0000" and "1111" render the same width with tnum). */
  font-variant-numeric: tabular-nums;
}
[data-density="work"] { font-size: var(--text-dense); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
h1, h2, h3, h4, .disp { font-family: var(--font-display); }
h1 { font-size: var(--text-title); font-weight: 700; color: var(--ink); margin-bottom: .2rem; letter-spacing: -.2px; }
h2 { font-size: 1.15rem; font-weight: 600; color: var(--ink); }
h2.sub { font-size: 1rem; margin-top: 0; font-family: var(--font-display); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); }
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
/* Redesign F1 (DSN-02): Familjen Grotesk = headings + key amounts only; buttons, labels and body
   are Figtree. Labels are 13px and quieter than values. Amounts: tabular figures. */
label { font-size: var(--text-label); color: var(--label-ink); }
.muted { color: var(--muted); font-size: .85rem; }
.faint { color: var(--faint); }
.lead { color: var(--muted); margin: .15rem 0 1rem; }
.req { color: var(--overdue); }
svg.ic { display: block; flex: none; }

/* ════════════════════════════════════════════════════════════════════════════
   APP SHELL — sidebar + main
   ════════════════════════════════════════════════════════════════════════════ */
.app { display: grid; grid-template-columns: calc(var(--sidebar-w) + var(--safe-left)) minmax(0, 1fr); min-height: 100dvh; background: var(--bg); }
/* the top safe area (tokens.css --safe-top): the page's own ground stays behind the clock line while the page scrolls
   under it; the dark .side (z 60) covers its own part. Height 0 in a desktop browser. */
.app::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-top); z-index: 59; background: var(--bg); pointer-events: none; }

/* ── THE SHELL (redesign F3 — SHL-01/02/03/09/12, DSN-14 #6). Desktop ≥ 1200: dark Ink sidebar with
   logo + bell, company switcher, timer, Search or ask, + New, the nine areas, account. No top bar.
   1024–1199: the same element as a narrow icon rail. < 1024: hidden — the bottom bar + sheets take over. */
.side {
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; gap: 10px; padding: 18px 14px;
  padding-top: calc(18px + var(--safe-top)); padding-left: calc(14px + var(--safe-left));   /* top 0 + the room in the padding: the dark runs up behind the clock */
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; z-index: 60;
  padding-bottom: calc(14px + var(--statusbar-reserve));
}
.side > * { flex-shrink: 0; }   /* a long open area scrolls the sidebar; nothing gets squeezed */
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; color: var(--side-text); }
.side .brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--green); display: grid; place-items: center; flex: none; }
.side .brand .nm { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--side-text); }
.sb-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--side-text); background: var(--side-on); flex: none; }
.sb-ic:hover { background: var(--side-hover-strong); color: var(--side-text); }
.sb-ask-ic { display: none; }

/* company switcher — only rendered with more than one company (SHL-08) */
.co { background: var(--side-on); border-radius: 12px; padding: 8px 10px; }
.co select { width: 100%; background: transparent; border: none; outline: none; cursor: pointer;
  color: var(--side-text); font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.co select option { color: var(--ink); }
.co-row { display: flex; align-items: center; gap: 8px; }
.co-row select { flex: 1; min-width: 0; }
.co-switch-icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: none; }
.co-switch-icon-fallback { display: flex; align-items: center; justify-content: center; color: var(--side-muted); }

/* running timer (SHL-09): top of the sidebar; a slim strip above the phone bar */
.sb-timer, .tb-timer { display: flex; align-items: center; gap: 8px; color: var(--side-text); background: var(--green); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.sb-timer .tm-l, .tb-timer .tm-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-timer .tm-t, .tb-timer .tm-t { font-weight: 700; }

/* Search or ask (SHL-07) + New (SHL-06) */
.sb-ask { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--side-on); color: var(--side-muted); }
.sb-ask input { flex: 1; min-width: 0; border: 0; background: none; color: var(--side-text); font: inherit; font-size: 15px; height: 100%; }
.sb-ask input::placeholder { color: var(--side-muted); }
.sb-ask input:focus { outline: none; }
.sb-ask:focus-within { box-shadow: 0 0 0 2px var(--green-pop); }
.sb-kbd, .menu-pop kbd { font: 600 11px var(--font-body); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--side-muted); color: var(--side-muted); }
.menu-pop kbd { margin-left: auto; border-color: var(--line-btn); color: var(--ink-faint); }
.sb-new { display: block; }
.sb-newbtn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; background: var(--green-pop); color: var(--ink); font-weight: 600; font-size: 15px; }
.sb-new .menu-pop { left: 0; right: auto; width: 100%; }

.sidenav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.navi { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 44px; border-radius: 12px; font-size: 15px; color: var(--side-text); }
.navi:hover { background: var(--side-on); color: var(--side-text); }
.navi.on { background: var(--side-hover-strong); color: var(--side-text); font-weight: 700; }   /* 11r-a / A6: bold + the light row, never another colour */
/* 11r-a / A6 + P3: the module square — the white icon on the module's colour (tokens.css --area-<key>, data-area).
   Sidebar 28 · rail 30 · bottom bar 28 · More list 30 · page head 38 desktop / 34 tablet / 32 phone. */
.mod-ic { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--area); color: var(--on-area); }
.mod-ic .ic { width: 16px; height: 16px; color: var(--on-area); }
.mod-ic-sheet { width: 30px; height: 30px; border-radius: 9px; }
.mod-ic-head { width: 38px; height: 38px; border-radius: 11px; align-self: center; }
.mod-ic-head .ic { width: 20px; height: 20px; }
@media (max-width: 1199px) { .mod-ic-head { width: 34px; height: 34px; border-radius: 10px; } .ph-record .mod-ic-head { display: none; } }
@media (max-width: 699px) { .mod-ic-head { width: 32px; height: 32px; } .mod-ic-head .ic { width: 18px; height: 18px; } }
.navi .nl { flex: 1; min-width: 0; }
.navi .badge { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--attn); color: var(--side-text); padding: 1px 7px; border-radius: var(--radius-btn); }
.nav-addons { border-top: 1px solid var(--side-on); margin-top: 8px; padding-top: 8px; }
/* step 10b fix-ups / 8: everything in the sidebar reachable on a 768-high screen — the rows tighten on a short screen
   with a mouse (spacing, never smaller text), and when it still does not fit the LIST scrolls while the person's name
   stays at the bottom (every page, not only a module's) */
.side > .sidenav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
@media (pointer: fine) and (max-height: 900px) {
  .side { gap: 8px; padding-top: calc(14px + var(--safe-top)); }
  .navi { min-height: 36px; }
  .sb-newbtn { height: 40px; }
  .nav-addons { margin-top: 6px; padding-top: 6px; }
  .side-foot { padding-top: 8px; }
}
.nav-mod { display: block; padding: 2px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--side-muted); }
.sd-mod:empty { display: none; }
/* step 10b / A2 — Settings › Connections › Add-ons (Plt-Desktop-Addons / Plt-Phone-Addons) */
.ao-row { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.ao-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.ao-txt { display: grid; min-width: 0; }
.ao-txt small { font-size: 13px; }
.ao-price { display: grid; text-align: right; font-weight: 600; }
.ao-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 699px) { .ao-row { grid-template-columns: 40px 1fr auto; } .ao-price { grid-column: 2; text-align: left; } .ao-do { grid-row: 1; grid-column: 3; } .ao-cards { grid-template-columns: 1fr; } }
.sheet-mod { margin: 0; padding: 6px 16px 2px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* collapsible groups — still used by the mailbox's account folders (mcNavInit) */
.nav-caret { flex: none; transition: transform .15s ease; }
.nav-toggle[aria-expanded="false"] .nav-caret { transform: rotate(-90deg); }

.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--side-on); }
.side-foot .ava { width: 34px; height: 34px; border-radius: 50%; background: var(--side-hover-strong); color: var(--side-text); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.side-foot .acct-me { min-width: 0; display: flex; flex-direction: column; color: inherit; }
.side-foot .who { color: var(--side-text); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .role { color: var(--side-muted); font-size: 12px; }
.side-foot a.out { margin-left: auto; color: var(--side-muted); }
.side-foot a.out:hover { color: var(--side-text); }

/* ── Main column ── */
.main { display: flex; flex-direction: column; min-width: 0; padding-top: var(--safe-top); padding-right: var(--safe-right); }
.content { padding: var(--content-pad); flex: 1; min-width: 0;
  padding-bottom: calc(var(--content-pad) + var(--statusbar-reserve)); }

/* ── Fix 2026-12-04 / F2: a labelled Ask on every screen — desktop: the Ask button in the sidebar box; the rail: "Ask"
   under its icon; phone / tablet portrait: the Ask button bottom right, above the bar and a docked primary, never while
   typing (the page keeps room for it at its foot). ── */
.sb-ask .sb-kbd { display: none; }
.sb-askgo { flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--accent);
  color: var(--on-accent); font: 700 13px var(--font-body); cursor: pointer; }
.sb-ask-l { font: 700 10px var(--font-body); }
.ask-fab { display: none; }
@media (max-width: 1023px) { .ask-fab { position: fixed; right: calc(18px + var(--safe-right)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 69;
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px 0 13px; border-radius: 999px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--accent); text-decoration: none;
  box-shadow: var(--shadow-pop); font: 700 15px var(--font-body); } }
.ask-fab .ic { color: var(--accent); }
.ask-fab:hover { background: var(--area-soft, var(--surface)); }
@media print { .ask-fab { display: none; } }
/* fix 2026-12-04 / F1: a tag's "Hide from lists" switch (its ⋯ menu) and the quiet line under a list */
.tgr-hide { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.list-hidden { margin: 10px 2px 0; }
/* fix 2026-12-04 / F3: a non-production app says so on every page — one thin orange line, never on production */
/* an overlay on the top edge (takes no room — every measured fit stays as on production), never catches a tap */
.dev-band { position: fixed; z-index: 90; top: var(--safe-top); left: 0; right: 0; height: 3px; background: var(--amber);
  pointer-events: none; font-size: 0; }
.dev-band::after { content: attr(data-label); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  padding: 1px 10px 2px; border-radius: 0 0 8px 8px; background: var(--amber); color: var(--on-accent);
  font: 700 11px/14px var(--font-body); letter-spacing: .04em; white-space: nowrap; }

/* ── Phone + tablet portrait: bottom bar (SHL-01), + New / More sheets (SHL-06), timer strip (SHL-09) ── */
.tabbar, .tb-timer { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; align-items: center; justify-content: space-around;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 calc(6px + var(--safe-right)) env(safe-area-inset-bottom) calc(6px + var(--safe-left));
  background: var(--surface); border-top: 1px solid var(--line); }
.tb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
  font: 600 12px var(--font-body); color: var(--ink-muted); background: none; border: 0; cursor: pointer; }
.tb.on { color: var(--ink); font-weight: 800; background: var(--area-soft); border-radius: 14px; }   /* 11r-a / A6: bold + the light row (the module's own tint) */
.tb-new { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; margin-top: -26px; box-shadow: var(--shadow-pop); cursor: pointer; flex: none; }
.tb-timer { position: fixed; left: 0; right: 0; z-index: 69; border-radius: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 6px calc(16px + var(--safe-right)) 6px calc(16px + var(--safe-left)); font-size: 13px; }

/* 11s / SH: above the bottom bar, anchored like it (+ shell.js fit); swipe on the top band; the body scrolls.
   display only under [open] (a bare display beats the UA's closed none). */
dialog.sheet { inset: auto 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--sheet-lift, 0px)); margin: 0; width: 100%; max-width: 100%;
  max-height: calc(86dvh - var(--tabbar-h) - env(safe-area-inset-bottom)); border: 0; padding: 0 calc(16px + var(--safe-right)) 16px calc(16px + var(--safe-left));
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); overflow: hidden; overscroll-behavior: contain;
  transform: translateY(var(--drag-y, 0px)); transition: transform .2s ease-out; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet.is-dragging { transition: none; }
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet:focus { outline: none; }
.sheet-top { position: relative; flex: none; min-height: 56px; padding: 8px 48px 0; touch-action: none; cursor: grab; }
.sheet .grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-btn); margin: 0 auto 10px; }
.sheet-x { position: absolute; top: 6px; right: -6px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--ink-muted); cursor: pointer; }
.sheet-x:hover, .sheet-x:focus-visible { background: var(--bg); color: var(--ink); }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
html.gs-sheet-lock, html.gs-sheet-lock body { overflow: hidden; overscroll-behavior: none; }
html.gs-sheet-lock body { position: fixed; left: 0; right: 0; top: var(--lock-y, 0px); }
@media (prefers-reduced-motion: reduce) { dialog.sheet { transition: none; } }
.sheet-h { font: 700 18px var(--font-display); margin: 0 -44px 10px; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.sheet-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 88px;
  border-radius: 16px; background: var(--bg); color: var(--ink); font-weight: 600; font-size: 14px; text-align: center; padding: 8px; }
.sheet-tile .ic { color: var(--accent); }
.sheet-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 8px; border-radius: 12px; color: var(--ink); font-size: 16px; font-weight: 600; }
.sheet-row.on { background: var(--area-soft); font-weight: 800; }   /* 11r-a / A6: the open module = bold + the light row (its tint) */
.sheet-row .badge { margin-left: auto; }
.sheet-sub { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 10px 52px; }
.sheet-sub a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-btn); border: 1.5px solid transparent; background: var(--bg); color: var(--ink); font-size: 14px; }
.sheet-div { height: 1px; background: var(--line); margin: 8px 0; }
.sheet-co { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.sheet-co select { flex: 1; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-field); padding: 0 10px; font: inherit; }

/* Tablet landscape (1024–1199): the sidebar becomes a narrow icon rail (SHL-02). */
@media (min-width: 1024px) and (max-width: 1199px) {
  .app { grid-template-columns: calc(var(--rail-w) + var(--safe-left)) minmax(0, 1fr); }
  .side { padding: calc(14px + var(--safe-top)) 10px 14px calc(10px + var(--safe-left)); align-items: center; }
  .side .brand .nm, .navi .nl, .navi .badge, .side-foot .acct-me, .side-foot a.out, .sb-top .sb-bell,
  .sb-ask, .co, .sb-timer .tm-l, .sb-newbtn .nl, .menu-pop kbd { display: none; }
  .sb-top { justify-content: center; }
  .sb-ask-ic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 48px; height: 48px; border-radius: 12px; }   /* + "Ask" (fix 12-04 / F2) */
  .sb-newbtn { width: 48px; height: 48px; padding: 0; }
  .sb-new .menu-pop { position: fixed; left: calc(var(--rail-w) + var(--safe-left) + 8px); top: calc(110px + var(--safe-top)); width: 240px; }   /* the rail scrolls → fixed, or it clips */
  .navi { width: 48px; padding: 0; justify-content: center; }
  .mod-ic-nav { width: 30px; height: 30px; border-radius: 9px; }   /* 11r-a / P3: the rail's square */
  .sb-timer { padding: 8px 2px; flex-direction: column; font-size: 11px; }
  .side-foot { padding: 10px 0 0; justify-content: center; }
}
/* Phone + tablet portrait (< 1024): no sidebar; bottom bar + sheets; the page head starts the page. */
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding-left: var(--safe-left); }   /* no menu on this side: the notch of a phone in landscape */
  .tabbar { display: flex; }
  .tb-timer { display: flex; }
  /* 11c Part B review / 3: + 40 px — the round + rises ~13 px over the bar, so a page's last button keeps clear of it */
  .content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--dock-h) + 60px); }   /* + the Ask button (fix 12-04 / F2) */
  body.kb-open .tabbar, body.kb-open .tb-timer, body.kb-open .ask-fab { display: none; }   /* SHL-12: typing = no nav bar */
  /* --dock-h = the docked primary + the timer strip (shell.js), 0 without them */
  .ask-fab { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--dock-h, 0px) + 14px); right: calc(14px + var(--safe-right)); height: 40px; }
  body.kb-open .content { padding-bottom: calc(var(--kb-offset, 0px) + var(--dock-h) + 24px); }   /* 11r-a / P2: a low field can rise above the keyboard */
}
/* ── THE PAGE HEAD (redesign F3, DSN-14 #1–3): every page's {% block topbar %} renders the same
   contract — .topbar > .loc > .crumb (.pre = the trail "Relations › ", then the name, then " · count")
   + .topbar-actions (the actions, primary right). It is the TITLE of the page on the paper, not a bar.
   New screens use page_head() in _components.html, which emits the same contract. ── */
.topbar { display: flex; align-items: center; gap: 12px; padding: 0; background: transparent; flex-wrap: wrap; }
/* Header search (app-wide, context-aware) — lives IN the header row (.apphead), to the RIGHT of the page
   topbar (no double header). On lists it drives that module's live filter; on the Dashboard the universal
   /search/. The field sits LEFT of the green Search button. */
.apphead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: var(--head-pad-top) var(--content-pad) 6px; }
.apphead:empty { display: none; }
.apphead > .topbar { flex: 1; min-width: 0; order: 0; }
.apphead > .headersearch { flex: none; display: flex; align-items: center; order: 2; }   /* head · tabs (1) · search (2) · tools (3) */
.hs-form { display: flex; gap: 8px; align-items: center; width: 340px; max-width: 42vw; }
.hs-box { flex: 1; display: flex; align-items: center; background: var(--field-tint); border: 1px solid var(--line); border-radius: var(--radius-input); padding: 0 10px; min-width: 0; }
.hs-box input { flex: 1; min-width: 0; border: none; background: none; outline: none; height: 32px; font-family: var(--font-body); font-size: 14px; color: var(--ink); }
.hs-box input::placeholder { color: var(--ink-faint); }
.hs-form:focus-within .hs-box { border-color: var(--accent); box-shadow: var(--focus-ring); }
/* mobile: the header search drops below the topbar (stacks) so it doesn't crush the crumb */
@media (max-width: 760px) { .hs-form { width: 100%; max-width: none; } }
/* detail-page only: blend the topbar into the off-white card content below (no hard white edge) */
.topbar .loc { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar .lic { display: none; }   /* the page head carries no icon tile (boards: title only) */
.topbar .crumb { font-family: var(--font-display); font-weight: 700; font-size: var(--text-title); line-height: 1.2; overflow-wrap: anywhere; }   /* 11d / 0a: titles wrap, never cut */
.topbar .crumb .pre:first-child { color: var(--ink-muted); font-weight: 600; }
.topbar .crumb .pre:not(:first-child), .topbar .crumb .sub, .topbar .ph-count { font-family: var(--font-body); font-weight: 500; color: var(--ink-muted); font-size: 16px; }
@media (max-width: 1023px) { .topbar .crumb { font-size: 24px; } .topbar .loc { flex-wrap: wrap; row-gap: 2px; } }
/* step 6 / 0a (GAP-88): THE no-break rule — an amount and its unit, a head's quiet line, never break over two lines */
/* 11c Part B review / 5: every money cell too — "−€4.67" broke after the minus (a break point browsers allow);
   .mono-wrap opts a long code / URL out */
.nw, .cn-minus, .pj-when, .tmr-h, .topbar .ph-count, .mono:not(.mono-wrap), td.n, td.num-col, .owes, .bval, .kpi-num,
.pc-v > b, .lv-total, .lv-price, .pj-amt, .rem-overdue, .mbx-rc-owes, .found-total b, .rdoc-sum dd { white-space: nowrap; }
.topbar .ph-count { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }   /* GAP-203: a long name ends in … */

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* Record navigation (data-nav-bar slice 1): First · Prev · «X / N» · Next · Last over the found set.
   A tight icon group with a mono position chip; disabled buttons dim per the global .btn:disabled. */
.recnav { display: inline-flex; align-items: center; gap: 4px; }
.recnav .icon-btn { padding: 6px 8px; min-height: 32px; }
.recnav-pos { font-size: 12px; color: var(--muted); padding: 0 6px; min-width: 56px; text-align: center;
  white-space: nowrap; }

/* data-nav-bar TOOLBAR (2026-06-29): the grouped FileMaker-style icon bar — every control an icon-button
   with a hover-tooltip (native title), groups separated by dividers. Replaces the ad-hoc List/Edit/New.
   ALWAYS inline + right-aligned (top-right) on ONE row WITH the crumb — a stable, consistent position. It's
   compact enough to fit; the LEFT crumb truncates (ellipsis) so a long title never pushes the bar down.
   `flex:0 0 auto` (never shrinks) + the crumb's `min-width:0` shrink → the crumb yields, the bar stays whole;
   `nowrap` + `overflow-x:auto` guards against wrap as a last resort. */
/* A DISTINCT control surface (Dick): subtle tint + hairline + soft shadow, so the bar reads as a defined
   strip, not a faint floating row. Buttons sit FLAT on it (no per-button border) with dark icons. */
.navbar { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; justify-content: flex-end;
  flex: 0 0 auto; overflow-x: auto; padding: 3px 4px;
  background: var(--bg); border-radius: var(--radius);   /* tinted a touch darker than the white header */
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft); }
.tb-group { display: inline-flex; flex-direction: row; align-items: center; gap: 1px; }
.tb-div { width: 1px; align-self: center; height: 18px; background: var(--line); margin: 0 3px; }
.navbar .icon-btn,
.navbar .recnav .icon-btn { padding: 4px 5px; min-height: 28px; }
.navbar .recnav-pos { min-width: 44px; padding: 0 2px; }
/* enabled controls = flat + DARK (clearly visible); hover = accent-soft fill */
.navbar .btn { box-shadow: none; color: var(--ink); }
/* hover = a MID-strength accent tint (clearly visible — between the faint soft and the solid active fill);
   :not(.on) so hovering the active mode keeps its solid fill, :not([disabled]) so placeholders don't light up */
.navbar .btn.ghost:not([disabled]):not(.on):hover { background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--accent); box-shadow: none; }
/* ACTIVE mode (View/Edit/Find) = STRONG solid-accent fill (obvious at a glance, not a faint tint) */
.navbar .mode-btn.on,
.navbar .mode-btn.on:hover { background: var(--accent); color: var(--on-accent); }
/* Invert found set active (2026-07-04): lit like the mode buttons while showing the omitted set. */
.navbar .inv-btn.on,
.navbar .inv-btn.on:hover { background: var(--accent); color: var(--on-accent); box-shadow: none; }
/* not-yet-built controls: clearly FADED + inert, tooltip "(coming)" — obviously different from enabled.
   `.btn.nav-ph` beats the `.btn:disabled` opacity:.55 so the placeholders read distinctly more faded. */
.navbar .btn.nav-ph { opacity: .3; pointer-events: none; box-shadow: none; }
/* the crumb side shrinks + ellipsis-truncates so a long company name never pushes the top-right bar down.
   `.topbar-bar` = nowrap so the crumb TRUNCATES (flex-wrap would bump the bar to a 2nd row instead). */
.topbar-bar { flex-wrap: nowrap; }
.topbar-bar .loc { flex: 1 1 auto; min-width: 0; }
.topbar-bar .crumb { min-width: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   BUTTONS — one shape (.btn + .pri / .ghost / .quiet / .danger)
   ════════════════════════════════════════════════════════════════════════════ */
/* Buttons (DSN-05, board Dsn-Overview §1): primary · secondary (.ghost) · quiet · danger. One primary
   per screen; delete is never primary. 46px on touch screens (DSN-11), 40px with a mouse. */
.btn {
  font: inherit; font-size: 15px; font-weight: 600; border: none; border-radius: var(--radius-btn);
  padding: 0 20px; min-height: var(--h-btn); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.btn.pri { background: var(--accent); color: var(--on-accent); }
.btn.pri:hover { background: var(--accent-d); color: var(--on-accent); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-btn); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.btn.quiet { background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; }
.btn.quiet:hover { color: var(--accent-d); }

.btn.sm { padding: 0 14px; min-height: 44px; font-size: 14px; }
@media (pointer: fine) { .btn.sm { min-height: var(--h-btn-sm); } }   /* 11r-f: .btn = --h-btn, 36px with a mouse */
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
/* .btn.danger — the destructive variant (Remove/Revoke/Delete). Red-outlined ghost that
   fills on hover; respects the existing `.btn.ghost.danger` authoring (audit §1.7). Additive:
   a real rule where these buttons previously fell back to a plain neutral ghost. */
.btn.danger { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger-line); }
.btn.danger:hover { background: var(--danger); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--danger); }

/* ════════════════════════════════════════════════════════════════════════════
   PAGE PRIMITIVES
   ════════════════════════════════════════════════════════════════════════════ */
.page, .page-wide, .page-narrow, .page-form { width: 100%; }
.page-narrow { max-width: 760px; }   /* kept for 403 + any genuinely single-column page */
/* .page-form — full-width form page that hosts a dense multi-column .form-grid.
   container-type makes the grid respond to the CONTENT-AREA width (so it also
   re-flows when the sidebar collapses), never the physical screen. */
.page-form { container-type: inline-size; }

/* ── KPI cards ── */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-card); }
.kpi { background: var(--surface); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--pad-card); }
.kpi .k-lbl { font-size: 11px; color: var(--muted); }
.kpi .k-val { font-family: var(--font-display); font-weight: 700; font-size: var(--text-key); margin-top: 7px; letter-spacing: -.5px; color: var(--ink); }
.kpi .k-sub { font-size: 11px; margin-top: 5px; color: var(--faint); }
.kpi.flag { border-color: #E7C9C2; background: linear-gradient(0deg,#FCF4F2,#fff); }
.kpi.flag .k-val { color: var(--overdue); }

/* ── Homepage (dashboard) — module hero grid + calm rail (theming Phase 1 rebuild).
   Ported from the approved mockup against semantic tokens + the per-module --tone
   (= var(--mod-<key>), emitted by the theme injection). NO per-module baked rules —
   each tile carries --tone inline, so a new registry module themes automatically. ── */
.seclabel { font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 2px 2px 12px; }

.modgrid { display: grid; gap: 16px; grid-template-columns: repeat(2,1fr); }
.modtile { position: relative; overflow: hidden; border-radius: 18px; padding: 20px 20px 20px 24px;
  background: linear-gradient(155deg, var(--tone-soft), color-mix(in srgb, var(--tone-soft) 42%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--tone) 16%, var(--line));
  box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .14s ease;
  display: flex; flex-direction: column; min-height: 150px; color: var(--ink); }
.modtile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tone); }
.modtile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); color: var(--ink); }
/* The watermark sits INSIDE the tile (Dick 2026-08-01): it used to be pinned at right:-14px
   bottom:-20px, so `overflow:hidden` sliced the glyph off two edges and it read as cramped.
   A real inset + a smaller glyph lets it breathe; the arrow chip still passes in front of it
   (it is `position:relative` with a solid background), which is the existing, deliberate look. */
.modtile .bg { position: absolute; right: 16px; bottom: 16px; color: var(--tone); opacity: .18; pointer-events: none; }
.modtile .bg .ic { width: 92px; height: 92px; stroke-width: 1; }
.modtile .mn { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); position: relative; display: flex; align-items: center; gap: 8px; }
/* the module glyph in front of its name — 20px to match the 20px name, in the module's own tone */
.modtile .mn .ic { width: 20px; height: 20px; color: var(--tone); flex: none; }
.modtile .mrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; position: relative; }
.modtile .mc { font-size: 13px; color: var(--muted); }
.modtile .mc b { font-family: var(--font-num); font-weight: 600; color: var(--tone); font-size: 15px; }
.modtile .arrow { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--tone); display: grid; place-items: center; flex: none; transition: transform .14s ease; box-shadow: var(--shadow); }
.modtile .arrow .ic { width: 16px; height: 16px; }
.modtile:hover .arrow { transform: translateX(3px); }
/* Dark: solid tinted cards over the wallpaper (not glass). */
[data-theme-mode="dark"] .modtile { background: linear-gradient(158deg, color-mix(in srgb, var(--tone) 24%, #131B18), color-mix(in srgb, var(--tone) 9%, #131B18)); border-color: color-mix(in srgb, var(--tone) 30%, transparent); }
[data-theme-mode="dark"] .modtile .arrow { background: rgba(255,255,255,.08); }

/* ── Two-column panels (financial.html). Row gap 24px on purpose (Dick, round 7 item 1b; history in git). ── */
.cols { display: grid; grid-template-columns: 1fr; gap: var(--gap-block); margin-top: var(--gap-section); }
.cols.wide { grid-template-columns: 1.55fr 1fr; }
.panel { background: var(--surface); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.panel-h h2, .panel-h h3 { font-size: 14px; font-weight: 600; }
.panel-h a { font-size: 12px; font-weight: 500; }

.panel-pad { padding: 15px; }

/* ── To-do / activity rows ── */

.act:last-child { border-bottom: none; }
.kpi.pos .k-val { color: var(--green); }
.dash { width: 100%; }   /* full-viewport dashboard — fluid-dense, no boxed cap (layout-density standard) */

/* ── Horizontal bar list (financial: aging / top clients / monthly) ── */
.barlist { display: flex; flex-direction: column; gap: 11px; padding: 14px 15px; }
.bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar .blbl { width: 96px; color: var(--muted); flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .btrack { flex: 1; height: 16px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar .bfill { height: 100%; border-radius: 5px; background: var(--accent); min-width: 2px; }
.bar .bfill.red { background: var(--overdue); }
.bar .bfill.amber { background: var(--amber); }
.bar .bfill.blue { background: var(--blue); }
.bar .bval { width: 92px; text-align: right; font-family: var(--font-num); font-weight: 600; flex: none; }

/* ── Pills + refs (status vocabulary) ── */
/* THE STATUS SET (DSN-08): five colours. `over` = Overdue, `warn`/`part` = Part paid (amber).
   Every module status maps onto these in _macros.html pill() — table in design-system.md. */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-label); font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1.3; }
.pill.draft { background: var(--st-draft-bg); color: var(--st-draft-ink); }
.pill.sent { background: var(--st-sent-bg); color: var(--st-sent-ink); }
.pill.warn, .pill.part { background: var(--st-part-bg); color: var(--st-part-ink); }
.pill.over { background: var(--st-overdue-bg); color: var(--st-overdue-ink); }
.pill.paid, .pill.ok { background: var(--st-paid-bg); color: var(--st-paid-ink); }
.ref { font-family: var(--font-num); font-size: 11px; color: var(--muted); }

/* ════════════════════════════════════════════════════════════════════════════
   LIST ARCHETYPE — toolbar (search + filter chips) + table
   ════════════════════════════════════════════════════════════════════════════ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.toolbar select { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: 13px; background: var(--surface); color: var(--ink); }
/* Filter chips (DSN-05): white pills; the active one is soft pine (11r-a / A1, the CHOSEN block at the end). `.fchip.add` = the dashed "+ Filter". */
.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip { white-space: nowrap; flex: none; font-size: 14px; font-weight: 600; padding: 0 14px; min-height: var(--h-chip); border-radius: var(--radius-btn); border: 1.5px solid transparent; background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow-soft); }
.fchip.add { background: transparent; border: 1.5px dashed var(--line-btn); box-shadow: none; }
@media (pointer: coarse) { .fchip { min-height: 44px; } }

.tablecard { background: var(--surface); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
/* Wide-table guard (A6 "scrolling"): a wide table scrolls INSIDE this wrapper so the PAGE body never
   h-scrolls on mobile. Wrap any table that can outgrow a 375px viewport (e.g. the Roles/User-rights
   matrices). */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-dense); }
table.tbl th { text-align: left; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 11px 15px 8px; border-bottom: 1px solid var(--dt-head-line); background: var(--dt-head-bg); hyphens: auto; }
/* step 11a: Dutch and Italian column heads run longer — on those pages a head may wrap (hyphenated); English is as before */
:root:not([lang=en]) :is(.tablecard .sortable-table th, .std-table .std-perm-h, .cfg-tbl th) { white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
table.tbl th.n, table.tbl td.n { text-align: right; }
table.tbl td { padding: var(--pad-row) 15px; border-bottom: 1px solid var(--dt-row-line); }
table.tbl tbody tr:last-child td { border-bottom: none; }
/* STYLE RULE A5 (staging-tuning 2026-07): subtle tinted zebra on alternate rows (theme-aware
   --row-alt; declared BEFORE :hover so hover still wins). One token, every list surface inherits.
   A5.1 (Dick 07-09): zebra STARTS tinted on the FIRST data row (so row 1 is distinguished from the
   header) — CONSISTENTLY on every list surface. tbody holds only data rows → :nth-child(odd) = the
   1st/3rd/5th data row. */
table.tbl tbody tr:nth-child(odd) td { background: var(--dt-zebra); }
table.tbl tbody tr:hover td { background: var(--dt-hover); }
table.tbl tbody tr[onclick], table.tbl tbody tr[hx-get] { cursor: pointer; }
table.tbl a.rowlink { color: inherit; display: block; font-weight: 500; }
@media (max-width: 760px) { table.tbl th.col-hide, table.tbl td.col-hide { display: none; } }
table.tbl .col-primary .sub { overflow-wrap: anywhere; }
.mini { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 600; font-family: var(--font-display); flex: none; }
.nm-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nm-cell .sub { font-size: 11px; color: var(--muted); font-weight: 400; }

.pagination { display: flex; align-items: center; gap: .8rem; justify-content: center; margin-top: 1rem; }
.page-indicator { color: var(--muted); font-size: .85rem; }
.empty-state { padding: 30px 16px; text-align: center; color: var(--muted); }

/* ── Portals (reusable hub macro) ── */
.portals { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.portal { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.portal-h { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.portal-h .pic { color: var(--accent); }
.portal-h h2, .portal-h h3 { font-size: 13.5px; font-weight: 600; flex: 1; margin: 0; }
.portal-h .ct { font-family: var(--font-num); font-size: 11px; color: var(--faint); background: var(--bg); padding: 1px 7px; border-radius: 20px; }
.portal-body { display: flex; flex-direction: column; }

.portal-empty { padding: 14px 15px; color: var(--muted); font-size: 12.5px; }

/* ════════════════════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════════════════════ */
.form { background: var(--surface); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1.1rem; margin-top: 1rem; }
.form label { display: block; font-weight: 600; font-size: .82rem; margin: .7rem 0 .25rem; color: var(--ink); }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=number], .form input[type=date], .form input[type=search],
.form input[type=tel], .form input[type=url], .form select, .form textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--neutral-300);
  border-radius: var(--radius-input); font: inherit; font-size: .92rem; background: var(--field-bg); color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.form input:disabled { background: var(--bg); color: var(--muted); }
.form-actions { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
/* THE tick box (redesign step 4 / GAP-43): every checkbox is the green rounded square — never the browser's own
   box. :where() keeps it at zero specificity, so a screen may size it; the switch (.toggle) and the chips
   (.choice-chip) hide their input and draw their own. Gate: scripts/verify_tick_boxes.py (computed style). */
:where(input[type="checkbox"]) { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border: 2px solid var(--line-btn); border-radius: 6px; background: var(--surface) center / 72% no-repeat; cursor: pointer; vertical-align: middle; }
:where(input[type="checkbox"]:checked) { background-color: var(--accent); border-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
:where(input[type="checkbox"]:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(input[type="checkbox"]:disabled) { opacity: .5; cursor: default; }
.check-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .3rem; }
.check-item { display: flex; align-items: center; gap: .5rem; font-weight: 400 !important; min-height: 40px; }
.check-item input:not([type=checkbox]) { width: auto !important; }
/* .checkbox-label — the shared checkbox+label utility (audit §1.12); a tick box keeps its 20px. */
.checkbox-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; }
.checkbox-label input:not([type=checkbox]) { width: auto; }
.inline-row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.inline-row > div { flex: 1; min-width: 140px; } .inline-row .ctl-check { white-space: normal; }
.form-dense input, .form-dense select, .form-dense textarea { padding: .4rem .55rem; }

/* ── Dense multi-column form grid ───────────────────────────────────────────
   Opt-in via `.form.form-grid` inside a `.page-form` (the container-query host).
   Fields flow into 1 col → 2 cols (≥1024px content width) → 3 cols (≥1500px).
   Deterministic column counts (stable positions — NEVER auto-fit). Each field is
   a `.fld` (label stacked over its control); existing `.inline-row` groups
   dissolve into the same grid via display:contents (no markup change needed).
   Section headers / helper text / textareas / special widgets span all columns
   and keep a sane reading measure. ───────────────────────────────────────── */
.form.form-grid { display: grid; grid-template-columns: 1fr; gap: .55rem 1.4rem; align-items: start; }
/* Thresholds are CONTENT-AREA widths (the .page-form is the container). With the
   232px sidebar, ~720px container ≈ a ~1000px viewport (and a full-width iPad), and
   ~1150px container ≈ a ~1400px+ viewport — so 2-up lands on laptops & tablets, 3-up
   on wide desktops, exactly as intended. (When the sidebar is off-canvas the content
   IS the viewport, so the same numbers hold.) */
@container (min-width: 720px) { .form.form-grid { grid-template-columns: 1fr 1fr; } }
@container (min-width: 1150px) { .form.form-grid { grid-template-columns: 1fr 1fr 1fr; } }
/* a field cell + the promoted children of an .inline-row both render as label-over-control */
.form-grid > .fld, .form-grid .inline-row > div { display: flex; flex-direction: column; min-width: 0; }
.form-grid .inline-row { display: contents; }
.form-grid > .fld > label, .form-grid .inline-row > div > label { margin: 0 0 .25rem; }
/* full-bleed rows: headings, prose, grouped widgets, actions — span every column */
.form-grid > h2, .form-grid > .sub, .form-grid > p, .form-grid > details,
.form-grid > .check-list, .form-grid > .vat-row,
.form-grid > .vat-note, .form-grid > #vat-note,
.form-grid > .form-actions, .form-grid > .alert,
.form-grid > .inv-form-grid, .form-grid > .more-fields,
.form-grid > .full, .form-grid > .fld.full { grid-column: 1 / -1; }
/* a check-item on its own row reads better full-width; the textarea/long single
   field keeps a comfortable measure even when it spans the grid */
.form-grid > .check-item { grid-column: 1 / -1; }
.form-grid .fld > textarea, .form-grid .fld.full > textarea,
.form-grid .fld.full > input[type=text], .form-grid .fld.full > input[type=email],
.form-grid .fld.full > input[type=url], .form-grid > .vat-row { max-width: 80ch; }
.logo-preview { max-height: 60px; border-radius: 6px; margin: .3rem 0; display: block; }

/* Settings ▸ Relations configurable-list CRUD rows (Salutations · Roles-add · Social channels):
   a clean flex row of label-over-control cells + inline action buttons (the cd7813f approved
   arrangement — preserved; relocated here from settings.html inline <style>). */
.cfg-add { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.std-table td.std-label input { min-width: 120px; }
.hidden-rel-open { text-align: right; }

/* ── Detail (view) cards ── */
.detail-card { background: var(--surface); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1rem 1.1rem; margin-top: 1rem; }
/* reading-view card grid: single column → two columns at a wide CONTENT width
   (inside a .page-form container). Each card keeps its own comfortable measure
   instead of one card sprawling across an ultrawide. Stable column count. */
.detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--line2); }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--muted); font-size: .85rem; }
.detail-value { text-align: right; word-break: break-word; }
.addr { font-style: normal; line-height: 1.5; }

/* ── Alerts ── */
.alert { border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .9rem; }

.alert-error { background: var(--overdue-soft); color: var(--overdue); border: 1px solid var(--red-soft); }
.alert-warning { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-soft); }
.alert-info { background: var(--blue-soft); color: var(--blue); }

/* ── Login (centered card; outside the app shell) ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: calc(1.2rem + var(--safe-top)) calc(1.2rem + var(--safe-right)) 1.2rem calc(1.2rem + var(--safe-left)); background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.9rem 1.6rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; }
.login-logo img { height: 40px; width: auto; display: inline-block; }
.login-tag { text-align: center; color: var(--muted); margin-bottom: 1rem; font-size: .9rem; }
.login-card label { display: block; font-weight: 600; font-size: .85rem; margin: .7rem 0 .25rem; }
.login-card input { width: 100%; padding: .65rem .7rem; border: 1px solid var(--neutral-300); border-radius: var(--radius-input); font: inherit; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.login-card .btn { margin-top: 1.1rem; }
/* sign-up (11b / 1): language switch, the heading, the honeypot off-screen */
.su-lang { display: flex; justify-content: flex-end; gap: .8rem; font-size: .85rem; margin: -.8rem 0 .4rem; }
.su-lang a[aria-current] { font-weight: 700; color: var(--ink); }
.login-card h1 { margin: .9rem 0 .3rem; line-height: 1.15; }
.su-foot { margin: 1rem 0 .4rem; }
.su-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* role pill (sidebar/user chip) */
.role-pill { background: var(--accent); color: var(--on-accent); border-radius: var(--radius-pill); padding: .08rem .55rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — sidebar → off-canvas drawer on mobile/tablet
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .kpis { grid-template-columns: repeat(4,1fr); }
}
@media (min-width: 1100px) {
  .cols.wide { grid-template-columns: 1.55fr 1fr; }
  .portals { grid-template-columns: 1fr 1fr; }
}

/* Module tiles (theme editor preview): 2-across on a phone, 3-across from 768px. */
@media (max-width: 767px) {
  .modtile { min-height: 126px; padding: 15px; border-radius: 15px; }
  .modtile .mn { font-size: 16px; }
  .modtile .bg .ic { width: 88px; height: 88px; }
}
@media (min-width: 768px) { .modgrid { grid-template-columns: repeat(3,1fr); } }


.list { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.list-row { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }

.list-main { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.list-title { font-weight: 600; }
.list-actions { display: flex; gap: .4rem; align-items: center; }
.badge { background: var(--line); color: var(--ink); border-radius: var(--radius-pill); padding: .05rem .55rem; font-size: .7rem; }

.entity-tabs { display: flex; gap: .4rem; margin: .6rem 0 .2rem; }
/* nested module sub-tab bar — sits under the module tab, visually inset from the outer row */
.entity-tabs.sub-tabs { flex-wrap: wrap; margin: .2rem 0 .7rem; padding-bottom: .55rem;
    border-bottom: 1px solid var(--line); }

.type-pill { border-radius: var(--radius-pill); padding: .08rem .6rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; background: var(--st-draft-bg); color: var(--st-draft-ink); white-space: nowrap; }
/* List status pills (status-pill <prefix>-<status>) share .pill's shape and the five DSN-08 colours. */
.status-pill { display: inline-flex; align-items: center; font-size: var(--text-label); font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1.3; background: var(--st-draft-bg); color: var(--st-draft-ink); }
.type-service { background: var(--purple-soft); color: var(--purple); }
.margin-out { display: block; padding: .55rem 0; font-weight: 600; }


/* draft/declined/expired/cancelled keep the base (Draft grey) */
.inv-unpaid, .inv-sent { background: var(--st-sent-bg); color: var(--st-sent-ink); }
.inv-partial { background: var(--st-part-bg); color: var(--st-part-ink); }
.inv-overdue { background: var(--st-overdue-bg); color: var(--st-overdue-ink); }
.inv-paid { background: var(--st-paid-bg); color: var(--st-paid-ink); }

/* Expense form — main details + a right "Expense Settings" rail (desktop split, stacks ≤900px). */
.exp-main { min-width: 0; }
.exp-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .exp-form-layout { grid-template-columns: 1fr; } }
.exp-aside { position: sticky; top: calc(1rem + var(--safe-top)); display: flex; flex-direction: column; gap: 1rem; }
.exp-aside .fblock { margin: 0; }
.exp-grand-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: .4rem; padding-top: .7rem; border-top: 2px solid var(--rule); }
.exp-grand-row .lbl { font-weight: 600; }
.exp-grand-row .amt { font-family: var(--mono, monospace); font-size: 1.5rem; font-weight: 600; }
.exp-receipt-drop { border: 2px dashed var(--rule); border-radius: var(--radius); padding: 1rem; text-align: center; color: var(--muted); }
.exp-receipt-drop input[type=file] { margin-top: .5rem; }

.chain-lineage { font-size: .92rem; }
.chain-lineage a { font-weight: 600; }
.lv-desc { white-space: pre-wrap; }

/* New-template Type picker */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; margin-top: 1rem; }
.picker-tile { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start;
  background: var(--surface); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 1rem; color: var(--ink); }
.picker-tile:hover { border-color: var(--accent); }

.inv-table { display: flex; flex-direction: column; gap: .45rem; margin-top: 1rem; }
.inv-row { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; display: grid; grid-template-columns: 1fr; gap: .25rem; }
.inv-row.inv-head { display: none; }
a.inv-row { color: var(--ink); }
a.inv-row:hover { border-color: var(--accent); }
.inv-row > span { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.inv-row > span::before { content: attr(data-label); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.inv-form-grid { display: grid; grid-template-columns: 1fr; gap: .2rem .9rem; }
.line-editor { display: flex; flex-direction: column; gap: .55rem; margin-top: .5rem; }
/* ══ .gtable — the flexible multi-line data-table component (2026-07-14). The BASE holds the shared
   skin (all `--dt-*` token-driven) + the generic grid-cell mechanics; a per-consumer `.gtable--<v>`
   variant carries ONLY the grid shape (`grid-template-columns`/`-areas`) — N lines is purely the
   number of area-rows there, never hardcoded here. Consumed by /time/ now; Relations stays a native
   `table.tbl` (R1) but shares this exact skin via the same `--dt-*` tokens. Sub-rules live in the
   `@media` blocks further down (moved off `.pb-lines-time` verbatim, token-based). Base = a flex
   column stacking header / add-row / scroll region, matching the .line-editor rhythm it replaced. ══ */
.gtable { display: flex; flex-direction: column; gap: .55rem; margin-top: .5rem; }
.gtable .ga-date { grid-area: date; }     .gtable .ga-client { grid-area: client; }
.gtable .ga-project { grid-area: project; } .gtable .ga-service { grid-area: service; }
.gtable .ga-note { grid-area: note; }     .gtable .ga-time { grid-area: time; }
.gtable .ga-rate { grid-area: rate; }     .gtable .ga-status { grid-area: status; }
.gtable .ga-amount { grid-area: amount; } .gtable .ga-cp { grid-area: cp; }
.line-row { display: grid; grid-template-columns: 1fr; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; }
.line-row.line-head { display: none; }
.line-row > span { display: flex; flex-direction: column; gap: .15rem; }
.line-row > span::before { content: attr(data-label); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.line-row input, .line-row select, .line-row textarea { width: 100%; padding: .4rem .55rem; border: 1px solid var(--neutral-300); border-radius: var(--radius-input); font: inherit; background: var(--field-bg); }
.line-row textarea.line-desc { resize: vertical; min-height: 2.4em; line-height: 1.35; overflow: hidden; }
.line-row input.line-note { margin-top: .25rem; font-size: .85em; color: var(--muted); }
.line-row select.line-rate { margin-top: .25rem; }

/* Stage 2 — rich estimate-line description: a contenteditable surface styled like a line input,
   with a compact toolbar that floats in only while the line is focused (keeps the table dense). */
.rte-line { position: relative; }
.rte-line .rte-surface {
  width: 100%; min-height: 2.4em; max-height: 9em; overflow-y: auto; padding: .4rem .55rem;
  border: 1px solid var(--neutral-300); border-radius: var(--radius-input); background: var(--field-bg);
  font: inherit; line-height: 1.35;
}
.rte-line .rte-surface:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rte-line .rte-surface:empty::before { content: attr(data-placeholder); color: var(--ink-faint); pointer-events: none; }
.rte-line .rte-surface p { margin: 0 0 .3em; }
.rte-line .rte-surface p:last-child { margin-bottom: 0; }
.rte-line .rte-surface ul, .rte-line .rte-surface ol { margin: .2em 0 .3em; padding-left: 1.4em; }
.rte-line .rte-surface a { color: var(--accent); text-decoration: underline; }
.rte-line .rte-bar {
  display: none; position: absolute; bottom: calc(100% + 3px); left: 0; z-index: 30;
  gap: 2px; padding: 3px 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-input); box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.rte-line:focus-within .rte-bar { display: flex; }
.rte-line .rte-b { border: 1px solid var(--line); background: var(--bg); border-radius: 4px; }   /* Group A skin — base .rte-b owns sizing+hover; base .rte-sep owns the separator */
/* Boxed RTE variant (2026-08-14, Dick: "no background (field) box, RTE icons very small") — the plain
   `.rte` (rte_field with no context class, e.g. the profile/user mail-signature field) rendered NO
   field box + an unsized toolbar, because box+toolbar sizing is context-scoped everywhere else
   (.rte-line/.proddetail/.mail-body-rte). Additive opt-in via rte_field's `wrapper_cls` param —
   zero effect on those other scopes. */
.rte-boxed .rte-read, .rte-boxed .rte-surface { width: 100%; box-sizing: border-box; min-height: 4.6em;
  padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-input);
  background: var(--field-bg); font: inherit; line-height: 1.4; }
.rte-boxed img { max-width: 100%; height: auto; }   /* 12/B1: a logo widened My profile */
.rte-boxed .rte-surface:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.rte-boxed .rte-read:empty::before, .rte-boxed .rte-surface:empty::before { content: "Your signature…"; color: var(--ink-faint); pointer-events: none; }
.rte-disc .rte-surface:empty::before { content: "Add a legal footer for outgoing mail…"; }
.rte-boxed .rte-bar { display: flex; gap: 2px; padding: 3px 0 6px; }
.rte-boxed .rte-b { border: 1px solid var(--line); background: var(--bg); border-radius: 4px; }   /* Group A skin */
.line-total { font-weight: 600; padding: .2rem 0; }
.line-del { min-height: 34px; }
.inv-view-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: .9rem; }

.share-panel .share-block { margin-top: .8rem; }
.share-panel summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.share-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.send-log { margin: 0 0 .4rem; }
.send-ok { color: var(--accent); font-weight: 600; }
.send-err { color: var(--overdue); font-weight: 600; font-size: .8rem; }
.notes-text { white-space: pre-wrap; }                 /* preserved message/notes body (was inline) */
/* ── THE hint treatment — 11px, ONE rule, both class names (Dick 2026-07-30) ────────────────
   A below-field / below-config-table explanatory sentence. 11px is Dick's call, quoting the
   /settings/ Display hint as the reference. Deliberately UNSCOPED: the previous 11px rule lived
   under `.fblock`, so the same class used outside a block matched nothing and fell back to the
   inherited body size — a silent third size. Both names resolve here because ~36 call sites use
   `.field-hint` and ~39 use `.fb-hint`; new work should use the components' `desc=` slot.
   NB the CSS drift gate cannot police this: G8 sees a class in a selector and calls it defined
   whether or not any DOM context matches it. The evidence is the computed size in the page. */
.fb-hint, .field-hint { font-size: 11px; line-height: 1.35; color: var(--muted); }
.field-hint { margin: .15rem 0 .5rem; font-size: var(--text-label); color: var(--ink-faint); }  /* a form field hint (also ui_field's hint) */


.vat-note { font-size: .82rem; margin-top: .35rem; border-radius: 8px; }
.vat-note:not(:empty) { padding: .5rem .7rem; }
.vat-note.vat-ok { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-soft); }
.vat-note.vat-warn { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-soft); }
.vat-note form { display: inline; }   /* 11c merge / 0b: "check again" in the VIES line; the tick beside the text */
p[data-vat="confirmed"] { display: flex; justify-content: flex-end; align-items: baseline; gap: 4px; }
.reset-pw-form { display: flex; gap: .4rem; margin-top: .5rem; align-items: stretch; }
.reset-pw-form input { padding: .45rem .6rem; min-width: 0; flex: 1; }   /* border/radius/font from the base input.ctl field box */

@media (min-width: 768px) {
  .inv-form-grid { grid-template-columns: 1fr 1fr; }
  .inv-view-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 860px) {
  .inv-row.inv-head { display: grid; gap: .8rem; padding: .2rem .9rem; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: transparent; border: none; }
  .inv-head, .inv-row { grid-template-columns: 1.1fr 2fr 1fr 1fr 1.1fr; align-items: center; gap: .8rem; }
  .inv-row > span { display: block; }
  .inv-row > span::before { content: none; }
  .inv-c-amt { text-align: right; }
  .inv-view-lines .inv-head, .inv-view-lines .inv-row { grid-template-columns: 3fr .7fr 1fr .8fr 1.1fr; }
  .lv-qty, .lv-price, .lv-vat, .lv-total { text-align: right; }
  .line-row.line-head { display: grid; gap: .5rem; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 0 0 .3rem; background: transparent; border: none; }
  .line-head, .line-row { grid-template-columns: 1.3fr 1.8fr .7fr 1fr .9fr 1.1fr 1fr auto; align-items: center; gap: .5rem; }
  .line-row { background: transparent; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: .35rem 0; }
  .line-row > span { display: block; }
  .line-row > span::before { content: none; }
  /* Time Entries grid: fixed minmax bands for every short column (never `auto` — an auto track sizes per row,
     so the header and the data rows would not line up); only the free-text columns are `fr`. */
  /* ── Time Entries: OFFSET 5-column, 2-line entry grid (Dick round 5, 2026-07-14) — header, booked rows and the
     add-row share it; placement by grid-area. */
  .gtable .gt-row, .gtable .gt-head {
    display: grid; column-gap: 10px; row-gap: 4px; align-items: end; }
  /* variant --time: the OFFSET 5-col / 2-line shape — Client·Project + Service·Notes are the only
     fr tracks (absorb all slack); Date, Time/Rate, Status/Amount stay bounded-narrow; row 2 offsets
     under col 2 (col-1/line-2 under Date stays empty); the trailing 36px column spans both lines. */
  .gtable--time .gt-row, .gtable--time .gt-head {
    grid-template-columns: minmax(100px,128px) minmax(140px,2.4fr) minmax(140px,2.4fr) minmax(104px,124px) minmax(132px,148px) 36px;
    grid-template-areas: "date client service time status act" ".    project note    rate amount act"; }
  /* 11s / E4: the heads on ONE line — a column's two names side by side over it ("Client / Project") */
  .gtable--time .gt-head { grid-template-areas: "date client service time status act"; align-items: center; }
  .gtable--time .gt-hp { display: flex; gap: 5px; align-items: baseline; min-width: 0; white-space: nowrap; font-size: .68rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .gtable--time .gt-hp > i { font-style: normal; color: var(--faint); }
  .gtable--time .gt-hp.ga-time { justify-content: center; }
  .gtable--time .gt-hp.ga-status { justify-content: flex-end; }
  /* Round 8: FLAT spreadsheet rows — no per-entry box; the --dt-zebra tint alone separates them (like
     the Relations `.tbl` rows); compact tokenised padding (--space-1). */
  .gtable .gt-row { padding: var(--space-1) var(--space-5); background: transparent; }
  .gtable .ga-act { grid-area: act; align-self: center; display: flex; justify-content: center; }
  .gtable .gt-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  /* The per-column sort header row: the SAME offset grid (12px inset = a row's padding), so each label sits over
     its column; data-label only feeds the mobile ::before. */
  .gtable .gt-head { padding: 4px 12px 6px; margin-bottom: 0; background: var(--dt-head-bg);
    border-bottom: 1px solid var(--dt-head-line); }
  .gtable .gt-hf { font-size: .68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); align-self: end; }
  /* Round 6: column-wide alignment — Time/Status CENTER, Rate/Amount RIGHT, on the header label AND every
     cell so each column reads clean top-to-bottom. text-align is inherited → covers the header <a> + the
     inputs; align-items positions the non-stretching flex children (the Status pill, the Amount .mono,
     the Rate €-field). Desktop only (inside this @media) — mobile stacking untouched. */
  .gtable--time .ga-time, .gtable--time .ga-status { text-align: center; }
  .gtable--time .ga-rate, .gtable--time .ga-amount { text-align: right; }
  .gtable--time .gt-f.ga-time, .gtable--time .gt-f.ga-status { align-items: center; }
  .gtable--time .gt-f.ga-rate, .gtable--time .gt-f.ga-amount { align-items: flex-end; }
  /* Round 6: the Time-Entries block adopts the Relations tab-block treatment via SHARED TOKENS (no fork):
     a lighter --surface panel (vs the page --paper bg) with --radius-xl, filling to just above the footer
     (the round-5 .time-layout grid already bounds it; .lines-scroll stays the scroll leaf). overflow:hidden
     clips the flush rows to the rounded corners. Same excel tokens (--surface/--row-alt/--line2/--line) as
     the Relations `.tbl`, so a theme / per-user appearance change flows through automatically. */
  .pb-lines-time.time-panel, .time-panel--totals, .time-panel--timer { background: var(--surface); border-radius: var(--radius-xl); overflow: hidden; }
  /* Round 8: close the vertical space between entries — the booked-rows .line-editor drops its base
     `gap:.55rem`/`margin-top` so rows sit FLUSH (compact), matching the Relations `.tbl` row rhythm
     where consecutive rows are adjacent and the zebra does the separating. */
  .gtable .lines-scroll .line-editor { gap: 0; margin-top: 0; }
  /* Round 7: emphasise the identity fields — Client, Service, Project — in BOOKED rows only (not the
     header, not the add-row: both live OUTSIDE .lines-scroll). Reuses the shared weight token
     (--weight-semibold = the app's identity-emphasis weight, same family as `.list-title`/`.nm-cell`),
     never a one-off raw number. Date/Notes/Time/Rate/Status/Amount stay regular. */
  .gtable .lines-scroll .gt-row .ga-client input,
  .gtable .lines-scroll .gt-row .ga-client .client-derived,
  .gtable .lines-scroll .gt-row .ga-service select,
  .gtable .lines-scroll .gt-row .ga-project select { font-weight: var(--weight-semibold); }
  /* Visible field boundaries (2026-07-14): the base `.fblock .ctl` uses `border:1px solid transparent`,
     so on a zebra row the field-bg blends into the --row-alt tint and the field edges vanish. Give each
     inline field the shared hairline border (--line — the SAME token `.tbl`/`.client-derived` use, not a
     new value) so its edges read clearly on BOTH zebra and non-zebra rows. Desktop-only (this @media). */
  .gtable .gt-f input, .gtable .gt-f select, .gtable .gt-f .client-derived {
    width: 100%; height: 28px; line-height: 1.1; padding: .15rem .45rem; box-sizing: border-box;
    margin: 0; display: block; border-color: var(--line); }
  .gtable .gt-f select { appearance: none; -webkit-appearance: none; }
  .gtable .gt-f input[type="date"] { padding-top: 0; padding-bottom: 0; }
  /* Amount (read-only value) isn't an input — drop it onto the control baseline so it lines up with the
     editable cells on the same line rather than floating at cell-top. (Status = a plain shared pill(),
     NO /time/-specific sizing — it renders byte-for-byte like the estimate/invoice status pill.) */
  .gtable .ga-amount .mono { display: inline-block; height: 28px;
    line-height: 28px; padding-top: 0; padding-bottom: 0; }
  /* Totals-for-this-period: a read-only 3-col instance of the same .gtable skin. */
  .gtable--time-totals .gt-head, .gtable--time-totals .gt-row {
    grid-template-columns: 1fr 70px 90px; grid-template-areas: "cp time amount"; }
}

/* ── 2-line entry — MOBILE ONLY (<768px). Gated with max-width (NOT an unwrapped mobile-first base):
   these layout rules have the SAME specificity as the desktop grid rules inside the @media(min-width)
   block above, and they appear LATER in the file — so unguarded they'd win even at desktop (media
   queries add no specificity; source order breaks the tie). At <768px each entry becomes a card with
   every field fully stacked (label over control), one per line — clean vertical list, no H-scroll. ── */
/* 11s / E4: to 859 px (was 767) — 768–859 had neither the grid (≥ 860) nor the cards: loose text at 820 */
@media (max-width: 859px) {
  /* Stacked card: the header row hides, each field carries its own label via ::before(data-label). */
  .gtable .gt-head { display: none; }
  .gtable .gt-row { display: flex; flex-direction: column; gap: .45rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; }
  .gtable .gt-f { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
  .gtable .gt-f::before { content: attr(data-label); font-size: .7rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em; text-align: left; }
  .gtable .gt-f input, .gtable .gt-f select, .gtable .gt-f .client-derived {
    width: 100%; box-sizing: border-box; }
  .gtable .ga-act { display: flex; justify-content: flex-end; }
  /* 11s / E4: the totals (read-only, three short columns) stay a table here too — one line per client · project */
  .gtable--time-totals .gt-head, .gtable--time-totals .gt-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px 88px;
    grid-template-areas: "cp time amount"; gap: 8px; align-items: center; padding: 6px 12px; border: none; border-radius: 0; }
  .gtable--time-totals .gt-row { background: transparent; }
  .gtable--time-totals .gt-f::before { content: none; }
  .gtable--time-totals .gt-hf { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  /* Totals period bar (Part A) at narrow widths: the desktop rebuild is flex-wrap:nowrap (so ‹ date ›
     never breaks on the wide viewport); on mobile that would overflow, so let the whole header + the
     bar wrap, and drop the label's desktop min-width. Title on top, controls wrap below it. */
  .time-panel-h.fblock-h.has-ic { flex-wrap: wrap; }
  .time-period-bar { flex-wrap: wrap; }
  .time-period-nav .time-period-label { min-width: 0; }
}
/* The pinned add-row: a soft accent tint sets it apart from the booked rows below it. */
.gtable .gt-add { background: var(--accent-soft); border-color: var(--accent); }
.gtable .gt-row.empty { display: block; background: transparent; border: none; padding: .5rem .2rem; }

/* Money/center column alignment (Dick's Slice-1b review, 2026-07-14; widened grid-review follow-up
   to `.time-panel` so the Totals table's Time/Amount columns reuse the SAME classes/rule as the
   entries table below it — one alignment system, not two): right-aligned money (matching the
   site-wide money-column convention — table.tbl th.n/td.n), centered Time/Status. Unscoped by width
   on purpose — a stacked mobile row's value still reads better right/center-aligned than left. */
.time-panel .col-money, .time-panel .col-money input { text-align: right; }
.time-panel .col-center, .time-panel .col-center input { text-align: center; }

/* Rate — a €-adorned ALWAYS-EDITABLE currency input (051): the site-wide .num-read/.num-edit toggle
   (product_view.html money_inp) doesn't apply here — this cell has no read mode, it's a live grid
   input — so the € sign is a fixed adornment INSIDE the field instead, value right-aligned + mono
   like every other money figure in the app. Used on the Timer bar + every Time Entries Rate cell. */
.cur-field { position: relative; display: flex; align-items: center; width: 100%; }
.cur-field .cur-sym { position: absolute; left: 8px; color: var(--muted); font-family: var(--font-mono); font-size: .85em; pointer-events: none; }
.pb-lines-time .cur-field input, .time-panel .cur-field input, .tmr .cur-field input, .wk-add .cur-field input { padding-left: 22px; text-align: right; font-family: var(--font-mono); }
/* Timer start fields: 2-up on the Settings `.fb-f` cell; `.fblock .timer-fields > .fb-f` outranks the
   later `.fblock .fb-f` margin (which doubled the row gap). */
.timer-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-2) var(--gutter-col); padding: 0 var(--space-5) var(--space-5); }
.fblock .timer-fields > .fb-f { margin-bottom: 0; }
.timer-fields > .fb-f.full { grid-column: 1 / -1; }
/* Notes — a 2-3 line SCROLLABLE textarea (was single-line), same fixed-height `.ctl-area` treatment
   as other `.fblock` textareas (`.pb-scope .ctl-area`): bounded height, internal scroll, no resize. */
.timer-fields textarea.ctl-area { height: 64px; max-height: 64px; overflow-y: auto; resize: none; }
/* Client cell DERIVED state (051) — a Project selection resolves the Client read-only (its own
   client, or "Internal"); styled to sit exactly where the relpick sits, just non-interactive. */
.client-derived { display: flex; align-items: center; width: 100%; box-sizing: border-box; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: var(--radius-input); background: var(--field-bg); color: var(--muted); }

/* Timer header actions (Dick 2026-08-17, running-state redesign) — groups the relocated
   Discard+Stop pair so they stay adjacent at the header's right edge; `.fblock-h`'s own
   space-between only fits ONE right-hand child (the idle Start-Timer button) — a bare second/
   third child would get spread evenly across the header instead of pinned together. */
.timer-header-actions { display: flex; align-items: center; gap: var(--gap-inline); }
/* Timer RUNNING body (Dick 2026-08-17, replaces the one-line `#timer-banner` alert) — a padded,
   noticeably-tinted panel: Client/Project/Service centered on top, the live clock large+bold
   below. Background is a warm amber wash built from the SAME theme-injected role tokens the old
   alert used (`--amber`/`--surface`, both light+dark values come from the active-theme
   injection) via `color-mix`, never a hardcoded hex — adapts to light/dark/company theme for
   free. `flex:1` inside the desktop side-by-side breakpoint (below) makes it use whatever row
   height Totals occupies, matching "use the space there is". */
.timer-running { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-5); text-align: center; margin: 0 var(--space-5) var(--space-5);
  padding: var(--space-8) var(--space-5); border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.timer-running-info { font-size: var(--text-base); color: var(--ink); line-height: 1.4; }
.timer-running-info b { font-weight: var(--weight-semibold); }
.timer-running-clock { font-size: 46px; font-weight: var(--weight-bold); line-height: 1; color: var(--ink); }

/* ── /time/ layout (Dick 2026-08-16): Totals | Timer side by side, Entries full width below with its own
   scroll; only at ≥861px AND ≥620px (the .results-scroll pair), else plain block flow. */
@media (min-width: 861px) and (min-height: 620px) {
  .time-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: min-content minmax(400px, 1fr);
    grid-template-areas: "totals timer" "entries entries";
    gap: 16px; height: 100%;
  }
  .time-layout > .time-panel--totals { grid-area: totals; }
  /* Timer is the 2nd .fblock in DOM order, so the global `.fblock + .fblock` stack margin (~2586)
     still fires though it now sits BESIDE Totals, not below — cancel it so tops align (mirrors
     `.rel-left .rt-head + .fblock` above, opposite direction). */
  .time-layout > .time-panel.time-panel--timer { grid-area: timer; margin-top: 0; }
  /* Running panel claims the flex column's leftover height (the header above stays flex:none),
     so it stretches to fill whatever the row ends up — matching Totals' own natural height. */
  .time-layout > .time-panel.time-panel--timer .timer-running { flex: 1; min-height: 0; }
  .time-layout > .pb-lines-time.time-panel { grid-area: entries; }
  .time-layout > .time-panel { min-height: 0; display: flex; flex-direction: column; }
  .time-layout > .time-panel > .fblock-h { flex: none; }
  .time-totals-scroll { max-height: 220px; overflow-y: auto; }
  /* Sticky header + add-row (polish round, 2026-07-14): the scroll boundary sits BELOW them, not a
     `position:sticky` stack — `.pb-lines-time`'s direct-child `.line-editor` (line-head + add-row +
     the `.lines-scroll` wrapper) now sits between `.time-panel` and `.lines-scroll`, so it must ALSO
     join the flex:1;min-height:0 chain (else it never shrinks, and `.lines-scroll` below it never
     gets a bounded height to scroll within) — line-head/add-row stay their natural size, only
     `.lines-scroll` (flex:1) absorbs the leftover height. */
  #time-grid .pb-lines-time.time-panel > .gtable { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  /* #time-grid-anchored (id specificity) so this reliably BEATS the base
     `.pb-lines:not(.pb-lines-est) .lines-scroll { max-height:360px }` rule later in this file —
     same specificity in class-count terms, and source order alone would let the later rule win. */
  #time-grid .pb-lines-time.time-panel .lines-scroll { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
}
/* 11r-f part 2 (A2, GAP-237): from 1200 px the totals and the timer are one short band (the totals' list scrolls in
   its box, the running clock beside its line, the start fields three across), so the entries — the work, edited in
   their rows, the full width for their words — keep several rows in view; their list scrolls in its own box and the
   page itself does not scroll. */
@media (min-width: 1200px) and (min-height: 620px) {
  .time-layout { grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  .time-layout > .time-panel--totals { max-height: 176px; }
  .time-layout > .time-panel--totals .time-totals-scroll { flex: 1; min-height: 0; max-height: none; }
  .time-layout .time-panel-h { padding: 4px 12px; margin-bottom: 4px; flex-wrap: nowrap; min-height: 44px; }
  .time-layout .time-panel-h .fbh-ic { display: none; }
  .time-layout > .time-panel--timer .timer-running { flex-direction: row; justify-content: space-between; gap: 16px; text-align: left;
    margin: 0 12px 12px; padding: 10px 16px; }
  .time-layout > .time-panel--timer .timer-running-clock { font-size: 34px; }
  .time-layout .timer-fields { gap: 4px 10px; padding: 0 12px 12px; }
  .time-layout .timer-fields textarea.ctl-area { height: var(--h-field); min-height: 0; max-height: var(--h-field); padding-block: 7px; }
  .time-layout .time-panel-h .fbh-t { white-space: nowrap; }
  .time-layout .time-period-bar { flex-wrap: nowrap; gap: 6px; }
  .time-layout .time-period-label { min-width: 0; }
  .time-layout > .pb-lines-time .time-panel-h { margin-bottom: 0; min-height: 38px; padding-block: 0; }
  .time-layout > .fblock.time-panel { margin-top: 0; }
  .time-layout .timer-fields > .fb-f > label { margin: 0; line-height: 1.1; }
  .time-layout .timer-fields { padding-bottom: 8px; }
  .time-layout > .time-panel--timer > .time-panel-h { padding-bottom: 4px; }
  .time-layout > .pb-lines-time > .gtable { gap: 0; margin-top: 0; }
}
/* 11s / E4 (GAP-238): from 861 px plain card titles; the timer's fields in two rows (Client | Project / Service | Rate | Note) */
@media (min-width: 861px) and (min-height: 620px) {
  .time-layout .time-panel-h.fblock-h .fbh-ic { display: none; }
  .time-layout .time-panel-h.fblock-h .fbh-t { font-size: 16px; white-space: nowrap; }
  .time-layout .timer-fields { grid-template-columns: minmax(0, 1.3fr) 112px minmax(0, 1fr);
    grid-template-areas: "client project project" "service rate note"; }
  .time-layout .timer-fields > .tf-client { grid-area: client; }
  .time-layout .timer-fields > .tf-project { grid-area: project; }
  .time-layout .timer-fields > .tf-service { grid-area: service; }
  .time-layout .timer-fields > .tf-rate { grid-area: rate; }
  .time-layout .timer-fields > .fb-f.tf-note { grid-area: note; }
  .time-layout .timer-fields textarea.ctl-area { height: var(--h-field); min-height: 0; max-height: var(--h-field); padding-block: 7px; }
}
/* 11s / E4 (GAP-238): tablet landscape — totals + timer one short band (timer fields without labels, as the add row;
   the totals' title gives its room to the period), entry rows at the 44 px touch minimum: ≥ 2 rows in their box */
@media (min-width: 861px) and (max-width: 1199px) and (min-height: 620px) {
  .time-layout { grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  .time-layout > .fblock.time-panel { margin-top: 0; }
  .time-layout > .time-panel > .time-panel-h { padding: 0 8px 0 12px; margin-bottom: 2px; flex-wrap: nowrap; min-height: 44px; }
  .time-layout > .time-panel--totals .time-panel-h .fbh-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .time-layout > .time-panel--totals .time-panel-h { justify-content: flex-end; }
  .time-layout .time-period-bar { flex-wrap: nowrap; gap: 4px; }
  .time-layout .time-period-label { min-width: 0; }
  .time-layout > .time-panel--totals .time-totals-scroll { flex: 1; min-height: 0; max-height: none; }
  .time-layout > .time-panel--totals { contain: size; }   /* the band is the timer's height; the totals scroll in it */
  .time-layout .timer-fields { gap: 4px 8px; padding: 0 12px 6px; }
  .time-layout .timer-fields > .fb-f { margin: 0; }
  .time-layout .timer-fields .ctl { margin-bottom: 0; }
  .time-layout .timer-fields > .fb-f > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .time-layout > .time-panel--timer .timer-running { flex-direction: row; justify-content: space-between; gap: 12px; text-align: left;
    margin: 0 12px 8px; padding: 8px 14px; }
  .time-layout > .time-panel--timer .timer-running-clock { font-size: 30px; }
  .time-layout > .pb-lines-time > .time-panel-h { margin-bottom: 0; min-height: 30px; padding-block: 0; }
  .time-layout > .pb-lines-time > .gtable { gap: 0; margin-top: 0; }
  .time-layout .gtable--time .gt-row { padding-block: 2px; row-gap: 2px; }
  /* the room goes to the words: a project's / service's name and the note are read whole; the numbers keep theirs */
  .time-layout .gtable--time .gt-row, .time-layout .gtable--time .gt-head { padding-inline: 8px; column-gap: 6px;
    grid-template-columns: 112px minmax(200px, 1fr) minmax(250px, 1.4fr) 116px 130px 36px; }
  .time-layout .gtable--time .gt-hp, .time-layout .gtable--time .gt-hp .gt-hf { gap: 3px; letter-spacing: .02em; }
  .time-layout .gtable--time .gt-head { padding-block: 4px; }
}
@media (min-width: 861px) and (max-width: 1199px) and (min-height: 620px) and (pointer: coarse) {
  .time-layout .gtable .gt-f input, .time-layout .gtable .gt-f select, .time-layout .gtable .gt-f .client-derived,
  .time-layout .timer-fields .ctl, .time-layout .timer-fields textarea.ctl-area { height: 44px; max-height: 44px; }
  .time-layout .gtable .ga-amount .mono { height: 44px; line-height: 44px; }
}
/* the entry fields in their rows: the one field height — 36 px with a mouse, 44+ on touch (was 28 px) */
@media (min-width: 768px) {
  .gtable .gt-f input, .gtable .gt-f select, .gtable .gt-f .client-derived { height: var(--h-field); }
  .gtable .gt-f .client-derived { display: flex; align-items: center; }   /* 11s / E4: the client's name mid-field */
  .gtable .ga-amount .mono { height: var(--h-field); line-height: var(--h-field); }
}
/* Standard Gestano module header (icon+title left / action right) PLUS a subtle accent-tinted band so
   the two panels read as distinct zones (Dick's "more accent for clarity" ask) — scoped to /time/
   only via .time-panel-h, layered on the canonical .fblock-h.has-ic treatment (never modifies the
   shared rule other screens rely on). The icon chip swaps to --surface so it still pops against the
   now-tinted header instead of blending into it. */
/* 11s / E4 (GAP-238): today's look — a white card with a plain head (no tinted band), as every 11r screen */
.time-panel-h { padding: 8px 12px; margin-bottom: 6px; border-bottom: none; flex-wrap: wrap; }
.fblock-h.has-ic.time-panel-h { border-bottom: none; }
/* Totals period bar — CLEAN REBUILD (2026-07-14): a self-contained, NON-WRAPPING flex cluster,
   deliberately NOT built on .inline-row (whose flex-wrap:wrap + `>div{flex:1;min-width:140px}` made
   the label force the nav to break, stacking the arrows vertically, and let "All time" float loose).
   `flex-wrap:nowrap` guarantees ‹ date › stays on one line; the label's min-width fits the WIDEST
   mode (the week range "07 Jul – 13 Jul 2026") so all four modes occupy the identical box and the
   toggle never jumps. In All mode `.is-all` hides the arrows in place (visibility:hidden → footprint
   reserved) while the label shows a tidy "All time" IN its centered slot — never dumped in the header. */
.time-period-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.time-period-nav { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.time-period-nav.is-all .icon-btn { visibility: hidden; pointer-events: none; }
.time-period-label { display: inline-block; min-width: 20ch; text-align: center; white-space: nowrap; }
/* Zebra on booked rows only, counted among .gt-row siblings (stable with or without the add-row). */
.gtable .gt-body .gt-row:nth-child(odd of .gt-row) { background: var(--dt-zebra); }

/* Sortable grid header (review-pass 3) — the SAME caret contract as .sortable-table th.sortable /
   .notes-table th.sortable (cursor/hover/⇅↑↓ via ::after on [data-dir]), re-scoped to this grid's
   <span><a> header cells instead of <table><th> (CSS Grid, not a table) — same visual vocabulary,
   never a parallel one. */
.gtable .gt-head .sortable { cursor: pointer; user-select: none; white-space: nowrap; color: inherit; text-decoration: none; }
.gtable .gt-head .sortable:hover { color: var(--accent); }
.gtable .gt-head .sortable::after { content: " ↕"; color: var(--faint); font-size: 10px; }
.gtable .gt-head .sortable[data-dir="asc"]::after { content: " ↑"; color: var(--accent); }
.gtable .gt-head .sortable[data-dir="desc"]::after { content: " ↓"; color: var(--accent); }

@media (min-width: 1025px) {
  .inv-form-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════════════════════════════════════
   RELATION HUB — tabbed detail (seed: Artifact-relation+list.html). Built on the
   shared tokens; numerics use .mono (NOT a bare .m, which clashes with .rel-meta).
   ════════════════════════════════════════════════════════════════════════════ */
/* the outer shell is NO LONGER a box — the field area sits on the plain page bg (Dick's mockup);
   only the tab region (.reltabs) keeps a bg+border. .relcard stays the full-height flex container. */
.relcard { background: transparent; border: none; border-radius: 0; }
/* The tab block: white CONTENT surface, rounded + clipped. NO outer border — it read as a light sliver
   above the tinted bar (the tabstrip tint now reaches the very top edge, flush into the rounded corners). */
.reltabs { background: var(--surface); border: none; border-radius: var(--radius-xl); overflow: hidden; }
.rt-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rava { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; flex: none; }
.rid { flex: 1; min-width: 260px; }
.rid h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
/* ── Badge (.tag) — THE single source (the duplicate ~L354 base was removed; it neutralised the colour
   modifiers). Every role + standing modifier resolves to its OWN colour (matches the .role- and .standing-
   list scheme). A neutral default means an unknown modifier still renders a visible badge, never blank. */
.tag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; line-height: 1.5;
  margin: 0; padding: 2px 8px; border-radius: var(--radius-pill); font-family: var(--font-display);
  background: var(--neutral-200); color: var(--ink); }   /* margin:0 — the role 'lead' badge also matches the paragraph .lead (margin) rule; neutralise it */
.tag.client { background: var(--accent-soft);  color: var(--accent); }   /* green  */
.tag.supplier { background: var(--amber-soft);   color: var(--amber); }    /* amber  */
.tag.lead { background: var(--blue-soft);     color: var(--blue); }     /* blue   */
.tag.contact { background: var(--slate-soft);    color: var(--slate); }     /* slate (not grey) — role 'contact' */
.tag.bad { background: var(--overdue-soft);  color: var(--overdue); }  /* red — standing bad_payer / blacklisted */


/* tab strip */
/* tab BAR: tinted like the Relation-ID block (--surface-sunk) so it reads distinct from the white tab
   CONTENT below; tabs spread full-width (space-between) instead of clustering left. */
.tabstrip { display: flex; align-items: stretch; gap: 1px; margin: 0; padding: 0 10px; background: var(--surface-sunk); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; justify-content: space-between; }
.tabstrip::-webkit-scrollbar { height: 0; }
/* context-aware create action, pinned to the right of the bar; min-width keeps the tab spread stable
   across tabs whether or not the active tab has an action. */
.tabstrip .tab-actions { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 148px; padding-left: 10px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 13px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--font-display); background: none; border-top: none; border-left: none; border-right: none; }
.tab:hover { color: var(--ink); }
.tab .pic { color: var(--faint); }
.tab .n { font-family: var(--font-num); font-size: 10px; color: var(--faint); background: var(--bg); padding: 1px 6px; border-radius: var(--radius-pill); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab.on .pic { color: var(--accent); }

/* panes + cards */
.pane { padding: 0; }
.pane[hidden] { display: none; }
.pcard { display: flex; flex-direction: column; min-width: 0; }
.pcard-h { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pcard-h .pic { color: var(--accent); }
.pcard-h h3 { font-size: 14px; font-weight: 600; flex: 1; }
.pcard-h .ct { font-family: var(--font-num); font-size: 11px; color: var(--faint); background: var(--bg); padding: 1px 7px; border-radius: var(--radius-pill); }
.pcard-h .btn { margin-left: 6px; }
.pcard-b { overflow: auto; }

.notebox { padding: 15px; font-size: 13px; color: var(--muted); line-height: 1.65; }
.notebox p + p { margin-top: 10px; }

/* list/grid toggle (seed toolbar). The .fchips/.fchip/.fchip.on rules are consolidated ONCE up near
   .toolbar (Phase-5 §3.8 dedup: the two blocks are merged into the single per-property-identical rule). */
.viewtoggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: auto; }
.viewtoggle .vt { padding: 7px 9px; color: var(--muted); cursor: pointer; display: grid; place-items: center; background: var(--surface); border: none; }


/* ════════════════════════════════════════════════════════════════════════════
   RELATION HUB — gap-fix: standing colours, full-height desktop, decorative map,
   and the seed's DEDICATED mobile (.m-*) layouts. (2026-06-26)
   ════════════════════════════════════════════════════════════════════════════ */

/* Settings → Relations roles (standings) manager — rides the .cfg-tbl editable-list base (NOT the
   `.tbl` data-table skin), so its row height + vertical rhythm match Salutations/Social/VAT. These add
   ONLY the column-specific bits: a header band (takes effect HERE only, where `.tbl` is absent — the
   Users capabilities grid stays `tbl std-table`, so `table.tbl th/td` at higher specificity override
   these there and it is untouched), perm-column centering, and the colour input box. */
.std-table th { text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); font-weight: 600; padding: 8px 8px 6px; border-bottom: 1px solid var(--dt-head-line);
  vertical-align: middle; }
.std-table td { vertical-align: middle; }
.std-table .std-perm-h { font-size: 10.5px; text-align: center; white-space: nowrap; }
.std-table .std-perm { text-align: center; }
.std-table .std-perm input { margin: 0; }
.std-table input[type="color"] { width: 38px; height: 28px; padding: 1px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }

/* ── Desktop full-height (V2 flex model): the relation-detail shell is exactly one
   viewport tall, the card flex-fills the space below the top bar, only inner tables
   scroll. Scoped to pages that contain a .relcard so other screens still page-scroll. ── */
@media (min-width: 861px) {
  /* Frame = min-height (NOT fixed 100vh) + NO overflow clip: the detail fills the viewport so the tab
     region can flex to the bottom on tall screens, but GROWS with content and lets the PAGE scroll on
     short viewports — never clips the bottom out of reach. Inner tab scroll (.pcard-b) still works. */
  body:has(.relcard) .main { min-height: 100vh; }
  /* In the fill frame the tab region already sits above the fixed status bar, so the page-level
     status-bar reserve padding is not needed here — dropping it avoids a spurious ~1-line forced
     scroll on tall screens where the detail just fits. (Page-scroll screens still clear the bar via
     the reltabs sitting inside the frame.) */
  /* .content must be a flex COLUMN (not just a flex item) or the next link `.relcard{flex:1}` is inert
     and the card never stretches → the tab region can't reach the bottom. This makes the whole chain
     .main→.content→.relcard→.reltabs→.pane→.pcard→.pcard-b resolve. */
  /* Breathing room below the tab block (Dick 2026-07-01): clear the fixed status bar + a small margin so
     the tab region ends a little ABOVE the footer (still flex-fills the space; just not flush/under it). */
  body:has(.relcard) .content { flex: 1; min-height: 0; display: flex; flex-direction: column;
                                padding-bottom: calc(var(--statusbar-reserve) + 8px); }
  .relcard { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
  .relcard > .rel-top { flex: none; }
  .relcard > .reltabs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .reltabs > .tabstrip { flex: none; }
  .reltabs > .pane:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .reltabs > .pane > .pcard { flex: 1; min-height: 0; }
  .pcard > .pcard-b { flex: 1; min-height: 0; overflow: auto; }
  .m-listscroll { display: none !important; }
}

/* ── Internal list scroll, site-wide (Dick 2026-07-01): on a TALL-ENOUGH viewport the frame is CAPPED to
   the viewport so the inner list scroll containers actually overflow → the wheel scrolls the LIST, not the
   page (FM feel); toolbar/filters/header stay fixed above. On SHORT viewports we keep the min-height +
   page-scroll fallback (the tab-fill fix) so nothing clips. Two height thresholds because the detail
   header (rel-top) is much taller than a list toolbar, so each caps only where it fits without clipping.
   ── DETAIL tab lists: cap the .relcard frame → the flex chain bounds .pcard-b (already overflow:auto). ── */
@media (min-width: 861px) and (min-height: 840px) {
  body:has(.relcard) .main { height: 100vh; overflow: hidden auto; }
  /* 10a / 0d: a tall head (product, company) squeezed the tabs to 0 px at 1470×850 — keep them a usable
     height; the page scrolls when head + tabs pass the viewport */
  .relcard > .reltabs { min-height: 260px; }
}
/* ── MAIN list screens: cap the frame + a bounded .results-scroll region (the #…-results div) so the
   table body scrolls internally, the toolbar/filters above it staying put. Lower threshold — a list's
   fixed chrome (toolbar) is small, so it caps safely on most screens. ── */
@media (min-width: 861px) and (min-height: 620px) {
  body:has(.results-scroll) .main { height: 100vh; overflow: hidden; }
  body:has(.results-scroll) .content { display: flex; flex-direction: column; min-height: 0; }
  .listwrap { display: flex; flex-direction: column; min-height: 0; flex: 1; }
  .results-scroll { flex: 1; min-height: 0; overflow: auto; }
  /* keep the column headers visible while the body scrolls (FM look) */
  .results-scroll table.tbl thead th { position: sticky; top: 0; z-index: 1; }
}

/* ══ Slice 4b — SETTINGS viewport-fit + master-detail (mirrors the .relcard / .results-scroll model).
   The Settings screens (General · Templates · Users · Custom Fields · Tables · Appearance+Terminology ·
   API) each wrap their body in `.settings-fit`; the frame caps to the viewport so the PAGE never scrolls
   and internal panes (the scroll region / the master-detail list + detail) scroll on their own. Below the
   height threshold the cap lifts → page-scroll fallback, so nothing ever clips on a short screen. ══ */
@media (min-width: 861px) and (min-height: 620px) {
  body:has(.settings-fit) .main { height: 100vh; overflow: hidden; }
  body:has(.settings-fit) .content { display: flex; flex-direction: column; min-height: 0;
    padding-bottom: calc(var(--statusbar-reserve) + 8px); }
  .settings-fit { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .settings-fit > .settings-scroll { flex: 1; min-height: 0; overflow-y: auto; }
  .settings-fit > .md { flex: 1; min-height: 0; }
}
/* Settings tab-hubs (Phase-1) use the canonical `.reltabs` card, but they live in the scrolling
   `.settings-scroll` — NOT the `.relcard` viewport-fill model. So the desktop detail-hub fill rule
   `.reltabs > .pane:not([hidden]){display:flex;flex-direction:column}` (≥861px) must not flatten a
   Settings pane: restore block/grid so the form_section tiling (the cd7813f width-fill arrangement)
   holds. The reltabs card supplies the surface+radius; the form-grid columns come from the @container
   queries (the .settings-scroll.page-form host). */
.settings-scroll .reltabs > .pane:not([hidden]) { display: block; flex: none; min-height: 0; }
.settings-scroll .reltabs > .pane.form-grid { display: grid; }

/* Settings tab-hub holding a MASTER-DETAIL (Templates rebuild): the reltabs fills the viewport-fit
   frame; its active pane + the .md inside fill so the list/detail scroll internally, page never scrolls. */
.settings-fit > .reltabs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.settings-fit > .reltabs > .tabstrip { flex: none; }
.settings-fit > .reltabs > .pane { padding: 12px 14px; }
.settings-fit > .reltabs > .pane:not([hidden]) { flex: 1; min-height: 0; display: flex; }
.settings-fit > .reltabs > .pane > .md { flex: 1; min-height: 0; }

/* General settings sub-menu = the relation-hub tab strip, on top (Slice 4b). Reuses .tabstrip/.tab
   visuals + the mcShowSub mechanism (.sub-tab-link / data-subtabs); left-aligned (no tab-actions). */
.settings-fit > .tabstrip { flex: none; }

/* Master-detail: a narrow LIST left (scrolls in its own pane), the DETAIL right (scrolls in its own
   pane). One shape for Templates / Users / Custom Fields / Tables. */
.md { display: flex; gap: 14px; align-items: stretch; }
.md-list { flex: 0 0 248px; max-width: 248px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.md-list-head { padding: 9px 12px; border-bottom: 1px solid var(--line); font-family: var(--font-display);
  font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--muted); text-transform: uppercase;
  flex: none; }
.md-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.md-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer;
  border: 0; border-bottom: 1px solid var(--line2); color: var(--ink); font-size: 13.5px; width: 100%; text-align: left;
  background: none; border-left: 3px solid transparent;
  appearance: none; -webkit-appearance: none; }   /* border:0 kills the native <button> 2px-outset-black on top/right (appearance:none does NOT remove it in Chrome); bottom/left re-added after. .md-item is a <button> on Templates/Users/Custom Fields/Tables */
.md-item:hover { background: var(--surface-sunk); }
.md-item.on { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.md-item .md-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-item .md-tag { font-size: 10px; font-family: var(--font-num); color: var(--faint); background: var(--bg);
  padding: 1px 6px; border-radius: var(--radius-pill); flex: none; }
.md-item.on .md-tag { color: var(--accent); background: var(--surface); }
/* Templates rows: the default star sits BESIDE the row button */
.md-item-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line2); }
.md-item-row .md-item { border-bottom: 0; flex: 1; min-width: 0; }
.md-item-star-form { display: flex; align-items: center; padding: 0 8px; flex: none; }
.md-item-star { color: var(--faint); }
.md-item-star:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.md-detail { flex: 1; min-width: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 16px 18px; }
.md-detail .md-empty { color: var(--muted); display: flex; height: 100%; align-items: center; justify-content: center; text-align: center; }
.md-editor-head, .fblock-h.has-ic { display: flex; align-items: center; gap: var(--gap-head-ic); padding-bottom: var(--gap-head-rule); margin-bottom: var(--gap-head-body); border-bottom: 1px solid var(--line); }
.md-editor-head .lic, .fblock-h.has-ic .fbh-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
/* the master-detail detail forms don't need the extra page lead/margin — tighten them */
.md-detail > .form:first-child, .md-detail > form:first-child { margin-top: 0; }
.md-detail h2.sub:first-child { margin-top: 0; }
@media (max-width: 860px) {
  .md { flex-direction: column; }
  .md-list { flex: none; max-width: none; max-height: 44vh; }
}


/* ── Mobile (≤860px): the seed's dedicated layouts (NOT a reflow of the desktop) ── */
.m-listscroll { display: none; }   /* shown only in the mobile media block */

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 100px; padding: 6px 11px; flex: none; font-family: var(--font-display); }
.chip .pic { color: var(--accent); }
.chip .n { font-family: var(--font-num); font-size: 10px; color: var(--faint); }

.m-listscroll .m-lrow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line2); color: var(--ink); }
.m-lrow .mini { width: 36px; height: 36px; font-size: 12px; border-radius: 9px; }
.m-lrow .lx { flex: 1; min-width: 0; }
.m-lrow .nm { font-weight: 500; font-size: 14px; }
.m-lrow .sub { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; }

/* ════════════════════════════════════════════════════════════════════════════
   RELATIONS detail — the V2 Artifact card, refined for clarity (round 2).
   Bigger fonts, Title-case block headers (no CAPS), darker VALUES vs lighter
   placeholders/chrome. Fields are placeholder-driven, grouped into equal-width blocks.
   Read/edit IN PLACE: `.ctl` controls are borderless+flat in read, bordered+white in edit
   — fixed-height border-box so that is the ONLY delta → ZERO layout shift. i18n-flex.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Header: editable Company-name title + the two top-right blocks ── */
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* .title-input.ctl (0,2,0) beats the base field box → borderless transparent heading in READ mode (--neutral-300 only in edit). */
.title-input.ctl { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-input);
  padding: 2px 6px; box-sizing: border-box; min-width: 220px; max-width: 100%; flex: 1 1 auto; height: 38px; }
.reldetail.mode-edit .title-input { border-color: var(--neutral-300); background: var(--field-bg); }
.title-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

/* Document detail: the big client-name title is an IN-PLACE customer control (Dick 2026-07-04) —
   read = the name (links to the contact), edit = the type-ahead picker, find = the customer-name
   criterion; all moved here from the sidebar Customer row (now removed). */
/* Edit-mode customer picker fills the title row = full 2-column main width (Dick 2026-08-14: long
   company names were clipped at the old fixed 320px). title-cust is flex:1, so filling it = full width. */

.hblock { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.hb-id { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 6px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
/* Standing field (Stage 2) — prominent pill in the standing's configured colour, under the Relation-ID number */
/* Standing + Type are ONE grouped section above a single divider (Dick 2026-06-29): the divider moved
   from under Standing to .hb-group (below Type). */
.hb-group { padding-bottom: 6px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.standing-pill { display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--neutral-200); color: var(--ink); white-space: nowrap; }
/* list-dense variant — SAME colour rendering as the card pill (color-mix from the configured colour set
   inline per row), just smaller so the directory list stays dense. ONE colour source everywhere. */
.standing-pill.sm { font-size: 10.5px; font-weight: 600; padding: 2px 9px; line-height: 1.4; }

/* ── List tables: dynamic column widths (scoped to .tablecard so the relation-card tabs are untouched).
   Narrow columns shrink-wrap to their content (width:1% + nowrap); the .col-primary identity column
   (Company Name / Customer / Subject / Product Name) absorbs the remaining width. ── */
.tablecard .sortable-table { width: 100%; table-layout: auto; }
.tablecard .sortable-table th, .tablecard .sortable-table td { white-space: nowrap; width: 1%; }
.tablecard .sortable-table th.col-primary, .tablecard .sortable-table td.col-primary { width: auto; white-space: normal; }
/* The colspan "No … yet" row must wrap: under the nowrap above it pushed an empty table wider than its card. */
.tablecard .sortable-table td.empty-state { white-space: normal; }
/* ── Bank ledger row controls (VAT epic Slice 4a): the review cluster (status pill · business/personal
   toggle · reviewed · remove) on ONE line inside its table cell. Each control is its own tiny <form>
   (a GET-list row cannot nest one form), and a wrapping cluster turned every ledger row into a
   3-line, 200px-tall block — the Viewport Rule defect this rule prevents. Layout only; the controls
   keep the shared .btn/.pill styling. ── */
.bank-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem;
  flex-wrap: nowrap; }
@media (max-width: 899px) { .bank-actions { flex-wrap: wrap; } }
.bank-actions form { margin: 0; }
/* ── Bank ledger FILTER BAR (4c follow-up): the "Uncategorised only" filter made it nine controls,
   and the shared `.inline-row` (flex-wrap + `>div{flex:1}`) then stretched whatever landed on the
   last line across the full width — one giant select next to a small button, the "never an orphan
   row / don't pack, don't cramp" defect. An even auto-fill grid wraps them into equal cells instead,
   so every filter keeps the SAME width whichever line it falls on. Scoped to this one form: the
   shared `.inline-row` used by every other screen is untouched. Layout only. ── */
#bankFilters .inline-row { display: grid; align-items: end;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hb-id-l { font-size: 12px; color: var(--muted); font-family: var(--font-display); }
.hb-id-n { font-family: var(--font-mono); font-weight: 600; font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.hb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 2px 0; }
.hb-row > span { color: var(--muted); font-family: var(--font-display); white-space: nowrap; }
.hb-row > b { color: var(--ink); font-weight: 600; text-align: right; min-width: 0; }
.kpi-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 15px; }
.kpi-num.flag { color: var(--overdue); }
/* down-payment edit row: "active" checkbox + a narrow right-aligned amount input, flush right like the values */
/* the audit box folds into the Info block — borderless there (the macro stays reusable elsewhere) */
.info-block .audit-box { border: none; background: transparent; padding: 6px 0 0; margin-top: 5px; border-top: 1px solid var(--line); min-width: 0; }

/* ── PART B/C — Relation-ID block pickers: Internal-company membership + the Type field ──
   The pull-down is a native <details>; its menu is position:absolute so OPENING it never shifts the
   card (zero-shift preserved). Read/edit reps swap via .det-read/.det-edit. */
.hb-row.hb-pick { align-items: center; }
.hb-pick > span + span { white-space: normal; text-align: right; min-width: 0; }

.ckdrop { position: relative; min-width: 0; }
.ckdrop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  max-width: 172px; font-size: 12.5px; font-weight: 600; font-family: var(--font-display); color: var(--ink);
  padding: 4px 9px; border: 1px solid var(--neutral-300); border-radius: var(--radius-input);
  background: var(--field-tint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ckdrop > summary::-webkit-details-marker { display: none; }
.ckdrop > summary::after { content: "▾"; margin-left: auto; padding-left: 4px; color: var(--muted); font-size: 11px; }
.ckdrop[open] > summary { border-color: var(--accent); box-shadow: var(--focus-ring); }
/* OPEN menu renders IN-FLOW (pushes the rows below down) rather than an absolute overlay, so it can
   NEVER cover — and trap clicks on — the adjacent dropdown's summary below it (two stacked pickers:
   Type + Internal Company). The card grows only while a picker is open (an interaction, not a mode
   change), so read↔edit zero-shift is unaffected. */
.ckdrop[open] { display: flex; flex-direction: column; align-items: flex-end; }
.ckdrop-opt { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500;
  font-family: var(--font-body); color: var(--ink); white-space: nowrap; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.ckdrop-opt:hover { background: var(--surface-sunk); }
.ckdrop-opt input { width: auto; margin: 0; }


/* ── ONE UNIFIED GRID (Dick's mockup) — headline + the 6 field blocks + the right block column ──
   Plain page background, NO box around the fields. **4 EQUAL columns (1fr each)** — the Relation-ID /
   Outstanding blocks are col 4, the SAME width as the field columns (the RIGHT COLUMN of THIS grid,
   not a side panel). Row 1: headline spans cols 1–3 · Relation-ID = col 4 spanning down beside it
   (rows 1–2). Row 2 fields: Name · Contact · Social.  Row 3 fields: Address 1 · Address 2 · Legal ·
   Outstanding (col 4). Stacks to one column below 1024px. Blocks keep style. */
.rel-top { display: grid; grid-template-columns: 1fr; gap: 14px 28px; padding: 2px 0 16px; align-items: start; }
/* LEFT zone: header + the 6 field blocks in their own grid (single column on mobile). Independent from
   the right .detail-side zone so the two columns size their own heights (no shared-row coupling). */
.rel-left { display: grid; grid-template-columns: 1fr; gap: 14px 28px; align-content: start; min-width: 0; }
/* Row-2 column alignment (Dick 2026-08-09): fb-name is the FIRST field block, right after .rt-head,
   so the `.fblock + .fblock` stack margin skips it — leaving column 1 (Name/Legal) 16px HIGHER than
   its row-mates (Contact/Social). Hand it the SAME --gap-stack so all three columns share one
   baseline and the whole board keeps a uniform block rhythm. Applies to Relations AND the Company
   hub (shared archetype). */
.rel-left .rt-head + .fblock { margin-top: var(--gap-stack); }
/* Settings tabs reuse .rel-left with NO .rt-head, so the first field block is .rel-left's first child
   and the `.fblock + .fblock` stack margin skips it — the top row (e.g. Invoices: Numbering vs
   Recurring/Payment) rode 16px higher (Dick 2026-08-14). Give the first block the --gap-stack so all
   columns share one top baseline. Relations/Company detail unaffected (first child is .rt-head). */
.pane .rel-left > .fblock:first-child { margin-top: var(--gap-stack); }
/* Responsive VAT consolidation text (Dick 2026-08-09): the long form
   "Registration type: … Consolidates on VAT with …" only fits the fiscal-type column on a wide
   monitor; below that show the short form by hiding the " type" / " on VAT" words. */
.vat-wide-word { display: none; }
@media (min-width: 1900px) { .vat-wide-word { display: inline; } }
@media (min-width: 1024px) {
  /* Relations detail = TWO independent zones (like Products .prod-left/.prod-side): a 3fr LEFT field
     grid + a 1fr right .detail-side stack. Each column sizes its own height, so the right stack is
     top-aligned and tight without inflating the field rows or forcing scroll. */
  .reldetail:not(.proddetail) .rel-top { grid-template-columns: minmax(0,3fr) minmax(0,1fr); }
  .rel-left { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .rt-head { grid-column: 1 / -1; grid-row: 1; }
  .fb-name { grid-column: 1; grid-row: 2; }
  .fb-contact { grid-column: 2; grid-row: 2; }
  .fb-social { grid-column: 3; grid-row: 2; }
  .fb-addr { grid-column: 1; grid-row: 3; }
  .fb-addr2 { grid-column: 2; grid-row: 3; }
  .fb-legal { grid-column: 3; grid-row: 3; }
  /* fb-appearance — the /me/ page ONLY (company-settings redesign PART C): same slot fb-legal uses
     on the Company hub (the two never appear on the same page — /me/ has no Legal block). */
  .fb-appearance { grid-column: 3; grid-row: 3; }
  /* fb-vat — the COMPANY hub only (VAT epic Slice 1): fiscal type + VAT registration. A 7th block
     on its own row rather than inside Legal, so a company with several registration peers cannot
     inflate row 2 and push the whole board into scroll. Spans all 3 columns: its two pulldowns sit
     side by side and the consolidation notice gets the full width, instead of a tall narrow stack
     in col 1 leaving cols 2–3 empty. */
  .fb-vat { grid-column: 1 / -1; grid-row: 4; }
  .fb-vat .vat-row { display: flex; gap: 28px; align-items: flex-start; }
  .fb-vat .vat-row > * { flex: 1; min-width: 0; }
  /* regtype-row (VAT epic Slice 1b) — the registration-type pulldown beside its OWN small Save.
     Deliberately not a .vat-row: that hands every child an equal flex share, which is right for a
     row of peer pulldowns but would inflate a two-word button to half the block. The pulldown takes
     the space; the button stays its own size (global rule: small buttons by default). Mobile is
     unstyled here, so it stacks — same as .vat-row. */
  .fb-vat .regtype-row { display: flex; gap: 12px; align-items: center; }
  .fb-vat .regtype-row > select { flex: 1; min-width: 0; }
  /* fb-sig — the Users hub's Mail signature block (mail-signature slice): full-width row 4, the same
     slot fb-vat uses on the Company hub (the two never appear on the same page). */
  .fb-sig { grid-column: 1 / -1; grid-row: 4; }
  /* Company hub — NO `[data-base="/companies"]` grid/spacing override (removed 2026-08-09,
     match-relations dispatch). The right rail is now the SAME 3 cards every detail page carries
     (Company ID · KPI · Branding), so it inherits the shared 3fr/1fr `.rel-top`, `.detail-side`
     gap 12px and `.hblock` padding 9px 12px exactly — consistency by construction, the archetype
     is never bent (design-system § "Alignment is a hard rule"). */
}

/* ── Shared right-column stack (app-wide default for ALL detail views — Relations, Products, …):
   blocks stack from the TOP with one small uniform gap (no grid-row dead space, no forced scroll). ── */
.detail-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; align-self: start; }

/* ── Selections block (spec 2026-07-01) — bottom of the right column. Compact rows matching .hblock
   density: [checkbox] [name] [Clear]; pencil (rename) top-right. ── */
/* Company hub — logo block (read = current logo, edit = file picker). */
.co-logo { margin-top: 4px; }
.co-logo-img { max-height: 46px; max-width: 160px; object-fit: contain; display: block; }
/* Compact logo control row: the native file selector + a right-aligned trash icon on ONE line. */
.co-logo-ctl { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.co-logo-ctl input[type=file] { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted); }
.co-logo-ctl .logo-del-form { flex: none; margin: 0 0 0 auto; }
/* Company hub — the Branding card's 3-logo row (per-slot role label) and the header company
   pulldown. Muted labels (emphasis-on-value); density from spacing, not tiny type. */
.logo-slot { min-width: 0; }
.logo-role { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
/* Branding card (2026-08-09) — accent row + the three logos live in ONE framed right-rail `.hblock`
   (Dick: "Use Block background like the above blocks"). The three logos STACK vertically (Dick
   2026-08-09): the rail is only ~295px, so three side-by-side slots crushed the "Choose file / no
   file chosen" control until it was unreadable — full-width stacked slots keep each file selector
   legible. */
.branding-block .logo-row { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 8px; }
.branding-block .logo-slot { flex: none; width: 100%; }
/* VIEW mode only (Dick 2026-08-09): each logo on ONE line — short label left, logo right — to save
   space. EDIT mode keeps the full label above the file-selector + trash row (the default block flow). */
.reldetail.mode-read .branding-block .logo-slot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reldetail.mode-read .branding-block .co-logo { margin-top: 0; }
/* Per-logo Remove control (edit mode only, shown when a logo exists) — its own tiny form, so removing
   a mistaken upload never rides the company Save. Positioned by .co-logo-ctl (right-aligned trash). */
/* Accent row — a small colour swatch + hex in read mode, the compact colour input in edit mode,
   both riding the shared `.hb-row` + `.det-read`/`.det-edit` idiom (identical to the Status row). */
.accent-swatch { display: inline-block; width: 13px; height: 13px; border-radius: 3px; vertical-align: middle;
                 margin-right: 6px; border: 1px solid var(--border); }
.branding-block .ib-ctl { flex: none; }
.branding-block .ib-ctl input[type=color].ctl { width: 44px; height: 24px; padding: 2px; margin: 0; }
/* Theme select (2026-08-14, Dick: "the pulldown is not in style") — select styling is context-scoped
   app-wide (no base select.ctl rule), so this bare native select rendered unstyled. Match the field
   family used elsewhere (estimates .ib-ctl select.ctl, line 1708) + the row height of Accent above. */
.branding-block .ib-ctl select.ctl { width: 180px; height: 24px; padding: 0 .4rem; margin: 0; font-size: 13px; }
.co-nav-select { max-width: 220px; }
/* ── Products detail (proddetail) — two zones: .prod-left (header + content, auto-reflow when type hides
   Inventory/Physical) + .prod-side (identity · KPI · Images stacked tight). The left column is its OWN
   container, so the sidebar's edit-mode growth never pushes the content down (read↔edit zero-shift).
   The .prod-side flex column also removes the old grid-row dead gap. The parallel .prod-* layout family is
   namespaced under the Layer-3 .module-products scope (Dick's decision — kept separate from .rel-*, not
   folded in); the product-detail root carries both .proddetail and .module-products. ── */
.module-products .prod-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* .prod-side now carries the shared .detail-side class (flex column + uniform gap) — only its grid
   placement stays here, so the right-column gap is the ONE app-wide value, not a per-view override. */
.module-products .prod-main { display: grid; grid-template-columns: 1fr; gap: 14px 28px; align-items: start; min-width: 0; }
@media (min-width: 768px) { .module-products .prod-main { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.module-products .prod-main .pb-desc { grid-column: 1 / -1; }
@media (min-width: 1024px) {
  .module-products .rel-top { grid-template-columns: minmax(0,3fr) minmax(0,1fr); align-items: start; }
  .module-products .prod-left { grid-column: 1; }
  .module-products .prod-side { grid-column: 2; }
  .module-products .prod-main { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .module-products .prod-main .pb-desc { grid-column: 1 / 3; }
  /* Pricing + Custom fields stack lives in col 3 for EVERY type (independent of the Description
     height) — the shared .detail-side class stacks them tight; Inventory/Physical flow in cols 1-2. */
  .module-products .prod-main .pb-side { grid-column: 3; }
}
/* project-type: Description textarea taller (bottom ~aligned with sidebar Images block at 1280px) */
.proddetail.pt-project .pb-desc .ctl-area { height: 300px; min-height: 300px; max-height: 300px; overflow-y: auto; resize: none; }
/* project-type Client row (051, Time-Tracking) — the relation-picker `<select>` + the Internal
   toggle sit side by side in the SAME edit-mode cell (mutually exclusive: pick one or the other). */
.pt-client-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-client-edit .pt-internal { margin-bottom: 0; }
/* ── Estimates detail (estdetail) — Slice 1 of the Estimates rework (2026-07-01): same tabbed
   read/edit-in-place archetype as Products (.proddetail), fields differ. .est-left (header + content
   blocks) + .est-side (shared .detail-side — Info + KPI). pb-lines/pb-scope span the full main width
   (Products' pb-desc equivalent). The .rel-top 3fr/1fr split is already inherited from the Relations
   default (`.reldetail:not(.proddetail) .rel-top`) since estdetail carries no .proddetail class.
   Scoped to .estdetail — zero effect on Products/Relations. ── */
/* Top-row column alignment (Dick 2026-08-09): pb-cust (Address) is est-main's FIRST child, so the
   `.fblock + .fblock` stack margin skips it — leaving column 1 16px above pb-contact (col 2). Same
   defect and same cure as `.rel-left .rt-head + .fblock`: hand the first block the --gap-stack so both
   top columns share one baseline on Estimate / Order / Invoice detail (shared .estdetail archetype). */
/* Custom fields sit in column 2 next to Reference, below Contact (Dick 2026-08-14). With custom fields
   (.has-custom) Reference drops to col 1 and custom takes col 2 (DOM order Reference-then-custom keeps
   them in one row); with no custom fields Reference keeps its full-width row (rule below). */
/* Scope + Reference stay full-width in the est-main field grid. The Lines block (+ NEW-mode #linesHost)
   moved OUT of est-main (2026-08-14) to be a direct .est-left flex child, so it fills the column to the
   bottom by CSS flex (rules in the ≥1024 block) — replaces the old JS height calc that stopped filling
   when the script didn't run in a browser (the gap). */
/* sidebar Info block's editable hb-row controls (Status/Customer/Zero-VAT/Template/Acceptance) — same
   sizing as Products' equivalent, just scoped to estdetail instead of proddetail. */
/* 4a.4: compact reminder/recurring status on the info tab — right-aligned status text + a small action */
/* border/radius/bg come from the base field box; only compact geometry + date auto-width stay here. */
/* Terms (2026-07-01): a multi-line block now lives in the sidebar too — the general .ib-ctl .ctl
   rule above fixes height:30px (right for a single-line input), which would clip a multi-row
   textarea regardless of its `rows` attribute. Override height for THIS textarea specifically. */
/* ── ESTIMATE Info block (block 1) — COMPACT one-line rows (2026-07-03 redesign). Scoped to
   #reldetail[data-base="/estimates"] so Orders/Invoices (which share the .estdetail class) stay byte-for-byte
   untouched. Every row is ONE line, label left / control right, in BOTH read and edit — nothing stacks
   full-width any more, so the block no longer vertical-scrolls on a short viewport. Text/selects fill the
   row and grow on wider viewports with a 120px floor; date inputs size to the dd-mm-yyyy notation only;
   checkbox rows put the box hard-right. Reference now lives in the main column (.pb-reference), not here. */
#reldetail[data-base="/estimates"] .info-block .hb-row .ib-ctl { justify-content: flex-end; }
/* all selects (Customer · Terms · Payment · Template) = uniform FIXED 120px, right-aligned to the value
   gutter (same right edge as dates/checkboxes/read-mode values) — not row-filling. Styled to MATCH the
   date inputs (same neutral border + field-tint bg as input.ctl above; height/padding/font come from the
   shared .ctl base) so selects + dates read as one low-key field family. Native dropdown arrow kept. */
#reldetail[data-base="/estimates"] .info-block .hb-row .ib-ctl select.ctl { width: 180px; flex: 0 0 180px; min-width: 0; }
/* dates: sized to their fixed-length notation (~DD-MM-YYYY + picker), right-aligned to the gutter — no big
   field needed (the selects hold variable content, so they stay a fixed 120px; dates don't). */
#reldetail[data-base="/estimates"] .info-block .hb-row .ib-ctl input.ctl[type="date"] { width: auto; min-width: 0; flex: 0 0 auto; }
/* checkbox rows (EU reverse-charge · Ask to approve online): bare box, hard-right (label stays on the left). */
/* Reference relocated to the main column — a labeled full-width field above Scope (matches the .fblock look). */
/* Customer type-ahead picker: the typed field keeps the 120px gutter-aligned footprint + field-tint styling
   of the other controls (input.ctl gets its border/bg from the input.ctl rule above); the results dropdown is
   absolutely positioned BELOW it, right edge on the gutter, free to be wider than 120px.
   Generic base (any [data-relpick] host, e.g. a plain form — Time Entries): the two screen-scoped rules
   below override its size/alignment when they apply; this is just the positioned-ancestor default so
   .relpick-results (position:absolute) never escapes to an unrelated ancestor. */
.relpick { position: relative; display: inline-flex; }
#reldetail[data-base="/estimates"] .info-block .hb-row .ib-ctl.relpick { position: relative; flex: 0 0 180px; width: 180px; }
#reldetail[data-base="/estimates"] .info-block .hb-row .ib-ctl.relpick .relpick-input { width: 100%; min-width: 0; }
/* Projects detail — Dick 2026-08-16 (option B): full-width Overview, NO right sidebar. Revert the
   .reldetail 3fr/1fr split to one full-width column so the KPI cards + graphs span edge-to-edge and
   the edit panel is full-width. */
#reldetail[data-base="/projects"] .rel-top { grid-template-columns: 1fr; }
.relpick-results { position: absolute; top: calc(100% + 3px); right: 0; z-index: 40; min-width: 210px; max-width: 260px;
  max-height: 230px; overflow-y: auto; background: var(--surface); border: 1px solid var(--neutral-300); border-radius: var(--radius-input);
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 3px; }
.relpick-opt { display: block; width: 100%; text-align: left; padding: 6px 9px; font-size: 13px; line-height: 1.25;
  background: none; border: none; border-radius: 6px; cursor: pointer; color: var(--ink); font-family: var(--font-body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relpick-opt:hover { background: var(--field-tint); }
.relpick-none { color: var(--muted); border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 3px; }
.relpick-empty { padding: 7px 9px; font-size: 12px; }

/* ── relpick TRIGGER variant (Slice 1) — a select-shaped CLOSED control that, on click, hides
   itself and shows a `.relpick-panel` — the search input ON TOP, results below, ONE floating unit
   (not the base variant's input positioned separately from its results) so the two never drift
   apart under the flip/reposition math. Closed shape borrows .ckdrop-sum's recipe (padding/border/
   radius/tint, ▾ as a CSS ::after — never a text glyph) but NOT its in-flow panel (that shoves table
   rows down — a Viewport-Rule defect on a 100-row ledger); app.js positions `.relpick-panel` itself
   (fixed, flipped above the trigger when there's no room below) exactly as the base variant already
   positions `.relpick-results` alone. */
.relpick-trigger { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  max-width: 172px; font-size: 12.5px; font-weight: 600; font-family: var(--font-display); color: var(--ink);
  padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--radius-input);
  background: var(--field-tint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relpick-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.relpick-trigger-label { overflow: hidden; text-overflow: ellipsis; }
.relpick-trigger::after { content: "▾"; margin-left: auto; padding-left: 4px; color: var(--muted); font-size: 11px; }
.relpick-trigger[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--focus-ring); }
.relpick-panel { position: absolute; top: calc(100% + 3px); left: 0; z-index: 40; min-width: 210px; max-width: 260px;
  display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-input); box-shadow: var(--shadow-lift); padding: 5px; }
.relpick-panel .relpick-input { width: 100%; box-sizing: border-box; }
.relpick-panel .relpick-results { position: static; min-width: 0; max-width: none; border: none; box-shadow: none;
  padding: 0; margin: 0; }
.relpick-opt.relpick-active { background: var(--field-tint); }
/* Recipient type-ahead (mail compose To/Cc/Bcc) — a full-width .ctl input with the house
   .relpick-results dropdown anchored to it (left-aligned, matching the input width). */
.rcpt-ac { position: relative; display: block; }
.rcpt-ac > input { width: 100%; box-sizing: border-box; }
.rcpt-ac .relpick-results { left: 0; right: auto; min-width: 0; max-width: none; width: 100%; }

/* ── Slice 4a.1: the Financial report is a multi-panel dashboard (no .relcard) — it can't fit 850px
   without gutting the charts, so cap it to the viewport + scroll the report BODY internally (the same
   viewport-fit model the homepage `.body-new` uses). The page chrome stays fixed → NO page scroll. ── */
@media (min-width: 861px) {
  body:has(.fin-report) .app > .main { height: 100vh; overflow: hidden; }
  body:has(.fin-report) .content { flex: 1; min-height: 0; display: flex; flex-direction: column;
                                   padding-bottom: calc(var(--statusbar-reserve) + 8px); }
  body:has(.fin-report) .fin-report { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

/* ── Header form controls (`.hdr-ctl`) — a NAMED, SHARED variant of the `.topbar-actions` archetype,
   not a screen-scoped rule. Any screen that needs a select / date / text input beside the header's
   icon buttons uses this; Financials ▸ Overview is the first (Dick 2026-08-03). 32px = `.btn.sm`'s
   height. ⚠ NO width pin: a 97px pin once CLIPPED THE YEAR of the date inputs. */
.topbar-actions .hdr-ctl {
  width: auto;   /* header controls size to content (documented intent) — override the base .ctl width:100% */
  height: 32px; padding: 0 6px; border: 1px solid var(--line);
  border-radius: var(--radius-input); font: inherit; font-size: .82rem;
  background: var(--field-bg); color: var(--ink);
}
.topbar-actions .hdr-ctl:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

/* delta 6 — compact read-only contact card (phone/mobile/email/website), click-to-copy. data-copy-text
   sits on the VALUE span only (never a parent containing the icon) — app.js's mcFlash() replaces the
   clicked element's textContent to show "Copied!", which would silently delete a nested <svg> icon. */

.note-add-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-input); resize: vertical; }
.na-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ══ Estimate lines block — the SHARED 2-column look for BOTH estimate variants (4a-2, 2026-07-03).
   Scoped to `.pb-lines-est` (carried by est-project AND est-prodservhrs) so the two variants share the
   scroll/band/grid/stacked-right styling; `.est-prodservhrs` adds compact deltas below. Orders/Invoices
   render the else-branch structure (no `.pb-lines-est`) and keep the ORIGINAL rules right below. ══ */

/* Original pre-tweak lines-block rules — the non-est structure (Orders/Invoices) + the 8-col New-document
   forms (via the global .lc-del). `:not(.pb-lines-est)` = anything that is NOT an estimate variant. */
.lc-del { flex-direction: row; align-items: flex-end; gap: 4px; }
.pb-lines:not(.pb-lines-est) .fblock-h { margin-bottom: var(--gap-head-body); }
.pb-lines:not(.pb-lines-est) .lines-scroll { max-height: 360px; overflow-y: auto; }
.pb-lines:not(.pb-lines-est) .lines-scroll .inv-table.inv-view-lines { padding-top: 2px; }

/* ── Shared estimate-variant look: ONE viewport-capped scroll div (sizeLines() sets the max-height; 72vh
   = JS-off fallback), a sticky header bar, a 2-column row (Description/Subject/Item LEFT, stacked
   Qty/Unit/Cost/VAT/Total RIGHT), read mirroring edit for a 0px browse↔edit shift. ── */
.pb-lines-est { --lines-bar-h: 36px; }
/* Rounded top+bottom on the scroll box (overflow clips inside) → the "Lines" header gets rounded
   TOP corners, the body gets rounded BOTTOM corners, and the header↔body seam stays square —
   10px to match the other page blocks (.hblock).
   STYLE RULE A1 (staging-tuning 2026-07): the Est/Ord/Inv lines panel reuses the SAME dark-green
   tokens the Relations detail tabs use (shared source of truth) — body = --surface (like .reltabs),
   header = --surface-sunk (like .tabstrip) — so it reads consistently across Light/Dark/user themes
   instead of the old bright-mint (--green-pop / --accent-soft) that was too prominent in dark. */
.pb-lines-est .lines-scroll { max-height: 72vh; overflow-y: auto; overflow-x: hidden; background: var(--surface); border-radius: 0 0 10px 10px; }
.pb-lines-est .lines-head-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center;
  justify-content: space-between; gap: .8rem; height: var(--lines-bar-h); padding: 0 10px; background: var(--surface-sunk); border-radius: 10px 10px 0 0; }
.pb-lines-est .lines-head-title { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--ink-muted); }
.pb-lines-est .lines-add-btn { flex: none; }
/* 2px L+R inset so the green lines-panel shows on both sides of each line card (Dick 2026-07-03). */
.pb-lines-est .inv-table, .pb-lines-est .line-editor { margin-top: 0; padding-left: 2px; padding-right: 2px; }
.pb-lines-est .lc-desc { display: flex; flex-direction: column; gap: .4rem; }
/* align-items:stretch is REQUIRED here: `.lv-side` (a `.inv-row > span`) otherwise inherits
   align-items:baseline from the base .inv-row rule, which shrink-wraps each `.lf` — so the values would
   sit just after their label instead of filling the column. Stretch lets `.lf-v`/inputs reach the edge. */
.pb-lines-est .lc-side, .pb-lines-est .lv-side { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
/* one label-prefixed field: a muted display label ("Qty:"), then its control/value filling the rest */
.pb-lines-est .lf { display: flex; align-items: center; gap: .45rem; }
.pb-lines-est .lf-l { font-family: var(--font-display); font-size: 12px; color: var(--muted); min-width: 44px; flex: none; }
.pb-lines-est .lf > input { flex: 1; min-width: 0; padding: .35rem .5rem; text-align: right; }
.pb-lines-est .lf-v { flex: 1; text-align: right; font-size: 12.5px; }
/* flush-right number column (Dick 2026-07-03): every VALUE shares ONE right edge at the card edge, labels
   stay left. flex:1 items (Qty/Unit/Cost inputs + read .lf-v) already fill to the edge once .lf is full
   width; the fixed-width VAT select and the read-out Total get margin-left:auto to sit flush right too. */
.pb-lines-est .lf > .line-vat { flex: 0 0 auto; width: 78px; padding: .35rem .4rem; margin-left: auto; }
.pb-lines-est .lf-total .line-total { margin-left: auto; }
.pb-lines-est .lf-total .lf-v, .pb-lines-est .lf-total .line-total { font-weight: 600; color: var(--ink); }
.pb-lines-est .line-total { padding: 0; }
.pb-lines-est .line-note { margin-top: 0; }
.pb-lines-est .lc-del { display: flex; flex-flow: row wrap; gap: 6px; margin-top: .25rem; }
/* Subject (project) / product-name (prodservhrs) short title — bold, above the description, read + edit. */
.pb-lines-est .line-subject { font-family: var(--font-display); font-weight: 600; }
.pb-lines-est .lv-subject { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
/* Spinner arrows removed on est number fields (Unit & Cost hold large numbers). */
.pb-lines-est input[type=number] { -moz-appearance: textfield; }
.pb-lines-est input[type=number]::-webkit-outer-spin-button,
.pb-lines-est input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* est-prodservhrs = a more COMPACT version of the shared look (catalog + plain single-line desc). */
.pb-lines.est-prodservhrs .lc-desc { gap: .3rem; }
.pb-lines.est-prodservhrs .lc-side, .pb-lines.est-prodservhrs .lv-side { gap: .25rem; }
.pb-lines.est-prodservhrs .line-row textarea.line-desc { min-height: 2em; }

/* ── Line heights, per-line scroll & edit-field fill (2026-07-03), est variants only. ── */
/* READ cards shrink to content: the global `.lv-desc{white-space:pre-wrap}` was preserving the TEMPLATE's
   indentation newlines, so a 1-line description ballooned to ~250px. Normalise whitespace here (rich HTML
   still breaks via its own <p>/<li>); a genuinely long description caps at ~the edit-box height and gets
   its OWN scrollbar instead of ballooning the card. */
.pb-lines-est .lv-desc { white-space: normal; }
.pb-lines-est .inv-view-lines .inv-row .lv-desc { max-height: 220px; overflow-y: auto; }
/* EDIT: the description fills DOWN to the bottom of the line box (level with Duplicate/Delete). The row
   stretches (below, in the grid @media), so lc-desc matches the right stack's height; the rich/plain
   description then flexes to fill it, scrolling inside the field when the text overflows. */
.pb-lines-est .lc-desc .rte-line { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 2.4em; }
.pb-lines-est .lc-desc .rte-line .rte-surface { flex: 1 1 auto; max-height: none; min-height: 0; }
.pb-lines-est .lc-desc textarea.line-desc { flex: 1 1 auto; resize: none; overflow-y: auto; }
/* est-prodservhrs: centre the Duplicate/Delete buttons within their column. */
.pb-lines.est-prodservhrs .lc-del { justify-content: center; }

@media (min-width: 860px) {
  /* Description/Item takes all the room (1fr); the stacked fields sit in a fixed narrow right column.
     READ (.inv-row) and EDIT (.line-row) share the grid → the two columns line up between modes. */
  .pb-lines-est .inv-view-lines .inv-row,
  .pb-lines-est .line-row { grid-template-columns: minmax(160px,1fr) 216px; gap: 16px; align-items: start; }
  /* EDIT rows stretch both columns to the row height so the left description fills to the bottom (level
     with Duplicate/Delete). READ rows keep align-items:start so short cards stay compact. */
  .pb-lines-est .line-row { align-items: stretch; }
  /* Each line is a visible CARD in read + edit + new, on BOTH estimate variants. The card was previously
     bordered with var(--line) = rgba(0,0,0,.08) — a white card on the ~#f2f3ef page = ~3% contrast, so it
     read as "no card" (worst on est-prodservhrs, whose shorter content gave the eye no other frame cue).
     A firmer border + a subtle lift makes the card unmistakable and identical across variants/modes. */
  .pb-lines-est .inv-view-lines .inv-row,
  .pb-lines-est .line-row { background: var(--surface); border: 1px solid var(--neutral-200);
    border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .pb-lines-est .line-row { padding: .7rem .9rem; }
  .pb-lines.est-prodservhrs .line-row { padding: .5rem .7rem; }
}

/* 4a-2: Estimate Type radio group — top-right in the document header (pushed right in the flex .rt-head),
   compact pill options; the checked one is accented. Editable in edit/new, disabled (but readable) in read. */

/* Delta 2 — Scope: fixed ~4-5 line height, own internal scrollbar, does not grow with content
   (mirrors the existing .proddetail.pt-project .pb-desc fixed-height precedent above). */
/* photo gallery strip + thumbnails (the Images sidebar block) */
.rava-img { padding: 0; overflow: hidden; }
.rava-img img { width: 100%; height: 100%; object-fit: cover; }
.proddetail .photo-strip { display: flex; flex-wrap: wrap; gap: 7px; align-items: flex-start; margin-bottom: 4px; }
.photo-thumb { position: relative; width: 60px; height: 60px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-field); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-thumb.is-primary { border-color: var(--accent); box-shadow: 0 0 0 2px var(--shadow-thumb); }
/* always-visible bar: ★ set-primary (left) · Delete (right) — no hover reveal, no reorder */
.photo-thumb .pt-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; align-items: center;
  background: rgba(20,30,26,.62); padding: 2px 4px; }
.photo-thumb .pt-actions form { display: inline; margin: 0; }
.pt-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 12px; line-height: 1; padding: 1px 2px; }
.pt-btn.pt-star:hover { color: #ffd24a; }
.pt-btn.pt-star.is-on { color: #ffd24a; cursor: default; }
.pt-btn.pt-del:hover { color: #ff8c7a; }
/* simple centred modal (Images → Add file-picker; reusable via data-modal-open/data-modal-close) */
.pmodal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) 24px calc(24px + var(--safe-left)); }
.pmodal[hidden] { display: none; }
.pmodal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  min-width: 300px; max-width: 92vw; max-height: calc(100vh - 48px - var(--safe-top)); overflow-y: auto; box-shadow: 0 12px 48px rgba(0,0,0,.3); }
.pmodal-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px;
  font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.pmodal-x { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted); line-height: 1; }
.pmodal-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
/* tab_add (_components.html) — the tab-bar "+"-popup body: fields stacked vertically, each an
   already-shared .gen-field/.gen-lbl pair (Generate-Invoice popover); the relpick search widget
   needs an explicit full-width override since `.relpick` is inline-flex and otherwise shrinks to
   its input's content width. */
.tab-add-form { display: flex; flex-direction: column; gap: 10px; }
.gen-field .relpick { width: 100%; }

/* ── Slice 2: Generate-Invoice popover / Review dialog (reuses .pmodal; token-driven, no literals) ── */
.gen-card { width: 460px; min-width: 340px; }
.gen-card-wide { width: 560px; }
/* Doc-preview popup (Est/Ord/Inv on project_detail, Dick 2026-08-18) — wide enough that the reused
   .inv-view-lines line-table grid (≥860px viewport) reads comfortably instead of cramming into the
   narrower Generate-Invoice popover widths above. */
.gen-card-xl { width: 760px; }
/* Doc-preview header id: the number at the label's 12px, so "Estimate #…" never reads run-together (Dick
   2026-08-18) — scoped to #docPreviewBody, the shared .hb-id-n untouched. */
#docPreviewBody .hb-id-n { font-size: 12px; }
/* Doc-preview body: bound content height so a many-line Est/Ord/Inv scrolls INSIDE the popup instead
   of growing it past the viewport (Dick 2026-08-18). `.pmodal-card` already caps the whole card at
   calc(100vh - 48px) with its own overflow-y:auto (shared with every other .pmodal — untouched here);
   this ADDITIONAL, tighter bound on #docPreviewBody (unique to this popup) keeps the "Preview" title
   + close button fixed and scrolls only the doc content, comfortably inside the card's own budget so
   only one scrollbar ever shows. */
#docPreviewBody { max-height: calc(100vh - 160px - var(--safe-top)); overflow-y: auto; }
.gen-intro { margin: 0 0 10px; font-size: 13px; }
/* border/radius/bg from the base field box (audit row 10); only sizing here. */
.gen-card .ctl { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; height: 34px; padding: .4rem .55rem; }
.gen-search { margin-bottom: 10px; }
.gen-list { display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden; max-height: 46vh; overflow-y: auto; }
.gen-radio-row, .gen-check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  cursor: pointer; border-bottom: 1px solid var(--line2); }
.gen-radio-row:last-child, .gen-check-row:last-child { border-bottom: none; }
.gen-radio-row:hover, .gen-check-row:hover { background: var(--surface-sunk); }
.gen-rr-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.gen-rr-name, .gen-cr-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.gen-cr-name { flex: 1; min-width: 0; }
.gen-rr-sub { font-size: 12px; color: var(--muted); }
.gen-rr-time, .gen-cr-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.gen-empty { padding: 18px 6px; text-align: center; }
.gen-review-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.gen-field { display: flex; flex-direction: column; gap: 5px; }
.gen-lbl { font-family: var(--font-display); font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); }
.gen-disabled { padding: .4rem .55rem; border: 1px dashed var(--line); border-radius: var(--radius-input);
  color: var(--faint); font-size: 12.5px; background: var(--surface-sunk); }
.gen-section { margin-bottom: 14px; }
.gen-section-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.gen-selectall { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.gen-fmt { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gen-fmt-opt { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.gen-preview-box { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.gen-preview-h { padding: 7px 12px; background: var(--surface-sunk); font-size: 12px; font-weight: 600;
  color: var(--muted); border-bottom: 1px solid var(--line); }
.gen-preview-tbl { font-size: 12px; }
.proddetail .photo-upload { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; flex-wrap: wrap; }
.proddetail .pb-images .photo-upload input[type=file] { max-width: 100%; font-size: 11px; }
/* image lightbox (click a thumbnail → full-size overlay) */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.82); padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) 24px calc(24px + var(--safe-left)); cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5); }
/* Suppliers tab — table + add/edit forms */
.sup-table td, .sup-table th { vertical-align: middle; }
.sup-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.sup-table .sup-n { flex-wrap: wrap; } .sup-table .tag { white-space: nowrap; }
.sup-edit { display: inline-block; }
.sup-edit > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.sup-edit > summary::-webkit-details-marker { display: none; }
/* Add-supplier panel — trigger lives in the tab header (#sup-add-btn); this just toggles hidden. */
.sup-add-panel { margin-top: 12px; }
.sup-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 14px; margin-top: 10px;
  padding: 12px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 10px; }
.sup-form .sf { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-family: var(--font-display); }
.sup-form .sf .ctl { font-size: 13.5px; padding: .35rem .5rem; }
.sup-form .sf-wide { grid-column: 1 / 3; }
.sup-form .sf-pref { flex-direction: row; align-items: center; gap: 6px; }
.sup-form .sf-actions { grid-column: 1 / 3; }
@media (min-width: 860px) { .sup-form { grid-template-columns: repeat(3, minmax(0,1fr)); } .sup-form .sf-wide { grid-column: 1 / 4; } .sup-form .sf-actions { grid-column: 1 / 4; } }
/* info-block editable controls: read shows <b>, edit shows the sized control on the row's right */
.proddetail .info-block .hb-row .ib-ctl { display: inline-flex; flex: 1; min-width: 0; justify-content: flex-end; }
.proddetail .info-block .hb-row .ib-ctl .ctl { width: 64%; min-width: 120px; height: 30px; padding: .25rem .45rem; font-size: 13px; margin: 0; }
/* large description textarea — auto height (the base .fblock .ctl pins 35px for inputs) */
.proddetail .ctl-area { height: auto; min-height: 92px; resize: vertical; line-height: 1.4; }

/* ── Rich-text Full description (Stage 1, 2026-06-30) ──────────────────────────────
   Read mode renders the sanitised HTML formatted; edit mode shows a contenteditable
   surface + an absolutely-positioned toolbar. The toolbar is absolute (NO flow height),
   and BOTH faces reserve the same top strip + share the .ctl-area sizing, so toggling
   read↔edit changes nothing in flow → zero shift (incl. the project 300px scroll box). */
.proddetail .rte { position: relative; }
.proddetail .rte-read, .proddetail .rte-surface {
  width: 100%; box-sizing: border-box; font-family: var(--font-body); font-size: 14px;
  color: var(--ink); background: var(--field-bg); border: 1px solid transparent;
  border-radius: var(--radius-input); padding: 32px .5rem .45rem; margin-bottom: 8px;
  box-shadow: var(--shadow-field); resize: none; overflow-y: auto; line-height: 1.4; }
.proddetail.mode-edit .rte-surface { border-color: var(--neutral-300); }
.proddetail .rte-surface:focus { outline: none; border-color: var(--accent);
  box-shadow: var(--focus-ring); }
.proddetail .rte-read:empty::before { content: "Full description"; color: var(--ink-faint); }
/* formatted content — same look in read render and edit surface */
.proddetail .rte-read p, .proddetail .rte-surface p { margin: 0 0 .4em; }
.proddetail .rte-read p:last-child, .proddetail .rte-surface p:last-child { margin-bottom: 0; }
.proddetail .rte-read ul, .proddetail .rte-read ol,
.proddetail .rte-surface ul, .proddetail .rte-surface ol { margin: .2em 0 .4em; padding-left: 1.5em; }
.proddetail .rte-read a, .proddetail .rte-surface a { color: var(--accent); text-decoration: underline; }
/* toolbar (det-edit: edit only) — 11s / FT: in the flow, wrapping (field-height buttons overflowed a 390 phone) */
.proddetail .rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-bottom: 4px; }
.proddetail .rte-bar ~ .rte-surface { padding-top: .45rem; }
.proddetail .rte-b { padding: 0 6px; border: 1px solid var(--neutral-300); border-radius: 5px;
  background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }   /* Group B skin */
/* AI placeholder pane */
.ai-placeholder { text-align: center; padding: 2.4rem 1rem; color: var(--muted); }
.ai-placeholder .ic { color: var(--accent); opacity: .8; }
.ai-placeholder h3 { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); margin: .5rem 0 .25rem; }
/* AI Search tab-header action (screen-review 2026-08-09 item 6) — placement only, no engine yet. */
.ai-search-act { display: flex; align-items: center; gap: 6px; }
.ai-search-act .ai-search-input { width: 180px; height: 28px; font-size: 12.5px; margin: 0; }
.fblock { display: flex; flex-direction: column; min-width: 0; }      /* vertical stack, no frame */
.fblock-h { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--ink-muted);
  margin-bottom: var(--gap-field); display: flex; align-items: center; justify-content: space-between; gap: var(--gap-field); }
/* address headers: keep the Default radio DIRECTLY AFTER the title, not pushed to the far edge */
.fblock-h.h-inline { justify-content: flex-start; }
/* canonical Settings block header (2026-07-13, Dick): the FULL .md-editor-head module treatment —
   `.fblock-h.has-ic` REUSES the .md-editor-head + .lic rules above (30px accent-soft icon chip,
   18px bold display name, same gap/padding/underline) so a Settings block header is byte-identical
   in size to the /templates/ editor header. Opt-in via `icon=` on field_block/config_table; the
   `.fblock` base justify-content:space-between keeps the add/primary action right-aligned. */
.fbh-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fblock-h.has-ic .fbh-t { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); }

/* ── Block-header TOOLTIP (Settings cleanup 2026-08-16) — the block description moved OFF a below-block
   `<p class="fb-hint">` INTO a hover/focus bubble on the header (icon+title), for a cleaner, consistent
   interface app-wide. Pure CSS: `.fbh-tip` is a real hidden-until-hover child (so any markup passed in
   `desc=` renders), revealed on hover of the `.has-tip` cluster or when it takes keyboard focus. The
   `?` affordance cursor tells the user the header carries help. */
.fbh-l.has-tip { position: relative; cursor: help; }
.fbh-tip {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: max-content; max-width: 320px; padding: 8px 11px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  font-family: var(--font-body); font-weight: 400; font-size: 12px; line-height: 1.4;
  white-space: normal; text-transform: none; letter-spacing: 0;
  visibility: hidden; opacity: 0; transform: translateY(-3px);
  transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
  pointer-events: none;
}
.fbh-tip code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-sunk); padding: 0 3px; border-radius: 4px; }
.fbh-l.has-tip:hover .fbh-tip, .fbh-l.has-tip:focus .fbh-tip, .fbh-l.has-tip:focus-within .fbh-tip {
  visibility: visible; opacity: 1; transform: translateY(0);
  transition: opacity .12s ease, transform .12s ease;
}

/* BASE FIELD BOX (Phase 2 Step 1, audit §2) — the ONE field-box default; .fblock .ctl/.title-input.ctl override the border. */
input.ctl, select.ctl, textarea.ctl { width: 100%; box-sizing: border-box; font-family: var(--font-body);
  font-size: 14px; color: var(--ink); background: var(--field-bg); border: 1px solid var(--neutral-300);
  border-radius: var(--radius-input); padding: .4rem .5rem; height: 35px; }
textarea.ctl { height: auto; min-height: 62px; line-height: 1.4; resize: vertical; }
.ctl::placeholder { color: var(--ink-faint); }
input.ctl:focus, select.ctl:focus, textarea.ctl:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

/* Relations/Settings control — FULL box (base can't serve read-face `span.ctl`); border:transparent = read↔edit zero-shift. */
.fblock .ctl { width: 100%; box-sizing: border-box; font-family: var(--font-body); font-size: 14px;
  color: var(--ink); background: var(--field-bg); border: 1px solid transparent; border-radius: var(--radius-input);
  padding: .4rem .5rem; height: 35px; margin-bottom: var(--gap-field); }
/* money / percent fields (product detail): READ mode shows the TIGHT unit (€150.00 / 18%), right-aligned
   & mono like the KPIs; EDIT mode swaps to the raw editable number. The .num-read span and .num-edit
   input share the same .ctl box (det-read/det-edit toggle one at a time) → read↔edit is 0px shift; the
   symbol/percent is never inside the input value. */
.module-products .num-in { display: block; }   /* wraps the read/edit money-field swap (num-read ↔ num-edit) */
.num-read { display: flex; align-items: center; justify-content: flex-end;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num-edit { text-align: right; }
/* fblock selects flat; base does NOT force appearance app-wide (other selects keep the native arrow). */
.fblock select.ctl { appearance: none; -webkit-appearance: none; }
.reldetail.mode-edit .fblock input.ctl, .reldetail.mode-edit .fblock select.ctl { border-color: var(--neutral-300); background: var(--field-bg); }
.reldetail.mode-edit .fblock select.ctl { appearance: auto; -webkit-appearance: auto; }
/* Field "lift" (Dick): a SOFT drop-shadow on the detail-card fields in BOTH read (browse) AND edit mode, so
   the fields read as gently lifted tinted boxes when just viewing too (they carry --field-tint in both
   modes). Softer than the old edit-only value. box-shadow is outside the box model → ZERO layout shift. The
   big name title gets it in EDIT only (read = a transparent heading → no stray shadow under plain text); the
   ckdrop pickers are edit-only-visible anyway. The :focus ring (below) replaces it while focused. */
.reldetail .fblock input.ctl,
.reldetail .fblock select.ctl,
.reldetail .fblock textarea.ctl,
.reldetail .ckdrop > summary,
.reldetail.mode-edit .title-input { box-shadow: var(--shadow-field); }
.reldetail .fblock .ctl:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

/* Referred by pinned to the Name block bottom → its top lands on line 4, baseline with Contact's Web. */

/* two-field line side-by-side within a block (Phone|Mobile · Postcode|Town · Region|Country · vat+VIES) */
.fblock .pair { display: flex; gap: var(--gap-inline); align-items: center; margin-bottom: var(--gap-field); }
.fblock .pair > .ctl { flex: 1; min-width: 0; margin-bottom: 0; }
.fblock .pair > span { display: flex; min-width: 0; }
.fblock .pair > span.narrow { flex: .7; } .fblock .pair > span.wide { flex: 1.3; }
.fblock .pair > span > .ctl { width: 100%; margin-bottom: 0; }

/* ── field_block LABELED fields (Settings rebuild 2026-07-12) — consumes the Relations field_block
   density for always-editable config screens. A `.fb-f` stacks one small label + its compact `.ctl`
   control (+ optional terse `.fb-hint`); the shared `.fblock .ctl` box (35px, tinted) styles the
   control, so Settings fields match Relations exactly. Token-based; no Settings-only life. ── */
.fblock .fb-f { display: flex; flex-direction: column; margin-bottom: var(--gap-field); }
.fblock .fb-f > label { font-family: var(--font-display); font-weight: 600; font-size: 11px;
  color: var(--ink-faint); margin: 0 0 2px; letter-spacing: .01em; }
.fblock .fb-f > .ctl { margin-bottom: 0; }
/* size/colour come from the canonical .fb-hint rule above; only spacing is scoped here */
.fblock .fb-f > .fb-hint { margin: 3px 0 0; }
.fblock p.fb-hint { margin: 0 0 6px; }
/* a field_block spanning the whole field grid (wide textarea / matrix groups) */
.rel-left .fblock.fb-wide { grid-column: 1 / -1; }
/* a compact inline config-CRUD row (salutations · social · roles-add): label-over-control cells that
   flow with inline action buttons. (Never write an asterisk + slash inside a comment: it ends it, and the
   rule below was once silently dropped that way — B2b, 2026-08-02.) */
.cfg-line { display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.cfg-line > .fb-f { flex: 1; min-width: 96px; margin-bottom: 0; }
.cfg-line > .fb-f.narrow { flex: .5; } .cfg-line > .fb-f.wide { flex: 1.7; }
.cfg-line > .btn { flex: none; }
/* a field_block header's inline hint (the "standings — …" / "send — legacy" note after the title) */
.fblock-h .fb-hint { font-weight: 400; margin-left: 8px; }
/* a master-detail LIST empty state (small, padded — not the centred detail md-empty) */
.md-list-scroll .md-empty { padding: 1rem; font-size: 12.5px; }
/* small avatar in a master-detail editor header (Users detail) */
.md-editor-head .mini { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
/* inner margin so a Settings pane's fields are never edge-to-edge inside the reltabs card */
.settings-scroll .reltabs > .pane { padding: 13px 16px 16px; }

.ctl-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 400 !important; font-family: var(--font-body); white-space: nowrap; margin-bottom: 8px; }
.def-radio { font-size: 11.5px; font-weight: 400; color: var(--muted); font-family: var(--font-display); display: inline-flex; align-items: center; gap: 4px; }
.def-radio input { width: auto; }
.url-open { flex: none; padding: .2rem .5rem; }
.vr-default-btn { flex: none; color: var(--muted); }
.vr-default-btn.on { color: var(--accent); }
/* ── Settings v2 config-table pattern (2026-07-12, Dick's review) — the ONE compact table view for
   per-company config lists (Salutations · Social channels · VAT rates · Custom Fields · Table Fields).
   Header row = the .fblock-h title (left) + a `+` icon (right, via base space-between); data rows =
   compact .ctl inputs + a right-aligned Delete icon. Dynamic widths + a .table-scroll fit the viewport.
   Reuses the frameless .fblock + the tokenised .ctl field box, so it matches Relations Detail exactly. */
.cfg-tbl { width: 100%; border-collapse: collapse; }
/* Editable-list row rhythm — SYMMETRIC vertical padding so every config row (Salutations · Social ·
   VAT rates · Roles) is evenly spaced and equal-height, and NO row border/zebra (the `.tbl`
   data-table skin used to bleed those in — this list is deliberately frameless). Same metrics for
   all four lists = "one style everywhere". */
.cfg-tbl > tbody > tr > td { padding: 3px 6px 3px 0; vertical-align: middle; border: none; }
.cfg-tbl > tbody > tr > td:last-child { padding-right: 0; }
.cfg-tbl .ctl { margin-bottom: 0; }
.cfg-tbl td.cfg-del { width: 1%; white-space: nowrap; text-align: right; }
.cfg-tbl .cfg-row-del { flex: none; color: var(--muted); }
.cfg-tbl td.cfg-star { width: 1%; white-space: nowrap; padding-right: 4px; }
.cfg-tbl td.cfg-rate { width: 6.5rem; }
/* the frameless config block owns the `+` header; keep the header row tight above the table */
.cfg-block .fblock-h { margin-bottom: var(--gap-head-body); }
.cfg-block .cfg-add { flex: none; }

/* Settings v2 Templates editor header (Dick's review 2026-07-12) — the md-editor-head becomes the
   editor's action bar: an inline-editable name title (like the Relations company-name), the accent
   swatch + type pill, and the Save · Duplicate · Remove buttons top-right (off the form body). */
.md-editor-head .title-input { font-size: 18px; height: auto; padding: .25rem .45rem; flex: 0 1 auto;
  min-width: 180px; max-width: 340px; }
.tmpl-accent { display: inline-flex; align-items: center; flex: none; }
.tmpl-accent input[type=color] { width: 2rem; height: 2rem; padding: 2px; border: 1px solid var(--line);
  border-radius: var(--radius-input); background: var(--field-bg); cursor: pointer; }
.md-head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.md-head-actions form { margin: 0; }
.tmpl-form { display: contents; }            /* hidden carrier (template_id/doc_type) — no layout box */

/* Templates editor SHELL (UI Slice A, 2026-08-09) — control rail LEFT, live preview (the paper)
   RIGHT. The reusable editor archetype UI Slice B extends with per-zone composers, so this is built
   as a clean shell, not a one-off (design-system-before-code). Mirrors the mail-template editor's
   fill pattern directly below: the enclosing panel (.md-detail in the master-detail hub,
   .settings-scroll on the standalone page) flexes `.tmpl-editor` to fill whatever height remains
   after the tab-bar/topbar above it, so only the rail + the preview iframe scroll internally — the
   page itself never does (Viewport Rule: no vertical scroll on the 1470×956 floor). */
.tmpl-editor { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.tmpl-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tmpl-section { display: flex; flex-direction: column; gap: 6px; }
.tmpl-preset-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.tmpl-preview { flex: 1; min-width: 0; min-height: 360px; display: flex; flex-direction: column;
  background: var(--surface-sunk); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 10px; }
.tmpl-preview-head { flex: none; margin-bottom: 8px; }
.tmpl-preview-frame { flex: 1; min-height: 320px; width: 100%; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); }
@media (min-width: 861px) {
  .tmpl-editor { flex-direction: row; }
  .tmpl-rail { flex: 0 0 380px; }
}
/* Defect B (round 3): the rail header must never clip the type-pill. The wider rail above gives it
   room; here the NAME input shrinks (min-width:0) instead of the pill, and the pill is pinned
   (flex-shrink:0, and it already carries white-space:nowrap) so it can never be cut. */
.tmpl-rail .md-editor-head .title-input { min-width: 0; }
.tmpl-rail .md-editor-head .type-pill { flex-shrink: 0; }
@media (min-width: 861px) and (min-height: 620px) {
  /* Doc-template editor ONLY (scoped via :has() on its distinctive .tmpl-editor child) — same fill
     contract as the mail-template editor above: the shell flexes to fill the panel, the rail scrolls
     on its own, the preview iframe fills the rest. */
  .md-detail:has(> .tmpl-editor), .settings-scroll:has(> .tmpl-editor) {
    display: flex; flex-direction: column; min-height: 0; overflow-y: hidden; }
  .md-detail:has(> .tmpl-editor) > .tmpl-editor,
  .settings-scroll:has(> .tmpl-editor) > .tmpl-editor { flex: 1; min-height: 0; }
  .tmpl-rail { min-height: 0; overflow-y: auto; }
  .tmpl-preview, .tmpl-preview-frame { min-height: 0; }
}

/* Templates editor ZONE ACCORDION (UI Slice B, 2026-08-09) — Logo · Company details · Client block ·
   Line columns · Document defaults, ONE `.tmpl-zone` open at a time (mcTemplateEditorInit, app.js) so
   the rail never grows past the 1470×956 no-scroll floor even with five sections. Collapsed rows are
   compact (a single header line); only the open one spends height. */
.tmpl-zones { display: flex; flex-direction: column; gap: 6px; }
.tmpl-zone { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tmpl-zone-h { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 7px 10px; background: var(--surface); border: none; cursor: pointer;
  font: inherit; text-align: left; color: var(--ink); }
.tmpl-zone-t { font-weight: 600; font-size: 12.5px; }
.tmpl-zone-caret { flex: none; color: var(--muted); transition: transform .15s ease; }
.tmpl-zone-h[aria-expanded="true"] .tmpl-zone-caret { transform: rotate(180deg); }
.tmpl-zone-body { display: none; padding: 10px; border-top: 1px solid var(--line); }
.tmpl-zone.zone-open .tmpl-zone-body { display: block; }
.tmpl-zone-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tmpl-zone-lbl { font-size: 12px; color: var(--muted); }
.tmpl-zone-hint { margin: 2px 0 6px; font-size: 11.5px; }
.tmpl-zone-rte .rte-surface { min-height: 110px; max-height: 220px; }
.tmpl-col-list { display: flex; flex-direction: column; gap: 3px; }
.tmpl-col-row { display: flex; align-items: center; gap: 6px; }
.tmpl-col-row .checkbox-label { width: auto; }
.tmpl-col-row [data-tmpl-col-label] { flex: 1; min-width: 0; }
.tmpl-col-updown { display: flex; flex-direction: column; gap: 0; flex: none; }
.tmpl-col-arrow { font-size: 9px; line-height: 1; padding: 1px 4px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); cursor: pointer; border-radius: 3px; }
.tmpl-col-arrow:hover { background: var(--surface-sunk); color: var(--ink); }
/* Terms & footer section — the three RTE fields (Terms/Footer/Scope) stacked, each a labelled block.
   Reuses the mail-body-rte/tmpl-zone-rte surface skin; only the per-field spacing + label live here. */
.tmpl-def-fld { margin-top: 12px; }
.tmpl-def-fld > label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; }
.tmpl-def-rte .rte-surface { min-height: 80px; max-height: 170px; }

/* Mail-template editor Body (Dick's spec, 2026-07-13) — the app rich editor with an ALWAYS-visible
   toolbar (static, not the hover-only `.rte-line` table-row treatment) + an Insert-field pull-down
   on the title. Base rules are a sane mobile/narrow fallback (fixed max-height, panel scrolls
   normally); the desktop settings-fit viewport (same gate as the master-detail fill, line ~990)
   makes the Body flex to fill the REST of the panel so it is the ONLY thing that scrolls. */
.mail-tmpl-carrier { display: contents; }     /* hidden carrier (template_id) — no layout box */
.mail-tmpl-fields { margin-top: 12px; }
.form-grid.mail-tmpl-top { grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.mail-body-fld { margin-top: 10px; }
.mail-body-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.token-pick { display: inline-flex; align-items: center; font-weight: 400; }
.token-select { width: auto; max-width: 220px; font-size: 12px; padding: .3rem .4rem; }
.mail-body-rte { position: relative; }
.mail-body-rte .rte-bar { position: static; display: flex; gap: 2px; padding: 4px 5px;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius-input) var(--radius-input) 0 0; }
.mail-body-rte .rte-surface { width: 100%; box-sizing: border-box; min-height: 220px; max-height: 46vh;
  overflow-y: auto; padding: .55rem .65rem; border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-input) var(--radius-input); background: var(--field-bg);
  font: inherit; line-height: 1.4; }
.mail-body-rte .rte-surface:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.mail-body-rte .rte-surface p { margin: 0 0 .4em; }
.mail-body-rte .rte-surface p:last-child { margin-bottom: 0; }
.mail-body-rte .rte-surface ul, .mail-body-rte .rte-surface ol { margin: .2em 0 .4em; padding-left: 1.5em; }
.mail-body-rte .rte-surface a { color: var(--accent); text-decoration: underline; }
.mail-body-rte .rte-b { padding: 0 6px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--ink); }   /* Group B skin */
/* Shared RTE font-size + colour controls (Part B2) — context-independent so they match the toolbar
   in every rte_field consumer (signature, Products description, template zones, mail). */
.rte-size { font-family: var(--font-body); font-size: 12px; height: 22px; padding: 0 4px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink);
  cursor: pointer; }
.rte-color { display: inline-flex; align-items: center; justify-content: center; position: relative;
  min-width: 26px; height: 22px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); cursor: pointer; overflow: hidden; }
.rte-color:hover { border-color: var(--accent); }
.rte-color .rte-color-a { font-weight: 700; font-size: 12.5px; line-height: 1; color: var(--ink);
  border-bottom: 2px solid currentColor; }
.rte-color input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
  border: 0; opacity: 0; cursor: pointer; }
/* BASE RTE TOOLBAR (Phase 2 Step 2, audit §1B) — the ONE toolbar-button + separator default, shared by
   every RTE context (.rte-line/.rte-boxed/.proddetail/.mail-body-rte). Each context keeps ONLY its
   genuine skin delta (border token / radius / bg / padding). Placed AFTER .rte-size/.rte-color so the
   0-1-0 tie on the Size <select>'s font-size resolves to 12.5px exactly as the old scoped .rte-b did.
   .rte-sep carries align-self:center (needed by the flex bars whose bar has no align-items; a no-op on
   .proddetail whose .rte-bar already sets align-items:center) → zero visual change everywhere. */
.rte-b { font-family: var(--font-body); font-size: 12.5px; line-height: 1; min-width: 26px; height: 22px; cursor: pointer; }
.rte-b:hover { background: var(--surface-sunk); border-color: var(--accent); }
.rte-sep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; align-self: center; }
/* Mail-template editor TWO-PANE shell (logo-in-signature slice, 2026-08-09) — composer LEFT, the
   server-rendered live preview RIGHT (reusing the doc editor's .tmpl-preview* classes, no new preview
   CSS). Stacks on narrow, side-by-side from 861px. */
.mail-editor { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.mail-editor-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.mail-editor-main .mail-tmpl-fields { margin-top: 0; }
.mail-logo-row { margin-top: 6px; }
.mail-logo-row input[type="range"] { flex: 1; min-width: 0; }
@media (min-width: 861px) {
  .mail-editor { flex-direction: row; }
  /* Match the doc-template editor: fixed-width composer column + flexible preview (Dick 2026-08-14 —
     the mail editor's composer was flex:1 1 0 so its 2nd column didn't stay fixed like Est/Ord/Inv/
     Reminder). Same 380px as .tmpl-rail. */
  .mail-editor-main { flex: 0 0 380px; }
}
@media (min-width: 861px) and (min-height: 620px) {
  /* Fill contract (same as the doc editor's, scoped via :has() on .mail-editor): the shell fills the
     panel, the Body surface is the only thing that scrolls — no page scrollbar on the 1470×956 floor. */
  .md-detail:has(> .mail-editor), .settings-scroll:has(> .mail-editor) {
    display: flex; flex-direction: column; min-height: 0; overflow-y: hidden; }
  .md-detail:has(> .mail-editor) > .mail-editor,
  .settings-scroll:has(> .mail-editor) > .mail-editor { flex: 1; min-height: 0; }
  .mail-editor-main { min-height: 0; }
  .mail-editor-main .mail-tmpl-fields { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .mail-editor-main .mail-body-fld { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 6px; }
  .mail-editor-main .mail-body-rte { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .mail-editor-main .mail-body-rte .rte-surface { flex: 1; min-height: 0; max-height: none; }
}

/* Settings v2 two-column board (Relations · Products screens) — a left + right independent column
   stack that reduces scrolling. Mirrors .rel-left's frameless field-block density at 2 columns. */
.cfg-2col { display: grid; grid-template-columns: 1fr; gap: var(--gap-block) var(--gutter-col); align-content: start; min-width: 0; }
.cfg-2col > .cfg-col { display: flex; flex-direction: column; gap: var(--gap-block); min-width: 0; }
@media (min-width: 1024px) { .cfg-2col { grid-template-columns: repeat(2, minmax(0,1fr)); } }
/* A field_block that is a DIRECT .cfg-2col child (not nested inside a .cfg-col) spans both columns —
   used by Settings ▸ Mail's Mailboxes list (2026-08-16 fix) so its 6-column table + row-action icons
   fit without horizontal scroll. Scoped to the direct child only: fb-wide blocks that stay INSIDE a
   .cfg-col (Edit-mailbox form, Legacy SMTP) keep the narrow-column behaviour untouched. */
.cfg-2col > .fblock.fb-wide { grid-column: 1 / -1; }

/* ── Settings cleanup (2026-08-16) ─────────────────────────────────────────────────────────
   Social ▸ Active cell — compact checkbox in the config table row. */
.cfg-tbl td.cfg-active { width: 1%; white-space: nowrap; }
.cfg-tbl td.cfg-active .checkbox-label { font-size: 11.5px; gap: 4px; }

/* ── THE STACKED-SIBLING GAP (pass 1 gave it an owner; pass 2a set the value, 2026-08-03) ──
   A block that FOLLOWS another block in a `display:block` parent owned no spacing (Backups ▸ Run
   history sat flush under the grid above it). One token, `--gap-stack` (16px), owns it — no screen one-off. ─── */
.fblock + .fblock,
.fblock + .tablecard,
.tablecard + .fblock,
.tablecard + .tablecard,
.cfg-2col + .fblock,
.cfg-2col + .tablecard,
.cfg-2col + .cfg-2col { margin-top: var(--gap-stack); }

/* mode-driven element visibility (topbar buttons toggled by JS; in-card ones by class) */
.reldetail.mode-edit .det-read { display: none !important; }
.reldetail.mode-read .det-edit { display: none !important; }

/* Find mode (data-nav-bar slice 2 → v2): the relations card flipped into a criteria form. Find is its OWN
   mode — it does NOT touch read↔edit zero-shift. v2: render the FULL browse layout (FileMaker look) —
   searchable fields LIT (accent tint), non-searchable fields GREYED + disabled (shown, not removed), the
   tab block visible with related-table criteria. Mode reps swap via det-read/det-edit/det-find. */
.reldetail.mode-find .det-read { display: none !important; }
.reldetail.mode-find .det-edit { display: none !important; }
.reldetail:not(.mode-find) .det-find { display: none !important; }
/* …and EXPLICITLY reveal the info-block criteria in mode-find (number/status/date/valid/amount/customer)
   rather than relying on the implicit "not hidden → natural display" fallback. Number & Amount rows have
   no read/edit value, so the whole row is find-only (det-find on the .hb-row); the others carry det-find
   on the value span beside their read/edit reps — both are force-shown here. (part-f reveal, 2026-07-04) */
/* pure record-metadata — not fields you'd search → hidden in Find (id stays as a greyed "—") */
.reldetail.mode-find .nf-hide-find,
.reldetail.mode-find .audit-box,
.reldetail.mode-find .kpi-block { display: none !important; }
.reldetail.mode-find .rava,
.reldetail.mode-find .hb-id-n { opacity: .4; }
/* LIT searchable inputs (own fields carry data-find; .find-meta = the standing/type/kind/related selects) */
.reldetail.mode-find .fblock input.ctl[data-find],
.reldetail.mode-find .fblock textarea.ctl[data-find],
.reldetail.mode-find .find-meta,
.reldetail.mode-find .title-input { border-color: var(--accent); background: var(--field-tint);
  opacity: 1; color: var(--ink); }
/* item B (2026-07-04): the in-place Scope textarea + the Lines find input are editable find criteria in
   find mode (they carry data-find) — keep them fully interactive (the greying rule below excludes
   [data-find], but be explicit for the textarea/find-rep). */
.reldetail.mode-find .fblock textarea.ctl[data-find],
.reldetail.mode-find .lines-find-rep .ctl { opacity: 1; pointer-events: auto; }
.lines-find-rep { padding: 4px 0 2px; }
.reldetail.mode-find .find-meta { appearance: auto; -webkit-appearance: auto; }
/* range criteria (date from/to, amount min/max) — stacked in the narrow info-block cell so both
   inputs fit the value column (side-by-side would overrun the row label). Scoped to beat the
   .ib-ctl .ctl { min-width:120px } rule. */
/* GREYED non-searchable controls — shown but visibly inert (muscle-memory layout, no false affordance) */
.reldetail.mode-find .fblock .ctl:not([data-find]),
.reldetail.mode-find .def-radio,
.reldetail.mode-find .ctl-check,
.reldetail.mode-find .url-open { opacity: .42; pointer-events: none; }
.find-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 9px 14px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-body); font-size: 13px; }
.find-banner b { font-family: var(--font-display); }
.find-banner span { color: var(--muted); }
.find-banner em { font-style: italic; color: var(--accent); }
/* Tab block in Find: panes show ONLY their criterion (.find-tabcrit); the data tables are hidden.
   Non-searchable tabs (Logbook/Financial/Map) greyed in the strip. */
.reldetail.mode-find .reltabs .tab-panel > *:not(.find-tabcrit) { display: none !important; }
.reldetail.mode-find .tabstrip .tab-link[data-tab="log"],
.reldetail.mode-find .tabstrip .tab-link[data-tab="fin"],
.reldetail.mode-find .tabstrip .tab-link[data-tab="map"] { opacity: .4; }
.find-tabcrit { padding: 4px 2px 2px; }
.find-tabcrit .find-meta { max-width: 460px; }
/* mode-aware Notes/Log tab search (shared _tab_search.html): browse-filter input (icon-toggled) +
   the find criterion share one wrapper; exactly one shows per mode (browse input = nf-hide-find,
   criterion span = det-find). The header icon pushes to the right, just before "+ New". */
.tabsearch-input { width: 100%; max-width: 460px; height: 30px; font-size: 13px; margin: 0; }
/* Compact in-tab search icon (Dick 2026-07-04), the same height as the tab's "+ New". */
.tabsearch-btn.icon-btn { min-height: 0; padding: 5px 6px; align-self: center; }
.tabsearch-btn .ic { width: 13px; height: 13px; }
/* found-set active: the tab's browse filter is applied (input committed via Enter, rows stay filtered).
   Green fill (mirrors the nav-bar .mode-btn.on active look); click it again to reset → all rows back. */
.tabsearch-btn.fs-on, .tabsearch-btn.fs-on:hover { background: var(--accent); color: var(--on-accent); box-shadow: none; }
/* PART 3 — the matched child row, highlighted when you open a related-criteria find hit */
.find-hit { background: var(--accent-soft) !important; box-shadow: inset 3px 0 0 var(--accent); }

/* Record-audit box (reusable component) */
.audit-box { font-size: 11.5px; color: var(--muted); background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; min-width: 200px; }
.audit-row { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.audit-row + .audit-row { margin-top: 3px; }
.audit-k { color: var(--faint); font-size: 11px; font-family: var(--font-display); }
.audit-v { font-family: var(--font-mono); font-size: 11px; text-align: right; }
.audit-who { color: var(--muted); }

.note-add-form { padding: 10px 14px; }
.note-add-form textarea, .note-edit-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; border: 1px solid var(--neutral-300); border-radius: var(--radius-input); padding: .5rem .6rem; resize: vertical; }
.notes-table { width: 100%; }
.notes-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.notes-table th.sortable:hover { color: var(--accent); }
.notes-table th.sortable::after { content: " ⇅"; color: var(--faint); font-size: 10px; }

/* generic sortable list-tab tables (estimates/orders/invoices/mail/logbook/financial): clickable
   column headers with an asc/desc arrow that toggles on click. */
.sortable-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-table th.sortable:hover { color: var(--accent); }
.sortable-table th.sortable::after { content: " ↕"; color: var(--faint); font-size: 10px; }
.sortable-table th.sortable[data-dir="asc"]::after { content: " ↑"; color: var(--accent); }
.sortable-table th.sortable[data-dir="desc"]::after { content: " ↓"; color: var(--accent); }
.notes-table tr.note-row { cursor: pointer; }
.notes-table tr.note-row:hover { background: var(--surface-sunk); }
.notes-table .note-cell { color: var(--ink); max-width: 0; width: 99%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-table .nowrap { white-space: nowrap; }
.notes-table .note-user { white-space: nowrap; min-width: 130px; }   /* Username on ONE line (note-cell's 99% was squeezing it to 2 rows) */
.notes-table .note-actions { text-align: right; white-space: nowrap; }
.notes-table .icon-btn { padding: .25rem .45rem; }
.notes-table tr.note-edit > td { background: var(--surface-sunk); padding: 12px 14px; }
.note-edit-form .na-actions { margin-top: 8px; }

.logbook-table th:nth-child(1), .logbook-table td:nth-child(1),  /* Date / Time */
.logbook-table th:nth-child(2), .logbook-table td:nth-child(2) { /* User */
    white-space: nowrap; width: 1%;
}
.logbook-table th:nth-child(3), .logbook-table td:nth-child(3) { /* Entry */
    width: 99%; white-space: normal;
}
.logbook-table td { vertical-align: top; }

@media (max-width: 860px) {
  .m-filterbar { flex-wrap: nowrap; overflow-x: auto; }
  .m-listscroll { display: block; }
  #contact-view .m-listscroll { display: none; }   /* Relations: table down to 700 px, phone rows below (step 1) */
}

/* ── Financial charts (inline SVG; additive, scoped to the /financial screen) ────────── */
.chart-pad { padding: 16px 16px 12px; }
.svgbars { display: block; width: 100%; height: auto; }
.svgbars text { font-family: var(--font-num); }
.svgbars .svg-mlbl { font-size: 11px; fill: var(--faint); font-family: var(--font-display); }
.svgbars .svg-val { font-size: 10px; fill: var(--muted); font-weight: 600; }
.svgbars .svg-axis { stroke: var(--line); stroke-width: 1; }

.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px; }
.donut-wrap { flex: none; width: 150px; }
/* .cash-donut (round 7, "This can be bigger" — Cash split only; additive, the shared .donut-wrap stays 150px). */
.cash-donut { width: 200px; }
.donut { display: block; width: 100%; height: auto; }
.donut .donut-c { font-family: var(--font-num); font-weight: 600; font-size: 15px; fill: var(--ink); }
.donut .donut-cs { font-family: var(--font-display); font-size: 8px; fill: var(--faint); text-transform: uppercase; letter-spacing: .5px; }
.donut-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 9px; margin: 0; }
.donut-legend .dl { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.donut-legend .dl-sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.donut-legend .dl-lbl { color: var(--muted); flex: 1; white-space: nowrap; }
.donut-legend .dl-val { font-family: var(--font-num); font-weight: 600; text-align: right; }
.donut-table { flex: 1; min-width: 220px; border: none; border-radius: 0; }   /* frameless: it sits inside a .panel already (was an inline override) */

@media (max-width: 860px) {
  .donut-wrap { width: 130px; margin: 0 auto; }
}

/* ════════════════════════════════════════════════════════════════════════
   Theming Phase 1 — DARK-mode structural rules (wallpaper ground + glass).
   Keyed on [data-theme-mode="dark"] (stamped on <html>). The injected
   active-theme <style> supplies the dark ROLE colours; these supply the
   STRUCTURE — SAME markup both themes. Lifted from the approved mockup
   (.screen block). --wall is the dark theme's wallpaper url() role.
   ════════════════════════════════════════════════════════════════════════ */
/* STYLE RULES A2 + A5 (staging-tuning 2026-07) — dark-mode token values. NEW tokens the injected
   active-theme <style> never sets, so this override wins in any dark theme (built-in OR user). A2:
   fields a touch lighter than the page (fill-in affordance); A5: zebra tint flips to a light overlay. */
[data-theme-mode="dark"] { --field-bg: rgba(255,255,255,.075); --row-alt: rgba(255,255,255,.04); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }

[data-theme-mode="dark"] .main {
  background-image: linear-gradient(rgba(10,15,13,.58), rgba(10,15,13,.80)), var(--wall);
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
[data-theme-mode="dark"] .apphead > .topbar,
[data-theme-mode="dark"] .apphead > .headersearch {
  background: rgba(20,28,25,.68);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  border-bottom-color: rgba(255,255,255,.09);
}
[data-theme-mode="dark"] .panel,

/* Dark scrollbars — generalised to ANY dark-mode scroll area (the homepage Tasks/Activity
   internal-scroll panels + the page itself), so the default light chrome scrollbar never
   shows through on dark. Thumb = a lightened --line, track transparent. Light mode UNCHANGED
   (these rules only match under [data-theme-mode="dark"]). Firefox via scrollbar-color, set on
   the dark root so it inherits into every internal-scroll descendant. The scrollbar-width/color pair
   is merged into the dark-root token block above (§3.8 dedup — one [data-theme-mode="dark"] block). */
[data-theme-mode="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme-mode="dark"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme-mode="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18); border-radius: 6px;
  border: 2px solid transparent; background-clip: padding-box;
}
[data-theme-mode="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.30); background-clip: padding-box; }
[data-theme-mode="dark"] ::-webkit-scrollbar-corner { background: transparent; }

/* ══ MAIL — the one Mail place (redesign step 7 / L1; boards Mail-Desktop-Inbox, Mail-Tablet, Mail-Phone-Inbox).
   List card left, the open mail right; each scrolls inside the frame (Viewport Rule). ⋯ › Folders and accounts
   adds the folder rail on the left; ⋯ › Select several shows the tick boxes + bulk bar. Phone: one column, a
   mail opens full screen (.mailbox[data-reading]). ══ */
.mailbox { display: grid; grid-template-columns: minmax(300px, 430px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: var(--gap-card); min-height: 0; min-width: 0; }
.mailbox:has(> .mbx-rail:not([hidden])) { grid-template-columns: 210px minmax(280px, 380px) minmax(0, 1fr); }
.mbx-rail, .mbx-list, .mbx-card, .mbx-compose { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.mbx-rail { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); min-height: 0; overflow-y: auto; align-self: start; max-height: 100%; }
.mbx-rail[hidden], .mbx-fold[hidden], .mbx-selbar[hidden], .mailbox:not(.selecting) .mbx-selcell, .mailbox:not(.selecting) .mbx-list-h { display: none; }
.mbx-acct, .mbx-fold { display: flex; flex-direction: column; gap: 2px; }
.mbx-acct { padding-bottom: var(--space-2); border-bottom: 1px solid var(--line-soft); }
.mbx-acct-h { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-1); width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; min-width: 0; }
.mbx-acct-h .nav-caret { color: var(--ink-faint); }
.mbx-acct-em { font-size: 12px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbx-acct-tag { margin-left: auto; font-size: 10px; text-transform: uppercase; color: var(--ink-faint); }
.mbx-unified .mbx-folder-nm { font-weight: 600; }
.mbx-folder { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 13.5px; }
.mbx-folder .ic { flex: none; color: var(--ink-faint); }
.mbx-folder:hover { background: var(--field-tint); color: var(--ink); }
.mbx-folder.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.mbx-folder-nm { flex: 1; min-width: 0; }
.mbx-folder.custom .mbx-folder-nm { font-style: italic; }
.mbx-folder .badge.mbx-count { flex: none; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; }
.mbx-folder .badge.mbx-count.zero { background: var(--field-tint); color: var(--ink-faint); font-weight: 400; }
.mbx-folder.drop-hover { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 2px var(--on-accent); }
.mbx-newfolder { justify-content: flex-start; color: var(--ink-muted); margin-top: var(--space-2); }
.mbx-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; align-self: start; max-height: 100%; }
.mbx-list-h, .mbx-selbar, .mbx-filterbar { flex: none; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-5); border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-muted); }
.mbx-selbar, .mbx-filterbar { background: var(--accent-soft); justify-content: space-between; }
.mbx-list-t { font-weight: 600; color: var(--ink); flex: 1; }
.mbx-filter-clear { margin-left: auto; }
.mbx-sel-actions, .mbx-selall { display: flex; gap: var(--space-2); }
.mbx-check { flex: none; width: 15px; height: 15px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.mbx-spin { display: none; width: 13px; height: 13px; margin-left: var(--space-2); border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: mbx-spin .6s linear infinite; }
.mbx-spin.htmx-request { display: inline-block; }
.mbx-busy { opacity: .55; pointer-events: none; }
@keyframes mbx-spin { to { transform: rotate(360deg); } }
.mbx-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.mbx-msg { display: flex; gap: var(--space-3); padding: var(--pad-row) var(--space-5); border-bottom: 1px solid var(--line-soft); color: var(--ink-muted); cursor: pointer; }
.mbx-msg:last-child { border-bottom: 0; }
.mbx-msg:hover, .mbx-msg.sel { background: var(--surface-sunk); }
.mbx-msg.on { background: var(--accent-soft); }
.mbx-msg.dragging { opacity: .15; }
.mbx-msg-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; }
.mbx-msg.unread .mbx-msg-dot { background: var(--accent); }
.mbx-msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mbx-msg-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.mbx-msg-from, .mbx-msg-subj, .mbx-msg-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbx-msg-from { font-size: 15px; color: var(--ink); }
.mbx-msg-subj { font-size: 14px; color: var(--ink); }
.mbx-msg.unread .mbx-msg-from, .mbx-msg.unread .mbx-msg-subj { font-weight: 700; }
.mbx-msg-date { flex: none; font-size: 12px; color: var(--ink-faint); }
.mbx-msg-snip { font-size: 13px; color: var(--ink-muted); }
.mbx-lbl { margin-top: 3px; padding: 1px 9px; border-radius: 100px; background: var(--line-soft); color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbx-lbl.new { background: var(--amber-soft); color: var(--amber); }
.mbx-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-field); background: var(--amber-soft); font-size: 14px; }
.mbx-ask span { flex: 1 1 100%; font-weight: 600; }
.mbx-list-empty, .mbx-rail-empty, .mbx-read-empty { padding: var(--space-5); font-size: 13px; color: var(--ink-faint); }
.mbx-fold-err { padding: var(--space-2) var(--space-3); font-size: 12px; color: var(--red); }
.mbx-read { display: flex; flex-direction: column; gap: var(--gap-card); min-height: 0; min-width: 0; overflow-y: auto; }
.mbx-card { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
.mbx-read-top { display: flex; align-items: center; gap: var(--space-4); }
.mbx-read-subj { flex: 1; min-width: 0; margin: 0; font-size: 19px; font-weight: 700; }
.mbx-back { display: none; border: 0; background: none; padding: 0; font: 600 16px var(--font-body); color: var(--accent); cursor: pointer; }
.mbx-reply-actions { flex: none; display: flex; align-items: center; gap: var(--space-2); }
.mbx-read-meta { font-size: 14px; color: var(--ink-muted); }
.mbx-read-errd { font-size: 12px; color: var(--ink-faint); }
.mbx-atts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mbx-att { display: inline-flex; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--field-tint); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; color: var(--ink); }
.mbx-att:hover { border-color: var(--accent); }
.mbx-att-sz { color: var(--ink-faint); }
.mbx-imgbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-2) var(--space-4); border: 1px dashed var(--line); border-radius: var(--radius-sm); font-size: 12px; color: var(--ink-muted); }
.mbx-read-body { min-width: 0; }
.mbx-html { max-width: 100%; overflow-x: auto; font-size: 15px; line-height: 1.6; color: var(--ink); }
.mbx-html img, .mbx-html table { max-width: 100%; height: auto; }
.mbx-html ul, .mbx-html ol { margin: .4em 0; padding-left: 1.6em; }
.mbx-html blockquote { margin: .5em 0; padding-left: .9em; border-left: 2px solid var(--line); color: var(--ink-muted); }
.mbx-text { margin: 0; max-width: 78ch; white-space: pre-wrap; word-break: break-word; font: 15px/1.6 var(--font-body); color: var(--ink); }
/* step 7 / L3: the next step under a received mail (Make a quote · Open the document); Reply joins it on the phone */
.mbx-next { display: flex; gap: 12px; }
.mbx-next:not(:has(.nx-go)), .nx-r { display: none; }
.mbx-relcard { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6); background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); color: var(--ink); }
.mbx-relcard .av { width: 44px; height: 44px; border-radius: 12px; }
.mbx-rc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mbx-rc-n { font-weight: 700; }
.mbx-rc-s { font-size: 13px; color: var(--ink-muted); }
.mbx-rc-owes { flex: none; font-weight: 700; }
.mbx-rc-owes.late { color: var(--red); }
.mbx-compose { min-height: 0; }
.mbx-compose-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mbx-compose-h { flex: none; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6) var(--space-4); border-bottom: 1px solid var(--line); }
.mbx-compose-t { display: flex; align-items: center; gap: var(--space-3); font-weight: 600; font-size: 15px; }
.mbx-compose-t .ic { color: var(--accent); }
.mbx-compose-fields { flex: none; padding: var(--space-4) var(--space-6) 0; display: flex; flex-direction: column; gap: var(--space-3); }
.mbx-compose-fields .fld { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: var(--space-4); }
.mbx-compose-fields .fld label { font-size: 12px; color: var(--ink-faint); text-align: right; }
.mbx-compose-fields .fld input, .mbx-compose-fields .fld select { width: 100%; }
.mbx-compose-body { flex: 1; min-height: 0; display: flex; padding: var(--space-4) var(--space-6) var(--space-6); }
.mbx-compose-body .rte { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.mbx-compose-body .rte-surface { flex: 1; min-height: 110px; max-height: none; overflow-y: auto; }
.mbx-attach, .mbx-fwd-atts { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.mbx-attach-list { font-size: 12px; color: var(--ink-muted); }
.mbx-fwd-att { font-size: 11.5px; color: var(--ink-muted); background: var(--field-tint); border-radius: 100px; padding: 1px var(--space-3); }
.mbx-hint { position: fixed; z-index: 60; padding: var(--space-2) var(--space-3); background: var(--ink); color: var(--surface); border-radius: var(--radius-sm); font-size: 11.5px; pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.mbx-hint.on { opacity: .95; }
.mbx-folderpick { position: fixed; z-index: 70; min-width: 160px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: var(--space-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-input); box-shadow: var(--shadow-lift); opacity: 0; }
.mbx-folderpick.on { opacity: 1; }
.mbx-pick-opt { text-align: left; padding: var(--space-2) var(--space-3); border: 0; background: none; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink); cursor: pointer; }
.mbx-pick-opt:hover { background: var(--accent-soft); }
.tpl-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.tpl-docs > .empty { grid-column: 1 / -1; }
.tpl-c { padding: 12px; }
.tpl-pv { position: relative; display: block; height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tpl-pv iframe { position: absolute; width: 794px; height: 1160px; border: 0; transform: scale(.155); transform-origin: 0 0; pointer-events: none; }
.tpl-n { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-weight: 600; }
.tpl-n > :first-child { flex: 1 1 100%; }
.tpl-n .menu { margin-left: auto; }
.tpl-c a, .tpl-texts a { color: var(--ink); }
.tpl-texts h2 { flex: none; }
.tpl-texts .kv + .kv { border-top: 1px solid var(--line-soft); padding: 12px 0; }
@media (min-width: 861px) and (min-height: 560px) {
  body:has(.mailbox) .main { height: 100vh; overflow: hidden; }
  body:has(.mailbox) .content { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .mailbox { flex: 1; }
}
@media (max-width: 1100px) {
  .mailbox { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
  /* a narrow reading pane: the buttons on top, the subject full width under them (step 7 / L3: + Add as lead) */
  .mbx-read-top { flex-wrap: wrap; }
  .mbx-read-subj { order: 3; flex-basis: 100%; }
  .mbx-reply-actions { margin-left: auto; }
}
@media (max-width: 699px) {
  .ml-head .ml-new, body:has(.mailbox[data-reading]) :is(.ml-tabs, .ml-head) { display: none; }
  .mailbox:not([data-reading]) .mbx-msg.on { background: none; }
  .mailbox, .mailbox:has(> .mbx-rail:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .mailbox:not([data-reading]) > .mbx-read, .mailbox[data-reading] > .mbx-list, .mailbox[data-reading] > .mbx-rail { display: none; }
  .mbx-list { max-height: none; }
  .mbx-back { display: inline; }
  /* GAP-129: the card's top row IS the head ("‹ Mail" · ⋯), the mail's text the card (Mail-Phone-Message) */
  .mbx-card { padding: 0; background: none; box-shadow: none; }
  .mbx-read-body { padding: var(--space-5); background: var(--surface); border-radius: var(--radius-card); }
  /* Mail-Phone-Message: Reply · Make a quote (primary) docked at the bottom; the head keeps Add as lead + ⋯ */
  .mbx-next { position: fixed; left: 16px; right: 16px; z-index: 68; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  body.has-timer .mbx-next { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 44px); }
  .mbx-next .btn { display: flex; width: 100%; min-height: 52px; }
  .nx-go .btn { background: var(--accent); color: var(--on-accent); box-shadow: none; }
  .mbx-card:has(.nx-go) .mbx-reply-actions > .pri { display: none; }
  .mbx-read:has(.nx-go) { padding-bottom: 72px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN BUILDING BLOCKS (step 0 / F2 — DSN-04/05/07/09/11). Markup lives ONLY in the ui_* macros
   in _components.html; the living style page /settings/style/ renders every one of them.
   ════════════════════════════════════════════════════════════════════════════ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.icon-btn { padding: 0 10px; }

/* Field: label above, 48px box. .is-smart = filled in for you (green tint + accent border);
   .is-error = red border + one sentence under the field. Date stays the native picker. */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: var(--text-label); color: var(--label-ink); }
.field-in { height: var(--h-field); padding: 0 14px; border: 1.5px solid var(--line-field); border-radius: var(--radius-field);
  background: var(--surface); font: 500 var(--text-body) var(--font-body); color: var(--ink); width: 100%; }
textarea.field-in { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.field-in:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field.is-smart .field-in { background: var(--smart-bg); border-color: var(--accent); }
.field.is-error .field-in { border-color: var(--red); }
.field-err { font-size: var(--text-label); color: var(--red); }
.fields-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* Toggle (a real checkbox with role=switch) + count badge */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .tr { width: 52px; height: 30px; border-radius: var(--radius-btn); background: var(--line-btn); position: relative; flex: none; transition: background var(--dur-fast); }
.toggle .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); transition: transform var(--dur-fast); }
.toggle input:checked + .tr { background: var(--accent); }
.toggle input:checked + .tr::after { transform: translateX(22px); }
.toggle input:focus-visible + .tr { outline: 2px solid var(--accent); outline-offset: 2px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-btn); background: var(--attn); color: var(--surface); font-size: 12px; font-weight: 800; }

/* Search or ask + FileMaker find chips (SHL-07; Find logic is F5) */
.ask { display: flex; align-items: center; gap: 10px; height: var(--h-field); padding: 0 16px; border-radius: var(--radius-btn); background: var(--surface); border: 1.5px solid var(--line-field); color: var(--ink-faint); }
.ask input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); height: 100%; }
.ask input:focus { outline: none; }
.ask:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.findchips { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.findchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 34px; border-radius: var(--radius-chip); font-weight: 600; background: var(--smart-bg); color: var(--ink); border: 1.5px solid transparent; }
.findchip.omit { background: var(--st-overdue-bg); }
.findchip.act { background: var(--surface); border-color: var(--line-field); cursor: pointer; }

/* List row (phone/tablet + desktop cards): initials · title + sub · amount right · pill */
.lrows { display: flex; flex-direction: column; }
.lrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: var(--pad-row) 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.lrow:last-child { border-bottom: 0; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--st-draft-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.lrow .av { width: 40px; height: 40px; font-size: 14px; }
.av-lg { width: 60px; height: 60px; border-radius: 16px; font: 700 20px var(--font-display); }
.lrow .tx { display: flex; flex-direction: column; min-width: 0; }
.lrow .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s { font-size: var(--text-label); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .amt { font-weight: 700; text-align: right; }
a.lrow:hover .t { color: var(--accent); }

/* Smart note (DSN-07): tinted, sparkle, one plain sentence, Undo. Next step: one button + Not now. */
.smart-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-field); background: var(--smart-bg); color: var(--ink); font-size: 14px; }
.smart-note .ic { color: var(--accent); }
.mbx-card .smart-note { background: var(--st-paid-bg); color: var(--st-paid-ink); }   /* GAP-128: Linked to … */
.smart-note .sn-t { flex: 1; min-width: 0; }
.smart-note .sn-undo { margin-left: auto; font-weight: 600; color: var(--accent); background: none; border: 0; font: inherit; cursor: pointer; min-height: 32px; }
.sn-offer, .sn-picks { flex-wrap: wrap; }
.sn-offer .sn-t { flex-basis: 240px; }
.sn-picks { display: flex; align-items: center; gap: 8px; }
.sn-picks .field-in { width: 84px; }
.snd-warn { padding: 6px 10px; border-radius: var(--radius-field); background: var(--st-part-bg); color: var(--st-part-ink); }
.next-step { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: var(--pad-card); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.next-step .ns-t { flex: 1 1 220px; }

/* Empty state (DSN-09): icon tile, title, what to do first, one primary + one alternative */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 20px; }
.empty .em-ic { width: 60px; height: 60px; border-radius: 14px; background: var(--st-draft-bg); color: var(--accent); display: grid; place-items: center; }
.empty .em-t { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.empty .em-p { color: var(--ink-muted); max-width: 300px; }
.empty .em-a { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ⋯ menu: a popover on desktop/tablet, a bottom sheet on the phone (thumb reach). Destructive items
   last, red, after a divider. Built on <details> — no JS needed to open; app.js closes it on Esc /
   outside click. */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
/* step 11r-b / R3: wide enough that no item wraps (min 300 px, the label never breaks), an icon before every item */
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 300px; max-width: calc(100vw - 24px); padding: 6px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.menu-pop .mi { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.menu-pop .mi-l { white-space: nowrap; }
.menu-pop .mi-ic { flex: none; color: var(--ink-muted); }
.menu-pop .mi.danger .mi-ic { color: currentColor; }
.menu-pop .mi:hover { background: var(--smart-bg); }
.menu-pop .mi.danger { color: var(--red); }
.menu-pop .mdiv { height: 1px; background: var(--line); margin: 4px 6px; }
.menu-pop .grab { display: none; }
@media (max-width: 699px) {
  .menu[open]::before { content: ""; position: fixed; inset: 0; background: var(--scrim); z-index: 79; }
  .menu-pop { position: fixed; left: 0; right: 0; top: auto; bottom: 0; min-width: 0; max-width: none; border-radius: 20px 20px 0 0;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
  .menu-pop .grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-btn); margin: 4px auto 8px; }
  .menu-pop .mi { min-height: 48px; font-size: 16px; }
}

/* Style page (/settings/style/) — sections mirror board Dsn-Overview */
.sg { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; }
.sg h2 { font-size: 28px; margin-top: 18px; }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
/* the six screen types as small drawings (GAP-06, board Dsn-Overview §2): each <i> is one block */
.sg-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sg-type h3 { margin: 0; font: 700 18px var(--font-display); }
.sg-wire { display: grid; gap: 6px; height: 120px; padding: 10px; border-radius: 12px; background: var(--paper); }
.sg-wire i { border-radius: 5px; background: var(--line); }
.sg-wire i:first-child { background: var(--accent-soft); }
.sg-wire-list { grid-template-rows: 14px repeat(5, 1fr); }
.sg-wire-list i:first-child { width: 45%; }
.sg-wire-record { grid-template-columns: 2fr 1fr; grid-template-rows: 14px 1fr 1fr 1fr 1fr; }
.sg-wire-record i:first-child { grid-column: 1 / -1; width: 55%; }
.sg-wire-record i:nth-child(2) { grid-row: 2 / 4; }
.sg-wire-doc { grid-template-columns: 1fr 1fr; grid-template-rows: 14px 1fr 1fr 1fr 1fr; }
.sg-wire-doc i:first-child, .sg-wire-doc i:nth-child(3), .sg-wire-doc i:nth-child(4) { grid-column: 1 / -1; }
.sg-wire-doc i:nth-child(6) { grid-column: 2; }
.sg-wire-edit { grid-template-columns: 1fr 1fr; grid-template-rows: 14px repeat(3, 1fr); }
.sg-wire-edit i:first-child { grid-column: 1 / -1; width: 40%; }
.sg-wire-settings { grid-template-columns: 1fr 2.4fr; grid-template-rows: repeat(5, 1fr); }
.sg-wire-settings i:nth-child(2) { grid-row: 1 / -1; grid-column: 2; }
.sg-wire-wizard { grid-template-columns: repeat(4, 1fr); grid-template-rows: 10px 1fr 1fr 24px; }
.sg-wire-wizard i:nth-child(5) { grid-column: 1 / -1; grid-row: 2 / 4; }
.sg-wire-wizard i:nth-child(6) { grid-column: 3 / -1; grid-row: 4; background: var(--accent); }
.sg-card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sg-h { font-size: 13px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.sg-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sg-note { font-size: 14px; color: var(--ink-muted); }

/* ════════════════════════════════════════════════════════════════════════════
   SHELL — docked primary + page head pieces (redesign F3, DSN-14 #2/#3, SHL-12)
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .ph-dock { position: fixed; left: 16px; right: 16px; z-index: 68; min-height: 52px; font-size: 16px;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); box-shadow: var(--shadow-pop); }
  body.has-timer .ph-dock { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 44px); }
  body.kb-open .ph-dock { bottom: calc(8px + var(--kb-offset, 0px)); }
  /* 11r-e / 0b: the page's own ground behind the docked Save, from the keyboard up to 8 px above Save — the content
     scrolling under it (a chip row showed as grey pill fragments in the 8 px gap) never peeks out */
  body.kb-open:has(.ph-dock)::after { content: ""; position: fixed; left: 0; right: 0; z-index: 67;
    bottom: var(--kb-offset, 0px); height: 68px; background: var(--bg); }   /* takes the taps too: nothing under it */
  /* the page head never makes the page wider than the phone: title on its own line, the tool row
     below it scrolls sideways (module steps replace these tool rows with the F5 list tools). */
  .apphead { flex-wrap: wrap; }
  .topbar-bar { flex-wrap: wrap; }
  .topbar-bar .loc { flex: 1 1 100%; }
  .topbar-actions { margin-left: 0; max-width: 100%; min-width: 0; }
  .apphead > .topbar, .topbar-bar .navbar { min-width: 0; max-width: 100%; }
  .apphead > .topbar, .apphead > .headersearch { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .apphead > .headersearch { justify-content: flex-end; }
  .navbar { flex: 1 1 100%; max-width: 100%; justify-content: flex-start; }
}
/* step 11r-b / R4 + A5 — the row ABOVE a record's title (page_head .rec-bar): the way back left, THE pager right, so
   the pager never moves with the name ("Pager on its own line above the name, top right", Dick 2026-11-23). The
   head is a grid: "bar bar" over "title actions" — on every size (the phone shows only the ‹ of the way back). */
.topbar.has-rb { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "bar bar" "loc acts"; align-items: center; column-gap: 12px; row-gap: 4px; }
.has-rb > .rec-bar { grid-area: bar; display: flex; align-items: center; gap: 12px; min-height: 36px; min-width: 0; }
.has-rb > .loc { grid-area: loc; }
.has-rb > .topbar-actions { grid-area: acts; }
.rb-back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; min-width: 0; color: var(--accent); font: 600 15px var(--font-body); }
.rb-a { font-size: 22px; line-height: 1; }
.rb-w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-nav { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--radius-btn); background: var(--surface); box-shadow: var(--shadow-soft); font: 600 14px var(--font-body); color: var(--ink); white-space: nowrap; flex: none; }
.ph-nav .btn { min-height: 36px; padding: 0 8px; box-shadow: none; background: none; }   /* Money › VAT's quarter stepper */
.pager { margin-left: auto; }
.pg-b { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); }
.pg-b:hover { background: var(--smart-bg); }
.pg-b.is-off { color: var(--ink-faint); opacity: .45; }
.pg-n { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .pg-b, .rb-back { min-height: 44px; } .pg-b { width: 44px; height: 44px; } .has-rb > .rec-bar { min-height: 44px; } }
@media (max-width: 699px) { .rec-bar:has(.pager) .rb-w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .rb-back { min-width: 44px; } }

/* ════════════════════════════════════════════════════════════════════════════
   FEEDBACK + POOR SIGNAL (redesign F4 — DSN-10, FND-16). Driven by shell.js gsToast/gsSaved/gsQueue.
   ════════════════════════════════════════════════════════════════════════════ */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 18px; border-radius: 14px;
  background: var(--ink); color: var(--surface); font-weight: 600; box-shadow: var(--shadow-pop); pointer-events: auto;
  opacity: 0; transform: translateY(8px); transition: opacity var(--dur-normal), transform var(--dur-normal); }
.toast.show { opacity: 1; transform: none; }
.toast > span { flex: 1; min-width: 0; }
.toast.is-error { background: var(--st-overdue-ink); }
.toast-undo { background: none; border: 0; color: var(--green-pop); font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; padding: 0 4px; }
.ph-saved { font-size: 14px; color: var(--ink-faint); opacity: 0; transition: opacity var(--dur-normal); align-self: center; }
.ph-saved.show { opacity: 1; }
.offline-line { position: sticky; top: var(--safe-top); z-index: 85; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; background: var(--st-part-bg); color: var(--st-part-ink); font-size: 14px; }
/* 11b / 2 + 3: the one read-only banner (trial ended · over the plan · a part outside it) + the plan tag */
.ro-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 16px; background: var(--st-part-bg); color: var(--st-part-ink); font-size: 14px; }
.ro-line span { flex: 1 1 220px; }
.ro-line a { font-weight: 700; color: inherit; }
.home-trial { margin: 0; }
.set-limits { margin: 0; padding: 0; list-style: none; }
.set-limits li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; }
.set-limits li span { flex: 1; }
.set-limits li.over { color: var(--st-part-ink); }
.navi .plan-tag.nl { flex: none; }
.plan-tag { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--st-part-bg); color: var(--st-part-ink); }
@media (max-width: 1023px) {
  .toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--dock-h) + 12px); }
}
/* Loading: content outlines first (ui_skeleton), a spinner only after 1 s (shell.js adds .is-slow). */
.skel { display: flex; flex-direction: column; gap: 12px; padding: var(--pad-card); }
.skel i { display: block; height: 14px; border-radius: 7px; background: var(--st-draft-bg); animation: skel 1.2s ease-in-out infinite; }
.skel i:nth-child(3n+2) { width: 72%; } .skel i:nth-child(3n) { width: 48%; }
@keyframes skel { 50% { opacity: .5; } }
[aria-busy="true"] { position: relative; }
.is-slow::after { content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; border: 3px solid var(--line-btn); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════════════
   FIND + THE LIST TOOL ROW (redesign F5 — DSN-14 #4, SHL-07). Order is fixed: search field · Find ·
   Show all · Invert · Saved · the current find as chips; the module's filter chips follow.
   ════════════════════════════════════════════════════════════════════════════ */
.apphead > .topbar.topbar-bar { flex: 1 1 100%; }   /* list + record heads own the first row; search + tools below */
.hs-list { width: 340px; max-width: 100%; height: var(--h-field); }   /* 11r-f: 36 with a mouse, 48 on touch */
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 360px; min-width: 0; }
.tools .tl { min-height: 44px; padding: 0 14px; font-size: 14px; box-shadow: var(--shadow-soft); background: var(--surface); }
.tl-div { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.findchip.add { border-style: dashed; }
.findchip.omit-add { color: var(--st-overdue-ink); }
a.findchip { color: var(--ink); }
.findbar { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 14px; }
.findany { display: flex; align-items: center; gap: 10px; max-width: 560px; }
.findany > span, .findscope > span { font-size: var(--text-label); color: var(--label-ink); white-space: nowrap; }
.findany .field-in { height: 44px; }
.findscope { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1023px) {
  .hs-list { flex: 1 1 100%; width: auto; }
  .tools .tl:not(:first-child) span { display: none; }   /* phone: Find keeps its word, the rest are icons */
}

/* ════════════════════════════════════════════════════════════════════════════
   SELECT · ACT · TAG (redesign F6 — SHL-13). gsSelect in shell.js; macros ui_select_cb / ui_selectbar /
   ui_saved / ui_tag_labels.
   ════════════════════════════════════════════════════════════════════════════ */
.sel-cb, .sel-all { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex: none; vertical-align: middle; }
[data-select-id].is-sel > td { background: var(--smart-bg); }
.m-lrow.is-sel { background: var(--smart-bg); }
.selbar { position: fixed; z-index: 75; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 18px; border-radius: 16px; background: var(--ink); color: var(--surface);
  box-shadow: var(--shadow-pop); max-width: calc(100vw - 24px); }
body.has-selbar .results-scroll { padding-bottom: 84px; }   /* the pager scrolls above the bar (A-relations-30) */
.selbar .sb-n { margin-right: 8px; white-space: nowrap; }
.selbar .sb-a, .selbar .sb-x { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px;
  background: none; border: 0; color: var(--surface); font: 600 14px var(--font-body); cursor: pointer; list-style: none; }
.selbar .sb-a:hover, .selbar .sb-x:hover { background: var(--side-on); }
.selbar .sb-a-pri { background: var(--green-pop); color: var(--ink); }
.selbar .sb-a-pri:hover { background: var(--green-pop); }
.selbar .menu-pop { bottom: calc(100% + 8px); top: auto; right: 0; color: var(--ink); min-width: 280px; }
.tagpop .tagnew, .menu-pop .tagnew { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.tagpop { min-width: 380px; }
.tp-h { font: 700 18px var(--font-display); padding: 10px 8px 2px; }
.tp-l { font-size: var(--text-label); color: var(--label-ink); }
/* 11s / G1: a tag as a row (tag_row) — the tag (tap = use it), ✎ rename in place, ⋯ colour · merge · delete */
.tp-rows { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.tgr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); }
.tgr-use { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px;
  background: none; border: 0; border-radius: 10px; color: inherit; font: inherit; text-align: left; }
button.tgr-use { cursor: pointer; } button.tgr-use:hover { background: var(--chosen-bg); }
.tgr-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--st-sent-ink); }
.tgr-dot[data-area], .tgr-sw[data-area] { background: var(--area); }
.tgr-t { display: flex; flex-direction: column; min-width: 0; }
.tgr-nm { font-weight: 600; overflow-wrap: anywhere; }
.tgr-t small, .tgr-del small { font-size: 12px; font-weight: 400; color: var(--ink-faint); }
.tgr.is-ren .tgr-use { display: none; }
.tgr-b { flex: none; }
.tgr-in { flex: 1; min-width: 0; height: var(--h-field); }
.tgr-menu { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 4px 8px 10px; }
.tgr-sws, .tgr-merge { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tgr-l { font-size: var(--text-label); color: var(--label-ink); }
.tgr-sws .tgr-l { flex-basis: 100%; }
.tgr-sw { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); background: var(--st-sent-ink);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.tgr-sw.on { box-shadow: 0 0 0 2px var(--ink); }
.tgr-merge .field-in { width: auto; min-width: 160px; }
.tp-ask { padding: 8px 10px; margin: 6px 0; border-radius: 10px; background: var(--chosen-bg); color: var(--chosen-ink); }
.tp-ask p { margin: 0 0 6px; font-weight: 600; }
.tp-ask-a { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-q { width: 100%; margin: 4px 0 6px; }
.tg-list { max-height: none; }   /* Settings: the page's own fit (gsFit, data-fit-min) — the phone scrolls the page */
@media (pointer: coarse) { .tgr-use { min-height: 44px; } .tgr-sw { width: 34px; height: 34px; } }
.tp-a { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.menu-pop .mi .mi-s { display: block; font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.menu-pop .mi .mi-t { display: flex; flex-direction: column; }
.menu-pop .mh { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px 2px; }
.menu-pop .mi-empty { color: var(--ink-faint); cursor: default; font-size: 14px; }
.taglabels { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.taglabel { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-btn); background: var(--st-sent-bg);
  color: var(--st-sent-ink); font-size: var(--text-label); font-weight: 600; }
.taglabel[data-area] { background: var(--area-soft); color: var(--area); }   /* 11s / G1: the tag's own colour */
.taglabel button { background: none; border: 0; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; min-width: 24px; min-height: 24px; }
.tag-add { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
.tag-add .field-in { height: var(--h-field); flex: 1; min-width: 0; }
.tag-add .btn { flex: none; width: auto; }
@media (max-width: 1023px) {
  .selbar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  .selbar .sb-a span { display: none; }
  body.has-selbar .ph-dock { display: none; }
}
/* the phone: use, rename, colour, merge and delete tags — creating a new one stays on desktop/tablet (SHL-13; 11s / G1:
   the tablet creates too, so this is the phone width only) */
@media (max-width: 699px) {
  .tagpop .tp-l, .tagpop #tagWord, .tagpop .tp-who, .tagpop .tp-a .btn.pri, .tag-add { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   LOGBOOK OF CHANGES (redesign F7 — SHL-14): _changes_list.html, changes.html.
   ════════════════════════════════════════════════════════════════════════════ */
.chg-list { list-style: none; display: flex; flex-direction: column; }
.chg { display: flex; align-items: center; gap: 12px; padding: var(--pad-row) 4px; border-bottom: 1px solid var(--line-soft); }
.chg:last-child { border-bottom: 0; }
.chg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chg-what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chg-mod { color: var(--ink-muted); font-size: var(--text-label); }
.chg-vals { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.chg-old { color: var(--ink-muted); text-decoration: line-through; }
.chg-new { font-weight: 600; }
.chg-meta { font-size: var(--text-label); color: var(--ink-faint); }
.chg-act { flex: none; max-width: 40%; text-align: right; }
.chg.is-undo, .chg.is-redo { background: var(--bg); }
.chg.is-auto .chg-new { font-weight: 400; color: var(--ink-muted); }
.chg-empty { padding: 14px 4px; }
.chg-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--gap-block); }
.chg-filters label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-label); color: var(--label-ink); }
.chg-filters .field-in { height: 44px; min-width: 160px; }

/* ════════════════════════════════════════════════════════════════════════════
   HOME (redesign F8 — SHL-04/05): dashboard.html. Phone = quick actions + timer + Needs you;
   desktop = Needs a decision cards + the month + recent invoices; first run = Get started + sample data.
   ════════════════════════════════════════════════════════════════════════════ */
.home { display: flex; flex-direction: column; gap: var(--gap-section); }   /* 11r-b / H1: full width, no 1180 cap */
.hcard { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: var(--pad-card);
  border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.hcard .hc-big { font: 700 var(--text-key) var(--font-display); }
.hcard .hc-t { color: var(--ink-muted); font-size: 14px; flex: 1; }
.hcard .btn { align-self: stretch; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--gap-block); align-items: start; }
.home-grid > .panel:only-child { grid-column: 1 / -1; }
.hm-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hm-h h2 { font-size: 18px; margin: 0; }
.hm-bar { height: 8px; border-radius: 8px; background: var(--st-draft-bg); overflow: hidden; margin-bottom: 6px; }
.hm-bar i { display: block; height: 100%; background: var(--green-pop); }
.hm-list { list-style: none; }
.hm-list li { display: flex; align-items: center; gap: 12px; min-height: 54px; border-top: 1px solid var(--line-soft); }
.hm-list .hm-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-btn); display: grid; place-items: center; flex: none; }
.hm-list li.done .hm-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hm-list li.done .hm-l { text-decoration: line-through; color: var(--ink-faint); }
.hm-list .hm-l { flex: 1; font-weight: 600; }
.hm-list a { font-weight: 600; }
.hm-side { display: flex; flex-direction: column; gap: 10px; }
.hm-side h2 { font-size: 18px; margin: 0; }
.home-sample { display: flex; align-items: center; gap: 10px; }
.home-calm { margin: 0; }
.home-quick { display: none; }
@media (max-width: 1023px) {
  .hm2-timer.is-on { display: none; }   /* 11s/E5 */
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .hq { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 92px; padding: 16px;
    border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); font-weight: 600; }
  .hq .ic { color: var(--ink-muted); }
  .hq.hq-pri { background: var(--accent); color: var(--on-accent); }
  .hq.hq-pri .ic { color: var(--on-accent); }
  .hq-edit { grid-column: 1 / -1; font-size: 14px; color: var(--ink-muted); }
  .hq-edit summary { cursor: pointer; list-style: none; text-align: right; }
  .hq-form { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 0; }
  .ht-clock { font: 700 26px var(--font-display); }
}

/* ── step 11r-d / H3: Home per role (.hm2) — row 1 Money in and out | Who owes you | Coming in, row 2 Needs you today
   (2 columns) | Did you know…; tablet 2 × 2; phone one column: the tip card, Who owes you (top 3, a 44 px bell), the
   chart smaller. Fits 1366 × 768 (tight spacing, never small text). ── */
.hm2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-block); grid-auto-flow: dense; align-items: start; }
.hm2 > .panel { min-width: 0; height: 100%; }
.hm2 .panel-pad, .mo2-grid .panel-pad { padding: var(--pad-row); }
.hm2 .hm-h { margin-bottom: 6px; }
.hm2-needs { grid-column: span 2; }
.hm2-sub { margin: -4px 0 6px; font-size: 12.5px; }
.hm2-tot { display: flex; gap: 18px; margin: 0 0 4px; }
.hm2-tot div { display: flex; flex-direction: column; }
.hm2-tot dt { font-size: var(--text-label); color: var(--ink-muted); }
.hm2-tot dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.hm2-list { list-style: none; display: flex; flex-direction: column; }
.hm2-list > li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--line-soft); }
.hm2-list > li:first-child { border-top: 0; }
.hm2-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.hm2-tx b, .hm2-tx a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hm2-tx .field-hint { font-size: 12.5px; }
.hm2-late { color: var(--overdue); }
.hm2-amt { font-variant-numeric: tabular-nums; text-align: right; }
.hm2-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-sunk); color: var(--ink-muted); }
.hm2-ic.tone-over { background: var(--red-soft); color: var(--red); }
.hm2-ic.tone-warn { background: var(--amber-soft); color: var(--amber); }
.hm2-rf { margin: 0; }
.hm2-held { white-space: nowrap; }
.hm2-more summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0; }
.hm2-dyk h2 { display: flex; align-items: center; gap: 6px; }
.hm2-dyk-t { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; }
.hm2-time { width: 88px; flex: none; font-variant-numeric: tabular-nums; color: var(--ink-muted); font-size: 13px; }
.hm2-clock { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; }
.hm2-clock b { font: 700 28px var(--font-display); font-variant-numeric: tabular-nums; }
.hm2-acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1199px) {
  .hm2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm2-needs { grid-column: auto; }
  .hm2-dyk { grid-column: 1 / -1; }
}
@media (max-width: 699px) {
  .hm2 { grid-template-columns: minmax(0, 1fr); }
  .hm2-dyk { order: -3; } .hm2-owes { order: -2; } .hm2-money { order: -1; }
  .hm2-coming { display: none; }
  .hm2-owes li:nth-child(n+4) { display: none; }
  .hm2-bell { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .hm2-bl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ── step 11r-d: the charts (_charts.html, app/services/charts.py) — inline SVG; colours from tokens.css --ch-*. Marks
   thin with a rounded data end, a hairline grid, labels in ink (never the data colour), tabular digits. ── */
/* 11r-e / 0c: no viewBox — px units, the plot stretches, text stays 12 px at every width (charts.py) */
.ch { display: flex; width: 100%; }
.ch-ax { flex: none; overflow: visible; }
.ch-plot { flex: 1 1 0; min-width: 0; overflow: visible; }
.ch.ch-narrow { display: none; }
@media (max-width: 1199px) { .ch.ch-wide.ch-tab { display: none; } .ch.ch-narrow.ch-tab { display: flex; } }
@media (max-width: 699px) { .ch.ch-wide { display: none; } .ch.ch-narrow { display: flex; } }
.ch text { font: 500 12px var(--font-body); fill: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ch-line, .ch-mark { vector-effect: non-scaling-stroke; }
@media (max-width: 699px) { .ch .ch-odd { display: none; } }
.ch .ch-val { fill: var(--ink); font-weight: 600; }
.ch .ch-reft { fill: var(--ink-muted); }
.ch-grid { stroke: var(--line-soft); stroke-width: 1; }
.ch-base { stroke: var(--line); stroke-width: 1; }
.ch-hit { fill: transparent; }
.ch path:hover, .ch a:focus path { opacity: .8; }
.ch-m0, .ch-pos { fill: var(--ch-in); }
.ch-m1 { fill: var(--ch-out); }
.ch-pop { fill: var(--ch-pop); }
.ch-neg { fill: var(--ch-neg); }
.ch-work { fill: var(--area-work); }
.ch-ok { fill: var(--ch-in); } .ch-warn { fill: var(--ch-warn); }
.ch-c0 { fill: var(--ch-c0); } .ch-c1 { fill: var(--ch-c1); } .ch-c2 { fill: var(--ch-c2); } .ch-c3 { fill: var(--ch-c3); }
.ch-c4 { fill: var(--ch-c4); } .ch-c5 { fill: var(--ch-c5); } .ch-c6 { fill: var(--ch-c6); }
.ch-track { fill: var(--line-soft); }
.ch-band { fill: var(--ch-in); fill-opacity: .1; }
.ch-line { fill: none; stroke: var(--ch-in); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-ref { stroke: var(--ch-neg); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ch-low { fill: var(--ch-in); stroke: var(--surface); stroke-width: 2; }
.ch .ch-x { fill: var(--ink-muted); }
.ch .ch-tick { font-size: 11px; }
.ch-mark { stroke: var(--ink); stroke-width: 2; }
.ch-hb { display: block; width: 100%; height: 14px; }
.ch-prog { height: 10px; margin: 8px 0 4px; }
.ch-rows { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ch-rows li { display: grid; grid-template-columns: minmax(80px, 36%) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.ch-v { min-width: 60px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 0; font-size: var(--text-label); color: var(--ink-muted); }
.ch-key { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.ch-key.ch-m0, .ch-key.ch-ok, .ch-linekey { background: var(--ch-in); } .ch-key.ch-m1 { background: var(--ch-out); }
.ch-key.ch-warn { background: var(--ch-warn); } .ch-linekey { height: 2px; width: 14px; border-radius: 0; }
.ch-bandkey { background: var(--ch-band); } .ch-markkey { width: 2px; height: 12px; border-radius: 0; background: var(--ink); }
.ch-refkey { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--ch-neg); }

/* ════════════════════════════════════════════════════════════════════════════
   RELATIONS — the reference module (redesign step 1). R1 the list: boards Rel-Desktop-List,
   Rel-Tablet, Rel-Phone-List. `.lt` = the redesigned list table (sentence-case head, white rows, one
   line high) — later modules put `lt` on their .tablecard to get the same.
   ════════════════════════════════════════════════════════════════════════════ */
.tl-div-f { margin: 0 2px; }
.tools > .fchips { flex-wrap: nowrap; gap: 6px; }
.tools > .fchips .fchip { padding: 0 12px; }
@media (min-width: 1200px) and (max-width: 1599px) {
  /* Dick's 1470 laptop: search · Find · Show all · Invert · Saved | five chips on ONE line (measured) */
  .apphead > .headersearch .hs-list { width: 260px; }
  .tools { gap: 6px; }
  .tools .tl { padding: 0 12px; }
}
.lt { container-type: inline-size; }
.lt table.tbl { font-size: var(--text-body); }
.lt table.tbl th { text-transform: none; letter-spacing: 0; font-size: var(--text-label); color: var(--label-ink); background: var(--surface); padding: 14px 16px 10px; }
.lt table.tbl td { padding: 12px 16px; background: var(--surface); }
.lt table.tbl tbody tr:nth-child(odd) td { background: var(--surface); }
.lt table.tbl tbody tr:hover td { background: var(--dt-hover); }
.lt table.tbl tbody tr.is-sel td { background: var(--smart-bg); }   /* a selected row stays tinted (Rel-Desktop-Select) */
@media (max-width: 1023px) {
  .topbar-actions > .ph-nodock { display: none; }
  /* a list head is ONE line under 1024 px: title · "N found" · ⋯ (GAP-04); its primary docks or is the + */
  .apphead > .topbar-list { flex-wrap: nowrap; }
  .apphead > .topbar-list .loc { flex: 1 1 auto; }
  .apphead > .topbar-list .topbar-actions { flex: none; }
}
@media (max-width: 1199px) {
  /* narrower than the desktop: search + tools on one line, the filter chips on the next, full width */
  .apphead > .tools { display: contents; }
  .tools > .tl-div-f { display: none; }
  .tools > .fchips { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
}
@media (min-width: 700px) and (max-width: 1199px) { .apphead > .headersearch .hs-list { width: 300px; } }
.lt .nm-cell { gap: 12px; font-weight: 600; }
.lt .owes { font-weight: 700; }
.owes.is-late { color: var(--st-overdue-ink); }
.owes.nil { color: var(--ink-muted); font-weight: 400; }
@container (max-width: 1060px) { .lt .col-phone { display: none; } }
@container (max-width: 900px) { .lt .col-town { display: none; } }
@container (max-width: 760px) { .lt .col-type { display: none; } }
.found-total { margin: 14px 2px 0; color: var(--ink-muted); }
.found-total b { color: var(--ink); }
.rel-mrows .m-lrow { gap: 12px; padding: 12px 14px; }
.rel-mrows .nm { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.rel-mrows .sub { font-size: var(--text-label); display: block; }
.rel-mrows .rt, .rp-rows .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
@media (max-width: 699px) {
  #contact-view .tablecard { display: none; }
  #contact-view .m-listscroll, #sales-view .m-listscroll, #product-view .m-listscroll, #purchase-view .m-listscroll { display: block; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
}

/* R2 the record page (Rel-Desktop-Record, Rel-Phone-Record, Rel-Tablet): `.rec` = card + tabs left,
   money cards right; the record archetype later modules re-use. */
.card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--pad-card); }
.ph-badge { font: 600 13px var(--font-body); padding: 3px 10px; border-radius: var(--radius-btn); background: var(--st-part-bg); color: var(--st-part-ink); vertical-align: middle; }
.menu-pop .mk { margin-left: auto; padding-left: 16px; font: 500 12px var(--font-body); color: var(--ink-faint); }
.rec-split { display: block; }
.rec-pane { display: none; }
.rec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 20px; align-items: start; }
.rec-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rpane { min-width: 0; }
.rdet { display: block; }
.rec-side { display: flex; flex-direction: column; gap: 16px; }
.rc-top { display: flex; gap: 16px; align-items: flex-start; }
.rc-id { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rc-name { display: none; font: 700 22px var(--font-display); margin: 0; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-line { margin: 0; color: var(--ink-muted); }
.rc-line b, .rc-line a { color: var(--ink); font-weight: 600; }
.cbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-btn); background: var(--paper, var(--bg)); color: var(--ink); font-weight: 600; }
.cbtn .cb-ic { display: inline-flex; color: var(--accent); }
.cbtn:hover { background: var(--accent-soft); }
.owes-band { display: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 18px; border-radius: 14px; background: var(--st-draft-bg); color: var(--ink); }
.owes-band b { font: 700 24px var(--font-display); }
.owes-band.is-late { background: var(--st-overdue-bg); color: var(--st-overdue-ink); }
.rtabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-btn); background: var(--line-soft, var(--line)); align-self: flex-start; max-width: 100%; overflow-x: auto; }
.rtab { border: 0; background: none; font: 600 15px var(--font-body); color: var(--ink-muted); padding: 0 18px; min-height: 40px; border-radius: var(--radius-btn); cursor: pointer; white-space: nowrap; }
.rtab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
a.rtab { display: inline-flex; align-items: center; text-decoration: none; }
/* step 11r-b / R5: a record's tabs with a small pin each — the open tab's pill holds its pin; the lit pin = my start tab */
.rtab-w { display: inline-flex; align-items: center; flex: none; border-radius: var(--radius-btn); }
.rtab-w.on { background: var(--surface); box-shadow: var(--shadow-soft); }
.rtabs-pin .rtab.on { background: none; box-shadow: none; }
.rtabs-pin .rtab { padding-right: 6px; }
.rtab-pin { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 6px; border: 0; border-radius: 50%; background: none; color: var(--ink-faint); opacity: .5; cursor: pointer; }
.rtab-pin:hover, .rtab-pin:focus-visible { opacity: 1; background: var(--smart-bg); }
.rtab-pin.on { color: var(--accent); opacity: 1; }
@media (pointer: coarse) { .rtab-pin { width: 44px; height: 40px; margin-right: 0; } }
.area-tabs { display: flex; width: max-content; margin: 0 0 12px; }
.owes-card { background: var(--surface); }
.owes-card.is-late { background: var(--st-overdue-bg); }
.oc-h { font-weight: 600; color: var(--ink-muted); }
.owes-card.is-late .oc-h, .owes-card.is-late .oc-n { color: var(--st-overdue-ink); }
.oc-n { font: 700 34px var(--font-display); margin: 6px 0; }
.oc-s { margin: 0; color: var(--ink-muted); }
.year-card h3 { font: 700 18px var(--font-display); margin: 0 0 8px; }
.year-card dl, .rdoc-sum { margin: 0; }
.year-card dl > div, .kv { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.year-card dt, .kv dt { color: var(--ink-muted); }
.year-card dd, .kv dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
/* the timeline (ui_timeline) */
.tl-chips { display: flex; gap: 6px; margin-bottom: 12px; padding: 2px; overflow-x: auto; scrollbar-width: none; }   /* GAP-133: one line, scrolls */
.tl-add { display: flex; gap: 8px; margin-bottom: 6px; }
.tl-add .field-in { flex: 1; min-width: 0; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-e { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft, var(--line)); }
.tl-e:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--ink-faint); }
.tl-dot.over { background: var(--st-overdue-ink); } .tl-dot.sent { background: var(--st-sent-ink); }
.tl-dot.paid { background: var(--st-paid-ink); } .tl-dot.warn { background: var(--st-part-ink); }
.tl-tx { min-width: 0; }
.tl-t { font-weight: 600; } .tl-t a { color: var(--ink); }
.tl-s { color: var(--ink-muted); font-size: var(--text-label); overflow-wrap: anywhere; }
.tl-m { color: var(--ink-faint); font-size: 12px; }
.tl-r { display: flex; align-items: flex-start; gap: 6px; }
.tl-tag, .tl-why { font-size: var(--text-label); color: var(--ink-muted); white-space: nowrap; }
.tl-why { white-space: normal; max-width: 180px; text-align: right; }
@media (max-width: 699px) { .tl-why { max-width: 120px; } }
.tl-edit summary { cursor: pointer; font-size: var(--text-label); color: var(--accent); }
.tl-edit form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tl-edit-a { display: flex; justify-content: flex-end; }
.tl-empty { color: var(--ink-muted); margin: 8px 0; }
.tl-r .log-del { margin: 0; }
/* Documents + Details tabs */
.rdoc-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rdoc-sum dt { color: var(--ink-muted); font-size: var(--text-label); }
.rdoc-sum dd { margin: 0; font: 700 18px var(--font-display); }
.rdoc-sum dd.is-late { color: var(--st-overdue-ink); }
.rdoc-new { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rdoc-tbl { box-shadow: none; }
.rdet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rdet-b h3 { font: 700 18px var(--font-display); margin: 0 0 8px; }
.rdet-b dl { margin: 0; }
.rdet-wide { grid-column: 1 / -1; }
.rdet-more .ed-mh h3 { margin: 0; }
.rdet-map { width: 100%; height: 220px; border: 0; border-radius: 14px; margin-top: 10px; }
.rdet-people { margin: 0; padding-left: 18px; }
.rdet-people li { padding: 4px 0; }
/* tablet landscape: the found set beside the record (Rel-Tablet) */
.rp-h { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 4px 12px; }
.rp-h a { font: 700 22px var(--font-display); color: var(--ink); }
.rp-rows .m-lrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; color: var(--ink); }
.rp-rows .m-lrow.is-cur { background: var(--surface); box-shadow: var(--shadow-soft); }
.rp-rows .lx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-rows .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-rows .sub { font-size: var(--text-label); color: var(--ink-muted); }
.rp-more { display: block; padding: 10px 12px; color: var(--accent); font-weight: 600; }
@media (min-width: 1024px) and (max-width: 1199px) {
  .rec-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
  .rec-split:not(:has(> .rec-pane)) { display: block; }   /* 11s / FT: a new record, no list: full width */
  .rec-pane { display: block; position: sticky; top: calc(8px + var(--safe-top)); max-height: calc(100vh - 120px - var(--safe-top)); overflow: auto; }
}
@media (max-width: 1199px) {
  .rec { grid-template-columns: minmax(0, 1fr); }
  .rec-side { display: none; }
  .owes-band { display: flex; }
  .rc-name { display: block; }
  .rec-proj .wcard > .rc-name { display: none; }
  .rec-card .av-lg { display: none; }
}
@media (max-width: 1023px) {
  /* record head under 1024 (11r-b): the .rec-bar row (‹ back · the pager) on top; under it the status + ⋯; the primary
     docks at the bottom, the second action lives in the Documents tab. Step 12 / X4: the name is the title on every
     record page — only a page whose header card always shows it (.ph-named: relation, product) leaves it there;
     the project's Overview card drops its copy (from 1199 down) */
  .ph-record.ph-named .crumb .ph-t { display: none; }
  .apphead > .ph-record .loc { flex-wrap: nowrap; }
  .ph-record .topbar-actions > .btn.ghost:not(.icon-btn) { display: none; }
  .rtab { padding: 0 14px; }
}
@media (max-width: 699px) {
  .rec-card .av-lg { display: grid; width: 52px; height: 52px; font-size: 18px; }
  .rc-name { font-size: 20px; }
  .rc-line { display: none; }
  .cbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .cbtn { flex-direction: column; gap: 6px; padding: 0; min-height: 0; background: none; font-size: 13px; font-weight: 500; }
  .cbtn .cb-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--paper, var(--bg)); align-items: center; justify-content: center; }
  .rdoc-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rdet-grid { grid-template-columns: minmax(0, 1fr); }
  .rdoc-tbl .col-town { display: none; } .rdoc-tbl table.tbl :is(td,th) { padding-inline: 8px; }
}

/* R3 new + edit (Rel-Desktop-New/Edit, Rel-Tablet-Edit, Rel-Phone-New/Edit): ui_choice chips, the start
   cards, two columns of block cards (one block at a time on the phone). */
.choice { border: 0; padding: 0; margin: 0; }
.choice legend { font-size: var(--text-label); color: var(--label-ink); padding: 0; margin-bottom: 6px; }
.choice-hint { color: var(--ink-faint); }
.choice-set { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip > span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-btn); border: 1.5px solid transparent; background: var(--paper); font-weight: 600; cursor: pointer; }
.choice-chip > span .ic { display: none; }
.choice-chip input:checked + span .ic { display: inline; width: 14px; height: 14px; }
.choice-chip input:focus-visible + span { box-shadow: var(--focus-ring); }
.rel-edit { display: flex; flex-direction: column; gap: 16px; }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ed-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ed-b { display: flex; flex-direction: column; gap: 14px; }
.ed-b h3 { font: 700 20px var(--font-display); margin: 0; }
.ed-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ed-sub { margin: 0 0 -8px; font-size: var(--text-label); color: var(--label-ink); }
.flabel { font-size: var(--text-label); color: var(--label-ink); }
.ed-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-label); color: var(--ink-muted); margin-top: 6px; }
.ed-more summary, .ed-moreb summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.ed-more { display: flex; flex-direction: column; gap: 14px; }
.ed-more[open] > summary { margin-bottom: 14px; }
.ed-moreb summary { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; color: var(--ink); }
.ed-moreb[open] > summary { margin-bottom: 14px; }
.ed-moreb > .field + .field, .ed-more > .field + .field { margin-top: 14px; }
.rel-edit[data-type="company"] .only-person, .rel-edit[data-type="person"] .only-company { display: none; }
/* Contact persons (step 11r-c, R1/R2): the record card (a grid of people) + the edit block's rows; the type badge in
   its module colour (data-area → --area / --area-soft, 11r-a) */
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cp-head h3 { font: 700 18px var(--font-display); margin: 0; }
.cp-n, .cp-c, .cp-note, .cp-none, .cp-row-t { color: var(--ink-muted); }
.cp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 20px; }
.cp-p { display: flex; gap: 10px; min-width: 0; }
.cp-b { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cp-nm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cp-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--area-soft); color: var(--area); }
.cp-c, .cp-note, .cp-route { font-size: 13px; overflow-wrap: anywhere; }
.cp-c a { color: inherit; }
.cp-c a[href^="tel"] { white-space: nowrap; }
.cp-route { font-weight: 600; color: var(--area-relations); }
.cp-none { margin: 0; }
.cp-rows { display: flex; flex-direction: column; }
.cp-row { display: flex; flex-direction: column; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cp-row:first-child { border-top: 0; padding-top: 0; }
.cp-row-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: -6px; }
.cp-row-t { font-size: var(--text-label); font-weight: 600; }
.cp-add { align-self: flex-start; }
.ed-tabs { display: none; }
.start-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.start-h { display: none; font: 700 22px var(--font-display); margin: 0; }
.start-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); border: 1.5px solid transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.start-card.on, .start-card:hover { border-color: var(--accent); }
.start-card b { display: block; }
.sc-s { display: block; color: var(--ink-muted); font-size: var(--text-label); }
.sc-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--paper); color: var(--accent); flex: none; }
.card-read { display: flex; gap: 14px; align-items: center; }
.card-read[hidden] { display: none; }
.cr-img { width: 120px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--paper); }
.cr-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cr-s { color: var(--ink-muted); font-size: var(--text-label); }
.cr-keep { display: inline-flex; gap: 6px; align-items: center; font-size: var(--text-label); margin-top: 4px; }
.smart-host, .dupes { display: flex; flex-direction: column; gap: 8px; }
.dupe-note a { font-weight: 700; }
.smart-host:empty, .dupes:empty { display: none; }
@media (max-width: 1199px) and (min-width: 700px) { .start-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) {
  /* edit head under 1024 (Rel-Phone-Edit): "Cancel · Edit relation" on ONE line, Save docked at the bottom */
  .apphead > .ph-edit { flex-wrap: nowrap; }
  .apphead > .ph-edit .loc { flex: 1 1 auto; order: 2; }
  .apphead > .ph-edit .topbar-actions { order: 1; flex: none; }
  .ph-edit .crumb .pre, .ph-edit .ph-badge, .ph-edit .menu:not(:has(.danger)) { display: none; }   /* 11r-b: Delete stays */
  .ph-edit .crumb { font-size: 18px; }
  .ph-edit .topbar-actions > .btn.ghost:not(.icon-btn) { border: 0; box-shadow: none; background: none; color: var(--accent); padding: 0 8px 0 0; }
}
@media (max-width: 699px) {
  .ed-grid, .ed-col { display: contents; }
  .ed-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-btn); background: var(--line-soft); overflow-x: auto; }
  .ed-b.ed-off { display: none !important; }
  .start-cards { grid-template-columns: minmax(0, 1fr); }
  .start-h { display: block; }
  .ed-2 { grid-template-columns: minmax(0, 1fr); }
}

/* R4 the ⋯ actions: merge (side by side), statement (period + the document), map (list + one map). */
.merge, .merge-pick { display: flex; flex-direction: column; gap: 16px; }
.merge h3, .merge-pick h3 { font: 700 18px var(--font-display); margin: 0 0 8px; }
.merge-list { list-style: none; margin: 0; padding: 0; }
.merge-list .m-lrow, .map-list .m-lrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.merge-list .m-lrow:hover, .map-list .m-lrow:hover, .map-list .m-lrow.is-cur { background: var(--paper); }
.merge-list .lx, .map-list .lx { display: flex; flex-direction: column; min-width: 0; }
.merge-list .nm, .map-list .nm { font-weight: 600; }
.merge-list .sub, .map-list .sub { font-size: var(--text-label); color: var(--ink-muted); }
.merge-tbl { width: 100%; border-collapse: collapse; }
.merge-tbl th { text-align: left; font-size: var(--text-label); color: var(--label-ink); padding: 8px; }
.merge-tbl td { padding: 8px; border-top: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
.merge-opt { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.merge-opt input { accent-color: var(--accent); margin-top: 3px; }
.merge-opt input:checked + span { font-weight: 700; }
.merge-moves { margin: 0 0 8px; padding-left: 18px; }
.merge-note { margin-top: 12px; }
.map-split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 20px; height: calc(100vh - 140px - var(--safe-top)); }
.map-list { list-style: none; margin: 0; padding: 8px; overflow: auto; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.map-list li { display: flex; align-items: center; }
.map-open { padding: 0 10px; font-weight: 600; font-size: var(--text-label); }
.map-frame { width: 100%; height: 100%; border: 0; border-radius: var(--radius-card); }
@media (max-width: 1023px) {
  .map-split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .map-frame { height: 360px; }
  .merge-tbl th:first-child, .merge-tbl td:first-child { width: 30%; }
}

/* R5 Find (Rel-Desktop-Find): the request chips + criteria grid left, Search signs + Saved finds right. */
.find-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 20px; align-items: start; }
.find-main { display: flex; flex-direction: column; gap: 16px; }
.find-side { display: flex; flex-direction: column; gap: 16px; }
.find-side h3 { font: 700 18px var(--font-display); margin: 0 0 8px; }
.find-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.find-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.find-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.find-save .field-in { flex: 1 1 240px; max-width: 360px; }
.signs { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.signs > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.signs dt { white-space: nowrap; }
.signs dt code { display: inline-block; min-width: 52px; text-align: center; padding: 3px 8px; border-radius: 8px; background: var(--paper); font: 600 14px var(--font-mono); }
.signs dd { margin: 0; color: var(--ink-muted); }
.saved-finds { list-style: none; margin: 0; padding: 0; }
.saved-finds a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--ink); font-weight: 600; }
.find-page .findbar { padding: 0; }
@media (max-width: 1023px) {
  .find-page { grid-template-columns: minmax(0, 1fr); }
  .find-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) { .find-grid { grid-template-columns: minmax(0, 1fr); } }

/* ════════════════════════════════════════════════════════════════════════════
   SALES (redesign step 2). S1 the pipeline: stage tabs (Sales-Desktop-List) — a phone switch below 700 px.
   ════════════════════════════════════════════════════════════════════════════ */
.apphead > .stage-tabs { order: 1; flex: 1 1 100%; }
.stage-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.stage { display: flex; flex-direction: column; padding: 8px 18px; border-radius: 12px; color: var(--ink-muted); white-space: nowrap; }
.stage .st-t { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
/* 11r-a / S1 + S2: the count FIRST, in a pill — green normally, red for what needs attention (stage_tabs macro) */
.stage .st-n, .fchip .st-n { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--pill-ok); color: var(--on-area); font: 700 12.5px var(--font-body); font-variant-numeric: tabular-nums; }
.stage .st-n.st-red, .fchip .st-n.st-red { background: var(--pill-bad); }
.stage .st-s { font-size: 12px; color: var(--ink-faint); }
.stage.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.apphead > .tools, .apphead > .tools > * { order: 3; }   /* head · stage tabs · search · tools (all lists) */
@media (max-width: 699px) {
  .stage-tabs { border-radius: var(--radius-btn); }
  /* 11r-a / S1: the phone keeps the pills — one sideways-scrolling row, every tab 44 px high */
  .stage { flex: none; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius-btn); }
  .stage .st-s { display: none; }
  #sales-view .tablecard { display: none; }
}
@media (min-width: 700px) and (max-width: 860px) { #sales-view .m-listscroll { display: none; } }

/* S2 — the document screen (Sales-Desktop-Editor, Sales-Phone-Quick): one layout for quote, order, invoice. */
.ph-tail { display: inline-flex; align-items: center; gap: 12px; margin-left: 12px; }
.saved-at { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
.saved-at .ic { color: var(--accent); }
.saved-at.is-err { color: var(--red); }
.chain { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--gap-card); }
.ch-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 100px; background: var(--line-soft); color: var(--ink-muted); font-size: 13px; }
.ch-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-field); background: var(--surface); }
.ch-t { font-weight: 600; }
.ch-n { color: var(--ink-faint); }
.ch-step.is-done { color: var(--ink); }
.ch-step.is-done .ch-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ch-step.is-current { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.ch-step.is-current .ch-dot { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent); }
.ch-step.is-skipped { opacity: .6; }
.ch-step.is-skipped .ch-t { text-decoration: line-through; text-decoration-color: var(--ink-faint); }
a.ch-step:hover { background: var(--surface); }
.sdoc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-card); align-items: start; }
.sdoc-main { display: flex; flex-direction: column; gap: var(--gap-card); min-width: 0; }
.sdoc-side { display: flex; flex-direction: column; gap: var(--gap-card); min-width: 0; }
.sdoc-preview { display: none; }
@media (min-width: 1200px) {
  .sdoc-grid { grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 440px); }
  .sdoc-side { position: sticky; top: calc(12px + var(--safe-top)); }
  .sdoc-preview { display: flex; flex-direction: column; gap: 10px; }
  .sdoc-preview-btn { display: none; }
}
.sdoc-side h2, .sl-progress h2 { font: 700 17px var(--font-display); margin: 0; }
.sdoc-next { display: flex; flex-direction: column; gap: 10px; }
.sdoc-next .btn { justify-content: center; }
.sdoc-money { display: flex; flex-direction: column; gap: 10px; }
.sdoc-money .is-paid { color: var(--green-deep); }
.sdoc-accepted { display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap-card); background: var(--smart-bg); box-shadow: none; }
.sdoc-accepted > div { display: flex; flex-direction: column; gap: 2px; }
.sa-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green-deep); flex: none; }
.sl-progress { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sl-desc:has(> .sl-tick), .sl-desc:has(> .sl-tick-ro) { display: flex; align-items: flex-start; gap: 10px; }
.sl-tick { flex: none; display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.sl-tick input { width: 22px; height: 22px; accent-color: var(--accent); }
.sl-tick-ro { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-field); display: grid; place-items: center; }
.sl-tick-ro.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.st-dp { padding: 8px 10px; border-radius: var(--radius-field); background: var(--smart-bg); color: var(--green-deep); font-weight: 600; }
.st-dp b { color: var(--green-deep); }
/* S4 — getting paid (Sales-Desktop-PartPaid, Sales-Phone-Payment, Sales-Phone-Paid) */
.sdoc-pay { display: flex; flex-direction: column; gap: 10px; }
.sdoc-pay h3 { font: 700 15px var(--font-display); margin: 6px 0 0; }
.sp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sp-open { font: 800 20px var(--font-display); }
.is-paid { color: var(--green-deep); }
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.pay-list form { display: inline; }
.pl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* a payment on an invoice (10a / 0d): the payer on one line, cut with an ellipsis; the bank text when opened */
.pay-list li:has(> .pl-d) { align-items: flex-start; flex-wrap: wrap; row-gap: 2px; }   /* GAP-250: the actions wrap under */
.pl-d { flex: 1; min-width: 0; }
.pl-d > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.pl-d > summary::-webkit-details-marker { display: none; }
.pl-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* GAP-250: line 1 who · how (cut with …), line 2 the date + the amount; the closed row's actions on a line of their own */
.pl-l1 { display: flex; min-width: 0; white-space: nowrap; } .pl-l1 .muted { flex: none; margin-left: .3em; }
.pl-l2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pay-list li:has(> .pl-d) > .pl-act { flex-basis: 100%; min-height: 0; padding-left: 48px; }
.pl-x { padding: 6px 0 0 48px; font-size: 13px; overflow-wrap: anywhere; }
.pl-x p { margin: 0 0 4px; }
.pl-act { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.pl-act .link-btn, .pl-acts .link-btn { align-self: center; }
.pl-acts { display: none; }
@media (max-width: 699px) { .pl-acts { display: flex; gap: 14px; margin-top: 4px; } }
/* 11c: an OPENED payment row (its online lines, bank text) takes the card's whole width — its actions move inside it, as
   on the phone */
.pay-list li:has(> .pl-d[open]) > .pl-act { display: none; } .pl-d[open] .pl-acts { display: flex; gap: 14px; margin-top: 4px; }
.gp-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green-deep); flex: none; }
.pay-sheet { display: flex; flex-direction: column; gap: 12px; width: min(380px, 100%); }
.pay-amt { font-size: 22px; font-weight: 700; }
.pay-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pay-m input { position: absolute; opacity: 0; }
.pay-m span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; border-radius: var(--radius-btn); border: 1.5px solid var(--line-field); font-weight: 600; cursor: pointer; }
.pay-m input:focus-visible + span { box-shadow: var(--focus-ring); }
.getpaid { display: flex; flex-direction: column; gap: 10px; width: min(380px, 100%); }
.gp-opt { border: 1.5px solid var(--line-field); border-radius: var(--radius-card); }
.gp-opt[open] { border-color: var(--accent); }
.gp-opt > summary { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; list-style: none; }
.gp-opt > summary > span:last-child { display: flex; flex-direction: column; }
.gp-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.gp-qr { align-self: center; background: var(--surface); border-radius: var(--radius-field); }
@media (max-width: 699px) { .pay-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* S5 — the credit note (Sales-Desktop-Credit, Sales-Phone-Credit) */
.cn-main { display: flex; flex-direction: column; gap: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-o input { position: absolute; opacity: 0; }
.seg-o span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 100px; border: 1.5px solid transparent; background: var(--line-soft); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg-o input:focus-visible + span { box-shadow: var(--focus-ring); }
.cn-ctx { margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cn-lines { list-style: none; margin: 0; padding: 0; }
.cn-l { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sdoc:not(.is-editable) .cn-l { grid-template-columns: minmax(0, 1fr) auto; }
.cn-tick input { width: 22px; height: 22px; accent-color: var(--accent); }
.cn-t { display: flex; flex-direction: column; min-width: 0; }
.cn-t .muted { font-size: 13px; }
.cn-amt { display: flex; align-items: center; gap: 4px; color: var(--red); font-weight: 700; }
.cn-amt .field-in { text-align: right; color: var(--red); font-weight: 700; }
.cn-l:not(.is-on) .cn-amt { opacity: .35; }
.cn-neg { color: var(--red); }
@media (max-width: 699px) { .cn-l { grid-template-columns: 36px minmax(0, 1fr) 118px; } }
/* S6 — recurring (Sales-Desktop-Recurring) + the reminders batch (Sales-Desktop-Reminders) */
.rec-queue { margin-bottom: var(--gap-card); }
.rec-queue h2, .rec-page h3 { font: 700 16px var(--font-display); margin: 0; }
.rec-queue form { display: inline; }
.rec-split2, .rem-batch { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-card); align-items: start; }
@media (min-width: 1024px) {
  .rec-split2 { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .rem-batch { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
}
.rec-list { padding: 6px; }
.rec-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; color: var(--ink); }
.rec-row.is-cur { background: var(--line-soft); }
.rec-row.is-off { opacity: .6; }
.rec-row .rt { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.rec-page { display: flex; flex-direction: column; gap: 14px; }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rec-grid .rec-wide { grid-column: span 2; }
.rec-every { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px; }
.rec-save { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.rec-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-acts form { display: inline; }
.rb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.rb-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.rb-row.is-cur { background: var(--line-soft); border-radius: 12px; }
.rb-pick { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.rb-level { width: auto; height: var(--h-btn-sm); flex: none; }
.rem-preview { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 699px) {
  .rec-grid { grid-template-columns: minmax(0, 1fr); } .rec-grid .rec-wide { grid-column: auto; }
  .rb-row { flex-wrap: wrap; }
  .rb-row .rb-pick { flex: 1 1 calc(100% - 40px); }
  .rb-row .rb-level { margin-left: 34px; }
  .rb-row > .mono { margin-left: auto; }
}
.sp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sp-head h2 { font: 700 16px var(--font-display); margin: 0; }
.sp-fit { display: block; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-field); background: var(--paper); }
.sp-frame { width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; }
.pmodal .sp-frame { pointer-events: auto; }
.pmodal-wide .pmodal-card { width: min(860px, 94vw); }
.sh-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sh-client-in { position: relative; display: flex; align-items: center; gap: 10px; height: var(--h-field); padding: 0 6px 0 10px; border: 1.5px solid var(--line-field); border-radius: var(--radius-field); background: var(--surface); }
.sh-client-in:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.sh-client-in .sh-picker { flex: 1; min-width: 0; position: static; }
.sh-client-in .relpick-input { border: 0; box-shadow: none; padding: 0; height: 100%; font-weight: 600; background: none; }
.sh-client-ro { display: flex; align-items: center; gap: 10px; height: var(--h-field); font-weight: 600; }
.field-ro { min-height: var(--h-field); display: flex; align-items: center; color: var(--ink); }
.link-btn { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--accent); font: 600 13px var(--font-body); cursor: pointer; }
.sdoc-head .smart-note { margin-top: 12px; }
.sh-newrel-form { margin-top: 12px; padding: 12px; border-radius: var(--radius-field); background: var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.sh-newrel-form[hidden] { display: none; }
.sh-nr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sh-nr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sh-nr-act { display: flex; gap: 8px; }
/* lines: Product or service · Qty · Unit · Price · VAT · Total — one price per line */
.sl-head, .sl-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 52px 96px 70px 96px 32px; gap: 10px; align-items: center; }
.sl-head { font-size: 13px; font-weight: 600; color: var(--label-ink); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sdoc:not(.is-editable) .sl-head, .sdoc:not(.is-editable) .sl-row { grid-template-columns: minmax(0, 1fr) 56px 52px 90px 56px 100px; }
.sl-row { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
/* a narrow lines card (phone, or beside the tablet list pane): each line on two rows — what, then qty × price = total */
.sdoc-lines { container-type: inline-size; }
@container (max-width: 620px) {
  .sl-head { display: none; }
  .sl-row, .sdoc:not(.is-editable) .sl-row { grid-template-columns: 72px 96px minmax(0, 1fr) 32px; grid-template-areas: "d d d x" "q p t t"; row-gap: 6px; }
  .sdoc:not(.is-editable) .sl-row { grid-template-areas: "d d t t" "q p . ."; }
  .sl-row .sl-desc { grid-area: d; } .sl-row .sl-qty { grid-area: q; } .sl-row .sl-price { grid-area: p; }
  .sl-row .sl-total { grid-area: t; align-self: center; } .sl-row .sl-del { grid-area: x; }
  .sl-row .sl-unit, .sl-row .sl-vat { display: none; }
}
.sl-head .sl-qty, .sl-head .sl-price, .sl-head .sl-total, .sl-row .sl-total, .sdoc:not(.is-editable) .sl-qty, .sdoc:not(.is-editable) .sl-price { text-align: right; }
.sl-in { width: 100%; height: 40px; padding: 0 10px; border: 1.5px solid var(--line-field); border-radius: var(--radius-field); background: var(--surface); font: 500 15px var(--font-body); color: var(--ink); }
textarea.sl-in { height: auto; min-height: 40px; padding: 9px 10px; line-height: 1.3; resize: none; overflow: hidden; font-weight: 600; }
.sl-in:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.sl-qty .sl-in, .sl-price .sl-in { text-align: right; font-family: var(--font-num); }
.sl-subject { margin-bottom: 6px; }
.sl-unit { color: var(--ink-muted); font-size: 14px; }
.sl-vat .line-vat { border: 0; background: none; font: 500 14px var(--font-body); color: var(--ink-muted); padding: 0; width: 100%; }
.sl-total { font-weight: 700; }
.sl-note { display: block; font-size: 13px; color: var(--ink-muted); font-weight: 400; }
.sl-desc { min-width: 0; font-weight: 600; }
.sl-none { padding: 12px 0; }
.sl-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.sl-add-wrap { position: relative; flex: 1 1 340px; display: flex; align-items: center; gap: 8px; height: var(--h-field); padding: 0 12px; border: 1.5px dashed var(--line-field); border-radius: var(--radius-field); color: var(--ink-muted); }
.sl-add-wrap:focus-within { border-style: solid; border-color: var(--accent); }
.sl-add { flex: 1; min-width: 0; border: 0; background: none; font: 500 15px var(--font-body); color: var(--ink); height: 100%; }
.sl-add:focus { outline: none; }
.sl-resform { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0 0; padding: 12px; box-shadow: var(--shadow-pop); }
.sl-resform b { flex-basis: 100%; } .sl-resform label { display: flex; flex-direction: column; gap: 2px; font-size: var(--text-sm); color: var(--ink-muted); } .sl-resform [data-rf-n] { width: 80px; }
.sl-res i { color: var(--ink-muted); font-style: normal; font-size: var(--text-xs); }
.sl-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border-radius: var(--radius-field); box-shadow: var(--shadow-pop); padding: 6px; max-height: 320px; overflow: auto; }
.sl-opt { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font: 500 14px var(--font-body); color: var(--ink); text-align: left; cursor: pointer; }
.sl-opt i { font-style: normal; font-size: 12px; color: var(--accent); margin-left: 6px; }
.sl-opt:hover, .sl-opt.on { background: var(--line-soft); }
.sl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sl-chips[hidden], .chip[hidden] { display: none; }
.sl-chips-l { font-size: 13px; color: var(--ink-muted); }
.chip-timer { gap: 6px; }
.chip-rebill { color: var(--st-sent-ink); background: var(--st-sent-bg); border-color: transparent; }
.sl-totals { margin: 16px 0 0 auto; width: min(320px, 100%); display: flex; flex-direction: column; gap: 6px; }
.st-row { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; color: var(--ink-muted); }
.st-row b { color: var(--ink); font-weight: 600; }
.st-total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font: 700 22px var(--font-display); color: var(--ink); }
.st-total b { font-weight: 800; }
.sdoc-more > summary { cursor: pointer; font: 700 15px var(--font-display); list-style: none; }
.sdoc-more > summary .muted { font: 400 13px var(--font-body); }
.sdoc-more[open] > summary { margin-bottom: 14px; }
.sm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sm-grid .sm-wide { grid-column: 1 / -1; }
.sm-dp { display: flex; align-items: center; gap: 10px; }
.sm-dp .field-in { flex: 1; }
.send-mark { margin-top: 10px; }
@media (max-width: 1023px) {
  .sh-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sh-fields .sh-client { grid-column: 1 / -1; }
  .sm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .ph-doc .ph-tail { margin-left: 0; }
  .sh-nr-grid, .sm-grid { grid-template-columns: minmax(0, 1fr); }
  .sl-totals { width: 100%; }
  .chain .ch-n { display: none; }
  .ch-step { padding-right: 10px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   PRODUCTS (redesign step 3). P1 the list: type tabs (the Sales strip), "Below reorder" amber chip, photo thumbs.
   ════════════════════════════════════════════════════════════════════════════ */
.prod-tabs .stage { padding: 8px 16px; }
.fchip-warn { background: var(--st-part-bg); color: var(--st-part-ink); box-shadow: none; }
.mini-img { object-fit: cover; padding: 0; }
.prod-lists-note a { font-weight: 600; color: var(--accent); }
@media (max-width: 699px) {
  #product-view .tablecard { display: none; }
}
@media (min-width: 700px) and (max-width: 860px) { #product-view .m-listscroll { display: none; } }
/* P2 the product page (Prod-Desktop-Record, Prod-Phone-Record): header card, stock / reorder card, Details. */
.pc-top { display: flex; gap: 18px; align-items: flex-start; }
.pc-thumb { width: 96px; height: 96px; flex: none; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; object-fit: cover; }
.pc-id { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pc-sub, .pc-name { display: none; margin: 0; }
.pc-sub { color: var(--ink-muted); }
.pc-figs { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.pc-f { display: flex; flex-direction: column; gap: 2px; }
.pc-l { font-size: var(--text-label); color: var(--ink-muted); }
.pc-only { font-size: 11px; }
.pc-v b { font: 700 24px var(--font-display); }
.pc-cost b { font-size: 18px; }
.pc-sup { flex-basis: 100%; }
.pc-sup a { font-weight: 600; color: var(--accent); }
.pc-stock-m { display: none; }
.stock-card .sc-h { font-weight: 600; color: var(--ink-muted); }
.stock-card.is-low { background: var(--st-part-bg); }
.stock-card.is-low .sc-h { color: var(--st-part-ink); }
.sc-n { font: 700 38px var(--font-display); margin: 4px 0 10px; }
.sc-n.is-neg { color: var(--st-overdue-ink); }
.sc-u { font: 400 15px var(--font-body); color: var(--ink-muted); }
.sc-bar { width: 100%; height: 8px; border: 0; border-radius: 8px; background: var(--line-soft); appearance: none; overflow: hidden; }
.sc-bar::-webkit-progress-bar { background: var(--line-soft); }
.sc-bar::-webkit-progress-value { background: var(--st-part-ink); border-radius: 8px; }
.sc-bar::-moz-progress-bar { background: var(--st-part-ink); }
.sc-sugg, .sc-note { margin: 12px 0 0; }
.sc-note { color: var(--ink-muted); font-size: 14px; }
.sc-alloc { margin: 8px 0 0; padding-left: 18px; }
.sup-list { list-style: none; margin: 0 0 10px; padding: 0; }
.sup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.sup-n { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sup-m { flex: 1; }
.sup-a { display: inline-flex; align-items: center; gap: 4px; }
.sup-edit[open], .sup-add[open], .bk-else[open] { flex-basis: 100%; }
.pd-short { margin: 0 0 8px; font-weight: 600; }
@media (max-width: 1199px) { .pc-stock-m { display: block; } .ph-record .topbar-actions { flex-wrap: nowrap; } }
/* GAP-47 (step 4, board Prod-Tablet): on a tablet the name is never cut off — since 11r-b the pager has its own row
   (.rec-bar), so the name may wrap onto a second line beside the buttons instead. */
@media (min-width: 700px) and (max-width: 1199px) { .ph-record .crumb { white-space: normal; } }
/* P3 the Stock tab (every movement) + Count or correct; the phone's big − / + on the stock card */
.sm-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sm-h h3 { font: 700 18px var(--font-display); margin: 0; }
.count-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 12px 0; padding: 14px; border-radius: 14px; background: var(--line-soft); }
.count-tip { flex-basis: 100%; margin: 0; }
.sm-list { list-style: none; margin: 8px 0 0; padding: 0; }
.sm-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line2); }
.sm-q { width: 52px; text-align: right; font: 700 17px var(--font-display); font-variant-numeric: tabular-nums; }
.sm-q.is-up { color: var(--green); }       /* GAP-46: + green, − amber (Prod-Desktop-Record) */
.sm-q.is-down { color: var(--amber); }
.sm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.sm-t a { color: var(--ink); }
.sm-d { font: 400 13px var(--font-body); color: var(--ink-muted); }
.sm-after { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sm-after.is-neg { color: var(--st-overdue-ink); }
.count-step { display: none; }
@media (max-width: 1199px) {
  .pc-stock-m .count-step { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 10px; margin-top: 4px; }
  .pc-stock-m .sc-n { display: none; }
}
.cs-b { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow-soft); font: 400 28px var(--font-body); color: var(--ink); cursor: pointer; }
.cs-mid { display: flex; flex-direction: column; align-items: center; }
.cs-n { width: 100%; max-width: 160px; border: 0; background: none; text-align: center; font: 700 44px var(--font-display); color: var(--ink); appearance: textfield; }
.cs-save, .cs-tip { grid-column: 1 / -1; justify-self: center; }
.cs-tip { margin: 0; text-align: center; }
/* P4 Needs reordering (Prod-Desktop-Reorder): one card per usual supplier */
.ro-groups { display: flex; flex-direction: column; gap: 16px; }
.ro-group { padding: 0; overflow: hidden; }
.ro-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line2); }
.ro-av { width: 36px; height: 36px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; font: 700 13px var(--font-display); flex: none; }
.ro-n a { color: var(--ink); }
.ro-sub { margin-left: auto; font-size: 14px; }
.ro-rows { list-style: none; margin: 0; padding: 0; }
.ro-r { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line2); }
.ro-r.is-off { opacity: .55; }
.ro-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ro-t a { color: var(--ink); }
.ro-t .muted { font-size: 13px; }
.ro-set { font-size: 13px; font-weight: 600; color: var(--accent) !important; }
.ro-q, .ro-p { display: inline-flex; align-items: center; gap: 6px; }
.ro-u, .ro-cur { color: var(--ink-muted); }
.ro-tick { flex: none; display: inline-flex; }
.ro-q .field-in { width: 96px; text-align: right; font-weight: 700; }
.ro-p .field-in { width: 92px; text-align: right; }
.ro-tot { width: 96px; text-align: right; }
.ro-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.ro-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ro-sum { font: 600 18px var(--font-display); }
.ro-note, .ro-only { margin: 16px 0 0; }
.ro-only { margin: 0 0 16px; }
@media (max-width: 699px) {
  .ro-r { flex-wrap: wrap; padding: 12px 14px; }
  .ro-t { flex-basis: calc(100% - 40px); }
  .ro-q { margin-left: 36px; }
  .ro-tot { margin-left: auto; }
  .ro-h { flex-wrap: wrap; padding: 14px; }
  .ro-sub { margin-left: 48px; flex-basis: 100%; }
}
/* P5 barcode scan (Prod-Phone-Scan): the camera fills the screen, a frame + red line, the result sheet */
.scan-screen { position: fixed; inset: 0; padding: var(--safe-top) var(--safe-right) 0 var(--safe-left); z-index: 95; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; align-items: center; }
.scan-top { position: relative; z-index: 2; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 18px; }
.scan-close, .scan-msg { color: var(--side-text); }
.scan-close { font-weight: 600; }
.scan-title { margin: 0; font: 700 18px var(--font-display); color: var(--side-text); }
.scan-gap { width: 44px; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; z-index: 1; margin-top: 28vh; width: min(76vw, 420px); aspect-ratio: 1.6; border: 3px solid var(--accent-soft); border-radius: 18px; display: grid; place-items: center; }
.scan-line { width: 86%; height: 2px; background: var(--st-overdue-ink); }
.scan-msg, .scan-type { position: relative; z-index: 1; }
.scan-msg { margin: 18px 16px 0; text-align: center; }
.scan-type { display: flex; gap: 8px; margin: 14px 16px 0; width: min(92vw, 440px); }
.scan-type .field-in { flex: 1; background: var(--surface); }
.scan-sheet { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 16px; max-width: 520px; margin: 0 auto; padding: 16px; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.ss-head { display: flex; gap: 12px; align-items: center; }
.ss-ic { width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ss-tx { display: flex; flex-direction: column; margin: 0; }
.ss-tx b { font: 700 17px var(--font-display); }
.ss-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ss-acts .btn { justify-content: center; text-align: center; }
.ss-unknown .ss-acts { grid-template-columns: 1fr; }
.ss-found, .ss-unknown { display: block; }
.ss-found[hidden], .ss-unknown[hidden] { display: none; }
.ss-link { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 12px; }
.ss-link .field { flex: 1; }
.ss-again { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
.scan-chip { display: none; }
@media (max-width: 1199px) { .scan-chip { display: inline-flex; background: var(--ink); color: var(--surface); } }
.chip-scan { display: none; }
@media (max-width: 1199px) { .chip-scan { display: inline-flex; align-items: center; gap: 6px; } }
/* PURCHASES (redesign step 4). U1 the list: tabs with sub-lines (the Sales strip), the phone's big Scan, drop */
.pur-scan { display: none; }
.pur-drop-note { margin: 14px 0 0; }
.pur-drop-over { position: fixed; inset: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) 12px calc(12px + var(--safe-left)); z-index: 90; border: 3px dashed var(--accent); border-radius: 22px; background: var(--accent-soft); display: grid; place-items: center; font: 700 22px var(--font-display); color: var(--accent); }
.pur-drop-over[hidden] { display: none; }
@media (max-width: 699px) {
  .pur-scan { display: flex; justify-content: center; gap: 10px; width: 100%; min-height: 56px; margin: 0 0 12px; font-size: 17px; }
  #purchase-view .tablecard { display: none; }
  .pur-drop-note, .pur-upload { display: none; }
}
@media (min-width: 700px) and (max-width: 860px) { #purchase-view .m-listscroll { display: none; } }
/* U2 the receipt scan (Pur-Phone-Scan — the step-3 .scan-screen) and the receipt check (Pur-Phone-Check, Pur-Tablet) */
.rs-frame { position: relative; z-index: 1; margin-top: 6vh; width: min(68vw, 300px); aspect-ratio: 0.62; border: 3px solid var(--green-pop); border-radius: 18px; padding: 10px; transform: rotate(-3deg); }
.rs-paper { display: block; width: 100%; height: 100%; border-radius: 8px; background: var(--surface); opacity: .12; }
.rs-bar { position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 44px; }
.rs-side { color: var(--side-text); font-weight: 600; cursor: pointer; min-width: 64px; text-align: center; }
.rs-shutter { width: 76px; height: 76px; border-radius: 50%; background: var(--green-pop); box-shadow: 0 0 0 5px var(--side-bg), 0 0 0 9px var(--surface); cursor: pointer; }
.ck-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 20px; align-items: start; }
.ck-wrap.no-doc { grid-template-columns: minmax(0, 560px); }
.ck-doc { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; position: sticky; top: calc(8px + var(--safe-top)); max-height: calc(100vh - 120px - var(--safe-top)); }
.ck-doc img { display: block; width: auto; max-width: 100%; margin: 0 auto; height: auto; max-height: calc(100vh - 120px - var(--safe-top)); object-fit: contain; }
.ck-doc iframe { display: block; width: 100%; height: calc(100vh - 140px - var(--safe-top)); border: 0; }
.ck-col { display: flex; flex-direction: column; gap: 12px; }
.ck-card { padding: 4px 18px; }
.ck-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); }
.ck-row:last-child { border-bottom: 0; }
.ck-ro { display: inline-flex; align-items: center; justify-content: flex-end; }
.ck-k { color: var(--ink-muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ck-v { flex: 1; min-width: 0; max-width: 62%; border: 0; background: transparent; font: 600 16px var(--font-body); color: var(--ink); text-align: right; text-align-last: right; padding: 6px 0; }
.ck-v:focus, .ck-sel:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* a pick whose name wraps: the select lies unseen over the text */
.ck-sel { position: relative; display: block; padding-right: 18px; overflow-wrap: anywhere; }
.ck-sel select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; }
.ck-sel::after { content: ""; position: absolute; right: 3px; top: 40%; width: 7px; height: 7px; border: solid; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ck-rate { width: 4.2em; border: 0; border-bottom: 1px dashed var(--line-btn); background: transparent; font: inherit; color: var(--ink-muted); text-align: right; }
.ck-total .ck-v { font: 700 26px var(--font-display); }
.ck-charge { padding: 14px 18px; }
.ck-h { margin: 0 0 10px; font: 700 16px var(--font-body); }
.ck-charge .fchip input { position: absolute; opacity: 0; pointer-events: none; }
.ck-charge .fchip { position: relative; background: var(--bg); box-shadow: none; }
.ck-other { margin-top: 10px; width: 100%; }
.ck-hint { margin: 8px 0 0; font-size: var(--text-label); }
.ck-more { padding: 12px 18px; }
.ck-more .field { margin-top: 0; }
/* step 12 / X1–X3 "Amounts per VAT rate" (_vat_parts.html): rate · net · VAT · ✕ on one line at every width */
.vp { padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.vp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vp-cols, .vp-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.vp-cols { color: var(--ink-muted); font-size: var(--text-label); }
.vp-cols span:nth-child(n+2) { text-align: right; padding-right: 10px; }
.vp-rows { display: flex; flex-direction: column; gap: 6px; }
.vp-in { min-width: 0; height: var(--h-field); border: 1px solid var(--line-btn); border-radius: var(--radius-field); background: var(--field-bg); font: 600 15px var(--font-body); color: var(--ink); padding: 0 8px; }
.vp-amt { display: flex; align-items: center; gap: 4px; }
.vp-amt i { font-style: normal; color: var(--ink-muted); }
.vp-amt input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; text-align: right; }
.vp label.vp-amt { display: flex; margin: 0; font: 600 15px var(--font-body); } .vp .vp-amt input { width: auto; height: auto; min-height: 0; padding: 0; box-shadow: none; }
.vp-ro { display: flex; align-items: center; background: var(--surface-sunk); }
.vp-ro.vp-amt { justify-content: space-between; }
.vp-add { align-self: flex-start; }
.vp-tot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.vp-big { font: 700 26px var(--font-display); }
.vp-si { margin: 0; }
.vp-ok { padding: 10px 14px; border-radius: var(--radius-field); background: var(--st-paid-bg); color: var(--st-paid-ink); }
.vp-lockline { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 14px; border-radius: var(--radius-field); background: var(--surface-sunk); color: var(--ink); }
.vp-lockline .ic, .vp-lk .ic { color: var(--ink-muted); flex: none; margin-top: 2px; }
/* U3 the supplier invoice check (Pur-Desktop-Check): document beside header + lines → your products */
.si-note { margin: 0 0 16px; }
.si-warn { display: block; margin-top: 2px; color: var(--st-overdue-ink); }
.si-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.si-doc { min-height: 420px; }
.si-nodoc { padding: 24px; }
.si-head { padding: 16px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.si-head .field { margin: 0; }
.si-head .field:first-child { grid-column: 1 / -1; }
.si-unknown { display: flex; justify-content: space-between; gap: 8px; margin: 12px 12px 0; padding: 6px 10px; border-radius: 6px; background: var(--st-part-bg); color: var(--st-part-ink); font-size: 13px; }
.si-lines { padding: 14px 20px; }
.si-lh { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.si-lh .ck-h { margin: 0; }
.si-adds { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-label); color: var(--ink-muted); }
.si-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 84px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.si-row:last-child { border-bottom: 0; }
.si-what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.si-desc { width: 100%; border: 0; background: transparent; font: 600 16px var(--font-body); color: var(--ink); padding: 2px 0; min-width: 0; }
.si-qp { display: flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: 14px; }
.si-n { flex: none; width: 5.5em; min-height: 0; padding: 2px 0; border: 0; border-bottom: 1px dashed var(--line-btn); border-radius: 0; background: transparent; font: inherit; color: var(--ink-muted); }
.si-arrow { color: var(--ink-muted); text-align: center; }
.si-pick { width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--accent); border-radius: var(--radius-field); background: var(--accent-soft); font: 600 15px var(--font-body); color: var(--ink); min-width: 0; }
.si-pick.is-new { border-style: dashed; border-color: var(--st-part-ink); background: var(--st-part-bg); }
.si-done { display: flex; align-items: center; }
.si-eff { font-size: 14px; color: var(--accent); white-space: nowrap; }
.si-row.is-same .si-desc, .si-row.is-same .si-qp { color: var(--ink-muted); }
.si-row.is-same .si-pick { border-color: var(--line); background: var(--surface); }
.si-diff { font-size: 13px; font-weight: 600; color: var(--st-part-ink); }
.si-missing { margin: 10px 0 0; font-size: 14px; color: var(--st-part-ink); }
.si-polink { display: flex; align-items: center; min-height: 44px; font-weight: 700; }
.si-head .si-po { grid-column: span 2; }
@media (max-width: 1199px) {
  .si-wrap { grid-template-columns: minmax(0, 1fr); }
  .si-doc { min-height: 0; position: static; max-height: 34vh; overflow: auto; }
  .si-doc iframe { height: 34vh; }
  .si-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .si-row { grid-template-columns: minmax(0, 1fr) 64px; }
  .si-arrow { display: none; }
  .si-what { grid-column: 1 / -1; }
  .si-doc { display: none; }
}
/* U4 a purchase order (Pur-Desktop-PO): the line stepper, the step-2 line block (+ a "received" box), the help card */
.chain-line { gap: 6px 0; align-items: center; }
.chain-line .ch-step { background: none; box-shadow: none; padding: 0; font-size: 14px; }
.chain-line .ch-step + .ch-step::before { content: ""; width: clamp(12px, 4vw, 48px); height: 2px; margin: 0 12px; background: var(--line); }
.chain-line .ch-dot { width: 28px; height: 28px; border-style: dashed; }
.chain-line .is-done .ch-dot { border-style: solid; }
.chain-line .is-current .ch-dot { border: 3px solid var(--accent); box-shadow: none; }
.po-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(260px, 4fr); gap: 20px; align-items: start; }
.po-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.po-sup { flex: 1 1 240px; margin: 0; max-width: 360px; }
.po-lines .sl-head, .po-lines .sl-row { grid-template-columns: minmax(0, 1fr) 64px 44px 88px 96px 32px; }
.po-lines.is-recv .sl-head, .po-lines.is-recv .sl-row { grid-template-columns: minmax(0, 1fr) 48px 44px 80px 96px 130px; }
.po-lines .sl-qty, .po-lines .sl-price { text-align: right; }
.po-lines .sl-desc { display: grid; gap: 6px; }
.po-got { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--accent); border-radius: var(--radius-field); font-weight: 700; }
.po-got input { width: 4.5em; border: 0; background: transparent; font: inherit; text-align: right; color: var(--ink); }
.po-got.is-done { border-color: var(--line); color: var(--ink-muted); }
.po-help p { margin: 0; line-height: 1.5; }
.po-newcard, .mo-export { max-width: 560px; }
@container (max-width: 620px) {
  .po-lines .sl-row, .po-lines.is-recv .sl-row { grid-template-columns: 72px 96px minmax(0, 1fr) 32px; }
  .po-lines.is-recv .sl-row { grid-template-areas: "d d t t" "q p g g"; } .po-got { grid-area: g; }
}
@media (max-width: 1199px) { .po-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1024px) and (max-width: 1199px) { .ck-wrap { grid-template-columns: minmax(0, 1fr) minmax(300px, 1.2fr); } }
@media (max-width: 699px) {
  .ck-wrap, .ck-wrap.no-doc { grid-template-columns: minmax(0, 1fr); }
  .ck-doc { display: none; }
}
.cn-back, .bk-a { display: flex; align-items: center; gap: 8px; flex-basis: 100%; margin-top: 6px; font-size: 14px; }
.bk-a { flex-wrap: wrap; }
.mo-chk .ns-t { flex-basis: 0; }
.cn-back[hidden] { display: none; }
.cn-backq { width: 80px; }
@media (max-width: 1023px) { .pc-name { display: block; } }   /* step 12 / X4: the tablet too (the head's title is off) */
@media (max-width: 699px) {
  .pc-thumb { width: 64px; height: 64px; border-radius: 14px; }
  .pc-name, .pc-sub { display: block; }
  .pc-card .rc-chips, .pc-figs { display: none; }
}
/* WORK (step 5). W1 the Work page (Work-Desktop-List, Work-Tablet): project cards with a budget bar; the Tasks tab */
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.wcard { display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.wc-h, .wc-f { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wc-f { margin-top: auto; }
.rec-pane .work-tabs .st-s { display: none; }
.rec-pane .work-tabs .stage { flex: 1 1 auto; align-items: center; padding: 8px 6px; font-size: 14px; }   /* GAP-91: fits */
.wc-n { font: 700 18px var(--font-display); }
.wc-c, .wc-r { color: var(--ink-muted); }
.wc-r { font-size: var(--text-label); }
.wc-bar { display: flex; align-items: center; gap: 8px; font-size: var(--text-label); color: var(--ink-muted); }
.wc-bar .sc-bar::-webkit-progress-value { background: var(--accent-pop); }
.wc-bar .sc-bar::-moz-progress-bar { background: var(--accent-pop); }
.wc-bar.is-over .sc-bar::-webkit-progress-value { background: var(--st-overdue-ink); }
.wpane .lx { gap: 4px; }
.wtasks { list-style: none; margin: 0; padding: 4px 20px; }
.wt { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.wt:last-child { border-bottom: 0; }
.wt-x { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.wt-t { font-weight: 600; }
.wt-s { font-size: var(--text-label); color: var(--ink-muted); }
.wt.is-done .wt-t { text-decoration: line-through; color: var(--ink-faint); }
/* W2 the project page (Work-Desktop-Project, Work-Phone-Project): phone/tablet = two big buttons + the open tasks;
   the docked "Invoice work done" carries its amount */
.wt .fchip { background: var(--st-part-bg); color: var(--st-part-ink); }
.wt .menu > .btn:not(:hover) { box-shadow: none; background: none; }   /* GAP-87: a quiet ⋯ per task */
.pj-acts, .pj-amt { display: none; }
.ph-dock .pj-amt { display: inline; }
.pj-go { background: var(--ink); color: var(--surface); }
.pj-trk.is-watch { color: var(--st-part-ink); }
.pj-trk.is-over { color: var(--st-overdue-ink); }
@media (max-width: 1199px) {
  .pj-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .pj-acts .btn { flex-direction: column; gap: 4px; min-height: 72px; }
  .pj-tasks .is-done { display: none; }
}
@media (max-width: 699px) { .pj-chips { display: none; } }
/* W3 the timer (Work-Phone-Timer): the big card centred; from 1024 px Today sits beside it */
.tmr { display: grid; gap: 16px; max-width: 560px; margin: 0 auto; padding-bottom: 24px; }
.tmr-card { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 24px 20px; }
.tmr-since { margin: 0; color: var(--red); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tmr-since::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.tmr-idle { color: var(--muted); }
.tmr-clock { font: 700 64px/1 var(--font-num); letter-spacing: -1px; color: var(--ink); }
.tmr-who { margin: 0; display: grid; gap: 2px; font-size: 18px; }
/* 11d / 0c: a timer running longer than 10 hours — the stop-at question, and the chips in amber */
.tmr-long { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: var(--radius-field); background: var(--amber-soft); color: var(--amber-ink); }
.tmr-long b { flex: 1 0 100%; }
.tm-long, .tm-long + .tm-l { color: var(--amber-ink); }
.sb-timer.tm-long, .tb-timer.tm-long { background: var(--amber-soft); }
.tmr-who span, .tmr-list span { font-size: 14px; color: var(--ink-muted); }
.tmr-f { display: grid; justify-items: center; gap: 12px; width: 100%; text-align: left; }
.tmr-f > .ctl, .tmr-f > .fb-f, .tmr-rate { width: 100%; }
.tmr-f .fb-f, .wk-add .fb-f { display: flex; flex-direction: column; font-size: var(--text-label); color: var(--label-ink); }
.tmr-rate { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.tmr-go { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); display: grid; place-items: center; cursor: pointer; }
.tmr-sm { width: 64px; height: 64px; background: var(--line); color: var(--ink); }
.tmr-play { background: var(--green); color: var(--surface); }
.tmr-bs { display: flex; align-items: center; gap: 20px; }
.tmr-today .seclabel { margin-top: 4px; }
.tmr-list { list-style: none; margin: 0 0 8px; padding: 4px 18px; }
.tmr-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.tmr-list li:first-child { border: 0; }
.tmr-list div { display: grid; min-width: 0; }
.tmr-q { grid-column: 1 / -1; text-align: center; color: var(--ink-muted); font-size: 13px; margin: 0; }
@media (min-width: 1024px) { .tmr { max-width: 980px; grid-template-columns: 1fr 1fr; align-items: start; } }
/* W4 the week (Work-Desktop-Week): the grid from 1024 px, a day list below; today tinted; a cell opens below */
.wk-pager { display: inline-flex; gap: 4px; }
.wk-st .ic { display: none; }
@media (max-width: 699px) { .wk-st .ic { display: block; } .wk-st span { display: none; } }
.wk-grid { padding: 0; overflow-x: auto; }
.wk-grid, .wk-days { margin-bottom: 16px; }
.wk { width: 100%; border-collapse: collapse; }
.wk th { padding: 12px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.wk td { padding: 8px; text-align: center; border-top: 1px solid var(--line-soft); }
.wk tr > :first-child { text-align: left; padding-left: 16px; }
.wk td span, .wk-dr span span { display: block; font-size: 13px; color: var(--ink-muted); }
.wk .n { text-align: right; padding-right: 16px; }
.wk-today { background: var(--smart-bg); }
.wk-h, .wk-e { display: inline-block; min-width: 54px; padding: 8px 0; border-radius: 10px; color: var(--ink); }
.wk-h { background: var(--paper); font-weight: 700; }
.wk-e { color: var(--faint); }
.wk-h:hover, a.wk-e:hover, .wk .on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.wk-days { display: none; gap: 12px; }
.wk-day h2, .wk-cell h2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 16px; }
.wk-cell h2 { font-weight: 500; }
.wk-day { padding: 12px 16px; }
.wk-day small, .wk-cell small { font-weight: 500; color: var(--ink-muted); margin-left: 6px; }
.wk-cell small { display: block; margin: 2px 0 0; }
.wk-dr { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--ink); }
.wk-cell { margin-top: 16px; display: grid; gap: 8px; }
.wk-cell .tmr-list { padding: 0; }
.wk-cell > .btn { justify-self: start; }
.wk-amt { display: flex; gap: 10px; align-items: center; }
.wk-add { display: grid; grid-template-columns: 110px 120px 1fr 1fr auto; gap: 10px; align-items: end; }
.smart-note a.sn-undo { display: flex; align-items: center; }
@media (max-width: 1023px) { .wk-grid { display: none; } .wk-days { display: grid; } .wk-add { grid-template-columns: 1fr 1fr; } .wk-wide, .wk-add .btn { grid-column: 1 / -1; } }
@media (max-width: 699px) { .topbar-list .crumb .pre { display: none; } }
.topbar-list .crumb .pre a { color: inherit; }

/* ── MONEY (redesign step 6 / M1): money.html — 4 numbers (.hcard), In/out bars, phone cards ── */
.money { display: flex; flex-direction: column; gap: var(--gap-block); }   /* 11r-b / H1 (+ M1): full width */
.mo-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-block); }
.mo-cards .hcard { gap: 4px; color: var(--ink); }
.mo-cards .hc-t { flex: none; }
.mo-cards .hc-big-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }   /* 11s / E6 */
.mo-cards .mo-over { color: var(--overdue); }
/* step 11r-d (M1–M3): the overview's cards — 6 tracks: Profit (4) | Tips (2) · Costs | Days to pay | VAT (2 each) · Cash */
.mo2-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap-block); align-items: stretch; }
.mo2-grid > .panel { min-width: 0; grid-column: span 2; }
.mo2-grid > .mo2-profit { grid-column: span 4; }
.mo2-grid > .mo2-cash { grid-column: 1 / -1; }
.mo2-sum { display: flex; align-items: baseline; gap: 6px; }
.mo2-wait { color: var(--ink-faint); }
.mo2-amber { color: var(--amber); }
.hm2-list > .mo2-tip { align-items: flex-start; padding: 8px 0; }
.mo2-tt { font-size: 14px; white-space: normal; }
.hm2-tx .mo2-rule { margin-top: 2px; font-size: 12px; }
.mo2-ta { margin-top: 6px; }
.mo2-x { margin: 0; }
.mo2-how { margin: 8px 0 0; font-size: 12px; }
.mo2-big { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; }
.mo2-big b { font: 700 var(--text-key) var(--font-display); }
.mo2-aside { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.mo2-aside input { width: 120px; }
.mo2-next { margin: 10px 0 0; }
.mo-phone { display: none; flex-direction: column; gap: var(--gap-block); }
.mo-chk { background: var(--amber-soft); color: var(--ink); }
/* Money › VAT (M3/M4): numbered box rows on .lrow, grey zeros, bold payable */
.vt-n { display: grid; place-items: center; height: 30px; border-radius: 8px; background: var(--ink); color: var(--surface); }
.vt .lrow .t { font-weight: 400; white-space: normal; } .vt a.amt { color: inherit; }
.vt .nb { grid-template-columns: minmax(0, 1fr) auto auto; }
.vt .z { color: var(--ink-faint); } .vt .z .vt-n { background: var(--line-soft); color: inherit; }
.vt .tot .t, .vt .tot .amt { font-weight: 700; font-size: 20px; }
.vt-dec { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.vt-go { display: flex; flex-direction: column; align-items: center; } .vt-go .field-hint { margin: 2px 0 0; }
/* step 12 / F1–F4: the strip + Mark dialog, the filed line, as filed, came in after filing */
.vt-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.vt-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-weight: 600; }
.vt-steps li { display: inline-flex; align-items: center; gap: 6px; } .vt-steps .ic { color: var(--accent); }
.vt-sn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); font-size: 12px; }
.vt-off { background: var(--surface-sunk); color: var(--ink-muted); border-color: var(--line); }
.vt-filed { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); border-left: 4px solid var(--accent); }
.vt-fi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--st-paid-bg); color: var(--st-paid-ink); flex: none; }
.vt-ft { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vt-fl, .vt-late-n { font-weight: 600; }
.vt-lr { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.vt-lr .lx { display: flex; flex-direction: column; min-width: 0; }
.vt-undo-h { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.vt-late-in { margin: 0; }
.vt-mf { display: flex; flex-direction: column; gap: 12px; padding: 4px 18px 18px; }
.vt-mf p { margin: 0; }
.vt-mf-a { display: flex; justify-content: flex-end; gap: 10px; }
@media (min-width: 700px) { dialog.sheet.vt-dlg { inset: 0; margin: auto; width: min(440px, 92vw); max-height: 90vh; border-radius: var(--radius-card); } .vt-dlg .grab { display: none; } }
@media (max-width: 1199px) { .vt-asfiled .vt-side { order: 0; } }
@media (max-width: 699px) { .vt-steps { display: none; } .vt-strip .btn { flex: 1; justify-content: center; }
  .vt-asfiled .lrow.z, .vt-asfiled .vt-cp { display: none; } .vt-filed { align-items: flex-start; flex-wrap: wrap; }
  .vt-ft { flex-basis: calc(100% - 50px); } .vt-fl { margin-left: 50px; }
  .vt-head .crumb { display: flex; flex-direction: column; align-items: flex-start; }
  .vt-head .crumb .pre { display: block; font: 600 16px var(--font-body); } .vt-head .crumb .pre a { color: var(--accent); }
  .vt-head .pre a::before { content: "‹ "; } .vt-head .pre .sep { display: none; } }
@media (max-width: 1199px) { .mo2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mo2-grid > .panel, .mo2-grid > .mo2-profit { grid-column: span 1; } .mo2-grid > .mo2-cash { grid-column: 1 / -1; }
  .mo-cards { grid-template-columns: 1fr 1fr; } .vt-side { order: -1; } .mo-head .topbar-actions > .btn.ghost { display: none; } }
@media (max-width: 699px) { .mo-tabs, .mo-head .topbar-actions, .mo-dt, .mo-back .sep, .mo-back .ph-count, .no-ph, .mi.no-ph { display: none; } .mo-phone { display: flex; }
  .mo-cards .hc-big { font-size: 22px; }
  /* 11r-d: the totals as a sideways row, then the cards stacked */
  .mo2-tot { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; }
  .mo2-tot > .hcard { flex: 0 0 70%; scroll-snap-align: start; }
  .mo2-grid { grid-template-columns: minmax(0, 1fr); }
  /* Bank (Money-Phone-Bank): "‹ Money" left, the title centred; answers side by side */
  .mo-back .loc { flex: 1; } .mo-back .crumb { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; width: 100%; }
  .mo-back .crumb .pre { display: block; font: 600 16px var(--font-body); } .mo-back .crumb .pre a { color: var(--accent); } .mo-back .pre a::before { content: "‹ "; }
  .smart-host .mo-chk { margin: 0 -15px; padding: var(--pad-row); } .bk-a .btn.sm { padding: 0 10px; } }
/* Send (L4, Mail-Desktop-Send / Mail-Phone-Send): channel buttons; on the phone a bottom sheet */
.snd { display: grid; grid-template-columns: minmax(0, 7fr) minmax(240px, 4fr); gap: 20px; align-items: start; }
.snd-main, .snd-f, .snd-how, .snd-fields { display: flex; flex-direction: column; gap: 14px; }
.snd-ch { display: flex; flex-wrap: wrap; gap: 8px; }
.snd-c { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--radius-btn); box-shadow: inset 0 0 0 1.5px var(--line-btn); color: var(--ink); font-weight: 600; }
.snd-pdf, .snd-sum, .snd-ask:not([hidden]), .snd-none { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: var(--radius-field); background: var(--paper); }
.snd-pdf .muted { margin-left: auto; } .snd-none { display: block; }
.snd-t, .snd-sum, .snd-line, .snd-dim, .snd .grab { display: none; }
@media (max-width: 1199px) { .snd { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .snd-head .topbar-actions > .ghost, .snd-how, .snd.is-edit .snd-sum, .snd:not(.is-edit) .snd-fields { display: none; }
  .snd-dim { display: block; position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
  .snd-main { position: fixed; inset: auto 0 0; z-index: 61; max-height: 86vh; overflow: auto; border-radius: 22px 22px 0 0; padding-bottom: calc(var(--dock-h) + var(--tabbar-h) + 16px); }
  .snd .grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-btn); margin: 0 auto; }
  .snd-t { display: block; margin: 0; font: 700 18px var(--font-body); } .snd-sum { display: block; }
  .snd-ch { display: grid; grid-template-columns: 1fr 1fr; } .snd-c { flex-direction: column; justify-content: center; gap: 4px; min-height: 62px; }
  .snd-line { display: block; margin: 0; text-align: center; font-size: var(--text-label); color: var(--ink-muted); } }
/* Settings frame (step 8 / S1, the Set-* boards) */
.setg { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.setnav, .set-cos, .setf { display: flex; flex-direction: column; gap: 2px; }
.setf { gap: 16px; }
.setnav-h { display: none; margin: 0 0 8px; font: 700 24px var(--font-display); }
.setnav-i, .set-co-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--radius-card); color: var(--ink); }
.setnav-i.on { background: var(--surface); box-shadow: var(--shadow-card); }
.setnav .si { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--line-soft); color: var(--accent); }
.setg .st { display: flex; flex-direction: column; flex: 1; min-width: 0; } .setg .st small { font-size: 13px; color: var(--ink-muted); }
.set-co-row { padding: 12px 0; border-radius: 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.set-ch { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; } .set-ch small { color: var(--ink-muted); }
.set-sw { display: flex; flex-wrap: wrap; gap: 10px; } .set-sw input { position: absolute; opacity: 0; }
.set-sw i { display: block; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; }
.set-sw :checked + i { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); } .set-sw :focus-visible + i { outline: 2px solid var(--accent); }
.set-logo { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 80px; border: 1px dashed var(--line-btn); border-radius: var(--radius-btn); color: var(--accent); cursor: pointer; }
.set-logo img { max-width: 60%; max-height: 56px; }
.setg .set-co-row > .st { flex: 1 1 160px; }
.set-co-row > .field-in { flex: none; width: 120px; } .set-co-row > select.field-in { width: auto; } .set-co-row > .menu { flex: none; }
/* 11c / A1 — Online payments (Set-Desktop-GettingPaid, Set-Phone-GettingPaid): head + state pill, the Mollie / Stripe
   chips, the two key boxes, Test now first (full width on the phone), the last test line */
.on-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.on-head h3 { margin: 0; }
.on-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.on-last { margin: 0; font-size: 14px; color: var(--ink-muted); } .on-last.bad, .on-bad { color: var(--danger); }
.on-until, .on-where { margin: 0; } .on-where .btn { padding: 0; }
.on-help h4 { margin: 0; }
@media (max-width: 699px) { .on-acts .on-testbtn { flex: 1 1 100%; } }
/* 11c / A2 — the Send screen's fee line (BP7): the line before it is sent + this invoice's own choice, "Use" beside it */
.snd-fee { gap: 6px; } .snd-fee-row { display: flex; align-items: flex-end; gap: 8px; } .snd-fee-row > .field { flex: 1 1 auto; }
.set-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.set-pe { display: flex; white-space: nowrap; } .set-pe span { overflow: hidden; text-overflow: ellipsis; }
.set-plans .on { box-shadow: inset 0 0 0 3px var(--accent); } .set-price { font: 700 28px var(--font-display); }
.set-ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; } .set-ticks li::before { content: "✓  "; color: var(--success); }
/* 11c Part B / B2 — Change plan (Set-Desktop-ChangePlan): the choice left, "What you pay" right; the seller's invoices */
.sub-cp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.sub-pick, .sub-plans, .sub-sum { display: flex; flex-direction: column; gap: 12px; }
.sub-sum { padding: 14px; border-radius: var(--radius-card); background: var(--line-soft); }
.sub-plans .choice-chip > span { display: flex; width: 100%; min-height: 48px; }   /* 11c B review / 2: full-width plan choices */
.sub-sum h4, .sub-done h2 { margin: 0; }
.sub-rows, .sub-invs { list-style: none; margin: 0; padding: 0; }
.sub-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sub-rows .sub-today { border-top: 1px solid var(--line); padding-top: 8px; font-size: 18px; font-weight: 700; }
.sub-invs li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.setf.set-one { columns: 1; }   /* Subscription: every card full width */
.sub-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-done { align-items: center; text-align: center; gap: 12px; } .sub-tick { color: var(--success); }
.sub-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; padding: 14px 16px; border-radius: var(--radius-card); background: var(--st-overdue-bg); color: var(--st-overdue-ink); }
.sub-fail > div:first-child { flex: 1 1 320px; } .sub-fail p { margin: 4px 0 0; } .sub-fail-acts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 699px) { .sub-cp { grid-template-columns: minmax(0, 1fr); } .sub-invs li { flex-wrap: wrap; } }
/* API & MCP keys (step 10a / 1, Plt-Desktop-Keys): the AI card + the keys as columns; phone + tablet (< 1200) a list */
.set-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; } .setg .set-ai > .st { flex: 1 1 240px; }
.ai-i { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: var(--on-accent); }
.set-key { flex-wrap: nowrap; } .set-kh { padding: 0 0 6px; border: 0; font-size: 13px; color: var(--ink-muted); }
.sk-c { flex: 0 0 20%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sk-b { flex: 0 0 104px; text-align: right; }
.set-key.off { color: var(--ink-muted); } .sk-sub { display: none; }
#keys { container-type: inline-size; }   /* 11s / FT: by the card's width — in 11r-f's half column the columns overlapped */
@container (max-width: 699px) { .sk-c, .set-kh { display: none; } .setg .set-key .sk-sub { display: block; } .sk-b { flex-basis: auto; } }
/* Webhooks (step 10a / 3): event · URL · pill; phone: the URL under the event */
.set-hook { flex-wrap: nowrap; color: var(--ink); } .sh-e { flex: 0 0 170px; }
.sh-u { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-muted); }
@media (max-width: 699px) { .set-hook { flex-wrap: wrap; row-gap: 2px; } .sh-e { flex: 1 1 auto; } .sh-u { order: 3; flex-basis: 100%; } }
.sh-st { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; } .sh-st small { color: var(--ink-muted); overflow-wrap: anywhere; }
.sh-log { max-height: 260px; overflow-y: auto; }
.set-wd-find { display: flex; gap: 8px; } .set-wd-find .field-in { flex: 1; min-width: 0; }
.set-wd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px 14px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.set-wd:first-child { border-top: 0; } .set-wd-g, .set-wd-o { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.set-wd.own .set-wd-o .field-in { border-color: var(--accent); } .set-wd-a { display: flex; gap: 6px; flex-wrap: wrap; }
.own-tx, .own-tx-list { display: flex; flex-direction: column; gap: 8px; } .own-tx-more > summary { cursor: pointer; }
.set-wd-n { grid-column: 2; display: flex; gap: 6px 10px; flex-wrap: wrap; } .set-wd-c { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 120px; }
@media (max-width: 699px) { .set-wd { grid-template-columns: minmax(0, 1fr); } .set-wd-n { grid-column: 1; } }
@media (max-width: 1199px) { .setg { grid-template-columns: 220px minmax(0, 1fr); } .setnav-h { display: block; } .setnav .st small { display: none; } .apphead > .set-ph { flex-wrap: nowrap; } }
@media (max-width: 767px) { .setg { display: block; } .setg[data-view=list] .set-page, .setg[data-view=page] .setnav, .main:has([data-view=list]) .apphead, .set-ph .sep { display: none; }
  .set-ph .pre a { margin-right: 20px; font: 600 16px var(--font-body); color: var(--accent); } .set-ph .pre a::before { content: "‹ "; }
  .setnav .st small { display: block; } .setg[data-view=list] .setnav-i.on { background: none; box-shadow: none; }
  .set-bank { order: 1; } .set-look { order: 2; } .setf > .sm-x { order: 3; }
  .set-rights.tbl :is(th, td) { padding-inline: 4px; } }   /* 11r-f / A2: no "More" on the phone either — the extra cards always show */
/* Welcome steps (step 11b / 4, Gro-Desktop-Onboard / Gro-Phone-Onboard): the dark rail + the step; phone: count, bar, Next at the foot */
.wl { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.wl-rail { background: var(--side-bg); color: var(--side-text); padding: calc(28px + var(--safe-top)) 28px 28px calc(28px + var(--safe-left)); display: flex; flex-direction: column; gap: 14px; }
.wl-brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--font-display); color: var(--on-accent); }
.wl-hi { font: 700 24px var(--font-display); color: var(--on-accent); margin: 20px 0 0; } .wl-sub { color: var(--side-muted); margin: 0 0 8px; }
.wl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .wl-steps a { display: flex; align-items: center; gap: 12px; min-height: 42px; color: var(--side-muted); font-weight: 600; }
.wl-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-size: 14px; flex: none; }
.wl-steps .on a, .wl-steps .done a { color: var(--on-accent); } .wl-steps .done .wl-dot { background: var(--green-pop); border-color: var(--green-pop); color: var(--on-accent); }
.wl-main { padding: calc(48px + var(--safe-top)) calc(48px + var(--safe-right)) 32px 48px; max-width: 820px; width: 100%; } .wl-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wl-count { color: var(--ink-muted); font-size: 14px; } .wl-later { background: none; border: 0; font: 600 15px var(--font-body); color: var(--accent); cursor: pointer; min-height: 40px; }
.wl-bar { display: none; gap: 6px; margin: 6px 0 4px; } .wl-bar i { flex: 1; height: 5px; border-radius: 4px; background: var(--line); } .wl-bar i.on { background: var(--accent); }
.wl-form { display: flex; flex-direction: column; gap: 14px; } .wl-h { font: 700 34px var(--font-display); margin: 8px 0 0; } .wl-lead { margin: 0; color: var(--ink-muted); }
.wl-cards { display: grid; gap: 10px; } .wl-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.wl-card > input[type=radio] { position: absolute; opacity: 0; } .wl-card:has(> input:checked) { border-color: var(--accent); background: var(--smart-bg); } .wl-card:focus-within { box-shadow: var(--focus-ring); }
.wl-card b { font-size: 17px; } .wl-lvl { font-size: 14px; } .wl-lvl.full { color: var(--accent); } .wl-lvl.overview { color: var(--st-sent-ink); } .wl-card select { margin: 4px 0; }
.wl-kind { display: flex; gap: 18px; } .wl-none { color: var(--ink-muted); }
.wl-acts { display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; margin-top: 8px; } .wl-acts > a { margin-right: auto; }
@media (max-width: 1199px) { .wl { grid-template-columns: 280px minmax(0, 1fr); } .wl-rail { padding: calc(22px + var(--safe-top)) 22px 22px calc(22px + var(--safe-left)); } .wl-main { padding: calc(36px + var(--safe-top)) calc(28px + var(--safe-right)) 28px 28px; } }
@media (max-width: 1023px) { .wl { display: block; } .wl-rail { display: none; } .wl-main { padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + var(--safe-left)); max-width: none; }
  .wl-bar { display: flex; } .wl-h { font-size: 26px; } .wl-acts { flex-wrap: wrap; } .wl-next { flex: 1 1 100%; order: -1; } }
/* First-day Home (step 11b / 5, Gro-Desktop-FirstHome): close ×, resume the welcome steps, the side column, the app QR */
.hm-x { margin-left: auto; } .hm-wl { margin: 12px 0 0; } .hm-col { display: flex; flex-direction: column; gap: var(--gap-block); }
.hm-qr { width: 120px; height: 120px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); } .hm-phone { display: none; }
@media (max-width: 1023px) { .hm-desk { display: none; } .hm-phone:not([hidden]) { display: block; } }
/* step 11s / P1 — the install steps (ONE set, _install_steps.html: the card, the welcome step, /get-the-app, first-day
   Home). shell.js names the browser on <html data-gs-browser>; only that browser's block shows (no script: all). */
.ins { display: flex; flex-direction: column; gap: 10px; } .ins-for, .ins-is, .ins-pad, .ins-card[hidden] { display: none; }
html:not([data-gs-browser]) .ins-for, html[data-gs-browser="ios-safari"] [data-for="ios-safari"], html[data-gs-browser="ios-chrome"] [data-for="ios-chrome"],
html[data-gs-browser="android"] [data-for="android"], html[data-gs-browser="desktop"] [data-for="desktop"] { display: block; }
html[data-gs-pad] .ins-pad { display: inline; } html[data-gs-pad] .ins-ph, html[data-gs-standalone] .ins .ins-for { display: none; }
html[data-gs-standalone] .ins-is { display: flex; } .ins-dn, html[data-gs-browser="desktop"] .ins-hint, html[data-gs-standalone] .ins-hint { display: none; }
html[data-gs-browser^="ios"]:not([data-gs-standalone]) .ins-dn { display: inline-flex; }
html[data-gs-browser^="ios"]:not([data-gs-standalone]) .ins-nx { display: none; }
.ins-steps { list-style: none; margin: 0; padding: 0; counter-reset: ins; } .ins-st + .ins-st { margin-top: 8px; }
.ins-st { display: grid; grid-template-columns: 176px minmax(0, 1fr); align-items: center; gap: 12px; counter-increment: ins; }
.ins-tx::before { content: counter(ins) ". "; font-weight: 700; }
.ins-pic { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 8px; border-radius: 12px; background: var(--surface-sunk); border: var(--border-hairline); color: var(--blue); }
.ins-g { width: 20px; height: 20px; flex: none; } .ins-to { width: 14px; height: 14px; flex: none; color: var(--ink-faint); }
.ins-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-card); flex: none; }
.ins-row, .ins-key, .ins-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.2; }
.ins-row .ins-g, .ins-bar .ins-g { color: var(--blue); } .ins-key { padding: 4px 14px; border-radius: 999px; color: var(--blue); font-size: 13px; font-weight: 700; }
.ins-sw { flex: none; width: 30px; height: 18px; margin-left: auto; border-radius: 9px; background: var(--chosen-ink); position: relative; }
.ins-sw::after { content: ""; position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); }
.ins-bar { flex: 1; border-radius: 999px; } .ins-bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.ins-one { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; } .ins-one[hidden] { display: none; }
.ins-is { align-items: center; margin: 0; gap: 8px; color: var(--chosen-ink); font-weight: 600; }
html[data-gs-browser="desktop"] .ins-desk { display: flex; gap: 16px; align-items: flex-start; } .ins-desk .field-hint { margin: 0 0 8px; }
.ins-card { margin-bottom: var(--gap-block); } .login-card.gta { max-width: 520px; } .gta h1 { text-align: center; font-size: 22px; } .gta .ins { margin: 0 0 12px; } .ins-again { color: var(--ink); font-weight: 600; margin: 0 0 4px; }
@media (max-width: 420px) { .ins-st { grid-template-columns: 150px minmax(0, 1fr); gap: 10px; } }

/* ════ CHOSEN (step 11r-a / A1 + P4, Dick 2026-11-23): every chosen chip, toggle, segmented choice and the chosen row
   in a sheet is SOFT PINE on every device — light green fill, pine text, a 1.5 px pine-grey line, a 14 px tick before
   the word. Never the Ink fill. Main actions (Save, Send, +) stay solid in the company accent. ONE block, last in the
   file so it wins; gate: scripts/verify_chosen_colours.py. ════ */
.fchip.on, .findchip.on, .tools .tl.on, .viewtoggle .vt.on, .snd-c.on, .sheet-sub a.on, .tmpl-preset-btn[aria-pressed="true"],
.choice-chip input:checked + span, .seg-o input:checked + span, .pay-m input:checked + span {
  background: var(--chosen-bg); color: var(--chosen-ink); border: 1.5px solid var(--chosen-line); box-shadow: none; }
.fchip.on::before, .findchip.on::before, .tools .tl.on::before, .snd-c.on::before, .sheet-sub a.on::before,
.tmpl-preset-btn[aria-pressed="true"]::before, .seg-o input:checked + span::before, .pay-m input:checked + span::before {
  content: ""; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--tick-mask) center / contain no-repeat; mask: var(--tick-mask) center / contain no-repeat; }
.tools .tl.on > svg { display: none; }   /* the tick takes the tool's icon place */

/* ── step 11r-e (A4, A4b): THE PAPER VIEWER (paper_view.html, shell.js gsPaperInit) — the document's real pages as
   sheets on grey, true proportion, a shadow; nothing drawn on them. Desktop: thumbnails left, Fit page = one whole
   page; tablet: pages under each other with a gap; phone: swipe sideways, pinch to zoom. ── */
.pp-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; width: 100%; }
.pp-tools, .pp-zoom, .pp-acts { display: flex; align-items: center; gap: 8px; }
.pp-acts { margin-left: auto; }
.pp-count { min-width: 96px; text-align: center; font: 600 14px var(--font-body); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pp-period { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 12px; }
.pp-period .field-hint, .pp-ptitle { flex: 1 1 100%; margin: 0; }
.pp { display: flex; gap: 16px; padding: 24px 16px; background: var(--pp-ground); border-radius: var(--radius-card); }
.pp-thumbs { display: none; flex: none; flex-direction: column; gap: 12px; width: 104px; position: sticky; top: calc(16px + var(--safe-top)); align-self: flex-start; max-height: calc(100dvh - 32px - var(--safe-top)); overflow: auto; }
.pp-th { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: 8px; background: none; font: 600 12px var(--font-body); color: var(--ink-muted); cursor: pointer; }
.pp-th img { display: block; width: 88px; height: auto; background: var(--pp-sheet); box-shadow: var(--pp-shadow); }
.pp-th.on { border-color: var(--accent); color: var(--ink); }
.pp-stage { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 24px; overflow: auto; outline: none; }
.pp-sheet { flex: none; width: min(100%, 794px); background: var(--pp-sheet); box-shadow: var(--pp-shadow); line-height: 0; page: paper; }
.pp-sheet img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.pp-plain { min-height: 70vh; } .pp-obj { width: 100%; min-height: 70vh; }
@media (min-width: 1200px) { .pp-thumbs { display: flex; } }
@media (max-width: 699px) {
  .pp-bar .pp-back { flex: 1 1 100%; }
  .pp-zoom { display: none; }   /* the phone zooms with two fingers */
  .pp-count { min-width: 0; text-align: left; }
  .pp-acts .btn span { display: none; } .pp-acts .btn.pri span { display: inline; }
  .pp { margin: 0 -16px; padding: 12px 0; border-radius: 0; }
  .pp-stage { flex-direction: row; align-items: flex-start; gap: 16px; padding: 0 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .pp-sheet { scroll-snap-align: center; }
  .pp.is-zoomed .pp-stage { scroll-snap-type: none; }
}
@page paper { margin: 0; }
@media print {
  .side, .tabbar, .tb-timer, .apphead, .pp-thumbs, .pp-period, .toasts { display: none !important; }
  .content, .pp, .pp-stage { padding: 0 !important; margin: 0 !important; background: none !important; overflow: visible !important; display: block !important; }
  .pp-sheet { width: 100% !important; box-shadow: none; break-after: page; }
}
/* Settings › Documents › Paper and margins — the ONLY place with the dotted margin lines and the "20 mm" label */
.pm { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px 24px; align-items: start; }
.pm-sides { display: grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); gap: 8px 12px; }
.pm-page { display: block; width: 200px; height: auto; box-shadow: var(--pp-shadow); }
.pm-sheet { fill: var(--pp-sheet); }
.pm-guide { fill: none; stroke: var(--pp-guide); stroke-width: .8; stroke-dasharray: 2.5 2; }
.pm-text { fill: var(--line); }
.pm-lbl { fill: var(--pp-guide); font: 600 12px var(--font-body); }
.pm-m { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 699px) { .pm { grid-template-columns: minmax(0, 1fr); } .pm-sides { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pm-page { margin: 0 auto; } }

/* ════ 11r-f / A2 (Dick 2026-11-23) — every detail and edit screen FITS 1366 × 768: 2–3 columns, mouse spacing
   (36px fields with a fine pointer, tokens.css), nothing behind "More"; touch keeps 44px. A list inside a screen
   ([data-fit-list]) scrolls in its own box (shell.js gsFit); gate scripts/verify_fit.py. ════ */
[data-fit-on] { max-height: var(--fit-h); overflow-y: auto; overscroll-behavior: contain; }
.co-hub .branding-block .ib-ctl select.ctl { height: var(--h-field); }   /* part 2: the company page's theme picker, the one field height */
.setf .ed-2.set-stack { grid-template-columns: minmax(0, 1fr); }   /* part 2: fields that stack on every width (their values read whole) */
@media (pointer: fine) {
  .field { gap: 4px; }
  .choice legend { margin-bottom: 4px; }
  .choice-chip > span { min-height: var(--h-chip); padding: 0 14px; }
  .rtab { min-height: var(--h-btn); }
  input.ctl, select.ctl, .fblock .ctl { height: var(--h-field); }
  .ed-b, .ed-grid, .ed-col { gap: 10px; } .ed-2 { gap: 10px; }
  .ed-b h3, .rdet-b h3, .cp-head h3, .year-card h3 { font-size: 18px; }
  .rec, .rec-main, .rec-side { gap: 12px; }
  .kv, .year-card dl > div { padding: 4px 0; }
  .cbtns { margin-top: 12px; }
  .cbtn { min-height: var(--h-btn); }
}
@media (pointer: fine) and (min-width: 1024px) { .content { padding-top: 12px; } }
@media (min-width: 1024px) { .content .rtabs { flex-wrap: wrap; } }   /* every tab in sight — a long row wraps, never hides one off the side */
/* Settings from 1200 px: the menu without its second lines (as under 1200), the page's cards in two columns */
@media (min-width: 1200px) {
  .setg { grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
  .setnav .st small { display: none; }
  .setnav-i { padding: 6px 10px; gap: 10px; }
  .setf { display: block; columns: 2; column-gap: 12px; }
  .setf .setf { display: contents; }   /* a page's form inside the page's cards (VAT & money, Connections): its cards join the same two columns */
  .setf .set-wide { column-span: all; }   /* a card that needs the page's whole width (Your way's custom fields) */
  .setf .set-whole { break-inside: avoid; }   /* a card that reads best in one piece */
  .setf .set-col2 { break-before: column; }   /* a card that starts the second column */
  .setf .pm { grid-template-columns: minmax(0, 1fr) 140px; gap: 12px 16px; }   /* paper and margins in half the page */
  .setf .pm-page { width: 140px; }
  .setf .pm-sides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Your data › Backups (the whole width): the archives left, the nightly runs right */
  .setf #backups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; align-items: start; }
  .setf #backups > * { margin: 0; grid-column: 1; }
  .setf #backups > :is(.set-ch, #bkNightly) { grid-column: 1 / -1; }
  .setf #backups > #runs { grid-column: 2; grid-row: 3 / span 2; }
  /* People & rights: the people beside the rights, the rights' words on one line each where they can */
  .setf.set-people { display: grid; columns: auto; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; align-items: start; }
  .setf.set-people > * { margin-bottom: 0; }
  .set-people .set-pe { flex-wrap: wrap; white-space: normal; }   /* the whole address, the "not active" under it when it must */
  .set-people .set-pe span { overflow: visible; overflow-wrap: anywhere; }
  .set-people .set-co-row { flex-wrap: nowrap; }
  .set-rights.tbl :is(th, td) { padding: 4px 6px; }   /* 11g: + "Manage resources" — one row more, still one screen */
  .set-rights .std-perm, .set-rights .std-perm-h { width: 58px; }
  /* the older SMTP: the sender's name and address read whole, the user name wide, host · port · security in one row */
  #smtp .ed-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #smtp .ed-2 > .field:nth-child(-n+2) { grid-column: 1 / -1; }
  #smtp .ed-2 > .field:nth-child(3) { grid-column: span 2; }
  .setf > * { margin-bottom: 12px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }   /* a long card goes on at the top of the next column */
  .setf :is(.field, .ed-2, .choice, h3, .ed-mh, tr, .set-co-row, .pm, .cfg-tbl, table) { break-inside: avoid; }
  .setf :is(h3, .ed-mh, .ed-sub) { break-after: avoid; }
  .setf > .ed-b, .setf > .ed-b > .ed-b { display: block; }   /* a flex card does not split over two columns; a block one does */
  .setf > .ed-b > * + *, .setf > .ed-b > .ed-b > * + * { margin-top: 10px; }
  .setf > .card, .set-page > .card { padding: 14px 16px; }
}
@media (pointer: coarse) {
  input.ctl, select.ctl, .fblock .ctl { height: 44px; }
  .choice-chip > span, .rtab { min-height: 44px; }
  /* every target ≥ 44 px on touch (also a touch-screen laptop): menu items, the tab pin, a smart note's Undo / Change,
     a text button, a tick box's label, a tag's ×, the "In other languages" line, a module row in Your way */
  .menu-pop .mi, .smart-note .sn-undo, .md-item { min-height: 44px; }
  .tl-edit summary { display: flex; align-items: center; min-height: 44px; }
  .rtab-pin { height: 44px; }
  .link-btn, .own-tx-more > summary { display: inline-flex; align-items: center; min-height: 44px; }
  label.ed-check, label.ctl-check, label.check-item { display: inline-flex; align-items: center; min-height: 44px; }
  .taglabel [data-untag] { min-width: 44px; min-height: 44px; margin: -10px -12px -10px -6px; }
}
.ed-dk, .cp-thead { display: none; }
.ed-sub2 { margin: 2px 0 0; font: 600 var(--text-label) var(--font-body); color: var(--label-ink); }
.ed-mh { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ed-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
@media (min-width: 1024px) {
  /* the relation edit screen in three parts (Who and where · Contact persons · Business and extra fields), each part
     its blocks side by side */
  .ed-tabs.ed-dk { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-btn); background: var(--line-soft); align-self: flex-start; }
  .rel-edit .ed-b.ed-off { display: none !important; }
  /* 11r-f part 2: a Settings page in parts — one part at a time under its tabs (_components.set_parts) */
  .set-parts { margin-bottom: 12px; }
  .setg [data-part].sp-off { display: none !important; }
  .rel-edit .ed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rel-edit .ed-col { display: contents; }
  .rel-edit [data-eblock="persons"] { grid-column: 1 / -1; }
  .rel-edit { gap: 8px; }
  .rel-edit .ed-grid { gap: 8px 12px; }
  .rel-edit .ed-b { padding: 12px 16px; gap: 8px; }
  .rel-edit .ed-b h3 { line-height: 1.15; }
  .rel-edit .ed-check { margin-top: 2px; }
  .start-cards { gap: 10px; }
  .start-card { padding: 8px 12px; gap: 10px; }
  .start-card .sc-ic { width: 32px; height: 32px; }
  .ed-21 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  /* contact persons: one row per person under one row of column names; the note on a second line under email ·
     phone · mobile, its label beside it (11r-f part 2: wide enough for the whole value) */
  .cp-thead, .cp-row { display: grid; grid-template-columns: 1.1fr .9fr 1.7fr 1fr 1fr 44px; column-gap: 10px; }
  .cp-thead span { font-size: var(--text-label); color: var(--label-ink); }
  .cp-row { align-items: start; padding: 6px 0; border-top: 0; row-gap: 4px; }
  .cp-row > .ed-2 { display: contents; }
  .cp-row-h { grid-column: 6; grid-row: 1; margin: 0; justify-content: center; }
  .cp-row-t { display: none; }
  .cp-row .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cp-row [data-cp-other] { grid-column: 2; grid-row: 2; }
  .cp-note-f { grid-column: 3 / span 3; grid-row: 2; }
  .cp-note-f > .field { flex-direction: row; align-items: center; gap: 10px; }
  .cp-row .cp-note-f > .field > label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .cp-note-f > .field > .field-in { flex: 1; min-width: 0; }
}
@media (min-width: 1200px) {
  /* the relation edit screen's parts, three columns: Who | Contact + Address | Second address — Business | More */
  .rel-edit .ed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rel-edit [data-eblock="who"] { grid-column: 1; grid-row: 1 / span 2; }
  .rel-edit [data-eblock="contact"] { grid-column: 2; grid-row: 1; }
  .rel-edit [data-eblock="address"]:not(.ed-sec) { grid-column: 2; grid-row: 2; }
  .rel-edit .ed-sec { grid-column: 3; grid-row: 1 / span 2; }
  .rel-edit [data-eblock="persons"] { grid-row: 1; }
  .rel-edit [data-eblock="business"] { grid-column: 1; grid-row: 1; }
  .rel-edit [data-eblock="more"] { grid-column: 2 / span 2; grid-row: 1; }
  /* the relation page: identity · contact persons · money in one row, then the tabs and the open tab full width */
  .rec-rel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(230px, 260px); grid-template-areas: "card pers side" "tabs tabs side" "pane pane pane"; gap: 8px 14px; }
  .rec-rel > .rec-main { display: contents; }
  .rec-rel .rec-card { grid-area: card; align-self: stretch; }
  .rec-rel .cp-card { grid-area: pers; align-self: stretch; }
  .rec-rel:not(:has(.cp-card)) .rec-card { grid-column: 1 / 3; }
  .rec-rel > .rec-side { grid-area: side; }
  .rec-rel .rtabs { grid-area: tabs; }
  .rec-rel .rpane { grid-area: pane; }
  .rec-rel .rec-card .av-lg { display: none; }
  .rec-rel .rc-id { gap: 6px; }
  .rec-rel .cbtns { gap: 6px; }
  .rec-rel .cbtn { padding: 0 10px; gap: 6px; }
  .rec-rel .merge-note { margin-top: 10px; padding: 6px 10px; }
  .rec-rel .cp-head { margin-bottom: 6px; }
  .rec-rel .cp-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; }
  .rec-rel .cp-head { margin-bottom: 4px; }
  .rdet-b { padding: 12px 14px; }
  .rdet-b h3 { margin-bottom: 4px; }
  .rdet-b .kv { padding: 1px 0; flex-wrap: wrap; gap: 0 12px; }
  .rdet-b .kv dd { margin-left: auto; overflow-wrap: normal; }
  .rdet-b .tag-add { margin-top: 4px; }
  .rdet-b .audit-box { border: 0; background: none; padding: 4px 0 0; }
  .rdet-b .audit-row { gap: 0 6px; flex-wrap: wrap; }
  .rdet-b .audit-v { font-family: var(--font-body); }
  .rec-rel .rec-card, .rec-rel .cp-card { padding: 14px 16px; }
  .rec-rel .cp-p .av { display: none; }
  .rec-rel .cp-route { font-size: 12px; }
  .rdet-more .ed-mh .field-hint { display: none; }   /* open, the hint naming what is inside says nothing more */
  /* money: the two cards read as one */
  .rec-rel > .rec-side { gap: 0; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--pad-card); align-self: stretch; }
  .rec-rel > .rec-side > .card { background: none; box-shadow: none; padding: 0; border-radius: 0; }
  .rec-rel > .rec-side > .card + .card { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .rec-rel .oc-n { font-size: 28px; margin: 2px 0; }
  .rec-rel .year-card h3 { margin-bottom: 2px; }
  .rec-rel .year-card dl > div { padding: 3px 0; }
  /* Details: Who · Contact (+ More details, the people under it) · Address (+ map) · Business */
  /* the blocks flow through four columns like a newspaper — a long block continues at the top of the next column
     (its card repeats its edges), so a fully filled relation still fits */
  .rdet-grid { display: block; columns: 4; column-gap: 12px; }
  .rdet-grid > .rdet-b { box-decoration-break: clone; -webkit-box-decoration-break: clone; margin-bottom: 8px; }
  .rdet-b h3 { break-after: avoid; }
  .rdet-b .kv, .rdet-b .rdet-map, .rdet-b .audit-box, .rdet-b .tag-add, .rdet-people li, .rd-adr, .rd-con { break-inside: avoid; }
  .rdet-map { height: 76px; margin-top: 4px; }
  .rdet-b h3 { font-size: 17px; }
  .rdet-more .audit-box { min-width: 0; margin-top: 6px; }
  /* 11r-f part 2: the product page — the stock card beside the header card, the tabs and the open tab full width;
     Details in three columns + a wide fourth for the rate card (its unit, price and cost read whole) */
  .rec-prod > .rec-main { display: contents; }
  .rec-prod > .rec-main > * { grid-column: 1 / -1; }
  .rec-prod > .rec-main > .pc-card { grid-column: 1; }
  .rec-prod > .rec-side { grid-column: 2; grid-row: 1; }
  .rdet-grid.pdet-grid { display: grid; columns: auto; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2.2fr); grid-auto-flow: row dense; gap: 10px 12px; align-items: start; }
  .pdet-grid > .rdet-b { margin: 0; }
  .pdet-grid td.cfg-rate { width: 5.25rem; }
  /* a project's Tasks tab: the task's name gets the room, Save and Archive side by side */
  /* the company page (/companies/<id>/, GAP-236): its fields are the Details tab beside its records */
  .co-hub .co-det { flex: none; padding: 10px 16px 8px; gap: 10px 20px; }
  /* the columns sized for what they hold: a postcode, an email beside its mail button, a whole IBAN */
  .co-hub .rel-left { gap: 10px 16px; grid-template-columns: minmax(0, 226fr) minmax(0, 232fr) minmax(0, 300fr); }
  .reldetail.co-hub .rel-top { grid-template-columns: minmax(0, 1fr) 220px; }
  .co-hub .fblock .pair > span.narrow { flex: .8; }   /* a whole postcode */
  /* editing: the registration's type joins the VAT row (fiscal type · registration · its type · company no.), a new
     registration opens from its button; the theme picker within the rail */
  .co-hub.mode-edit .fb-vat { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .6fr); gap: 6px 16px; align-items: start; }
  .co-hub.mode-edit .fb-vat > .vat-row { display: contents; }
  .co-hub.mode-edit .fb-vat > :is(.fblock-h, .alert) { grid-column: 1 / -1; grid-row: 1; }
  .co-hub.mode-edit .fb-vat > .alert { grid-row: auto; }
  .co-hub.mode-edit .fb-vat > .vat-row > :last-child { order: 2; }
  .co-hub.mode-edit .fb-vat > .fb-f.det-edit:not(.co-newreg) { order: 1; }
  .co-hub.mode-edit .fb-vat > .fb-f.det-edit:not(.co-newreg) > label .muted { display: none; }   /* Settings › VAT & money says it in full */
  .co-hub.mode-edit .fb-vat > .co-newreg { grid-column: 3 / -1; grid-row: 1; justify-self: end; margin: 0; }   /* the button on the block's title line */
  .co-hub.mode-edit .fb-vat > .co-newreg[open] { grid-column: 1 / -1; grid-row: auto; order: 3; justify-self: stretch; }
  .co-hub .co-newreg > summary { list-style: none; width: max-content; }
  .co-hub .co-newreg[open] > .vat-row { display: flex; gap: 10px; margin-top: 6px; }
  .co-hub.mode-edit .kpi-block { display: none; }   /* while editing, the counts (also on the tabs) make room for the logo pickers */
  .co-hub .branding-block .ib-ctl { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
  .co-hub .branding-block .ib-ctl select { width: 100%; min-width: 0; max-width: 140px; height: var(--h-field); }
  .co-hub .branding-block .logo-row { gap: 6px; margin-top: 4px; }
  .co-hub .kpi-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }   /* the counts two by two */
  .co-hub .detail-side { gap: 8px; }
  .co-hub .detail-side .hblock { padding-block: 8px; }
  .co-hub .detail-side .hb-row { min-height: 0; padding-block: 2px; }
  .co-hub .branding-block .co-logo-img { max-height: 32px; }
  /* Bank (two lines, like Legal and Contact) in the first row, the four links (as many lines as an address) under it */
  .co-hub .fb-legal { grid-column: 3; grid-row: 2; }
  .co-hub .fb-social { grid-column: 3; grid-row: 3; }
  .main:has(.co-hub) .area-tabs { flex-wrap: nowrap; }   /* the Settings places in one row above the company */
  .main:has(.co-hub) .area-tabs .rtab { padding-inline: 12px; }
  .co-hub > .reltabs:has(> .co-det:not([hidden])) { flex: none; }
  .rec.rec-proj { grid-template-columns: minmax(0, 1fr) 300px; }   /* the money card narrower: the tabs' tables wider */
  [data-rpane="tasks"] .tbl td:first-child { width: 40%; }
  [data-rpane="tasks"] .tbl td.log-actions { width: 1%; white-space: nowrap; }
  .pdet-grid > .rdet-wide { grid-column: auto; }
  .pdet-grid > #rates { grid-column: 4; grid-row: 1 / span 3; }
}
/* the document screen (quote · order · invoice): head + all its fields, then the lines (they scroll in their box) on the
   left; the payments, the next step, the preview and the activity (two tabs) on the right. Under 1200 px one column in
   the old order. */
.sd-vtabs { display: none; }
@media (max-width: 1199px) {
  .sdoc-grid { display: flex; flex-direction: column; align-items: stretch; }
  .sdoc-main, .sdoc-side { display: contents; }
  .sdoc-grid .sdoc-head { order: 1; } .sdoc-grid .sdoc-pay { order: 2; } .sdoc-grid .sdoc-lines { order: 3; } .sdoc-grid .sdoc-more { order: 4; }
  .sdoc-grid .sdoc-act { order: 5; } .sdoc-grid .sdoc-next, .sdoc-grid .sdoc-money { order: 6; } .sdoc-grid .sdoc-preview { order: 7; }
}
@media (min-width: 1200px) {
  .sdoc-grid { grid-template-columns: minmax(0, 1fr) clamp(250px, 19vw, 360px); }
  .sdoc-grid .sdoc-head { order: 1; } .sdoc-grid .sdoc-more { order: 2; } .sdoc-grid .sdoc-lines { order: 3; }
  /* the lines card: the add row and the totals side by side under the lines */
  .sdoc-grid .sdoc-lines { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); column-gap: 24px; align-items: start; }
  .sdoc-grid .sdoc-lines > * { grid-column: 1 / -1; }
  .sdoc-grid .sdoc-lines > .sl-add-row { grid-column: 1; }
  .sdoc-grid .sdoc-lines > .sl-totals { grid-column: 2; width: auto; margin-left: 0; }
  .sdoc-side .sdoc-pay .sp-top { flex-wrap: wrap; }
  .sd-vtabs { display: inline-flex; align-self: flex-start; }
  .sdoc-side .vw-off { display: none; }
  .sdoc-side .sp-fit { width: 100%; margin: 0 auto; flex: none; }   /* narrower when the window leaves less room (sales_doc.js fitPreview) */
  .sl-progress { margin-bottom: 2px; }
  .sl-head { padding-bottom: 4px; }
  .sdoc-grid .sl-head, .sdoc-grid .sl-row { grid-template-columns: minmax(0, 1fr) 64px 48px 88px 64px 88px 32px; gap: 8px; }
  .sdoc:not(.is-editable) .sdoc-grid .sl-head, .sdoc:not(.is-editable) .sdoc-grid .sl-row { grid-template-columns: minmax(0, 1fr) 52px 48px 84px 52px 92px; }
  .sl-tick { width: 32px; height: 36px; }
  .sd-vtabs ~ .sdoc-preview .sp-head h2 { display: none; }   /* the tab says it */
  /* 11r-f part 2: the second column wider — VAT treatment's "Not set — needs review" and a quote's down payment
     (the tick, the amount under it) read whole */
  .sm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
  .sm-grid .sm-dp { flex-direction: column; align-items: stretch; gap: 4px; }
  .sm-grid .sm-dp .field-in { flex: none; }
  .sm-grid .sm-wide { grid-column: span 3; }
  .sdoc[data-kind="estimate"] .sm-grid .sm-wide { grid-column: span 2; }   /* a quote has two more fields (down payment, acceptance) */
  .sdoc > .chain { margin-bottom: 8px; }
  .sdoc-grid .sdoc-head { padding-top: 12px; } .sdoc-grid .sdoc-lines { padding-top: 12px; padding-bottom: 12px; }
  .st-total { padding-top: 4px; }
  .sm-grid textarea.field-in { min-height: var(--h-field); padding: 7px 12px; field-sizing: content; }   /* grows with its text */
  .sdoc-head .smart-note { margin-top: 8px; padding: 4px 12px; min-height: 36px; }
  .sh-client { position: relative; }
  .sh-client > .link-btn { position: absolute; top: 0; right: 0; line-height: 1.2; }   /* "+ New client" on the label's line */
  .sm-grid select.field-in { padding: 0 4px 0 10px; }
  /* the head and its fields read as ONE card */
  .sdoc-main > .sdoc-head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding-bottom: 8px; }
  .sdoc-main > .sdoc-more { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: calc(-1 * var(--gap-card)); padding-top: 8px; }
  .sl-add-row { margin-top: 8px; }
  .sdoc-grid .sl-totals { margin-top: 4px; gap: 0; }
  .sl-row { padding: 4px 0; }
  /* the purchase order: the lines (the form) wide on the left, the help beside it */
  .po-grid { grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 12px; }
  .chain-line { margin-bottom: 10px; }
}
@media (pointer: fine) { .sl-in { height: var(--h-field); } }
@media (pointer: coarse) { .sl-in { height: 44px; } }
/* every older form's field (config_form .form) is one height too: 36 with a mouse, 48 on touch (--h-field) */
.form :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
  input[type=tel], input[type=url], select) { height: var(--h-field); padding-top: 0; padding-bottom: 0; }
.sdoc .line-vat { height: var(--h-field); }
/* the fields that read as text (the receipt check, the supplier invoice lines), the title field, the text toolbar and
   the small sidebar fields of the older detail screens — the same one height */
.ck-v, .ck-rate, .si-desc, .si-n, .si-pick, .title-input.ctl, .co-nav-select.ctl,
.proddetail .info-block .hb-row .ib-ctl .ctl { height: var(--h-field); min-height: 0; padding-top: 0; padding-bottom: 0; }
.rte-size, .rte-b { height: var(--h-field); min-width: var(--h-field); }
@media (pointer: coarse) { .ck-v, .ck-rate, .si-desc, .si-n, .si-pick, .title-input.ctl, .co-nav-select.ctl, .rte-size, .rte-b,
  .proddetail .info-block .hb-row .ib-ctl .ctl { height: 44px; min-width: 44px; } }
/* the product's edit screen: the own fields under the description, three across (were one long column under Pricing) */
@media (min-width: 1200px) {
  /* a person (Settings › People › a user, My profile): the signature beside Account + Contact, Social over Appearance
     beside the two addresses — no fourth row */
  .reldetail .rel-top:has(> .rel-left > .fb-sig) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 24px; }
  .rel-top:has(> .rel-left > .fb-sig) .rel-left .rt-head + .fblock { margin-top: 0; }
  .rel-top:has(> .rel-left > .fb-sig) > .rel-left { display: contents; }
  .rel-top:has(> .rel-left > .fb-sig) > .detail-side { grid-column: 4; grid-row: 1 / span 2; }
  .rel-top .rel-left > .fb-sig { grid-column: 4; grid-row: 3; }
  .rel-top:has(> .rel-left > .fb-sig) .rt-head { grid-column: 1 / 4; }
  /* the new-product form: its own fields across the whole width, four to a row */
  .module-products .prod-main .pb-cfall { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
  .module-products .prod-main .pb-cfall > .fblock-h { grid-column: 1 / -1; }
  .page-form .module-products .prod-main { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; }
  .page-form .module-products .prod-main .pb-desc { grid-column: 1 / 3; grid-row: 1; }
  .page-form .prod-main .pf-price { grid-column: 3; grid-row: 1; }
  .page-form .prod-main .pf-notes { grid-column: 4; grid-row: 1; }
  .page-form .prod-main .pf-inv { grid-column: 1 / 3; }
  .page-form .prod-main .pf-dims { grid-column: 3 / 5; }
  .page-form .prod-main .pf-dims { flex-direction: row; flex-wrap: wrap; column-gap: 7px; }
  .page-form .prod-main .pf-dims > .fblock-h { flex-basis: 100%; }
  .page-form .prod-main .pf-dims > .cfg-line { flex: 3 1 0; flex-wrap: nowrap; } .page-form .prod-main .pf-dims > .cfg-line + .cfg-line { flex: 2 1 0; }
  .page-form .prod-main .pf-dims .cfg-line > .fb-f { min-width: 0; }
  .page-form .form { margin-top: 0; padding: 12px 18px; }
  /* the receipt check without a picture: the values left, the client / project and the description right */
  .ck-wrap.no-doc { grid-template-columns: minmax(0, 1fr); }
  .ck-wrap.no-doc .ck-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .ck-wrap.no-doc .ck-col > :not(.ck-card) { grid-column: 1 / -1; }
  .ck-wrap.no-doc .ck-col > .ck-card:first-of-type { grid-row: span 2; }
  .ck-col { gap: 10px; }
  .page-form .prod-main .pb-desc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 7px; align-content: start; }
  .page-form .prod-main .pb-desc > :not(:nth-last-child(-n+2)) { grid-column: 1 / -1; }
  .page-form .form .fb-f > label { margin-top: var(--gap-field); }
  .fb-sig .rte-bar, .fb-sig [class*="rte-tool"] { flex-wrap: wrap; }
  .module-products .prod-main .pb-side { display: contents; }
  .module-products .prod-main .pb-price { grid-column: 3; grid-row: 1; }
  .module-products .prod-main:has(> .pb-inv) .pb-price { grid-row: 1 / span 2; }   /* Inventory + Physical tuck in beside it */
  /* the right column (identity · margin · images) runs on beside the Notes / Suppliers / … tabs below */
  .reldetail.proddetail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .reldetail.proddetail > * { grid-column: 1 / -1; }
  .reldetail.proddetail > .rel-top { display: contents; }
  .reldetail.proddetail > .rel-top > .prod-left { grid-column: 1; }
  .reldetail.proddetail > .rel-top > .prod-side { grid-column: 2; grid-row: span 2; }
  .reldetail.proddetail > .reltabs { grid-column: 1; }
  .module-products .prod-main .pb-custom { grid-column: 1 / 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; align-content: start; }
  .module-products .prod-main .pb-custom > .fblock-h { grid-column: 1 / -1; }
}

/* ── Import (step 11d / A: Imp-*-Start · Gro-Desktop-Import · Imp-*-Check · Imp-Desktop-Done · Imp-Phone-Contacts) ── */
.imp { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.imp-intro h2 { font-size: 22px; margin: 0 0 4px; }
.imp-tiles { display: grid; gap: 12px; margin-top: 14px; }
.imp-tile { display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); color: inherit; text-decoration: none; }
a.imp-tile:hover { border-color: var(--accent); }
.imp-tile .st, .imp-who .st { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-tile small, .imp-who small, .imp-wl { color: var(--ink-muted); font-size: 13px; }
.imp-ti { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.imp-other { border-style: dashed; background: transparent; }
.imp-ph { display: none; }
.imp-row form { margin: 0; }
.imp-2 { display: grid; gap: 16px; align-items: start; }
.imp-2 > * { min-width: 0; }
.imp-tw { overflow-x: auto; max-width: 100%; }
.imp-crow { display: grid; grid-template-columns: minmax(90px, 1fr) 16px minmax(150px, 1.3fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.imp-cn { font-weight: 600; overflow-wrap: anywhere; }
.imp-ar { color: var(--ink-muted); }
.imp-crow select.on { border-color: var(--accent); background: var(--smart-bg); }
.imp-eg { color: var(--ink-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-also .set-co-row { display: flex; justify-content: space-between; gap: 8px; color: inherit; text-decoration: none; }
.imp-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
.imp-all { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.imp-list { padding: 4px 16px; }
.imp-r { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.imp-r:first-child { border-top: 0; }
.imp-hd { display: none; }
.imp-who { display: flex; gap: 10px; align-items: center; }
.imp-wh { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.imp-prob .imp-who b { color: var(--ink-muted); }
.imp-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-seg .seg-o { position: relative; flex: 1 1 auto; }
.imp-seg .seg-o span { justify-content: center; width: 100%; min-height: 44px; white-space: nowrap; }
.imp-tk { flex: none; width: 22px; height: 22px; }
.imp-end { display: flex; justify-content: flex-end; }
.imp-figs { display: grid; gap: 12px; }
.imp-fig { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; }
.imp-fig b { font-size: 26px; font-family: var(--font-num); }
.imp-fig span { color: var(--ink-muted); font-size: 14px; }
/* THE import drop zone (_import_drop.html, 11d Part B review 2): dropped or chosen files are read at once. The file
   input stays inside, visually hidden but focusable (keyboard + the phone's picker). */
label.imp-drop { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 0; font-weight: 400; padding: 26px 18px; border: 2px dashed var(--line); border-radius: var(--radius-card); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.imp-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.imp-drop:hover, .imp-drop.on, .imp-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.imp-drop small { color: var(--ink-muted); font-size: 13px; }
.imp-dri { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.imp-dst { font-weight: 600; color: var(--accent); }
.imp-dst:empty { display: none; }
.imp-drop[aria-busy="true"] { pointer-events: none; opacity: .75; }
/* The open-invoices preview (11d Part B review 1): fits its card — number, date, total and the pill never wrap, a
   client name takes at most two lines; on the phone a card per invoice (below). */
table.tbl.imp-iv th, table.tbl.imp-iv td { padding-left: 10px; padding-right: 10px; }
.imp-iv .imp-ivn, .imp-iv .imp-ivd, .imp-iv .imp-ivt { white-space: nowrap; }
.imp-iv .imp-ivc span { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.imp-iv .imp-ivs { width: 1%; }
.imp-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.imp-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.imp-pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
@media (max-width: 767px) {
  .imp-ph { display: revert; }
  .imp-dt { display: none; }
  .imp-phone-first { order: -1; }
  .imp-crow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); row-gap: 2px; }
  .imp-ar { display: none; }
  .imp-eg { grid-column: 1 / -1; }
  .imp-end .btn { flex: 1; justify-content: center; }
  table.tbl.imp-iv, table.tbl.imp-iv tbody { display: block; }
  table.tbl.imp-iv thead { display: none; }
  table.tbl.imp-iv tbody { display: grid; gap: 8px; }
  table.tbl.imp-iv tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n s" "c c" "d t"; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-card); }
  table.tbl.imp-iv tbody tr td { padding: 0; border: 0; background: none; }
  table.tbl.imp-iv .imp-ivn { grid-area: n; } table.tbl.imp-iv .imp-ivs { grid-area: s; width: auto; }
  table.tbl.imp-iv .imp-ivc { grid-area: c; font-weight: 600; } table.tbl.imp-iv .imp-ivd { grid-area: d; color: var(--ink-muted); }
  table.tbl.imp-iv .imp-ivt { grid-area: t; }
}
@media (min-width: 768px) {
  .imp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .imp-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .imp-fig { flex-direction: column; gap: 4px; }
}
@media (min-width: 1024px) { .imp-2 { grid-template-columns: minmax(0, 1fr) 300px; } .imp-2.imp-2w { grid-template-columns: minmax(0, 1fr); } }
/* Open invoices: the settings cards stack ABOVE the preview up to 1279; from 1280 a narrow left column, the preview
   takes the rest (11d Part B review 1). */
@media (min-width: 1280px) { .imp-2.imp-2w { grid-template-columns: 280px minmax(0, 1fr); } }
@media (min-width: 1200px) {
  .imp-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 16px; align-items: center; }
  .imp-hd { display: grid; color: var(--ink-muted); font-size: 13px; font-weight: 600; }
  .imp-seg { flex-wrap: nowrap; }
  .imp-seg .seg-o span { min-height: 36px; padding: 6px 12px; }
}
/* Recommend Gestano (11e / A3 — Rec-Desktop-Recommend, Rec-Phone-*; rcm-, never rec- = the record layout) */
.rcm { display: grid; gap: 16px; align-items: start; } .rcm > * { min-width: 0; }
.rcm-head { display: flex; gap: 12px; } .rcm-head p, .rcm-months { margin: 0; }
.rcm-ai { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.rcm-box { display: flex; gap: 8px; align-items: center; margin-top: 14px; } .rcm-box .field-in { flex: 1; min-width: 0; }
.rcm-acts, .rcm-ask-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.rcm-change { margin-top: 14px; } .rcm-change summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.rcm-r { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.rcm-r .st, .rcm-tile .st { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rcm-r small, .rcm-tile small { color: var(--ink-muted); font-size: 13px; }
.rcm-tile { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; } a.rcm-tile:hover { border-color: var(--accent); }
.rcm-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--st-paid-bg); color: var(--st-paid-ink); }
.rcm-ask .rcm-ai { background: var(--surface); } .rcm-at { flex: 1 1 280px; min-width: 0; } .rcm-at p { margin: 4px 0 0; }
.rcm-ask-acts { margin: 0; }
.su-ref { display: flex; align-items: center; gap: 6px; margin: 0 0 .4rem; color: var(--accent); font-weight: 600; }
@media (max-width: 767px) { .rcm-acts .rcm-wa { flex: 1 1 100%; justify-content: center; }
  .rcm-r { flex-direction: column; align-items: stretch; } .rcm-r .pill { justify-content: center; } .rcm-ask-acts { flex: 1 1 100%; } .rcm-ask-acts .btn { flex: 1; justify-content: center; } }
@media (min-width: 1280px) { .rcm { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
/* The accountant (11e Part B — Acc-*-Invite, Acc-*-Clients, Acc-*-Ask, Par-Desktop-*; acv- = the accountant's view) */
.acc-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.acc-who .st, .acv .st, .acc-q .st, .par-r .st { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.acc-who small, .acv small, .acc-q small, .par-r small { color: var(--ink-muted); font-size: 13px; }
.acc-who form, .par-acts form { margin: 0; } .par-acts { display: flex; gap: 8px; }
.acc-h { margin: 14px 0 6px; font-size: 14px; }
.acc-lately { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.acc-lately li { display: flex; gap: 10px; } .acc-lately .mono { flex: none; min-width: 110px; color: var(--ink-muted); }
.acc-inv { display: flex; gap: 8px; } .acc-inv .field-in { flex: 1; min-width: 0; }
.acc-may { display: grid; gap: 6px; } .acc-save { display: flex; justify-content: flex-end; }
.acv { display: grid; gap: 16px; align-items: start; }
.acv-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-card); background: var(--surface); }
.acv-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.acv-cap { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ink-muted); }
.acv-c, .acv-c > a { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius-field); color: inherit; text-decoration: none; }
.acv-c > a { flex: 1; padding: 0; } .acv-c.on { background: var(--accent-soft); } .acv-c form { margin: 0; }
.acv-me { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.acv-main { display: grid; gap: 16px; min-width: 0; }
.acv-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.acv-tabs a { padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface); color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; }
.acv-tabs a.on { background: var(--accent); color: var(--on-accent); }
.acv-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acv-fig { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; } .acv-fig b { font-size: 24px; font-family: var(--font-num); } .acv-fig span { color: var(--ink-muted); font-size: 14px; }
.acc-q, .par-r { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.qa-th { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; }
.qa-th li { display: flex; gap: 10px; } .qa-th p { margin: 2px 0 0; white-space: pre-wrap; } .qa-th small { color: var(--ink-muted); }
.qa-th li.qa-me > div { background: var(--smart-bg); border-radius: var(--radius-field); padding: 6px 10px; }
.qa-f { display: grid; gap: 6px; } .qa-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.par-card { max-width: 560px; } .par-kicker { margin: 0; color: var(--accent); font-weight: 600; }
.par-ticks { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.acv-fig small { color: var(--ink-muted); font-size: 13px; }
.web-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .web-3 .acv-fig { padding: 6px 0; }
.web-grid { display: grid; gap: 12px; margin-top: 12px; } .web-grid > .card { min-width: 0; margin: 0; }
.web-tbl td:first-child { overflow-wrap: anywhere; }   /* step 12 / A6 (W2): break-word does not lower a table cell's min width — a long source or page name pushed the phone page 4 px wide */ .web-tbl th.n, .web-tbl td.n { width: 1%; white-space: nowrap; } .web-all { display: inline-block; margin-top: 6px; font-weight: 600; }
table.tbl.web-tbl th, table.tbl.web-tbl td { padding-left: 8px; padding-right: 8px; } table.tbl.web-tbl th { letter-spacing: .02em; }
@media (min-width: 1200px) { .web-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); } }
@media (min-width: 768px) { .acv-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .acv.acv-open { grid-template-columns: 280px minmax(0, 1fr); } .acv:not(.acv-open) { max-width: 560px; } }
@media (max-width: 1023px) { .acv-open .acv-list { display: none; } }
/* 11f-v: "Already booked" (held save) · the review's VAT line · Booked without an expense */
.ck-already { margin: 0 0 .75rem; } .ck-already p { margin: 0; } .ck-already-do { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px !important; }
.si-vatline { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.noexp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px; margin-bottom: 8px; }
.noexp-what { display: flex; flex-direction: column; min-width: 0; } .noexp-do { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .noexp-do form { margin: 0; } .noexp-why { font-size: .85rem; color: var(--muted); }
@media (min-width: 768px) { .noexp-row { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1.2fr); } .noexp-do { grid-column: auto; justify-content: flex-end; } .noexp-amt { text-align: right; } }

/* ── STEP 11g — RESOURCES: Settings › Resources, a resource, Work › Planner, booking (tokens only) ── */
.rsc-head { margin: 0 0 8px; } .rsc-tabs { margin-bottom: 12px; } .rsc-card { margin-bottom: 12px; }
.rsc-tbl td, .rsc-tbl th { vertical-align: middle; } .rsc-name { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.rsc-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--area-work-soft); color: var(--area-work); }
.rsc-av-m { --k: var(--pl-c7); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--k) 18%, var(--surface)); color: var(--k); }
.rsc-k-exc { --k: var(--pl-c0); } .rsc-k-van { --k: var(--pl-c1); } .rsc-k-crane { --k: var(--pl-c2); } .rsc-k-drill { --k: var(--pl-c5); }
.rsc-av-h { box-shadow: inset 0 0 0 1.5px var(--k, var(--line-btn)); }
.rsc-tbl th, .rsc-tbl td { white-space: nowrap; } .rsc-tbl td.rsc-kind { white-space: normal; min-width: 120px; }
.rsc-dim { color: var(--muted); font-weight: 400; } .rsc-num { max-width: 110px; text-align: right; }
.rsc-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; } .rsc-inline .field-in { flex: 1 1 160px; min-width: 0; }
.rsc-add { margin-top: 12px; } .rsc-rates td { padding-top: 4px; padding-bottom: 4px; }
.rsc-form .card { margin-bottom: 12px; } .rsc-supplier { max-width: 520px; } .rsc-two, .rsc-hours-row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.rsc-headline { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; } .rsc-headline p { margin: 0; color: var(--ink-muted); }
.rsc-sched { display: grid; gap: 12px; grid-template-columns: 1fr; } .rsc-cards { display: grid; gap: 12px; grid-template-columns: 1fr; align-content: start; }
.rsc-more { font-weight: 600; white-space: nowrap; } .rsc-away-row td { color: var(--ink-muted); }
.rsc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; } .rsc-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 4px 2px 12px; border-radius: var(--radius-pill); background: var(--chosen-bg); color: var(--chosen-ink); font-weight: 600; }
.rsc-x { border: 0; background: transparent; color: inherit; cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 50%; }
.rsc-mini td, .rsc-mini th { padding-top: 4px; padding-bottom: 4px; }
.rsc-away { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.rsc-away-add { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; margin-top: 10px; } .rsc-away-add .rsc-wide, .rsc-away-add .btn { grid-column: 1 / -1; }
.rsc-ptbl td.mono { white-space: nowrap; } table.tbl.rsc-ptbl th, table.tbl.rsc-ptbl td { padding-left: 8px; padding-right: 8px; } table.tbl.rsc-ptbl td.col-primary { white-space: nowrap; } .rsc-cst { display: block; font-size: var(--text-xs); color: var(--ink-muted); }
.riw-q { max-width: 96px; text-align: right; } table.tbl.riw-tbl td small { display: block; }
.me-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 10px; }
.me-strip { display: flex; gap: 6px; } .me-sd { display: flex; flex-direction: column; align-items: center; min-width: 44px; padding: 4px 6px; border-radius: var(--radius-btn); color: inherit; text-decoration: none; background: var(--surface); }
.me-sd small { font-size: var(--text-xs); color: var(--ink-muted); } .me-sd.today b { color: var(--accent); } .me-sd.on { background: var(--chosen-bg); color: var(--chosen-ink); }
.me-day { display: grid; gap: 10px; margin: 0 0 14px; } .me-day h3 { margin: 4px 0 0; }
.me-it { padding: 12px 14px; border-left: 5px solid var(--pl, var(--line)); } .me-it p { margin: 0 0 4px; }
.me-time { font-size: var(--text-h3); font-weight: 700; } .me-job { font-size: var(--text-base); } .me-pc, .me-with { color: var(--ink-muted); font-size: var(--text-sm); }
.me-addr { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--text-sm); }
.me-clock { display: flex; gap: 10px; align-items: center; margin: 8px 0 0; } .me-cbtn { min-height: 44px; min-width: 140px; } .me-cl { color: var(--ink-muted); }
.me-next { color: var(--ink-muted); font-weight: 600; } .hm2-my .me-it { margin: 0 0 8px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--pl, var(--line)) 10%, var(--surface)); }
@media (min-width: 1024px) { .me-v-today .me-day { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } .me-day h3 { grid-column: 1 / -1; }
  .me-v-week, .me-v-month { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; align-items: start; } }
.sug-card { margin: 10px 0; padding: 14px 16px; background: var(--smart-bg); box-shadow: none; } .sug-card h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.sug-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; padding: 6px; border: 1.5px dashed var(--line-btn); border-radius: var(--radius-sm); }
.sug-f .field-in { min-height: 34px; width: auto; } .sug-dt { display: inline-flex; gap: 4px; align-items: center; }
.sug-l { min-width: 3.6em; font-size: var(--text-label); color: var(--ink-muted); }   /* step 12 / A4 From / Until */
.sug-done a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; } .sug-done small { display: block; }
.sug-why { display: block; color: var(--ink-muted); margin-top: 2px; } .sug-clash { display: block; color: var(--st-overdue-ink); font-weight: 600; }
.sug-acts { display: flex; gap: 8px; flex-wrap: wrap; } .sug-acts form { margin: 0; } .sug-ask { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; } .sug-ask p, .sug-ask form { margin: 0; }
table.tbl.sug-tbl td { vertical-align: top; background: transparent; } table.tbl.sug-tbl td:first-child { width: 26%; }
.year-card dl > div > dd { flex: none; white-space: nowrap; overflow-wrap: normal; } .year-card dl > div > dt { flex: 1 1 0; min-width: 0; }   /* 11g fix: an amount never breaks; the longer hours label wraps */
.gt-bill { display: block; font-size: var(--text-xs); color: var(--ink-muted); font-family: inherit; }   /* 11g fix: "12:30 to bill" under the real hours */
/* 11g fix (GAP-263, GAP-264): on the phone nothing scrolls sideways — each booking of the project's Resources tab is a
   card (the resource on top, a label over each value, two per line), and each suggestion is a card (what the quote
   says, the resource and the dates stacked full width, Book full width; Book all / Not now / Put on quote below) */
@media (max-width: 767px) {
  .rsc-pwrap { overflow: visible; background: transparent; box-shadow: none; border: 0; }
  table.tbl.rsc-ptbl, table.tbl.rsc-ptbl tbody { display: block; } table.tbl.rsc-ptbl thead { display: none; }
  table.tbl.rsc-ptbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
  table.tbl.rsc-ptbl td { display: block; padding: 0; border: 0; text-align: left; background: transparent; white-space: normal; }
  table.tbl.rsc-ptbl td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; }
  table.tbl.rsc-ptbl td.col-primary, table.tbl.rsc-ptbl td.log-actions, table.tbl.rsc-ptbl td.empty-state { grid-column: 1 / -1; white-space: normal; font-weight: 600; }
  table.tbl.rsc-ptbl td.log-actions { display: flex; gap: 8px; justify-content: flex-end; font-weight: 400; } table.tbl.rsc-ptbl td.log-actions form { margin: 0; }
  .sug-card .tablecard { overflow: visible; background: transparent; box-shadow: none; border: 0; }
  table.tbl.sug-tbl, table.tbl.sug-tbl tbody, table.tbl.sug-tbl tr, table.tbl.sug-tbl td { display: block; width: auto; }
  table.tbl.sug-tbl thead { display: none; } table.tbl.sug-tbl td:first-child { width: auto; }
  table.tbl.sug-tbl tr { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); }
  table.tbl.sug-tbl td { padding: 0 0 8px; border: 0; } table.tbl.sug-tbl td.sug-b { padding: 0; }
  .sug-q::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; }
  .sug-f { flex-direction: column; align-items: stretch; } .sug-f .field-in, .sug-dt { width: 100%; } .sug-dt { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .sug-b .btn, .sug-acts .btn { width: 100%; min-height: 44px; } .sug-acts { flex-direction: column; } .sug-acts form { width: 100%; }
}
.pj-split { margin: 6px 0 0; font-size: var(--text-sm); color: var(--ink-muted); } .pj-split b { color: var(--ink); } .pj-bfrom { margin-top: 2px; } .rsc-sug-row td { color: var(--ink-muted); }
@media (min-width: 768px) { .rsc-two { grid-template-columns: 1fr 1fr; } .rsc-hours-row { grid-template-columns: 1fr 1fr 1fr; } .rsc-away-add { grid-template-columns: 1fr 1fr 1fr 1fr; } }
/* E5: This week per day — a day's blocks as bars in the project's colour, planned + clocked hours */
.rsc-wsum { margin: -4px 0 8px; font-size: var(--text-sm); color: var(--ink-muted); font-weight: 600; }
.rsc-days { list-style: none; margin: 0; padding: 0; } .rsc-day { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.rsc-day.today .rsc-dn { color: var(--accent); } .rsc-dn { font-size: var(--text-sm); font-weight: 700; color: var(--ink-muted); }
.rsc-dbars { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rsc-bar { display: block; padding: 3px 8px; border-left: 5px solid var(--pl, var(--line)); border-radius: var(--radius-sm); background-color: color-mix(in srgb, var(--pl, var(--line)) 30%, var(--surface)); font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsc-bar a { color: inherit; text-decoration: none; } .rsc-bar small { font-weight: 400; color: var(--ink-muted); }
.rsc-dh { min-width: 34px; text-align: right; font-size: var(--text-sm); } .rsc-dc { color: var(--ink-muted); }
.rsc-sched > *, .rsc-cards > * { min-width: 0; } table.tbl.rsc-mini th, table.tbl.rsc-mini td { padding: 5px 6px; } table.tbl.rsc-mini td:first-child { white-space: nowrap; }
table.tbl.rsc-tbl th, table.tbl.rsc-tbl td { padding-left: 10px; padding-right: 10px; }
.rsc-away-more summary { list-style: none; display: inline-flex; margin-top: 6px; } .rsc-away-more summary::-webkit-details-marker { display: none; } .rsc-none { margin: 0 0 4px; }
@media (min-width: 768px) { .rsc-sched { grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr); } .rsc-sched > .rsc-cards { grid-column: 2; } .rsc-sched > .rsc-week { grid-row: span 2; } }
@media (min-width: 1280px) { .rsc-sched { grid-template-columns: minmax(0, 1.25fr) minmax(250px, 1fr) minmax(0, .9fr); } .rsc-sched > .rsc-cards + .rsc-cards { grid-column: 3; grid-row: 1; } .rsc-sched > .rsc-week { grid-row: auto; } }

.pl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; } .pl-range { margin: 0; font-size: var(--text-h3); flex: 1 1 auto; }
.pl-views { display: inline-flex; border-radius: var(--radius-btn); background: var(--surface-sunk); padding: 2px; }
.pl-vw { padding: 0 12px; min-height: calc(var(--h-btn) - 4px); display: inline-flex; align-items: center; border-radius: var(--radius-btn); color: var(--ink); text-decoration: none; font-weight: 600; }
.pl-vw.on { background: var(--chosen-bg); color: var(--chosen-ink); }
.pl-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; } .pl-skill { margin: 0; } .pl-skill .field-in { min-height: var(--h-chip); }
.pl-grid { display: none; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.pl-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); border-top: 1px solid var(--line-soft); }
.pl-headrow { border-top: 0; background: var(--dt-head-bg); } .pl-group { padding: 8px 12px 4px; border-top: 1px solid var(--line); } .pl-group h3 { margin: 0; font-size: var(--text-label); color: var(--ink-muted); text-transform: uppercase; letter-spacing: var(--tracking-label); }
.pl-lab { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 8px; align-items: center; padding: 6px 10px; border-right: 1px solid var(--line-soft); }
.pl-who { display: flex; flex-direction: column; min-width: 0; } .pl-who a { color: inherit; text-decoration: none; } .pl-who b, .pl-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-line, .pl-use { font-size: var(--text-xs); color: var(--muted); } .pl-use { grid-column: 2; font-weight: 600; color: var(--ink-muted); }
.pl-track { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--lanes), minmax(44px, auto)); }
.pl-ch { grid-column: var(--i); padding: 8px 6px; font-size: var(--text-label); font-weight: 700; color: var(--ink-muted); text-align: center; border-left: 1px solid var(--line-soft); }
.pl-ch.today { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.pl-cell { grid-column: var(--i); grid-row: 1 / -1; border-left: 1px solid var(--line-soft); }
.pl-cell.today { background: var(--ch-band); } .pl-cell.we, .pl-ch.we { background: var(--surface-sunk); }
.pl-b { grid-column: var(--cs) / var(--ce); grid-row: var(--ln); z-index: 1; margin: 3px; padding: 3px 8px; min-width: 0; min-height: 38px; text-align: left; display: flex; flex-direction: column; justify-content: center; border: 0; border-left: 5px solid var(--pl); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--pl) 30%, var(--surface)); color: var(--ink); cursor: pointer; overflow: hidden; touch-action: pan-y; }
.pl-b b, .pl-b small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pl-b b { font-size: var(--text-sm); } .pl-b small { font-size: var(--text-xs); color: var(--ink-muted); }
.pl-b.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .pl-b.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pl-c0 { --pl: var(--pl-c0); } .pl-c1 { --pl: var(--pl-c1); } .pl-c2 { --pl: var(--pl-c2); } .pl-c3 { --pl: var(--pl-c3); } .pl-c4 { --pl: var(--pl-c4); }
.pl-c5 { --pl: var(--pl-c5); } .pl-c6 { --pl: var(--pl-c6); } .pl-c7 { --pl: var(--pl-c7); } .pl-c8 { --pl: var(--pl-c8); } .pl-c9 { --pl: var(--pl-c9); }
.pl-pat { background-image: repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--pl) 30%, transparent) 5px 7px); }
.pl-b.pl-off, .pl-sw.pl-off, .pl-dot.pl-off { --pl: var(--ink-faint); background: repeating-linear-gradient(135deg, var(--st-draft-bg) 0 6px, var(--surface) 6px 12px); }
.pl-b.pl-rep, .pl-sw.pl-rep, .pl-dot.pl-rep { --pl: var(--amber); background: repeating-linear-gradient(135deg, var(--amber-soft) 0 6px, var(--surface) 6px 12px); }
.pl-b.pl-sug, .pl-sw.pl-sug, .pl-dot.pl-sug { background: var(--surface); border: 1.5px dashed var(--pl, var(--line-btn)); border-left-width: 4px; }
.pl-b.pl-lift { opacity: .7; box-shadow: var(--shadow-lift); } .pl-cell.pl-drop { background: var(--chosen-bg); } .pl-moving .pl-cell { cursor: copy; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 10px 0 4px; font-size: var(--text-sm); color: var(--ink-muted); }
.pl-legend li { display: inline-flex; align-items: center; gap: 6px; } .pl-sw { width: 22px; height: 14px; border-radius: 3px; border-left: 4px solid var(--pl, var(--line)); background-color: color-mix(in srgb, var(--pl, var(--line)) 30%, var(--surface)); }
.pl-sw.pl-today { --pl: var(--accent); background: var(--ch-band); }
.pl-hint { display: none; } .pl-days { display: grid; gap: 10px; } .pl-day h3 { margin: 0 0 6px; } .pl-day.today h3 { color: var(--accent); }
.pl-it { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.pl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--pl); vertical-align: middle; }
.pl-cardwrap:empty { display: none; } .pl-cardwrap { position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 12px); }
.pl-card { position: relative; padding: 14px 16px; box-shadow: var(--shadow-pop); } .pl-card p { margin: 0 0 6px; } .pl-card-x { position: absolute; top: 6px; right: 6px; }
.pl-card-t { padding-right: 36px; } .pl-move-hint { color: var(--accent); font-weight: 600; } .bk-dt { min-width: 0; }
.pl-card-a { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .pl-del { margin: 0; }
@media (min-width: 768px) {
  .pl-grid { display: block; } .pl-days { display: none; } .pl-hint { display: block; }
  .pl-cardwrap { left: auto; right: 24px; bottom: 24px; width: 380px; }
}
.pl-l-np { display: none; }
@media (max-width: 1279px) { .pl-row { grid-template-columns: 180px minmax(0, 1fr); } .pl-l-full { display: none; } .pl-l-np { display: inline; } }

.bk-wrap { display: flex; justify-content: flex-end; } .bk-panel { width: 100%; }
.bk-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.bk-fixed { margin-top: 8px; max-width: 240px; } .bk-err { margin: 8px 0; }
.bk-clash { margin: 10px 0; padding: 12px 14px; border-radius: var(--radius-card); background: var(--red-soft); color: var(--st-overdue-ink); border-left: 4px solid var(--red); } .bk-clash p { margin: 0 0 4px; }
.bk-alts h4 { margin: 8px 0 6px; } .bk-alt { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.bk-alt > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; } .bk-line { margin: 10px 0; padding: 10px 12px; border-radius: var(--radius-card); background: var(--smart-bg); font-weight: 600; }
.bk-actions { position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.bk-actions .btn.pri:disabled { opacity: 1; background: color-mix(in srgb, var(--ink) 14%, var(--surface)); background-image: none; border-color: transparent; color: var(--ink-muted); box-shadow: none; }
.bk-line span { display: block; margin-top: 4px; font-weight: 400; font-size: var(--text-sm); color: var(--ink-muted); }
/* E3: ONE resource search field, its list under it (name, kind or skill) */
.bk-res { position: relative; } .bk-res-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; max-height: 280px; overflow-y: auto; margin: 2px 0 0; padding: 4px; list-style: none; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); }
.bk-res-g { padding: 6px 8px 2px; font-size: var(--text-label); font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: var(--tracking-label); }
.bk-res-list button { display: flex; flex-direction: column; width: 100%; min-height: 40px; padding: 4px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.bk-res-list button:hover, .bk-res-list button:focus-visible, .bk-res-list [aria-selected="true"] button { background: var(--chosen-bg); }
.bk-res-list small { color: var(--ink-muted); font-size: var(--text-xs); }
/* E3: the dialog over the page it came from — full screen on the phone, a panel on the right from 768 px */
dialog.bk-dlg { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; }
dialog.bk-dlg[open] { display: flex; justify-content: flex-end; } dialog.bk-dlg:focus, dialog.bk-dlg:focus-visible { outline: none; } dialog.bk-dlg::backdrop { background: var(--scrim); }
.bk-dlg .bk-panel { margin: 0; width: 100%; height: 100%; overflow-y: auto; border-radius: 0; }
.bk-dlg-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; } .bk-dlg-h h2 { margin: 0; font-size: var(--text-h3); }
@media (min-width: 768px) { .bk-panel { max-width: 560px; box-shadow: var(--shadow-pop); } .bk-dates { grid-template-columns: 1.4fr 1fr 1.4fr 1fr; } .bk-wrap { justify-content: center; }
  dialog.bk-dlg { padding: 16px; } .bk-dlg .bk-panel { height: auto; max-height: 100%; border-radius: var(--radius-card); } }

/* ── step 10b — the coach operator module (boards Coach-*; C1–C9). The planner: lanes (vehicles / drivers) × the day
   05:00–21:00; a trip block sits at --s % from the left, --w % wide (coach_trips.html); the now-line at --s. ── */
.nav-addons .navi .ic { color: var(--amber); }
.ct-sub { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.ct-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.ct-side { display: grid; gap: 12px; }
.ct-views a, .ct-plan .seg a { padding: 6px 12px; border-radius: 100px; font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; background: var(--line-soft); }
.ct-views a.on, .ct-plan .seg a.on { background: var(--ink); color: var(--paper); }
.ct-grid { display: grid; gap: 0; }
.ct-hours, .ct-lane { display: grid; grid-template-columns: 190px 1fr; align-items: stretch; }   /* "Wheelchair minibus 5 · 12 seats" on one line */
.ct-scale { position: relative; height: 22px; }
.ct-scale i { position: absolute; left: calc(var(--s) * 1%); font-style: normal; font-size: 12px; color: var(--muted); transform: translateX(-50%); }
.ct-lane { border-top: 1px solid var(--line); min-height: 50px; }
.ct-ln { align-self: center; font-weight: 600; font-size: 14px; padding-right: 8px; }
.ct-track { position: relative; background: repeating-linear-gradient(90deg, transparent 0 calc(6.25% - 1px), var(--line-soft) calc(6.25% - 1px) 6.25%); }
.ct-b { position: absolute; top: 6px; bottom: 6px; left: calc(var(--s) * 1%); width: max(calc(var(--w) * 1%), 34px); display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 3px 6px; border-radius: 8px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--ink); font-size: 12px; text-decoration: none; cursor: grab; touch-action: none; }
.ct-b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-b.ct-done { border-color: var(--green); background: var(--green-soft); }
.ct-b.ct-way { border-color: var(--amber); background: var(--amber-soft); }
.ct-b.ct-need { border-color: var(--danger); background: var(--overdue-soft); }
.ct-b.ct-lift { z-index: 5; box-shadow: var(--shadow-pop); cursor: grabbing; }
.ct-who { align-self: flex-start; font-size: 11px; padding: 0 5px; border-radius: 6px; background: var(--paper); }
.ct-now { position: absolute; top: 0; bottom: 0; left: calc(var(--s) * 1%); width: 2px; background: var(--attn); z-index: 3; pointer-events: none; }
/* fix-ups / 9: the now-line's time in a strip of its own above the hours — never over an hour's label */
.ct-hours { padding-top: 16px; }
.ct-now b { position: absolute; top: -38px; left: 1px; transform: translateX(-50%); font-size: 11px; line-height: 14px; color: var(--attn); white-space: nowrap; }
.ct-loose { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.ct-chip { display: block; font-size: 12px; padding: 3px 8px; margin: 2px 0; border-radius: 8px; background: var(--blue-soft); color: var(--ink); text-decoration: none; }
.ct-chip.ct-need { background: var(--overdue-soft); }
.ct-week th.is-today { color: var(--accent); }
.ct-list { display: grid; gap: 10px; margin-top: 12px; }
.ct-phone-only { display: none; }
.ct-days { display: flex; gap: 6px; overflow-x: auto; }
.ct-days .chip.on { background: var(--ink); color: var(--paper); }
.ct-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-field); background: var(--paper); border: 1px solid var(--line); }
.ct-card-need { border-left: 4px solid var(--danger); }
.ct-card-a { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; color: var(--ink); text-decoration: none; }
.ct-card-a b, .ct-card-a small { grid-column: 1 / -1; }
.ct-t { font-family: var(--font-num); font-size: 18px; font-weight: 700; }
.ct-nd { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.ct-free form { display: inline; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.ct-w { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.ct-w .is-neg { color: var(--st-overdue-ink); }
.ct-hint { font-size: 13px; padding: 14px 16px; margin: 0; }
.ct-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ct-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ct-f4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; align-items: end; }
.ct-clash { margin: 10px 0; }
.ct-more { margin: 10px 0; }
.ct-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ct-tot { display: flex; justify-content: flex-end; align-items: baseline; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.ct-big b { font-size: 22px; }
.ct-agree { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 10px 14px; border-radius: var(--radius-field); background: var(--blue-soft); font-size: 14px; }
.ct-kv > form > div, .ct-kv > div { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.ct-find { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.ct-find .field-in { max-width: 320px; }
.ct-leg { padding: 12px 14px; margin: 10px 0; border-radius: var(--radius-field); background: var(--paper); border: 1px solid var(--line); }
.ct-leg h3 { margin: 0 0 6px; font-size: 15px; }
/* fix-ups / 6 (Coach-Phone-NewBooking): One way · Return · 2 trips · Gozo split — ONE segmented bar, one line at 390 */
.ct-shape { display: flex; gap: 2px; border: 0; padding: 3px; margin: 10px 0; border-radius: 100px; background: var(--line-soft); }
.ct-shape label { position: relative; flex: 1 1 auto; min-width: 0; }
.ct-shape.seg-o span { display: flex; justify-content: center; width: 100%; padding: 7px 10px; background: transparent; border: 0; font-size: 13px; white-space: nowrap; }
.ct-shape.seg-o input:checked + span { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-field); }
.ct-shape.seg-o input:checked + span::before { display: none; }
.ct-save { width: 100%; margin-top: 12px; }
.ct-my { display: grid; gap: 12px; max-width: 560px; }
.ct-mt { display: grid; gap: 4px; padding: 14px 16px; }
.ct-mt.ct-next { border: 2px solid var(--accent); }
.ct-mt-h { display: flex; justify-content: space-between; align-items: center; }
.ct-mt-a { display: flex; gap: 8px; margin-top: 8px; }
.ct-mt-a form { flex: 1; } .ct-mt-a .btn { width: 100%; justify-content: center; }
.ct-note { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--line-soft); font-size: 14px; }
.ct-hm { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ct-inv .ct-ic { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ct-inv .ct-ic-sum { grid-template-columns: 1fr auto; }
.ct-cbx { width: 18px; height: 18px; border: 1.5px solid var(--line-field); border-radius: 5px; }
.ct-pl { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ct-inv { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.ct-ag { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ct-ag span { display: grid; }
.ct-add { margin-top: 10px; }
/* 10c / D1 (Coach-Desktop-ClientVAT): VAT on trips per client — three option cards, the agreed prices, the next invoice */
.cvat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cvat-card { display: grid; gap: 8px; align-content: start; }
.cvat-set { display: grid; gap: 8px; }
.cvat-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-field); cursor: pointer; }
.cvat-opt:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); }
.cvat-opt span { display: grid; }
.cvat-opt small, .cvat-next { color: var(--ink-muted); }
/* 10c / D2 (Coach-Desktop-Cash / Coach-Phone-Cash): three figures, the ticked list, the phone's bottom button */
.cash-per { margin-bottom: 12px; }
.cash-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: var(--gap-block); }
.cash-list .set-ch { align-items: center; }
.cash-act { display: flex; gap: 12px; align-items: center; }
.cash-row { display: grid; grid-template-columns: 22px 100px minmax(0, 1fr) minmax(0, 0.8fr) 120px auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.cash-route { display: grid; }
.cash-route small { display: none; }
@media (max-width: 699px) {
  .cash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-year, .cash-act .muted { display: none; }
  .cash-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .cash-date, .cash-who, .cash-drv { display: none; }
  .cash-route { font-weight: 600; }
  .cash-route small { display: block; font-weight: 400; }
  .cash-act { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5; }
  .cash-act .cash-btn { flex: 1; justify-content: center; }
}
/* 10c / D3 (Coach-Desktop-DriverPay / Coach-Phone-DriverPay): chips + the year, how paid, the month bars, the total */
.pay-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.pay-year { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.pay-bars svg { display: block; fill: var(--accent-pop); }
.pay-bars-h, .pay-bars { text-align: right; }
.pay-sub { display: none; }
.pay-total td { border-top: 2px solid var(--ink); }
.pay-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
@media (max-width: 699px) {
  .pay-how, .pay-bars, .pay-bars-h, .pay-x, .pay-tbl thead th:nth-child(3), .pay-tbl td:nth-child(3) { display: none; }
  .pay-sub { display: block; }
}
.cvat-next { margin: 4px 0 0; padding: 10px 14px; border-radius: var(--radius-field); background: var(--accent-soft); }
/* fix-ups / 4 (Coach-Desktop-Settings): trip types + the switch left, agreed prices + numbers + drivers right; an add
   row is ONE line "+ Add a trip type" */
.ct-set { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ct-col { display: grid; gap: 12px; min-width: 0; }
.ct-col > .card { margin: 0; min-width: 0; }
.ct-col > .card > * { min-width: 0; }   /* a flex card: the table scrolls inside it, never pushes it over the next column */
.ct-add > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; font-weight: 600; color: var(--accent); }
.ct-add > summary::-webkit-details-marker { display: none; }
.ct-add[open] > summary { margin-bottom: 10px; }
.ct-types td, .ct-types th { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.ct-types td:nth-child(-n+2) { white-space: normal; }
.ct-x { width: 1%; }
.ct-full { grid-column: 1 / -1; }
.ct-sw { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ct-ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.ct-hint0 { margin: 0 0 8px; font-size: 13px; }
@media (max-width: 1199px) { .ct-set { grid-template-columns: minmax(0, 1fr); } }
/* fix-ups / 5: "New booking" stays in the Trips head on a tablet (as drawn); the phone's + makes one */
@media (min-width: 700px) and (max-width: 1023px) { .ct-ph .topbar-actions > .ph-nodock { display: inline-flex; } }
/* fix-ups / 7: the booking's client card — values; the edit form stacked under it */
.ct-bk > div { grid-template-columns: 110px minmax(0, 1fr); }
.ct-bk-edit { border-top: 1px solid var(--line); padding-top: 10px; }
.ct-stack { display: grid; gap: 10px; }
.ct-stack .ct-acts { margin-top: 0; }
@media (max-width: 1199px) { .ct-wrap, .ct-inv { grid-template-columns: 1fr; } }
@media (max-width: 699px) {
  .ct-grid, .ct-week, .ct-plan > .set-ch, .ct-views { display: none; }
  /* fix-ups / 5 (Coach-Phone-Trips): one day control, the cards straight on the page, no second ‹ Today ›, the + makes
     a booking. 10b ultra / 11: Needs a driver (coming days) above the list, Watch under it */
  .ct-ph .ct-step, .ct-ph [data-ph-nodock], .ct-side > .ct-hint, .ct-needs.ct-none { display: none; }
  .ct-side { display: contents; } .ct-needs { order: -1; }
  .ct-plan.card { background: none; border: 0; box-shadow: none; padding: 0; }
  .ct-plan .ct-list { margin-top: 0; }
  .ct-days { margin: 0 -16px 2px; padding: 0 16px; }
  .ct-phone-only { display: grid; }
  .ct-f2, .ct-f4 { grid-template-columns: 1fr 1fr; }
  .ct-kv > form > div, .ct-kv > div { grid-template-columns: 1fr; }
  .ct-inv .ct-ic { grid-template-columns: 24px 1fr auto; } .ct-inv .ct-ic > span.muted { display: none; }
}
@media print { .ct-sheet { box-shadow: none; } }

/* ── step 13 — smart onboarding (boards Onb-*, Set-*-MyBusiness; O1–O9). The yellow examples line, Home's first four
   per type (every size — the phone quick actions' look), the business step's tiles, the remove sheet, My business. ── */
.ex-line { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-card); background: var(--amber-soft); color: var(--ink); font-size: 14px; }
.ex-line > span { flex: 1; } .ex-line .linkbtn { font-weight: 600; text-decoration: underline; }
.biz-first { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.biz-first > h2 { grid-column: 1 / -1; margin: 0; font-size: var(--text-label); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-muted); }
.biz-first .hq { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 92px; padding: 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); }
.biz-first .hq > a:first-child { display: flex; flex-direction: column; gap: 14px; color: var(--ink); font-weight: 600; text-decoration: none; }
.biz-first .hq .ic { color: var(--ink-muted); }
.biz-first .hq.hq-pri { background: var(--accent); } .biz-first .hq.hq-pri a, .biz-first .hq.hq-pri .ic { color: var(--on-accent); }
.hq-sub { font-size: 13px; font-weight: 600; }
.wl-biz { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wl-biz .wl-card { min-height: 46px; padding: 6px 10px; justify-content: center; }
.wl-biz .wl-card b { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.25; }
.wl-biz .wl-card:last-child { grid-column: span 2; }
.wl-exl { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.wl-team { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.ex-sheet { display: grid; gap: 10px; } .ex-sheet .btn { width: 100%; }
.ex-go { margin: 0; padding: 0 0 0 18px; display: grid; gap: 6px; }
.ex-stay { margin: 0; padding: 10px 12px; border-radius: var(--radius-card); background: var(--accent-soft); font-size: 14px; }
.biz-set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.biz-part { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.biz-part .st { display: flex; flex-direction: column; } .biz-part small { color: var(--ink-muted); }
.biz-addons { margin-top: 12px; }
@media (max-width: 1023px) { .biz-first { grid-template-columns: 1fr 1fr; } .wl-biz { grid-template-columns: 1fr 1fr; } .wl-biz .wl-card:last-child { grid-column: 1 / -1; } .biz-set { grid-template-columns: minmax(0, 1fr); } }
