/* AI Controller — dashboard styles. Tokens first; light + dark. */
:root {
  color-scheme: light;
  --bg: #eef1f4; --surface: #ffffff; --surface-2: #f6f8fa; --ink: #14202c; --muted: #566573; --faint: #86939f;
  --hair: #e2e7ec; --hair-2: #d1d8df;
  --brand: #003562; --brand-2: #0b4f8a; --accent: #c8102e; --on-brand: #ffffff;
  --pos: #11734b; --pos-bg: #e3f3eb; --neg: #b3261e; --neg-bg: #fbe9e7; --warn-bg: #fdf3dc; --warn: #8a5a00;
  --status-good: #0ca30c; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #d03b3b;
  --s-BYT: #0072b2; --s-BYV: #e69f00; --s-GEC: #009e73; --s-GEM: #d55e00; --s-CHM: #cc79a7; --s-CHO: #56b4e9;
  --track: #e6ebf0; --grid: #edf0f3;
  --shadow: 0 1px 2px rgba(15,30,45,.05), 0 8px 24px rgba(15,30,45,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1218; --surface: #161f28; --surface-2: #121a22; --ink: #e8edf1; --muted: #a0adb8; --faint: #6f7d89;
    --hair: #26323d; --hair-2: #34424f;
    --brand: #7fb2e5; --brand-2: #9cc4ec; --accent: #ef5a6f; --on-brand: #0c1218;
    --pos: #4cc38a; --pos-bg: #123325; --neg: #f07a70; --neg-bg: #3a1c19; --warn-bg: #33270f; --warn: #e6b45a;
    --s-BYT: #0072b2; --s-BYV: #e69f00; --s-GEC: #009e73; --s-GEM: #d55e00; --s-CHM: #cc79a7; --s-CHO: #56b4e9;
    --track: #25313b; --grid: #1f2a33;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1218; --surface: #161f28; --surface-2: #121a22; --ink: #e8edf1; --muted: #a0adb8; --faint: #6f7d89;
  --hair: #26323d; --hair-2: #34424f;
  --brand: #7fb2e5; --brand-2: #9cc4ec; --accent: #ef5a6f; --on-brand: #0c1218;
  --pos: #4cc38a; --pos-bg: #123325; --neg: #f07a70; --neg-bg: #3a1c19; --warn-bg: #33270f; --warn: #e6b45a;
  --s-BYT: #0072b2; --s-BYV: #e69f00; --s-GEC: #009e73; --s-GEM: #d55e00; --s-CHM: #cc79a7; --s-CHO: #56b4e9;
  --track: #25313b; --grid: #1f2a33;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.4);
}

/* ---------- type scale: every screen font size comes from here ----------
   Sora for titles and headline figures, Inter for everything else. The print has its own pt scale. */
:root {
  --fs-label: 11px;    /* uppercase labels (tiles, table headers, controls), tags, badges */
  --fs-small: 12px;    /* change chips, notes, captions, legends, chart text, tooltips */
  --fs-meta: 13px;     /* secondary text: section subtitles, controls, buttons, toggles, card footers */
  --fs-body: 14px;     /* body text, tables, rows */
  --fs-card: 15px;     /* card titles */
  --fs-section: 17px;  /* section titles */
  --fs-figure: 20px;   /* the headline figure of a card or strip */
  --fs-display: 24px;  /* page title, KPI tile values */
}
.cap { color: var(--muted); font-size: var(--fs-small) }  /* caption under or beside a figure */

* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font: var(--fs-body)/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased }
h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; letter-spacing: -.015em; margin: 0 }
button, select { font: inherit; color: inherit }
.tnum, td, .v { font-variant-numeric: tabular-nums }
[hidden] { display: none !important }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 600px at 80% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%), var(--bg) }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; text-align: center }
.login-card img { height: 46px; display: block; margin: 0 auto 18px }
.login-card h1 { font-size: var(--fs-display); margin-bottom: 4px }
.login-card p { color: var(--muted); margin: 0 0 22px }
.btn-primary { width: 100%; padding: 12px 16px; border: 0; border-radius: 11px; font-weight: 600; background: var(--brand); color: var(--on-brand); cursor: pointer }
.btn-primary:hover { filter: brightness(1.1) }
.login-foot { margin-top: 18px; color: var(--faint); font-size: var(--fs-small) }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--hair) }
.topbar-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 24px; flex-wrap: wrap }
/* CXP Auto Dealer Group wordmark */
.group-mark { display: block; font: 700 var(--fs-small)/1.1 "Sora", "Inter", sans-serif; letter-spacing: .02em; text-transform: uppercase;
  color: #fff; background: var(--brand); border-radius: 8px; padding: 6px 10px }
.login-mark { display: inline-block; margin: 0 auto 18px; font-size: var(--fs-meta) }
.product { line-height: 1.15; margin-right: 6px }   /* the product leads the header */
.product b { font-family: "Sora"; font-size: var(--fs-section); letter-spacing: -.015em; display: block; color: var(--brand) }
.product small { color: var(--faint); font-size: var(--fs-label) }
.product .by { display: flex; align-items: center; gap: 4px; margin-top: 2px }
.product .cxp { height: 11px; width: auto; display: block }
.cxp-dark { display: none !important }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cxp-light { display: none !important } :root:not([data-theme="light"]) .cxp-dark { display: block !important } }
:root[data-theme="dark"] .cxp-light { display: none !important }
:root[data-theme="dark"] .cxp-dark { display: block !important }
.tabs { display: flex; gap: 4px; margin-left: 8px }
.tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer }
.tab:hover { background: var(--surface-2); color: var(--ink) }
.tab[aria-selected="true"] { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand) }
.tab .count { font-size: var(--fs-label); background: var(--warn-bg); color: var(--warn); border-radius: 99px; padding: 1px 7px; margin-left: 4px }
.spacer { flex: 1 }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.ctl { position: relative }
.ctl label { position: absolute; top: -7px; left: 10px; font-size: var(--fs-label); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); background: var(--surface); padding: 0 4px }
select { appearance: none; -webkit-appearance: none; padding: 8px 30px 8px 12px; border: 1px solid var(--hair-2); border-radius: 9px; background: var(--surface); font-weight: 600; font-size: var(--fs-meta); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat }
.seg { display: inline-flex; border: 1px solid var(--hair-2); border-radius: 9px; overflow: hidden }
.seg button { border: 0; background: var(--surface); padding: 7px 12px; font-weight: 600; font-size: var(--fs-meta); cursor: pointer; color: var(--muted) }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand) }

/* ---------- layout ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 22px 24px 60px }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px }
.page-head h1 { font-size: var(--fs-display) }
.page-head .sub { color: var(--muted) }
.page-head .sub-note { color: var(--faint); font-size: var(--fs-small); margin-top: 3px }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--hair); color: var(--muted) }
.chip .dot { width: 8px; height: 8px; border-radius: 50% }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow) }
.section { margin-top: 22px }
.section > .sec-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px 2px }
.section > .sec-head h2 { font-size: var(--fs-section) }
.section > .sec-head span { color: var(--muted); font-size: var(--fs-meta) }
.pad { padding: 16px 18px }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px }  /* 14px everywhere, so column edges line up */
.kpi { padding: 14px 16px 13px; position: relative; display: flex; flex-direction: column }  /* same anatomy in all 8 tiles */
.kpi .lab { font-size: var(--fs-label); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em }
.kpi .val { font-family: "Sora"; font-size: var(--fs-display); font-weight: 600; margin: 4px 0 2px; letter-spacing: -.02em }
.kpi .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted) }

/* ---------- deltas & status ---------- */
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: var(--fs-small); border-radius: 6px; padding: 1px 6px; white-space: nowrap }
.delta.up { color: var(--pos); background: var(--pos-bg) }
.delta.down { color: var(--neg); background: var(--neg-bg) }
.delta.flat, .delta.none { color: var(--muted); background: var(--surface-2) }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-small); font-weight: 600; color: var(--muted) }
.status i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: var(--fs-label); color: #fff }
.status.good i { background: var(--status-good) }
.status.bad i { background: var(--status-critical) }
.na { color: var(--faint); font-style: italic; font-weight: 500 }
[data-tip] { cursor: help }
.v[data-tip]:hover, td[data-tip]:hover { text-decoration: underline dotted var(--faint); text-underline-offset: 3px }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--hair); white-space: nowrap }
th:first-child, td:first-child { text-align: left }
thead th { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; border-bottom: 1px solid var(--hair-2) }
tbody tr:last-child td { border-bottom: 0 }
td.lead { font-weight: 600 }
td.sub { padding-left: 26px; color: var(--muted) }
tr.group td { background: var(--surface-2); font-weight: 700; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .04em; color: var(--muted) }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block }
.rank { font-family: "Inter", system-ui, sans-serif; letter-spacing: normal; font-size: var(--fs-label); font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px }

/* ---------- sales section ---------- */
.term { font-size: var(--fs-label); font-weight: 700; letter-spacing: .03em; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); border-radius: 4px; padding: 1px 5px; margin-left: 4px }
/* section colours: Sales / Fixed Operations / Bottom Line (identity only — green/red stay for good/bad) */
:root { --acc-sales: #2a78d6; --acc-fixed: #0f8b8d; --acc-bottom: #6a4fc4 }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --acc-sales: #3987e5; --acc-fixed: #27a7a9; --acc-bottom: #9085e9 } }
:root[data-theme="dark"] { --acc-sales: #3987e5; --acc-fixed: #27a7a9; --acc-bottom: #9085e9 }
.acc-sales { --acc: var(--acc-sales) } .acc-fixed { --acc: var(--acc-fixed) } .acc-bottom { --acc: var(--acc-bottom) }
.acc .card { border-top: 3px solid var(--acc) }
.acc > .sec-head h2 { display: inline-flex; align-items: center; gap: 9px }
.acc > .sec-head h2::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--acc) }
.acc .meter-fill { background: var(--acc) }
.p-sec-sales thead th { border-bottom-color: #2a78d6 } .p-sec-sales thead th.lab { color: #1c5cab }
.p-sec-fixed thead th { border-bottom-color: #0f8b8d } .p-sec-fixed thead th.lab { color: #0b6f71 }
.p-sec-bottom thead th { border-bottom-color: #6a4fc4 } .p-sec-bottom thead th.lab { color: #53399e }

/* sales: total strip + New | Used cards */
.tv-strip { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 12px 18px; margin-bottom: 14px }
.tv-strip .tv-title { font: 700 var(--fs-card) "Sora", "Inter", sans-serif; margin-right: 4px }
.tv-strip .tv-item { display: flex; align-items: center; gap: 6px; color: var(--muted) }
.tv-strip .big { font: 600 var(--fs-figure) "Sora", "Inter", sans-serif; color: var(--ink) }
.dept-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.dept-cards + .dept-cards { margin-top: 14px }  /* New | Used, then Inventory aging | Front end: same columns */
.dept-card h3 { font-size: var(--fs-card) }
.dc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px }
.dc-table { margin-top: 4px }
.dc-table td, .dc-table th { padding: 8px 8px; vertical-align: top }
.dc-table .cv { font-weight: 600; margin-bottom: 3px }
.dc-table tr.dc-total td { border-top: 1.5px solid var(--hair-2); background: var(--surface-2) }
.dc-table tr.dc-total .cv { font-weight: 700 }
.dc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--hair); font-size: var(--fs-meta); color: var(--muted) }
.dc-foot b { color: var(--ink); font-weight: 600 }
@media (max-width: 1100px) { .dept-cards { grid-template-columns: 1fr } }
tr.subtot td { background: var(--surface-2); font-weight: 600 }
tr.grandtot td { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); font-weight: 700; border-top: 2px solid var(--hair-2) }
.p-table tr.sub td { background: #f1f4f7; font-weight: 600 }

/* expense rows + meters */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hair) }
.row:last-child { border-bottom: 0 }
.row .k { color: var(--muted) }
.row .k.strong { color: var(--ink); font-weight: 600 }
.row .r { display: flex; align-items: center; gap: 10px }
.row .v { font-weight: 600 }
.meter { margin: 10px 0 4px }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px }
.meter-top .k { font-weight: 600 }
.meter-top .big { font-family: "Sora"; font-size: var(--fs-figure); font-weight: 600 }
.meter-top .r { display: flex; align-items: baseline; gap: 8px }
.meter-row { display: flex; align-items: center; gap: 10px }
.meter-row .meter-track { flex: 1 }
.meter-row .status { font-size: var(--fs-small); flex: none }
.meter-track { position: relative; height: 10px; background: var(--track); border-radius: 99px }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-2); border-radius: 99px }
.meter-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink) }

/* departments */
.depts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px }
.dept h3 { font-size: var(--fs-card); display: flex; justify-content: space-between; align-items: center }
.dept .gp { font-family: "Sora"; font-size: var(--fs-figure); font-weight: 600; margin: 2px 0 0 }
.empty-note { font-size: var(--fs-small); color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 8px 0 }

/* expense breakouts: a row that opens on click (Front end + Fixed Ops cards) */
.acc-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; margin: 4px 0 0;
  background: none; border: 0; border-bottom: 1px solid var(--hair); color: var(--muted); font-size: var(--fs-meta); cursor: pointer; text-align: left }
.acc-toggle:hover, .acc-toggle[aria-expanded="true"] { color: var(--ink) }
.acc-toggle .chev { font-size: var(--fs-meta); font-weight: 600; color: var(--brand); white-space: nowrap }
.acc-toggle:hover .chev { text-decoration: underline }
.acc-toggle:focus:not(:focus-visible) { outline: none }
.acc-body .row .k { padding-left: 12px }
.acc-note { margin: 8px 0 2px }

/* bottom line cards */
.split-bar { display: flex; gap: 2px; height: 10px; margin: 4px 0 0 }  /* same height as the meters */
.split-bar .sb-seg { display: flex; align-items: center; justify-content: center; font-size: var(--fs-small); font-weight: 600; white-space: nowrap; overflow: hidden; border-radius: 4px }
.sb-rent { background: color-mix(in srgb, var(--acc) 22%, var(--surface)); color: var(--ink) }
.sb-np { background: var(--acc); color: #fff }
.meter-legend i.sq { width: 10px; height: 10px; border: 0; border-radius: 2px; vertical-align: 0 }
.bl-rows { margin-top: 10px }
.meter-mark { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -4px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--tot); border-radius: 1px }  /* Group = diamond; targets / references = solid tick */
.meter-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); margin-top: 8px }
.meter-legend i { display: inline-block; width: 0; height: 11px; border-left: 2px solid var(--ink); margin-right: 6px; vertical-align: -1px }
.meter-legend i.grp { width: 8px; height: 8px; border: 2px solid var(--tot); border-radius: 1px; transform: rotate(45deg); margin: 0 7px 0 2px; vertical-align: 0 }

/* memos */
.memos td.src { color: var(--faint); font-size: var(--fs-small); text-align: left; white-space: normal; max-width: 340px }

/* ---------- charts ---------- */
:root { --bar: #2a78d6; --bar-sel: #104281; --cmp: #8a96a3; --up: #1f8a52; --dn: #d03b3b; --tot: #0b3d6e;
  --age0: var(--status-good); --age1: var(--status-warning); --age2: var(--status-serious); --age3: var(--status-critical);
  --dot: #a3aeb9 }  /* aged inventory: the fixed status scale (good > warning > serious > critical), same in light and dark */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bar: #3987e5; --bar-sel: #9cc4ec; --cmp: #8793a0; --up: #3fb477; --dn: #e66767; --tot: #7fb2e5;
  --dot: #5d6874 } }
:root[data-theme="dark"] { --bar: #3987e5; --bar-sel: #9cc4ec; --cmp: #8793a0; --up: #3fb477; --dn: #e66767; --tot: #7fb2e5;
  --dot: #5d6874 }
.chart-card h3 { font-size: var(--fs-card) }
.chart-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px }
.chart-head h3 { margin-right: auto }
.chart-card .note { font-size: var(--fs-small); color: var(--muted); margin-top: 6px }
.chart { display: block; overflow: visible }
.chart text { font: var(--fs-small) "Inter", system-ui, sans-serif; fill: var(--muted) }
.chart .ax-strong { fill: var(--ink); font-weight: 600 }
.chart .ax-sel { fill: var(--ink); font-weight: 700 }
.chart .grid { stroke: var(--grid); stroke-width: 1 }
.chart .base { stroke: var(--hair-2); stroke-width: 1 }
.chart .bar { fill: var(--bar) }
.chart .bar-sel { fill: var(--bar-sel) }
.chart .cmp-line { stroke: var(--cmp); stroke-width: 2; stroke-dasharray: 5 4 }
.chart .cmp-dot { fill: var(--surface); stroke: var(--cmp); stroke-width: 2 }
.chart .hit { fill: transparent }
.chart .hit:hover { fill: color-mix(in srgb, var(--ink) 5%, transparent) }
.chart .clickable { cursor: pointer }
.chart .wf-tot { fill: var(--tot) }
.chart .wf-up { fill: var(--up) }
.chart .wf-dn { fill: var(--dn) }
.chart rect.clickable:hover { filter: brightness(1.15) }
.chart .wf-conn { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 3 }
.chart .brk { fill: none; stroke: var(--surface); stroke-width: 3 }
.chart .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round }  /* keeps a label readable over a line */
.chart .wf-val { fill: var(--ink); font-weight: 600; font-size: var(--fs-small) }
.chart .age0, .sw.age0 { fill: var(--age0); background: var(--age0) }
.chart .age1, .sw.age1 { fill: var(--age1); background: var(--age1) }
.chart .age2, .sw.age2 { fill: var(--age2); background: var(--age2) }
.chart .age3, .sw.age3 { fill: var(--age3); background: var(--age3) }
.chart .age-lab { fill: #0d2440; font-weight: 700; font-size: var(--fs-small) }
.chart .age-lab.on-dark { fill: #fff }
.chart .age-lab.out { fill: var(--ink) }  /* value above a segment too narrow to hold it */
.aged-card { display: flex; flex-direction: column }  /* chart centred in the height the Front End card sets */
.aged-card .aged-body { margin: auto 0 }  /* legend + bars move together */
.legend2 { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); margin: 2px 0 6px }
.lg { display: inline-flex; align-items: center; gap: 6px }
.lg i { display: inline-block }
.sw-bar { width: 12px; height: 12px; border-radius: 3px; background: var(--bar) }
.sw-line { width: 18px; border-top: 2px dashed var(--cmp) }
.sw { width: 12px; height: 12px; border-radius: 3px }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 20px }  /* = sparkline height */
.spark { flex: none }
.spark .spark-line { stroke: var(--bar); stroke-width: 1.75 }
.spark .spark-dot { fill: var(--bar); cursor: help }
.seg-sm button { padding: 5px 10px; font-size: var(--fs-small) }
.seg button:disabled { opacity: .4; cursor: not-allowed }
.sel-sm { padding: 6px 28px 6px 10px; font-size: var(--fs-small) }
table.cmp th.th-sel { color: var(--brand) }

/* compare: GM scorecard (heatmap) + ranked view */
:root { --h-b1: #e3eefc; --h-b2: #bcd6f7; --h-b3: #8fbaf0; --h-w1: #fdeceb; --h-w2: #f8cfcc; --h-w3: #f1a9a4; --h-0: #f1f2f0 }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --h-b1: #16283d; --h-b2: #1b3c63; --h-b3: #22528a; --h-w1: #33201f; --h-w2: #4d2826; --h-w3: #6b302d; --h-0: #1f272f } }
:root[data-theme="dark"] { --h-b1: #16283d; --h-b2: #1b3c63; --h-b3: #22528a; --h-w1: #33201f; --h-w2: #4d2826; --h-w3: #6b302d; --h-0: #1f272f }
.h-b1 { background: var(--h-b1) } .h-b2 { background: var(--h-b2) } .h-b3 { background: var(--h-b3) }
.h-w1 { background: var(--h-w1) } .h-w2 { background: var(--h-w2) } .h-w3 { background: var(--h-w3) } .h-0 { background: var(--h-0) }
.lg .sw.h-b1, .lg .sw.h-b3, .lg .sw.h-w1, .lg .sw.h-w3, .lg .sw.h-0 { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--hair) }
.cmp-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 14px; align-items: start }  /* 5 stores: table gets the room */
table.heat td, table.heat th { padding: 7px 10px }
table.heat td.sub { white-space: normal; min-width: 205px; max-width: 230px; line-height: 1.3 }  /* one-line labels with 5 stores */
table.heat th.store-h, table.heat th.comb { white-space: normal; min-width: 92px; line-height: 1.25 }
table.heat td.tgt { padding-left: 4px; padding-right: 8px }
.rank-card { position: sticky; top: 76px }
.view-toggle { display: flex; justify-content: center; margin: -2px 0 16px }  /* Comparison: % Ratios | $ Dollars, centred and large */
.view-toggle .seg { border-radius: 11px; box-shadow: var(--shadow) }
.view-toggle .seg button { padding: 10px 28px; font-size: var(--fs-body) }
.rank-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px }  /* shortcuts: the headline lines, from compare.SHORTCUTS */
table.heat td.hc { font-weight: 600; border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface) }
table.heat tr.mrow { cursor: pointer }
table.heat tr.mrow:hover td.sub, table.heat tr.mrow:focus td.sub { color: var(--brand); text-decoration: underline }
table.heat tr.mrow.sel td.sub { box-shadow: inset 4px 0 0 var(--brand); font-weight: 700; color: var(--brand) }
table.heat tr.mrow.sel td { border-top: 1px solid var(--brand); border-bottom-color: var(--brand) }
table.heat tr.mrow:focus { outline: none }
table.heat th.store-h { cursor: pointer }
table.heat th.store-h:hover { color: var(--brand); text-decoration: underline }
table.heat th.stick, table.heat td.sub { position: sticky; left: 0; background: var(--surface); z-index: 1 }
.chart .rbar { fill: var(--dot) }
.chart .rbar.sel { fill: var(--bar) }
.chart .ref-grp { stroke: var(--tot); stroke-width: 2; stroke-dasharray: 5 3 }
.chart .ref-tgt { stroke: var(--ink); stroke-width: 2 }
.chart text.clickable:hover { fill: var(--brand); text-decoration: underline }
@media (max-width: 1100px) { .cmp-grid { grid-template-columns: 1fr } .rank-card { position: static } }

/* compare */
table.cmp td, table.cmp th { padding: 7px 12px }
table.cmp thead th { text-transform: none; letter-spacing: 0; font-size: var(--fs-meta); color: var(--ink); vertical-align: bottom }
table.cmp .thsub { font-size: var(--fs-label); color: var(--faint); font-weight: 500 }
table.cmp td.sub { padding-left: 22px; color: var(--ink) }
table.cmp td.tgt { color: var(--muted) }
table.cmp .comb { border-left: 2px solid var(--hair-2); font-weight: 600 }
.tmark { font-size: var(--fs-label); font-weight: 700 }
.tmark.ok { color: var(--pos) } .tmark.bad { color: var(--neg) }
.footnotes { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); max-width: 980px }
.footnotes p { margin: 4px 0 }
.sec-head .btn { margin-left: auto }

/* executive dashboard: the per-unit numbers, measures down the left and rooftops across (the Comparison layout) */
.xfilter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.xfl { font-size: var(--fs-small); font-weight: 600; color: var(--muted); margin-right: 2px }
table.exec th.stick, table.exec td.sub { position: sticky; left: 0; background: var(--surface); z-index: 1 }
table.exec td.sub { min-width: 190px; padding-left: 16px; white-space: normal; line-height: 1.3 }
table.exec th.xcol, table.exec th.comb { white-space: normal; min-width: 108px; max-width: 160px; line-height: 1.25; text-align: right }
table.exec th.comb, table.exec td.comb { position: sticky; right: 0; z-index: 1 }
table.exec th.comb { background: var(--surface) }
table.exec td.hc { text-align: right; vertical-align: top; font-weight: 600 }
table.exec td.xna { color: var(--faint) }
table.exec .xv { font: 600 var(--fs-card) "Sora", "Inter", sans-serif; font-variant-numeric: tabular-nums }
table.exec td.hc .delta { margin-top: 4px }
table.exec td.comb { background: color-mix(in srgb, var(--brand) 5%, var(--surface)) }
table.exec .xname { cursor: pointer }
table.exec .xname:hover { color: var(--brand); text-decoration: underline }
table.exec tr.group td { font: 700 var(--fs-section) "Sora", "Inter", sans-serif; color: var(--ink); text-transform: none; letter-spacing: -.01em;
  background: var(--surface-2); padding: 14px 16px 8px; border-top: 1px solid var(--hair-2) }  /* the four sections, called out */
table.exec tr.group .xper { font: 500 var(--fs-small) "Inter", sans-serif; color: var(--muted); letter-spacing: 0; margin-left: 10px }
.xbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-left: auto }  /* Filters + what's applied + Reset */
.xfwrap { position: relative }
.xfbtn { display: inline-flex; align-items: center; gap: 6px }
.xfi path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none }
.xpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(460px, 92vw); background: var(--surface); border: 1px solid var(--hair-2);
  border-radius: 12px; box-shadow: 0 14px 36px rgba(15,30,45,.18); padding: 12px 16px 16px; display: grid; gap: 12px }
.xpop-h { display: flex; align-items: center; justify-content: space-between }
.xpop-h b { font: 700 var(--fs-card) "Sora", "Inter", sans-serif; color: var(--ink) }
.xpop-x { border: 0; background: none; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px }
.xpop .xfl { min-width: 66px }
.fbtn.xnone { opacity: .55 }  /* no statements yet */
table.exec tr.xrow { cursor: pointer }
table.exec tr.xrow:hover td.sub, table.exec tr.xrow:focus td.sub { color: var(--brand); text-decoration: underline }
table.exec tr.xrow:focus { outline: none }
table.exec tr.xrow.sel td.sub { box-shadow: inset 4px 0 0 var(--brand); font-weight: 700; color: var(--brand) }
table.exec tr.xtot td { border-top: 1px solid var(--hair-2) }
table.exec tr.xtot td.sub, table.exec tr.xtot .xv { font-weight: 700 }
table.xvol td:not(.sub) { text-align: right; font-variant-numeric: tabular-nums }
.xoffl { margin: 10px 4px 0; font-size: var(--fs-small); color: var(--muted) }
.xoffl summary { cursor: pointer; font-weight: 600 }
.xoffl p { margin: 6px 0 0; line-height: 1.6 }
.xempty { color: var(--muted) }
/* executive dashboard: scorecards (one per dealership + Group) and the chart against the Group */
/* executive dashboard: the landing — one tile per department, its charts on click */
.xtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.xtile { background: var(--surface); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px 10px; display: flex; flex-direction: column }
.xtile { cursor: pointer; position: relative; outline: none }
.xtile:hover { border-color: var(--hair-2) }
.xtile:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent), var(--shadow) }
.xtile.sel { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow) }
.xtile.sel::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; margin-left: -7px; background: var(--surface);
  border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg) }  /* points at its detail below */
.xt-h b { display: block; font: 700 var(--fs-section) "Sora", "Inter", sans-serif; color: var(--ink) }
.xt-h span { font-size: var(--fs-small); color: var(--muted) }
.xtile:hover .xt-h b, .xtile.sel .xt-h b { color: var(--brand) }
.xt-k { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--hair) }
.xt-gl { font-size: var(--fs-small); font-weight: 600; color: var(--muted) }
.xbig { font: 700 var(--fs-figure) "Sora", "Inter", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums }
.xt-rs { display: grid; gap: 10px; flex: 1; align-content: start }
.xt-l { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.xt-n { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-small); color: var(--ink); white-space: nowrap }
.xt-n .xname { cursor: pointer; overflow: hidden; text-overflow: ellipsis }
.xt-n .xname:hover { color: var(--brand); text-decoration: underline }
.xt-v { font: 700 var(--fs-body) "Sora", "Inter", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums }
.xt-vw { display: inline-flex; align-items: center; gap: 3px }
.xt-ar { width: 12px; display: inline-flex; justify-content: center }  /* keeps the figures aligned when a row has no arrow */
.delta.xar { background: none; padding: 0; font-size: var(--fs-label); line-height: 1 }
.xt-t { position: relative; height: 8px; margin-top: 4px; background: var(--surface-2); border-radius: 4px }
.xt-b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0 }
.xt-g { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px dashed var(--ink); margin-left: -1px; opacity: .6 }
.xt-more { margin-top: 12px; font-size: var(--fs-small); font-weight: 600; color: var(--muted) }
.xtile:hover .xt-more, .xtile.sel .xt-more { color: var(--brand) }
.xdot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--surface) }
.xbest { color: var(--brand); font-size: var(--fs-body); margin-right: 1px }
.xnums { display: flex; justify-content: center; margin-top: 18px }
@media (max-width: 1100px) { .xtiles { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 640px) { .xtiles { grid-template-columns: minmax(0, 1fr) } }
/* executive dashboard: how the dealerships compare — a bar chart per section (stacked where the parts add up) */
.xb-sec + .xb-sec { border-top: 1px solid var(--hair-2); margin-top: 6px; padding-top: 4px }
.xb-st { font: 700 var(--fs-section) "Sora", "Inter", sans-serif; color: var(--ink); padding: 10px 0 2px }
.xb-st span { font: 500 var(--fs-small) "Inter", sans-serif; color: var(--muted); margin-left: 10px }
.xb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 36px }
.xb-grid.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) }
.xb-grid.g11 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
.xb-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 4px }
.xb-ti { font-size: var(--fs-body); font-weight: 700; color: var(--ink); cursor: pointer; outline: none }
.xb-ti:hover, .xb-ti:focus { color: var(--brand); text-decoration: underline }
.xb-leg { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--muted) }
.xb-sw { width: 12px; height: 10px; border-radius: 2px; background: var(--muted); display: inline-block }
.xb-sw2 { background: color-mix(in srgb, var(--muted) 35%, var(--surface)); margin-left: 8px }
.xb-body { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: 14px }
.xb-n, .xb-t, .xb-v { height: 32px; display: flex; align-items: center }
.xb-n { gap: 8px; font-size: var(--fs-small); color: var(--ink); white-space: nowrap }
.xb-v { justify-content: flex-end; gap: 4px; font: 700 var(--fs-body) "Sora", "Inter", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums }
.xb-tr { position: relative }
.xb-t { gap: 2px }
.xb-s { display: flex; align-items: center; height: 22px; padding-left: 7px; box-sizing: border-box; overflow: hidden; white-space: nowrap;
  background: var(--h); font: normal 700 var(--fs-label) "Inter", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums }
.xb-s:last-child { border-radius: 0 4px 4px 0 }
.xb-s2 { background: color-mix(in srgb, var(--h) 40%, var(--surface)) }
.xb-s { position: relative; z-index: 1 }  /* the Group line runs behind the bars, so it never crosses a figure */
.xb-g { position: absolute; top: 0; bottom: 18px; width: 0; border-left: 2px dashed var(--ink); margin-left: -1px; opacity: .7 }
.xb-sp { height: 18px; position: relative }
.xb-note { font-size: var(--fs-small); color: var(--muted); margin-top: 4px }  /* a line under a chart that needs one */
.xb-gl { position: absolute; top: 2px; transform: translateX(-50%); font-size: var(--fs-label); font-weight: 600; color: var(--muted); white-space: nowrap }
@media (max-width: 1000px) { .xb-grid.g21, .xb-grid.g11 { grid-template-columns: minmax(0, 1fr) } }
.fbtn.xreset { border-style: dashed }
.xdetail { scroll-margin-top: 84px }  /* "Show me" in Ask AI Controller scrolls here, clear of the top bar */

/* ---------- Ask AI Controller: a chat that answers from the figures on screen, opened from the header ---------- */
  /* room for the button below the last card */
.ask-top:focus-visible, .hero-chip:focus-visible, .ask-chip:focus-visible, .ask-go:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px }
.xhead-ti { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap }  /* the page title with Ask AI Controller beside it */
@keyframes ask-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent) } 100% { box-shadow: 0 0 0 14px transparent } }
.ask-ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none }
  /* points at the button on its left */
  /* points up at the button */
.ask { position: fixed; right: 24px; top: 84px; bottom: 24px; z-index: 46; width: min(410px, calc(100vw - 32px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--hair-2); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 56px rgba(15,30,45,.22), var(--shadow);
  animation: ask-in .22s ease-out both }
.ask-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px 13px 16px; background: var(--brand); color: var(--on-brand) }
.ask-ti { display: flex; align-items: center; gap: 8px; min-width: 0 }
.ask-ti b { font: 700 var(--fs-card) "Sora", "Inter", sans-serif; white-space: nowrap }
.ask-tag { font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: color-mix(in srgb, var(--on-brand) 20%, transparent); border-radius: 99px; padding: 2px 8px }
.ask-x { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; padding: 6px; cursor: pointer; opacity: .85 }
.ask-x:hover { opacity: 1 }
.ask-ctx { padding: 8px 16px; font-size: var(--fs-small); color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--hair) }
.ask-ctx b { color: var(--ink); font-weight: 600 }
.ask-log { position: relative; flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px }
.ask-m { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: var(--fs-body); line-height: 1.5; animation: ask-in .25s ease-out both }
.ask-m p { margin: 0 } .ask-m p + p { margin-top: 6px }
.ask-m.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--hair); border-bottom-left-radius: 4px; color: var(--ink) }
.ask-m.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px }
.ask-m .delta { font-size: var(--fs-label); padding: 1px 6px; vertical-align: 1px }
.ask-up { color: var(--pos); font-weight: 600 } .ask-dn { color: var(--neg); font-weight: 600 } .ask-flat { color: var(--muted); font-weight: 600 }
.ask-typing { display: inline-flex; gap: 4px; padding: 3px 0 }
.ask-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: ask-dot 1.1s infinite ease-in-out }
.ask-typing i:nth-child(2) { animation-delay: .15s } .ask-typing i:nth-child(3) { animation-delay: .3s }
.ask-mini { display: grid; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair) }
.ask-mr { display: grid; grid-template-columns: max-content minmax(32px, 1fr) max-content; align-items: center; gap: 8px; font-size: var(--fs-small) }
.ask-mn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink) }
.ask-mt { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden }
.ask-mt i { display: block; height: 100%; border-radius: 0 4px 4px 0 }
.ask-mval { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap }
.ask-mr.ask-mg .ask-mn, .ask-mr.ask-mg .ask-mval { color: var(--muted) }
.ask-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px }
.ask-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: var(--fs-small) }
.ask-list li span { color: var(--muted) } .ask-list li em { grid-column: 1 / -1; font-style: normal; color: var(--muted) }
.ask-list li b { font-size: var(--fs-body); text-align: right; font-variant-numeric: tabular-nums }
.ask-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; border: 0; background: none; padding: 0; color: var(--brand); font-weight: 700; font-size: var(--fs-meta); cursor: pointer }
.ask-go:hover { text-decoration: underline }
.ask-sug { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 10px }
.ask-chip { border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--hair-2)); background: var(--surface); color: var(--brand); border-radius: 99px; padding: 6px 12px;
  font-size: var(--fs-small); font-weight: 600; cursor: pointer; text-align: left; line-height: 1.3 }
.ask-chip:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)) }
.ask-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hair); background: var(--surface) }
.ask-in input { flex: 1; min-width: 0; border: 1px solid var(--hair-2); border-radius: 99px; padding: 9px 14px; font: inherit; font-size: var(--fs-body); background: var(--surface); color: var(--ink) }
.ask-in input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent) }
.ask-in button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--brand); color: var(--on-brand); cursor: pointer; display: grid; place-items: center }
.ask-in button svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round }
.ask-in button:disabled { opacity: .45; cursor: default }
.ask-hl { animation: ask-hl 1.9s ease-out 1 }
@keyframes ask-in { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes ask-dot { 0%, 60%, 100% { opacity: .35; transform: none } 30% { opacity: 1; transform: translateY(-3px) } }
@keyframes ask-hl { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent), var(--shadow) } 100% { box-shadow: 0 0 0 16px transparent, var(--shadow) } }
@media (max-width: 640px) {
  .ask { inset: 0; width: auto; border-radius: 0; border: 0 }
}
@media (prefers-reduced-motion: reduce) { .ask, .ask-m, .ask-hl, .ask-typing i { animation: none } }

/* data notes */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px }
.stat-strip .card { padding: 14px 16px }
.stat-strip .val { font-family: "Sora"; font-size: var(--fs-display); font-weight: 600 }
.stat-strip .lab { color: var(--muted); font-size: var(--fs-small) }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px }
.fbtn { border: 1px solid var(--hair-2); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: var(--fs-small); font-weight: 600; color: var(--muted); cursor: pointer }
.fbtn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink) }
.btn { border: 1px solid var(--hair-2); background: var(--surface); border-radius: 9px; padding: 7px 12px; font-size: var(--fs-meta); font-weight: 600; cursor: pointer }
.btn:hover { background: var(--surface-2) }
.notes-table td { white-space: normal; text-align: left; vertical-align: top }
.notes-table td.num { width: 34px; color: var(--faint); font-weight: 700 }
.notes-table .t { font-weight: 700 }
.notes-table .d { color: var(--muted); margin-top: 3px; max-width: 640px }
.notes-table .meta { font-size: var(--fs-small); color: var(--muted) }
.notes-table .meta b { color: var(--ink); font-weight: 600 }
.cat { display: inline-block; font-size: var(--fs-label); font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap }
.cat.c-def { background: var(--warn-bg); color: var(--warn) }
.cat.c-map { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand) }
.cat.c-pend { background: var(--surface-2); color: var(--muted) }
.cat.c-src { background: var(--neg-bg); color: var(--neg) }
.cat.c-not { background: var(--surface-2); color: var(--muted) }
.pill-ok { color: var(--pos); font-weight: 700 }
.pill-diff { color: var(--neg); font-weight: 700 }
.fx td.note { white-space: normal; text-align: left; color: var(--muted); font-size: var(--fs-small); min-width: 280px }
pre.cfg { background: var(--surface-2); border: 1px solid var(--hair); border-radius: 10px; padding: 14px; overflow: auto; font-size: var(--fs-small); line-height: 1.45; margin: 0 }
.scroll-x { overflow-x: auto }

.placeholder { padding: 48px 28px; text-align: center; color: var(--muted) }
.placeholder h2 { color: var(--ink); margin-bottom: 8px }

footer { max-width: 1320px; margin: 0 auto; padding: 0 24px 30px; color: var(--faint); font-size: var(--fs-small) }

/* tooltip */
#tip { position: fixed; z-index: 80; max-width: 360px; pointer-events: none; background: var(--ink); color: var(--surface); font-size: var(--fs-small); line-height: 1.4; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transition: opacity .08s }
#tip.on { opacity: 1 }
#tip b { display: block; margin-bottom: 2px }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr) }
  .depts { grid-template-columns: 1fr }
  .stat-strip { grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 640px) {
  .topbar-inner, main { padding-left: 16px; padding-right: 16px }
  .kpi .val { font-size: var(--fs-figure) }  /* phones: tile values step down one level of the scale */
}

/* ================================================================ PRINT
   Each tab has its own paper layout (rendered into #print by app.js, always kept current so
   Cmd/Ctrl+P prints the same thing as the Print preview button). Paper uses fixed ink colours —
   it never inherits the dark theme. Page size is set per tab by app.js (@page in #page-size). */
.btn-print { white-space: nowrap }
#preview { position: fixed; inset: 0; z-index: 70; background: #3b4148; overflow: auto }
.pv-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: #22272d; color: #fff; font-size: var(--fs-meta) }
.pv-bar #pv-info { color: #b8c0c8 }
.pv-bar .btn-primary { width: auto; padding: 8px 18px; background: #fff; color: #003562 }
.pv-bar .btn { background: transparent; color: #fff; border-color: #6b747d }
#print { padding: 24px 0 40px }

.paper { background: #fff; color: #111; margin: 0 auto 24px; box-shadow: 0 6px 30px rgba(0,0,0,.35); overflow: hidden;
  font: 9.5pt/1.3 "Inter", "Helvetica Neue", Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  display: flex; flex-direction: column }
.paper.legal { width: 14in; height: 8.5in; padding: 0.35in }
.paper.letter { width: 11in; min-height: 8.5in; padding: 0.4in }
.paper.flow { height: auto; overflow: visible }
.paper * { color: inherit }
.p-head { display: flex; align-items: center; gap: 16px; border-bottom: 2.5pt solid #003562; padding-bottom: 7px; margin-bottom: 9px }
.p-group { font: 700 9pt/1.1 "Sora", "Inter", Arial, sans-serif; letter-spacing: .02em; color: #fff; background: #003562; border-radius: 4pt; padding: 4pt 7pt; text-transform: uppercase }
.p-title { flex: 1 }
.p-title .t1 { font: 700 14pt/1.15 "Sora", "Inter", Arial, sans-serif; color: #003562; letter-spacing: -.01em }
.p-title .t2 { font-size: 9.5pt; color: #444 }
.p-brand { text-align: right; font-size: 8.5pt; color: #555; line-height: 1.25 }
.p-brand b { color: #111; font-size: 9.5pt }
.p-by { display: inline-flex; align-items: center; gap: 3px }
.p-cxp { height: 8pt; width: auto }
.p-foot { margin-top: auto; padding-top: 6px; border-top: 0.75pt solid #999; display: flex; justify-content: space-between; gap: 20px; font-size: 7.5pt; color: #555 }
.p-notes { font-size: 8pt; color: #333; margin-top: 7px; line-height: 1.35 }
.p-lede { margin: 0 0 8px; font-size: 9.5pt }
.p-h3 { font: 700 11pt "Sora", "Inter", Arial, sans-serif; color: #003562; margin: 14px 0 6px }

.p-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums }
.p-table th, .p-table td { padding: 2.2pt 5pt; text-align: right; border-bottom: 0.5pt solid #d4d4d4; white-space: nowrap }
.p-table th { font-size: 8pt; font-weight: 700; color: #333; border-bottom: 1pt solid #111; vertical-align: bottom; text-transform: none; letter-spacing: 0 }
.p-table th.lab, .p-table td.lab { text-align: left }
.p-table thead th.lab { font: 700 9.5pt "Sora", "Inter", Arial, sans-serif; color: #003562 }
.p-table td.cur { font-weight: 700 }
.p-table td.var { color: #333 }
.p-table tr.strong td { font-weight: 700; border-top: 0.75pt solid #111 }
.p-table tr.pg td { background: #e9eef4; font-weight: 700; font-size: 8.5pt; color: #003562; text-align: left; padding-top: 3pt }
.p-table .th2 { font-weight: 500; color: #666; font-size: 7.5pt }
.p-table td.oth, .p-table th.oth { color: #555; font-weight: 500 }
.p-table td.ind { padding-left: 14pt }

/* compare (one legal page) */
.p-cmp { font-size: 10pt; table-layout: fixed }
.p-cmp td, .p-cmp th { padding: 3.6pt 4pt }
.p-cmp th { font-size: 8.5pt }
.p-cmp col.c-lab { width: 27% } .p-cmp col.c-tgt { width: 7% }  /* store columns: set in printCompare for any count */
.p-cmp.p-dense { font-size: 8.5pt } .p-cmp.p-dense th { font-size: 7.5pt }  /* 4+ stores */
.p-cmp.p-dense td, .p-cmp.p-dense th { padding: 2.6pt 3pt } .p-cmp.p-dense td.lab { padding-left: 8pt }
.p-cmp.p-xdense { font-size: 8pt } .p-cmp.p-xdense th { font-size: 7pt } .p-cmp.p-xdense td, .p-cmp.p-xdense th { padding: 2.4pt 2pt }
.p-cmp.p-xdense col.c-lab { width: 24% }  /* 6+ stores */
.p-cmp td.lab { padding-left: 12pt; white-space: normal }
.p-cmp td.tgt { color: #555 }
.p-cmp td.lead { background: #e3efe7; font-weight: 700 }
.p-cmp .comb { border-left: 1.25pt solid #111; font-weight: 700 }

/* executive dashboard (one legal page): measures down the left, rooftops across. Type steps down as columns
   are added: lg up to 5 value columns (the table beside Volumes & Totals), md up to 9 and sm beyond (stacked,
   the change beside each figure) — tools/print_check.py proves it fits. */
.p-xbot { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0.3in; align-items: start }  /* stacked: totals beside the notes */
.p-xgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0.3in; align-items: start }
.p-xvol th { white-space: normal; line-height: 1.2 }
.p-exec { margin-bottom: 10px }
.p-exec td, .p-exec th { vertical-align: top }
.p-exec th { white-space: normal; line-height: 1.2 }
.p-exec td.lab { white-space: normal }
.p-exec .comb, .p-xvol .comb { border-left: 1.25pt solid #111 }
.p-exec tr.xtot td { border-top: 0.75pt solid #111 }
.p-exec tr.xtot td.lab { font-weight: 700 }
.p-exec .xpv { font-weight: 500; color: #444 }
.p-table .xper { font-weight: 500; color: #3b4a5a }
.p-exec tr.pg td { font-family: "Sora", "Inter", Arial, sans-serif }
.p-exec tr.pg .xper { font-family: "Inter", Arial, sans-serif; font-size: .8em }
.p-x-lg .p-exec { font-size: 12.5pt; line-height: 1.15 } .p-x-lg .p-exec td, .p-x-lg .p-exec th { padding: 2.5pt 9pt } .p-x-lg .p-exec th { font-size: 10pt }
.p-x-lg .p-exec .xpv { font-size: 8.5pt } .p-x-lg .p-exec tr.pg td { font-size: 13pt; padding: 3pt 9pt }
.p-x-md .p-exec tr.pg td { font-size: 10.5pt; padding: 2pt 6pt } .p-x-sm .p-exec tr.pg td { font-size: 10pt }
.p-x-lg .p-sm { font-size: 10pt } .p-x-lg .p-sm td, .p-x-lg .p-sm th { padding: 3pt 4pt }
.p-x-md .p-exec { font-size: 10.5pt } .p-x-md .p-exec td, .p-x-md .p-exec th { padding: 2pt 6pt } .p-x-md .p-exec th { font-size: 9pt }
.p-x-md .p-exec .xpv { display: inline; margin-left: 4pt; font-size: 8.5pt } .p-x-md .p-sm { font-size: 9.5pt }
.p-x-sm .p-exec { font-size: 9.5pt } .p-x-sm .p-exec td, .p-x-sm .p-exec th { padding: 2pt 4pt } .p-x-sm .p-exec th { font-size: 8pt }
.p-x-sm .p-exec .xpv { display: inline; margin-left: 3pt; font-size: 7.5pt } .p-x-sm .p-sm { font-size: 8.5pt }

/* deep dive (legal, 2 pages) */
.p-kpis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 10px }
.p-kpi { border: 0.75pt solid #b8c2cc; border-radius: 4pt; padding: 4pt 6pt }
.p-kpi .l { font-size: 7pt; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: 0; white-space: nowrap }
.p-kpi .v { font: 700 13pt/1.2 "Sora", "Inter", Arial, sans-serif }
.p-kpi .s { font-size: 7.5pt; color: #555 }
.p-kpi .vn { font: 500 7pt "Inter", Arial, sans-serif; color: #555; white-space: nowrap }  /* "/retail sold (net)" stays on one line */
.p-term { font-size: 6.5pt; font-weight: 700; color: #1c5cab }
.p-deep1 .p-table { font-size: 9.5pt }
.p-band2 { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 16px; margin-bottom: 10px; align-items: start }
.p-fixed { margin-bottom: 10px }  /* Service | Parts | Bodyshop in one table */
.p-fixed th.grp { text-align: center; font: 700 9.5pt "Sora", "Inter", Arial, sans-serif; color: #0b6f71; border-bottom: 0.5pt solid #0f8b8d }
.p-fixed .g0 { border-left: 0.75pt solid #b9c3cc; padding-left: 7pt }
.p-bl th { text-align: right; line-height: 1.2 }
.p-bl td, .p-bl th { width: 12% }
.p-bl td.lab, .p-bl th.lab { width: 10% }
.p-sm td.lab { white-space: normal }
.p-cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start }
.p-band2 { min-width: 0 }
.p-deep1 { font-size: 10pt }
.p-deep1 .p-table td, .p-deep1 .p-table th { padding: 1.9pt 5pt }
.p-deep1 .p-kpis { margin-bottom: 8px }
.p-deep1 .p-kpi .v { font-size: 14pt }
.p-memo td, .p-memo th { padding: 2pt 6pt }

.p-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 8px }
.p-ch { font: 700 8.5pt "Sora", "Inter", Arial, sans-serif; color: #003562; margin-bottom: 2px }
.paper .chart text { font-size: 10px; fill: #333 }
.paper .chart .wf-val { font-size: 9.5px; fill: #111 }
.paper .legend2 { font-size: 8pt; color: #333; margin: 0 0 2px; gap: 12px }
.paper .legend2 .sw-bar { background: #0b3d6e }
.paper .legend2 .sw-line { border-color: #7a8591 }
.p-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start }
.p-deep2 .p-memo { font-size: 8pt; table-layout: fixed }
.p-deep2 .p-memo td, .p-deep2 .p-memo th { padding: 1.5pt 3pt }
.p-deep2 .p-memo td.lab { white-space: normal }
.p-deep2 .p-memo td.ind { padding-left: 8pt }
.p-memo col.m-lab { width: 32% } .p-memo col.m-v { width: 17.5% } .p-memo col.m-dv { width: 18.5% } .p-memo col.m-pv { width: 14.5% }  /* fits ($1,048,779) and −1385.7% */
.paper .chart.bridge text.ax { font-size: 9px }

/* data notes (letter, flowing) */
.p-notes-t { font-size: 8pt }
.p-notes-t td { vertical-align: top; white-space: normal }
.p-notes-t td.lab { white-space: normal }
.p-notes-t col.c-item { width: 48% } .p-notes-t col.c-aff { width: 20% } .p-notes-t col.c-def { width: 22% }
.p-notes-t tr { break-inside: avoid }

/* ---------- Targets ---------- */
.tg-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 12px }
.tg-k { display: block; font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px }
.tg-big > b { display: block; font: 600 34px/1.1 "Sora", "Inter", sans-serif; letter-spacing: -.02em; color: var(--brand); margin: 2px 0 4px }
.tg-big .cap { max-width: 640px; display: block } .tg-big .cap b { color: var(--ink) }
.tg-bench { display: flex; flex-direction: column; align-items: flex-end; gap: 4px }
table.prize { width: 100%; border-collapse: collapse }
table.prize th { vertical-align: bottom; white-space: normal; min-width: 140px }
table.prize th:first-child { min-width: 170px }
.pz-h { display: block; color: var(--ink); font-size: var(--fs-meta); text-transform: none; letter-spacing: 0 }
.pz-b { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted) }
table.prize td.pz { background: color-mix(in srgb, var(--brand) var(--pz), transparent); font-weight: 600 }
table.prize td.pz-at { color: var(--muted); font-size: var(--fs-small) }
table.prize .pz-tot { border-left: 1px solid var(--hair-2); font-size: var(--fs-card) }
table.prize tr.pz-row { cursor: pointer }
table.prize tr.pz-row:hover td.pz-n, table.prize tr.pz-row:focus td.pz-n { color: var(--brand); text-decoration: underline }
table.prize tr.pz-row:focus { outline: none }
table.prize tr.pz-sum td { font-weight: 700; border-top: 1px solid var(--hair-2); background: var(--surface-2) }
.wi { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) }
.wi-in { padding: 16px 18px; border-right: 1px solid var(--hair) }
.wi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: var(--fs-card) }
.wi-btns { display: flex; gap: 6px }
.wi-g + .wi-g { margin-top: 8px }
.wi-gh { font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin: 6px 0 2px }
.wi-r { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, 1.2fr) 74px; align-items: center; gap: 12px; padding: 5px 0 }
.wi-l { display: flex; flex-direction: column; font-size: var(--fs-meta); font-weight: 600 }
.wi-l small { font-size: var(--fs-small); font-weight: 500; color: var(--muted) }
.wi-r input[type=range] { width: 100%; accent-color: var(--brand); cursor: pointer }
.wi-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--fs-meta) }
.wi-out { padding: 18px 20px; background: var(--surface-2); border-radius: 0 14px 14px 0 }
.wi-k { font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
.wi-np { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; font-variant-numeric: tabular-nums }
.wi-np b { font: 600 30px/1.1 "Sora", "Inter", sans-serif; letter-spacing: -.02em }
.wi-from { color: var(--muted); font-size: var(--fs-figure) }
.wi-arrow { color: var(--faint) }
.wi-bars { margin-top: 16px; display: grid; gap: 8px }
.wi-br { display: grid; grid-template-columns: 130px minmax(0, 1fr) 80px; align-items: center; gap: 10px; font-size: var(--fs-meta) }
.wi-br b { text-align: right; font-variant-numeric: tabular-nums }
.wi-bt { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden }
.wi-bt i { display: block; height: 100%; border-radius: 5px }
.wi-bt i.pos { background: var(--pos) } .wi-bt i.neg { background: var(--neg) }
@media (max-width: 1000px) { .wi { grid-template-columns: minmax(0, 1fr) } .wi-in { border-right: 0; border-bottom: 1px solid var(--hair) } .wi-out { border-radius: 0 0 14px 14px } }
@media (max-width: 640px) { .wi-r { grid-template-columns: minmax(0, 1fr) 64px } .wi-r input { grid-column: 1 / -1; grid-row: 2 } }
.bud-sum { display: flex; gap: 36px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px }
.bud-big { display: block; font: 600 var(--fs-display)/1.15 "Sora", "Inter", sans-serif; letter-spacing: -.02em; margin: 2px 0 }
.bud-leg { margin-left: auto; display: flex; gap: 14px; font-size: var(--fs-small); color: var(--muted) }
.bud-leg span { display: inline-flex; align-items: center; gap: 6px }
.bud-sw { width: 10px; height: 10px; border-radius: 2px; background: var(--muted); display: inline-block }
.bud-tw { width: 14px; height: 0; border-top: 2px solid var(--ink); display: inline-block }
.bud-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }
.bud-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px }
.bud-h { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.bud-n { font-weight: 700; font-size: var(--fs-card) }
.bud-k b { font: 600 var(--fs-figure) "Sora", "Inter", sans-serif }
.bud-svg { display: block; margin: 4px 0 }
.bud-svg .bud-base { stroke: var(--hair-2) } .bud-svg .bud-tick { stroke: var(--ink); stroke-width: 2 }
.bud-svg .bud-short { opacity: .55 }
.bud-lw { width: 10px; height: 10px; border-radius: 2px; background: var(--muted); opacity: .45; display: inline-block }
.bud-svg .bud-ax { fill: var(--faint); font-size: 10px }
.bud-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: var(--fs-meta) }
.bstat { font-size: var(--fs-label); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 99px; padding: 2px 8px; white-space: nowrap }
.bstat.good { color: var(--pos); background: var(--pos-bg) } .bstat.bad { color: var(--neg); background: var(--neg-bg) } .bstat.track { color: var(--warn); background: var(--warn-bg) }
.btrend { font-size: var(--fs-small); font-weight: 600; color: var(--muted) }
.btrend.up { color: var(--pos) } .btrend.down { color: var(--neg) }
@media (max-width: 1100px) { .bud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 640px) { .bud-grid { grid-template-columns: minmax(0, 1fr) } .tg-bench { align-items: flex-start } }

/* ---------- Monthly Brief ---------- */
.brief-kpis .kpi .val { font-size: var(--fs-display) }
.brief-kpis .foot { gap: 6px }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer }
.linkbtn:hover { text-decoration: underline }
.brief-lede { margin-top: 14px; font-size: var(--fs-card); line-height: 1.6; max-width: none }
.ro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px }
.ro { border-top: 3px solid var(--ro) }
.ro.risks { --ro: var(--neg) } .ro.opps { --ro: var(--pos) }
.ro h2 { font-size: var(--fs-section); display: flex; align-items: center; gap: 8px; margin-bottom: 6px }
.ro h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ro) }
.ro ol { margin: 0; padding: 0; list-style: none; counter-reset: ro }
.ro li { counter-increment: ro; position: relative; padding: 10px 0 10px 34px; border-top: 1px solid var(--hair) }
.ro li:first-child { border-top: 0 }
.ro li::before { content: counter(ro); position: absolute; left: 0; top: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-small); font-weight: 700; color: var(--ro); background: color-mix(in srgb, var(--ro) 14%, transparent) }
.ro li b { display: block; font-size: var(--fs-body) }
.ro li span { display: block; color: var(--muted); font-size: var(--fs-meta); margin-top: 2px }
.ro .ask-go, .chk .ask-go { margin-top: 6px }
.brief-deep-t { margin-bottom: 12px; font-size: var(--fs-body); line-height: 1.6 }
.brief-deep-t p { margin: 0 }
.chks { display: grid; gap: 2px }
.chk { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--hair) }
.chk:first-child { border-top: 0 }
.chk i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-label); font-weight: 700; color: #fff; margin-top: 1px }
.chk.ok i { background: var(--status-good) } .chk.bad i, .chk.flag i { background: var(--status-critical) }
.chk b { display: block } .chk span { display: block; color: var(--muted); font-size: var(--fs-meta) }
.chk.flag { background: color-mix(in srgb, var(--neg) 6%, transparent); border-radius: 10px; padding: 10px; margin-top: 4px; border-top: 0 }
.chk-h { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--neg) }
.ask-ol { margin: 6px 0 0; padding-left: 18px } .ask-ol li { margin: 4px 0 }
@media (max-width: 900px) { .ro-grid { grid-template-columns: minmax(0, 1fr) } }

/* ---------- paper: Monthly Brief, Targets, one-pager ---------- */
.paper .p-up { color: #11734b; font-weight: 600 } .paper .p-dn { color: #b3261e; font-weight: 600 } .paper .p-fl { color: #555 }
.pb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px }
.pb-k { border: 0.75pt solid #c9d2dc; border-radius: 4pt; padding: 5pt 8pt; display: flex; flex-direction: column }
.pb-k span { font-size: 7.5pt; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .04em }
.pb-k b { font: 700 15pt/1.2 "Sora", "Inter", Arial, sans-serif; color: #003562 }
.pb-k em { font-style: normal; font-size: 8pt; color: #444 }
.pb-lede { margin: 0 0 8px; font-size: 10pt; line-height: 1.4 }
.pb-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.3in; align-items: start }
.pb-bot { margin-top: 8px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) }
.pb-h { font: 700 9.5pt "Sora", "Inter", Arial, sans-serif; color: #003562; border-bottom: 1pt solid #003562; padding-bottom: 2pt; margin-bottom: 4pt }
.pb-h.risk { color: #b3261e; border-color: #b3261e } .pb-h.opp { color: #11734b; border-color: #11734b }
.pb-ol { margin: 0; padding-left: 14pt; font-size: 8.8pt; line-height: 1.32 }
.pb-ol li { margin-bottom: 4pt } .pb-ol li b { color: #111 }
.pb-chk { list-style: none; margin: 0; padding: 0; font-size: 8.5pt; line-height: 1.3 }
.pb-chk li { display: grid; grid-template-columns: 12pt minmax(0, 1fr); gap: 4pt; margin-bottom: 3pt }
.pb-chk i { font-style: normal; font-weight: 700 } .pb-chk li.ok i { color: #0a7a0a } .pb-chk li.bad i { color: #b3261e }
.p-one td.lab { white-space: normal }
.p-tg td, .p-tg th { padding: 3pt 6pt } .p-tg { font-size: 9pt } .p-tg td.comb, .p-tg th.comb { border-left: 1.25pt solid #111; font-weight: 700 }
.po-lede { font-size: 10pt; line-height: 1.45; margin-bottom: 10px }
.po-lede p { margin: 0 }
.po-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 0.35in; align-items: start }
.pbar { display: grid; grid-template-columns: 1.5in minmax(0, 1fr) 0.8in; gap: 8px; align-items: center; font-size: 9pt; margin-bottom: 5pt }
.pbar b { text-align: right }
.pbar-t { height: 11pt; background: #edf0f3; border-radius: 2pt; overflow: hidden }
.pbar-t i { display: block; height: 100%; background: #7a8591 }
.pbar-g { border-top: 0.75pt dashed #999; padding-top: 4pt; font-weight: 700 }

@media (max-width: 640px) {
  .topbar .seg { max-width: 100%; overflow-x: auto }   /* five period views: scroll sideways rather than widen the page */
  .topbar .seg button { flex: none }
  .tabs { flex-wrap: wrap; margin-left: 0 }   /* five tabs: two tidy rows on a phone */
  .tab { white-space: nowrap; padding: 6px 10px }
  .section > .sec-head { flex-wrap: wrap; row-gap: 2px }
  .tg-big > b { font-size: 28px }
}
/* ---------- header: navigation and Ask AI Controller on one row; the view's controls on a slim bar below ---------- */
.topbar-inner { padding-top: 9px; padding-bottom: 9px }
.ask-top { display: inline-flex; align-items: center; gap: 8px; padding: 9px 17px 9px 14px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--brand); color: var(--on-brand); font: 700 var(--fs-body) "Inter", system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 32%, transparent) }
.ask-top:hover { filter: brightness(1.12) }
.ask-top[aria-expanded="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent) }
.ask-top .ask-ic path, .hero-ask .ask-ic path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.more { position: relative }
.more-btn { width: 38px; height: 38px; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer }
.more-btn:hover, .more-btn[aria-expanded="true"] { color: var(--ink); background: var(--surface-2) }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--hair-2);
  border-radius: 12px; box-shadow: 0 14px 36px rgba(15,30,45,.18) }
.more-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
  background: none; text-align: left; font-weight: 600; font-size: var(--fs-meta); cursor: pointer }
.more-menu button:hover, .more-menu button:focus-visible { background: var(--surface-2); outline: none }
.more-menu kbd { font: 600 var(--fs-small) "Inter", sans-serif; color: var(--faint) }
.ctxbar { border-top: 1px solid var(--hair) }
.ctxbar-inner { max-width: 1320px; margin: 0 auto; padding: 10px 24px 9px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap }

/* ---------- the Monthly Brief's ask box ---------- */
.hero-ask { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 22px; align-items: center; padding: 16px 18px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 11%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--hair)); box-shadow: var(--shadow) }
.hero-t { display: flex; align-items: center; gap: 12px; color: var(--brand) }
.hero-t b { display: block; font: 700 var(--fs-section) "Sora", "Inter", sans-serif; color: var(--ink) }
.hero-t span { display: block; font-size: var(--fs-meta); color: var(--muted) }
.hero-in { display: flex; gap: 8px }
.hero-in input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--hair-2); border-radius: 11px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-body) }
.hero-in input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); border-color: var(--brand) }
.hero-in button { padding: 0 20px; border: 0; border-radius: 11px; background: var(--brand); color: var(--on-brand); font-weight: 700; cursor: pointer }
.hero-in button:hover { filter: brightness(1.12) }
.hero-chips { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap }
.hero-chip { border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--hair-2)); background: var(--surface); color: var(--brand); border-radius: 99px; padding: 5px 12px;
  font-size: var(--fs-meta); font-weight: 600; cursor: pointer }
.hero-chip:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)) }
@media (max-width: 900px) { .hero-ask { grid-template-columns: minmax(0, 1fr) } }
@media (max-width: 640px) {
  .ctxbar-inner { padding-left: 16px; padding-right: 16px }
  .ask-top { padding: 8px 12px }
  .ask-top span { display: none }   /* the icon alone on a phone */
  .topbar-inner .tabs { order: 3; flex-basis: 100% }   /* brand, Ask and the menu on one row; the tabs below */
  .topbar-inner { gap: 8px }
  .more-btn { width: 34px; height: 34px }
  .ask-top { padding: 8px 10px }
}

.eyebrow { font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: 2px }

/* ---------- gross to net, in one line (Executive Dashboard and Deep Dive) ---------- */
.g2n { display: flex; align-items: stretch; flex-wrap: wrap; gap: 4px 6px; padding: 12px 16px; margin-bottom: 14px }
.g2-t { flex-basis: 100%; font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px }
.g2-c { flex: 1 1 130px; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 2px 6px }
.g2-l { font-size: var(--fs-meta); color: var(--ink); font-weight: 700 }   /* the line's headings carry it */
.g2-c b { font: 600 var(--fs-figure) "Sora", "Inter", sans-serif; letter-spacing: -.01em; white-space: nowrap }
.g2-c b .v { font: inherit }
.g2-f { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--fs-small); color: var(--muted) }
.g2-op { font-style: normal; align-self: center; color: var(--faint); font-weight: 700; font-size: var(--fs-figure) }
.g2-c:last-of-type b { color: var(--brand) }
@media (max-width: 900px) { .g2-op { display: none } .g2-c { flex-basis: 40% } }
.ro-card { margin-top: 14px }
.ro-t td:first-child { min-width: 170px }

@media print {
  html, body { background: #fff !important }
  body > *:not(#preview) { display: none !important }
  #preview { display: block !important; position: static; background: none; overflow: visible }
  #preview .pv-bar { display: none !important }
  #print { padding: 0; zoom: 1 !important }
  .paper { width: auto !important; height: auto !important; min-height: 0 !important; margin: 0; padding: 0 !important; box-shadow: none; overflow: visible; break-after: page }
  .paper.legal { height: 7.79in !important }     /* 8.5in - 2 x 0.35in margin: footer pinned to the page bottom */
  .paper:last-child { break-after: auto }
}
