/* PriceDesk — app styles (B3).
   Colours are tokens on :root, redefined for dark mode, so every screen and chart reads the
   same names. Chart colours come from the validated reference palette (dataviz skill). */

:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --line: #e2e0da;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7974;
  --accent: #2a78d6;          /* series 1 / increase */
  --accent-soft: #e7f0fb;
  --down: #d03b3b;            /* decrease (diverging pole) */
  --total: #52514e;
  --good: #0a7d0a;
  --good-soft: #e6f2e6;      /* upside background (B8b, spec 1.6) */
  --signal: #a65f00;         /* "price signal" — the only orange left on screen (spec 1.6) */
  --signal-soft: #fdf1df;
  --cty: #7a4fc4; --cty-soft: #efe9fa;   /* countries (customers = risk red, products = accent blue) */
  --risk: #b4302f;
  --risk-soft: #fbeaea;
  --seg-A: #184f95; --seg-B: #3987e5; --seg-C: #86b6ef; --seg-D: #cde2fb;
  --month-y1: #bebcb5;       /* the earlier year in "this year vs last" charts (B8c) */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --line: #33332f;
    --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
    --accent: #3987e5; --accent-soft: #1b2a3d; --down: #e66767; --total: #a9a89f;
    --good: #3fbf3f; --good-soft: #16291a; --signal: #e3a72a; --signal-soft: #2e2615; --risk: #e66767; --risk-soft: #2f1c1c;
    --cty: #a585e6; --cty-soft: #251d36;
    --seg-A: #86b6ef; --seg-B: #3987e5; --seg-C: #1c5cab; --seg-D: #104281;
    --month-y1: #5c5b56;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --line: #33332f;
  --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
  --accent: #3987e5; --accent-soft: #1b2a3d; --down: #e66767; --total: #a9a89f;
  --good: #3fbf3f; --good-soft: #16291a; --signal: #e3a72a; --signal-soft: #2e2615; --risk: #e66767; --risk-soft: #2f1c1c;
  --cty: #a585e6; --cty-soft: #251d36;
  --seg-A: #86b6ef; --seg-B: #3987e5; --seg-C: #1c5cab; --seg-D: #104281;
  --month-y1: #5c5b56;
  --shadow: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 15px/1.5 var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--text-3); }

/* ---------- Shell (B8b, spec 1.4 / 2): left sidebar 248 px + content; top bar with icon tabs; one data line */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.content { min-width: 0; display: flex; flex-direction: column; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand { font-weight:600; font-size: 20px; letter-spacing: -.01em; padding: 4px 10px 14px; }
.brand span { color: var(--accent); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.side a:hover { background: var(--surface-2); }
.side a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.side a.sec { font-weight:600; color: var(--text); font-size: 14.5px; padding: 8px 10px; margin-top: 6px; }
.side a.sec .ic { color: var(--text-2); }
.side a.sec.on .ic { color: var(--accent); }
.side .sub { border-left: 1px solid var(--line); margin: 0 0 4px 19px; padding-left: 4px; }
.side .sub a { padding: 4px 8px; font-size: 13px; }
.side .sub a .nm { flex: 1; min-width: 0; line-height: 1.25; }
.side .sub a .dot { align-self: center; }
.side .sub a .amt { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side .fam { font-size: 11px; color: var(--text-3); padding: 8px 8px 2px; font-weight:600; }
.side .foot { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.side .foot a { font-size: 13px; color: var(--text-3); padding: 4px 10px; }
.side .foot a.on { color: var(--text); }
.count { margin-left: auto; font-size: 11px; font-weight:600; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; }
.count:empty { display: none; }
.toptabs .count { margin-left: 4px; }
/* Area dots: green = upside, red = risk, grey = fine or small, dashed = needs more data (spec 1.6) */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot-up { background: var(--good); } .dot-risk { background: var(--risk); }
.dot-fine, .dot-small { background: var(--line); border: 1px solid var(--text-3); }
.dot-more { background: transparent; border: 1px dashed var(--text-3); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
          position: sticky; top: 0; z-index: 10; }
.toptabs { display: flex; gap: 2px; min-width: 0; }
.toptabs a { display: inline-flex; align-items: center; gap: 7px; padding: 14px 11px 12px; color: var(--text-2); text-decoration: none; font-size: 14px;
             font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.toptabs a .ic { width: 16px; height: 16px; }
.toptabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.toptabs a.on .ic { color: var(--accent); }
.viewbadge { margin-left: auto; font-size: 12px; font-weight:600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.menu, .top-brand { display: none; }
.menu { background: none; border: 0; color: var(--text); padding: 8px 4px; cursor: pointer; }
.dataline { padding: 7px 24px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--line); background: var(--bg); }
.dataline b { color: var(--text-2); }
@media (max-width: 600px) { .dl-long { display: none; } }
main { padding: 20px 24px 48px; width: 100%; }   /* full width (spec 1.4): no cap on wide screens */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 18px 20px; }
h2 { font-size: 13px; color: var(--text-2); margin: 0 0 10px; font-weight: 600; }
h1.view { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
section + section { margin-top: 16px; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 0 0 4px; }

/* Overview: content + right rail (spec 1.4) */
.ovgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.rail { display: grid; gap: 16px; }
.rail section + section { margin-top: 0; }
.rail .checks { grid-template-columns: 1fr; }
@media (min-width: 861px) { .ovmain .drow { grid-template-columns: 28px minmax(0, 1fr) 150px 100px 22px; } .ovmain .drow .segs { display: none; } }
.pot.up { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, var(--line)); }
.pot.risk { background: var(--risk-soft); border-color: color-mix(in srgb, var(--risk) 25%, var(--line)); }
.pot.up .big { color: var(--good); }
a.check { display: block; color: inherit; text-decoration: none; }
a.check:hover { border-color: var(--text-3); }

/* Pricing-area tiles (B8c, spec 4.2): term + plain line + € + status. Green = upside, red = risk,
   darker = more € (--tint, set per tile by area.js); neutral = fine or small; dashed = needs more data. */
.famrow { margin-top: 18px; }
.famhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; }
.famhead b { font-size: 15px; }
.famhead a { color: var(--text); text-decoration: none; }
.famhead span { font-size: 13px; color: var(--text-3); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.area-tile { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; min-height: 150px;
             padding: 12px 13px; color: inherit; text-decoration: none; background: var(--surface); box-shadow: var(--shadow); }
.area-tile:hover { border-color: var(--text-3); }
.area-tile .tn { font-size: 14.5px; line-height: 1.25; }
.area-tile .pl { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.area-tile .tb { margin-top: auto; padding-top: 6px; font-size: 20px; font-weight:600; letter-spacing: -.01em; line-height: 1.15; }
.area-tile .tl { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.area-tile .tw { font-size: 11px; font-weight:600; color: var(--text-3); margin-top: 4px; }
.area-tile.st-up { background: color-mix(in srgb, var(--good) var(--tint, 20%), var(--surface)); border-color: color-mix(in srgb, var(--good) 30%, var(--line)); }
.area-tile.st-up .tw { color: var(--good); }
.area-tile.st-risk { background: color-mix(in srgb, var(--risk) var(--tint, 18%), var(--surface)); border-color: color-mix(in srgb, var(--risk) 30%, var(--line)); }
.area-tile.st-risk .tw { color: var(--risk); }
.area-tile.st-fine .tw { color: var(--good); }
.area-tile.st-more { border-style: dashed; background: transparent; box-shadow: none; }
.area-tile.st-more .tn, .area-tile.st-more .tb { color: var(--text-2); }
.area-tile.st-more .tb { font-size: 15px; }
.tile-legend { margin-top: 10px; align-items: center; }
.tile-legend .lg-fine::before { background: var(--surface); border: 1px solid var(--text-3); }
.tile-legend .lg-more::before { background: transparent; border: 1px dashed var(--text-3); }
.tile-legend a { margin-left: auto; }
.up-t { color: var(--good); }
.search-in { width: min(420px, 100%); margin-bottom: 8px; }
.flash { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion (D269): arrival in order; off under reduced motion */
@keyframes fxIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fx-in, .fx-row { animation: fxIn .45s ease-out both; animation-delay: calc(var(--i, 0) * var(--step, 70ms)); }
@media (prefers-reduced-motion: reduce) { .fx-in, .fx-row { animation: none !important; } }

/* Phone: the sidebar opens over the page from the menu button; the tabs scroll sideways */
@media (max-width: 1180px) { .ovgrid { grid-template-columns: 1fr; } .rail .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 30; transform: translateX(-100%); transition: transform .2s ease;
          box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.side-open .side { transform: none; }
  .menu, .top-brand { display: inline-flex; }
  .top-brand { padding: 0; font-size: 17px; }
  .topbar { padding: 0 12px; gap: 10px; flex-wrap: wrap; }
  .toptabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 6px; width: calc(100% + 24px); }
  .toptabs a { padding: 10px 9px; font-size: 13px; }
  .dataline { padding: 6px 16px; }
  main { padding: 16px 16px 40px; }
}
@media (max-width: 520px) { .rail .checks { grid-template-columns: 1fr; }
@media (min-width: 861px) { .ovmain .drow { grid-template-columns: 28px minmax(0, 1fr) 150px 100px 22px; } .ovmain .drow .segs { display: none; } } }

/* ---------- Headline */
.headline { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.big { font-size: 40px; font-weight:600; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 6px; }
.big.risk { color: var(--risk); }
.range-ends { display: flex; gap: 18px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.range-ends b { color: var(--text); }
.split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 10px 0 6px; }
.split i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px;
                       background: var(--c); vertical-align: 0; }
.risk-line { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.risk-line:first-of-type { border-top: 0; }
.risk-line .amt { font-size: 26px; font-weight:600; color: var(--risk); min-width: 108px; letter-spacing: -.01em; }
.risk-line .amt.sm { font-size: 20px; }
.pending { margin-top: 8px; padding: 6px 10px; background: var(--accent-soft); border-radius: 6px; font-size: 13px; color: var(--text); }

/* ---------- AI box */
.brief { border-left: 4px solid var(--accent); }
.brief p { margin: 0 0 8px; font-size: 15px; line-height: 1.55; max-width: 72ch; }
.brief .state { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
                background: var(--surface-2); color: var(--text-2); margin-bottom: 8px; }

/* ---------- Decision rows */
.drow { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 170px 100px 22px; gap: 14px;
        align-items: center; padding: 12px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.drow:hover { background: var(--surface-2); }
.drow:first-child { border-top: 0; }
.drow .rank { font-weight:600; color: var(--text-3); font-size: 18px; text-align: center; }
.drow .title { font-weight: 600; }
.drow .why { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.drow .gbp { text-align: right; font-weight:600; font-size: 16px; }
.drow .gbp .kind { display: block; font-size: 12px; font-weight: 400; color: var(--text-2); }
.drow .gbp.risk { color: var(--risk); }
.drow .go { color: var(--text-3); }
.drow.hidden-item { opacity: .6; }
.drow.held .gbp { color: var(--accent); }
.badges { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.badge.conflict { background: var(--risk-soft); color: var(--text); }
.badge.held { background: var(--accent-soft); color: var(--text); }
.segs { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.segbar { display: flex; height: 6px; gap: 2px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.segbar i { display: block; height: 100%; }
.conf { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.conf b { color: var(--accent); letter-spacing: 1px; font-weight: 400; }
.more-line { padding: 10px 6px 0; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--line); }
.detail { grid-column: 2 / -1; font-size: 13px; color: var(--text-2); background: var(--surface-2);
          border-radius: 8px; padding: 10px 14px; margin: 0 6px 10px 48px; cursor: default; }
.detail ol { margin: 4px 0 6px 18px; padding: 0; }

/* ---------- Checks */
.checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.check { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.check .st { font-size: 12px; font-weight:600; }
.check.ok .st { color: var(--good); }
.check.look .st { color: var(--risk); }
.check.look { background: var(--risk-soft); border-color: transparent; }
.check .t { font-weight: 600; margin: 2px 0 4px; font-size: 14px; }
.check .d { font-size: 13px; color: var(--text-2); }

/* ---------- Bridge */
.bridge-wrap { position: relative; height: 320px; }
.bridge-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.bridge-notes b { color: var(--text); }
details.table-view { margin-top: 8px; font-size: 13px; }
details.table-view table { border-collapse: collapse; margin-top: 6px; }
details.table-view td, details.table-view th { padding: 3px 10px; border-bottom: 1px solid var(--line); text-align: left; }
details.table-view td.n { text-align: right; }

/* ---------- Decisions list */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 999px;
        padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters label { font-size: 13px; color: var(--text-2); margin-left: auto; }
.placeholder { text-align: center; padding: 48px 20px; color: var(--text-2); }

footer { padding: 0 24px 32px; font-size: 12px; color: var(--text-3); }

/* ---------- Narrow screens */
@media (max-width: 860px) {
  .headline, .bridge-notes { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr 1fr; }
  .drow { grid-template-columns: 24px minmax(0, 1fr) 110px; }
  .drow .segs, .drow .conf, .drow .go { display: none; }
  .detail { margin-left: 6px; }
  .big { font-size: 32px; }
}
@media (max-width: 520px) {
  .checks { grid-template-columns: 1fr; }
  .drow { grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; }       /* B8: £ goes under the text on a phone */
  .drow .gbp { grid-column: 2; text-align: left; }
}

/* ---------- B4: decision page, panels, my actions */
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.crumbs a { text-decoration: none; }
.dhead h1.view { margin-bottom: 6px; }
.dhead-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 20px; margin-top: 12px; align-items: start; }
.risk-note { font-size: 13px; color: var(--risk); }
.first-action { margin-top: 8px; font-size: 14px; padding: 8px 10px; background: var(--accent-soft); border-radius: 6px; }
table.segt { border-collapse: collapse; font-size: 13px; margin-top: 4px; }
table.segt td { padding: 2px 8px 2px 0; }
table.segt td.n { text-align: right; }
.found { font-size: 15px; max-width: 90ch; margin: 0 0 12px; }
.evidence-wrap { position: relative; height: 340px; margin: 6px 0; }
.evidence-wrap.short { height: 220px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
.tablewrap { overflow-x: auto; }
table.items { border-collapse: collapse; width: 100%; font-size: 13px; }
table.items th { text-align: left; font-weight: 600; color: var(--text-2); padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.items td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.items .n { text-align: right; white-space: nowrap; }
table.items tr.link { cursor: pointer; }
table.items tr.link:hover { background: var(--surface-2); }
table.items tr.tot td { font-weight:600; }
table.items.small-t { width: auto; }
details.more summary { font-size: 13px; color: var(--accent); cursor: pointer; padding: 6px 0; }
.seg { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; font-weight:600; border-radius: 4px; padding: 0 3px; color: #fff; background: var(--text-3); }
.seg-A { background: var(--seg-A); } .seg-B { background: var(--seg-B); }
.seg-C { background: var(--seg-C); color: var(--text); } .seg-D { background: var(--seg-D); color: var(--text); }
.sig { color: var(--signal); }
.risk-t { color: var(--risk); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two > * { min-width: 0; }
.two ul, ul.small { margin: 0; padding-left: 18px; font-size: 14px; }
.two li, ul.small li { margin-bottom: 6px; }
.conflict-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.conflict-card summary { cursor: pointer; }
table.opts tr.def td { background: var(--accent-soft); }
ol.acts { margin: 0; padding-left: 20px; }
li.act { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
li.act .act-main { flex: 1; }
.accept { margin-top: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 6px; font-size: 14px; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.addact { font-size: 13px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
table.whatif td, table.whatif th { text-align: right; }
table.whatif td:first-child { text-align: left; white-space: nowrap; }
ul.reasons { list-style: none; padding: 0; margin: 4px 0 0; }
ul.reasons li { padding: 3px 0 3px 8px; border-left: 3px solid var(--line); margin-bottom: 4px; }
ul.reasons li.protect { border-left-color: var(--accent); }
ul.reasons li.tighten { border-left-color: var(--risk); }
ul.reasons li.way-protect { border-left-color: var(--accent); }                  /* B8f: "way-" prefix — the bare class "info" */
ul.reasons li.way-tighten { border-left-color: var(--risk); }                    /* collided with the ⓘ icon style (15 px wide) */
.chip:disabled { opacity: .5; cursor: default; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; }
@media (max-width: 860px) {
  .dhead-grid, .two { grid-template-columns: 1fr; }
  .evidence-wrap { height: 300px; }
}
.copy-box { width: 100%; height: 240px; margin-top: 12px; font: 13px/1.4 ui-monospace, monospace; }
@media (max-width: 600px) {
  table.opts tr:first-child { display: none; }
  table.opts tr, table.opts td { display: block; width: 100%; }
  table.opts tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.opts td { border: 0; padding: 2px 4px; text-align: left !important; }
  li.act, .accept { flex-direction: column; gap: 4px; }
}

/* ---------- B5: settings, thresholds & assumptions, data view */
.changed-strip { background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.changed-strip div { padding: 6px 24px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.badge.changed { background: var(--accent-soft); color: var(--text); }
.changed-line { margin-top: 8px; font-size: 13px; padding: 6px 10px; background: var(--accent-soft); border-radius: 6px; }
.moved { color: var(--accent); }
.was { color: var(--text-3); text-decoration: line-through; }
.th-sticky { position: sticky; top: 48px; z-index: 5; background: var(--bg); padding: 10px 0 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a.chip { text-decoration: none; }
.th-head { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--text-2); }
.th-head b { color: var(--text); }
.th-group { font-size: 12px; color: var(--text-3); margin: 18px 0 6px; font-weight: 600; }
details.th-card { padding: 0; }
details.th-card + details.th-card { margin-top: 8px; }
details.th-card > summary { cursor: pointer; padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; list-style: none; }
details.th-card > summary::-webkit-details-marker { display: none; }
details.th-card > summary::before { content: "▸"; color: var(--text-3); width: 10px; }
details.th-card[open] > summary::before { content: "▾"; }
.th-title { font-weight: 600; }
.th-sum { font-size: 13px; color: var(--text-2); margin-left: auto; }
.th-body { padding: 4px 18px 16px 36px; border-top: 1px solid var(--line); }
.th-impact { margin: 10px 0 4px; }
table.impact { border-collapse: collapse; font-size: 13px; margin-top: 4px; }
table.impact td { padding: 3px 14px 3px 0; vertical-align: top; }
table.impact td:first-child { color: var(--text-2); }
.th-row { padding: 10px 0 10px 10px; border-top: 1px dashed var(--line); border-left: 3px solid transparent; }
.th-row.is-changed, li.is-changed, label.is-changed { border-left-color: var(--accent); }
.th-label { font-size: 14px; margin-bottom: 6px; }
.ctrl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.chip.step { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; padding: 4px 12px; }
.chip.step small { font-size: 11px; color: var(--text-3); }
.chip.step.on small { color: rgba(255,255,255,.85); }
.chip.sug { box-shadow: inset 0 -2px 0 var(--accent); }
.chip.step.on.sug { box-shadow: none; }
.other { font-size: 13px; color: var(--text-2); }
.num-in { width: 72px; font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px;
          background: var(--surface); color: var(--text); text-align: right; }
.num-in::placeholder { color: var(--text-3); }
.num-in.changed { border-color: var(--accent); background: var(--accent-soft); }
.num-in.bad { border-color: var(--risk); background: var(--risk-soft); }
.text-in { width: min(360px, 100%); font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
label.cut { font-size: 13px; color: var(--text-2); }
ol.prio { list-style: none; padding: 0; margin: 8px 0; }
ol.prio li { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px; margin-bottom: 6px; background: var(--surface); }
ol.prio li.dragging { opacity: .5; }
ol.prio li.over { outline: 2px dashed var(--accent); }
.grip { cursor: grab; color: var(--text-3); user-select: none; padding-top: 2px; }
.pnum { font-weight:600; color: var(--accent); min-width: 16px; }
.pbody { flex: 1; }
.pbtns { display: flex; gap: 4px; }
.pbtns .chip { padding: 2px 9px; }
table.guard td .num-in { width: 64px; }
.costgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 8px 0; }
label.cost-in { display: flex; flex-direction: column; gap: 2px; font-size: 13px; padding-left: 8px; border-left: 3px solid transparent; }
.voltables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }   /* minmax(0,…): lets the table scroll inside on a phone instead of widening the page */
table.vol { width: auto; }
table.vol .num-in { width: 52px; }
table.vol tr.tiny td { color: var(--text-3); font-size: 12px; }
.status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.status.run { background: var(--accent-soft); color: var(--text); }
.status.ok { color: var(--good); border: 1px solid var(--line); }
.status.look { background: var(--risk-soft); color: var(--text); }
.status.off { background: var(--surface-2); color: var(--text-2); }
.attrib { font-size: 13px; padding: 8px 12px; background: var(--surface-2); border-radius: 6px; margin: 8px 0; }
@media (max-width: 860px) {
  .th-body { padding-left: 18px; }
  .th-sum { margin-left: 0; }
  .th-sticky { position: static; }
}

/* B6: margin terms (D211) — a dotted underline says "hover or click for the definition" */
a.term { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }

/* B6: AI analyst box — the state chip says where the text comes from (spec §9.4) */
.brief .state.st-ai, .brief .state.st-fallback { background: var(--accent-soft); color: var(--accent); }
.brief .state.st-previous, .brief .state.st-updating { background: var(--accent-soft); color: var(--accent); }
.brief .state.st-unavailable, .brief .state.st-off, .brief .state.st-filtered { background: var(--surface-2); color: var(--text-2); }
.ai-box.stale .ai-text { opacity: .55; }
.ai-box .ai-toggle { margin-left: 6px; vertical-align: middle; font-size: 12px; }
.ai-box .ai-text { margin-top: 8px; }
.ai-box ul.ai-acts { margin: 0 0 8px; padding-left: 20px; font-size: 15px; line-height: 1.5; }

/* ---------- B7: My choices & roadmap, concept pricing */
.lead { font-size: 16px; max-width: 80ch; margin: 6px 0 16px; color: var(--text-2); }
.note { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 0 0 16px; }
.from { display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-right: 4px; }
.nowrap { white-space: nowrap; }
.ok-t { color: var(--good); }
.princ { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tier .big { margin: 2px 0 2px; }
.tier ul { padding-left: 18px; margin: 8px 0 0; }
.tier li { margin-bottom: 4px; }
.tier.main { border: 2px solid var(--accent); }
.calc { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font-size: 14px; margin-bottom: 8px; }
.calc input[type=number] { width: 90px; font: inherit; padding: 4px 6px; background: var(--surface); color: var(--text);
                           border: 1px solid var(--line); border-radius: 6px; }
.calc input[type=range] { flex: 1; min-width: 160px; }
@media (max-width: 860px) {
  .tiers, .princ { grid-template-columns: 1fr; }
}
#calc table.items tr:not(.verdict):not(:first-child) td { border-bottom: 0; }
#calc table.items tr.verdict td { padding-top: 0; }

/* Phone tables (B8): table.stack rows become small cards; APP.stack() copies the column names into data-label. */
@media (max-width: 600px) {
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack tr.head { display: none; }
  table.stack tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); }
  table.stack td, table.stack th { display: block; border: 0; padding: 2px 4px; text-align: left; white-space: normal; }
  table.stack td.n { text-align: left; }
  table.stack td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-3); }
  table.stack tr > :first-child { font-weight: 600; }
  table.stack tr > td:first-child::before { display: none !important; }
}

/* ---------- B8c: Overview (spec §4) */
.side a.brand { display: block; font-size: 20px; font-weight:600; color: var(--text); padding: 4px 10px 14px; }
.side a.brand:hover { background: none; }
a.top-brand { color: var(--text); text-decoration: none; }
.pots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pot .what { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.pot .parts { border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.pot .part { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent); font-size: 13px; color: var(--text-2); }
.pot .part:last-child { border-bottom: 0; }
.pot .part b { font-size: 15px; color: var(--text); white-space: nowrap; }
.pot .part a { color: var(--text); text-decoration: none; }
.pot .part a:hover strong { text-decoration: underline; }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--text-3); font-size: 10px; font-style: italic; color: var(--text-3); cursor: help; }
.ovmain { container-type: inline-size; }
.ovcharts { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 18px; }
@container (min-width: 700px) { .ovcharts { grid-template-columns: 1fr 1fr; } }
section.ovcharts + section, .ovcharts > .card + .card { margin-top: 0; }
.chartcard .ct { font-size: 15px; font-weight:600; }
.chartcard .cs { font-size: 12.5px; color: var(--text-2); margin: 2px 0 8px; min-height: 18px; }
.chartcard .bridge-wrap { height: 260px; }
.chartcard .bridge-notes { grid-template-columns: 1fr; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; }
.kv span { color: var(--text-2); }
.aiblk { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.aiblk:last-child { border-bottom: 0; }
.aiblk .k { font-size: 11px; font-weight:600; color: var(--text-3); margin-bottom: 2px; }
.rail .brief p { font-size: 14.5px; }

/* ---------- B8c: area pages (spec §5, 1.7) */
.areahead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.areahead .sub { color: var(--text-2); font-size: 15px; }
.areahead .badges { margin-top: 8px; }
.livebig { text-align: right; }
.livebig .v { font-size: 34px; font-weight:600; letter-spacing: -.02em; line-height: 1.1; }
.livebig .s { font-size: 13px; color: var(--text-2); }
.livebig.st-up .v { color: var(--good); } .livebig.st-risk .v { color: var(--risk); }
.livebig.st-fine .v, .livebig.st-small .v, .livebig.st-more .v { color: var(--text-2); }
.controls .ctrl-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.controls .ctrl-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 20px; }
.controls .th-row { border-top: 0; padding-left: 8px; }
details.more-th > summary { font-size: 13px; color: var(--accent); cursor: pointer; padding: 6px 0; }
.answer { border-left: 4px solid var(--accent); }
.answer .q { font-size: 12px; font-weight:600; color: var(--text-3); }
.answer .a { font-size: 19px; font-weight:600; line-height: 1.35; margin: 4px 0 8px; max-width: 80ch; }
.answer .found { color: var(--text-2); font-size: 14px; }
.segline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.segline .segs { min-width: 180px; }
.next { border-left: 4px solid var(--good); }
details.fold { padding: 0; }
details.fold > summary { cursor: pointer; padding: 13px 18px; font-weight: 600; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸ "; color: var(--text-3); }
details.fold[open] > summary::before { content: "▾ "; }
.fold-body { padding: 0 18px 16px; border-top: 1px solid var(--line); }
details.fold + details.fold { margin-top: 8px; }
.callout { background: var(--surface-2); border-left: 3px solid var(--text-3); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.two h3.risk-t, .two h3.up-t { margin-top: 4px; }
@media (max-width: 860px) { .pots { grid-template-columns: 1fr; } .livebig { text-align: left; } .livebig .v { font-size: 28px; } .answer .a { font-size: 17px; } }

/* ---------- B8c: tools */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
a.tool-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
a.tool-card:hover { border-color: var(--text-3); }
.scen-in { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; margin-bottom: 8px; }
.scen-in label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.num-in.wide { width: 120px; }
table.whatif tr.mine td { background: var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toc { margin: 10px 0 0; }
.toc a.chip { text-decoration: none; }
details.rule-def { border-top: 1px solid var(--line); padding: 4px 0; }
details.rule-def > summary { color: var(--text); }

/* ---------- B8c: About, the landing page (spec §3): blue page with a white grid, sections as cards */

body.landing .shell { grid-template-columns: 1fr; }
body.landing .side, body.landing .topbar, body.landing .dataline, body.landing .changed-strip, body.landing .content > footer { display: none; }
body.landing main { padding: 0; }

.pp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pb { border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text-2); }
.pb b { display: block; font-size: 22px; letter-spacing: -.01em; margin: 2px 0; }
.pb.g { background: var(--good-soft); } .pb.g b { color: var(--good); }
.pb.r { background: var(--risk-soft); } .pb.r b { color: var(--risk); }

    

.ck { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13.5px; }
.ck b { color: var(--good); } .ck.look { background: var(--risk-soft); border-color: transparent; } .ck.look b { color: var(--risk); }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots button { width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: width .2s; }
.dots button.on { width: 22px; background: var(--accent); }

  

/* ===================================================================== B8d — Review 2 (D294–D297)
   Area page row 1: thresholds │ answer + AI side by side, same height; one column on a narrow screen.
   Ranked tables: columns sized to their content, the € bar column takes the rest (Alex, E1–E2). */
.arow1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.arow1 > .card { margin: 0; }
.arow1.solo { grid-template-columns: minmax(0, 1fr); }
.arow1 .acol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.arow1 .acol > .card { margin: 0; }
.arow1 .acol > .answer { flex: 1 0 auto; }
.arow1 .controls .ctrl-rows { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1080px) { .arow1 { grid-template-columns: minmax(0, 1fr); } }

table.items.fit th, table.items.fit td { width: 1%; white-space: nowrap; }
table.items.fit .name { white-space: normal; min-width: 160px; max-width: 34vw; }
table.items.fit th.barc, table.items.fit td.barc { width: auto; min-width: 150px; }
table.items.fit:not(.ranked) td:first-child, table.items.fit:not(.ranked) th:first-child { width: auto; white-space: normal; }
.bcell { display: grid; grid-template-columns: auto minmax(40px, 1fr); align-items: center; gap: 8px; }
.bcell .v { text-align: right; min-width: 58px; font-variant-numeric: tabular-nums; }
i.b { display: block; height: 12px; border-radius: 3px; min-width: 2px; background: var(--total); }
i.b-risk { background: var(--down); } i.b-up { background: var(--good); } i.b-prod, i.b-cust { background: var(--accent); }
i.b-cust { background: var(--down); } i.b-cty { background: var(--cty); } i.b-neutral { background: var(--total); }
.bcell i.b { justify-self: start; }
.drow i.rowbar { height: 5px; margin-top: 4px; margin-left: auto; opacity: .85; }
.also { font-size: 12px; color: var(--risk); font-weight: 600; white-space: nowrap; margin-top: 2px; }

/* Next step: one line per action, € to the right, "Add" at the end. */
li.act .act-t { flex: 1; font-weight: 600; }
li.act .act-g { white-space: nowrap; font-size: 13px; }
section.next .tiny { margin-top: 6px; }

/* Overview: three amounts, never added (D295). The leak box is green-edged on the page background. */
.pots.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pot.leak { background: var(--surface); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); border-style: solid; border-width: 1px 1px 1px 4px; }
.pot.leak .big { color: var(--good); }
.pots-note { margin: 8px 2px 4px; }
/* B8f-0: a different measure under a box (e.g. paid above others under the sales at risk): dashed rule, never a "+". */
.pot .apart { margin-top: 10px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--text) 25%, transparent); color: var(--text-2); }
.pot .apart b { color: var(--text); }
/* B8f-0: the limit of a typed threshold (what the prepared data allows) */
.th-row .lim { display: block; margin-top: 2px; }
.th-row .lim.bad { color: var(--risk); font-weight: 600; }
@media (max-width: 1180px) { .pots.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pots.three .pot.risk { grid-column: 1 / -1; } }
@media (max-width: 860px) { .pots.three { grid-template-columns: 1fr; } }

/* Observed only (other charges): neutral tile and headline. */
.area-tile.st-info { background: var(--surface-2); }
.area-tile.st-info .tw { color: var(--text-2); }
.livebig.st-info .v { color: var(--text); }
.dot-info { background: var(--text-3); }

/* Search list: search box and "Columns" menu on one line. */
.listbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.listbar .search-in { flex: 1 1 260px; margin: 0; }
details.colmenu { position: relative; }
details.colmenu > summary { cursor: pointer; list-style: none; font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
details.colmenu > summary::-webkit-details-marker { display: none; }
details.colmenu .colpop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; max-width: 300px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
details.colmenu .colpop .tiny { margin-top: 4px; }

/* About preview: three boxes. */
.pp.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pp.three .pb b { font-size: 16px; }
.pb.l { background: var(--surface-2); border-left: 3px solid var(--good); } .pb.l b { color: var(--good); }

@media (max-width: 520px) { .pp.three { grid-template-columns: 1fr; } }
.pots.three .pot { min-width: 0; overflow-wrap: anywhere; }
.pots.three .pot .big { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.1; }
.pots.three .pot .part { grid-template-columns: minmax(0, 1fr); gap: 2px; }
@media (max-width: 600px) { table.items.fit th.barc, table.items.fit td.barc { min-width: 96px; } .bcell { grid-template-columns: auto minmax(24px, 1fr); gap: 6px; } }

/* B8e: price-change boxes (spec 11.11) — a 2 × 2 grid: price up / down × volume held / fell.
   The coloured edge says which box (green = room to continue, red = stop or reverse, blue = did it pay?, grey = stop cutting). */
.pmgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.pmbox { text-align: left; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.pmbox:hover { background: var(--surface-2); }
.pmbox.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.pmbox .pmh { font-weight: 600; font-size: 14px; }
.pmbox .pmv { font-size: 26px; font-weight:600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pmbox .pmv small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.pmbox .pmw { font-size: 13px; font-weight: 600; }
.pmbox .pms { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.pmbox.pm-up { border-left-color: var(--good); } .pmbox.pm-risk { border-left-color: var(--risk); }
.pmbox.pm-prod { border-left-color: var(--accent); } .pmbox.pm-neutral { border-left-color: var(--text-3); }
.pm-up .pmw, .pmtag.pm-up { color: var(--good); } .pm-risk .pmw, .pmtag.pm-risk { color: var(--risk); }
.pm-prod .pmw, .pmtag.pm-prod { color: var(--accent); } .pm-neutral .pmw, .pmtag.pm-neutral { color: var(--text-2); }
.pmtag { font-size: 12px; font-weight: 600; white-space: normal; display: inline-block; min-width: 120px; max-width: 170px; }
@media (max-width: 700px) { .pmgrid { grid-template-columns: 1fr; } }
/* B8e: a conflict line under a name wraps instead of widening the whole ranked table */
table.items.fit .also { white-space: normal; max-width: 260px; }
/* B8e: months compared (price changes) — twelve small toggles */
.pmper .ctrl { margin-bottom: 6px; }
.pm-months .chip.mon { padding: 3px 8px; font-size: 12px; min-width: 40px; }

/* ---------- B8f: customer and product pages, diagnosis, consistency pages */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.kpi { min-width: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.kpi .kv { font-size: 22px; font-weight:600; margin: 2px 0; overflow-wrap: anywhere; }
ul.reasons.wide li { overflow-wrap: anywhere; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.rd { font-size: 12px; white-space: normal; display: inline-block; min-width: 120px; max-width: 190px; }
.rd-price { color: var(--signal); font-weight: 600; } .rd-same { color: var(--risk); } .rd-more { color: var(--good); } .rd-gone, .rd-otherq, .rd-small { color: var(--text-2); }
.rd-chips { margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.rd-chips .chip.on .swatch { outline: 1px solid #fff; }
.two.wf { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.note-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); resize: vertical; }
.scen .whatif { width: auto; }
.splitbar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; margin: 8px 0 6px; background: var(--surface-2); }
.splitbar > i { display: block; height: 100%; min-width: 2px; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.split-legend span { white-space: nowrap; }
.scrollbox { max-height: 520px; overflow-y: auto; }
.cty-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.cty-pick .chip { padding: 3px 10px; }
.grp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.grp-chips .chip b { margin-left: 4px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two.wf { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr; } }
.parts-t table.items.fit .name { width: 48%; min-width: 200px; max-width: none; }   /* the definitions need room; the bar does not */
.parts-t table.items.fit td.barc, .parts-t table.items.fit th.barc { width: 40%; }
.r10two { gap: 24px; }                                                   /* side by side only where both tables fit (spec 6.4) */
@media (max-width: 1599px) { .two.r10two { grid-template-columns: 1fr; } .two.r10two > div + div { margin-top: 8px; } }
@media (max-width: 600px) { .parts-t table.items.fit .name { width: auto; min-width: 0; } .parts-t table.items.fit td.barc, .parts-t table.items.fit th.barc { width: auto; } }

/* ------------------------------------------------------------------ B8g: filter row (filter.js, spec 2.2; D344)
   Four type-to-search boxes under the data line: pick one or several values, a clear button beside each.
   Picked values are chips inside the box; the list drops below it. Colours: countries purple, customers
   red, products blue (spec 1.6). */
.filterrow { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 10px; padding: 8px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.filterrow.loading { opacity: .6; }
.fr-title { font-size: 11px; font-weight:600; color: var(--text-3); }
.fbox { position: relative; display: flex; align-items: center; gap: 4px; flex: 1 1 0; min-width: 150px; }
.fin { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; overflow: hidden; align-items: center; gap: 4px; min-height: 32px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: text; }
.fbox.on .fin { border-color: var(--accent); background: var(--surface); }
.fin:focus-within { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fq { flex: 1; min-width: 44px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; padding: 2px 2px; outline: none; }
.fq::-webkit-search-cancel-button { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 2px; max-width: 75%; flex: 0 1 auto; min-width: 0; padding: 1px 2px 1px 8px; border-radius: 999px; font-size: 12px; line-height: 1.6;
         background: var(--accent-soft); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchip.countries { background: var(--cty-soft); } .fchip.customers { background: var(--risk-soft); }
.fchip button { border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 5px; border-radius: 50%; }
.fchip button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.fclear { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 8px; font-size: 12px; padding: 6px 7px; cursor: pointer; flex: none; }
.fclear:disabled { opacity: .4; cursor: default; }
.fclear:not(:disabled):hover { color: var(--text); border-color: var(--text-3); }
.fdrop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: max(100%, 300px); max-height: 340px; overflow-y: auto; padding: 6px;
         background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.fopt { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; }
.fopt b { font-weight: 600; font-size: 13.5px; } .fopt span { font-size: 12px; color: var(--text-3); }
.fopt:hover, .fopt.first { background: var(--surface-2); }
.fpresets { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.fpresets .chip { font-size: 12px; padding: 2px 9px; }
.fdrop-note { padding: 6px 8px 2px; }
.fr-all { margin-left: 2px; }
.filternote { padding: 6px 24px; font-size: 12.5px; color: var(--text-2); background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.filternote a { color: var(--text); }
.fn-warn { color: var(--text); }
body.landing .filterrow, body.landing .filternote { display: none; }
@media (max-width: 900px) { .filterrow { padding: 8px 16px; flex-wrap: wrap; } .filternote { padding: 6px 16px; } .fbox { max-width: none; flex-basis: calc(50% - 10px); } .fr-title { width: 100%; } }
@media (max-width: 520px) { .fbox { flex-basis: 100%; } }

/* An area that cannot follow the filter (its data lacks a dimension of the selection): grey, dotted. */
.dot-na { background: transparent; border: 1px dotted var(--text-3); }
.area-tile.st-na { background: var(--bg); border-style: dotted; }
.area-tile.st-na .tn, .area-tile.st-na .tb { color: var(--text-3); }
.tile-legend .lg-na::before { background: var(--bg); border: 1px dotted var(--text-3); }
.area-tile .ts { font-size: 12px; color: var(--text-2); line-height: 1.3; font-variant-numeric: tabular-nums; }

/* Overview families: six boxes in a 3 × 2 grid (D344), each with its areas as compact tiles. */
.famgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.fambox { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fambox .famhead { margin: 0 2px; }
.fambox .famhead span { font-size: 12px; }
.ftiles { display: flex; flex-direction: column; gap: 6px; }
.area-tile.ctile { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tn tb" "pl pl" "ts tw"; gap: 1px 8px; padding: 7px 10px; }
.ctile .tn { grid-area: tn; font-size: 13.5px; line-height: 1.25; }
.ctile .pl { grid-area: pl; font-size: 12px; line-height: 1.3; }
.ctile .tb { grid-area: tb; margin: 0; padding: 0; font-size: 15.5px; white-space: nowrap; text-align: right; }
.ctile .ts { grid-area: ts; font-size: 11px; }
.ctile .tw { grid-area: tw; margin: 0; font-size: 10px; text-align: right; align-self: end; }
@container (max-width: 760px) { .famgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 480px) { .famgrid { grid-template-columns: 1fr; } }
/* B8g (D344): the three amounts in a compact form — the areas behind each amount on one line (name €) — so the
   six family boxes fit below; each area's plain line is a tooltip, and the boxes below show every area again. */
.pot .parts.c { font-size: 12.5px; color: var(--text-2); padding-top: 7px; line-height: 1.45; }
.pot .parts.c a { color: var(--text); font-weight: 600; }
.pot .parts.c b { color: var(--text); white-space: nowrap; }
.pot .parts.c .pc { white-space: normal; }
.pot .apart { margin-top: 8px; }
.pots.three .pot h2 { font-size: 12px; }
.apart-strip { margin: 8px 0 0; padding: 6px 12px; border-radius: 8px; background: var(--risk-soft); color: var(--text-2); }
.apart-strip b { color: var(--text); }
.pots-note { margin-top: 6px; }
/* Compact tiles: one line of plain description (the full line on hover), so the 3 × 2 grid fits a laptop screen. */
.ctile .pl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fambox .famhead { flex-wrap: nowrap; overflow: hidden; }
.fambox .famhead span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pots.three .pot { padding-top: 14px; padding-bottom: 12px; }
.pots.three .pot .what { margin-bottom: 4px; }
/* B8g: Overview rows — amounts and families full width; charts beside the rail (all four beside it on a very wide screen). */
.ovgrid.ov3 { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "a a" "b b" "c r"; row-gap: 0; }
.ov3 .ov-a { grid-area: a; } .ov3 .ov-b { grid-area: b; } .ov3 .ov-c { grid-area: c; } .ov3 > .rail { grid-area: r; margin-top: 18px; }
.ov3 .ovcharts { margin-top: 18px; }
@media (min-width: 1800px) { .ovgrid.ov3 { grid-template-areas: "a r" "b r" "c r"; } .ov3 > .rail { margin-top: 0; } }
@media (max-width: 1180px) { .ovgrid.ov3 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "c" "r"; } }
.fambox { padding: 8px; gap: 6px; }
.fambox .famhead b { white-space: nowrap; }
.ftiles { gap: 5px; }
.area-tile.ctile { padding: 5px 9px; }
.famgrid { margin-top: 12px; gap: 10px; }
.ov3 .pots-note { margin: 4px 0 0; }
.bar-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; }
.bar-hint { margin: -4px 0 8px; }
/* Size × trend matrix (tools: customer segmentation, B8g) */
.mxgrid { display: grid; gap: 6px; margin-top: 8px; }
.mxcells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 600px) { .mxcells { grid-template-columns: 1fr; } }
.mxbox { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.mxbox.on { outline: 2px solid var(--accent); }
.mxh { font-size: 11px; font-weight:600; color: var(--text-2); }
.mxv { font-size: 24px; font-weight:600; } .mxv small { font-size: 12px; font-weight: 400; color: var(--text-2); }
.mxs { font-size: 12.5px; color: var(--text-2); } .mxw { font-size: 12.5px; margin-top: 4px; }
.mx-keep { background: var(--good-soft); } .mx-winback { background: var(--risk-soft); } .mx-grow { background: var(--accent-soft); } .mx-watch { background: var(--surface-2); }
.sel-note { margin: 8px 0; background: var(--accent-soft); }
.fct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fchip:not(:has(button)) { padding-right: 8px; }
/* The filter title is a button that opens the four boxes on a phone; on a wider screen it is a plain label. */
button.fr-title { border: 0; background: transparent; padding: 0; cursor: default; font: inherit; font-size: 11px; font-weight:600; color: var(--text-3); }
.fr-caret { display: none; margin-left: 6px; }
.fn-more { display: inline; } .fn-more summary { display: inline; cursor: pointer; color: var(--text); text-decoration: underline dotted; }
.fn-more[open] summary { margin-right: 6px; }
@media (max-width: 600px) {
  button.fr-title { cursor: pointer; width: auto; padding: 4px 0; font-size: 12px; color: var(--text-2); }
  .fr-caret { display: inline; }
  .filterrow:not(.open) .fbox, .filterrow:not(.open) .fr-all { display: none; }
  .filterrow.open .fr-caret { display: inline-block; transform: rotate(180deg); }
}

/* ------------------------------------------------------------------ B10: Full-data view (simulated company) */
/* The permanent banner: nobody may mistake a simulated finding for a real one (plan §6.4). Amber, never dismissible. */
.simbanner { padding: 8px 24px; font-size: 13px; color: var(--text); background: var(--signal-soft); border-bottom: 1px solid var(--signal); }
.simbanner b { color: var(--signal); }
.simbanner a { margin-left: 6px; white-space: nowrap; }
.viewbadge { cursor: pointer; }
.view-full .viewbadge { color: var(--signal); background: var(--signal-soft); }
.view-full .filterrow, .view-full .filternote { display: none !important; }
.wf-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 4px 0 14px; font-size: 13px; color: var(--text-2); }
.wf-controls select, .wf-controls input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.wf-controls .chips { display: inline-flex; gap: 6px; }
.wf-table { margin-top: 12px; }
.wf-table tr.tot td { font-weight:600; border-top: 1px solid var(--line); }
.findings { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.findings li { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; border-left: 3px solid var(--total); }
.findings li.fd-up { border-left-color: var(--good); }
.findings li.fd-risk { border-left-color: var(--risk); }
.findings li.fd-signal { border-left-color: var(--signal); }
.findings li.fd-fine { border-left-color: var(--text-3); }
@media (max-width: 700px) { .simbanner { padding: 8px 16px; } }
/* B10: the entry screen — two cards, one per view */
.entry { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 6px; }

@media (max-width: 700px) { .entry { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ B11 (D376): two demos, obvious from the first screen */
/* About: two buttons in the top bar; the cards say what you get and what is missing. */

/* App top bar and Overview: a two-way switch, the current demo highlighted. */
.viewbadge { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none !important; cursor: default; }
.vs-l { font-size: 11px; font-weight:600; color: var(--text-3); }
.vswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.vswitch a { padding: 4px 11px; font-size: 12px; font-weight:600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.vswitch a + a { border-left: 1px solid var(--line); }
.vswitch a:hover { color: var(--text); }
.vswitch a.vs-real.on { background: var(--accent-soft); color: var(--accent); }
.vswitch a.vs-full.on { background: var(--signal-soft); color: var(--signal); }
.vswitch.vs-big a { padding: 6px 14px; font-size: 13px; }
.demostrip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius);
             border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.demostrip.ds-real { border-left: 4px solid var(--accent); }
.demostrip.ds-full { border-left: 4px solid var(--signal); }
.demostrip .ds-txt { flex: 1 1 320px; min-width: 0; color: var(--text-2); }
.demostrip .ds-txt b { color: var(--text); }
.demostrip .ds-txt a { white-space: nowrap; }
@media (max-width: 520px) { .vs-l { display: none; } .vswitch a { padding: 4px 9px; } }
