/* Live demo dashboard (/demo/). Colours are roles; charts are drawn by demo.js. */
.viz-root{
  --surface:#fff;
  --plane:#f3f4fa;
  --ink:#101729;
  --ink-2:#3e4658;
  --muted:#596171;
  --grid:#e6e8f1;
  --axis:#c3c8d6;
  --border:#e1e4ee;
  --accent:#a82bb2;      /* this period / single-series marks */
  --deemph:#8a91a3;      /* comparison series */
  --ramp-1:#dc9fe2;      /* ordinal ramp, light to dark (validated) */
  --ramp-2:#c66fce;
  --ramp-3:#a82bb2;
  --ramp-4:#7d1f86;
  --ramp-5:#54145b;
  --nodata:#e9ebf2;      /* map: states outside the selected region */
  --good:#006300;
  --bad:#b42336;
  --st-good:#0ca30c;
  --st-warn:#fab219;
  --st-crit:#d03b3b;
  position:relative;
  color:var(--ink);
  font-size:15px;
  line-height:1.45;
}
.viz-root h2,.viz-root h3,.viz-root p{margin:0}

.demo-hero{padding:34px 0 64px}
.demo-hero h1{letter-spacing:-.035em;max-width:900px;margin:0 0 18px;font-size:clamp(2.1rem,4.6vw,3.6rem);line-height:1.1}
.demo-hero p{max-width:780px;margin:0;font-size:clamp(1.05rem,1.6vw,1.2rem);line-height:1.6;color:#d9dcec}

.demo-stage{background:#f3f4fa;padding:44px 0 72px}

.dash-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.dash-eyebrow{color:var(--muted);font-size:.85rem;letter-spacing:.02em;margin-bottom:4px !important}
.dash-head h2{font-size:1.7rem;font-weight:700;letter-spacing:-.02em;line-height:1.2}
.dash-asof{color:var(--muted);font-size:.85rem}

.filters{display:flex;flex-wrap:wrap;gap:14px 26px;align-items:center;margin-bottom:18px}
.filter{display:flex;align-items:center;gap:10px}
.filter-label{color:var(--muted);font-size:.85rem;font-weight:700}
.seg{display:inline-flex;background:var(--surface);border:1px solid var(--axis);border-radius:8px;padding:2px}
.seg button{background:none;border:0;border-radius:6px;padding:7px 13px;font-size:.88rem;font-weight:600;color:var(--ink-2);cursor:pointer;min-height:34px}
.seg button:hover{background:#f0f1f8}
.seg button[aria-pressed=true]{background:var(--ink);color:#fff}
#region{background:var(--surface);border:1px solid var(--axis);border-radius:8px;padding:7px 10px;min-height:40px;font-size:.88rem;font-weight:600;color:var(--ink);cursor:pointer}
#region:focus-visible{outline-offset:2px;outline:3px solid #7764e5}

.headline{background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:10px;padding:14px 18px;margin-bottom:16px !important;font-size:1.02rem;line-height:1.55;color:var(--ink-2)}
.headline strong{color:var(--ink)}

.card,.kpi{background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 1px 2px rgba(16,23,41,.04)}
.card{padding:20px 22px 22px;min-width:0}
.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.card-head h3{font-size:1.05rem;font-weight:700;line-height:1.3}
.card-sub{color:var(--muted);font-size:.85rem;margin-top:2px !important}
.src{flex:none;background:#f0f1f8;color:var(--ink-2);border-radius:999px;padding:3px 10px;font-size:.7rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}

.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:16px}
.kpi{padding:16px 18px 14px;display:flex;flex-direction:column;min-width:0}
.kpi-label{color:var(--muted);font-size:.85rem;font-weight:600}
.kpi-value{font-size:1.9rem;font-weight:700;letter-spacing:-.02em;line-height:1.2;margin-top:4px}
.kpi-delta{font-size:.82rem;color:var(--muted);margin-top:2px;min-height:1.3em}
.kpi-delta b{font-weight:700}
.kpi-delta .up{color:var(--good)}
.kpi-delta .down{color:var(--bad)}
.kpi svg{width:100%;height:30px;margin-top:10px;overflow:visible}

.grid{display:grid;gap:16px;margin-bottom:16px}
.g-2-1{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.g-1-1{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}

.legend{display:flex;flex-wrap:wrap;gap:6px 20px;font-size:.82rem;color:var(--ink-2);margin-bottom:6px}
.legend span{display:inline-flex;align-items:center;gap:7px}
.key{display:inline-block;width:16px;height:2px;border-radius:2px;background:var(--deemph)}
.key-cur{background:var(--accent)}

.trend svg{display:block;width:100%;overflow:visible;outline:none}
.trend svg:focus-visible{outline:3px solid #7764e5;outline-offset:4px;border-radius:6px}
.trend text{font-size:12px;fill:var(--muted);font-variant-numeric:tabular-nums}

.bars{display:flex;flex-direction:column;gap:14px}
.bar-row{border-radius:6px;outline:none}
.bar-row:focus-visible{outline:3px solid #7764e5;outline-offset:4px}
.bar-top{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:6px}
.bar-name{font-size:.9rem;color:var(--ink-2)}
.bar-val{font-size:.9rem;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.bar-val small{font-size:.8rem;font-weight:400;color:var(--muted);margin-left:6px}
.bar-track{height:12px;border-left:1px solid var(--axis)}
.bar-fill{height:100%;min-width:2px;background:var(--accent);border-radius:0 4px 4px 0;transition:width .25s ease}
.bar-row:hover .bar-fill,.bar-row:focus-visible .bar-fill{filter:brightness(1.18)}

.map svg{display:block;width:100%;height:auto;overflow:visible}
.map .st{stroke:var(--surface);stroke-width:1;vector-effect:non-scaling-stroke;transition:fill .2s}
.map .hl{fill:none;stroke:var(--ink);stroke-width:1.75;vector-effect:non-scaling-stroke;stroke-linejoin:round;pointer-events:none}
.map text{font-weight:700;text-anchor:middle;pointer-events:none}
.map-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:12px;font-size:.82rem;color:var(--ink-2)}
.map-legend span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.map-legend i{display:inline-block;width:12px;height:12px;border-radius:3px}
@media (prefers-reduced-motion:reduce){.map .st{transition:none}}

.ar-total{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.ar-total strong{font-size:1.6rem;letter-spacing:-.02em;line-height:1.2}
.ar-total span{color:var(--muted);font-size:.85rem}
.segbar{display:flex;gap:2px;height:8px;margin-bottom:14px}
.segbar i{display:block;height:100%;min-width:3px;outline:none}
.segbar i:first-child{border-radius:999px 0 0 999px}
.segbar i:last-child{border-radius:0 999px 999px 0}
.segbar i:hover,.segbar i:focus-visible{filter:brightness(1.18)}
.segbar i:focus-visible{outline:3px solid #7764e5;outline-offset:3px}
.ar-list{display:grid;grid-template-columns:auto 1fr auto auto;gap:9px 12px;align-items:center;font-size:.9rem}
.ar-list .sw{width:10px;height:10px;border-radius:3px}
.ar-list .nm{color:var(--ink-2)}
.ar-list .amt{font-weight:700;text-align:right;font-variant-numeric:tabular-nums}
.ar-list .shr{color:var(--muted);text-align:right;font-variant-numeric:tabular-nums;min-width:3.2em}

.tbl{margin-top:10px}
.tbl summary{cursor:pointer;color:var(--ink-2);font-size:.82rem;font-weight:600;width:fit-content;padding:4px 0}
.tbl summary:focus-visible{outline:3px solid #7764e5;outline-offset:3px;border-radius:4px}
.tbl-scroll{overflow-x:auto}
.viz-root table{width:100%;border-collapse:collapse;font-size:.9rem}
.viz-root th,.viz-root td{padding:9px 12px 9px 0;text-align:left;border-bottom:1px solid var(--grid);white-space:nowrap}
.viz-root th{color:var(--muted);font-size:.78rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase}
.viz-root tbody tr:last-child td{border-bottom:0}
.viz-root .num{text-align:right;font-variant-numeric:tabular-nums}
.viz-root .num+td:not(.num),.viz-root .num+th:not(.num){padding-left:20px}
.viz-root td.cust{font-weight:700}
.status{display:inline-flex;align-items:center;gap:8px}
.badge{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;font-size:11px;font-weight:800;line-height:1;color:#fff}
.badge.good{background:var(--st-good)}
.badge.warn{background:var(--st-warn);color:#0b0b0b}
.badge.crit{background:var(--st-crit)}

.viz-tip{position:absolute;top:0;left:0;z-index:5;pointer-events:none;background:var(--ink);color:#fff;border-radius:8px;padding:9px 12px;font-size:.82rem;line-height:1.5;box-shadow:0 8px 24px rgba(16,23,41,.22);max-width:260px;white-space:nowrap}
.viz-tip[hidden]{display:none}
.viz-tip .tt{color:#c9cee0;font-size:.76rem;margin-bottom:3px}
.viz-tip .tr{display:flex;align-items:center;gap:8px}
.viz-tip .tr b{font-weight:700}
.viz-tip .tr span{color:#c9cee0}
.viz-tip .tk{flex:none;width:12px;height:2px;border-radius:2px}

.demo-notes{padding:84px 0 96px}
.demo-notes h2{text-align:center;letter-spacing:-.03em;margin:0 0 44px;font-size:clamp(1.8rem,3.4vw,2.6rem);line-height:1.15}
.notes-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:34px}
.notes-grid h3{color:#a82bb2;text-transform:uppercase;letter-spacing:.02em;margin:0 0 12px;font-size:1.02rem;line-height:1.35;font-weight:700}
.notes-grid p{margin:0;font-size:1.02rem;line-height:1.7}

@media (max-width:980px){
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g-2-1,.g-1-1{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:680px){
  .demo-hero{padding:20px 0 48px}
  .demo-stage{padding:28px 0 52px}
  .card{padding:16px 16px 18px}
  .kpis{gap:10px}
  .kpi{padding:13px 14px 12px}
  .kpi-value{font-size:1.5rem}
  .dash-head h2{font-size:1.4rem}
  .demo-notes{padding:60px 0 68px}
  .notes-grid{grid-template-columns:1fr;gap:28px}
}
@media (prefers-reduced-motion:reduce){.bar-fill{transition:none}}

/* Reserve space for the parts demo.js draws, so the page doesn't jump when the charts appear.
   Applies only while a box is still empty; once filled, its real content sets the height.
   Heights measured from the rendered demo (desktop, tablet and phone widths). */
#asof:empty{min-height:1.45em;min-width:11.8em}
.card-sub:empty{min-height:1.45em}
#headline:empty{min-height:80px}
#kpis:empty{min-height:152px}
#trend:empty{min-height:264px}
#cats:empty{min-height:303px}
#map:empty{aspect-ratio:960/612}
#map-legend:empty{min-height:19px}
#states:empty{min-height:409px}
#funnel:empty{min-height:198px}
#ar-total:empty{min-height:31px}
#ar-list:empty{min-height:140px}
#customers:empty{min-height:355px}
/* Text wraps onto more lines as the screen narrows; values measured at 320-1440px widths. */
@media (max-width:1080px){#kpis:empty{min-height:171px}}
@media (max-width:980px){#kpis:empty{min-height:321px}}
@media (max-width:750px){#headline:empty{min-height:105px}}
@media (max-width:690px){#kpis:empty{min-height:289px}}
@media (max-width:680px){#map-legend:empty{min-height:44px}}
@media (max-width:550px){#headline:empty{min-height:130px}}
@media (max-width:540px){#kpis:empty{min-height:308px}}
@media (max-width:510px){#kpis:empty{min-height:327px}}
@media (max-width:430px){#map-sub:empty{min-height:39px}}
@media (max-width:400px){#headline:empty{min-height:155px}#ar-sub:empty{min-height:39px}#map-legend:empty{min-height:69px}}
@media (max-width:370px){#headline:empty{min-height:181px}#ar-total:empty{min-height:60px}}
@media (max-width:330px){
  #kpis:empty{min-height:346px}
  #trend-sub:empty{min-height:39px}
  #ar-list:empty{min-height:161px}
}
