/* Mynt CRM — the office app's styles.
   Tokens in :root, light and dark. The stage ramp is one green hue that deepens as
   a case moves on (from the owner's Case Desk); people colours never reuse it, so a
   person and a stage are never confused. Contrast: ink on bg ≥ 12:1, ink-2 ≥ 7:1,
   muted ≥ 4.5:1 in both themes.
   The brand (round 19, owner, 8 November 2026: "change app colour to match logo"): the two colours of the owner's logo,
   public/brand/mynt-finance-logo.png, read from its pixels: its navy #122a49 ("mynt") and its mint #b6e2e0 ("finance").
   Light: the buttons, the menu's current item, rings and bars are the navy, the highlights behind them the mint made pale,
   and links a deep teal of the mint's own hue (#0e6a66, 6.4:1 on white), so a link still stands apart from the navy-black
   words. Dark: the other way round, mint buttons with the navy on them, navy highlights, links a mid teal. The greys lean
   to the navy. Good, warn and bad keep their own green, amber and red, apart from the brand. Each pair is AA or better
   (test/browser/checks/99o-titles-address-files-r19.mjs measures the buttons, the links and the words in both themes). */

:root {
  --bg: #f4f6f9; --surface: #ffffff; --sunk: #eef1f6; --raised: #ffffff;
  --ink: #0e1a2c; --ink-2: #334259; --muted: #5b6779; --line: #dde3eb; --line-2: #e9edf3;
  --accent: #122a49; --accent-2: #0b1d36; --accent-ink: #ffffff; --accent-soft: #dcf0ef; --link: #0e6a66;
  --brand-navy: #122a49; --brand-mint: #b6e2e0;
  --st-1: #8fcdb2; --st-2: #5db592; --st-3: #2f9a76; --st-4: #17805f; --st-5: #0b6448; --st-6: #064a35; --st-7: #03301f; --st-x: #a4aba7;
  --p-0: #e0682f; --p-1: #6250d6; --p-2: #d39400; --p-3: #d23c79; --p-4: #2a78d6; --p-5: #7a8a19; --p-6: #8b5a2b; --p-7: #1a9aa6;
  --bad: #c0362c; --bad-soft: #fcebe9; --warn: #9a5b00; --warn-soft: #fcf1de; --info: #4f5d70; --info-soft: #edf1f6;
  --good: #11784f; --good-soft: #e0f3ea; --star: #b77d00;
  --s-new: #2a78d6; --s-done: #0f8f62; /* validated pair (light): CVD ΔE 20, contrast ≥3:1 */
  --shadow-1: 0 1px 2px rgba(14, 26, 44, .06);
  --shadow-2: 0 1px 2px rgba(14, 26, 44, .05), 0 12px 32px rgba(14, 26, 44, .08);
  --shadow-3: 0 24px 64px rgba(14, 26, 44, .22);
  /* System fonts only: no web fonts, so no visitor's address goes to a font host. */
  --f-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* The menu is wide enough for its longest name with a count beside it, on one line ("Cases needing action" 99+;
     owner, 22 October 2026: the new names; it was 232px). */
  --r: 12px; --r-sm: 8px; --nav-w: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2b; --sunk: #0e1625; --raised: #172236;
    --ink: #e7edf5; --ink-2: #b8c3d3; --muted: #8f9cb0; --line: #253248; --line-2: #1b2639;
    --accent: #b6e2e0; --accent-2: #cdeeec; --accent-ink: #122a49; --accent-soft: #152d47; --link: #4aaaa5;
    --st-1: #1f5a46; --st-2: #23735a; --st-3: #2a8c6c; --st-4: #36a47f; --st-5: #52bb95; --st-6: #7bd0ad; --st-7: #a9e3c9; --st-x: #5b6762;
    --bad: #f0857a; --bad-soft: #3a1d1a; --warn: #e6b45c; --warn-soft: #33270f; --info: #a8b5c6; --info-soft: #1a2436;
    --good: #5fcf9f; --good-soft: #16302a; --star: #e3b341;
    --s-new: #3f86e0; --s-done: #23a077;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 14px 36px rgba(0, 0, 0, .45); --shadow-3: 0 24px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121b2b; --sunk: #0e1625; --raised: #172236;
  --ink: #e7edf5; --ink-2: #b8c3d3; --muted: #8f9cb0; --line: #253248; --line-2: #1b2639;
  --accent: #b6e2e0; --accent-2: #cdeeec; --accent-ink: #122a49; --accent-soft: #152d47; --link: #4aaaa5;
  --st-1: #1f5a46; --st-2: #23735a; --st-3: #2a8c6c; --st-4: #36a47f; --st-5: #52bb95; --st-6: #7bd0ad; --st-7: #a9e3c9; --st-x: #5b6762;
  --bad: #f0857a; --bad-soft: #3a1d1a; --warn: #e6b45c; --warn-soft: #33270f; --info: #a8b5c6; --info-soft: #1a2436;
  --good: #5fcf9f; --good-soft: #16302a; --star: #e3b341;
  --s-new: #3f86e0; --s-done: #23a077;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 14px 36px rgba(0, 0, 0, .45); --shadow-3: 0 24px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------ shell
   Phones (owner, 20 October 2026: "very mobile friendly and sized to view good on mobile"):
   heights use the screen a phone really shows (dvh: its address bar comes and goes; the vh
   line first is for a browser without dvh), and edges keep clear of the notch and the home
   bar (env(safe-area-inset-*), 0 everywhere else; the page asks for them with viewport-fit=cover). */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.nav { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 2px;
  padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-left: calc(10px + env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  font: 700 15px/1 var(--f-display); letter-spacing: -.02em; }
.brand-name { font: 700 16px/1.1 var(--f-display); letter-spacing: -.01em; }
.brand-org { font-size: 11.5px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav .badge { margin-left: auto; padding: 1px 5px; }
.nav-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  padding-top: calc(10px + env(safe-area-inset-top)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.searchbox { flex: 1; max-width: 560px; position: relative; }
/* Room on the right for Ctrl K, so the words never run under it (review, 28 October 2026). */
.searchbox input[type=search] { width: 100%; padding: 8px 64px 8px 34px; text-overflow: ellipsis; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.searchbox svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
/* The Ctrl K label is a hint, never a target: a tap or a click on it reaches the box under it. */
.searchbox kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
kbd { font: 11px var(--f-mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--surface); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--raised); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-2); max-height: 70vh; overflow: auto; padding: 6px; z-index: 40; }
.search-results h6 { margin: 8px 8px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.search-results a { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); }
/* A case found: who is borrowing and the property, then its lender on a line of its own (review, 28 October 2026). */
.search-results .sr-case { display: block; overflow-wrap: anywhere; }
.search-results .sr-case:empty { display: none; }
.search-results .sr-case + .sr-lender { display: block; margin-left: 0; }
.content { padding: 22px 24px 60px; max-width: 1480px; width: 100%; margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.icon-btn.menu-btn { display: none; position: relative; }
/* A dot on Menu when an item in the menu has something waiting (js/app.js). While the bar at the bottom of a phone is on
   screen it says so already (each tab's count, and More's dot for the rest), so Menu's dot steps aside: one sign, not two
   (review, 28 October 2026). It shows when the bar is out of the way (the keyboard up, a conversation open). */
.menu-dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
@media (max-width: 900px) { body:not(.kb-up):not(:has(.msg-layout.has-thread)) .menu-dot { display: none; } }
/* The page takes the focus after each change of page, for a screen reader to start there (js/app.js); a ring around the
   whole page helps nobody (review, 28 October 2026). Everything in it keeps its own ring. */
#view:focus { outline: none; }
.nav-backdrop { display: none; }
/* On a phone (review, 20 October 2026: the box was 82px with the label over it): no label,
   the box takes all the room the buttons leave, and while in use it opens across the whole
   top bar with its results full width under it. */
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  /* New is its plus alone, as Capture is its icon, so the search box keeps room for its word beside Back (review,
     28 October 2026: it was "Se"). */
  #new-btn { padding-left: 10px; padding-right: 10px; }
  .topbar > .grow { display: none; }
  .searchbox { min-width: 0; }
  .searchbox kbd { display: none; }
  .searchbox input[type=search] { padding-right: 10px; }
  .searchbox.wide { position: absolute; inset: 0; max-width: none; z-index: 3; display: flex; align-items: center; padding: 0 12px; background: var(--bg); }
  .searchbox.wide svg { left: 22px; }
  .searchbox.wide .search-results { left: 8px; right: 8px; top: calc(100% + 4px); max-height: calc(100dvh - 90px); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* The menu is a drawer: closed, it is off screen and out of reach of Tab (inert, js/app.js);
     open, a backdrop covers the page and a tap on it, or Escape, closes it. */
  .nav { position: fixed; inset: 0 auto 0 0; width: 280px; max-width: 85vw; z-index: 60; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-3); }
  .nav.open { transform: none; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(7, 13, 24, .45); }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .content { padding: 16px max(16px, env(safe-area-inset-right)) calc(60px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}

/* ------------------------------------------------------------ page heads */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font: 700 26px/1.15 var(--f-display); letter-spacing: -.02em; margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
/* A title with its line saying what the page is for (owner, 22 October 2026) takes the room the buttons beside it leave,
   the line wrapping there, so on a wide screen the buttons stay beside the title rather than dropping below it (61-names). */
.page-head > div:has(> .page-for) { flex: 1 1 16rem; min-width: 0; }
/* Tabs under a list page's head, at every width (Properties: All properties and By owner; owner, 22 October 2026,
   "know where you are"). Each is 44px or more to press. */
.page-tabs { display: flex; gap: 2px; margin: -6px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs [role=tab] { flex: 0 0 auto; display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; margin-bottom: -1px; padding: 10px 14px 7px;
  border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.page-tabs [role=tab]:hover { color: var(--ink); }
.page-tabs [role=tab][aria-selected=true] { color: var(--accent-2); border-bottom-color: var(--accent); }
.page-tabs [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.3; text-decoration: none; }
.btn:hover { background: var(--sunk); text-decoration: none; }
.btn:disabled, .btn.busy { opacity: .55; cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn svg { width: 15px; height: 15px; }
.icon-btn { padding: 6px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=password], input[type=date], input[type=month], input[type=number],
select, textarea, .input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 36px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.invalid, select.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.chip:hover { background: var(--sunk); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 500; }
.money-wrap { position: relative; }
.money-wrap::before { content: "£"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-wrap input { padding-left: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.pct-wrap { position: relative; }
.pct-wrap::after { content: "%"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pct-wrap input { padding-right: 24px; text-align: right; }
.yn { display: inline-flex; gap: 6px; }
.yn button { min-width: 64px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; color: var(--ink-2); }
.yn button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------ cards, panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.panel-h h2, .panel-h h3 { margin: 0; font: 700 15px/1.3 var(--f-display); letter-spacing: -.01em; }
.panel-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-b { padding: 14px 16px; }
.panel-b.flush { padding: 0; }
.panel + .panel { margin-top: 16px; }
.grid { display: grid; gap: 16px; align-items: start; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g21 { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
@media (max-width: 1180px) { .g21 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-1); min-width: 0; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile .v { font: 700 28px/1.15 var(--f-display); letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.delta { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--sunk); position: sticky; top: 0; white-space: nowrap; user-select: none; }
.tbl th.sort { cursor: pointer; }
.tbl th.sort:hover { color: var(--ink); }
.tbl th .arr { opacity: .8; margin-left: 3px; }
/* A heading that sorts is a button (round 19 audit: Tab reaches it, Enter or Space sorts; UI.sortTh), looking as the heading did. */
.tbl th.sort > .th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.tbl th.sort > .th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--sunk); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tfoot td { background: var(--sunk); font-weight: 700; border-top: 1px solid var(--line); }
.tbl .t-main { font-weight: 600; color: var(--ink); }
.tbl .t-sub { font-size: 12px; color: var(--muted); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font: 600 15px var(--f-display); margin-bottom: 4px; }

/* ------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: var(--info-soft); color: var(--info); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.star { background: var(--warn-soft); color: var(--star); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.badge.solid { background: var(--accent); color: var(--accent-ink); }
.stage { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.stage::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--sc, var(--st-x)); flex: none; }
.epc { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 5px; font: 700 12px/1 var(--f-display); color: #fff; }
.epc.A { background: #0b7a43; } .epc.B { background: #2a9a3c; } .epc.C { background: #8cb72b; color: #1d2a05; } .epc.D { background: #f2c418; color: #2b2100; }
.epc.E { background: #f0a12b; color: #2b1800; } .epc.F { background: #e46c26; } .epc.G { background: #d0262d; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 11px/1 var(--f-body); color: #fff; flex: none; }

/* ------------------------------------------------------------ pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
.col-h { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); }
.col-h b { font: 700 13.5px var(--f-display); }
.col-h .muted { margin-left: auto; font-size: 12px; }
.col-b { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col-b.drop { background: var(--accent-soft); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; cursor: pointer; box-shadow: var(--shadow-1); }
.card:hover { border-color: var(--accent); }
.card.dragging { opacity: .4; }
.card .t { font-weight: 600; line-height: 1.3; }
.card .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card .m { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; align-items: center; }
.card .foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.stagebar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--sunk); }
.stagebar span { display: block; height: 100%; }

/* ------------------------------------------------------------ action list */
.queue-item { display: grid; grid-template-columns: 5px 1fr auto; gap: 0 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.queue-item:hover { background: var(--sunk); }
.queue-item .stripe { border-radius: 3px; background: var(--st-x); }
.queue-item.now .stripe { background: var(--bad); }
.queue-item.soon .stripe { background: var(--warn); }
.queue-item .verb { font-weight: 700; }
.queue-item .who { color: var(--ink-2); }
.queue-item .reasons { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.tier-h { padding: 10px 16px; font: 700 12px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--sunk); border-bottom: 1px solid var(--line-2); }

/* ------------------------------------------------------------ forms */
.ff-section { border-top: 1px solid var(--line-2); }
.ff-section:first-child { border-top: 0; }
.ff-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; }
.ff-head h3 { margin: 0; font: 700 14.5px var(--f-display); }
.ff-head .chev { transition: transform .15s; color: var(--muted); }
.ff-section.closed .chev { transform: rotate(-90deg); }
.ff-section.closed .ff-body { display: none; }
.ff-body { padding: 4px 16px 16px; }
.ff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.ff-grid .w2 { grid-column: span 2; }
.ff-grid .w3 { grid-column: 1 / -1; }
@media (max-width: 760px) { .ff-grid { grid-template-columns: 1fr; } .ff-grid .w2 { grid-column: auto; } }

/* View first, edit to change (owner, 22 October 2026; forms.js mount with view): a section's answers in words, a small
   label over each answer; the section being changed has a stripe down its side so it is plain which one it is. */
.ff-section.vx > .ff-head .vx-mode { margin-left: auto; display: flex; gap: 6px; }
.ff-section.vx > .ff-head .vx-mode .btn { cursor: pointer; }
.ff-section.vx[data-mode="edit"] { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface); }
.ff-section.vx[data-mode="edit"] > .ff-head h3 { color: var(--accent-2); }
.vx-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 22px; margin: 2px 0 4px; }
.vx-row { min-width: 0; }
.vx-row.w3 { grid-column: 1 / -1; }
.vx-row dt { font-size: 12px; color: var(--muted); margin: 0 0 2px; }
.vx-row dd { margin: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.vx-row dd .vx-text { white-space: pre-wrap; }
.vx-rep + .vx-rep { margin-top: 4px; }
.vx-empty { margin: 2px 0 6px; font-size: 13px; }
.vx-need { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 2px; padding: 8px 10px; border-radius: 8px;
  background: var(--warn-soft); font-size: 13px; color: var(--ink-2); }
.vx-need .vx-fill { margin-left: auto; }
@media (max-width: 760px) { .vx-dl { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .vx-dl { grid-template-columns: 1fr; } }
/* A folding part of a page (ui.js foldable): its summary is its heading, with a chevron that turns. */
details.fold { border-top: 1px solid var(--line-2); }
details.fold > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; list-style: none; font-weight: 600; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 4px 0 2px; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary .fold-sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.field.missing label.lbl::after { content: " •"; color: var(--warn); }
.field .saved { font-size: 11px; color: var(--good); margin-left: 6px; font-weight: 600; }
.repeat { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.repeat-row { padding: 12px; border-bottom: 1px solid var(--line-2); position: relative; }
.repeat-row:nth-child(even) { background: var(--sunk); }
.repeat-row .rm { position: absolute; top: 8px; right: 8px; }
/* A row's own action (a job's "Find on Companies House", round 16): above its answers, clear of the remove button. */
.repeat-row > .row-acts { display: flex; justify-content: flex-end; padding-right: 44px; margin-bottom: 8px; }
.chf-officers-h { margin-top: 8px; }
.chf-by-row { align-items: center; gap: 8px; margin-bottom: 6px; }
.chf-by-row .lbl { margin: 0; }
/* Sign-in: "This is a shared computer" (round 17). */
.shared-pc { align-items: flex-start; gap: 8px; line-height: 1.4; }
.shared-pc input { margin-top: 3px; }
/* The library (round 16): each saved text's words as typed, the first lines of a long one. */
.lib-list { display: grid; gap: 12px; }
.lib-body { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.5em; overflow: hidden; margin-bottom: 6px; }
#lib-copy { width: 100%; }
.chf-officer-cos { display: grid; gap: 4px; padding-left: 16px; border-left: 2px solid var(--line); margin: 4px 0 6px 8px; }
.repeat-foot { padding: 8px 12px; background: var(--sunk); display: flex; gap: 8px; align-items: center; }
.addr { position: relative; }
.addr-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--raised); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-2); z-index: 30; max-height: 280px; overflow: auto; }
.addr-results button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: transparent; cursor: pointer; }
.addr-results button:hover, .addr-results button.sel { background: var(--accent-soft); }
.addr-parts { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr 0.9fr; gap: 8px; margin-top: 8px; }
@media (max-width: 760px) { .addr-parts { grid-template-columns: 1fr 1fr; } .addr-parts > [data-part-of="line1"] { grid-column: 1 / -1; } }
/* An address by hand (round 19, owner, 8 November 2026; forms.js addressHtml): the finder with "Type the address yourself"
   beside it, then the five parts, each a box with its name over it, and a line under them (what was filled in, or a postcode
   to check). Its own block, whatever the email composer's address chips do with .addr. */
.addr[data-addr] { display: block; cursor: auto; word-break: normal; overflow-wrap: normal; }
.addr-find { position: relative; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addr-find .addr-q { flex: 1 1 260px; width: auto; min-width: 0; }
.addr-hand { flex: none; }
.addr-unhand { display: inline-block; margin: 0 0 2px; }
.addr-p { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.addr-pl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.addr-note { margin: 6px 0 0; }
.addr-note.warn { color: var(--warn); font-weight: 600; }
.addr-note.info { color: var(--ink-2); }
.addr-none { margin: 0; padding: 10px 12px; color: var(--ink-2); font-size: 13.5px; }
.sec-notes { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ------------------------------------------------------------ dialogs, drawers, toasts */
.scrim { position: fixed; inset: 0; background: rgba(7, 13, 24, .45); z-index: 80; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--raised); border-radius: 14px; box-shadow: var(--shadow-3); width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.dialog.wide { width: min(880px, 100%); }
.dialog-h { padding: 16px 20px 4px; }
.dialog-h h2 { margin: 0; font: 700 18px var(--f-display); }
.dialog-b { padding: 12px 20px; }
.dialog-f { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
/* A phone: a window is a sheet from the bottom of the screen. Its words scroll; its buttons
   stay in view at the bottom, the width of the screen, above the home bar, so Save is never
   at the end of a long form (review, 20 October 2026: New client, a lender, a firm). */
@media (max-width: 640px) {
  .scrim { place-items: end center; padding: 8px 0 0; padding-top: max(8px, env(safe-area-inset-top)); }
  .dialog, .dialog.wide { width: 100%; max-height: calc(100vh - 8px); max-height: calc(100dvh - 8px); border-radius: 16px 16px 0 0;
    display: flex; flex-direction: column; overflow: hidden; }
  .dialog-h { padding: 16px max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left)); }
  .dialog-b { padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .dialog-f { position: sticky; bottom: 0; z-index: 5; background: var(--raised); border-top: 1px solid var(--line-2);
    padding: 10px 16px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .dialog-f .btn { flex: 1 1 auto; }
}
/* The big pop-up (round 20, owner, 9 November 2026: "similar to uploaded but wider should also fit screen for mobile"; js/ui.js
   UI.panel): wide, as tall as the screen less a margin, the title and Close at the top and the buttons at the foot staying put
   while the middle scrolls. On a phone, the whole screen, nothing wider than it. */
.dialog.popup { width: min(1180px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; outline: none; }
.popup-h { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); flex: none; }
.popup-t { flex: 1 1 auto; min-width: 0; }
.popup-h h2 { margin: 0; font: 700 20px var(--f-display); overflow-wrap: anywhere; }
.popup-sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.popup-x { flex: none; width: 40px; height: 40px; margin: -6px -8px 0 0; }
.popup-x svg { width: 20px; height: 20px; }
.popup-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 16px 20px; background: var(--bg); }
.popup-f { flex: none; border-top: 1px solid var(--line-2); padding: 12px 20px; }
.popup-b > .panel:first-child, .popup-b > section:first-child { margin-top: 0; }
.cp-embed-sub { margin: 0 0 12px; }
/* A quick look at a client, company or property (js/views/people.js Views.quickLook). */
.ql { display: flex; flex-direction: column; gap: 12px; }
.ql > .panel + .panel { margin-top: 0; }
.ql-kv dd { text-align: left; font-weight: 500; }
.ql-kv { grid-template-columns: minmax(110px, auto) 1fr; }
.ql-need-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ql-need-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ql-need-list li .grow { min-width: 0; overflow-wrap: anywhere; }
.ql-done { margin: 0; color: var(--good); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.quick-look .popup-f { justify-content: space-between; }
@media (max-width: 640px) {
  .scrim.popup-scrim { place-items: stretch; padding: 0; }
  .dialog.popup { width: 100%; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .popup-h { padding: 12px max(12px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); padding-top: max(12px, env(safe-area-inset-top)); }
  .popup-h h2 { font-size: 18px; }
  .popup-x { width: 44px; height: 44px; margin: -6px -6px 0 0; }
  .popup-b { padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); }
}
.toasts { position: fixed; bottom: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-2); max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }
.toast-link { color: inherit; text-decoration: underline; margin-left: 6px; }
/* Undo send (round 21): the line counting down, with its Undo button (js/views/mail.js Views.undoSend). */
.undo-toast { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toast-btn { background: transparent; color: inherit; border: 1.5px solid currentColor; border-radius: 999px; padding: 4px 14px; font: inherit; font-weight: 700; cursor: pointer; min-height: 32px; }
.toast-btn:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.toast-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toast-btn:disabled { opacity: .6; cursor: default; }
.banner { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-weight: 600; margin-bottom: 14px; }
.banner.info { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------ misc widgets */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.warn span { background: var(--warn); }
.meter.bad span { background: var(--bad); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 15px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }
.task { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; }
.task input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .due { font-size: 11.5px; color: var(--muted); }
.note { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.note:last-child { border-bottom: 0; }
.note .h { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.note .b { white-space: pre-wrap; margin-top: 3px; overflow-wrap: anywhere; }
.note.pinned { background: var(--warn-soft); margin: 0 -16px; padding: 10px 16px; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
/* Several files at once (round 19, owner, 8 November 2026; js/ui.js uploadList): a line each, its name and size, its own bar
   while it goes, then Uploaded (a tick) or Not uploaded with why and Try again. On a phone the words go under the name. */
.upl { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.panel-b.flush > .upl { margin: 0 16px 12px; }
.upl-line { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; grid-template-areas: "ic name size acts" "ic said said acts" "ic bar bar acts"; align-items: center; gap: 0 10px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 13.5px; }
.upl-ic { grid-area: ic; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); align-self: start; margin-top: 2px; }
.upl-line[data-state="sending"] .upl-ic { border-top-color: var(--accent); animation: spin .7s linear infinite; }
.upl-line[data-state="done"] .upl-ic { border: 0; background: var(--good); }
.upl-line[data-state="done"] .upl-ic::after { content: "✓"; display: grid; place-items: center; height: 100%; color: var(--surface); font: 700 11px/1 var(--f-body); }
.upl-line[data-state="failed"] { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); }
.upl-line[data-state="failed"] .upl-ic { border: 0; background: var(--bad); }
.upl-line[data-state="failed"] .upl-ic::after { content: "!"; display: grid; place-items: center; height: 100%; color: var(--surface); font: 700 12px/1 var(--f-body); }
.upl-name { grid-area: name; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.upl-size { grid-area: size; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.upl-said { grid-area: said; min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.upl-line[data-state="done"] .upl-said { color: var(--good); font-weight: 600; }
.upl-line[data-state="failed"] .upl-said { color: var(--bad); font-weight: 600; }
.upl-bar { grid-area: bar; width: 100%; height: 6px; margin-top: 4px; accent-color: var(--accent); }
.upl-acts { grid-area: acts; display: flex; align-items: center; gap: 2px; }
.upl-acts [hidden] { display: none; }
/* What each of several files is (js/views/case.js askFiles): a row each, its name, then what it is and its date beside it. */
.fk-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.fk-name { grid-column: 1 / -1; overflow-wrap: anywhere; }
.fk-all { padding: 10px 12px; border-radius: 10px; background: var(--sunk); }
@media (max-width: 640px) { .fk-row { grid-template-columns: minmax(0, 1fr); } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; display: grid; place-items: center; }

/* ------------------------------------------------------------ sign-in */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font: 700 24px var(--f-display); margin: 0 0 4px; }

/* ------------------------------------------------------------ print (owner: "on screen and printed summary") */
.print-only { display: none; }
@media print {
  :root { --bg: #fff; --surface: #fff; --sunk: #f5f5f5; --ink: #000; --muted: #444; --line: #ccc; --line-2: #ddd; }
  body { font-size: 11px; }
  .nav, .topbar, .no-print, .toasts, .btn, .icon-btn { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .rail, .cs-foot, .cs-move-here { display: none !important; }
  .case-parts > .rail-off { display: flex !important; }
  a { color: #000; }
}

/* charts: hover tooltip and read-only role */
.tip { position: fixed; z-index: 120; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 10px; border-radius: 8px;
  font-size: 12px; line-height: 1.4; box-shadow: var(--shadow-2); max-width: 260px; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .mark, .chart .mark:hover { opacity: .82; }
.chart text { fill: var(--muted); font: 11px var(--f-body); }
.chart .grid line { stroke: var(--line-2); }
.read-only [data-write] { display: none !important; }
.sum-sec { break-inside: avoid; margin-bottom: 14px; }
.sum-sec h4 { margin: 0 0 6px; font: 700 13px var(--f-display); text-transform: uppercase; letter-spacing: .05em; color: var(--accent-2); }
dl.sum { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
dl.sum dt { color: var(--muted); }
dl.sum dd { margin: 0; font-weight: 500; }
/* A lender's form laid out part by part (owner, 21 October 2026). */
.pack-part { margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--line-2); font: 600 14px var(--f-display); color: var(--ink); break-after: avoid; }
.pack-layout dl.sum dd { overflow-wrap: anywhere; }
/* The rows share one set of columns (subgrid), so every bar's track is the same length and equal values draw equal bars
   (review, 28 October 2026: "4 · £1.09m" took more room than "4 · £883k", so the same 4 cases drew a shorter bar). */
.hbars { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 6px 10px; }
.hbar { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; color: var(--ink); text-decoration: none; font-size: 13px; }
.hbar:hover { text-decoration: none; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 10px; background: var(--sunk); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar-t span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-v { min-width: 58px; font-weight: 600; text-align: right; }
/* Numbers & pipeline's Team and Lenders: side by side only where the Team table fits beside the bars, else one above the
   other (review, 28 October 2026: at 1366px the table was cut off at Open now, with no sign it scrolled). */
.grid.dash-team-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 660px), 1fr)); }
.pipe-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (max-width: 900px) { .pipe-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pipe-col { padding: 10px 12px; border-radius: 10px; background: var(--sunk); border-top: 3px solid var(--sc); color: var(--ink); text-decoration: none; display: block; }
.pipe-col:hover { text-decoration: none; background: var(--accent-soft); }
.pipe-col .n { font: 700 24px var(--f-display); font-variant-numeric: tabular-nums; }
.pipe-col .l { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pipe-col .s { font-size: 11.5px; color: var(--muted); }

.seg svg, .chip svg { width: 15px; height: 15px; vertical-align: -3px; }
.wf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 12px 14px; }
@media (max-width: 900px) { .wf-grid { grid-template-columns: 1fr 1fr; } }
.grid > .panel + .panel { margin-top: 0; }
.tbl td.mono { white-space: nowrap; }
/* Phone widths: nothing may push the page sideways. */
.grid > *, .tiles > * { min-width: 0; }
.seg { flex-wrap: wrap; max-width: 100%; }
.panel-h { flex-wrap: wrap; }
/* A panel's row of buttons wraps rather than pushing a phone's page sideways (round 19 audit: Compare products from a case,
   Add all to the options, Copy formatted table and Download spreadsheet, was 499px wide on a 390px phone). */
.panel-h .actions { flex-wrap: wrap; max-width: 100%; min-width: 0; }
.page-head .actions { max-width: 100%; }
@media (max-width: 640px) {
  .page-head .actions { margin-left: 0; width: 100%; }
  .queue-item { grid-template-columns: 5px 1fr; }
  .queue-item > :last-child { display: none; }
  .pipe-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .wf-grid { grid-template-columns: 1fr; } .wf-grid > * { grid-column: auto !important; } }
.tbl td .row { flex-wrap: nowrap; white-space: nowrap; }

/* Touch screens: every control is at least 44px tall, whatever the width. A small control
   (the board's ⋯, a To-do tick) keeps its look but gets a 44px area to press (review, 20 October 2026). */
@media (pointer: coarse) {
  .btn, .btn.sm, .nav a, input:not([type=checkbox]):not([type=radio]), select, textarea, .seg button { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .todo-tick input[type=checkbox] { width: 22px; height: 22px; }
  .todo-tick { min-width: 44px; min-height: 44px; margin: -10px -4px -10px -12px; padding: 0; }
  .card-move.icon-btn { min-width: 44px; min-height: 44px; margin: -12px -12px -8px 0; }
}
/* A field someone can't change looks it: greyed, with a not-allowed pointer. */
input:disabled, select:disabled, textarea:disabled { background: var(--sunk); color: var(--muted); border-style: dashed; cursor: not-allowed; opacity: 1; }

/* ------------------------------------------------------------ messaging and captures (js/views/convo.js, captured.js)
   Team messages, the Discussion panel, the Captured inbox and the Capture dialog.
   Colours come from the tokens above, so light and dark both work. */
.hide-sm { margin-left: 2px; }
@media (max-width: 640px) { .hide-sm { display: none; } #capture-btn { padding: 7px 9px; } }
.msg-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-layout > .panel + .panel { margin-top: 0; }
.msg-list .panel-h .seg { width: 100%; }
.msg-list .seg button { flex: 1; padding: 6px 8px; font-size: 13px; }
.thread-items { max-height: calc(100vh - 260px); max-height: calc(100dvh - 260px); overflow-y: auto; }
.thread-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; min-width: 0; }
.thread-item:hover { background: var(--sunk); text-decoration: none; }
.thread-item.on { background: var(--accent-soft); }
.thread-item.unread b { color: var(--accent-2); }
.thread-item .preview { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-main { min-width: 0; }
.chat-head h2 { overflow-wrap: anywhere; }
.back-btn { display: none; }
@media (max-width: 760px) {
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .msg-layout.has-thread .msg-list { display: none; }
  .msg-layout:not(.has-thread) .msg-main { display: none; }
  .back-btn { display: inline-grid; }
  .thread-items { max-height: none; }
  /* An open conversation fills the screen under the top bar, like WhatsApp: the page heading
     steps aside, the messages scroll in the middle and the message box sits at the bottom,
     ready to type in (review, 20 October 2026: it was below the fold). */
  .page-head.msg-head-thread { display: none; }
  .msg-layout.has-thread .msg-main { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h, 61px) - 24px); margin: 0; }
  .msg-layout.has-thread .chat-head { padding-top: 8px; padding-bottom: 8px; }
  .msg-layout.has-thread .chat-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .msg-layout.has-thread .chat { flex: 1; min-height: 0; }
  .msg-layout.has-thread .chat-log { flex: 1; min-height: 0; max-height: none; }
  .msg-layout.has-thread .chat-compose { padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-log { max-height: min(60vh, 560px); min-height: 160px; overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; }
.discussion-panel { margin: 16px 0; }
.discussion-panel .panel-b { padding: 0; }
.discussion-panel .chat-log { max-height: 420px; }
.chat-day { text-align: center; font-size: 11.5px; color: var(--muted); margin: 6px 0 2px; }
.chat-day span { background: var(--sunk); border-radius: 999px; padding: 2px 10px; }
.chat-more { text-align: center; }
.msg { max-width: 88%; align-self: flex-start; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 12px; padding: 7px 11px; min-width: 0; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.mentions-me { border-color: var(--accent); }
.msg.removed { background: transparent; border-style: dashed; font-style: italic; font-size: 13px; }
.msg.system { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.msg-h { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.msg-h b { color: var(--ink); font-size: 13px; }
.msg-h .avatar { width: 20px; height: 20px; font-size: 9px; }
.msg-b { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.msg-b .mention, .mention { color: var(--accent-2); font-weight: 600; }
.msg-quote { border-left: 3px solid var(--accent); padding: 2px 8px; margin: 4px 0; font-size: 12.5px; color: var(--ink-2); background: var(--surface); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.msg-task { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.msg-task svg { width: 14px; height: 14px; }
.msg-actions { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 3px; opacity: .55; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions .btn.sm { padding: 2px 6px; font-size: 12px; }
.msg-files { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.file-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.file-chip .thumb { display: block; max-width: min(240px, 100%); max-height: 180px; border-radius: 8px; border: 1px solid var(--line); }
.file-chip .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-compose { border-top: 1px solid var(--line-2); padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.compose-row { position: relative; }
.compose-row textarea { min-height: 52px; }
.compose-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.compose-files:empty { display: none; }
.compose-actions { margin-top: 6px; }
.compose-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar { display: flex; gap: 8px; align-items: center; font-size: 12.5px; background: var(--sunk); border-left: 3px solid var(--accent); padding: 4px 8px; margin-bottom: 6px; border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.mention-pick { position: absolute; left: 0; bottom: calc(100% + 4px); min-width: 220px; max-width: 100%; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); z-index: 30; padding: 4px; }
.mention-pick button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.mention-pick button.sel, .mention-pick button:hover { background: var(--accent-soft); }
.edit-box { width: 100%; }
/* Captured */
.cap-address .addr, .cap-help .addr, .addr { overflow-wrap: anywhere; word-break: break-all; }
.panel.cap-address { margin-bottom: 14px; }
/* Capture: a file that didn't upload stays, saying so, with Try again; files dropped on the window are added (round 19). */
.chip.cap-failed { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); white-space: normal; }
.cap-not { color: var(--bad); font-weight: 700; }
.cap-dialog.over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }
.cap-filters { margin-bottom: 12px; }
.cap-filters input[type=search] { min-width: 0; max-width: 360px; }
.cap-sec { font: 700 12px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; }
.cap-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); min-width: 0; }
.cap-card.unfiled { border-left: 4px solid var(--accent); }
.cap-card.unknown { border-left-color: var(--bad); }
.cap-card.compact { align-self: stretch; margin: 0; box-shadow: none; background: var(--sunk); }
.cap-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cap-h > svg { width: 16px; height: 16px; color: var(--muted); }
.cap-from { overflow-wrap: anywhere; }
.cap-subject { font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.cap-lines { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.cap-line { overflow-wrap: anywhere; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cap-line time { color: var(--muted); font-size: 12px; }
.cap-meta { margin-top: 6px; gap: 4px 12px; }
.cap-refused { color: var(--warn); margin-top: 4px; overflow-wrap: anywhere; }
.cap-actions { margin-top: 8px; }
.cap-body-box { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; background: var(--bg); }
.transcript { display: flex; flex-direction: column; gap: 6px; }
.transcript.mini { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.cap-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cap-note { font-size: 13px; background: var(--sunk); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cap-help summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.cap-help p { font-size: 13px; color: var(--ink-2); }
.rec-pick { position: relative; }
.rec-results { position: absolute; left: 0; right: 0; top: calc(100% - 30px); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); z-index: 30; max-height: 240px; overflow: auto; }
.rec-results button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: transparent; cursor: pointer; overflow-wrap: anywhere; }
.rec-results button:hover { background: var(--accent-soft); }
.rec-sugg { margin-top: 6px; gap: 6px; }
.rec-sugg .chip, .rec-chosen .chip { white-space: normal; text-align: left; max-width: 100%; }
.rec-chosen .chip .icon-btn { padding: 0; color: inherit; }
.people-pick .chip input { width: auto; min-height: 0; }
/* ---------------------------------------------------------------------------
   Sign-in security (owner, 19 October 2026): the two-step screens, recovery
   codes, Account & security, and controls only advisers and owners see.
   --------------------------------------------------------------------------- */
.not-senior [data-senior] { display: none !important; }
.code-in { font: 600 22px/1.2 var(--f-mono); letter-spacing: .25em; text-align: center; }
.enrol-steps { padding-left: 20px; margin: 12px 0 16px; display: grid; gap: 10px; }
.enrol-steps li { padding-left: 2px; }
/* The QR code stays dark on white in dark mode too: scanners need the contrast. */
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; margin: 10px 0; width: min(220px, 100%); }
.qr { display: block; width: 100%; height: auto; }
.secret { font-size: 15px; letter-spacing: .08em; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; margin-top: 6px; overflow-wrap: anywhere; user-select: all; }
.rc-list { list-style: none; padding: 12px; margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px;
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; user-select: all; }
.account .panel + .panel { margin-top: 16px; }
.account #signins td { vertical-align: top; }
@media (max-width: 640px) { .rc-list { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ cases, round 2: lender applications, bridge → exit,
   copying, fact-finds, the Companies House check (owner, 19 October 2026). Tokens only, so light and dark both work. */
.tbl.apps { min-width: 100%; }
.tbl.apps th[scope="row"] { position: static; background: var(--sunk); text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; width: 1%; }
.tbl.apps thead th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); min-width: 170px; white-space: normal; }
.tbl.apps td { vertical-align: top; min-width: 170px; }
.tbl.apps td .prod-status { margin-top: 6px; width: 100%; }
.tbl.apps .app-closed, .tbl .app-closed { opacity: .6; }
/* A case's lender applications in groups (round 9, owner, 21 October 2026): Applying with, Options, then the closed ones. */
.apps-group + .apps-group { border-top: 1px solid var(--line-2); }
.apps-group-h { margin: 0; padding: 12px 16px 6px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.apps-group-h .n { font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.apps-none { margin: 0; padding: 4px 16px 14px; color: var(--ink-2); font-size: 13.5px; }
.tbl.apps td.nowrap [data-apply] { margin-right: 6px; }
/* Valuation back (owner, 22 October 2026): the button under an application's progress, and the card above the groups that
   works the loan out again at the lender's valuation. Tokens only, so light and dark both work. */
.app-val-btn { margin-top: 8px; }
.val-wrap { border-bottom: 1px solid var(--line-2); }
.val-quiet { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.val-card { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 10px; background: var(--warn-soft); padding: 12px 14px; color: var(--ink); min-width: 0; }
.val-card[data-works="0"] { border-left-color: var(--bad); }
.val-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.val-head h3 { margin: 0; font: 700 15px var(--f-display); }
.val-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 0 0 10px; }
.val-compare > div { min-width: 0; }
.val-compare dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.val-compare dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.val-before { color: var(--ink-2); text-decoration: line-through; }
.val-limits { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
.val-limits li.bites { font-weight: 600; }
.val-verdict { margin: 0 0 10px; overflow-wrap: anywhere; }
.val-acts { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.val-own-row { gap: 8px; align-items: stretch; flex-wrap: wrap; }
.val-own-row .money-wrap { flex: 0 1 200px; min-width: 0; }
.val-ticks { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; min-width: 0; }
.val-ticks label { align-items: flex-start; gap: 8px; }
.val-ticks input { margin-top: 3px; }
.val-msg { margin: 0; color: var(--bad); font-weight: 600; }
.val-compare-links { margin-top: 10px; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .val-compare { grid-template-columns: 1fr; }
  .val-own-row .money-wrap { flex: 1 1 100%; }
  .val-own-row .btn, .val-main .btn, .val-compare-links .btn { flex: 1 1 auto; }
}
.tbl.apps [data-applying], .app-card [data-applying] { margin-left: 6px; vertical-align: middle; }
.chain { margin: 0 0 12px; border-left: 4px solid var(--accent); }
.chain-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 600; }
.chain-line svg { width: 17px; height: 17px; color: var(--accent); }
.chain-arrow { color: var(--muted); font-weight: 700; }
.chain-actions { margin-bottom: 12px; }
.chain .chain-actions { margin-bottom: 0; }
.copy-ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; border: 0; padding: 0; margin: 0; }
.copy-ticks legend { grid-column: 1 / -1; }
.copy-tick { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; }
.copy-tick input { margin-top: 3px; }
@media (max-width: 640px) { .copy-ticks { grid-template-columns: 1fr; } }
.copy-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pick-app { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.pick-app label { align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; }
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flag { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 10px; background: var(--info-soft); color: var(--ink); }
.flag-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--f-body); color: #fff; background: var(--info); }
.flag.good { background: var(--good-soft); } .flag.good .flag-icon { background: var(--good); color: var(--surface); }
.flag.warn { background: var(--warn-soft); } .flag.warn .flag-icon { background: var(--warn); color: var(--surface); }
.flag.bad { background: var(--bad-soft); } .flag.bad .flag-icon { background: var(--bad); color: var(--surface); }
.flag.info .flag-icon { color: var(--surface); }
.ch-people-wrap { margin-top: 14px; }
.ch-h { font: 700 14px var(--f-display); margin: 14px 0 6px; }
.ch-acts { text-align: right; }
.ch-acts .btn { margin: 2px 0; }
.ch-note { font-size: 10.5px; font-weight: 600; color: var(--accent-2); background: var(--accent-soft); border-radius: 999px; padding: 0 6px; margin-left: 4px; white-space: nowrap; }
/* Long reasons (a bridge's exit deadline, a lender's name) wrap rather than push a phone sideways. */
.queue-item .reasons .badge { white-space: normal; text-align: left; }
.app-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; flex-wrap: wrap; }
.app-row:last-child { border-bottom: 0; }
.app-row:hover { text-decoration: none; background: var(--sunk); }
/* The fact-find's own styles are in css/factfind.css (round 11, owner, 25 October 2026). */
/* The case print preview on a phone screen (review, 20 October 2026: 895px wide): the
   toolbar wraps and the summary's lines break. Screen only: the printed page stays A4. */
.print-bar select { max-width: 100%; min-width: 0; }
@media screen and (max-width: 640px) {
  #doc > .panel-b { padding: 16px !important; }
  #doc .nowrap { white-space: normal; }
  #doc dd, #doc dt { min-width: 0; overflow-wrap: anywhere; }
}
@media print {
  @page { size: A4; margin: 15mm 14mm; }
  .sum-sec { break-inside: avoid; }
  .chain-actions, .ch-note { display: none !important; }
}
/* ---------------------------------------------------------------- data protection, Trash, Activity
   (public/js/views/dataprot.js). Tokens only, so light and dark both work. */
.dp-banner { margin: -6px 0 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); overflow-wrap: anywhere; }
.dp-banner b { margin-right: 4px; }
.dp-line { overflow-wrap: anywhere; }
.dp-actions { gap: 6px; }
.dp-h { margin: 0 0 4px; font: 700 14px var(--f-display); }
.settings-ext { margin-top: 16px; }
.act-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.act-filters > * { min-width: 0; }
.act-record { position: relative; grid-column: span 2; }
.act-record .search-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; }
.act-record .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-search { grid-column: span 2; }
.act-set { margin-top: 10px; }
.act-set[hidden] { display: none; }
@media (max-width: 900px) { .act-record, .act-search { grid-column: 1 / -1; } .act-filters { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------ email (connected mailboxes, feat/mail) */
.mail { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mail[hidden] { display: none; }
.mail > .panel + .panel { margin-top: 0; }
.mail-list { min-width: 0; position: sticky; top: 70px; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); display: flex; flex-direction: column; }
.mail-tools { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.mail-tools .seg { align-self: flex-start; }
.mail-rows { overflow-y: auto; min-height: 0; }
.mail-row { padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; min-width: 0; border-left: 3px solid transparent; }
.mail-row:hover { background: var(--sunk); }
.mail-row.sel { background: var(--accent-soft); }
.mail-row.is-new { border-left-color: var(--s-new); }
.mail-row-top { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; min-width: 0; }
.mail-row-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail-subj { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subj svg, .mail-att svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: var(--muted); }
.mail-snip { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-more { padding: 10px; text-align: center; }
.mail-read { min-width: 0; min-height: 320px; }
.mail-msg { padding: 14px 16px; min-width: 0; }
.mail-head h2 { font: 700 18px/1.3 var(--f-display); margin: 6px 0 8px; overflow-wrap: anywhere; }
.mail-meta { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.mail-actions { margin: 10px 0 4px; }
.mail-sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.mail-sugg .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-atts { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.mail-att { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); flex-wrap: wrap; min-width: 0; }
.mail-att .grow { min-width: 0; overflow-wrap: anywhere; }
.mail-body { margin-top: 10px; }
.mail-imgs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
/* Email HTML is designed for white paper: it keeps a white page in dark mode too. */
.mail-frame { display: block; width: 100%; height: 60vh; min-height: 120px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; resize: vertical; overflow: auto; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 var(--f-body); margin: 0; }
.mail-back { display: none; }
.mail-empty { margin-bottom: 16px; }
.mail-empty p { margin: 6px 0 12px; }
.bad-banner { background: var(--bad-soft); color: var(--bad); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mbox { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 6px; }
.mbox + .mbox { margin-top: 10px; }
.mbox-err { color: var(--bad); }
.mbox-connect { padding-top: 12px; border-top: 1px solid var(--line-2); }
.picks { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 240px; overflow-y: auto; }
.pick { display: flex; gap: 8px; align-items: center; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; flex-wrap: wrap; }
.pick:hover { background: var(--sunk); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick .grow { min-width: 0; overflow-wrap: anywhere; }
.mthread + .mthread { border-top: 1px solid var(--line-2); }
.mthread-h { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 16px; border: 0; background: transparent; cursor: pointer; min-width: 0; }
.mthread-h:hover { background: var(--sunk); }
.mthread-s { font-weight: 600; overflow-wrap: anywhere; }
.mthread-b { padding: 0 16px 10px; }
.mmsg { padding: 8px 10px; border-left: 3px solid var(--line); margin-top: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mail-dialog .mail-msg { padding: 0; }
.mail-dialog .mail-head h2 { display: none; }

/* ------------------------------------------------------------ email, the full experience (feat/email) */
.mail-tools select { width: 100%; }
.mail-views button { padding: 6px 10px; }
.seg-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--s-new); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.mail-bulk { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid var(--line-2); background: var(--accent-soft); }
.mail-bulk[hidden], .mail-newpill[hidden] { display: none; }
.mail-bulk svg { width: 14px; height: 14px; }
.mail-newpill { position: sticky; top: 4px; z-index: 2; align-self: center; margin: 6px auto -34px; border: 0; border-radius: 16px; padding: 6px 14px; background: var(--s-new); color: #fff; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-2); }
.mail-row { display: flex; gap: 10px; align-items: flex-start; }
.mail-row-main { flex: 1; min-width: 0; }
.mail-row-top .grow { flex: 1; }
.mail-row-tags { margin-top: 3px; gap: 4px; }
.mail-check { padding: 2px 0 0; cursor: pointer; }
.mail-check input { width: 17px; height: 17px; accent-color: var(--accent); min-height: 0 !important; }
.mail-row.unread { border-left-color: var(--s-new); }
.mail-row.unread .mail-row-top b, .mail-row.unread .mail-subj { font-weight: 800; color: var(--ink); }
.mail-row:not(.unread) .mail-row-top b { font-weight: 500; }
.mail-row.checked { background: var(--accent-soft); }
.mail-row.fresh { animation: mail-fresh 2.4s ease-out 1; }
@keyframes mail-fresh { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .mail-row.fresh { animation: none; } }
.mail-hint { margin: 0 0 10px; }
/* Round 9: when mail was last checked, and a line when automatic checking has fallen behind. */
.mail-sync-line { margin: -10px 0 10px; }
.mail-behind { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 500; }
.mail-toolbar { gap: 6px; }
.mail-toolbar svg, .mc-actions svg { width: 14px; height: 14px; vertical-align: -2px; }
.mail-thread { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mc { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); min-width: 0; }
.mc.unread { border-left: 3px solid var(--s-new); }
.mc-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; padding: 10px 12px; cursor: pointer; min-width: 0; }
.mc-head:hover { background: var(--sunk); }
.mc-from { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.mc-snip { padding: 0 12px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mc-body[hidden] { display: none; }
.mc-state:empty { display: none; }
.mc-quoted { align-self: flex-start; }
.mail-quoted { color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; }
.mbox-rules ul.rules { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; }
.mbox-rules li { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; overflow-wrap: anywhere; }

/* The composer: a large sheet on a desktop, the whole screen on a phone. */
.compose-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(7, 13, 24, .35); display: grid; place-items: center; padding: 16px; }
.compose { background: var(--raised); border-radius: 14px; box-shadow: var(--shadow-3); width: min(820px, 100%); height: min(88vh, 900px); display: flex; flex-direction: column; min-width: 0; }
.compose-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
/* Full screen on a phone: clear of the notch at the top (the buttons clear the home bar, .compose-f). */
@media (max-width: 900px) { .compose-h { padding-top: calc(12px + env(safe-area-inset-top)); } }
.compose-h h2 { font: 700 17px/1.3 var(--f-display); margin: 0; }
.compose-h svg { width: 16px; height: 16px; }
.compose-b { flex: 1; overflow-y: auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.compose-f { display: flex; gap: 8px; align-items: center; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.compose-f svg { width: 15px; height: 15px; vertical-align: -3px; }
.cf { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; }
.cf[hidden] { display: none; }
.cf .lbl { margin: 0; }
.cf > select, .cf > input { width: 100%; grid-column: 2 / 4; border: 0; background: transparent; padding-left: 0; }
.cf-more { font-size: 13px; white-space: nowrap; }
.addr { position: relative; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; cursor: text; }
.addr-chips { display: contents; }
.addr-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 9px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-2); font-size: 13.5px; overflow-wrap: anywhere; }
.addr-chip.bad { background: var(--bad-soft); color: var(--bad); }
.addr-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.addr-in { flex: 1; min-width: 120px; border: 0 !important; background: transparent !important; padding: 4px 0 !important; box-shadow: none !important; }
.addr-sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-2); max-height: 260px; overflow-y: auto; }
.addr-sugg[hidden] { display: none; }
.addr-opt { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; cursor: pointer; overflow-wrap: anywhere; color: var(--ink); }
.addr-opt.on, .addr-opt:hover { background: var(--accent-soft); }
.rt-bar { display: flex; gap: 4px; align-items: center; padding: 4px 0; flex-wrap: wrap; }
.rt-bar button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 3px 10px; cursor: pointer; min-height: 32px; }
.rt-bar button:hover { background: var(--sunk); }
.compose-editor { flex: 1; min-height: 200px; padding: 10px 2px; outline: none; overflow-wrap: anywhere; font: 15px/1.55 var(--f-body); }
.compose-editor:focus-visible { outline: none; }
.compose-editor ul { padding-left: 22px; }
.compose-editor [data-signature] { color: var(--ink-2); margin-top: 12px; }
.compose-editor img { max-width: 100%; height: auto; }
.compose-editor img.remote-img { display: inline-block; min-width: 24px; min-height: 16px; background: var(--sunk); border: 1px dashed var(--line); }
.c-orig pre { max-height: 220px; overflow: auto; }
.c-files { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--sunk); font-size: 13.5px; max-width: 100%; overflow-wrap: anywhere; }
.file-chip svg { width: 13px; height: 13px; }
.file-chip.busy { opacity: .7; }
/* A file that didn't attach says why, with Try again (round 19); files dropped on the window are attached too. */
.file-chip.failed { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); }
.file-chip.failed .muted { color: var(--bad); font-weight: 600; }
.file-chip .file-retry { font-size: 12.5px; font-weight: 700; color: var(--link); text-decoration: underline; }
.compose.over { outline: 2px dashed var(--accent); outline-offset: -6px; }
#lib-out.over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 12px; background: var(--accent-soft); }
.file-chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) {
  /* Phone and narrow screens: the list, then the message. */
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail-list { position: static; max-height: none; }
  .mail .mail-read { display: none; }
  .mail.reading .mail-list { display: none; }
  .mail.reading .mail-read { display: block; }
  .mail-back { display: inline-flex; }
  .compose-scrim { padding: 0; }
  .compose { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .cf { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .mail-toolbar .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------ Today (the home page) */
.today-tiles .today-tile { text-decoration: none; color: inherit; display: block; border-left: 4px solid var(--line); }
.today-tiles .today-tile:hover { background: var(--sunk); }
.today-tiles .today-tile.bad { border-left-color: var(--bad); }
.today-tiles .today-tile.warn { border-left-color: var(--warn); }
.today-tiles .today-tile.zero .v { color: var(--muted); }
.today-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.today-side .panel { margin: 0; }
.today-line { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; min-width: 0; }
.today-line:last-child { border-bottom: 0; }
.today-line:hover b { text-decoration: underline; }
.today-task { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; min-width: 0; }
.today-task .grow { min-width: 0; overflow-wrap: anywhere; }
.today-task.done b { text-decoration: line-through; color: var(--muted); }
.today-more { display: block; padding: 10px 14px; font-size: 13px; font-weight: 600; }
#td-now, #td-tasks { margin-bottom: 14px; }

/* ------------------------------------------------------------ To-do, and tasks made from captures (feat/tasks) */
.todo-filters { margin-bottom: 14px; gap: 8px 12px; }
.todo-filters select { width: auto; max-width: 100%; min-width: 0; }
.todo-filters label.row { gap: 6px; }
.todo-group + .todo-group { margin-top: 14px; }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.todo:last-child { border-bottom: 0; }
.todo-tick { flex: none; display: inline-grid; place-items: center; margin: 0 -4px 0 -6px; padding: 3px 4px 0 6px; cursor: pointer; }
.todo-tick input[type=checkbox] { margin: 0; width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.todo-main { flex: 1; min-width: 0; }
.todo-t { font-weight: 600; overflow-wrap: anywhere; }
.todo.done .todo-t { text-decoration: line-through; color: var(--muted); }
.todo-m { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; color: var(--ink-2); min-width: 0; }
.todo-src { overflow-wrap: anywhere; min-width: 0; }
.todo-none { padding: 10px 14px; margin: 0; }
/* View, Snooze and More on a task, and what it was made from (owner, 22 October 2026; js/views/tasks.js). */
button.todo-t { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
button.todo-t:hover, button.todo-t:focus-visible { text-decoration: underline; }
.todo-acts { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.todo.snoozed .todo-t { color: var(--ink-2); }
.task-from { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--sunk); min-width: 0; overflow-wrap: anywhere; }
.task-from .tf-h { font-weight: 600; font-size: 13px; }
.task-from .tf-m { color: var(--ink-2); margin-top: 2px; }
.task-from .tf-s { font-weight: 600; margin-top: 4px; }
.task-from .tf-w { white-space: pre-wrap; margin-top: 4px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task-from.full .tf-w { display: block; -webkit-line-clamp: unset; max-height: 50vh; overflow-y: auto; }
.task-from .tf-f { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; color: var(--ink-2); }
.task-from .tf-f svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.task-from .tf-yes { margin-top: 4px; }
.task-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 10px; }
.task-facts dt { color: var(--muted); }
.task-facts dd { margin: 0; overflow-wrap: anywhere; }
.task-source { margin-top: 10px; }
.task-source > a { display: inline-block; margin-top: 6px; }
.task-view-acts { margin-top: 12px; gap: 8px; }
/* Badges sparingly, and an empty view says what to do next (owner, 22 October 2026, the outside layout review). */
.task-state { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0 0 10px; }
.todo-due, .today-due { color: var(--ink-2); }
.todo-kind { font-weight: 600; color: var(--ink); }
.today-task .today-due { flex: none; }
.todo-empty p { margin: 4px auto 0; max-width: 46ch; }
.todo-empty .btn { margin-top: 12px; }
.snooze-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.snooze-opts .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: auto; padding: 8px 10px; text-align: left; }
.menu.task-menu { position: fixed; right: auto; top: 0; left: 0; min-width: 200px; z-index: 90; } /* above a dialog: More opens from a task opened in full too */
.menu.task-menu [role=menuitem].danger { color: var(--bad); }
.today-from { display: block; color: var(--ink-2); }
.today-task .today-view { flex: none; }
.task.snoozed .tt { color: var(--ink-2); }
.task-from-line { color: var(--ink-2); }
/* A task's title opens it: on a touch screen it is a 44px place to press, as every control is. */
@media (pointer: coarse) { button.todo-t { min-height: 44px; } }
@media (max-width: 640px) {
  .todo { flex-wrap: wrap; }
  .todo-main { flex-basis: calc(100% - 60px); }
  .todo-acts { width: 100%; justify-content: flex-start; padding-left: 40px; }
  .snooze-opts { grid-template-columns: minmax(0, 1fr); }
}
.today-src { overflow-wrap: anywhere; }
.cap-card.tasked { border-left: 4px solid var(--s-new); }
.cap-tasks { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cap-task { display: flex; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; min-width: 0; }
.cap-task svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--s-new); }
.cap-task.done b { text-decoration: line-through; color: var(--muted); }
.cap-task-box { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--sunk); }
.cap-task-on { flex-wrap: wrap; gap: 6px 8px; cursor: pointer; }
.cap-task-on input { width: 17px; height: 17px; accent-color: var(--accent); }
.cap-task-fields { margin-top: 10px; }
/* ------------------------------------------------------------ messages like WhatsApp (js/views/convo.js)
   Files waiting to be sent, photos as thumbnails, document tiles, the voice-note player
   and recorder, drag and drop, and the ticks: one grey (sent), two grey (delivered), two
   blue (seen). The blue is checked against the bubble: ≥ 3:1 in both themes. */
:root { --tick-seen: #1565c0; --rec: #c0362c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tick-seen: #64b5f6; --rec: #f0857a; } }
:root[data-theme="dark"] { --tick-seen: #64b5f6; --rec: #f0857a; }

.chat { position: relative; }
.compose-files { gap: 8px; }
.pend { position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); }
/* The photo is rounded itself, not cut by its tile, so the × in the corner can have a press area beyond it. */
.pend-photo { width: 64px; height: 64px; padding: 0; justify-content: center; }
.pend-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 9px; }
.pend-photo .spinner { position: absolute; inset: 0; margin: auto; background: var(--raised); }
.pend-doc { padding: 6px 30px 6px 8px; max-width: min(260px, 100%); }
.pend-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pend .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pend-x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--raised); color: var(--ink); box-shadow: var(--shadow-1); padding: 0; }
.pend-x svg { width: 14px; height: 14px; }
/* A file that didn't upload (round 19): its tile says so, the press tries it again. */
.pend-retry { position: absolute; left: 2px; right: 2px; bottom: 2px; padding: 2px 4px; border: 0; border-radius: 6px; background: var(--bad); color: var(--surface); font-size: 11px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.pend-doc .pend-retry { position: static; margin-left: 4px; }
.doc-ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface); color: var(--accent); flex: none; }
.doc-ico svg { width: 18px; height: 18px; }

.msg-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 120px)); gap: 4px; }
.msg-photos.one { grid-template-columns: minmax(0, 240px); }
.msg-photos .photo { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); cursor: zoom-in; aspect-ratio: 1; }
/* Fixed boxes, so a photo arriving after the conversation is drawn never pushes the newest message out of view. */
.msg-photos.one .photo { aspect-ratio: 4 / 3; }
.msg-photos img { display: block; width: 100%; height: 100%; object-fit: cover; min-height: 60px; }
.file-row { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.doc-tile { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: min(300px, 100%); padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.doc-tile:hover { background: var(--sunk); }
.doc-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.doc-meta .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.photo-view { display: grid; place-items: center; }
.photo-view img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; }

/* The voice-note player: play/pause, how far along, and the length. */
.vn { display: flex; align-items: center; gap: 8px; min-width: 0; width: min(280px, 100%); padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.vn-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.vn-play svg { width: 16px; height: 16px; }
.vn.loading .vn-play { opacity: .6; cursor: progress; }
.vn-seek { flex: 1; min-width: 60px; width: auto; padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
.vn-time { flex: none; min-width: 34px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vn.unplayable { border-radius: 10px; padding: 6px 8px; flex-wrap: wrap; }

/* Recording: a red dot, the time, Cancel. */
.vrec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; padding: 6px 10px; border-radius: 10px; background: var(--bad-soft); }
.vrec[hidden] { display: none; }
.vrec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: vrec-pulse 1.2s ease-in-out infinite; }
.vrec-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.vrec-note { min-width: 0; }
@keyframes vrec-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .vrec-dot { animation: none; } }
.mic-btn[aria-pressed="true"] { background: var(--rec); color: #fff; border-color: transparent; }

/* Drag and drop onto a conversation. */
.drop-hint { position: absolute; inset: 0; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: var(--r); background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--accent-2); font-weight: 600; pointer-events: none; z-index: 5; }
.drop-hint[hidden] { display: none; }

/* Ticks on my own messages. */
.ticks { display: inline-grid; place-items: center; padding: 0 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 4px; }
.ticks svg { width: 18px; height: 18px; }
.ticks.t-seen { color: var(--tick-seen); }
.msg-info .info-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.msg-info .info-person { display: inline-block; margin-right: 12px; }
@media (max-width: 480px) { .msg-info .info-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }


/* ------------------------------------------------------------ getting around, the Timeline, the board
   (feat/nav, owner, 19 October 2026: "very easy to navigate and use all around"; js/nav.js,
   js/views/timeline.js, js/views/cases.js). The board's own indented menu item went with it from the menu
   (owner, 22 October 2026: the board is a view of Cases). */
/* the "+ New" menu and other small menus */
.new-menu { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--raised); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-2); padding: 6px; z-index: 45; display: flex; flex-direction: column; }
.menu [role=menuitem] { display: flex; align-items: center; gap: 8px; justify-content: space-between; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); cursor: pointer; font-weight: 500; text-decoration: none; }
.menu [role=menuitem]:hover, .menu [role=menuitem]:focus-visible { background: var(--accent-soft); outline: none; }
.move-menu { position: fixed; right: auto; top: 0; left: 0; min-width: 180px; }
.search-results .recent-item .badge { flex: none; }
.search-results .recent-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keys td { padding: 6px 10px; }
/* rows are real links: the link looks like the row's main text */
a.row-link { color: inherit; text-decoration: none; }
a.row-link:hover { text-decoration: underline; }
a.queue-item { color: inherit; text-decoration: none; }
a.queue-item:hover { text-decoration: none; }

/* the case's sticky compact header */
.case-bar { position: sticky; top: var(--topbar-h, 57px); z-index: 15; display: flex; align-items: center; gap: 10px; min-width: 0; margin: -6px 0 8px;
  padding: 6px 0; background: var(--bg); border-bottom: 1px solid transparent; }
.case-bar.stuck { border-bottom-color: var(--line); box-shadow: 0 6px 12px -10px rgba(0, 0, 0, .25); }
.case-bar .cb-crumbs { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-bar .cb-id, .case-bar .cb-actions { display: none; align-items: center; gap: 8px; min-width: 0; }
.case-bar.stuck .cb-id, .case-bar.stuck .cb-actions { display: flex; }
.case-bar.stuck .cb-crumbs { display: none; }
.case-bar .cb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-bar { overflow: hidden; }
.case-bar.stuck .cb-id { flex: 1 1 0; }
.case-bar.stuck > .grow { display: none; }
.case-bar .cb-id .badge, .case-bar .cb-id .stage, .case-bar .cb-actions .btn { flex: none; }
.case-bar .cb-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.cb-step { font-size: 20px; line-height: 1; width: 32px; height: 32px; text-decoration: none; }
.cb-step:hover { text-decoration: none; }
.cb-step.off { opacity: .3; cursor: default; }
.case-parts .panel, .case-parts .cs-sec { scroll-margin-top: calc(var(--topbar-h, 57px) + 64px); }
@media (max-width: 760px) {
  .case-bar .cb-actions .btn span { display: none; }
  .case-bar .cb-actions [data-jump="p-timeline"] { display: none; }
  .case-bar { gap: 6px; }
  .case-bar .cb-id .stage { display: none; }
}

/* Activity: one list grouped by London day, on its page and on every record (owner, 20 October 2026) */
.tl-chip-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-h .tl-panel-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.tl-panel-actions select { width: auto; max-width: 190px; }
.tl-more-row { padding: 0 16px 16px; }
.tl-day + .tl-day { margin-top: 14px; }
.tl-day-h { position: sticky; top: var(--topbar-h, 57px); z-index: 2; margin: 0 0 4px; padding: 6px 0; background: var(--surface); font: 700 13px var(--f-display);
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.panel .tl .tl-day-h { position: static; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 44px 26px minmax(0, 1fr); gap: 0 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.tl-item:last-child { border-bottom: 0; }
.tl-time { font: 12.5px var(--f-mono); color: var(--muted); padding-top: 4px; }
.tl-item > .avatar { margin-top: 1px; }
.tl-body { min-width: 0; overflow-wrap: anywhere; padding-top: 2px; }
.tl-rec { font-size: 13px; }
.tl-text { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-run-btn { font-size: 13px; margin-top: 4px; }
.tl-run-list { list-style: none; margin: 6px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); }
.tl-run-list[hidden] { display: none; }
.tl-sub { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 8px; padding: 3px 0; font-size: 13px; color: var(--ink-2); }
@media (pointer: coarse) { .tl-run-btn { min-height: 44px; } }
@media (max-width: 520px) { .tl-item { grid-template-columns: 40px 26px minmax(0, 1fr); gap: 0 6px; } }
#tl-out { padding-top: 4px; }

/* the board */
.case-filters { margin-bottom: 12px; }
.case-filters select { width: auto; max-width: 100%; }
.case-filters input[type=search] { max-width: 260px; }
.board { max-width: 100%; scroll-snap-type: x proximity; }
.col { scroll-snap-align: start; }
.col-h .col-n { margin-left: auto; font: 700 12px var(--f-body); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.col-h .col-sum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-empty { padding: 8px; }
.card { position: relative; -webkit-touch-callout: none; }
.card.prio { border-left: 3px solid var(--star); }
.card.open { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card-top { display: flex; align-items: flex-start; gap: 6px; }
.card-top .card-link { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.card-top .card-link:hover { text-decoration: underline; }
.card-star { color: var(--star); font-weight: 700; }
.card-move { padding: 2px; margin: -3px -4px 0 0; }
.card .s.next { color: var(--ink-2); }
.card .badge.wait { background: var(--info-soft); color: var(--info); }
.card-tasks { display: inline-flex; align-items: center; gap: 3px; }
.card-tasks svg { width: 14px; height: 14px; }
.card-loan { color: var(--ink); }
.avatar.none { background: var(--line); color: var(--muted); }
.card-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; opacity: .92; box-shadow: var(--shadow-3); }
.board-phone { display: none; }
@media (max-width: 760px) {
  .board-phone { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .board-phone .lbl { margin: 0; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .board .col { display: none; max-height: none; }
  .board .col.phone-on { display: flex; }
  .case-filters input[type=search] { max-width: none; }
}
/* the quick view on the right */
.drawer { position: fixed; top: var(--topbar-h, 57px); right: 0; bottom: 0; width: min(420px, 100vw); z-index: 30; background: var(--raised);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-3); display: flex; flex-direction: column; }
.drawer-h { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.drawer-h h2 { margin: 2px 0; font: 700 18px var(--f-display); overflow-wrap: anywhere; }
.drawer-h .icon-btn { margin-left: auto; }
.drawer-b { padding: 12px 16px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; }
.drawer .kv { grid-template-columns: 110px minmax(0, 1fr); }
@media (max-width: 760px) { .drawer { top: 0; width: 100vw; z-index: 70; } .drawer-h { padding-top: calc(14px + env(safe-area-inset-top)); } }
.drawer .kv dd { text-align: left; font-weight: 500; }

/* ------------------------------------------------------------ phones and touch screens, on every page
   (owner, 20 October 2026: "make the whole site very mobile friendly and sized to view good on
   mobile"). Held page by page by test/browser/checks/23-phone-sweep.mjs, which reads the pages
   off the menu, so a new page is held to these too. Last in the file, so they win. */

/* iPhone Safari zooms into a box whose text is under 16px, and stays zoomed: on a phone or a
   touch screen every box to type in is 16px. The page never stops zooming (no maximum-scale). */
@media (max-width: 900px), (pointer: coarse) {
  input, select, textarea, .compose-editor { font-size: 16px; }
}
/* Every control is at least 44×44 to press with a finger (the rule above, "Touch screens", has
   the first of them). A control that must look small (the × on an address, on a file, or on a
   file waiting to be sent) keeps its look and gets a 44px press area drawn round it, centred on it. */
@media (pointer: coarse) {
  .btn, .btn.sm, .seg button, .icon-btn, .rt-bar button, .cf-more .link-btn { min-width: 44px; min-height: 44px; }
  button.chip, a.chip, label.chip, .yn button, .ticks { min-width: 44px; min-height: 44px; }
  button.chip, a.chip, label.chip { justify-content: center; }
  .cb-step, .vn-play { width: 44px; height: 44px; }
  .tbl th.sort { height: 44px; }
  .tbl th.sort > .th-sort { min-width: 44px; min-height: 44px; }
  details > summary { min-height: 44px; padding-block: 10px; }
  .pick, .addr-results button, .rec-results button, .addr-opt, .mention-pick button, .menu [role=menuitem], .search-results a { min-height: 44px; }
  .addr-chip button, .file-chip button { position: relative; }
  .addr-chip button::after, .file-chip button::after, .pend-x::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
}

/* ---- lead, round 4: Settings → System, the notice after an owner's password link ---- */
.sys-meter { height: 10px; border-radius: 6px; background: var(--sunk); border: 1px solid var(--line); overflow: hidden; margin: 6px 0; }
.sys-meter > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.sys-meter.bad > span { background: var(--bad); }
/* Round 9: the scheduled jobs stopped, or a step that failed lately. */
.sys-bad { color: var(--bad); font-weight: 600; }
.sys-warn { color: var(--warn); }
.me-notice { margin: 12px 16px 0; }
/* ---- email triage: To deal with, one-press actions, the reader (owner, 20 October 2026) ---- */
/* A row's one press: the best suggestion ("File to MC-0042 · Landbay") and ⋯. */
.mail-row-acts { display: flex; gap: 6px; align-items: center; margin-top: 6px; min-width: 0; }
.sugg-btn { max-width: 100%; min-width: 0; flex: 0 1 auto; justify-content: flex-start;
  background: var(--accent-soft); border-color: transparent; color: var(--accent-2); }
.sugg-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sugg-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.mail-more-btn svg { width: 18px; height: 18px; stroke-width: 3.4; }
.mail-more-btn { color: var(--ink-2); }
.mail-menu { position: fixed; right: auto; top: 0; left: 0; min-width: 210px; z-index: 78; }
.mail-why { margin: 2px 0 6px; overflow-wrap: anywhere; }
.mail-tasks { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.mail-task { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); overflow-wrap: anywhere; }
.mail-task svg { width: 14px; height: 14px; color: var(--good); flex: none; }

/* The reader: a conversation laid out as Gmail lays out a long one. */
.mc-head { display: flex; gap: 10px; align-items: flex-start; }
.mc-av { width: 32px; height: 32px; font-size: 12px; margin-top: 1px; }
.mc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mc-line { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.mc-line .grow { flex: 1; }
.mc-from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc.unread .mc-from { font-weight: 800; }
.mc-head .mc-snip { padding: 0; }
.mc-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mc-body { padding-left: 54px; }
.mc-tline { margin-top: -6px; }
.mc-to { border: 0; background: none; padding: 2px 0; color: var(--muted); cursor: pointer; font: inherit; text-align: left; overflow-wrap: anywhere; }
.mc-to:hover { color: var(--ink); text-decoration: underline; }
.mc .mail-meta { padding: 8px 10px; border-radius: var(--r-sm); background: var(--sunk); }
.mc-more { display: block; width: 100%; padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--accent-2); font-weight: 700; cursor: pointer; text-align: center; }
.mc-more:hover { background: var(--accent-soft); }
.mc-folds { gap: 6px; }
.mc-trim { align-self: flex-start; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); color: var(--ink-2);
  padding: 0 10px; height: 20px; line-height: 16px; font-weight: 800; letter-spacing: 1px; cursor: pointer; }
.mc-trim:hover { background: var(--accent-soft); }
.mail-trimmed { color: var(--muted); }
/* A frame as tall as its email, without its own border (the card is the frame). */
.mc .mail-frame { border: 0; border-radius: var(--r-sm); }
.mail-frame.sized { resize: none; overflow: hidden; }
/* Files as chips. */
.mail-atts { flex-direction: row; flex-wrap: wrap; }
.mail-att { padding: 0; border: 0; background: none; gap: 4px; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 5px 12px 5px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--sunk); color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; min-width: 0; }
.att-chip:hover { background: var(--accent-soft); }
.att-chip .att-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 260px; }

/* The Emails panel on a case, client or company: the conversation opens in place. */
.mthread-h .mail-snip { max-width: 100%; }
.mail-inplace[hidden] { display: none; }
.mail-inplace .mail-back { display: inline-flex; }
.mail-inplace .mail-msg { padding: 12px 16px 16px; }

/* Settings: "Show email from". The new case from an email. */
.mbox-start { display: flex; flex-direction: column; gap: 4px; }
.mbox-start input[type=date] { max-width: 200px; }
.from-email-who { gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }

@media (max-width: 900px) {
  .mail-toolbar .mail-more-btn { flex: 0 0 auto; }
  .mc-body { padding-left: 0; }
  .mc-tline { margin-top: 0; }
  /* On a phone the conversation takes the whole screen, over the record, with Back at the top. */
  .mail-inplace:not([hidden]) { position: fixed; inset: 0; z-index: 65; overflow-y: auto; background: var(--bg);
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .mail-inplace .mail-msg { padding: 12px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
}
@media (pointer: coarse) {
  .mc-to, .mc-trim, .att-chip, .mc-more, .mthread-h { min-height: 44px; }
  .mc-trim { min-width: 44px; height: auto; }
}
/* ---- reminders and timings (owner, 20 October 2026) ---- */
.rc-line .badge { margin-left: auto; }
.td-deal .btn { margin-left: auto; }
.rc-ready { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.rc-ready .rc-line { padding: 6px 0; }
/* A document's dates, its one badge, and its buttons, which wrap rather than push the page wide. */
.doc-tbl .doc-dates { color: var(--ink-2); }
.doc-tbl .doc-snooze { overflow-wrap: anywhere; }
.doc-tbl .badge { white-space: normal; text-align: left; }
.doc-tbl td.doc-acts { white-space: normal; text-align: right; }
.doc-tbl td.doc-acts > * { margin: 2px 0 2px 4px; }
@media (max-width: 760px) {
  .doc-tbl, .doc-tbl tbody { display: block; }
  .doc-tbl tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
  .doc-tbl td { display: block; padding: 0; border: 0; min-width: 0; }
  .doc-tbl td:first-child { grid-row: span 3; }
  .doc-tbl td:not(:first-child) { grid-column: 2; }
  .doc-tbl td.doc-acts { display: flex; flex-wrap: wrap; gap: 6px; text-align: left; }
  .doc-tbl td.doc-acts > * { margin: 0; }
  .doc-tbl .t-sub { overflow-wrap: anywhere; }
}
/* A fact-find section's line under its header: changed, confirmed, check again by, Still correct. */
.ff-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 16px 10px 42px; margin-top: -4px; }
.ff-check .grow { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .ff-check { padding-left: 16px; } }
/* Settings: Reminders & timings. */
.rem-h { margin: 6px 0 4px; font: 700 14px var(--f-display); }
.rem-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.rem-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.rem-name { flex: 1 1 150px; min-width: 0; margin: 0; font-size: 13.5px; font-weight: 600; }
.rem-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; max-width: 100%; }
.rem-ctl select { width: auto; max-width: 100%; }
.rem-months { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.rem-months[hidden] { display: none; }
.rem-months input { width: 72px; }
.rem-group + .rem-group { margin-top: 12px; }
@media (max-width: 900px) { .rem-list { grid-template-columns: minmax(0, 1fr); } }
/* ---- underwriter conditions, payment and the client overview (owner, 20 October 2026) ----
   js/views/conditions.js and js/views/overview.js. No sizes for controls or text boxes here:
   the phone rules above keep every control 44px and every box 16px. */

/* Underwriter conditions on the case: outstanding first, then with the lender; cleared folded away. */
.cond-list { list-style: none; margin: 0; padding: 0; }
.cond { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cond:last-child { border-bottom: 0; }
.cond.over { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 8px; }
.cond-tick { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.cond-t { font-weight: 600; overflow-wrap: anywhere; }
.cond.cleared .cond-t { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.cond-meta { margin-top: 2px; }
.cond-late { color: var(--bad); font-weight: 600; }
.cond-doc { margin-top: 4px; }
.cond-doc svg { width: 14px; height: 14px; vertical-align: -2px; }
.cond-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.cond-sent-on input { width: 150px; }
.cond-cleared { margin-top: 10px; }
.cond-cleared > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .cond { grid-template-columns: auto minmax(0, 1fr); }
  .cond-acts { grid-column: 2; justify-content: flex-start; }
}

/* Payment on a completed case. */
.pay-form { display: grid; gap: 14px; }
.pay-fee { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 14px 14px; margin: 0; min-width: 0; }
.pay-fee legend { font-weight: 700; padding: 0 6px; }
.pay-day { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pay-day input { flex: 1 1 140px; min-width: 0; }
#pay-rule { border: 0; padding: 0; margin: 0; min-width: 0; }
#pay-chase { max-width: 160px; }
.pay-rule { align-items: flex-start; gap: 8px; }
.pay-rule input { margin-top: 4px; }
/* Round 9: who sees proc fees, a tick each, and off for everyone (Settings → Money). */
#proc-who { border: 0; padding: 0; margin: 0; min-width: 0; }
.proc-person, .proc-off { align-items: flex-start; gap: 8px; flex-wrap: nowrap; }
.proc-person input, .proc-off input { margin-top: 4px; flex: none; }
.proc-person > span, .proc-off > span { min-width: 0; }

/* The board: open conditions on a card, and the last column of completed cases awaiting payment. */
.badge.card-conds { background: var(--accent-soft); color: var(--accent); }
.card .s.card-paid { color: var(--warn); font-weight: 600; }
.col.col-pay { border-style: dashed; }
.cond-jump { white-space: normal; }

/* The dashboard: seven tiles, the last one Awaiting payment. */
.tiles.dash-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1200px) { .tiles.dash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles.dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The summary band at the top of a client's or a company's page. */
.ov { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); margin-bottom: 16px; min-width: 0; }
.ov-contact { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.ov-who { min-width: 0; overflow-wrap: anywhere; }
.ov-looker { display: inline-flex; gap: 6px; align-items: center; }
.ov-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ov-restricted { color: var(--bad); }
.ov-company { align-items: flex-start; }
.ov-people { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 320px; }
.ov-person { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.ov-col { padding: 12px 16px 16px; min-width: 0; }
.ov-col + .ov-col { border-left: 1px solid var(--line-2); }
.ov-h { font: 700 15px var(--f-display); margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ov-h a { margin-left: auto; font-weight: 500; }
.ov-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--raised); min-width: 0; }
.ov-card-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ov-card-h .mono { font-weight: 700; }
.ov-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 8px 0 0; font-size: 13px; }
.ov-kv dt { color: var(--muted); }
.ov-kv dd { margin: 0; overflow-wrap: anywhere; }
.ov-counts { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); line-height: 1.7; }
.ov-counts a { white-space: nowrap; }
.ov-counts .ov-bad { color: var(--bad); font-weight: 600; }
.ov-counts .ov-warn { color: var(--warn); font-weight: 600; }
.ov-folded { margin-top: 4px; line-height: 1.7; }
.ov-out-list { list-style: none; margin: 0; padding: 0; }
.ov-out { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.ov-out:last-child { border-bottom: 0; }
.ov-out .grow { min-width: 0; overflow-wrap: anywhere; }
.ov-out .badge { flex: none; margin-top: 2px; }
.ov-out .small { display: block; }
.ov-more { margin: 8px 0 0; }
.ov-note .ov-note-b { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ov-note.pinned { margin: 0 -16px; padding: 10px 16px; }
.ov-note .h { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ov-cases { grid-column: 1 / -1; border-bottom: 1px solid var(--line-2); }
  .ov-col + .ov-col { border-left: 0; }
  .ov-notes { border-left: 1px solid var(--line-2) !important; }
}
@media (max-width: 760px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-col { border-bottom: 1px solid var(--line-2); }
  .ov-notes { border-left: 0 !important; border-bottom: 0; }
  .ov-contact { align-items: flex-start; }
}
@media print { .ov-acts { display: none; } }
/* ---- notifications (owner, 20 October 2026; js/notify.js) ---- */
/* The bell in the top bar, with the number of new items on it. On a phone the bar's buttons sit
   closer (each is still 44px to press), so the search box keeps room to read what's typed. */
.bell-btn { position: relative; min-width: 36px; min-height: 36px; }
@media (max-width: 640px) { .topbar { gap: 4px; } }
.bell-btn svg { width: 19px; height: 19px; }
.bell-count { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff;
  font: 700 11px/18px var(--f-body); text-align: center; box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
:root[data-theme="dark"] .bell-count { color: #1a0605; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bell-count { color: #1a0605; } }
/* The list under it: a sheet across the top on a phone, a box under the bell on a computer. */
.bell-panel { position: fixed; top: calc(var(--topbar-h, 57px) + 4px); right: max(16px, env(safe-area-inset-right)); width: min(390px, calc(100vw - 32px));
  max-height: min(70vh, 540px); overflow-y: auto; overscroll-behavior: contain; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-2); z-index: 45; }
.bell-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--raised); }
.bell-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--line-2); text-decoration: none; min-height: 44px; }
.bell-item:hover, .bell-item:focus-visible { background: var(--sunk); text-decoration: none; }
.bell-item.fresh { background: var(--accent-soft); }
.bell-item.read .t { font-weight: 500; }
.bell-item > svg { width: 18px; height: 18px; flex: none; color: var(--muted); margin-top: 2px; }
.bell-item .grow { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bell-item .t { font-weight: 650; overflow-wrap: anywhere; }
.bell-item .x { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-item .w { font-size: 12px; color: var(--muted); }
.bell-empty { padding: 18px 14px; color: var(--muted); }
/* Account & security → Notifications. */
.nt .nt-sec + .nt-sec { border-top: 1px solid var(--line-2); padding-top: 12px; }
.nt .nt-h { font: 650 14px var(--f-body); margin: 0 0 8px; }
.nt .help { display: block; }
.nt .nt-switch, .nt .nt-check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.nt .nt-switch input, .nt .nt-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.nt .nt-check input:disabled + span { color: var(--muted); }
.nt .nt-say:empty, .nt .nt-say[hidden] { display: none; }
.nt .nt-say { background: var(--info-soft); color: var(--ink-2); border-radius: var(--r-sm); padding: 8px 10px; margin: 6px 0; }
.nt .nt-dev { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.install-card { margin-bottom: 14px; border-left: 4px solid var(--accent); }
@media (pointer: coarse) {
  .bell-btn { min-width: 44px; min-height: 44px; }
  .nt .nt-switch, .nt .nt-check { min-height: 44px; align-items: center; }
  .nt .nt-switch input, .nt .nt-check input { margin-top: 0; }
}
/* ---- phones and finishing touches (owner, 20 October 2026) ----
   The bar at the bottom of a phone (js/app.js wirePhoneBar), tabs on a case, a client and a
   company (js/views/case.js Views._recordTabs), lists as cards, the chase date's working-day
   picks and a phone number's note. Tokens only, so light and dark both work; controls are held
   to 44px and boxes to 16px by the phone rules above and test/browser/checks/23-phone-sweep.mjs. */

/* The bar: Today, Email, Messages, To-do, Cases and More, up to 900px wide. */
:root { --tabbar-h: 0px; }
.tabbar { display: none; }
@media (max-width: 900px) {
  :root { --tabbar-h: 58px; }
  .tabbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar > a, .tabbar > button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 44px; min-height: 44px; padding: 6px 2px 4px; border: 0; background: none; color: var(--muted); cursor: pointer;
    font: 600 11.5px/1.2 var(--f-body); text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .tabbar > a:hover, .tabbar > button:hover { color: var(--ink); text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; flex: none; }
  .tabbar .tb-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .on { color: var(--accent-2); }
  .tabbar .on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .tabbar .tb-badge { position: absolute; top: 3px; left: calc(50% + 4px); min-width: 18px; padding: 0 5px; justify-content: center; font-size: 11px; line-height: 17px; pointer-events: none; }
  .tabbar .tb-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
  /* Never over the page: the page ends above the bar, and so do the toasts and the board's quick view. */
  .content { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
  /* Out of the way while the keyboard is up (js/app.js), and inside an open conversation, which
     has its own message box at the bottom of the screen. */
  body.kb-up .tabbar, body:has(.msg-layout.has-thread) .tabbar { display: none; }
  body.kb-up .toasts, body:has(.msg-layout.has-thread) .toasts { bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (min-width: 761px) and (max-width: 900px) { .drawer { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); } }

/* Tabs on a record's page, up to 900px wide: the row stays in view under the top bar (and the case's
   header, its top set by js/views/case.js); a panel of another tab is out of the way (.tab-off). */
.rec-tabs, .rec-tabs-at { display: none; }
@media (max-width: 900px) {
  .rec-tabs { display: flex; position: sticky; z-index: 14; gap: 2px; margin: 0 -16px 14px; padding: 0 10px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line); }
  .rec-tabs::-webkit-scrollbar { display: none; }
  .rec-tabs-at { display: block; height: 0; margin: 0 !important; }
  .rec-tabs [role=tab] { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 10px 11px 7px;
    border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; }
  .rec-tabs [role=tab]:hover { color: var(--ink); }
  .rec-tabs [role=tab][aria-selected=true] { color: var(--accent-2); border-bottom-color: var(--accent); }
  .rec-tabs .tab-n { padding: 0 6px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 11.5px; font-weight: 700; line-height: 18px; }
  .tab-off { display: none !important; }
  .tab-flow { display: contents; }
  #view > [data-tab], .tab-flow > [data-tab] { margin: 0 0 16px !important; }
}

/* Lists as cards, up to 640px wide (Cases, Clients, Companies, Portfolios, Rate expiries): the board's
   card, the whole card a link, the table's sort as one box above. */
.list-cards { display: grid; gap: 10px; }
.list-cards-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sort-pick-l { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 0; }
.sort-pick-l .lbl { margin: 0; white-space: nowrap; }
.sort-pick { flex: 1; min-width: 0; width: auto; }
.list-card .card-top { gap: 8px; }
.list-card .card-top .t { font-size: 15.5px; }
.list-card .card-top .badge, .list-card .card-top .epc { flex: none; margin-left: auto; }
.list-card .m .stage { margin-right: 2px; }
.list-card svg { width: 14px; height: 14px; vertical-align: -2px; }
.card-kv { margin-top: 8px; grid-template-columns: auto minmax(0, 1fr); font-size: 13.5px; }
.card-kv dd { text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.list-cards-foot { margin-top: 10px; }
#tbl > .list-cards-head, #tbl > .list-cards, #tbl > .list-cards-foot { margin: 10px; }
@media (max-width: 640px) {
  .panel:has(> #tbl > .list-cards) { background: none; border: 0; box-shadow: none; }
  .panel:has(> #tbl > .list-cards) #tbl > * { margin: 0 0 10px; }
}
/* A case's lender applications: side by side on a wide screen, a card each on a phone. */
.apps-wide { overflow-x: auto; }
.app-cards { display: none; }
@media (max-width: 640px) {
  .apps-wide { display: none; }
  .app-cards { display: grid; gap: 10px; padding: 10px; }
  .app-card { cursor: default; }
  .app-card .card-top { align-items: flex-start; }
  .app-card .card-top .grow { min-width: 0; overflow-wrap: anywhere; }
  .app-card-acts { flex: none; gap: 2px; }
  /* With "Apply with this one" the buttons take their own line under the name (round 9). */
  .app-card .card-top { flex-wrap: wrap; }
  .app-card-acts:has([data-apply]) { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .app-card-acts [data-apply] { flex: 1 1 auto; }
  .app-card-progress { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
  .app-card-progress .prod-status { flex: 1 1 100%; width: 100%; }
  .app-kv { margin-top: 8px; grid-template-columns: auto minmax(0, 1fr); font-size: 13.5px; }
  .app-kv dd { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
  /* A case's documents and the To-do list: each one a card. */
  .doc-tbl tbody { display: grid; gap: 10px; padding: 10px; }
  .doc-tbl tr { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-1); }
  .todo-group .panel-b { display: grid; gap: 8px; padding: 8px; }
  .todo, .todo:last-child { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-1); }
}

/* The chase date's picks (on working days), and the gentle notes under a date or a phone number. */
.chase-picks { margin-top: 6px; gap: 6px; }
.day-note, .phone-note { color: var(--warn); }
/* A bank account's check (round 14, js/bankcheck.js): a quiet tick when the two fit, a sentence when they don't. */
.bank-note:empty { display: none; }
.bank-note.bank-ok { color: var(--good); }
.bank-note.bank-warn { color: var(--warn); }
.bank-tick { font-weight: 700; }
.ff-sec-link { margin: 10px 0 0; }
.ff-sec-link a { font-weight: 600; white-space: nowrap; }
.ff-sec-link a svg { vertical-align: -2px; }
.call-link { white-space: nowrap; }
/* WhatsApp beside Call (owner, 28 October 2026): the same look; on a touch screen, 44px to press, as a button is. */
.wa-link { white-space: nowrap; margin-left: 4px; }
@media (pointer: coarse) { .wa-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; } }

/* ---- the mynt finance logo (owner, 20 October 2026: "use this logo as asset and make as app logo and on
   dashboard"; "use the one I uploaded"): public/brand/mynt-finance-logo.png, exactly as supplied (transparent
   background, never redrawn or recoloured). On dark pages it sits on a light panel so the navy reads. ---- */
.brand-home { display: block; line-height: 0; border-radius: 8px; }
.nav .brand { flex-direction: column; align-items: flex-start; gap: 4px; }
.brand-logo { height: 64px; width: auto; }
.page-logo { display: block; height: 64px; width: auto; margin: 0 0 6px -6px; }
.auth-logo { height: 96px; width: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mynt-logo { background: #f7f9fc; border-radius: 12px; padding: 2px 6px; }
}
:root[data-theme="dark"] .mynt-logo { background: #f7f9fc; border-radius: 12px; padding: 2px 6px; }
@media (max-width: 900px) { .page-logo { height: 52px; } }

/* ---- Mynt Finance's own sign-in (owner, 20 October 2026): one card, the logo above the form ---- */
.auth { grid-template-columns: 1fr; background: var(--bg); }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2, 0 6px 24px rgba(0,0,0,.06)); padding: 28px 28px 22px; }
.auth-brand { display: flex; justify-content: center; margin: 0 0 22px; }
@media (max-width: 480px) { .auth-card { padding: 22px 18px 18px; } .auth-logo { height: 68px; } }

/* ---- proc fees (owner, 20 October 2026): the fact-find note under the proc fee, the Payment box without the amount ---- */
.proc-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.proc-note .help { margin: 0; flex: 1 1 200px; min-width: 0; }
.pay-proc-state { margin: 0 0 8px; font-weight: 600; }

/* ---- New case works out what it can, and a simpler lender application (owner, 20 October 2026) ---- */
.nc-loan { gap: 8px; flex-wrap: nowrap; }
.nc-loan .money-wrap { min-width: 0; }
.nc-ltv { flex: 0 0 96px; }
.work-out { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); padding: 10px 14px; }
.work-out h3 { margin: 0 0 6px; font-size: 14px; }
.wo-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 5px 0; border-top: 1px solid var(--line-2, var(--line)); }
.wo-row:first-child { border-top: 0; }
.wo-k { color: var(--muted); font-size: 13.5px; }
.wo-v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.wo-need { color: var(--muted); font-size: 13px; text-align: right; }
/* On a phone each figure's label sits above its value or what it needs, all left-aligned, so no row wraps raggedly (21 October 2026). */
@media (max-width: 640px) { .wo-row { flex-direction: column; align-items: flex-start; } .wo-v, .wo-need { text-align: left; } }
.work-out .help { margin: 8px 0 0; }
.app-picks { gap: 6px; }
.app-fold { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.app-fold > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.app-contact { margin-top: 10px; }
.app-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.app-dialog legend { padding: 0; }

/* ---- "Other" takes words (owner, 20 October 2026): the box under a choice of Other, marked while it is empty ---- */
.other-note { margin-top: 6px; }
.other-note[required]:placeholder-shown { border-color: var(--warn); }

/* ---- Settings, round 6 (owner, 20 October 2026: "redo the setting page to be much better nicer
   clearer"; js/views/settings.js). Sections on the left; on a phone, the list, then one section
   with Back. Each card with the line under it ("Not saved yet" / "Saved."). ---- */
.set { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 22px; align-items: start; }
.set-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.set-find { position: relative; }
.set-find input[type=search] { min-height: 40px; }
.set-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-2); padding: 4px; max-height: min(60vh, 420px); overflow-y: auto; }
.set-hit { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.set-hit b { display: block; font-weight: 600; }
.set-hit span { display: block; }
.set-hit:hover, .set-hit.sel { background: var(--accent-soft); }
.set-none { margin: 0; padding: 10px; color: var(--muted); font-size: 13px; }
.set-nav, .set-manage { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: 6px; }
.set-nav a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.set-nav a:hover { background: var(--sunk); text-decoration: none; }
.set-nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent-2); }
.set-nav .t, .set-manage .t { font-weight: 600; }
.set-nav .s, .set-manage .s { display: block; grid-column: 1; font-size: 12px; color: var(--muted); }
.set-dot { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.set-manage .lbl { padding: 6px 10px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.set-manage a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.set-manage a:hover { background: var(--sunk); text-decoration: none; }
.set-manage a svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.set-main { min-width: 0; }
.set-back { display: none; }
.set-head { margin: 2px 0 16px; }
.set-head h2 { font: 700 21px/1.2 var(--f-display); letter-spacing: -.01em; margin: 0; }
.set-head h2:focus { outline: none; }
.set-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.set-head .set-ro { margin: 10px 0 0; color: var(--info); }
.set-sec { display: flex; flex-direction: column; gap: 16px; }
.set-card { min-width: 0; scroll-margin-top: 80px; }
.set-card > .panel { transition: border-color .15s, box-shadow .15s; }
.set-card[data-state=dirty] > .panel { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.set-note { margin: 6px 4px 0; font-size: 12.5px; }
.set-note.dirty { color: var(--warn); font-weight: 600; }
.set-note.saved { color: var(--good); font-weight: 600; }
.set-note.saved::before { content: "✓ "; }
.set-found { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; scroll-margin-top: 90px; }
.set-opt .help { margin-top: 4px; }
.set-unit input { max-width: 120px; }
.set-unit span { color: var(--muted); }
.set-foot { display: flex; align-items: center; gap: 10px; }
.set-fieldset, .set-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.set-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.set-look { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.set-look:hover { background: var(--sunk); }
.set-look:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 1px var(--accent); }
.set-look input { position: absolute; top: 12px; right: 12px; z-index: 1; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.set-swatch { pointer-events: none; }
.set-look-t b { display: block; }
.set-look-t .help { margin: 2px 0 0; }
/* The three looks, drawn in their own colours whatever the page's (a picture of each; round 19: the logo's navy and mint). */
.set-swatch { display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr 1fr; gap: 5px; height: 58px; padding: 6px; border-radius: 8px; border: 1px solid #c9d2de; }
.set-swatch i { display: block; border-radius: 4px; }
.set-swatch i:first-child { grid-row: 1 / span 2; }
.set-swatch-light { background: #f4f6f9; }
.set-swatch-light i { background: #ffffff; box-shadow: 0 0 0 1px #dde3eb; }
.set-swatch-light i:last-child { background: #122a49; box-shadow: none; }
.set-swatch-dark { background: #0b1220; border-color: #253248; }
.set-swatch-dark i { background: #172236; }
.set-swatch-dark i:last-child { background: #b6e2e0; }
.set-swatch-system { background: linear-gradient(135deg, #f4f6f9 0 50%, #0b1220 50% 100%); }
.set-swatch-system i { background: #8f9cb0; opacity: .55; }
.set-swatch-system i:last-child { background: #b6e2e0; opacity: 1; }
.set-switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.set-switch input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.set-switch b { display: block; }
.set-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.set-facts > div { display: contents; }
.set-facts dt { color: var(--muted); }
.set-facts dd { margin: 0; }
.set-links { display: flex; flex-direction: column; gap: 8px; }
.set-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--ink); text-decoration: none; }
.set-link:hover { background: var(--sunk); text-decoration: none; }
.set-link svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.set-link > span:not(.set-go) { flex: 1; min-width: 0; }
.set-link b { display: block; }
.set-link .help { margin: 0; }
.set-go { color: var(--muted); font-size: 20px; line-height: 1; }
.set-conn { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.set-checklists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 1180px) { .set-checklists { grid-template-columns: minmax(0, 1fr); } }
/* A phone (or a narrow window): the list of sections, or one section with Back at the top. */
@media (max-width: 900px) {
  .set { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .set-side { position: static; }
  .set[data-open] .set-side { display: none; }
  .set:not([data-open]) .set-main { display: none; }
  .set-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -6px 0 6px; font-weight: 600; }
  .set-back span { font-size: 22px; line-height: 1; }
  .set-nav a { min-height: 56px; align-content: center; padding: 10px 12px; }
  .set-manage a { min-height: 48px; }
  .set-looks { grid-template-columns: minmax(0, 1fr); }
  .set-look { flex-direction: row; align-items: center; padding-right: 40px; }
  .set-look .set-swatch { width: 88px; height: 52px; flex: none; }
  .set-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .set-facts dd { margin-bottom: 8px; }
}
@media (pointer: coarse) {
  .set-hit { min-height: 44px; }
  .set-switch { min-height: 44px; align-items: center; }
  .set-switch input { margin-top: 0; }
  .set-link { min-height: 56px; }
}

/* ---- what every new client is asked for (owner, 21 October 2026; js/views/asks.js) ---- */
.ask-list { list-style: none; margin: 0; padding: 0; }
.ask-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ask-row:last-child { border-bottom: 0; }
.ask-row .badge { flex: none; margin-top: 2px; }
.ask-words { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.ask-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ask-list.compact .ask-row { padding: 6px 0; }
.ask-list.compact .ask-words { font-size: 13px; flex-basis: 160px; }
.ask-done { color: var(--good); }
.ask-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ask-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.ask-item-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-item-h select { width: auto; max-width: 100%; }
.ask-n { font-weight: 700; min-width: 1.5em; color: var(--muted); }
.ask-moves { display: flex; gap: 4px; margin-left: auto; }
.ask-tpl { grid-column: 1 / -1; }
.cm-files { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; }
.cm-file { gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.cm-file a { overflow-wrap: anywhere; }
.cm-row-files svg { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-width: 640px) {
  .ask-acts { margin-left: 0; width: 100%; }
  .ask-acts .btn { flex: 1 1 auto; min-height: 44px; }
  .ask-moves .icon-btn { min-width: 44px; min-height: 44px; }
  .cm-file input[type=checkbox] { width: 22px; height: 22px; }
}

/* Round 8 M: Compare products with a case or a property, rent needed and the ICR that applies (owner, 21 October
   2026: "i want it to look nice easy and good to work with"). Tokens only, so light and dark follow; on a phone each
   line stacks, nothing runs sideways, and each link to press is 44px tall. */

/* Compare: "Filled in from", one line a figure: what it is, the figure, where it came from, the way to change it. */
.cp-from { margin-bottom: 16px; }
.cp-from .panel-h { flex-wrap: wrap; gap: 4px 12px; }
.cp-from-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.cp-from-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.cp-from-k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cp-from-v { min-width: 0; overflow-wrap: anywhere; }
.cp-from-v b { font-variant-numeric: tabular-nums; }
.cp-from-s { color: var(--muted); }
.cp-from-a { font-size: 13px; white-space: nowrap; }
.cp-from-v .badge { vertical-align: 1px; }
.cp-from-v b + .cp-from-s::before { content: "· "; }
@media (max-width: 900px) { .cp-from-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  /* What it is and "Change" on one line, the figure under it. */
  .cp-from-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k a" "v v"; gap: 0 8px; padding: 2px 0 10px; align-items: center; }
  .cp-from-k { grid-area: k; }
  .cp-from-v { grid-area: v; }
  .cp-from-a { grid-area: a; display: inline-flex; align-items: center; min-height: 44px; }
  .cp-from-where { display: none; }
}
/* Compare: a product already on the case, and why one can't be added here. */
.cp-oncase { margin-top: 4px; }
.cp-use { margin-top: 8px; }
.cp-use .t-sub, .cp-use-s { margin-top: 2px; }
.cp-card-acts .cp-use-s { flex-basis: 100%; text-align: center; }
.cp-cannot { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--info-soft); color: var(--ink-2); font-size: 13.5px; }

/* A property's Rent and ICR, and a case's numbers: the figure, then what it is for; why underneath, quietly. */
.rc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rc-fig { background: var(--sunk); border-radius: var(--r-sm); padding: 12px 14px; min-width: 0; }
.rc-fig .k { font-size: 12px; font-weight: 600; color: var(--muted); }
.rc-fig .v { font: 700 22px/1.2 var(--f-display); letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rc-fig .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.rc-fig .s .badge { white-space: normal; display: inline-block; border-radius: var(--r-sm); line-height: 1.35; padding: 3px 8px; margin-top: 2px; }
.rc-unit { font: 400 13px/1 var(--f-body); color: var(--muted); letter-spacing: 0; }
.rc-need { color: var(--warn); font-weight: 600; }
.rc-why, .numbers-why { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rc-why li, .numbers-why li { font-size: 12.5px; color: var(--ink-2); background: var(--sunk); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; overflow-wrap: anywhere; }
.numbers-why { margin-top: 8px; }
#numbers-rent-needed .badge { margin-left: 4px; }
.wo-why { display: block; margin-top: 2px; }
@media (max-width: 900px) { .rc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .rc-panel .panel-h { flex-wrap: wrap; }
  .rc-panel .panel-h .actions { width: 100%; }
  .rc-panel .panel-h .actions .btn { flex: 1 1 auto; min-height: 44px; }
}
/* Round 8 N: Messages laid out like a phone chat app (owner, 21 October 2026: "make messages one for team and one
   that each can message privately each member and then add for only some people … i want it to look nice easy and
   good to work with"; js/views/convo.js). The Team chat on top, then People, Groups and Discussions, each a row with
   a picture, the name and time, and the last line with an unread count; a search box over them; the chat's ⋯ menu;
   a group's people. Tokens only, so light and dark both work; nothing wider than the screen on a phone. */
.msg-list-h { flex-direction: column; align-items: stretch; gap: 8px; }
.msg-search { width: 100%; min-width: 0; }
/* New message: what to do, said under the search box (round 19 audit). */
.msg-new-hint { margin: 8px 12px 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.thread-items { padding: 4px 0; }
.thread-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 0; border-radius: 0; }
.thread-item[hidden] { display: none; }
.thread-item + .thread-item { box-shadow: inset 0 1px 0 var(--line-2); }
.thread-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ti-av { flex: none; display: inline-grid; }
.ti-av .avatar, .chat-head-av .avatar { width: 38px; height: 38px; font-size: 13px; }
.ti-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ti-top, .ti-bottom { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ti-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.thread-item.unread .ti-name { font-weight: 700; }
.ti-when { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.thread-item.unread .ti-when { color: var(--accent-2); font-weight: 600; }
.ti-bottom .preview { flex: 1; min-width: 0; }
.ti-count { flex: none; min-width: 20px; justify-content: center; }
.chat-av { color: #fff; }
.chat-av svg { width: 55%; height: 55%; }
.av-team { background: var(--accent); color: var(--accent-ink); }
.av-group { background: var(--p-1); }
.av-record { background: var(--p-7); }
.msg-sec { padding-top: 6px; }
.msg-sec[hidden] { display: none; }
.msg-sec-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px 4px; }
.msg-sec-h h3 { margin: 0; flex: 1; font: 700 11.5px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.msg-sec .empty { padding: 10px 14px 14px; text-align: left; }
.chat-head { gap: 10px; }
.chat-head-av:empty { display: none; }
.chat-names { min-width: 0; }
.chat-names h2, .chat-names #chat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-manage { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.chat-manage svg { width: 18px; height: 18px; }
.msg-list .seg button { white-space: nowrap; padding: 6px 4px; font-size: 12.5px; }
.chat-gone { margin: 12px 14px 0; padding: 10px 14px; border-radius: 10px; background: var(--info-soft); color: var(--ink-2); font-weight: 600; }
.chat-menu { position: fixed; right: auto; top: 0; left: 0; min-width: 210px; z-index: 78; }
.chat-menu [role=menuitem].danger { color: var(--bad); }
.people-pick { max-height: 46vh; overflow-y: auto; padding: 2px; }
.pp-chip .avatar { width: 20px; height: 20px; font-size: 9px; }
.pp-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.pp-filter { width: 100%; margin-bottom: 8px; }
.gi-people { list-style: none; margin: 0; padding: 0; }
.gi-people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.gi-people li:last-child { border-bottom: 0; }
.gi-people li .grow { min-width: 0; overflow-wrap: anywhere; }
.save-rec .rec-pick { min-width: 0; }
.doc-from a { overflow-wrap: anywhere; }
/* A message's actions (Reply, Edit for 10 minutes, Make a task, Remove) are easy to reach: on a touch screen always
   shown in full, with room to press; with a mouse, in full when pointed at or reached with the keyboard. */
@media (pointer: coarse) {
  .msg-actions { opacity: 1; }
  .msg-actions .btn.sm { padding: 4px 10px; }
  .thread-item { min-height: 60px; }
}
@media (max-width: 760px) {
  .msg-list .panel-h { padding: 10px 12px; }
  .thread-item { padding: 10px 16px; }
  .msg-sec-h { padding: 12px 16px 4px; }
  .msg-sec .empty { padding: 8px 16px 14px; }
  .msg-layout.has-thread .chat-gone { margin: 8px 10px 0; }
}
/* Round 8 L: client › company › case, connected (owner, 21 October 2026: "make it all much better client > company >
   case … look nice easy and good to work with"). New case on one card; the client's company cards with their cases;
   the company's people as cards; the case header's breadcrumb and property; the shared New company and person dialogs.
   Colours are the theme's tokens only, so light and dark both follow. */
.nc-card { max-width: 920px; padding: 0; overflow: hidden; }
.nc-sec { padding: 16px 18px; border-top: 1px solid var(--line-2); min-width: 0; }
.nc-sec:first-child { border-top: 0; }
.nc-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 700 15px/1.3 var(--f-display); letter-spacing: -.01em; }
.nc-n { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-size: 12.5px; }
.nc-card .chip, .co-cards .chip, .new-co .chip, .pick-client .chip, .add-app .chip, .co-choose .chip { white-space: normal; max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.nc-card .chip svg, .new-co .chip svg, .pick-client .chip svg, .add-app .chip svg, .co-choose .chip svg { width: 14px; height: 14px; flex: none; }
.nc-find input[type=search] { max-width: 560px; }
.nc-found { margin-top: 8px; display: grid; gap: 6px; }
.nc-found:empty { display: none; }
.nc-found-h, .nc-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.nc-or { margin-top: 10px; }
.nc-sec .help { margin-top: 8px; }
.nc-borrower { display: grid; gap: 10px; }
.nc-b-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nc-ic, .co-ic { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--sunk); color: var(--accent-2); }
.nc-ic svg, .co-ic svg { width: 18px; height: 18px; }
.nc-b-t, .co-card-t, .pc-t { flex: 1 1 auto; min-width: 0; }
.nc-b-name { font: 700 16px/1.3 var(--f-display); color: var(--ink); overflow-wrap: anywhere; }
.nc-as { gap: 6px; }
.chip.nc-add { border-style: dashed; }
.chip.nc-add.on { border-style: solid; }
.chip.nc-lead { cursor: default; }
label.chip:has(input:focus-visible), .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#people { gap: 6px; }
#types { gap: 6px; }
#type-other { margin-top: 10px; max-width: 480px; }
#addr { margin-top: 12px; }
#addr .ff-body { padding: 0; }
.nc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.nc-grid .field[hidden] { display: none; }
.nc-where { margin: 10px 0 0; }
.nc-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--sunk); }
.nc-foot #summary { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); font-weight: 600; }
@media (max-width: 760px) { .nc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .nc-sec { padding: 14px; }
  .nc-foot { padding: 12px 14px; }
  .nc-foot #summary { flex-basis: 100%; }
  .nc-foot .btn { flex: 1 1 auto; }
}

/* A client's companies as cards, each with its cases. */
.co-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.co-card { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.co-card.resigned { opacity: .7; }
.co-card-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.co-card-name, .pc-name { font: 700 15px/1.3 var(--f-display); color: var(--ink); overflow-wrap: anywhere; }
.co-role, .pc-role { display: flex; flex-wrap: wrap; gap: 4px; }
.co-cases { display: grid; gap: 2px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.co-cases p { margin: 0; }
.case-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: var(--ink-2); }
.case-line:hover { background: var(--sunk); text-decoration: none; }
.case-line .cl-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-card-f { display: flex; flex-wrap: wrap; gap: 6px; }

/* A company's directors and shareholders as people. */
.person-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.person-card { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.person-card.resigned { opacity: .7; }
.pc-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pc-av { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 13px; }
.pc-contact { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.pc-pct .pct-wrap, .co-role-pct .pct-wrap { width: 92px; }
/* Settings → Money: the stress rate by the product, as sentences with their boxes in them (round 9, 21 October 2026). */
.aff-stress { display: flex; flex-direction: column; gap: 10px; }
.aff-line { line-height: 2.6; }
.aff-line .aff-pct { display: inline-block; width: 92px; vertical-align: middle; }
.aff-line select { display: inline-block; width: auto; max-width: 100%; vertical-align: middle; }
#stress-long-wrap[hidden] { display: none; }

/* The shared dialogs: choose a person, New company, a person's part in a company, Add an applicant. */
.pc-intro { margin: 0; }
.pc-res, .nco-res, #add-app-offers, #co-found { gap: 6px; margin-top: 8px; }
.pc-res:empty, .nco-res:empty, #co-found:empty { display: none; }
.nco-hand { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
.co-role-ask { border: 0; padding: 0; margin-inline: 0; margin-bottom: 0; display: grid; gap: 8px; }
.co-role-ask legend.lbl, .add-app div.lbl { display: block; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.co-choose { margin-top: 12px; max-width: 480px; }
@media (max-width: 640px) { .nco-hand { grid-template-columns: minmax(0, 1fr); } }

/* (The case header's crumbs of who it is for became "This case relates to": round 10, below.) A finger's press on a link
   to a record: 44px. */
@media (pointer: coarse) {
  .case-line { min-height: 44px; }
  .ch-rel a, .co-card-name, .pc-name, .nc-b-name { display: inline-flex; align-items: center; min-height: 44px; }
}
#people #too-many { flex-basis: 100%; margin: 4px 0 0; }

/* ------------------------------------------------------------ the case's flow (round 9; owner, 21 October 2026)
   The board's columns, by step or by who the case is waiting on, scroll sideways; one with nothing in it stays narrow.
   "Who did what" under a case's name. The case's steps themselves are its rail (below, "the case, one step at a time"). */
#declined-banner { margin: 0 0 12px; }
#p-solicitor .kv dd { overflow-wrap: anywhere; }
.last-done { font-size: 12px; color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; }
.tbl td .last-done, .drawer .last-done { margin-top: 0; }
.page-head .last-done { font-size: 13px; }
.board { display: flex; align-items: flex-start; }
.board > .col { flex: 1 0 250px; min-width: 0; }
.board > .col.col-none { flex: 0 0 150px; }
.board > .col.col-none .col-sum { display: none; }
@media (max-width: 760px) {
  .board { display: grid; }
  .board > .col, .board > .col.col-none { flex: none; }
  .board > .col.col-none .col-sum { display: inline; }
}
.nc-broker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line-2); color: var(--ink-2); }
.nc-broker select { width: auto; max-width: 100%; }
.nc-broker .lbl { margin: 0; }
@media (max-width: 640px) { .nc-broker { padding: 12px 14px; } }
.todo-by { margin-left: 2px; }
/* Numbers & pipeline: nine steps in a row on a wide screen (it was six stages); a phone keeps its two or three. */
@media (min-width: 901px) { .pipe-cols { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }

/* Round 9 (owner, 21 October 2026): who is borrowing, on the case, as cards (js/views/case.js clientFacts, borrowerMore). */
.bcard-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; margin: 0 0 12px; }
.bcard-facts > div { min-width: 0; }
.bcard-facts dt { font-size: 12px; color: var(--muted); }
.bcard-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: break-word; }
.bcard-need { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; justify-content: space-between; font-size: 13px;
  padding: 10px 12px; border-radius: 10px; background: var(--warn-bg, var(--line-2)); }
.bcard-need.done { background: transparent; padding: 4px 0; color: var(--good); }
.bcard-all { margin-top: 12px; }
.bcard-all > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-2); min-height: 44px; display: flex; align-items: center; }
.bcard-all[open] > summary { margin-bottom: 8px; }
@media (max-width: 640px) { .bcard-need { flex-direction: column; align-items: flex-start; } }

/* ------------------------------------------------------------ the case, one step at a time (owner, 22 October 2026)
   "make it clear as day every step and nice and easy to nivigate as easy as lendinvest portal": a white card at the top
   saying where the case is ("Step 4 of 11 · Choose lender") with its main action; the rail of the eleven steps down the
   left, a done one ticked, the one the case is at boxed, the ones to come grey, a skipped one dashed; beside it the part
   chosen, a white card per topic. On a phone the rail is a row at the top that stays in view under the case's header.
   One part shows at a time on every width (.rail-off; js/views/case.js Views._rail). */
.rail-off { display: none !important; }

/* The header */
.page-head.case-head { align-items: flex-start; gap: 14px 24px; margin-bottom: 14px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.case-head .ch-main { flex: 1 1 360px; min-width: 0; }
.ch-eyebrow { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); }
.ch-eyebrow .mono { font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.case-head h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.ch-where { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 8px 0; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2); font-size: 14px; }
.ch-where b { color: var(--ink); }
.ch-stepno { font-weight: 600; }
.ch-dot { color: var(--muted); }
.ch-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: 0 1 380px; max-width: 100%; }
.ch-move, .cs-move-on { font-size: 15px; padding: 10px 18px; }
.case-head .ch-actions { margin-left: 0; justify-content: flex-end; gap: 6px; }
@media (max-width: 760px) {
  .page-head.case-head { padding: 14px; }
  .ch-side { align-items: stretch; width: 100%; }
  .case-head .ch-actions { justify-content: flex-start; }
}
#p-workflow { margin-bottom: 16px; }
#p-workflow .panel-b { padding: 12px 16px; }
.wf-grid .wf-flags { grid-column: 1 / -1; }

/* The rail beside the parts */
.case-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start; }
.case-rail-col { min-width: 0; align-self: stretch; }
.rail { position: sticky; z-index: 5; max-height: calc(100vh - var(--topbar-h, 57px) - 84px); max-height: calc(100dvh - var(--topbar-h, 57px) - 84px);
  overflow-y: auto; padding: 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.rail-g + .rail-g { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.rail-gh { margin: 0 10px 8px; font: 700 11.5px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 5px 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: 600 14px/1.25 var(--f-body); text-align: left; cursor: pointer; }
.rail-item:hover { background: var(--sunk); }
.rail-item .ri-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--muted); font: 700 12px/1 var(--f-body); }
.rail-item .ri-n svg { width: 15px; height: 15px; }
.rail-item .ri-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rail-item .ri-sub { margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--muted); }
.rail-item .tab-n { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.rail-item .tab-n.warn { background: var(--warn-soft); color: var(--warn); }
/* Done: a green tick, its name in the link's colour. */
.rail-item[data-state="done"] .ri-n { background: var(--good); border-color: var(--good); color: var(--surface); }
.rail-item[data-state="done"] .ri-t { color: var(--accent-2); }
/* The step the case is at: in a box. */
.rail-item[data-state="now"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.rail-item[data-state="now"] .ri-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rail-item[data-state="now"] .ri-sub { color: var(--accent-2); }
/* To come: grey. Skipped: grey, its circle dashed. */
.rail-item[data-state="next"], .rail-item[data-state="skipped"] { color: var(--muted); }
.rail-item[data-state="skipped"] .ri-n { border-style: dashed; background: transparent; }
@media (pointer: coarse) { .rail-item { min-height: 44px; } }
/* The part on screen: a bar down its side, its name bolder. */
.rail-item[aria-current="true"] { background: var(--sunk); color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); }
.rail-item[aria-current="true"][data-state="now"] { background: var(--accent-soft); }
.rail-item[aria-current="true"] .ri-t { font-weight: 700; }

/* A part: its heading, its cards, and its foot */
.case-parts { min-width: 0; }
.cs-sec { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cs-sec .panel + .panel { margin-top: 0; }
.cs-slot { display: contents; }
.cs-head { padding: 2px 2px 0; }
.cs-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cs-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 2px; }
.cs-title h2 { margin: 0; font: 700 22px/1.2 var(--f-display); letter-spacing: -.01em; }
.cs-hint { margin: 6px 0 0; max-width: 72ch; color: var(--ink-2); }
.cs-skipped { margin: 10px 0 0; }
.cs-move-here { margin-top: 10px; }
.cs-none { margin: 0; color: var(--ink-2); }
.cs-sub { margin: 0 0 8px; font: 700 13.5px var(--f-display); color: var(--ink-2); }
.cs-pair { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1240px) { .cs-pair { grid-template-columns: minmax(0, 1fr); } }
.cs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.cs-go { flex-direction: column; align-items: flex-start; gap: 0; min-height: 44px; padding: 6px 14px; }
.cs-go-next { align-items: flex-end; }
.cs-go .cs-go-l { font-weight: 600; }
.cs-go .cs-go-to { font-size: 12px; font-weight: 500; color: var(--muted); }
.cs-add { margin: 0; }
.key-dates .kd-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.key-dates .kd-row input { width: 160px; }
.going-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.going-row select { width: auto; max-width: 100%; }
.going-kv dd { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.going-kv { grid-template-columns: minmax(120px, auto) 1fr; }
.val-wrap > .val-card { margin: 0; }

/* Who is borrowing, the company and the property: a card each, their own details opened in place */
.cs-cards { display: flex; flex-direction: column; gap: 14px; }
.bc-av { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2);
  font: 700 13px/1 var(--f-body); }
.bc-av svg { width: 17px; height: 17px; }
.bc-av.sm { width: 28px; height: 28px; font-size: 11.5px; }
.bcard .panel-h h3, #p-co .panel-h h3, #p-prop .panel-h h3 { font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.bc-state { margin-left: auto; }
.bc-state + .actions { margin-left: 0; }
.bcard-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.bcard-details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.bcard-ff { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.own-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--info-soft);
  color: var(--ink-2); font-size: 13.5px; }
.own-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent-2); }
.panel-b > .own-note:last-child { margin-bottom: 0; }
.co-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 12px; }
.co-person { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.co-person:hover { border-color: var(--accent); text-decoration: none; }
.co-person.resigned { opacity: .6; }
.co-person .cp-t { display: flex; flex-direction: column; min-width: 0; }
.co-charges { margin: 0 0 12px; }
.prop-epc { border-bottom: 1px solid var(--line-2); }

/* A phone: the rail is a row at the top, under the case's header, that scrolls sideways */
@media (max-width: 900px) {
  .case-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .case-rail-col { display: contents; }
  .rail { z-index: 14; display: flex; align-items: stretch; max-height: none; margin: 0 -16px 14px; padding: 0 10px; overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain; scrollbar-width: none; background: var(--bg); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail-g { display: flex; flex: none; }
  .rail-g + .rail-g { margin: 0 0 0 4px; padding: 0 0 0 4px; border-top: 0; border-left: 1px solid var(--line); }
  .rail-gh { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); }
  .rail-list { flex-direction: row; gap: 0; }
  .rail-item { width: auto; min-height: 48px; gap: 7px; padding: 8px 10px 5px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; white-space: nowrap; }
  .rail-item .ri-sub { display: none; }
  .rail-item .ri-n { width: 22px; height: 22px; font-size: 11px; }
  .rail-item[data-state="now"] { border-radius: 10px 10px 0 0; }
  .rail-item[aria-current="true"] { box-shadow: none; border-bottom-color: var(--accent); background: transparent; }
  .rail-item[aria-current="true"][data-state="now"] { background: var(--accent-soft); }
  .cs-title h2 { font-size: 20px; }
}
@media (max-width: 640px) {
  .cs-foot > .grow { display: none; }
  .cs-foot > .btn { flex: 1 1 40%; }
  .cs-foot > .cs-move-on { flex-basis: 100%; order: -1; }
  .key-dates .kd-row { flex-wrap: wrap; }
  .key-dates .kd-row input { width: 100%; }
  .bc-state { margin-left: 0; }
}

/* ------------------------------------------------------------ the case's header and rail, after the outside layout review
   (owner, 22 October 2026): the reference once, in the crumbs ("Cases › MC-0013"); what the case relates to, each a link
   with its kind, under its title; badges for states only (stage, settled or awaiting payment, not proceeding, on hold,
   answers to fill), facts in words; the rare and the dangerous under More, Delete apart; whose answers a step still needs,
   under it on the rail; and where each change is saved, said beside it. */
.case-bar .cb-crumbs .sep { margin: 0 2px; }
.case-bar .cb-ref { flex: none; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ch-eyebrow .ch-kind { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.ch-where-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 4px; }
.ch-where-row .ch-where { margin: 0; }
button.ch-fill { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
button.ch-fill:hover { text-decoration: underline; }
.ch-rel { margin: 12px 0 2px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sunk); }
.ch-rel-h { margin: 0 0 6px; font: 700 11.5px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ch-rel dl { margin: 0; display: grid; gap: 4px; }
.ch-rel dl > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.ch-rel dt { font-size: 13px; color: var(--muted); }
.ch-rel dd { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; min-width: 0; font-size: 14px; }
.ch-rel .rel-one { min-width: 0; overflow-wrap: anywhere; }
.ch-rel a { font-weight: 600; }
.ch-rel .rel-kind { color: var(--muted); font-size: 13px; }
.ch-more { position: relative; }
.ch-more > summary { list-style: none; cursor: pointer; }
.ch-more > summary::-webkit-details-marker { display: none; }
.ch-more[open] > summary { background: var(--sunk); }
.ch-more .ch-menu { position: absolute; right: 0; left: auto; top: calc(100% + 6px); z-index: 30; min-width: 240px; display: flex; flex-direction: column; }
.ch-menu [role=menuitem] { justify-content: flex-start; width: 100%; background: none; color: var(--ink); font: 500 14px/1.3 var(--f-body); text-decoration: none; cursor: pointer; }
.ch-menu [role=menuitem] svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.ch-menu-apart { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.ch-menu [role=menuitem].danger, .ch-menu [role=menuitem].danger svg { color: var(--bad); }
.ch-menu [role=menuitem].danger:hover, .ch-menu [role=menuitem].danger:focus-visible { background: var(--bad-soft); }
/* On a phone More opens across the header's width, under its buttons, never past the screen's edge. */
@media (max-width: 760px) {
  .case-head .ch-side { position: relative; }
  .ch-more { position: static; }
  .ch-more .ch-menu { left: 0; right: 0; min-width: 0; scroll-margin-bottom: calc(var(--tabbar-h, 64px) + 12px); }
  .ch-rel dl > div { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) { button.ch-fill { min-height: 44px; padding-inline: 12px; } }

/* The rail: whose answers a step still needs, a line each under it (a wide screen; a phone shows the count) */
.rail-li { display: flex; flex-direction: column; }
.ri-needs { list-style: none; margin: 0 0 4px; padding: 0 0 0 46px; display: flex; flex-direction: column; gap: 1px; }
.ri-need { display: block; width: 100%; padding: 2px 8px; border: 0; border-radius: 6px; background: none; color: var(--warn); text-align: left;
  font: 600 12px/1.35 var(--f-body); cursor: pointer; }
.ri-need span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-need:hover, .ri-need:focus-visible { background: var(--warn-soft); text-decoration: underline; }
@media (min-width: 901px) { .rail-item.with-needs .tab-n { display: none; } }
@media (max-width: 900px) { .rail-li { display: block; } .ri-needs { display: none !important; } }
@media (pointer: coarse) and (min-width: 901px) { .ri-need { min-height: 44px; } }

/* Where a change is saved: on the person's, the company's or the property's own record, or on this case only */
.vx-where { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--accent-2); }
.vx-where svg { width: 15px; height: 15px; flex: none; }
.saved-where { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 16px 10px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.saved-where svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

/* A person's card: their part in words, what they still need with Fill in */
.bc-title { display: flex; flex-direction: column; min-width: 0; }
.bc-title h3 { margin: 0; }
.bc-role { font-size: 12.5px; color: var(--muted); }
.bcard-need { margin: 0 0 12px; }
/* The strip: the chase date's three picks on one line beside it on a wide screen. */
@media (min-width: 1101px) {
  .wf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1.35fr); }
  .chase-picks { flex-wrap: nowrap; }
  .chase-picks .btn { padding: 3px 8px; font-size: 12px; white-space: nowrap; }
}
/* More shut: its items take no room and can't be found by a press (a shut <details> may still report their boxes). */
.ch-more:not([open]) > .ch-menu { display: none; }

/* Companies House first (owner, 26 October 2026; js/views/chfirst.js): the search, the register's details before adding,
   an instruction's borrower found on the register. */
.chf-res { display: grid; gap: 4px; margin-top: 6px; max-height: 300px; overflow: auto; }
.chf-res:empty { display: none; }
.chf-hit { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; min-height: 44px; }
.chf-hit > span { display: block; min-width: 0; overflow-wrap: anywhere; }
.chf-hit.on { border-color: var(--accent); background: var(--accent-soft); }
.chf-sub { display: block; }
.chf-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; background: var(--sunk); }
.chf-card-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.chf-name { font-size: 15px; overflow-wrap: anywhere; }
.chf-kv dd { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.chf-spv { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: 13.5px; }
.chf-spv.yes { background: var(--good-soft); color: var(--good); font-weight: 600; }
.chf-people-l { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.chf-hand { border-top: 1px solid var(--line); padding-top: 10px; }
.chf-offer { font-size: 13px; margin-top: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.chf-offer.chf-found { color: var(--good); }
.chf-offer.chf-none, .chf-offer.chf-off { color: var(--muted); }
#co-spv .btn { margin-left: 4px; }
@media (max-width: 640px) { .chf-kv { grid-template-columns: minmax(0, 1fr); } .chf-kv dt { margin-top: 4px; } }
/* The brokerage code in Settings → Firm (round 13, 28 October 2026): one long word, kept inside a phone's width. */
.org-code { overflow-wrap: anywhere; user-select: all; }
/* One search for everything (owner, 28 October 2026; js/app.js wireSearch): what was found around each word, the words marked, the
   date a message or note was written, and Show more for a group. */
.search-results mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-results .sr-snip { display: block; color: var(--ink-2); overflow-wrap: anywhere; margin-top: 2px; }
.search-results .sr-when { flex: none; white-space: nowrap; }
.search-results a > .grow { min-width: 0; }
.search-results .sr-more { display: block; margin: 2px 8px 6px; padding: 6px 10px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor: pointer; }
.search-results .sr-more:hover, .search-results .sr-more.sel { background: var(--accent-soft); }
.search-results .sr-note { margin: 8px 10px 4px; }
@media (max-width: 900px) { .search-results .sr-more { min-height: 44px; } }

/* Help in sections (round 17): the search, the topics grouped as cards, one topic at a time with Previous and Next. */
.help-search { margin: 0 0 18px; max-width: 640px; }
.help-search input { width: 100%; font-size: 16px; padding: 10px 14px; }
.help-group { margin-bottom: 22px; }
.help-group h2 { font-size: 17px; margin: 0 0 2px; }
.help-group > p { margin: 0 0 10px; }
.help-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.help-topic { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; min-height: 44px; }
.help-topic:hover, .help-topic:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.help-topic b { font-size: 15px; }
.help-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
/* A long topic name wraps inside its button, never past the screen's edge. */
.help-nav .btn { white-space: normal; max-width: 100%; min-width: 0; text-align: left; height: auto; min-height: 36px; }
#help-nav-foot { margin: 12px 0 0; }
#help-one .panel { max-width: 860px; }

/* ------------------------------------------------------------ round 17: a shorter menu and a calmer Today
   (owner, 4 November 2026: "yes perfect much much better … make everything tidy and nice easy to deal with").
   The menu: a gap where a section has no heading, and a short line under an item saying what is in it (js/app.js NAV). */
.nav-gap { height: 10px; }
.nav a { flex-wrap: wrap; row-gap: 0; }
.nav a .nav-hint { flex-basis: 100%; padding-left: 25px; margin-top: -1px; font-size: 11.5px; font-weight: 400; line-height: 1.3; color: var(--muted); }
.nav a.on .nav-hint { color: var(--accent-2); }
/* A group's tabs above its pages (Inbox, Reports; js/nav.js groupTabs), outside the page so they stay while it loads. */
.grp-host { padding: 14px 24px 0; max-width: 1480px; width: 100%; margin: 0 auto; }
.grp-host:not([hidden]) + .content { padding-top: 14px; }
.grp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.grp-tabs::-webkit-scrollbar { display: none; }
.grp-tabs a, .page-tabs .ptab-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: -1px; padding: 10px 14px 7px;
  border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; text-decoration: none; }
.grp-tabs a:hover, .page-tabs .ptab-link:hover { color: var(--ink); text-decoration: none; }
.grp-tabs a.on, .grp-tabs a[aria-current=page], .page-tabs .ptab-link[aria-current=page] { color: var(--accent-2); border-bottom-color: var(--accent); }
.grp-tabs a:focus-visible, .page-tabs .ptab-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grp-tabs .badge { padding: 1px 6px; }
.page-tabs .ptab-list { display: flex; gap: 2px; }
@media (max-width: 900px) {
  .grp-host { padding: 10px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .grp-host:not([hidden]) + .content { padding-top: 10px; }
}
@media (max-width: 760px) {
  /* An open conversation fills the screen under the top bar (as the page heading, the tabs step aside). */
  body:has(.msg-layout.has-thread) .grp-host { display: none; }
}
/* Firm: a big button for each thing set up once, with its line (js/views/firm.js). */
.firm-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.firm-btn { display: flex; gap: 12px; align-items: flex-start; padding: 16px; min-height: 44px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-1); color: inherit; text-decoration: none; min-width: 0; }
.firm-btn:hover { background: var(--sunk); text-decoration: none; }
.firm-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.firm-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); }
.firm-ic svg { width: 20px; height: 20px; }
.firm-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.firm-t b { font: 600 15.5px var(--f-display); color: var(--ink); }
.firm-acct { margin-top: 16px; }
@media (max-width: 640px) { .firm-hub { grid-template-columns: minmax(0, 1fr); } }
/* Today: three counters, then its tabs (js/views/today.js). */
.tiles.today-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
@media (max-width: 640px) { .tiles.today-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .today-tiles .today-tile { padding: 10px 10px; } .today-tiles .today-tile .s { display: none; } }
button.today-tile { font: inherit; text-align: left; cursor: pointer; width: 100%; }
.today-tiles .today-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.today-tabs { margin: 0 0 12px; }
.td-panel { margin-top: 0; }
.td-card { cursor: pointer; }
.td-card-b { min-width: 0; }
/* A phone hides a case row's last column (its "quiet" days, css above); a card on Today has none, its words are its last. */
@media (max-width: 640px) { .queue-item.td-card > .td-card-b { display: block; } }
.td-card-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.td-card-top .verb { color: var(--ink); text-decoration: none; }
.td-card-top .verb:hover { text-decoration: underline; }
.td-card .td-reason { white-space: normal; text-align: left; }
.td-card-sub { margin-top: 3px; overflow-wrap: anywhere; }
.td-card .td-more { position: relative; font-size: inherit; color: var(--accent-2); }
.td-card .td-rest { margin-top: 6px; }
.td-rc { padding: 6px 14px 4px; border-bottom: 1px solid var(--line-2); }
.td-sub-h { margin: 6px 0 2px; font: 600 13px var(--f-display); color: var(--ink-2); }
@media (pointer: coarse) {
  .td-card .td-more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -14px 0; }
}
