/* ============================================================
   Fluxa Stats — dashboard (direction C · Mixed-media)
   Tokens locked to taste-landing v4 (commit dd22952).
   Base styles are lifted verbatim from the approved mockup
   (design/taste-dashboard/index.html); the funnel / loading /
   error blocks at the foot are new for the wired build.
   ============================================================ */
:root {
  --canvas: #ffffff; --band: #f6f5f2; --ink: #121316; --muted: #555a63; --faint: #8a8f98; --hairline: #e8e7e3;
  --blue: #0A66FF; --blue-soft: rgba(10,102,255,.22); --blue-wash: rgba(10,102,255,.08);
  --up: #15803d; --down: #b91c1c;
  --pink-a: #f7c5c5; --pink-b: #fde4e4; --green-a: #8fe0a6; --green-b: #d3f4dd;
  --lilac-a: #cdb9f4; --lilac-b: #eae1fb; --skyc-a: #bcd7f7; --skyc-b: #e4effc; --yellow: #f4c84e;
  --shadow: 0 1px 2px rgba(18,19,22,.05), 0 18px 36px -12px rgba(18,19,22,.14);
  --shadow-w: 0 1px 2px rgba(18,19,22,.06), 0 12px 28px -10px rgba(18,19,22,.18);
  --r-card: 18px; --r-widget: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--band); color: var(--ink); line-height: 1.5; font-size: 16px; }
.mono { font-family: 'Space Mono', monospace; }
.label { font-family: 'Space Mono', monospace; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.app { max-width: 1180px; margin: 0 auto; padding: 0 28px 80px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 16px 0 14px; background: var(--band); border-bottom: 1px solid var(--hairline); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; white-space: nowrap; flex: none; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--blue), #4f8bff); display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 700; }
.site-pick { display: flex; align-items: center; gap: 8px; margin-left: 6px; min-width: 0; padding: 7px 13px; border: 1px solid var(--hairline); border-radius: 999px; background: var(--canvas); font-size: .85rem; font-weight: 500; cursor: pointer; }
.site-pick .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-pick .fav { width: 15px; height: 15px; border-radius: 4px; background: var(--green-a); flex: none; }
.site-pick .car { flex: none; color: var(--faint); font-size: .7rem; }
.topbar .spacer { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--hairline); font-family: 'Space Mono', monospace; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(21,128,61,.45); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(21,128,61,.45)} 70%{box-shadow:0 0 0 7px rgba(21,128,61,0)} 100%{box-shadow:0 0 0 0 rgba(21,128,61,0)} }
.range { display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; padding: 8px 15px; border-radius: 999px; background: var(--ink); color: #fff; font-family: 'Space Mono', monospace; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; border: none; }
.range .car { opacity: .6; }

/* page head */
.page-head { padding: 26px 0 6px; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: .95rem; }

/* candy card wrapper */
.candy { border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); }
.candy.pink { background: linear-gradient(135deg, var(--pink-a), var(--pink-b)); }
.candy.green { background: linear-gradient(135deg, var(--green-a), var(--green-b)); }
.candy.lilac { background: linear-gradient(135deg, var(--lilac-a), var(--lilac-b)); }
.candy.sky { background: linear-gradient(135deg, var(--skyc-a), var(--skyc-b)); }
.candy.ink { background: linear-gradient(135deg, #2a2d34, #16171b); }
.candy > .w { background: var(--canvas); border-radius: var(--r-widget); padding: 18px 18px 16px; box-shadow: var(--shadow-w); height: 100%; }
.w-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.w-head .wt { font-size: .92rem; font-weight: 600; }
.w-head .wsub { font-family: 'Space Mono', monospace; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.card { background: var(--canvas); border-radius: var(--r-card); border: 1px solid var(--hairline); box-shadow: var(--shadow); padding: 20px 22px; }

/* insight */
.insight-inner > .label { margin-bottom: 16px; }
.lines { display: grid; gap: 13px; }
.insight-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 26px; }
.line { display: flex; align-items: flex-start; gap: 13px; }
.line .ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; margin-top: 1px; }
.line .ic svg { width: 17px; height: 17px; }
.ic.good { background: var(--green-b); color: var(--up); }
.ic.flat { background: var(--skyc-b); color: var(--blue); }
.ic.warn { background: var(--pink-b); color: var(--down); }
.line .tx { font-size: 1.02rem; line-height: 1.45; letter-spacing: -.005em; }
.line .tx b { font-weight: 700; }
.line .tx .em-up { color: var(--up); font-weight: 700; }
.line .tx .em-dn { color: var(--down); font-weight: 700; }
.insight-foot { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill-link { font-size: .82rem; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pill-link svg { width: 14px; height: 14px; }

/* KPI + sparkline */
.kpi { background: var(--canvas); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--hairline); }
.kpi .k { font-family: 'Space Mono', monospace; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.kpi .v { font-size: 1.95rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 7px; }
.kpi .d { font-size: .78rem; font-weight: 700; margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .d.up { color: var(--up); } .kpi .d.down { color: var(--down); }
.kpi .d .since { color: var(--faint); font-weight: 400; }
.kpi .spark { width: 100%; height: 30px; display: block; margin-top: 10px; }

/* main chart */
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.chart-head .t { font-size: 1rem; font-weight: 600; }
.chart-head .big { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
.chart-head .big span { font-size: .82rem; color: var(--faint); font-weight: 400; margin-left: 6px; }
.chart30 { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart30 .grid { stroke: var(--hairline); stroke-width: 1; }
.chart30 .axis { font-family: 'Space Mono', monospace; font-size: 10px; fill: var(--faint); letter-spacing: .04em; }
.chart30 .dot { stroke: var(--canvas); stroke-width: 2; }

/* chart hover tooltip (guide line + dot + floating value) */
.chart-plot { position: relative; }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--blue-soft); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.chart-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); border: 2px solid var(--canvas); box-shadow: 0 0 0 1px var(--blue-soft); transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.chart-tip { position: absolute; background: var(--ink); color: #fff; border-radius: 9px; padding: 7px 11px; font-size: .74rem; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s ease; box-shadow: 0 8px 22px -8px rgba(18,19,22,.45); z-index: 6; }
.chart-tip .tip-v { font-family: 'Space Mono', monospace; font-weight: 700; }
.chart-tip .tip-l { color: rgba(255,255,255,.6); }
.chart-tip .tip-d { display: block; color: rgba(255,255,255,.6); font-family: 'Space Mono', monospace; font-size: .62rem; letter-spacing: .04em; margin-top: 2px; }
.chart-plot.is-hover .chart-cursor, .chart-plot.is-hover .chart-dot, .chart-plot.is-hover .chart-tip { opacity: 1; }

/* ranked list */
.rows { display: grid; gap: 11px; }
.prow { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.prow .nm { font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.prow .nm .ico { width: 16px; height: 16px; border-radius: 4px; flex: none; display: grid; place-items: center; font-size: 9px; }
.prow .nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .val { font-family: 'Space Mono', monospace; font-size: .82rem; font-weight: 700; }
.prow .barwrap { grid-column: 1 / -1; }
.pbar { height: 5px; border-radius: 3px; background: var(--hairline); }
.pbar > i { display: block; height: 100%; border-radius: 3px; background: var(--blue-soft); }
.prow:first-of-type .pbar > i { background: var(--blue); }
.flag { font-size: 1rem; line-height: 1; }

.callout { margin-top: 13px; font-size: .9rem; color: var(--muted); }
.callout b { color: var(--ink); font-weight: 700; }

/* legend (donut) */
.legend { display: grid; gap: 9px; }
.leg { display: flex; align-items: center; justify-content: space-between; font-size: .88rem; }
.leg .lk { display: inline-flex; align-items: center; gap: 8px; }
.leg .sw { width: 10px; height: 10px; border-radius: 3px; }
.leg .lv { font-family: 'Space Mono', monospace; font-weight: 700; font-size: .82rem; }

/* donut */
.donut-center { position: relative; }
.donut { transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 18; }
.donut .track { stroke: var(--hairline); }
.donut-center .dc { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center .dc .pct { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.donut-center .dc .lbl { font-family: 'Space Mono', monospace; font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }

/* day x hour heatmap */
.heat { display: grid; grid-template-columns: 26px 1fr; gap: 6px 8px; align-items: center; }
.heat .dlabel { font-family: 'Space Mono', monospace; font-size: .58rem; color: var(--faint); text-transform: uppercase; }
.heat .hrow { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.heat .hc { aspect-ratio: 1; border-radius: 2px; background: var(--blue); }
.heat-x { display: flex; justify-content: space-between; margin: 8px 0 0 34px; }
.heat-x span { font-family: 'Space Mono', monospace; font-size: .56rem; color: var(--faint); }

/* stylised UK map (intentional diagram, not geographic truth) */
.ukmap { display: block; width: 100%; max-width: 158px; margin: 2px auto 6px; }
.ukmap .land { fill: var(--blue-wash); stroke: var(--blue-soft); stroke-width: 1; stroke-linejoin: round; }
.ukmap .pin { fill: var(--blue); stroke: var(--canvas); stroke-width: 2; }
.ukmap .pin.sm { fill: var(--blue-soft); stroke: var(--canvas); stroke-width: 1.5; }
.ukmap .pin.faint { fill: var(--blue-soft); stroke: none; opacity: .55; }
.ukmap .plabel { font-family: 'Space Mono', monospace; font-size: 8px; font-weight: 700; fill: var(--ink); }
.map-list { margin-top: 4px; }

/* featured big stat (dark) */
.feature { display: flex; flex-direction: column; height: 100%; }
.feature .fbig { font-size: clamp(2.6rem, 6vw, 3.4rem); font-weight: 600; letter-spacing: -.03em; line-height: .95; }
.feature .fsub { font-size: .88rem; color: var(--muted); margin-top: 8px; max-width: 24ch; }
.feature .fspace { flex: 1; min-height: 14px; }
.candy.ink .w { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); box-shadow: none; color: #fff; }
.candy.ink .fsub { color: rgba(255,255,255,.62); }
.candy.ink .w-head .wsub { color: rgba(255,255,255,.45); }
.candy.ink .w-head .wt { color: #fff; }
.candy.ink .goal-chip { border-color: rgba(255,255,255,.18); color: #7fe0a0; }
.goal-list { display: grid; gap: 10px; }
.goal-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .88rem; }
.goal-item .gv { font-family: 'Space Mono', monospace; font-weight: 700; }
.goal-chip { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-family: 'Space Mono', monospace; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 13px; color: var(--up); }
.goal-chip svg { width: 13px; height: 13px; }

.footnote { margin-top: 30px; text-align: center; }
.footnote .label { letter-spacing: .14em; }

/* category accent dots */
:root { --dot-pink:#cf645f; --dot-green:#3f9e6a; --dot-lilac:#7b68c9; --dot-sky:#2f74e0; }

/* MUTED — desaturated tints */
.pal-muted .candy.pink  { background:#efe6e3; }
.pal-muted .candy.green { background:#e5ece7; }
.pal-muted .candy.lilac { background:#e9e7f0; }
.pal-muted .candy.sky   { background:#e6ebf1; }

/* NEUTRAL (default) — white cards, colour reduced to a small category dot */
.pal-neutral .candy:not(.ink) { background:var(--canvas); border:1px solid var(--hairline); padding:0; box-shadow:var(--shadow); }
.pal-neutral .candy:not(.ink) > .w { box-shadow:none; border-radius:var(--r-card); }

/* SLATE — cool uniform surface + dot */
.pal-slate .candy:not(.ink) { background:#e9edf2; border:1px solid #e0e5ec; }

/* category dots for neutral + slate */
.pal-neutral .w-head .wt::before,
.pal-slate   .w-head .wt::before { content:""; display:inline-block; width:7px; height:7px; border-radius:2px; margin-right:8px; vertical-align:middle; }
.pal-neutral .candy.pink  .w-head .wt::before, .pal-slate .candy.pink  .w-head .wt::before { background:var(--dot-pink); }
.pal-neutral .candy.green .w-head .wt::before, .pal-slate .candy.green .w-head .wt::before { background:var(--dot-green); }
.pal-neutral .candy.lilac .w-head .wt::before, .pal-slate .candy.lilac .w-head .wt::before { background:var(--dot-lilac); }
.pal-neutral .candy.sky   .w-head .wt::before, .pal-slate .candy.sky   .w-head .wt::before { background:var(--dot-sky); }

/* CLICK-TO-EXPAND TILES */
.explain-tip { display:inline-flex; align-items:center; gap:7px; margin-top:10px !important; font-size:.82rem; color:var(--faint); }
.explain-tip .ico { display:inline-grid; place-items:center; width:16px; height:16px; border-radius:50%; background:var(--ink); color:#fff; font-weight:700; font-size:.7rem; }

.tile { cursor: pointer; user-select: none; transition: transform .18s ease, box-shadow .18s ease; }
.tile:hover { transform: translateY(-2px); }
.kpi.tile:hover, .card.tile:hover { box-shadow: 0 6px 22px -8px rgba(18,19,22,.22); }
.candy.tile:hover { box-shadow: 0 8px 26px -10px rgba(18,19,22,.26); }
.tile.is-open { grid-column: 1 / -1; transform: none; }

/* Panel reveal uses grid-template-rows 0fr->1fr so it animates to the content's
   true height (no max-height guess, no clipping, no off-paced easing). */
.explain { display: grid; grid-template-rows: 0fr; opacity: 0; overflow: hidden; max-width: 720px; transition: grid-template-rows .42s cubic-bezier(.22,.61,.36,1), opacity .26s ease, margin .42s cubic-bezier(.22,.61,.36,1), padding .42s cubic-bezier(.22,.61,.36,1); }
.explain > .explain-inner { min-height: 0; overflow: hidden; }
.is-open .explain { grid-template-rows: 1fr; opacity: 1; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.explain .xl { font-family: 'Space Mono', monospace; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.explain p { font-size: .92rem; color: var(--muted); line-height: 1.55; }
.explain p + p { margin-top: 8px; }
.explain p + .xl { margin-top: 15px; }
.explain b { color: var(--ink); font-weight: 600; }
.explain .close-hint { margin-top: 12px; font-family: 'Space Mono', monospace; font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.candy.ink .explain { border-top-color: rgba(255,255,255,.14); }
.candy.ink .explain p { color: rgba(255,255,255,.72); }
.candy.ink .explain b { color: #fff; }
.candy.ink .explain .xl, .candy.ink .explain .close-hint { color: rgba(255,255,255,.45); }

/* layout: mixed-media rows */
.c-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.c-row { display: grid; gap: 16px; margin-top: 16px; }
.c-row.r-83 { grid-template-columns: 8fr 4fr; }
.c-row.r-444 { grid-template-columns: repeat(3, 1fr); }
.c-chart .card, .c-row > * { height: 100%; }

@media (max-width: 940px) {
  .c-row.r-83, .c-row.r-444 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) { .app { padding: 0 16px 60px; } .live { display: none; } }
@media (max-width: 620px) {
  .c-kpis { grid-template-columns: 1fr 1fr; }
  .c-row.r-83, .c-row.r-444 { grid-template-columns: 1fr; }
  .insight-2col { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar { gap: 10px; }
  .brand .name { display: none; }
  .site-pick { max-width: 160px; }
  .range { padding: 8px 12px; }
}

/* ============================================================
   NEW FOR THE WIRED BUILD — funnel, loading, error states
   ============================================================ */

/* conversion funnel (computed from goals, since CE has no funnel API) */
.funnel-wrap { display: grid; gap: 16px; }
.fstage .ftop { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fstage .flabel { font-size: .92rem; font-weight: 600; }
.fstage .fright { display: inline-flex; align-items: baseline; gap: 8px; }
.fstage .fval { font-family: 'Space Mono', monospace; font-weight: 700; font-size: .92rem; }
.fstage .fpct { font-family: 'Space Mono', monospace; font-size: .66rem; color: var(--faint); letter-spacing: .04em; }
.fbar { height: 30px; border-radius: 9px; background: var(--blue-wash); overflow: hidden; }
.fbar > i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--blue), #4f8bff); min-width: 3px; transition: width .5s ease; }
.fdrop { font-family: 'Space Mono', monospace; font-size: .58rem; letter-spacing: .07em; text-transform: uppercase; color: var(--down); margin-top: 7px; padding-left: 2px; }
.funnel-empty { padding: 8px 2px; color: var(--muted); font-size: .92rem; }
.funnel-overall { font-family: 'Space Mono', monospace; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--up); border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 13px; display: inline-flex; }

/* loading + error */
.is-loading { opacity: .55; transition: opacity .2s ease; }
.error-banner { margin-top: 18px; background: var(--pink-b); border: 1px solid var(--pink-a); color: #7a1f1f; padding: 14px 16px; border-radius: 12px; font-size: .92rem; }
.error-banner b { font-weight: 700; }
.error-banner code { font-family: 'Space Mono', monospace; font-size: .82rem; background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; }
.skeleton { color: var(--faint); font-size: .9rem; padding: 30px 2px; }

/* ============================================================
   TILE DETAIL OVERLAY (premium modal)
   Clicking a tile lifts it into a centred card over a dimmed,
   blurred backdrop. Click the backdrop, the × button, or press
   Esc to return to the dashboard. Lives inside #app so it inherits
   the active palette (the clone matches the dashboard's look).
   ============================================================ */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 28px; }
.overlay[hidden] { display: none; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(12,14,18,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .28s ease; }
.overlay.is-open .overlay-backdrop { opacity: 1; }
.overlay-card { position: relative; z-index: 1; width: min(560px, 100%); overflow: visible; transform: scale(.96); opacity: 0; transition: transform .32s cubic-bezier(.22,.61,.36,1), opacity .24s ease; }
.overlay.is-open .overlay-card { transform: scale(1); opacity: 1; }
.overlay-body { max-height: calc(100vh - 56px); overflow: auto; border-radius: var(--r-card); }
.overlay-body .clone { cursor: default; }
.overlay-body .clone:hover { transform: none; }
.overlay-close { position: absolute; top: -14px; right: -14px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .15s ease, background .15s ease; }
.overlay-close:hover { transform: scale(1.07); background: var(--band); }
.overlay-close:active { transform: scale(.96); }
/* the explanation is always shown inside the overlay */
.overlay .explain { grid-template-rows: 1fr; opacity: 1; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }

@media (prefers-reduced-motion: reduce) {
  .overlay-backdrop, .overlay-card { transition: none; }
  .overlay-card { transform: none; }
}

/* ============================================================
   DARK MODE — toggled via the topbar switch (saved to
   localStorage; honours prefers-color-scheme on first visit).
   Mostly re-defines the tokens; a few controls hard-code
   ink/white and get explicit overrides. Grounded in dark
   analytics references (Mocha, Runey): very dark canvas,
   slightly-raised card surfaces, one bright accent, hairline
   borders for elevation.
   ============================================================ */
:root[data-theme="dark"] {
  --canvas: #181b21; --band: #0f1115; --ink: #eceef1; --muted: #a2a8b3; --faint: #6b7280; --hairline: #2a2f37;
  --blue: #5b8cff; --blue-soft: rgba(91,140,255,.34); --blue-wash: rgba(91,140,255,.13);
  --up: #4ade80; --down: #f87171;
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 18px 40px -14px rgba(0,0,0,.6);
  --shadow-w: 0 1px 2px rgba(0,0,0,.45), 0 14px 30px -12px rgba(0,0,0,.6);
  --dot-pink:#e07a74; --dot-green:#54c08a; --dot-lilac:#9b86e0; --dot-sky:#5b9bf0;
}
body { transition: background-color .25s ease, color .25s ease; }
[data-theme="dark"] .range { background: #272d36; color: var(--ink); border: 1px solid var(--hairline); }
[data-theme="dark"] .range .car { opacity: .55; }
[data-theme="dark"] .chart-tip { background: #232a34; border: 1px solid var(--hairline); }
[data-theme="dark"] .explain-tip .ico { background: var(--blue); color: #fff; }
[data-theme="dark"] .candy.ink { border: 1px solid var(--hairline); }
[data-theme="dark"] .ic.good { background: rgba(74,222,128,.16); }
[data-theme="dark"] .ic.flat { background: rgba(91,140,255,.16); }
[data-theme="dark"] .ic.warn { background: rgba(248,113,113,.16); }

/* theme toggle switch */
.theme-toggle { flex: none; width: 50px; height: 28px; padding: 0; border-radius: 999px; border: 1px solid var(--hairline); background: var(--canvas); position: relative; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.theme-toggle .tt-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; transition: transform .26s cubic-bezier(.22,.61,.36,1), background .2s ease; }
.theme-toggle .tt-knob svg { width: 13px; height: 13px; color: var(--canvas); }
.theme-toggle .tt-knob .moon { display: none; }
[data-theme="dark"] .theme-toggle .tt-knob { transform: translateX(22px); }
[data-theme="dark"] .theme-toggle .tt-knob .sun { display: none; }
[data-theme="dark"] .theme-toggle .tt-knob .moon { display: block; }
@media (max-width: 520px) { .theme-toggle { width: 46px; } [data-theme="dark"] .theme-toggle .tt-knob { transform: translateX(18px); } }
