@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f4efe6;
  --surface: #fffcf7;
  --surface-2: #f2ebdf;
  --ink: #1f1a14;
  --ink-2: #5b5247;
  --muted: #8f8578;
  --grid: #ece4d7;
  --axis: #d8cdbc;
  --border: rgba(60, 40, 20, 0.10);
  --flame: #e4570f;
  --flame-2: #f2a466;
  --cold: #2563c9;
  --s3: #138a68;
  --good: #1a7f37;
  --bad: #c9372c;
  --accent: #e4570f;
  --shadow: 0 1px 0 rgba(60, 40, 20, 0.04), 0 8px 24px -12px rgba(60, 40, 20, 0.18);
  --radius: 18px;
  --brand-grad: radial-gradient(circle at 50% 110%, #ffb057, #e4570f 55%, #9c2a0b);
  --brand-shadow: rgba(228, 87, 15, 0.7);
  --tab-grad: linear-gradient(90deg, #ffb057, var(--flame));
  --display: "Bricolage", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f1117;
    --surface: #171a22;
    --surface-2: #20242f;
    --ink: #f2ede4;
    --ink-2: #bdb5a8;
    --muted: #857e74;
    --grid: #242936;
    --axis: #353b4b;
    --border: rgba(255, 255, 255, 0.08);
    --flame: #ff7a33;
    --flame-2: #b8724c;
    --cold: #6aa1ff;
    --s3: #2bb38a;
    --good: #3fb760;
    --bad: #f0645a;
    --accent: #ff7a33;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1117;
  --surface: #171a22;
  --surface-2: #20242f;
  --ink: #f2ede4;
  --ink-2: #bdb5a8;
  --muted: #857e74;
  --grid: #242936;
  --axis: #353b4b;
  --border: rgba(255, 255, 255, 0.08);
  --flame: #ff7a33;
  --flame-2: #b8724c;
  --cold: #6aa1ff;
  --s3: #2bb38a;
  --good: #3fb760;
  --bad: #f0645a;
  --accent: #ff7a33;
  --shadow: none;
}

/* ================= extra thema's (data-palette op <html>) ================= */
/* ---- thema: amber ---- */
:root[data-palette="amber"] {
  color-scheme: light;
  --page: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #eeede8;
  --ink: #18160f;
  --ink-2: #55524a;
  --muted: #8c897f;
  --grid: #ebe9e3;
  --axis: #d3d0c6;
  --border: rgba(24, 22, 15, 0.09);
  --flame: #cf8a00;
  --flame-2: #efd08a;
  --cold: #3446c4;
  --s3: #0f766e;
  --good: #15803d;
  --bad: #dc2626;
  --accent: #cf8a00;
  --shadow: 0 1px 0 rgba(24, 22, 15, 0.04), 0 8px 24px -12px rgba(24, 22, 15, 0.18);
  --brand-grad: radial-gradient(circle at 50% 110%, #ffe08a, #e09b00 55%, #6b4300);
  --brand-shadow: rgba(207, 138, 0, 0.55);
  --tab-grad: linear-gradient(90deg, #ffd25e, var(--flame));
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="amber"]:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e0d0b;
    --surface: #171612;
    --surface-2: #211f1a;
    --ink: #f3efe6;
    --ink-2: #bbb5a7;
    --muted: #827d71;
    --grid: #26241e;
    --axis: #38352d;
    --border: rgba(255, 255, 255, 0.08);
    --flame: #f2b431;
    --flame-2: #7d6326;
    --cold: #8d9bff;
    --s3: #2dd4bf;
    --good: #3fb760;
    --bad: #f0645a;
    --accent: #f2b431;
    --shadow: none;
  }
}
:root[data-palette="amber"][data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0d0b;
  --surface: #171612;
  --surface-2: #211f1a;
  --ink: #f3efe6;
  --ink-2: #bbb5a7;
  --muted: #827d71;
  --grid: #26241e;
  --axis: #38352d;
  --border: rgba(255, 255, 255, 0.08);
  --flame: #f2b431;
  --flame-2: #7d6326;
  --cold: #8d9bff;
  --s3: #2dd4bf;
  --good: #3fb760;
  --bad: #f0645a;
  --accent: #f2b431;
  --shadow: none;
}
/* ---- thema: bordeaux ---- */
:root[data-palette="bordeaux"] {
  color-scheme: light;
  --page: #f7f4f4;
  --surface: #fffdfd;
  --surface-2: #efe9ea;
  --ink: #1d1215;
  --ink-2: #5a4b4f;
  --muted: #93858a;
  --grid: #ede5e7;
  --axis: #d7cacd;
  --border: rgba(29, 18, 21, 0.09);
  --flame: #9b1d42;
  --flame-2: #e4a6b8;
  --cold: #0e7490;
  --s3: #b7791f;
  --good: #15803d;
  --bad: #dc2626;
  --accent: #9b1d42;
  --shadow: 0 1px 0 rgba(29, 18, 21, 0.04), 0 8px 24px -12px rgba(29, 18, 21, 0.2);
  --brand-grad: radial-gradient(circle at 50% 110%, #ff8fae, #b0204b 55%, #4a0a1e);
  --brand-shadow: rgba(155, 29, 66, 0.55);
  --tab-grad: linear-gradient(90deg, #f0577f, var(--flame));
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="bordeaux"]:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #100b0c;
    --surface: #191113;
    --surface-2: #23191c;
    --ink: #f5ecee;
    --ink-2: #c0afb4;
    --muted: #8a787d;
    --grid: #2a1f22;
    --axis: #3c2d31;
    --border: rgba(255, 255, 255, 0.08);
    --flame: #f0577f;
    --flame-2: #7c3a4e;
    --cold: #38bdf8;
    --s3: #fbbf24;
    --good: #3fb760;
    --bad: #ff6b5e;
    --accent: #f0577f;
    --shadow: none;
  }
}
:root[data-palette="bordeaux"][data-theme="dark"] {
  color-scheme: dark;
  --page: #100b0c;
  --surface: #191113;
  --surface-2: #23191c;
  --ink: #f5ecee;
  --ink-2: #c0afb4;
  --muted: #8a787d;
  --grid: #2a1f22;
  --axis: #3c2d31;
  --border: rgba(255, 255, 255, 0.08);
  --flame: #f0577f;
  --flame-2: #7c3a4e;
  --cold: #38bdf8;
  --s3: #fbbf24;
  --good: #3fb760;
  --bad: #ff6b5e;
  --accent: #f0577f;
  --shadow: none;
}
/* ---- thema: haard ---- */
:root[data-palette="haard"] {
  color-scheme: light;
  --page: #f1f1ef;
  --surface: #fcfcfb;
  --surface-2: #e8e8e5;
  --ink: #161515;
  --ink-2: #4f4c4a;
  --muted: #8a8683;
  --grid: #e6e5e2;
  --axis: #cdcbc7;
  --border: rgba(22, 21, 21, 0.09);
  --flame: #d42a1f;
  --flame-2: #efbb45;
  --cold: #3466b0;
  --s3: #15803d;
  --good: #15803d;
  --bad: #b91c1c;
  --accent: #d42a1f;
  --shadow: 0 1px 0 rgba(22, 21, 21, 0.04), 0 8px 24px -12px rgba(22, 21, 21, 0.2);
  --brand-grad: radial-gradient(circle at 50% 110%, #ffd166, #e63323 50%, #5c0d07);
  --brand-shadow: rgba(212, 42, 31, 0.55);
  --tab-grad: linear-gradient(90deg, #efbb45, var(--flame));
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="haard"]:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0c0c;
    --surface: #161414;
    --surface-2: #201d1c;
    --ink: #f2efed;
    --ink-2: #b8b2ae;
    --muted: #827c78;
    --grid: #252220;
    --axis: #36322f;
    --border: rgba(255, 255, 255, 0.08);
    --flame: #ff5b4a;
    --flame-2: #a87c22;
    --cold: #7aa7ff;
    --s3: #4ade80;
    --good: #3fb760;
    --bad: #ff7a6b;
    --accent: #ff5b4a;
    --shadow: none;
  }
}
:root[data-palette="haard"][data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0c0c;
  --surface: #161414;
  --surface-2: #201d1c;
  --ink: #f2efed;
  --ink-2: #b8b2ae;
  --muted: #827c78;
  --grid: #252220;
  --axis: #36322f;
  --border: rgba(255, 255, 255, 0.08);
  --flame: #ff5b4a;
  --flame-2: #a87c22;
  --cold: #7aa7ff;
  --s3: #4ade80;
  --good: #3fb760;
  --bad: #ff7a6b;
  --accent: #ff5b4a;
  --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.12rem; }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.2rem; white-space: nowrap; letter-spacing: -0.02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-grad);
  box-shadow: 0 4px 14px -4px var(--brand-shadow);
}
.brand-mark svg { width: 18px; height: 18px; fill: #fff; }
.brand span b { color: var(--flame); font-weight: 700; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; padding: 8px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap; font-weight: 550; font-size: 0.93rem;
}
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a.on { color: var(--ink); }
.tabs a.on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 3px; border-radius: 3px;
  background: var(--tab-grad);
}

.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 28px 56px; }
.page { display: none; flex-direction: column; gap: 18px; }
.page.on { display: flex; animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.card-head > div:first-child { flex: 1 1 300px; min-width: 0; }
.card-head p { margin: 3px 0 0; }

.chart { width: 100%; height: 320px; }
.chart.short { height: 260px; }
.chart.tall { height: 380px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- hero (thermostaat) ---------- */
/* Licht blok in de kleur van de pagina; alleen een zachte gloed in de themakleur. */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; color: var(--ink);
  padding: 26px 30px 22px;
  background:
    radial-gradient(90% 110% at 100% 120%, color-mix(in srgb, var(--flame) 13%, transparent), transparent 62%),
    radial-gradient(55% 70% at 0% -20%, color-mix(in srgb, var(--flame-2) 14%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--flame) 14%, var(--border));
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(240px, 0.9fr) 1.4fr; gap: 10px 28px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(90deg, #000, transparent 55%);
}
.hero > * { position: relative; }
.hero-label { font-size: 0.9rem; color: var(--ink-2); font-weight: 550; display: flex; gap: 8px; align-items: center; }
.hero-num { font-family: var(--display); font-size: 5.4rem; line-height: 0.95; font-weight: 700; letter-spacing: -0.04em; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.hero-unit { font-size: 1rem; color: var(--ink-2); }
.hero-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  background: color-mix(in srgb, currentColor 9%, transparent); border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.hero-pill svg { width: 14px; height: 14px; }
.hero-pill.good { color: var(--good); }
.hero-pill.bad { color: var(--bad); }
.hero-spark { min-height: 170px; display: flex; flex-direction: column; }
.hero-spark .chart { height: 170px; }
.hero-spark-label { font-size: 0.78rem; color: var(--muted); }
.hero-strip {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--grid); margin-top: 8px; padding-top: 14px;
}
.hero-strip > div { padding: 0 16px; border-left: 1px solid var(--grid); }
.hero-strip > div:first-child { padding-left: 0; border-left: 0; }
.hero-strip .k { font-size: 0.78rem; color: var(--muted); }
.hero-strip .v { font-family: var(--display); font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.hero-strip .v small { font-family: var(--font); font-size: 0.78rem; font-weight: 500; color: var(--ink-2); margin-left: 4px; }

/* ---------- kleine kaarten ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 14px 16px; }
.kpi-ico {
  grid-row: span 3; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--flame) 12%, transparent); color: var(--flame);
}
.kpi-ico.cold { background: color-mix(in srgb, var(--cold) 13%, transparent); color: var(--cold); }
.kpi-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi-label { color: var(--ink-2); font-size: 0.8rem; font-weight: 550; }
.kpi-value { font-family: var(--display); font-size: 1.55rem; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value .u { font-family: var(--font); font-size: 0.8rem; color: var(--ink-2); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.kpi-sub { color: var(--muted); font-size: 0.78rem; }

.delta { font-weight: 650; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }

/* ---------- jaaroverzicht ---------- */
.statstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.statstrip > div { padding: 4px 18px; border-left: 1px solid var(--grid); }
.statstrip > div:first-child { border-left: 0; padding-left: 0; }
.statstrip .k { font-size: 0.8rem; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.statstrip .v { font-family: var(--display); font-size: 1.6rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.statstrip .v .u { font-family: var(--font); font-size: 0.8rem; color: var(--ink-2); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.statstrip .s { font-size: 0.78rem; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.yearbar { display: flex; flex-wrap: wrap; gap: 6px; }

.logbook { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.logbook li { display: flex; gap: 12px; align-items: baseline; }
.logbook .d { font-size: 0.82rem; color: var(--muted); min-width: 92px; font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 12px; border-radius: 9px; font: inherit; font-size: 0.84rem; font-weight: 550; cursor: pointer;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--border); }
.dates { display: flex; align-items: center; gap: 6px; }

.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 0.84rem; font-weight: 550; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--ink); border-color: var(--axis); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--axis); }
.chip.on { color: var(--ink); border-color: var(--ink-2); }
.chip.solid.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }

input, select {
  font: inherit; font-size: 0.9rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

.btn {
  font: inherit; font-weight: 650; font-size: 0.9rem; cursor: pointer;
  border: 0; border-radius: 12px; padding: 9px 16px; background: var(--ink); color: var(--page);
}
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: default; }
.link-btn { border: 0; background: none; color: var(--flame); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 4px; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--ink-2); font-weight: 550; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500; }
.form label.check.end { align-self: end; padding-bottom: 9px; }
.form > p { margin: -4px 0 0; }
.form > .btn { align-self: flex-start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inline-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.inline-form .btn { align-self: flex-start; }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 0.84rem; color: var(--ink-2); }
.note b { color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); }
.list li .t { font-weight: 600; }
.list li .d { color: var(--ink-2); font-size: 0.85rem; }
.list .del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.list .del:hover { color: var(--bad); background: var(--surface); }
.list .empty { background: none; color: var(--muted); padding: 0; }

.tag { font-size: 0.7rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-left: 6px; }

/* ---------- tabellen ---------- */
.table-wrap { overflow-x: auto; margin-top: 12px; }
.table-wrap.scroll { max-height: 440px; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-2); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
tbody tr:hover { background: var(--surface-2); }

/* ---------- thema-keuze ---------- */
.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-opt {
  display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 14px; padding: 10px; background: var(--surface); color: var(--ink); font: inherit;
}
.theme-opt:hover { border-color: var(--axis); }
.theme-opt.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-prev { width: 100%; height: 54px; border-radius: 10px; position: relative; overflow: hidden; display: flex; align-items: flex-end; gap: 4px; padding: 8px; }
.theme-prev i { display: block; width: 10px; border-radius: 3px 3px 0 0; }
.theme-name { width: 100%; font-weight: 650; font-size: 0.88rem; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.form > .seg { align-self: flex-start; }
.theme-name span { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.hint { font-size: 0.78rem; color: var(--muted); font-weight: 400; line-height: 1.4; }

/* ---------- overlay / toast ---------- */
.overlay { position: fixed; inset: 0; background: var(--page); display: grid; place-items: center; z-index: 50; padding: 16px; }
.login { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--ink-2); }
.error { color: var(--bad); min-height: 1em; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px;
  font-size: 0.9rem; z-index: 60; box-shadow: var(--shadow);
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px 0; gap: 8px; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -8px; }
  .topbar-right { margin-left: auto; }
  #latest { display: none; }
  main { padding: 16px 16px 40px; }
  .card { padding: 15px; }
  .hero { padding: 20px 18px 16px; border-radius: 20px; }
  .hero-num { font-size: 4.2rem; }
  .hero-spark { min-height: 0; }
  .hero-spark .chart { height: 130px; }
  .hero-strip { grid-template-columns: 1fr; row-gap: 8px; }
  .hero-strip > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0; border-left: 0; }
  .hero-strip .v { font-size: 1.15rem; text-align: right; }
  .kpis { gap: 10px; }
  .kpi { grid-template-columns: 1fr; padding: 12px; }
  .kpi-ico { display: none; }
  .kpi-value { font-size: 1.3rem; }
  .chart { height: 280px; }
  .chart.tall { height: 320px; }
  .statstrip { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .statstrip > div { border-left: 0; padding-left: 0; }
  .row2 { grid-template-columns: 1fr; }
  .dates input { width: 9.5em; }
}
