:root {
  --bg: #f4f6f8; --card: #fff; --ink: #1c2430; --muted: #5c6b7a; --line: #dfe5eb;
  --brand: #1f4e79; --brand-ink: #fff; --accent: #2f7d5b; --warn: #a15c00; --bad: #a12a2a; --chip: #eef2f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
/* The hidden attribute must always win over component display rules (request 019). */
[hidden] { display: none !important; }
a.btn.primary-link { display: inline-block; background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; }
.demo-banner { background: #fff4d6; color: #6b4a00; text-align: center; font-size: 13px; padding: 6px 12px; border-bottom: 1px solid #f0dca0; font-weight: 600; letter-spacing: .02em; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--brand); color: var(--brand-ink); padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 800; }
.brand-name { font-weight: 700; font-size: 18px; }
.brand-sub { font-size: 12px; opacity: .8; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 1px 8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--brand-ink); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 15px; opacity: .85; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.16); opacity: 1; }
.who { font-size: 14px; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.who button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; outline: none; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 700; }
button, .btn { font: inherit; font-size: 15px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button:disabled { opacity: .55; cursor: not-allowed; }
textarea { width: 100%; max-width: 640px; display: block; }
.card.removed { opacity: .75; border-style: dashed; }
.subtotal { font-size: 18px; }
ul.roster { list-style: none; padding: 0; margin: 0; }
ul.roster li { padding: 6px 0; border-bottom: 1px solid var(--line); }
h3 { font-size: 16px; margin: 0 0 6px; }
.notice.historical { font-size: 16px; border-width: 2px; }
ol.history { padding-left: 20px; margin: 0; }
ol.history li { margin: 6px 0; }
details > summary { cursor: pointer; font-weight: 600; }
.field { margin: 12px 0; }
a.btn { display: inline-block; text-decoration: none; margin: 4px 0; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #c7d0d9; border-radius: 8px; background: #fff; min-width: 0; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { display: flex; flex-direction: column; }
.row > .grow { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; } tr.click:hover { background: #f7f9fb; }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 13px; margin: 2px 4px 2px 0; }
.chip.ok { background: #e3f3eb; color: var(--accent); } .chip.warn { background: #fff1dc; color: var(--warn); } .chip.bad { background: #fbe6e6; color: var(--bad); }
.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.notice.info { background: #eef5fc; border-color: #c9dcef; } .notice.warn { background: #fff6e8; border-color: #f0d4a6; } .notice.bad { background: #fdeeee; border-color: #f0c2c2; }
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.account { text-align: left; padding: 12px 14px; }
.account.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,78,121,.2); }
.account strong { display: block; }
.account span { color: var(--muted); font-size: 13px; }
.tree ul { list-style: none; margin: 0; padding-left: 20px; border-left: 1px dashed var(--line); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 6px 0; }
.tree .node { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kind { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.right { text-align: right; }
@media (max-width: 640px) {
  .main { padding: 16px 12px 40px; }
  .topbar { padding: 10px 12px; }
  .who { margin-left: 0; width: 100%; justify-content: space-between; }
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 4px; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
}

/* Key/value details (request 030): one visible label per value; stacks on narrow screens. */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 8px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  dl.kv { grid-template-columns: 1fr; gap: 0; }
  dl.kv dt { font-size: 13px; }
  dl.kv dd { margin-bottom: 8px; }
}

/* Inline line editors (requests 022/032, layout fixed in 033): controls wrap inside the cell and may shrink; a select is
   never wider than its container; explanations wrap on their own line instead of widening the select. */
select { max-width: 100%; }
.line-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; flex: 1 1 auto; min-width: 0; max-width: 100%; margin-top: 4px; }
.line-edit select { flex: 1 1 12rem; width: 100%; min-width: 0; }
.line-edit input { min-width: 0; max-width: 8rem; }
.line-edit .note { flex: 1 0 100%; min-width: 0; overflow-wrap: anywhere; }
.line-edit .note:empty { display: none; }
.note { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  table.responsive td > .line-edit { justify-content: flex-start; }
}

/* Request 034: long dynamic text (staff/store names, history entries, concerns) wraps instead of widening the page.
   overflow-wrap: anywhere also lowers the min-content width, so flex/grid/table containers can shrink to the viewport.
   Nothing is clipped or hidden. */
h1, .sub, .card p, .notice, ol.history li, ul.roster li, .who span, table.responsive td { overflow-wrap: anywhere; }
.grid > .card { min-width: 0; }
.who span { min-width: 0; }
@media (max-width: 640px) {
  table.responsive td > * { min-width: 0; }
  table.responsive td::before { flex: 0 0 auto; }
}

/* Request 096: form rows never exceed their card. A field wrapper in a .row is a flex item whose automatic minimum width
   is its content's width: a select sizes itself to its LONGEST option label, so the wrapper (and the page) could become
   wider than a phone. Wrappers may shrink to the line, and their controls are capped at the wrapper's width; a select
   still shows its chosen text and the full option labels in the native picker. A fieldset's default min-width is its
   content width, so it is allowed to shrink too. Nothing is clipped or hidden. */
.row > div { min-width: 0; max-width: 100%; }
.row input, .row select { max-width: 100%; }
fieldset { min-width: 0; max-width: 100%; }
legend { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .row > div { flex: 1 1 100%; }            /* phones: one field per line, each the full card width */
  .row > div > input, .row > div > select { width: 100%; }
}

/* Request 101: worklist items stack on phones; attention is said in text and only tinted (no icons, rails or pills). */
ul.worklist li { display: grid; gap: 2px; padding: 10px 0; overflow-wrap: anywhere; }
ul.worklist li .row { margin: 6px 0 0; }
.attn { color: var(--bad); }

/* Request 108: Focus shell + Today over saved work. Tokens: the company accent (--brand; no per-company colour is
   recorded yet, so every company gets this neutral default) is separate from status colours (--bad, --warn); headline and
   body fonts are system stacks (nothing is fetched). Active navigation is a filled background, never an underline or
   edge accent; status is said in text and only tinted. */
:root { --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --font-head: var(--font-body);
  --head-weight: 750; --ink-2: #3b4856; }
body { font-family: var(--font-body); }
h1, h2, h3, .brand-name { font-family: var(--font-head); }
.brand-mark:empty { display: none; }
.nav { align-items: center; }
.nav a, .more > summary { min-height: 40px; display: inline-flex; align-items: center; }
.more { position: relative; }
.more > summary { list-style: none; color: var(--brand-ink); padding: 7px 12px; border-radius: 8px; font-size: 15px; font-weight: 400; opacity: .85; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "\25BE"; margin-left: 6px; font-size: 12px; }
.more.active > summary, .more[open] > summary, .more > summary:hover { background: rgba(255,255,255,.16); opacity: 1; }
.more-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; max-width: calc(100vw - 24px); display: grid; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; }
.more-menu a { color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 8px; min-height: 44px; display: flex; align-items: center; opacity: 1; }
.more-menu a.active, .more-menu a:hover { background: var(--chip); font-weight: 650; }
.f-date { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: 4px 0 6px; overflow-wrap: anywhere; }
.f-headline { font-size: clamp(26px, 6vw, 36px); line-height: 1.15; margin: 0 0 14px; font-weight: var(--head-weight); }
.f-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.f-actions .btn { margin: 0; }
.f-store { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.f-store label { margin: 0; }
.f-summary-box { margin: 0 0 14px; }
.f-summary { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 18px; font-weight: 650; }
.f-summary li { overflow-wrap: anywhere; }
.f-cols { display: grid; gap: 0 20px; }
.f-col { display: grid; align-content: start; min-width: 0; }
.f-panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 4px; }
.f-count { font-weight: 650; margin: 0 0 6px; }
.f-item-title { font-weight: 700; }
.f-stage { color: var(--ink-2); }
.f-why { margin-top: 10px; }
.f-why > summary { font-size: 14px; color: var(--muted); }
@media (min-width: 900px) {
  .f-cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 640px) {
  .nav { width: 100%; order: 3; }
  .f-store { flex: 1 1 100%; }
  .f-store select { flex: 1 1 auto; min-width: 0; }
}
/* Request 110: the More menu must stay inside the screen however many items precede More (Calendar, Unconfirmed) and
   however long the current label is. Wide screens: the menu opens right-aligned under More, capped to the viewport.
   Phones: it is anchored to the full-width nav row instead of to More, spanning that row (inside the page padding). Labels
   wrap rather than widen anything; touch targets stay 44px; the summary label may wrap too. */
.more > summary { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.more-menu { left: auto; right: 0; min-width: min(220px, calc(100vw - 24px)); }
.more-menu a { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .nav { position: relative; }
  .more { position: static; }
  .more-menu { left: 0; right: 0; min-width: 0; max-width: none; width: auto; }
}

/* Request 115: saved Work discovery. Grouped board columns stack independently on wide screens and become one list on
   phones; selected view/filter buttons use a filled background (no underline, edge accent or colour-only meaning). */
.work-board { display: grid; gap: 0 18px; align-items: start; }
.work-col { min-width: 0; }
.work-card .f-item-title { display: inline-block; text-decoration: none; color: var(--ink); }
.work-card .f-item-title:hover, .work-card .f-item-title:focus-visible { text-decoration: underline; }
.work-view button.active, .work-groups button.active { background: var(--chip); border-color: var(--ink-2); font-weight: 650; }
.work-groups, .work-view { align-items: center; }
@media (min-width: 900px) { .work-board { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
/* Request 117: customer search/workspace. Long names, VINs and vehicles wrap instead of widening the page; the chosen
   vehicle is a filled card (no side rail). */
.work-card, .f-headline, .sub { overflow-wrap: anywhere; }
.work-card.selected { background: var(--chip); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
/* Request 119: draft workspace. The concern reads first; the subtotal is set apart by a plain rule (no rails or pills);
   package cards inside a panel don't nest a second heavy border; summary lines wrap. */
.est-concern { font-size: 17px; margin: 4px 0 8px; overflow-wrap: anywhere; white-space: pre-wrap; }
.est-subtotal { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.f-panel .card { box-shadow: none; }
.f-count, .f-stage { overflow-wrap: anywhere; }
#estimate-history > summary { font-weight: 650; cursor: pointer; padding: 10px 0; }

/* Request 120: tables with amounts (package lines, package review, earlier revisions, seller attribution).
   - An amount and a button label never break inside the token ($29.99, Change); words in cells break only between
     words (or, for an unbreakable long word, as a last resort), never syllable by syllable.
   - Each table sits in its own container: when THAT width is narrow (a half column, a phone) it becomes label/value
     rows, so nothing needs sideways scrolling. The viewport rule above still applies where container queries don't.
   - A quantity/seller editor opens as a full-width row under its line instead of inside the narrow cell. */
.table-wrap { container-type: inline-size; min-width: 0; }
table.money td { overflow-wrap: break-word; }
table.money .amount, table.money button { white-space: nowrap; overflow-wrap: normal; }
table.money td[data-label="Unit price"], table.money td[data-label="Line total"], table.money td[data-label="Parts"], table.money td[data-label="Labor"],
table.money td[data-label="Services"], table.money td[data-label="Total"] { white-space: nowrap; }
table.money tr.line-editor-row > td { background: var(--bg); border-radius: 8px; }
.line-editor-title { margin: 0 0 4px; font-weight: 650; overflow-wrap: anywhere; }
@container (max-width: 680px) {
  table.money thead { display: none; }
  table.money, table.money tbody { display: block; }
  table.money tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.money td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 4px 4px; text-align: right; white-space: normal; }
  table.money td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: 0 0 auto; }
  table.money td > :not(.amount) { min-width: 0; }
}
/* Request 121: a saved reading's value and unit stay together ("6.50 mm"); long item names still wrap. */
.reading-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* After the stacked rules on purpose (same specificity, later wins): the editor row is one plain block, no label. */
table.money tr.line-editor-row > td { display: block; text-align: left; white-space: normal; }
table.money tr.line-editor-row > td::before { content: none; }

/* Request 128: Calendar week agenda. One vertical list of dated sections at every width (no timeline, durations or
   bars); each date heading reads as a date, not a small caps label. Entries wrap instead of widening the page. */
.cal-week { display: grid; gap: 0; }
.cal-day h2 { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 6px; overflow-wrap: anywhere; }
.cal-day ul.worklist li { padding: 8px 0; }
.cal-day .f-item-title { font-variant-numeric: tabular-nums; }

/* Request 036: attribution breakdown (read-only disclosure); long names and line text wrap. */
details.attribution > summary, details.attribution-lines > summary { overflow-wrap: anywhere; }
details.attribution-lines { margin: 6px 0; }
details.attribution-lines li { overflow-wrap: anywhere; }

/* Request 152: Today's completion promises as compact rows that wrap into as many columns as fit (one on phones). Each
   row keeps its own width (min-width: 0 + overflow-wrap) so nothing is clipped or scrolled out of view; only the
   "Promise time passed" text carries the warning colour, the rest of the row stays normal ink. */
ul.promise-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0 18px; }
ul.promise-list li { min-width: 0; padding: 8px 0; overflow-wrap: anywhere; }
ul.promise-list li .row { margin: 4px 0 0; }
/* Request 168: connected visit journey (Focus). Saved records vs simulation are told apart by label, not colour alone. */
.notice.ok { background: #e9f6ef; border-color: #b9dfca; }
.chip.saved { background: #e6eef7; color: var(--brand); font-weight: 650; }
.chip.sim { background: transparent; border: 1px dashed var(--ink-2); color: var(--ink-2); font-weight: 650; }
.f-visit-head { display: grid; gap: 4px; margin: 4px 0 12px; }
.f-visit-head .f-headline { margin: 0; }
.f-visit-head .veh { font-size: 17px; color: var(--ink-2); margin: 0; overflow-wrap: anywhere; }
.f-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 8px; overflow-x: auto; padding-bottom: 6px; }
.f-tabs a { text-decoration: none; padding: 10px 14px; font-weight: 650; color: var(--ink-2); border-radius: 8px; min-height: 44px; white-space: nowrap; display: inline-flex; align-items: center; }
.f-tabs a[aria-current="page"] { color: var(--ink); background: var(--chip); font-weight: 750; }
.f-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 8px; font-size: 15px; }
.f-kv dt { color: var(--muted); } .f-kv dd { margin: 0; overflow-wrap: anywhere; }
.journey-legend p { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.journey-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.journey-step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 0; }
.journey-step.is-now { border: 2px solid var(--brand); }
.journey-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.journey-n { width: 26px; height: 26px; border-radius: 999px; background: var(--chip); display: inline-grid; place-items: center; font-weight: 750; font-size: 14px; }
.journey-step-body p { margin: 4px 0; overflow-wrap: anywhere; }
.journey-panel { border: 2px solid var(--brand); }
.journey-panel .row, .journey-scenario .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.journey-change { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; display: grid; gap: 8px; }
.journey-change li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.journey-timeline li { margin-bottom: 8px; overflow-wrap: anywhere; }
.journey-visit { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; }
@media (min-width: 900px) { .journey-cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }

/* Request 168 (continuation): Focus appearance presets and type pairings ported from prototypes/advisor-experience.
   Independent of company identity: surfaces, corners, borders and heading type only. Status is always a word, never colour alone. */
:root { --radius-ui: 12px; --border-ui: 1px; --font-head: inherit; --head-style: normal; --head-transform: none; --head-track: -.01em; }
:root[data-look="modern"] { --bg: #f4f5f7; --card: #ffffff; --ink: #14171a; --ink-2: #464d55; --muted: #5f6670; --line: #dfe2e6; --radius-ui: 12px; }
:root[data-look="motorsport"] { --bg: #eceef1; --card: #ffffff; --ink: #0e1013; --ink-2: #3c424a; --muted: #565d66; --line: #d1d5da; --radius-ui: 3px; --head-style: italic; --head-transform: uppercase; }
:root[data-look="trail"] { --bg: #e7e8e3; --card: #f8f8f5; --ink: #1a1c18; --ink-2: #434840; --muted: #5c6258; --line: #c4c7bc; --radius-ui: 8px; --border-ui: 2px; }
:root[data-look="editorial"] { --bg: #f6f2e8; --card: #fbf8f1; --ink: #1d231f; --ink-2: #4b554e; --muted: #6e776f; --line: #ddd6c5; --radius-ui: 18px; }
:root[data-type="sans"] { --font-head: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --head-track: -.022em; }
:root[data-type="condensed"] { --font-head: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif; --head-track: .005em; }
:root[data-type="slab"] { --font-head: Rockwell, "Roboto Slab", Superclarendon, Clarendon, "Bookman Old Style", Georgia, serif; --head-track: -.012em; }
:root[data-type="serif"] { --font-head: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; --head-track: -.012em; }
h1, h2, .f-headline { font-family: var(--font-head); font-style: var(--head-style); text-transform: var(--head-transform); letter-spacing: var(--head-track); }
.card, .journey-step, .notice { border-radius: var(--radius-ui); border-width: var(--border-ui); }
:root[data-look="motorsport"] .topbar { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
:root[data-look="trail"] .topbar { border-bottom: 2px solid var(--ink); }
.look-card[data-look-preview="motorsport"] strong { font-style: italic; text-transform: uppercase; }
.look-card[data-look-preview="editorial"] strong { font-family: ui-serif, Georgia, serif; }

/* Journey: the next action leads (phone and desktop); details are progressive disclosure. */
.journey-next { border: 2px solid var(--brand); background: var(--card); }
.journey-next h2 { font-size: 22px; margin: 0 0 6px; }
.journey-next .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.journey-next .row > * { min-height: 44px; }
.journey-proposal { font-size: 16px; }
.journey-why h3 { font-size: 14px; margin: 10px 0 4px; }
.journey-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14px; }
.journey-about > summary { color: var(--ink-2); cursor: pointer; }
.journey-about p { margin: 6px 0; }
.journey-step > details > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 44px; }
.journey-step > details > summary::-webkit-details-marker { display: none; }
.journey-step[data-status="blocked"] { border-color: var(--bad); }
.journey-customer .customer-view { border: 0; padding: 0; }
.journey-link { font-size: 14px; }
/* Request 213: quote "Why this next step" card (full width above the columns): short labels, values take the width. */
.explain-card .f-kv { grid-template-columns: minmax(7.5rem, max-content) minmax(0, 1fr); }
.explain-card .f-why .f-kv { margin-top: 8px; }
.explain-card .notice ul.plain { margin: 6px 0 0; }
.explain-card .explain-unknowns { margin: 8px 0 0; overflow-wrap: anywhere; }
/* Saved explanation card: stack label over value on phones so long ids, rule versions and sources stay readable. */
.saved-explanation .f-kv dd, .stack-kv .f-kv dd { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 640px) {
  .saved-explanation .f-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .stack-kv .f-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .stack-kv .f-kv dt { margin-top: 10px; font-weight: 650; }
  .stack-kv .f-kv dd { margin: 0; }
  .saved-explanation .f-kv dt { margin-top: 10px; font-weight: 650; }
  .saved-explanation .f-kv dd { margin: 0; }
}

/* ======================================================================================================================
   Request 220: Focus app layer (phone-first shop workspace). One consolidated visual system over the existing classes.
   Company identity = the signed-in company's name/initial + the --brand accent; status colours stay semantic and are
   always paired with words. No decorative edge accents, no active-nav underlines (active = filled background).
   ====================================================================================================================== */
:root { --paper: #f4f5f7; --surface: #fff; --rule: #e3e6ea; --ink: #14171a; --ink-2: #464d55; --muted: #5f6670;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05); --radius-ui: 14px; --border-ui: 1px; --tab-h: 64px; }
body.focus-app { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
.focus-app .topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--rule); padding: 10px 20px; gap: 14px; }
.focus-app .brand-mark { background: var(--brand); color: #fff; border-radius: 10px; width: 36px; height: 36px; font-size: 17px; }
.focus-app .brand-name { color: var(--ink); font-size: 18px; letter-spacing: -.01em; font-weight: 750; }
.focus-app .nav a, .focus-app .more > summary { color: var(--ink-2); opacity: 1; font-weight: 600; font-size: 15px; border-radius: 10px; }
.focus-app .nav a.active, .focus-app .nav a:hover, .focus-app .more.active > summary, .focus-app .more[open] > summary, .focus-app .more > summary:hover { background: #e9eef5; color: var(--brand); }
.focus-app .who { color: var(--ink-2); }
.focus-app .who button { background: var(--surface); color: var(--ink); border: 1px solid var(--rule); }
.more-install { width: 100%; text-align: left; margin-top: 4px; min-height: 44px; font-weight: 650; color: var(--brand); }
.focus-app .main { max-width: 1180px; padding-top: 18px; }
.focus-app .card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-ui); box-shadow: var(--shadow); }
.focus-app .f-panel h2 { color: var(--ink-2); }
.focus-app h1 { letter-spacing: -.015em; }
.focus-app .f-headline { letter-spacing: -.02em; }
.focus-app button, .focus-app .btn { border-radius: 10px; min-height: 40px; border-color: var(--rule); font-weight: 600; }
.focus-app button.primary, .focus-app a.btn.primary-link { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.focus-app .notice { border-radius: 12px; }
.focus-app .chip { font-weight: 600; }
.focus-app input, .focus-app select, .focus-app textarea { border-color: #cfd5dc; border-radius: 10px; min-height: 40px; }

/* ---- the shared visit header + same-visit tabs ---- */
#visit-bar:empty { display: none; }
#visit-bar { max-width: 1180px; margin: 14px auto 0; padding: 0 20px; }
.visit-bar { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-ui); box-shadow: var(--shadow); padding: 14px 16px 0; }
.visit-bar-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: flex-start; }
.visit-bar-title { display: grid; gap: 2px; min-width: 0; }
.visit-ticket { font-size: 20px; font-weight: 780; letter-spacing: -.015em; }
.visit-who { color: var(--ink-2); overflow-wrap: anywhere; }
.visit-bar-state { display: flex; flex-wrap: wrap; gap: 6px; }
.visit-tabs { display: flex; gap: 4px; overflow-x: auto; margin-top: 12px; padding-bottom: 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.vtab { flex: 0 0 auto; text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: 14px; padding: 8px 12px; border-radius: 10px; min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
.vtab:hover { background: #f0f3f7; }
.vtab.active { background: #e9eef5; color: var(--brand); }
#rehearse-banner:empty { display: none; }
#rehearse-banner { max-width: 1180px; margin: 12px auto 0; padding: 0 20px; }

/* ---- journey: purposeful perspectives, compact simulation and ASA assistance ---- */
.focus-app .journey-panel { border: 1px solid var(--rule); background: var(--surface); }
.focus-app .journey-step { border-radius: 12px; }
.focus-app .journey-step.is-now { box-shadow: 0 0 0 2px rgba(31,78,121,.18); }
.focus-app .f-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: #eceff3; border-radius: 12px; padding: 4px; }
.focus-app .f-tabs a { text-decoration: none; color: var(--ink-2); font-weight: 650; padding: 8px 12px; border-radius: 9px; min-height: 40px; display: inline-flex; align-items: center; }
.focus-app .f-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.focus-app .saved-explanation, .focus-app .explain-card { background: #fbfcfe; }

/* ---- phone: bottom tab bar for the primary areas; More opens upward ---- */
@media (max-width: 760px) {
  .focus-app .topbar { padding: 8px 12px; }
  .focus-app .who { width: auto; margin-left: auto; font-size: 13px; }
  .focus-app .who span { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .focus-app .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--rule);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); flex: none; }
  .focus-app .nav a, .focus-app .more > summary { justify-content: center; text-align: center; font-size: 12px; min-height: 52px; padding: 6px 2px; flex-direction: column; border-radius: 10px; }
  .focus-app .more { position: static; }
  .focus-app .more > summary::after { content: none; }
  .focus-app .more-menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom)); max-height: 60vh; overflow-y: auto; }
  body.focus-app { padding-bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); }
  #visit-bar, #rehearse-banner { padding: 0 12px; }
  .visit-ticket { font-size: 18px; }
}
.offline-page .main { max-width: 560px; }
/* ASA recommendation in the visit header: current fixed-rule proposal, who decides, what is missing; Why opens the journey. */
.asa-now { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eef4fb; display: grid; gap: 2px; }
.asa-tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.asa-line, .asa-missing { margin: 0; overflow-wrap: anywhere; }
.asa-missing { color: var(--ink-2); font-size: 14px; }
.asa-why { font-weight: 650; font-size: 14px; color: var(--brand); }

/* ======================================================================================================================
   Request 221: Today "Up next", visit Overview stage card, compact scenario bar, role views, module hosts.
   ====================================================================================================================== */
.asa-assist:empty { display: none; }
.asa-assist { margin-top: 8px; }
/* Today: one row per visit — ticket + who, then Stage / Blocker / Next, then the actions. */
.today-priority { margin-bottom: 14px; }
.tp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.tp-head h2 { margin: 0; }
.tp-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.tp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.tp-row.is-attn { background: #fff7f5; border-color: #f2c9bf; }
.tp-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tp-ticket { font-weight: 750; letter-spacing: -.01em; }
.tp-who { color: var(--ink-2); overflow-wrap: anywhere; }
.tp-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 8px 0 0; font-size: 14px; }
.tp-facts dt { color: var(--muted); font-weight: 650; }
.tp-facts dd { margin: 0; overflow-wrap: anywhere; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.today-lists > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); margin: 6px 0 10px; }
/* Visit Overview: where the visit is. */
.visit-now { margin: 12px 0; }
.visit-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 0 12px; padding: 0; counter-reset: vs; }
.visit-steps li { counter-increment: vs; text-align: center; font-size: 13px; font-weight: 650; color: var(--muted); padding: 8px 4px; border-radius: 10px; background: #f0f2f5; }
.visit-steps li::before { content: counter(vs) " · "; }
.visit-steps li.done { background: #e7f3ea; color: #23633a; }
.visit-steps li.now { background: var(--brand); color: #fff; }
.visit-now-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; align-items: center; }
.visit-now-facts dt { color: var(--muted); font-weight: 650; }
.visit-now-facts dd { margin: 0; overflow-wrap: anywhere; }
.visit-about > summary, .visit-objectives > summary { cursor: pointer; font-weight: 650; color: var(--ink-2); }
/* Journey: compact scenario control and role views. */
.scenario-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.scenario-pick { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scenario-more { margin-left: auto; }
.scenario-more > summary { cursor: pointer; color: var(--ink-2); font-weight: 650; }
.journey-role { margin: 4px 0 8px; }
.journey-more { margin: 10px 0; }
.journey-more > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.tech-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tech-item { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; }
.tech-item.blocked { background: #fff7f5; }
.tech-item.done { color: var(--ink-2); }
.module-host:empty { min-height: 40vh; }
@media (max-width: 760px) {
  .tp-row { grid-template-columns: minmax(0, 1fr); }
  .tp-actions { justify-content: flex-start; }
  .visit-steps li { font-size: 12px; padding: 6px 2px; }
  .visit-steps li::before { content: none; }
  .scenario-more { margin-left: 0; }
}

/* Request 235: the category sections index (#/sections) and the cross-section strip under each section */
.section-index { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.section-index li { padding: .5rem 0; border-bottom: 1px solid var(--line, #e5e5e5); }
.section-index a { font-weight: 600; }
.section-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--line, #e5e5e5); font-size: .9rem; }

/* ---------- sign in (Oct 19): one centred card, practice accounts as a list ---------- */
.si { min-height: calc(100vh - 120px); display: grid; place-items: start center; padding: 6vh 16px 40px; }
.si-card { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06); }
.si-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink);
  font-weight: 700; font-size: 22px; margin: 0 auto 14px; }
.si-card h1 { text-align: center; font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
.si-sub { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.si-list { display: flex; flex-direction: column; gap: 0; grid-template-columns: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.si-list .si-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; cursor: pointer;
  border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.si-list .si-row:first-child { border-top: 0; }
.si-list .si-row:hover { background: var(--chip); }
.si-list .si-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.si-list .si-row.sel { background: var(--chip); box-shadow: none; }
.si-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.si-list .si-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.si-list .si-note { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; white-space: normal; }
.si-check { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); }
.si-row.sel .si-check { border-color: var(--brand); background: var(--brand);
  box-shadow: inset 0 0 0 4px var(--card); }
.si-form { display: flex; flex-direction: column; gap: 10px; }
.si-more summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.si-fields { display: grid; grid-template-columns: 1fr 90px; gap: 10px; margin-top: 10px; }
.si-fields .si-pw { grid-column: 1 / -1; }
.si-fields input { width: 100%; box-sizing: border-box; }
.si-who { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.si-go { width: 100%; padding: 12px 16px; font-size: 16px; border-radius: 12px; }
@media (max-width: 480px) { .si { padding-top: 3vh; } .si-card { padding: 22px 16px 18px; border-radius: 16px; } }
