/* ============================================================================================================
   The bridge (teams/crm/design/specs/02-bridge.md): every old page body, the templates that extend base.html,
   reads as the new product inside the new shell until its screen is rebuilt. It changes how pages look, never what
   they do or who sees what.

   Loaded last on a bridged page: static/crm/app.css, tokens.css, /ui/brand.css, components.css, then this file.
   Every rule is one of three things:
   - an @font-face that points an old family's name at a new file (section 1);
   - a custom property or the root size on :root (section 2);
   - a rule inside the old body's wrapper, :where(.ui-bridged). The wrapper weighs nothing, so each rule weighs
     exactly what the app.css rule it replaces weighs and wins by coming later, while every app.css rule that used to
     beat it still does (a variant, a state, a phone size).
   Tokens only: no color literal. ui/tests/test_bridge.py checks all of that, and that nothing in app.css is missed.

   The part between the GENERATED markers is written by `python3 -m ui.tools.build_bridge` from today's app.css: run
   it after any change to app.css (the test fails until you do). Everything else is written by hand.
   ============================================================================================================ */

/* ---- 1. The old families, pointed at the new files (spec 02 section 2) -------------------------------------
   Later @font-face rules with the same family and descriptors win, so the old TTFs in static/crm/fonts/ are never
   downloaded. The generated part also names the new families on every rule that named an old one, so these only
   catch what no rule names (an inline style). */
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/newsreader-latin-opsz-normal.f94a697b1650.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/newsreader-latin-opsz-normal.f94a697b1650.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-sans-latin-wght-normal.fa41c43a3d8e.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/instrument-sans-latin-wght-normal.fa41c43a3d8e.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/instrument-sans-latin-wght-normal.fa41c43a3d8e.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-sans-latin-wght-normal.fa41c43a3d8e.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/instrument-sans-latin-wght-normal.fa41c43a3d8e.woff2") format("woff2"); }

/* ---- 2. app.css's custom properties, mapped to tokens (spec 02 section 3), and the root size ----------------
   Declared on :root after app.css's own, so they follow the theme, sun and the company's color. --muted and --bg
   need nothing: tokens.css (loaded after app.css) declares both with the same meaning. */
:root {
  --navy: var(--accent-ink);
  --midnight: var(--text);
  --steel: var(--accent-ink);
  --pale: var(--sunken);
  --rust: var(--accent);
  --line: var(--border);
  --tile: var(--border);
  --field: var(--border-strong);
  --card: var(--surface);
  --green: var(--ok);       --green-bg: var(--ok-soft);
  --red: var(--danger);     --red-bg: var(--danger-soft);
  --amber: var(--warn);     --amber-bg: var(--warn-soft);
  --cream: var(--sunken);   --cream-line: var(--border);
  --radius: var(--r-lg);
  /* 16 px on every device (app.css's phone root of 17 px goes: the tokens carry phone sizes); 18 px in sun, so
     app.css's rem sizes and spacing grow with sun */
  font-size: 16px;
}
@media (max-width: 767px), (pointer: coarse) {
  :root[data-sun="1"] { font-size: 18px; }
}

/* ---- 3. Generated from app.css: old families, small text, all caps, pills and literal colors ---------------- */
/* ==== GENERATED by `python3 -m ui.tools.build_bridge` from static/crm/app.css: don't edit by hand ==== */
/* Old families: Oswald becomes Newsreader, Barlow and Barlow Condensed Instrument Sans (spec 02 section 2).
   Naming the new families here, not only aliasing the old names, means no old face is ever asked for. */
:where(.ui-bridged) h1, :where(.ui-bridged) h2, :where(.ui-bridged) h3 { font-family: var(--font-display); }
:where(.ui-bridged) .suggest-head { font-family: var(--font-ui); }
:where(.ui-bridged) .jump a { font-family: var(--font-ui); }
@media (min-width: 1200px) { :where(.ui-bridged) .side-fold { font-family: var(--font-ui); } }
:where(.ui-bridged) .goal-num strong { font-family: var(--font-display); }
:where(.ui-bridged) .seg a { font-family: var(--font-ui); }
:where(.ui-bridged) .lb-total strong { font-family: var(--font-display); }
:where(.ui-bridged) .lb-rank { font-family: var(--font-display); }
:where(.ui-bridged) .lb-face { font-family: var(--font-display); }
:where(.ui-bridged) .lb-num { font-family: var(--font-display); }
:where(.ui-bridged) .wf-name input[type=text] { font-family: var(--font-display); }
:where(.ui-bridged) .wf-n { font-family: var(--font-display); }
:where(.ui-bridged) .wf-group { font-family: var(--font-ui); }
:where(.ui-bridged) .wf-guide-list dt { font-family: var(--font-ui); }
:where(.ui-bridged) .code-item { font-family: var(--font-ui); }
:where(.ui-bridged) .star-chip { font-family: var(--font-ui); }
:where(.ui-bridged) .card h3 { font-family: var(--font-ui); }
:where(.ui-bridged) .card-ask .label { font-family: var(--font-ui); }
:where(.ui-bridged) .count { font-family: var(--font-display); }
:where(.ui-bridged) .btn { font-family: var(--font-ui); }
:where(.ui-bridged) input[type=text], :where(.ui-bridged) input[type=tel], :where(.ui-bridged) input[type=email], :where(.ui-bridged) input[type=date], :where(.ui-bridged) input[type=time], :where(.ui-bridged) input[type=number], :where(.ui-bridged) input[type=search], :where(.ui-bridged) input[type=password], :where(.ui-bridged) input[type=url], :where(.ui-bridged) select, :where(.ui-bridged) textarea { font-family: var(--font-ui); }
:where(.ui-bridged) .chan { font-family: var(--font-display); }
:where(.ui-bridged) table.data th { font-family: var(--font-ui); }
:where(.ui-bridged) .stat .n { font-family: var(--font-display); }
:where(.ui-bridged) .snapshot-head { font-family: var(--font-ui); }
:where(.ui-bridged) .approve-number { font-family: var(--font-display); }
:where(.ui-bridged) .login input.approve-input { font-family: var(--font-display); }
:where(.ui-bridged) input[type=file] { font-family: var(--font-ui); }
:where(.ui-bridged) input[type=file]::file-selector-button { font-family: var(--font-ui); }
:where(.ui-bridged) .stepper li { font-family: var(--font-ui); }
:where(.ui-bridged) .tg-label { font-family: var(--font-ui); }
:where(.ui-bridged) .cg-dow { font-family: var(--font-ui); }
:where(.ui-bridged) .c2-label { font-family: var(--font-ui); }
:where(.ui-bridged) .portal-nav a { font-family: var(--font-ui); }
:where(.ui-bridged) .portal-upgrade h3 { font-family: var(--font-ui); }
:where(.ui-bridged) .eyebrow { font-family: var(--font-ui); }
:where(.ui-bridged) .big-number { font-family: var(--font-display); }
:where(.ui-bridged) .roof-age legend { font-family: var(--font-display); }
:where(.ui-bridged) .wx-day strong { font-family: var(--font-ui); }
:where(.ui-bridged) .last-note .label { font-family: var(--font-ui); }
:where(.ui-bridged) .inbox-face { font-family: var(--font-display); }
:where(.ui-bridged) .thread-day { font-family: var(--font-ui); }
:where(.ui-bridged) .fq-label { font-family: var(--font-ui); }
:where(.ui-bridged) .need { font-family: var(--font-ui); }
:where(.ui-bridged) .btn.fill-finish { font-family: var(--font-display); }
:where(.ui-bridged) .fb-head-title { font-family: var(--font-display); }
:where(.ui-bridged) .fb-n { font-family: var(--font-display); }
:where(.ui-bridged) .import-steps li { font-family: var(--font-ui); }
:where(.ui-bridged) .import-steps .n { font-family: var(--font-display); }
:where(.ui-bridged) .records.compact h4 { font-family: var(--font-ui); }
:where(.ui-bridged) .day-chip .dow { font-family: var(--font-ui); }
:where(.ui-bridged) .day-chip .dom { font-family: var(--font-display); }
:where(.ui-bridged) .dash-tools strong { font-family: var(--font-ui); }
:where(.ui-bridged) .kpi .l { font-family: var(--font-ui); }
:where(.ui-bridged) .kpi .n { font-family: var(--font-display); }
:where(.ui-bridged) .list-row .when { font-family: var(--font-ui); }
:where(.ui-bridged) .seg-small button { font-family: var(--font-ui); }
:where(.ui-bridged) .trend-legend strong { font-family: var(--font-display); }
/* Text under 13 px today (under 15 px in sun, where the root is 18 px): never under 13, 15 in sun. */
:where(.ui-bridged) .tiny { font-size: var(--fs-xs); }
:where(.ui-bridged) .suggest-head { font-size: var(--fs-xs); }
@media (min-width: 1200px) { :where(.ui-bridged) .side-fold { font-size: var(--fs-xs); } }
:where(.ui-bridged) .lb-detail { font-size: var(--fs-xs); }
:where(.ui-bridged) .cb-sky { font-size: var(--fs-xs); }
:where(.ui-bridged) .wf-group { font-size: var(--fs-xs); }
:where(.ui-bridged) .code-item { font-size: var(--fs-xs); }
:where(.ui-bridged) .todo-need { font-size: var(--fs-xs); }
:where(.ui-bridged) .card-ask .label { font-size: var(--fs-xs); }
:where(.ui-bridged) .chip { font-size: var(--fs-xs); }
:where(.ui-bridged) .hint { font-size: var(--fs-xs); }
:where(.ui-bridged) .mention-line span { font-size: var(--fs-xs); }
:where(.ui-bridged) .chan { font-size: var(--fs-xs); }
@media (max-width: 560px) { :where(.ui-bridged) table.phone-cards td[data-label]::before { font-size: var(--fs-xs); } }
:where(.ui-bridged) .stat .l { font-size: var(--fs-xs); }
:where(.ui-bridged) .snapshot-head { font-size: var(--fs-xs); }
:where(.ui-bridged) .stepper li { font-size: var(--fs-xs); }
:where(.ui-bridged) .flag-chips li { font-size: var(--fs-xs); }
:where(.ui-bridged) .entry { font-size: var(--fs-xs); }
:where(.ui-bridged) .tg-label { font-size: var(--fs-xs); }
:where(.ui-bridged) .tg-hour { font-size: var(--fs-xs); }
:where(.ui-bridged) details.ev > summary { font-size: var(--fs-xs); }
:where(.ui-bridged) .ev-card .tiny { font-size: var(--fs-xs); }
:where(.ui-bridged) .cg-dow { font-size: var(--fs-xs); }
:where(.ui-bridged) .cg-day h3 { font-size: var(--fs-xs); }
:where(.ui-bridged) .c2-label { font-size: var(--fs-xs); }
:where(.ui-bridged) .cm-more { font-size: var(--fs-xs); }
:where(.ui-bridged) .cm-count { font-size: var(--fs-xs); }
@media (max-width: 800px) { :where(.ui-bridged) .cg-dow { font-size: var(--fs-xs); } }
:where(.ui-bridged) .colchart .yaxis span { font-size: var(--fs-xs); }
:where(.ui-bridged) .colchart .peak { font-size: var(--fs-xs); }
:where(.ui-bridged) .colchart .xaxis span { font-size: var(--fs-xs); }
:where(.ui-bridged) .colchart .tip { font-size: var(--fs-xs); }
:where(.ui-bridged) .tick { font-size: var(--fs-xs); }
:where(.ui-bridged) .photo-tag { font-size: var(--fs-xs); }
:where(.ui-bridged) .sign-pad-line { font-size: var(--fs-xs); }
:where(.ui-bridged) .portal-steps li { font-size: var(--fs-xs); }
:where(.ui-bridged) .map-legend { font-size: var(--fs-xs); }
:where(.ui-bridged) .code-pop .code-rules li { font-size: var(--fs-xs); }
:where(.ui-bridged) .eyebrow { font-size: var(--fs-xs); }
:where(.ui-bridged) .wx-badge { font-size: var(--fs-xs); }
:where(.ui-bridged) .last-note .label { font-size: var(--fs-xs); }
:where(.ui-bridged) .inbox-time { font-size: var(--fs-xs); }
:where(.ui-bridged) .inbox-about { font-size: var(--fs-xs); }
:where(.ui-bridged) .thread-day { font-size: var(--fs-xs); }
:where(.ui-bridged) .bubble-meta { font-size: var(--fs-xs); }
:where(.ui-bridged) .convo-hint { font-size: var(--fs-xs); }
:where(.ui-bridged) .convo-rule { font-size: var(--fs-xs); }
:where(.ui-bridged) .scope-head { font-size: var(--fs-xs); }
:where(.ui-bridged) .scope-row .scope-del { font-size: var(--fs-xs); }
@media (max-width: 900px) { :where(.ui-bridged) .scope-row .scope-label { font-size: var(--fs-xs); } }
:where(.ui-bridged) .need { font-size: var(--fs-xs); }
:where(.ui-bridged) .fb-n { font-size: var(--fs-xs); }
:where(.ui-bridged) .import-steps .n { font-size: var(--fs-xs); }
:where(.ui-bridged) .records .sub { font-size: var(--fs-xs); }
:where(.ui-bridged) .records .credit { font-size: var(--fs-xs); }
:where(.ui-bridged) .records.compact h4 { font-size: var(--fs-xs); }
:where(.ui-bridged) .entry .tag, :where(.ui-bridged) .ev .tag { font-size: var(--fs-xs); }
:where(.ui-bridged) .day-chip .dow { font-size: var(--fs-xs); }
:where(.ui-bridged) .day-chip .mon { font-size: var(--fs-xs); }
@media (max-width: 700px) { :where(.ui-bridged) .tiny, :where(.ui-bridged) .hint, :where(.ui-bridged) .chip, :where(.ui-bridged) .stat .l, :where(.ui-bridged) .last-note .label, :where(.ui-bridged) .card-ask .label, :where(.ui-bridged) .need, :where(.ui-bridged) .chan, :where(.ui-bridged) .stepper li, :where(.ui-bridged) .cg-day h3, :where(.ui-bridged) .entry, :where(.ui-bridged) details.ev > summary, :where(.ui-bridged) .inbox-time, :where(.ui-bridged) .inbox-about, :where(.ui-bridged) .bubble-meta, :where(.ui-bridged) .lb-detail, :where(.ui-bridged) .convo-hint, :where(.ui-bridged) .convo-rule, :where(.ui-bridged) .todo-need, :where(.ui-bridged) .fb-n, :where(.ui-bridged) .import-steps .n, :where(.ui-bridged) .wx-badge, :where(.ui-bridged) .portal-steps li, :where(.ui-bridged) .records .sub, :where(.ui-bridged) .records .credit, :where(.ui-bridged) .cb-sky, :where(.ui-bridged) .thread-day, :where(.ui-bridged) .eyebrow, :where(.ui-bridged) .snapshot-head, :where(.ui-bridged) .sign-pad-line, :where(.ui-bridged) .map-legend, :where(.ui-bridged) .colchart .xaxis span, :where(.ui-bridged) .colchart .yaxis span, :where(.ui-bridged) .colchart .peak, :where(.ui-bridged) .records.compact h4 { font-size: var(--fs-xs); } }
:where(.ui-bridged) .alert-dot { font-size: var(--fs-xs); }
:where(.ui-bridged) .alert-dot sup { font-size: var(--fs-xs); }
:where(.ui-bridged) .kpi .l { font-size: var(--fs-xs); }
:where(.ui-bridged) .kpi .m { font-size: var(--fs-xs); }
:where(.ui-bridged) .lc-tick span { font-size: var(--fs-xs); }
:where(.ui-bridged) .lc-tip { font-size: var(--fs-xs); }
:where(.ui-bridged) .lc-x span { font-size: var(--fs-xs); }
/* All caps today: sentence case, no letter spacing (the words are already in sentence case). */
:where(.ui-bridged) h1, :where(.ui-bridged) h2, :where(.ui-bridged) h3 { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .suggest-head { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .jump a { text-transform: none; letter-spacing: normal; }
@media (min-width: 1200px) { :where(.ui-bridged) .side-fold { text-transform: none; letter-spacing: normal; } }
:where(.ui-bridged) .seg a { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .wf-name input[type=text] { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .wf-group { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .wf-guide-list dt { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .code-item { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .card-ask .label { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .chan { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) table.data th { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .snapshot-head { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .stepper li { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .tg-label { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .cg-dow { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .c2-label { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .portal-nav a { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .eyebrow { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .wx-day strong { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .last-note .label { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .thread-day { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .need { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .btn.fill-finish { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .fb-head-title { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .import-steps li { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .records.compact h4 { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .day-chip .dow { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .dash-tools strong { text-transform: none; letter-spacing: normal; }
:where(.ui-bridged) .kpi .l { text-transform: none; letter-spacing: normal; }
/* Round pills today: square-cornered tags. Count badges, avatars, dots, bars and meters stay round. */
:where(.ui-bridged) .jump a { border-radius: var(--r-sm); }
:where(.ui-bridged) .star-chip { border-radius: var(--r-sm); }
:where(.ui-bridged) .todo-toggle.todo-all { border-radius: var(--r-sm); }
:where(.ui-bridged) .todo-need { border-radius: var(--r-sm); }
:where(.ui-bridged) .chip { border-radius: var(--r-sm); }
:where(.ui-bridged) .radios span { border-radius: var(--r-sm); }
:where(.ui-bridged) .stepper li:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
:where(.ui-bridged) .stepper li:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
:where(.ui-bridged) .flag-chips li { border-radius: var(--r-sm); }
:where(.ui-bridged) .tabs a { border-radius: var(--r-sm); }
:where(.ui-bridged) .portal-steps li { border-radius: var(--r-sm); }
:where(.ui-bridged) .wx-badge { border-radius: var(--r-sm); }
:where(.ui-bridged) .need { border-radius: var(--r-sm); }
:where(.ui-bridged) .fill-status { border-radius: var(--r-sm); }
:where(.ui-bridged) .import-steps li { border-radius: var(--r-sm); }
:where(.ui-bridged) .entry .tag, :where(.ui-bridged) .ev .tag { border-radius: var(--r-sm); }
/* Literal colors today, each through its token (spec 02 section 4). */
:where(.ui-bridged) .avatar { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .suggest-all { background: var(--raised); }
:where(.ui-bridged) .reach a, :where(.ui-bridged) .reach .reach-off { background: var(--surface); }
:where(.ui-bridged) .reach .reach-main { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .jump a { background: var(--surface); }
:where(.ui-bridged) .jump a.on { color: var(--on-accent); background: var(--accent); }
@media (min-width: 1200px) { :where(.ui-bridged) .jump.side .jump-in { background: var(--surface); } }
:where(.ui-bridged) .seg { background: var(--sunken); }
:where(.ui-bridged) .seg a:hover { background: var(--hover); }
:where(.ui-bridged) .seg a.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .lb-row.first .lb-rank span { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .lb-face { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .lb-row.first .lb-face { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--navy); }
:where(.ui-bridged) .lb-row.you .lb-bar { background: var(--surface); }
:where(.ui-bridged) .lb-row.you .chip { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .lb-row.off .lb-face { background: var(--muted); }
:where(.ui-bridged) .wf-n { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .code-quote { color: var(--ink, var(--text)); border-left: 3px solid var(--tile, var(--border)); }
:where(.ui-bridged) .star-chip { background: var(--surface); }
:where(.ui-bridged) .star-chip.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .todo-head { background: var(--sunken); border-bottom: 2px solid var(--border); }
:where(.ui-bridged) .todo-toggle, :where(.ui-bridged) .fold-toggle { border: 1px solid var(--border-strong); background: var(--surface); }
:where(.ui-bridged) .chip.todo-tag { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .todo-need { background: var(--surface); }
:where(.ui-bridged) .card .todo-head .sub, :where(.ui-bridged) .todo-head .muted { color: var(--muted); }
:where(.ui-bridged) .todo-po { background: var(--surface); }
:where(.ui-bridged) .chip.st-prospect { background: var(--sunken); }
:where(.ui-bridged) .chip.st-new { background: var(--sunken); }
:where(.ui-bridged) .chip.st-appointment, :where(.ui-bridged) .chip.st-inspected, :where(.ui-bridged) .chip.st-proposal { background: var(--sunken); }
:where(.ui-bridged) .btn { background: var(--surface); }
:where(.ui-bridged) .btn.primary { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .btn.danger { border-color: var(--danger); }
:where(.ui-bridged) input[type=text], :where(.ui-bridged) input[type=tel], :where(.ui-bridged) input[type=email], :where(.ui-bridged) input[type=date], :where(.ui-bridged) input[type=time], :where(.ui-bridged) input[type=number], :where(.ui-bridged) input[type=search], :where(.ui-bridged) input[type=password], :where(.ui-bridged) input[type=url], :where(.ui-bridged) select, :where(.ui-bridged) textarea { background: var(--surface); }
:where(.ui-bridged) .radios span { background: var(--surface); }
:where(.ui-bridged) .radios input:checked + span { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .panel { background: var(--surface); }
:where(.ui-bridged) .mention-pick { background: var(--raised); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .chan { color: var(--on-text); }
:where(.ui-bridged) .chan.ch-note { background: var(--sunken); }
:where(.ui-bridged) table.data { background: var(--surface); }
:where(.ui-bridged) table.data th { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .col h2 { background: var(--surface); box-shadow: none; }
:where(.ui-bridged) .col .card { background: var(--surface); box-shadow: none; }
:where(.ui-bridged) .chip.kind-insurance { background: var(--accent-soft); }
:where(.ui-bridged) .col.target { background: var(--accent-soft); }
:where(.ui-bridged) .card.dragging { box-shadow: var(--shadow-float); }
:where(.ui-bridged) .toast { color: var(--on-text); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .stat { background: var(--surface); }
:where(.ui-bridged) input[type=file]::file-selector-button { background: var(--surface); }
:where(.ui-bridged) .stepper li { background: var(--sunken); }
:where(.ui-bridged) .stepper li.done { background: var(--sunken); }
:where(.ui-bridged) .stepper li.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .flag-chips li.warn { border-color: var(--warn); }
:where(.ui-bridged) .flag-chips li.ok { border-color: var(--ok); }
:where(.ui-bridged) .chip.stage-sold, :where(.ui-bridged) .chip.stage-prep { background: var(--sunken); }
:where(.ui-bridged) .chip.stage-complete, :where(.ui-bridged) .chip.stage-invoiced { background: var(--sunken); }
:where(.ui-bridged) .entry { background: var(--sunken); }
:where(.ui-bridged) .entry.kind-visit { background: var(--surface); }
:where(.ui-bridged) .entry.tentative { background: var(--surface); }
:where(.ui-bridged) .cal-show-pick { background: var(--raised); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .tg-wrap { background: var(--surface); }
:where(.ui-bridged) .tg-day.today { background: var(--accent-soft); }
:where(.ui-bridged) .tg-allday { background: var(--surface); }
:where(.ui-bridged) .tg-label { background: var(--surface); }
:where(.ui-bridged) .tg-hours { background: var(--surface); }
:where(.ui-bridged) .tg-col.weekend { background: var(--sunken); }
:where(.ui-bridged) .tg-col.today { background: var(--accent-soft); }
:where(.ui-bridged) details.ev > summary { background: var(--sunken); }
:where(.ui-bridged) details.ev.kind-visit > summary { background: var(--surface); }
:where(.ui-bridged) details.ev.kind-busy > summary { background: var(--sunken); border-left-color: var(--border-strong); }
:where(.ui-bridged) details.ev.tentative > summary { background: var(--surface); }
:where(.ui-bridged) .ev-card { box-shadow: var(--shadow-float); background: var(--raised); }
:where(.ui-bridged) .cg-day { background: var(--surface); }
:where(.ui-bridged) .cg-day.weekend { background: var(--sunken); }
:where(.ui-bridged) .cm .cg-day.outside h3 a { color: var(--muted); }
:where(.ui-bridged) .cm-count { background: var(--sunken); }
:where(.ui-bridged) .colchart .plot { border-bottom: 1px solid var(--border); }
:where(.ui-bridged) .colchart .gridline { border-top: 1px solid var(--border); }
:where(.ui-bridged) .colchart .band.on .bar { background: var(--accent-hover); }
:where(.ui-bridged) .colchart .tip { background: var(--raised); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .tabs a { background: var(--surface); }
:where(.ui-bridged) .tabs a.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .tabs a.on .count { background: var(--on-accent); color: var(--accent); }
:where(.ui-bridged) .steps .bar { background: var(--sunken); }
:where(.ui-bridged) .tick { border: 2px solid var(--border-strong); color: var(--surface); }
:where(.ui-bridged) .step.skipped .tick { background: var(--sunken); }
:where(.ui-bridged) .chip.stage-signed, :where(.ui-bridged) .chip.stage-deposit, :where(.ui-bridged) .chip.stage-request { background: var(--sunken); }
:where(.ui-bridged) .chip.stage-supplementing, :where(.ui-bridged) .chip.stage-done { background: var(--sunken); }
:where(.ui-bridged) .photo-tag { background: var(--text); color: var(--on-text); }
:where(.ui-bridged) .scan-editor { color: var(--on-text); }
:where(.ui-bridged) .scan-handle::after { background: var(--raised); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .btn.cta { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .sign-page { background: var(--surface); }
:where(.ui-bridged) .sign-pad { background: var(--surface); }
:where(.ui-bridged) .portal-top { background: var(--surface); }
:where(.ui-bridged) .portal-steps li { background: var(--sunken); }
:where(.ui-bridged) .portal-steps li.now { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .map-toggle .dot { border: 2px solid var(--surface); }
:where(.ui-bridged) .map-legend i.hollow { background: var(--surface); }
:where(.ui-bridged) .chip.code-strong { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .map-pin span { border: 3px solid var(--surface); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .leaflet-popup-content .btn { color: var(--on-accent); }
:where(.ui-bridged) .brand-sample.light { background: var(--surface); }
:where(.ui-bridged) .wx-day { background: var(--surface); }
:where(.ui-bridged) .wx-day.wx-good { border-color: var(--ok); }
:where(.ui-bridged) .wx-day.wx-risky { border-color: var(--warn); }
:where(.ui-bridged) .wx-day.wx-bad { border-color: var(--danger); }
:where(.ui-bridged) .sub-link { border: 1px solid var(--border-strong); }
:where(.ui-bridged) .chip.st-review { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .inbox { background: var(--surface); }
:where(.ui-bridged) .inbox-face { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .inbox-face.unknown { background: var(--muted); }
:where(.ui-bridged) .convo-links .chip { background: var(--sunken); }
:where(.ui-bridged) .bubble-row.in .bubble { background: var(--surface); }
:where(.ui-bridged) .bubble-row.out .bubble { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .bubble-row.out .bubble a { color: var(--on-accent); }
:where(.ui-bridged) .bubble-row.out.not-sent .bubble { background: var(--surface); }
:where(.ui-bridged) .bubble-row.out.bad .bubble { border: 1.5px solid var(--danger); }
:where(.ui-bridged) .fill-section { background: var(--surface); }
:where(.ui-bridged) .pick span { background: var(--surface); }
:where(.ui-bridged) .pick span::before { border: 2px solid var(--border-strong); background: var(--surface); }
:where(.ui-bridged) .pick input:checked + span { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .pick input:checked + span::before { border-color: var(--on-accent); background: var(--on-accent); }
:where(.ui-bridged) .pick input[type=checkbox]:checked + span::before { border: solid var(--on-accent); }
:where(.ui-bridged) .fq-x { background: var(--text); color: var(--on-text); }
:where(.ui-bridged) .fq-signed img, :where(.ui-bridged) .answer-sign { background: var(--surface); }
:where(.ui-bridged) .fill-status { background: var(--raised); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .fill-status.bad { border-color: var(--warn); }
:where(.ui-bridged) .fb-n { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .fb-choices .chip { background: var(--surface); }
:where(.ui-bridged) .import-steps .n { background: var(--surface); }
:where(.ui-bridged) .import-steps li.done .n { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .import-steps li.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .area-tools .btn[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .portal-demo { border-bottom: 1px solid var(--warn); }
:where(.ui-bridged) .entry.kind-busy { background: var(--sunken); border-left-color: var(--border-strong); }
:where(.ui-bridged) .entry .tag, :where(.ui-bridged) .ev .tag { background: var(--sunken); }
:where(.ui-bridged) .day-chip { background: var(--surface); }
:where(.ui-bridged) .day-chip.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .day-chip.on .mon { color: var(--on-accent); }
:where(.ui-bridged) .pdf-page { background: var(--surface); box-shadow: none; }
:where(.ui-bridged) .pdf-link:hover, :where(.ui-bridged) .pdf-link:active, :where(.ui-bridged) .pdf-link:focus-visible { background: var(--accent-soft); }
:where(.ui-bridged) .code-notes { background: var(--surface); }
:where(.ui-bridged) .alert-dot { color: var(--surface); }
:where(.ui-bridged) .kpis.tally .kpi { background: var(--surface); }
:where(.ui-bridged) .trend-card { --chart-sold: var(--accent-ink); --chart-collected: var(--text); }
:where(.ui-bridged) .seg-small button:hover { background: var(--hover); }
:where(.ui-bridged) .seg-small button.on { color: var(--on-accent); background: var(--accent); }
:where(.ui-bridged) .lc-dot { border: 2px solid var(--surface); }
:where(.ui-bridged) .lc-tip { background: var(--raised); box-shadow: var(--shadow-float); }
:where(.ui-bridged) .sat-pick .sat-dot circle { fill: var(--raised); }
:where(.ui-bridged) .sat-pick .sat-dot.on circle { stroke: var(--surface); }
:where(.ui-bridged) .sat-pick .sat-dot.on text, :where(.ui-bridged) .sat-pick .sat-dot.added text { fill: var(--on-accent); }
:where(.ui-bridged) .sat-pick .sat-dot.added circle { stroke: var(--surface); }
/* ==== END GENERATED ==== */

/* ---- 4. The old body (spec 02 sections 2 and 7) ------------------------------------------------------------ */
.ui-bridged {
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text);
  /* capped at 1440 px and centered, except the pages that need the width (the shell adds the class by URL name) */
  max-width: var(--content-max);
  margin-inline: auto;
}
.ui-bridged.ui-bridged--wide { max-width: none; }
:where(.ui-bridged) .small { font-size: var(--fs-sm); }
:where(.ui-bridged) .empty { color: var(--muted); font-size: var(--fs-md); }

/* ---- 5. Headings and numbers (spec 02 section 2) ------------------------------------------------------------ */
:where(.ui-bridged) h1 {
  font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-2xl);
  line-height: var(--lh-tight); letter-spacing: var(--track-display); color: var(--text); text-wrap: balance;
}
:where(.ui-bridged) h2 {
  font-family: var(--font-ui); font-weight: var(--fw-strong); font-size: var(--fs-lg);
  line-height: var(--lh-tight); color: var(--text);
}
:where(.ui-bridged) h3 {
  font-family: var(--font-ui); font-weight: var(--fw-strong); font-size: var(--fs-md);
  line-height: var(--lh-tight); color: var(--text);
}
:where(.ui-bridged) .card h3 { font-size: var(--fs-md); color: var(--text); }
/* Big money: the serif, tabular lining figures */
:where(.ui-bridged) .stat .n, :where(.ui-bridged) .kpi .n, :where(.ui-bridged) .big-number,
:where(.ui-bridged) .goal-num strong, :where(.ui-bridged) .lb-num {
  font-family: var(--font-display); font-weight: var(--fw-display); color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}
:where(.ui-bridged) .stat .l, :where(.ui-bridged) .kpi .l { color: var(--muted); font-size: var(--fs-sm); }
:where(.ui-bridged) table.data td, :where(.ui-bridged) .num, :where(.ui-bridged) .kpi, :where(.ui-bridged) .stat,
:where(.ui-bridged) .count { font-variant-numeric: tabular-nums; }

/* ---- 6. Component skins: old classes, new looks (spec 02 section 5) ----------------------------------------- */
/* Buttons: secondary, primary, small, danger, disabled, busy */
:where(.ui-bridged) .btn {
  min-height: var(--ctl-h); padding: 0 var(--btn-px); gap: var(--sp-2);
  border: var(--bw) solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--accent-ink);
  font: var(--fw-strong) var(--btn-fs)/1.2 var(--font-ui);
}
:where(.ui-bridged) .btn:hover { background: var(--accent-soft); border-color: var(--accent-ink); }
:where(.ui-bridged) .btn.primary { background: var(--accent); color: var(--on-accent); border: var(--bw-strong) solid var(--accent-edge); }
:where(.ui-bridged) .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-edge); }
:where(.ui-bridged) .btn.small { min-height: var(--ctl-h-sm); padding: 0 var(--sp-3); font-size: var(--btn-fs); }
:where(.ui-bridged) .btn.danger { color: var(--danger); border-color: var(--danger); }
:where(.ui-bridged) .btn.danger:hover { background: var(--danger-soft); }
:where(.ui-bridged) .btn[disabled] { opacity: 1; }
:where(.ui-bridged) .btn[disabled]:where(:not([data-was-enabled])) {        /* not the one waiting for its save */
  border-style: dashed; border-color: var(--border-strong); background: var(--sunken); color: var(--muted); cursor: not-allowed;
}
/* One tap per save: the pressed button keeps its label and shows it's busy (a still mark under reduced motion) */
:where(.ui-bridged) form.sending button[data-was-enabled] { cursor: progress; }
:where(.ui-bridged) form.sending button[data-was-enabled]::after {
  content: ""; display: inline-block; flex: none; width: 1em; height: 1em; margin-left: var(--sp-1); vertical-align: -.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--r-pill);
  animation: ui-spin .8s linear infinite;
}
:where(.ui-bridged) .linkbtn {
  color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
:where(.ui-bridged) .linkbtn:hover { text-decoration-thickness: 2px; }
/* The action row (Call, Text, Map, Log): secondary buttons, the main one primary, "No text consent" a tag */
:where(.ui-bridged) .reach a, :where(.ui-bridged) .reach .reach-off {
  min-height: var(--ctl-h); padding: 0 var(--btn-px); border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-md); color: var(--accent-ink); font: var(--fw-strong) var(--btn-fs)/1.2 var(--font-ui);
}
:where(.ui-bridged) .reach a:hover { background: var(--accent-soft); border-color: var(--accent-ink); }
:where(.ui-bridged) .reach .reach-main { border-color: var(--accent-edge); }
:where(.ui-bridged) .reach .reach-main:hover { background: var(--accent-hover); }
:where(.ui-bridged) .reach .reach-off {
  background: var(--sunken); border-color: var(--sunken); color: var(--text); font-weight: var(--fw-medium);
}
:where(.ui-bridged) .chip.todo-tag:hover { background: var(--accent-hover); }

/* Cards: surface, a hairline, no shadow; a 3 px edge says late, warn or today */
:where(.ui-bridged) .card {
  background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg);
  box-shadow: none; padding: var(--sp-4);
}
:where(.ui-bridged) .card.late { border-left: var(--bar) solid var(--danger); }
:where(.ui-bridged) .card.today { border-left: var(--bar) solid var(--info); }
:where(.ui-bridged) .card.today.storm-alert { border-left-color: var(--info); background: var(--info-soft); }
:where(.ui-bridged) .card.warn { border-left: var(--bar) solid var(--warn); }
:where(.ui-bridged) .card-ask { background: var(--sunken); border-radius: var(--r-md); }
:where(.ui-bridged) .card.ghost { border-style: dashed; border-color: var(--accent-ink); }
:where(.ui-bridged) .stat, :where(.ui-bridged) .kpis.tally .kpi {
  border: var(--bw) solid var(--border); border-radius: var(--r-lg); box-shadow: none;
}
:where(.ui-bridged) .kpi { border-radius: var(--r-md); }

/* Tags (chips): square corners, the sunken fill, words in --text; the status ones keep their status colors */
:where(.ui-bridged) .chip {
  padding: 1px var(--sp-2); border-radius: var(--r-sm); background: var(--sunken); color: var(--text);
  font-size: var(--fs-sm); font-weight: var(--fw-strong); line-height: 1.4;
}
:where(.ui-bridged) .chip.st-prospect, :where(.ui-bridged) .chip.st-new, :where(.ui-bridged) .chip.st-appointment,
:where(.ui-bridged) .chip.st-inspected, :where(.ui-bridged) .chip.st-proposal, :where(.ui-bridged) .chip.st-nurture,
:where(.ui-bridged) .chip.st-lost, :where(.ui-bridged) .chip.kind-insurance, :where(.ui-bridged) .chip.kind-retail {
  background: var(--sunken); color: var(--text);
}
:where(.ui-bridged) .chip.st-won { background: var(--ok-soft); color: var(--ok); }

/* Filter chips (.tabs a, the Today and job pages' section chips): outlined, the chosen one filled with a check */
:where(.ui-bridged) .tabs a, :where(.ui-bridged) .jump a, :where(.ui-bridged) .star-chip {
  position: relative; display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: var(--chip-h); padding: 0 var(--sp-3);
  border: var(--bw) solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: var(--fw-medium) var(--chip-fs)/1.2 var(--font-ui);
}
:where(.ui-bridged) .tabs a::after, :where(.ui-bridged) .jump a::after, :where(.ui-bridged) .star-chip::after {
  content: ""; position: absolute; left: 0; right: 0;                 /* the hit area: 44 px on touch, 64 in sun */
  top: calc(-1 * var(--hit-extra)); bottom: calc(-1 * var(--hit-extra));
}
:where(.ui-bridged) .tabs a:hover, :where(.ui-bridged) .jump a:hover, :where(.ui-bridged) .star-chip:hover {
  background: var(--surface); border-color: var(--accent-ink); color: var(--accent-ink);
}
:where(.ui-bridged) .tabs a.on, :where(.ui-bridged) .jump a.on, :where(.ui-bridged) .star-chip.on {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent-edge); font-weight: var(--fw-strong);
}
:where(.ui-bridged) .tabs a.on::before, :where(.ui-bridged) .star-chip.on::before {
  content: ""; flex: none; width: 9px; height: 5px; margin: 0 2px 3px 0;          /* the check mark */
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
:where(.ui-bridged) .tabs a.on:hover, :where(.ui-bridged) .jump a.on:hover, :where(.ui-bridged) .star-chip.on:hover {
  background: var(--accent-hover); color: var(--on-accent);
}
/* The job page's side list on a computer: sidebar items, the current one with the 3 px ink bar */
@media (min-width: 1200px) {
  :where(.ui-bridged) .jump.side a {
    min-height: var(--nav-item-h); padding: 0 var(--sp-3); border: 0; border-left: var(--bar) solid transparent;
    border-radius: 0 var(--r-md) var(--r-md) 0; background: none; color: var(--text);
  }
  :where(.ui-bridged) .jump.side a::after { content: none; }
  :where(.ui-bridged) .jump.side a:hover { background: var(--hover); color: var(--text); }
  :where(.ui-bridged) .jump.side a.on { background: var(--accent-soft); border-left-color: var(--accent-ink); color: var(--text); }
}

/* Count badges: round, the UI font, tabular */
:where(.ui-bridged) .count {
  display: inline-grid; place-items: center; min-width: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--sunken); color: var(--text); font: var(--fw-strong) var(--fs-xs)/1.5 var(--font-ui);
}
:where(.ui-bridged) .count.red { background: var(--danger-soft); color: var(--danger); }

/* The segmented control */
:where(.ui-bridged) .seg {
  gap: 2px; padding: 2px; border: var(--bw) solid var(--border-strong); border-radius: var(--r-md); background: transparent;
}
:where(.ui-bridged) .seg a {
  display: inline-flex; align-items: center; min-height: calc(var(--ctl-h) - 4px - 2 * var(--bw)); padding: 0 var(--sp-3);
  border: var(--bw) solid transparent; border-radius: var(--r-sm); color: var(--text);
  font: var(--fw-medium) var(--fs-sm)/1.2 var(--font-ui);
}
:where(.ui-bridged) .seg a:hover { background: var(--hover); }
:where(.ui-bridged) .seg a.on {
  background: var(--surface); border-color: var(--accent-ink); color: var(--accent-ink); font-weight: var(--fw-strong);
}

/* Panel messages and the toast */
:where(.ui-bridged) .msgs li { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); color: var(--text); }
:where(.ui-bridged) .msgs .success { color: var(--ok); }
:where(.ui-bridged) .msgs .warning { color: var(--warn); }
:where(.ui-bridged) .msgs .error { color: var(--danger); }
:where(.ui-bridged) .toast {
  border: var(--bw) solid var(--border-strong); border-radius: var(--r-md);
  background: var(--raised); color: var(--text); box-shadow: var(--shadow-float);
}
:where(.ui-bridged) .toast.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
@media (max-width: 767px), (pointer: coarse) {
  /* above the tab bar and the + (app.css's phone rule is `body .toast`, so this one keeps body in front) */
  body :where(.ui-bridged) .toast { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
}

/* Tables: the surface header in muted words with a strong line under it, hairline rows, compact in the office */
:where(.ui-bridged) table.data { background: var(--surface); font-size: var(--fs-sm); }
:where(.ui-bridged) table.data th {
  padding: var(--cell-py) var(--cell-px); background: var(--surface); color: var(--muted);
  font: var(--fw-strong) var(--fs-sm)/1.3 var(--font-ui); border-bottom: var(--bw) solid var(--border-strong);
}
:where(.ui-bridged) table.data td { padding: var(--cell-py) var(--cell-px); border-bottom: var(--bw) solid var(--border); }
:where(.ui-bridged) table.data tfoot td { background: var(--sunken); border-top: var(--bw) solid var(--border-strong); }

/* Forms: labels, fields, errors, choices */
:where(.ui-bridged) label { font-weight: var(--fw-medium); font-size: var(--fs-sm); color: var(--text); }
:where(.ui-bridged) input[type=text], :where(.ui-bridged) input[type=tel], :where(.ui-bridged) input[type=email],
:where(.ui-bridged) input[type=date], :where(.ui-bridged) input[type=time], :where(.ui-bridged) input[type=number],
:where(.ui-bridged) input[type=search], :where(.ui-bridged) input[type=password], :where(.ui-bridged) input[type=url],
:where(.ui-bridged) select, :where(.ui-bridged) textarea {
  min-height: var(--ctl-h); padding: var(--sp-1) var(--sp-3);
  border: var(--bw) solid var(--border-strong); border-radius: var(--r-sm);
  background-color: var(--surface); color: var(--text); font: var(--fw-body) var(--input-fs)/1.3 var(--font-ui);
}
:where(.ui-bridged) textarea { padding: var(--sp-2) var(--sp-3); line-height: var(--lh-body); }
:where(.ui-bridged) input:focus, :where(.ui-bridged) select:focus, :where(.ui-bridged) textarea:focus {
  outline: none; border-color: var(--border-strong);       /* the focus ring (components.css) shows instead */
}
:where(.ui-bridged) input[type=file]::file-selector-button {
  min-height: var(--ctl-h); padding: 0 var(--btn-px); border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-md); color: var(--accent-ink); font: var(--fw-strong) var(--btn-fs)/1.2 var(--font-ui);
}
:where(.ui-bridged) .errorlist { color: var(--danger); font-size: var(--fs-sm); }
:where(.ui-bridged) .radios span, :where(.ui-bridged) .pick span { border-color: var(--border-strong); border-radius: var(--r-sm); }
:where(.ui-bridged) .radios input:checked + span, :where(.ui-bridged) .pick input:checked + span { border-color: var(--accent-edge); }
:where(.ui-bridged) .radios input:focus-visible + span, :where(.ui-bridged) .pick input:focus-visible + span {
  outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-offset);
}
:where(.ui-bridged) details summary { color: var(--accent-ink); font-weight: var(--fw-strong); }

/* The search suggestions (sales/_search_suggest.html) in the top bar's drop-down: the command bar's results look,
   group heads muted 14 px, the picked line --accent-soft with the 3 px bar */
:where(.ui-bridged) .suggest-head { padding: var(--sp-2) var(--sp-3) var(--sp-1); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-strong); }
:where(.ui-bridged) .suggest-line { padding: var(--sp-2) var(--sp-3); color: var(--text); }
:where(.ui-bridged) .suggest-line strong { color: var(--accent-ink); }
:where(.ui-bridged) .suggest-line:hover, :where(.ui-bridged) .suggest-line.on,
:where(.ui-bridged) .suggest-all:hover, :where(.ui-bridged) .suggest-all.on {
  background: var(--accent-soft); box-shadow: inset var(--bar) 0 0 var(--accent-ink); text-decoration: none;
}
:where(.ui-bridged) .suggest-empty { padding: var(--sp-2) var(--sp-3); color: var(--muted); font-size: var(--fs-sm); }

/* Avatars: a surface circle, a strong edge, initials in --text */
:where(.ui-bridged) .avatar { background: var(--surface); border: var(--bw) solid var(--border-strong); color: var(--text); }

/* Board columns: sunken with a hairline; cards on them flat */
:where(.ui-bridged) .col { background: var(--sunken); border: var(--bw) solid var(--border); border-radius: var(--r-lg); }
:where(.ui-bridged) .col .card { border: var(--bw) solid var(--border); border-radius: var(--r-md); }

/* ---- 7. Shapes, focus and motion (spec 02 section 6) -------------------------------------------------------
   The focus ring on every link, button, field, summary and [tabindex] in the old body comes from components.css
   (.ui-body ... :focus-visible), which outweighs app.css's own focus rules. */
:where(.ui-bridged) .card.dragging { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  :where(.ui-bridged) .card.dragging { transform: rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  :where(.ui-bridged) *, :where(.ui-bridged) *::before, :where(.ui-bridged) *::after {
    animation-duration: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0ms !important; scroll-behavior: auto !important;
  }
  :where(.ui-bridged) form.sending button[data-was-enabled]::after {
    animation: none !important; border-right-color: currentColor; border-style: dotted;
  }
}

/* ---- 8. The job page's folds (spec 02 section 9): behavior unchanged (static/crm/folds.js) --------------------
   The triangle is an icon button with a chevron, down when open and right when folded; a folded section's heading
   row reads as a card head, and the whole row folds and opens it (the button's ::before covers the row; anything
   else in the row that can be pressed sits above it). Collapse all / Expand all is a quiet button. */
:where(.ui-bridged) .todo-toggle, :where(.ui-bridged) .fold-toggle {
  border: var(--bw) solid transparent; border-radius: var(--r-md); background: transparent; color: var(--accent-ink);
}
:where(.ui-bridged) button.fold-toggle { width: 28px; height: 28px; }
:where(.ui-bridged) h3 > button.fold-toggle { width: 28px; height: 28px; }
:where(.ui-bridged) .todo-toggle:hover, :where(.ui-bridged) .fold-toggle:hover { background: var(--hover); border-color: var(--border-strong); }
:where(.ui-bridged) .todo-toggle::after, :where(.ui-bridged) .fold-toggle::after {
  content: ""; width: 7px; height: 7px; margin-top: -3px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
:where(.ui-bridged) .todo-toggle[aria-expanded="false"]::after, :where(.ui-bridged) .fold-toggle[aria-expanded="false"]::after {
  margin: 0 2px 0 0; transform: rotate(-45deg);
}
@media (max-width: 767px), (pointer: coarse) {
  :where(.ui-bridged) .todo-toggle, :where(.ui-bridged) button.fold-toggle, :where(.ui-bridged) h3 > button.fold-toggle {
    width: 44px; height: 44px;
  }
  :root[data-sun="1"] :where(.ui-bridged) .todo-toggle, :root[data-sun="1"] :where(.ui-bridged) button.fold-toggle,
  :root[data-sun="1"] :where(.ui-bridged) h3 > button.fold-toggle { width: 64px; height: 64px; }
}
:where(.ui-bridged) .todo-toggle.todo-all { border-color: var(--border-strong); }
body.job-folds :where(.ui-bridged) .section-head { position: relative; }
body.job-folds :where(.ui-bridged) .section-head.folded {
  padding: var(--sp-2) var(--sp-3); background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg);
}
body.job-folds :where(.ui-bridged) .section-head button.fold-toggle::before { content: ""; position: absolute; inset: 0; }
body.job-folds :where(.ui-bridged) .section-head :is(a, input, select, label, button:not(.fold-toggle)) { position: relative; z-index: 1; }
:where(.ui-bridged) .btn.fold-all {
  min-height: var(--ctl-h-sm); padding: 0 var(--sp-1); border-color: transparent; background: transparent;
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
:where(.ui-bridged) .btn.fold-all:hover { background: var(--hover); border-color: transparent; }

/* ---- 9. G1 finish: money, tags and containment (design-system sections 4.4, 4.6 and 5.6) -------------------------
   Money never splits: "-" and "$" are both line-break class PR, so a tight tile broke "-$9,500.00" in two. Nowrap on
   every amount element (the list is ui/tools/bridge_lists.py MONEY, checked by test_bridge) and tracks wide enough that
   the grid drops a column before the number could spill. */
:where(.ui-bridged) .stat .n, :where(.ui-bridged) .kpi .n, :where(.ui-bridged) .big-number,
:where(.ui-bridged) .goal-num strong, :where(.ui-bridged) .lb-num, :where(.ui-bridged) td.num, :where(.ui-bridged) .num {
  white-space: nowrap;
}
:where(.ui-bridged) .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); }
@media (min-width: 768px) {
  :where(.ui-bridged) .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); }
}
:where(.ui-bridged) .stat .n { font-size: var(--fs-xl); line-height: var(--lh-tight); }
@media (min-width: 768px) {
  :where(.ui-bridged) .stat .n { font-size: var(--fs-2xl); }
}
/* A status on a tile: the amount stays --text, a 3 px edge and the label carry the status (never red words) */
:where(.ui-bridged) .stat.red .n, :where(.ui-bridged) .stat.warn .n, :where(.ui-bridged) .stat.green .n { color: var(--text); }
:where(.ui-bridged) .stat.red { border-left: var(--bar) solid var(--danger); }
:where(.ui-bridged) .stat.warn { border-left: var(--bar) solid var(--warn); }
:where(.ui-bridged) .stat.green { border-left: var(--bar) solid var(--ok); }
:where(.ui-bridged) .kpi.red .n { color: var(--text); }
:where(.ui-bridged) .kpi.red { border-left: var(--bar) solid var(--danger); }
/* Tags that hold a sentence wrap inside the box; the action tag and the filter chips stay on one line */
:where(.ui-bridged) .chip { white-space: normal; max-width: 100%; overflow-wrap: break-word; }     /* break-word: a chip beside a long name keeps each word whole */
:where(.ui-bridged) .kind-stack, :where(.ui-bridged) .card-top .chip { flex-shrink: 0; }
:where(.ui-bridged) .chip.todo-tag { white-space: nowrap; }
/* Nothing makes the page wider than the screen: grid and flex items may shrink, fields stay inside their column */
:where(.ui-bridged) :is(.form, .fields, .grid, .row, .two, .three) > * { min-width: 0; }
:where(.ui-bridged) :is(input, select, textarea):not([type=checkbox], [type=radio], [type=file], [type=range]) { max-width: 100%; }
/* The job page's shortcuts run to the page's edges whatever the page padding is (32, 24 compact, 16 on a phone) */
:where(.ui-bridged) .jump {
  margin-inline: calc(-1 * var(--pad-page)); padding-inline: var(--pad-page);
}

/* ---- 10. Forms on old pages: controls with a real size, rows that stay whole (G1 finish; the merge-up look) -------- */
/* Checkboxes and radios: the company's ink, 20 px, and the label with its control is one hit area (24 mouse, 44 touch, 64 sun) */
:where(.ui-bridged) :not(.pick, .radios) > input:is([type=checkbox], [type=radio]) {
  accent-color: var(--accent-ink); width: 1.25rem; height: 1.25rem; flex: none; margin: 0;
}
:where(.ui-bridged) label:has(> input:is([type=checkbox], [type=radio])) {
  display: inline-block; min-height: var(--tap); padding-block: calc((var(--tap) - 1.5em) / 2);
  flex-wrap: wrap;                 /* a label app.css makes a flex row (a right's key beside its words) wraps its pieces */
}
:where(.ui-bridged) label:has(> input:is([type=checkbox], [type=radio])) > input { vertical-align: middle; margin-right: var(--sp-2); }
/* a control and its word ("On", "Primary") never part */
:where(.ui-bridged) label.nowrap { white-space: nowrap; }
/* Who sold it: the word on every radio, the radio centred on its row, the header over its input, a stacked row without a box in a box */
:where(.ui-bridged) .shares-pick { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); }
:where(.ui-bridged) .shares-pick .shares-word { display: inline; }
:where(.ui-bridged) .shares-editor td { vertical-align: middle; }
:where(.ui-bridged) .shares-editor th.num, :where(.ui-bridged) .shares-editor td.num { text-align: left; }
@media (max-width: 560px) {                        /* where the table stacks (app.css, table.phone-cards) */
  :where(.ui-bridged) .shares-editor .table-wrap { border: 0; border-radius: 0; }
  :where(.ui-bridged) .shares-editor table.phone-cards tr { border-bottom: 0; }
  :where(.ui-bridged) .shares-editor table.phone-cards td { border: 0; }
  :where(.ui-bridged) .shares-editor table.phone-cards td[data-label]::before { content: attr(data-label); display: block; }
}
/* The page's first heading sits the same distance under the banner or the tabs as a page that starts with a line of text */
:where(.ui-bridged) > h1:first-child { margin-top: var(--sp-2); }

/* ---- 11. Containment found by the whole-page check (design-system 5.6) ------------------------------------------- */
/* a wide table scrolls in its own box, so its hidden labels (position: absolute) must not escape the box and widen the page */
:where(.ui-bridged) .table-wrap { position: relative; }
/* a table with no scroll box (an email address, a long link) breaks inside its cell instead of widening the page */
:where(.ui-bridged) table.data td { overflow-wrap: break-word; }           /* break-word, not anywhere: it never shrinks a column below its longest word */
:where(.ui-bridged) dd { overflow-wrap: anywhere; }
/* the scope lines' row has nine fixed tracks: narrower ones where the sidebar-less laptop and tablet widths are tight */
@media (min-width: 901px) and (max-width: 1199px) {
  :where(.ui-bridged) .scope-head, :where(.ui-bridged) .scope-row {
    grid-template-columns: 2.6rem 6.5rem minmax(8rem, 1fr) 4.5rem 3.2rem 5.5rem 5.5rem 5.5rem 4.8rem;
  }
}
/* a column chart wider than a phone scrolls in its own box (design-system 5.6); only on a phone, where it can be too wide:
   a box that scrolls sideways also clips its top, so the peak's value and the top axis label get room above the plot */
@media (max-width: 560px) {
  :where(.ui-bridged) .colchart { overflow-x: auto; max-width: 100%; margin-top: 0; padding-top: 1.6rem; }
}
/* a row of text and its side note or Edit link wraps on a narrow screen instead of spilling past its card */
:where(.ui-bridged) .line { flex-wrap: wrap; }
:where(.ui-bridged) .line > * { min-width: 0; overflow-wrap: anywhere; }
/* the text side takes the room; the side note or buttons drop under it only when the text would be under 14rem */
:where(.ui-bridged) .line > :first-child { flex: 1 1 14rem; }
/* a table that sits straight in a panel (no scroll box of its own) scrolls inside the panel when the screen is too narrow */
:where(.ui-bridged) .panel:has(table:not(.table-wrap table)) { overflow-x: auto; }
:where(.ui-bridged) .line > .nowrap { min-width: auto; flex: none; overflow-wrap: normal; display: flex; align-items: center; gap: var(--sp-1); }   /* flex: the link's own 44 px hit area is part of the box */    /* an amount with its link keeps its width; the row wraps instead */
/* only a heading with its button wraps; a status chip beside long text stays on the right (app.css .spread > .end) */
:where(.ui-bridged) .spread:has(> :is(h1, h2, h3, h4)) { flex-wrap: wrap; }
:where(.ui-bridged) .spread > * { min-width: 0; }
:where(.ui-bridged) label:has(> input:is([type=checkbox], [type=radio])) { max-width: 100%; min-width: 0; overflow-wrap: break-word; }
/* a note under an amount (the profit-split line on a statement, a hint, a field error) wraps; only the amount keeps one line */
:where(.ui-bridged) td.num :is(div, p, ul) { white-space: normal; }
/* the Edit link's touch padding (app.css .line .nowrap > a) must not reach past its piece of the row */
:where(.ui-bridged) .line > .nowrap > a:last-child { margin-inline-end: 0; padding-inline-end: 0; }
/* Who sold it: the header over its input (app.css's table.data th.num is heavier than a plain class) */
:where(.ui-bridged) .shares-editor table.data th.num, :where(.ui-bridged) .shares-editor table.data td.num { text-align: left; }
/* the action row (Call, Text, Directions, Add a note) is two by two on a phone: four 64 px buttons in a row run past the screen in sun */
@media (max-width: 559px) {
  :where(.ui-bridged) .reach { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559px) { :where(.ui-bridged) .spread { gap: var(--sp-2); } }       /* the right-hand piece (a status and its button) needs the room in sun */
:where(.ui-bridged) .spread > div[style*="text-align:right"] { min-width: min-content; }     /* the right-hand piece (status and button) never shrinks under its button; the text side gives way */
