/* Themes: Light is the base. No data-theme = System (Light or Dark from the device setting).
   The .tp-* classes carry the same tokens so the Settings previews show each theme whatever is active. */
:root, .tp-light, .tp-paper, .tp-mist {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.08);
  --accent: #2a78d6;
  --accent-soft: rgba(42, 120, 214, 0.12);
  --glow-1: rgba(42, 120, 214, 0.14);
  --glow-2: rgba(235, 104, 52, 0.09);
  --good: #006300;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4a00;
  --bad: #d03b3b;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --other: #b5b3ab;
  --shadow: 0 1px 2px rgba(20, 20, 10, 0.04), 0 8px 24px -12px rgba(20, 20, 10, 0.10);
  --shadow-hover: 0 2px 4px rgba(20, 20, 10, 0.05), 0 18px 40px -16px rgba(20, 20, 10, 0.20);
  --glass: rgba(252, 252, 251, 0.72);

  /* Motion: one clean overshoot (no wobble) so short animations stay smooth. */
  --spring: cubic-bezier(0.32, 1.38, 0.58, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242422;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #3987e5;
    --accent-soft: rgba(57, 135, 229, 0.18);
    --glow-1: rgba(57, 135, 229, 0.16);
    --glow-2: rgba(217, 89, 38, 0.08);
    --good: #0ca30c;
    --warn-bg: #3a2e10;
    --warn-ink: #f5d58a;
    --bad: #e66767;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --other: #5c5b56;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 22px 44px -16px rgba(0, 0, 0, 0.75);
    --glass: rgba(26, 26, 25, 0.68);
  }
}

:root[data-theme="dark"], :root[data-theme="midnight"], .tp-dark, .tp-midnight {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #242422;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.18);
  --glow-1: rgba(57, 135, 229, 0.16);
  --glow-2: rgba(217, 89, 38, 0.08);
  --good: #0ca30c;
  --warn-bg: #3a2e10;
  --warn-ink: #f5d58a;
  --bad: #e66767;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --other: #5c5b56;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 22px 44px -16px rgba(0, 0, 0, 0.75);
  --glass: rgba(26, 26, 25, 0.68);
}

/* Paper: warm cream with a terracotta accent (light series colours). */
:root[data-theme="paper"], .tp-paper {
  --page: #f4efe6;
  --surface: #fbf8f2;
  --surface-2: #efe8dc;
  --ink: #1f1a14;
  --ink-2: #5a5145;
  --muted: #8a7f6f;
  --grid: #e4dccd;
  --axis: #cbbfa9;
  --border: rgba(60, 40, 10, 0.10);
  --accent: #b4532a;
  --accent-soft: rgba(180, 83, 42, 0.12);
  --glow-1: rgba(180, 83, 42, 0.10);
  --glow-2: rgba(27, 140, 122, 0.08);
  --good: #2f6b1f;
  --warn-bg: #f8e7c0;
  --warn-ink: #6b4a00;
  --bad: #b8322f;
  --other: #bdb4a3;
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.05), 0 8px 24px -12px rgba(60, 40, 10, 0.14);
  --shadow-hover: 0 2px 4px rgba(60, 40, 10, 0.06), 0 18px 40px -16px rgba(60, 40, 10, 0.24);
  --glass: rgba(251, 248, 242, 0.74);
}

/* Mist: cool blue-grey with a teal accent (light series colours). */
:root[data-theme="mist"], .tp-mist {
  --page: #eef2f6;
  --surface: #f9fbfd;
  --surface-2: #e7edf3;
  --ink: #0e1622;
  --ink-2: #4a5869;
  --muted: #7b8798;
  --grid: #dbe3ec;
  --axis: #b9c5d3;
  --border: rgba(14, 30, 50, 0.09);
  --accent: #0f7c86;
  --accent-soft: rgba(15, 124, 134, 0.12);
  --glow-1: rgba(15, 124, 134, 0.12);
  --glow-2: rgba(98, 80, 214, 0.08);
  --good: #0b6e3a;
  --warn-bg: #fdf1d3;
  --warn-ink: #6b4a00;
  --bad: #c93a3a;
  --other: #aeb8c4;
  --shadow: 0 1px 2px rgba(14, 30, 50, 0.05), 0 8px 24px -12px rgba(14, 30, 50, 0.14);
  --shadow-hover: 0 2px 4px rgba(14, 30, 50, 0.06), 0 18px 40px -16px rgba(14, 30, 50, 0.24);
  --glass: rgba(249, 251, 253, 0.72);
}

/* Midnight: deep navy with a bright blue accent (dark series colours, set above). */
:root[data-theme="midnight"], .tp-midnight {
  --page: #0a0f1c;
  --surface: #121a2b;
  --surface-2: #1a2438;
  --ink: #e8edf7;
  --ink-2: #b4bfd3;
  --muted: #7d89a0;
  --grid: #232f46;
  --axis: #314060;
  --border: rgba(160, 190, 255, 0.09);
  --accent: #5b9cff;
  --accent-soft: rgba(91, 156, 255, 0.18);
  --glow-1: rgba(91, 156, 255, 0.18);
  --glow-2: rgba(150, 110, 255, 0.10);
  --good: #2bb673;
  --bad: #ef6b6b;
  --series-1: #5b9cff;
  --other: #4a5670;
  --shadow: 0 1px 0 rgba(160, 190, 255, 0.04) inset, 0 10px 30px -14px rgba(0, 0, 10, 0.7);
  --shadow-hover: 0 1px 0 rgba(160, 190, 255, 0.06) inset, 0 22px 44px -16px rgba(0, 0, 10, 0.8);
  --glass: rgba(18, 26, 43, 0.70);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background-color: var(--page);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Background glow on its own fixed layer: the compositor keeps it still, nothing repaints while scrolling. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -6%, var(--glow-1), transparent 70%),
    radial-gradient(760px 480px at 100% 0%, var(--glow-2), transparent 70%);
}
/* Something is in focus (dropdown or dialog): the page behind stays put. */
html.scroll-locked { overflow: hidden; }
html.scroll-locked body { padding-right: var(--sbw, 0px); }

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 18px; }
h2 { font-size: 15px; }
.sub { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- Top bar (glass) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
/* Logo: a lens with rising bars inside, and a spark of insight. */
.logo {
  flex: none; width: 38px; height: 38px; overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(42, 120, 214, 0.35));
  transition: transform 0.37s var(--spring);
}
.lg-glass { transform-box: view-box; transform-origin: 17px 17px; animation: lens-in 0.56s var(--spring) both; transition: transform 0.37s var(--spring); }
.lg-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: logo-rise 0.56s var(--spring) both; }
.lg-bar:nth-child(1) { animation-delay: 0.25s; }
.lg-bar:nth-child(2) { animation-delay: 0.33s; }
.lg-bar:nth-child(3) { animation-delay: 0.41s; }
.lg-spark { transform-box: fill-box; transform-origin: center; animation: spark-in 0.43s var(--spring) 0.6s both, twinkle 4s ease-in-out 1.6s infinite; }
.brand:hover .logo { transform: scale(1.08); }
.brand:hover .lg-glass { transform: translate(-1.5px, -1.5px) rotate(-10deg); }
.brand:hover .lg-bar { animation: logo-dance 0.43s var(--spring); }
.brand:hover .lg-bar:nth-child(2) { animation-delay: 0.07s; }
.brand:hover .lg-bar:nth-child(3) { animation-delay: 0.14s; }
.brand:hover .lg-spark { animation: spark-spin 0.5s var(--spring); }
.tagline { margin: 0; font-size: 12px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  position: relative; overflow: hidden;
  font-size: 12px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 24px;
  max-width: 380px; white-space: nowrap; text-overflow: ellipsis;
}
.chip::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--series-3); box-shadow: 0 0 0 0 var(--series-3);
}
.chip.pulse::before { animation: ping 0.74s var(--ease-out) 2; }
.chip.busy::before { background: var(--series-4); animation: blink 0.8s ease-in-out infinite; }
.chip.busy::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  animation: shimmer 1.1s linear infinite;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 13px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.28s var(--spring), background-color 0.2s, box-shadow 0.19s var(--ease-out), border-color 0.2s;
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.25); }
.btn:active { transform: scale(0.94); transition-duration: 0.12s; }
.btn:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.icon { padding: 7px 10px; }
.ico-settings { width: 15px; height: 15px; flex: none; }
.ico-settings circle { fill: var(--surface); transform-box: fill-box; transition: transform 0.37s var(--spring), fill 0.2s; }
.settings-btn:hover .ico-settings circle { fill: var(--surface-2); }
.settings-btn:hover .ico-settings .k1 { transform: translateX(5px); }
.settings-btn:hover .ico-settings .k2 { transform: translateX(-5px); }
.settings-btn:hover .ico-settings .k3 { transform: translateX(3px); }

/* ---------- Filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
  padding: 14px 24px; background: var(--glass); border-bottom: 1px solid var(--border);
}
.filters { position: relative; }
.filters .field { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; transition: filter 0.25s var(--ease-out), opacity 0.25s var(--ease-out), transform 0.37s var(--spring); }
select, input[type="search"] {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 9px; min-width: 120px; max-width: 220px;
  transition: border-color 0.2s, box-shadow 0.22s var(--ease-out), transform 0.25s var(--spring);
}
select:hover, input[type="search"]:hover { border-color: var(--axis); }
select:focus, input[type="search"]:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="search"] { min-width: 260px; max-width: none; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; min-height: 0; }
.pills:empty { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; color: var(--accent); background: var(--accent-soft);
  border: 0; border-radius: 999px; padding: 4px 6px 4px 11px; cursor: pointer;
  animation: pop-in 0.31s var(--spring) both;
  transition: transform 0.25s var(--spring);
}
.pill b { font-weight: 600; }
.pill span { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--surface); font-size: 10px; }
.pill:hover { transform: scale(1.05); }
.pill.leaving { animation: pop-out 0.16s var(--ease-out) both; }

.banner {
  margin: 16px 24px 0; padding: 11px 15px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: 13px;
  animation: drop-in 0.37s var(--spring) both;
}
.banner .btn { margin: 0 6px; vertical-align: middle; }
.banner-tip { display: block; margin-top: 6px; font-size: 12px; opacity: 0.85; }

main { padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1480px; margin: 0 auto; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); min-width: 0;
  transition: box-shadow 0.25s var(--ease-out), transform 0.37s var(--spring), opacity 0.37s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

.grid2 { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 18px; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.43s var(--ease-out) calc(var(--i, 0) * 38ms), transform 0.56s var(--spring) calc(var(--i, 0) * 38ms), box-shadow 0.25s var(--ease-out);
}

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow); min-width: 0;
  transition: transform 0.34s var(--spring), box-shadow 0.25s var(--ease-out);
}
.kpi::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px 120px at var(--mx, 80%) var(--my, -20%), var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.35s;
}
.kpi:hover { transform: translateY(-4px) scale(1.015); box-shadow: var(--shadow-hover); }
.kpi:hover::after { opacity: 1; }
.kpis.reveal { opacity: 1; transform: none; }
.kpis.reveal .kpi { opacity: 0; transform: translateY(14px) scale(0.97); }
.kpis.reveal.in .kpi {
  opacity: 1; transform: none;
  transition: opacity 0.37s var(--ease-out) calc(var(--i, 0) * 33ms), transform 0.53s var(--spring) calc(var(--i, 0) * 33ms), box-shadow 0.25s var(--ease-out);
}
.kpis.reveal.in .kpi:hover { transform: translateY(-4px) scale(1.015); transition: transform 0.34s var(--spring), box-shadow 0.25s var(--ease-out); }
.kpi .label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable .label::after { content: "↗"; display: inline-block; margin-left: 6px; color: var(--accent); opacity: 0; transform: translate(-3px, 3px); transition: opacity 0.2s, transform 0.28s var(--spring); }
.kpi.clickable:hover .label::after, .kpi.clickable:focus-visible .label::after { opacity: 1; transform: none; }
.kpi.clickable:active { transform: scale(0.97) !important; transition-duration: 0.12s !important; }
.kpi.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi .value { font-size: 27px; font-weight: 650; letter-spacing: -0.025em; margin: 5px 0 2px; white-space: nowrap; display: inline-block; transform-origin: left center; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.kpi .value.bump { animation: bump 0.37s var(--spring); }
.kpi .note { font-size: 12px; color: var(--muted); }
.kpi .meter { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.kpi .meter > span {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--series-1), var(--series-7));
  transition: width 0.68s var(--spring) 0.15s;
}
.kpis.mini { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0; }
.kpis.mini .kpi { box-shadow: none; padding: 11px 13px; }
.kpis.mini .kpi .value { font-size: 19px; }
.kpis.mini .kpi { animation: pop-in 0.26s var(--spring) both; animation-delay: calc(var(--i, 0) * 18ms + 40ms); }

/* ---------- Charts ---------- */
.chart { position: relative; height: 300px; }
.chart.tall { height: 340px; }
.chart.short { height: 200px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin: 2px 0 8px; }
.legend button {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  padding: 3px 7px; margin: -3px -7px; border-radius: 7px;
  animation: fade-up 0.28s var(--ease-out) both;
  transition: background-color 0.2s, transform 0.28s var(--spring);
}
.legend button:hover { background: var(--surface-2); color: var(--ink); transform: translateY(-1px); }
.legend button:active { transform: scale(0.94); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Bar lists ---------- */
.barlist { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.barrow {
  display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center;
  font: inherit; font-size: 12.5px; text-align: left; color: inherit;
  background: none; border: 0; border-radius: 9px; padding: 4px 6px; margin: -4px -6px; width: calc(100% + 12px); cursor: pointer;
  transition: transform 0.28s var(--spring), background-color 0.2s;
}
.barrow:hover { transform: translateX(3px); background: var(--surface-2); }
.barrow:active { transform: scale(0.98); }
.barrow.new { animation: fade-up 0.31s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); }
.barrow .name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .track, .barrow .fill { display: block; }
.barrow .track { height: 10px; background: var(--surface-2); border-radius: 0 5px 5px 0; overflow: visible; }
.barrow .fill {
  height: 100%; border-radius: 0 5px 5px 0; min-width: 2px;
  background: linear-gradient(90deg, var(--series-1), color-mix(in srgb, var(--series-1) 70%, var(--series-7)));
  transform-origin: left center; transform: scaleX(0);
  transition: width 0.56s var(--spring), transform 1s var(--spring) calc(var(--i, 0) * 38ms + 0.1s);
}
.card.in .barrow .fill { transform: scaleX(1); }
.barrow:hover .fill { filter: brightness(1.08); }
.barrow .val { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; min-width: 92px; }
.barrow .val em { font-style: normal; color: var(--muted); margin-left: 4px; }

/* ---------- Table ---------- */
.table-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; overscroll-behavior: contain; }
.dlg-body { overscroll-behavior: contain; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; transition: color 0.2s; }
table.data th:hover { color: var(--ink); }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th[aria-sort="ascending"]::after,
table.data th[aria-sort="descending"]::after { content: "▼"; display: inline-block; font-size: 9px; margin-left: 4px; transition: transform 0.31s var(--spring); }
table.data th[aria-sort="ascending"]::after { transform: rotate(180deg); }
table.data tbody tr { cursor: pointer; transition: background-color 0.2s; }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data tbody tr.row-in { animation: row-in 0.34s var(--spring) both; animation-delay: calc(var(--i, 0) * 9ms); }
table.data td.name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
table.data td.muted { color: var(--muted); }
table.data td.due { color: var(--bad); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
#d-table tbody tr { cursor: default; }
#t-grantees { min-width: 980px; }

/* ---------- Data quality ---------- */
.dq { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dq details { border: 1px solid var(--border); border-radius: 12px; padding: 9px 13px; transition: background-color 0.25s, transform 0.28s var(--spring); }
.dq details:hover { background: var(--surface-2); }
.dq details[open] ul { animation: fade-up 0.25s var(--ease-out) both; }
.dq summary { cursor: pointer; font-size: 13px; }
.dq summary b { font-variant-numeric: tabular-nums; }
.dq .ok { color: var(--good); }
.dq .flag { color: var(--bad); }
.dq ul { margin: 8px 0 2px; padding-left: 18px; color: var(--ink-2); font-size: 12px; max-height: 220px; overflow: auto; }

.method ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.method li { margin: 4px 0; }

/* ---------- Dialog ---------- */
dialog.modal {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  border: 1px solid var(--border); border-radius: 22px; padding: 0;
  background: var(--surface); color: var(--ink); overflow: hidden;
  box-shadow: 0 40px 100px -24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transition: transform 0.22s var(--ease-out), opacity 0.18s var(--ease-out);
}
dialog.modal[open] { display: flex; flex-direction: column; animation: dialog-in 0.24s var(--spring) backwards; }
dialog.modal.entry { width: min(760px, calc(100vw - 32px)); }
dialog.modal.custom { width: min(640px, calc(100vw - 32px)); }
dialog.modal { will-change: transform, opacity; }
dialog[open]::backdrop { animation: fade 0.14s var(--ease-out) both; }
/* Closing must outrank the [open] rule, and fade out with its own keyframes (reversing the open fade doesn't restart it). */
dialog.modal.closing[open] { animation: dialog-out 0.14s var(--ease-out) forwards; pointer-events: none; }
dialog.modal.closing[open]::backdrop { animation: fade-out 0.14s var(--ease-out) forwards; }
/* A dialog opened on top of another only lightly tints: the one beneath already blurs the page. */
dialog.modal.stacked::backdrop { background: rgba(8, 8, 12, 0.1); -webkit-backdrop-filter: none; backdrop-filter: none; }
dialog::backdrop { background: color-mix(in srgb, var(--page) 35%, rgba(8, 8, 12, 0.35)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* A dialog with another stacked on top steps back and softens. */
dialog.modal:focus, dialog.modal:focus-visible { outline: none; }
dialog.modal.pushed { transform: translateY(-12px) scale(0.955); opacity: 0.55; }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 22px 12px; }
.dlg-titles { min-width: 0; }
.dlg-titles h2 { font-size: 18px; overflow-wrap: anywhere; }
.dlg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dlg-head .close-x { transition: transform 0.31s var(--spring), background-color 0.2s; }
.dlg-head .close-x:hover { transform: rotate(90deg) scale(1.08); }
.dlg-body { padding: 4px 22px 20px; overflow: auto; min-height: 0; }
.dlg-body .kpis.mini { margin-top: 4px; }
.dlg-table { max-height: 50vh; }
.dlg-hint { margin-top: 10px; }
.dlg-body.slide-next { animation: slide-next 0.31s var(--spring) both; }
.dlg-body.slide-prev { animation: slide-prev 0.31s var(--spring) both; }
.eyebrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
  animation: pop-in 0.31s var(--spring) both;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; }

/* Entry (single line) */
.entry-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.amt { background: var(--surface-2); border-radius: 16px; padding: 13px 15px; animation: pop-in 0.26s var(--spring) both; animation-delay: calc(var(--i, 0) * 22ms + 30ms); }
.amt.primary { background: var(--accent-soft); }
.amt .k { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.amt .v { display: block; font-size: 26px; font-weight: 650; letter-spacing: -0.025em; margin: 3px 0 1px; }
.amt .v small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.amt .r { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 0; }
.entry-grid > div {
  display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: 13px;
  animation: fade-up 0.2s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 10) * 6ms + 50ms);
}
.entry-grid dt { color: var(--muted); }
.entry-grid dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.link {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0 2px; margin: 0 -2px; cursor: pointer; text-align: left;
  border-radius: 4px; transition: background-color 0.2s;
}
.link:hover { background: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
.entry-ctx {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--axis);
  font-size: 12.5px; color: var(--ink-2); animation: fade-up 0.22s var(--ease-out) 0.1s both;
}
.entry-nav { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-nav .btn:disabled { opacity: 0.35; cursor: default; transform: none; }

/* Customize */
.custom h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 18px 0 8px; }
.custom h3:first-child { margin-top: 4px; }
.switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.switch { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; cursor: pointer; font-size: 13px; transition: background-color 0.2s; }
.switch:hover { background: var(--surface-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; flex: none; width: 36px; height: 21px; border-radius: 999px; background: var(--axis); transition: background-color 0.19s var(--ease-out); }
.switch .thumb { position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.34s var(--spring), width 0.16s var(--ease-out); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(15px); }
.switch:active .thumb { width: 21px; }
.switch:active input:checked + .track .thumb { transform: translateX(10px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.top-switch { padding: 6px 10px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--border); background: var(--surface); }
.top-switch:has(input:checked) { color: var(--ink); }
/* Full rupee figures are longer: give them a slightly smaller size so tiles don't overflow. */
.full-amounts .kpi .value { font-size: 21px; }
.full-amounts .kpis.mini .kpi .value { font-size: 16px; }
.full-amounts .amt .v { font-size: 21px; }
.dlg-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.dlg-foot .sub { align-self: center; margin: 0; }

/* Settings: theme picker. Each preview carries its theme's tokens through a .tp-* class. */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt {
  position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left;
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 7px 7px 10px; cursor: pointer;
  transition: transform 0.28s var(--spring), border-color 0.2s, box-shadow 0.22s var(--ease-out);
}
.theme-opt:hover { transform: translateY(-2px); border-color: var(--axis); }
.theme-opt:active { transform: scale(0.96); transition-duration: 0.12s; }
.theme-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-opt::after {
  content: "✓"; position: absolute; top: 12px; right: 12px; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  opacity: 0; transform: scale(0.3); transition: opacity 0.2s, transform 0.28s var(--spring);
}
.theme-opt[aria-checked="true"]::after { opacity: 1; transform: none; }
.tp { position: relative; display: block; height: 66px; margin-bottom: 6px; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 1px var(--border) inset; }
.tp-layer { position: absolute; inset: 0; background: var(--page); }
.tp-layer + .tp-layer { clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%); }
.tp-card {
  position: absolute; left: 10px; right: 10px; top: 12px; bottom: -8px; display: flex; align-items: flex-end; gap: 5px;
  padding: 0 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.tp-card::before { content: ""; position: absolute; left: 10px; top: 8px; width: 38%; height: 4px; border-radius: 2px; background: var(--ink); opacity: 0.75; }
.tp-card::after { content: ""; position: absolute; right: 9px; top: 6px; width: 18px; height: 8px; border-radius: 4px; background: var(--accent); }
.tp-card i { width: 9px; border-radius: 2px 2px 0 0; }
.tp-card i:nth-child(1) { height: 14px; background: var(--series-1); }
.tp-card i:nth-child(2) { height: 22px; background: var(--series-2); }
.tp-card i:nth-child(3) { height: 17px; background: var(--series-3); }
.tp-name { font-size: 13px; font-weight: 600; padding: 0 3px; }
.tp-note { font-size: 11.5px; color: var(--muted); padding: 0 3px; line-height: 1.35; }

/* ---------- Tabs ---------- */
.main-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { position: relative; display: inline-flex; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 15px; max-width: 100%; overflow-x: auto; }
.tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  background: none; border: 0; border-radius: 11px; padding: 8px 16px; cursor: pointer;
  transition: color 0.2s, transform 0.28s var(--spring);
}
.tab:hover { color: var(--ink); }
.tab:active { transform: scale(0.94); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab .count { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; transition: background-color 0.3s, color 0.3s; }
.tab .count:empty { display: none; }
.tab[aria-selected="true"] .count { background: var(--accent-soft); color: var(--accent); }
.tab-ink {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: 0; border-radius: 11px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 18px -10px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s var(--spring), width 0.28s var(--spring);
}
.tabpanel { display: flex; flex-direction: column; gap: 18px; }
.tabpanel.tab-in { animation: tab-in 0.37s var(--spring) both; }
.tabpanel.tab-in.from-left { animation-name: tab-in-left; }

/* Segmented control */
.seg { position: relative; display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.seg button {
  position: relative; z-index: 1; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: none; border: 0; padding: 5px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: color 0.2s, transform 0.25s var(--spring);
}
.seg button[aria-checked="true"] { color: var(--ink); }
.seg button:active { transform: scale(0.9); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-ink {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 8px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 10px -6px rgba(0, 0, 0, 0.3);
  transition: transform 0.34s var(--spring), width 0.25s var(--spring);
}

/* ---------- Line tabs ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end;
  margin: 14px 0; padding: 12px; background: var(--surface-2); border-radius: 16px;
}
.filterbar .field { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.filterbar .field.grow { flex: 1 1 240px; }
.filterbar .field.grow input { width: 100%; min-width: 0; }
.filterbar .pills { flex-basis: 100%; }
.range { display: flex; align-items: center; gap: 6px; }
.range i { color: var(--muted); font-style: normal; }
input[type="number"], input[type="date"] {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 8px; width: 92px; transition: border-color 0.2s, box-shadow 0.22s var(--ease-out);
}
input[type="date"] { width: 138px; }
input[type="number"]:focus, input[type="date"]:focus { box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.lines-wrap { max-height: 68vh; }
table.data td.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
table.data tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--axis); border-bottom: 0; }
.foot-btns { display: flex; gap: 6px; }
.pill.excl { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.pill.excl span { background: var(--bad); }

/* ---------- Loading ---------- */
.loading {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: center; background: var(--page); color: var(--ink-2);
  transition: opacity 0.28s var(--ease-out), visibility 0.45s;
}
.loading.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.loader { display: flex; align-items: flex-end; gap: 6px; height: 40px; }
.loader i { width: 8px; height: 100%; border-radius: 4px; background: linear-gradient(180deg, var(--series-1), var(--series-7)); transform-origin: bottom; animation: bounce-bar 0.56s var(--spring) infinite alternate; }
.loader i:nth-child(2) { animation-delay: 0.12s; }
.loader i:nth-child(3) { animation-delay: 0.24s; }
.loader i:nth-child(4) { animation-delay: 0.36s; }

/* ---------- Custom dropdowns ---------- */
/* The native <select> stays in the DOM as the source of truth; .dd is its visual stand-in. */
.dd-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd { position: relative; transition: transform 0.37s var(--spring), filter 0.22s var(--ease-out); }
.dd-btn {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 128px; max-width: 230px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 10px 7px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-radius 0.19s var(--ease-out), border-color 0.2s, box-shadow 0.19s var(--ease-out), transform 0.28s var(--spring), background-color 0.2s;
}
.dd-btn:hover { border-color: var(--axis); transform: translateY(-1px); }
.dd-btn:active { transform: scale(0.95); transition-duration: 0.12s; }
.dd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn.is-set .dd-val { color: var(--accent); }
.dd-chev { flex: none; width: 14px; height: 14px; color: var(--muted); transition: transform 0.34s var(--spring), color 0.2s; }
.dd.bump .dd-btn { animation: nudge 0.34s var(--spring); }

/* Open: the trigger and panel read as one surface that grew downward. */
.dd.open { z-index: 5; transform: translateY(-2px) scale(1.035); filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.16)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08)); }
.dd.open .dd-btn { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; box-shadow: none; transform: none; }
.dd.open .dd-chev { transform: rotate(180deg); color: var(--accent); }
.dd.open.up .dd-btn { border-radius: 0 0 12px 12px; border-bottom-color: var(--border); border-top-color: transparent; }

.dd-panel {
  position: absolute; z-index: 1; top: calc(100% - 1px); left: 0;
  min-width: max(100%, 210px); max-width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0 var(--tr, 14px) 14px 14px;
  overflow: hidden;
  transform-origin: top center;
}
.dd.align-right .dd-panel { left: auto; right: 0; border-radius: var(--tl, 14px) 0 14px 14px; }
.dd.up .dd-panel { top: auto; bottom: calc(100% - 1px); transform-origin: bottom center; border-radius: 14px 14px var(--tr, 14px) 0; }
.dd.up.align-right .dd-panel { border-radius: 14px 14px 0 var(--tl, 14px); }
.dd-panel[hidden] { display: none; }
.dd.open .dd-panel { animation: dd-in 0.26s var(--spring) both; }
.dd.closing .dd-panel { animation: dd-out 0.11s var(--ease-out) both; }
.dd-list { position: relative; max-height: min(330px, 56vh); overflow: auto; padding: 5px; overscroll-behavior: contain; outline: none; }
.dd-opt {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: color 0.2s, transform 0.22s var(--spring);
}
.dd.open .dd-opt { animation: dd-opt-in 0.22s var(--spring) backwards; animation-delay: calc(min(var(--i, 0), 12) * 8ms + 25ms); }
.dd-opt .dd-txt { overflow: hidden; text-overflow: ellipsis; }
.dd-opt .dd-check { flex: none; width: 14px; height: 14px; color: var(--accent); opacity: 0; transform: scale(0.3); transition: opacity 0.2s, transform 0.28s var(--spring); }
.dd-opt[aria-selected="true"] { font-weight: 600; color: var(--accent); }
.dd-opt[aria-selected="true"] .dd-check { opacity: 1; transform: scale(1); }
.dd-opt.active { transform: translateX(3px); }
.dd.open .dd-opt.picked, .dd.closing .dd-opt.picked { animation: dd-pick 0.25s var(--spring); }
/* Highlight that springs between options. */
.dd-hl {
  position: absolute; z-index: 0; left: 5px; right: 5px; top: 0; height: 34px;
  border-radius: 9px; background: var(--accent-soft); pointer-events: none;
  transition: transform 0.31s var(--spring), height 0.19s var(--ease-out), opacity 0.2s;
}
.dd-hl.instant { transition: none; }

/* Focus scrim: everything else steps back and blurs. */
.dd-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in srgb, var(--page) 38%, rgba(8, 8, 12, 0.12));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  /* Only opacity animates; animating the blur radius itself is what made it stutter. */
  transition: opacity 0.2s var(--ease-out), visibility 0s linear 0.2s;
}
.dd-scrim.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.2s var(--ease-out), visibility 0s; }
/* The open control is lifted into this layer, above the scrim; a placeholder holds its spot. */
.dd-layer { position: fixed; inset: 0; z-index: 46; pointer-events: none; }
.dd-layer > .dd { position: absolute; pointer-events: auto; }
.dd-layer .dd-btn { width: 100%; min-width: 0; max-width: none; }
.dd-ph { flex: none; }

/* Include / exclude multi-select */
.ms .dd-btn { min-width: 116px; max-width: 200px; }
.dd-btn.is-excl { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.dd-btn.is-excl .dd-val { color: var(--bad); }
.ms-panel { min-width: max(100%, 300px); }
.ms-top { display: flex; gap: 8px; align-items: center; padding: 8px 8px 4px; }
.ms-top .ms-search { flex: 1; min-width: 0; width: 100%; padding: 6px 9px; }
.ms-list { max-height: min(300px, 46vh); }
.ms-opt { justify-content: flex-start; }
.ms-opt .dd-txt { flex: 1; }
.ms-box {
  flex: none; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid var(--axis); background: var(--surface);
  transition: background-color 0.2s, border-color 0.2s, transform 0.28s var(--spring);
}
.ms-box svg { width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(0.2) rotate(-20deg); transition: opacity 0.15s, transform 0.31s var(--spring); }
.ms-opt[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.ms-opt[aria-selected="true"] .ms-box { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.ms-opt[aria-selected="true"] .ms-box svg { opacity: 1; transform: none; }
.ms-excl .ms-opt[aria-selected="true"] .ms-box { background: var(--bad); border-color: var(--bad); }
.ms-excl .ms-opt[aria-selected="true"] .dd-txt { text-decoration: line-through; text-decoration-color: var(--bad); }
.ms-count { color: var(--muted); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ms-mode button[data-v="exclude"][aria-checked="true"] { color: var(--bad); }
.ms-empty { padding: 16px; color: var(--muted); font-size: 12.5px; text-align: center; }
.ms-foot { display: flex; gap: 6px; justify-content: flex-end; padding: 7px 8px 8px; border-top: 1px solid var(--grid); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.dd.settled .dd-opt { animation: none !important; }

@keyframes tab-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes tab-in-left { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes slide-next { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes dd-in {
  0% { opacity: 0; transform: scaleY(0.6) translateY(-4px); }
  35% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes dd-out { to { opacity: 0; transform: scaleY(0.6) translateY(-4px); } }
@keyframes dd-opt-in { from { opacity: 0; transform: translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes dd-pick { 0% { transform: scale(1); } 40% { transform: scale(0.95); } 100% { transform: scale(1); } }

/* ---------- Natural-language search ---------- */
.topsearch { flex: 1 1 340px; min-width: 240px; max-width: 640px; }
.search-dd { width: 100%; }
.search-box {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.25s var(--ease-out), border-radius 0.2s var(--ease-out);
}
.search-box:hover { border-color: var(--axis); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.s-glass { width: 16px; height: 16px; flex: none; color: var(--muted); transition: color 0.2s, transform 0.3s var(--spring); }
.search-box:focus-within .s-glass { color: var(--accent); transform: scale(1.08); }
#q-nl { flex: 1; min-width: 0; height: 100%; font: inherit; font-size: 13.5px; color: var(--ink); background: none; border: 0; outline: none; padding: 0; max-width: none; }
#q-nl::placeholder { color: var(--muted); }
#q-nl::-webkit-search-cancel-button { cursor: pointer; }
.search-box kbd { font: 600 11px/1 system-ui, sans-serif; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; }
.dd.open .search-box { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; box-shadow: none; }
.dd.open .search-box kbd { opacity: 0; }
.search-panel { min-width: 100%; max-width: min(720px, calc(100vw - 32px)); border-radius: 0 0 16px 16px; }
.search-list { max-height: min(480px, 64vh); padding: 6px; }
.s-sec { position: relative; z-index: 1; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.s-sec.s-help { text-transform: none; letter-spacing: 0; font-weight: 500; line-height: 1.5; padding: 10px; border-top: 1px solid var(--grid); margin-top: 6px; }
.s-sec.s-chips { text-transform: none; letter-spacing: 0; padding: 4px 10px 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.s-opt { justify-content: flex-start; gap: 10px; white-space: normal; align-items: flex-start; }
.s-ico { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; }
.s-ico.s-run { background: var(--accent); color: #fff; }
.s-ico.s-ent { color: var(--accent); }
.s-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; padding-top: 2px; }
.s-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.s-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 500;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  animation: pop-in 0.22s var(--spring) both;
}
button.s-chip { cursor: pointer; transition: transform 0.25s var(--spring), background-color 0.2s, border-color 0.2s; }
button.s-chip:hover { transform: translateY(-1px); border-color: var(--axis); }
button.s-chip i { font-style: normal; font-size: 10px; opacity: 0.5; }
button.s-chip:hover i { opacity: 1; }
.s-chip.metric { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.s-chip.time { background: color-mix(in srgb, var(--series-3) 14%, transparent); border-color: transparent; }
.s-chip.amt { background: color-mix(in srgb, var(--series-4) 16%, transparent); border-color: transparent; }
.s-chip.shape { background: color-mix(in srgb, var(--series-7) 13%, transparent); border-color: transparent; }
.s-chip.neg { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: transparent; }
.s-chip.fuzzy::before { content: "≈"; font-weight: 700; color: var(--series-4); }
.s-chip.scope { background: none; border-style: dashed; color: var(--ink-2); }
.s-note { font-size: 12px; color: var(--muted); align-self: center; }
.s-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 14px; }
.s-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.s-answer {
  padding: 16px 18px; border-radius: 18px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--series-7) 10%, transparent));
  animation: pop-in 0.3s var(--spring) both;
}
.s-answer.empty { background: var(--surface-2); }
.s-big { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
.s-sentence { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.s-chart { position: relative; height: 260px; margin: 6px 0 14px; }
dialog.modal.search-res .dlg-titles h2 { font-weight: 650; }

/* ---------- Data source buttons ---------- */
.btn-group { display: inline-flex; }
.btn-group .btn:first-child:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding-left: 9px; padding-right: 9px; }
.btn-group .btn[hidden] + .btn, .btn-group .btn:only-child { border-radius: 10px; }
#btn-local .lbl { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ico-refresh, .ico-link { width: 14px; height: 14px; flex: none; transition: transform 0.4s var(--spring); }
#btn-refresh:hover .ico-refresh { transform: rotate(-60deg); }
#btn-refresh.busy .ico-refresh { animation: spin 0.7s linear infinite; }
#btn-local:hover .ico-link { transform: rotate(-20deg) scale(1.1); }
/* Linked file and showing it: the Refresh button reads as live. */
#btn-refresh.live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* ---------- Start screen (no workbook loaded yet) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--page) 70%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fade 0.2s var(--ease-out) both;
}
.gate-card {
  width: min(460px, 100%); padding: 28px 26px 22px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-hover);
  animation: dialog-in 0.24s var(--spring) both;
}
.gate-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.gate-ico svg { width: 26px; height: 26px; }
.gate-card h2 { font-size: 19px; overflow-wrap: anywhere; }
.gate-card .sub { margin-top: 6px; font-size: 13.5px; line-height: 1.5; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.gate-actions .btn { padding: 9px 16px; }
.gate-actions .btn.primary { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gate-other { margin-top: 14px; font-size: 12.5px; }
.gate-tip { margin: 14px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.gate-tip:empty { display: none; }

/* Busy state for export buttons */
.btn.busy { pointer-events: none; opacity: 0.75; }
.btn.busy .xl-ico { animation: spin 0.8s linear infinite; border-radius: 50%; }
.xl-ico {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px;
  background: #1d6f42; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: -0.02em; flex: none;
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Date field ---------- */
.datef { position: relative; }
.date-box {
  position: relative; z-index: 2; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease-out), border-radius 0.2s var(--ease-out);
}
.date-box:hover { border-color: var(--axis); }
.date-box:focus-within { box-shadow: 0 0 0 4px var(--accent-soft); border-color: var(--accent); }
.date-in {
  font: inherit; font-size: 13px; color: var(--ink); background: none; border: 0; outline: none;
  width: 104px; padding: 7px 4px 7px 11px; font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.date-in::placeholder { color: var(--muted); }
.date-in.invalid { color: var(--bad); animation: shake 0.32s var(--ease-out); }
.date-box:has(.date-in.invalid) { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 14%, transparent); }
.date-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 2px; border: 0; border-radius: 9px;
  background: none; color: var(--muted); cursor: pointer; transition: background-color 0.2s, color 0.2s, transform 0.3s var(--spring);
}
.date-btn svg { width: 16px; height: 16px; }
.date-btn:hover { background: var(--surface-2); color: var(--accent); }
.date-btn:active { transform: scale(0.9); }
.dd.open .date-box { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; box-shadow: none; }
.dd.open.up .date-box { border-radius: 0 0 12px 12px; border-bottom-color: var(--border); border-top-color: transparent; }
.dd.open .date-btn { color: var(--accent); }
.cal-panel { width: 292px; min-width: 0; padding: 10px 10px 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.cal-title { font: inherit; font-size: 14px; font-weight: 650; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 5px 10px; cursor: pointer; transition: background-color 0.2s; }
.cal-title:hover { background: var(--surface-2); }
.cal-nav { width: 30px; height: 30px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; transition: background-color 0.2s, transform 0.3s var(--spring); }
.cal-nav:hover { background: var(--surface-2); color: var(--ink); }
.cal-nav:active { transform: scale(0.88); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week span { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-day {
  position: relative; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--ink);
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.25s var(--spring);
}
.cal-day:hover { background: var(--surface-2); }
.cal-day:active { transform: scale(0.9); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day.out { color: var(--muted); opacity: 0.55; }
.cal-day.today { font-weight: 700; color: var(--accent); }
.cal-day.today::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cal-day.in-range { background: var(--accent-soft); border-radius: 4px; }
.cal-day.edge:not(.sel) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.sel { background: var(--accent); color: #fff; font-weight: 650; }
.cal-day.sel::after { background: #fff; }
.cal-day.picked { animation: dd-pick 0.25s var(--spring); }
.cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.cal-month { height: 42px; border: 0; border-radius: 11px; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; transition: background-color 0.15s, transform 0.25s var(--spring); }
.cal-month:hover { background: var(--surface-2); }
.cal-month.on { background: var(--accent); color: #fff; font-weight: 650; }
.cal-body.slide-r { animation: cal-r 0.22s var(--ease-out); }
.cal-body.slide-l { animation: cal-l 0.22s var(--ease-out); }
.cal-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--grid); }

/* ---------- Exclusions ---------- */
dialog.modal.excl { width: min(860px, calc(100vw - 32px)); }
.excl-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; min-height: 0; }
.excl-nav { display: flex; flex-direction: column; gap: 2px; }
.excl-field {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; color: var(--ink-2); text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background-color 0.15s, color 0.15s, transform 0.25s var(--spring);
}
.excl-field:hover { background: var(--surface-2); color: var(--ink); }
.excl-field.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.excl-field b { font-size: 11px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--bad); color: #fff; animation: pop-in 0.25s var(--spring); }
.excl-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.excl-tools .excl-q { flex: 1; min-width: 0; }
.excl-list { max-height: 46vh; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.excl-opt {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: background-color 0.15s; animation: fade-up 0.18s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 8ms);
}
.excl-opt:hover { background: var(--surface-2); }
.excl-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.excl-opt input:focus-visible + .ms-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.excl-opt .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.excl-opt .meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.excl-opt.on .ms-box { background: var(--bad); border-color: var(--bad); }
.excl-opt.on .ms-box svg { opacity: 1; transform: none; }
.excl-opt.on .txt { color: var(--bad); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.excl-lines h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 6px; }
.excl-lines h3 b { color: var(--bad); }
.excl-lines h3 .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.excl-lines ul { list-style: none; margin: 0; padding: 0; max-height: 22vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.excl-lines li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; font-size: 12.5px; border-bottom: 1px solid var(--grid); }
.excl-lines li:last-child { border-bottom: 0; }
.excl-lines li.muted { color: var(--muted); }
.excl-btn { color: var(--bad); }
.excl-badge { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
#btn-excl .count { font-size: 11px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 999px; padding: 1px 7px; }
#btn-excl .count:empty { display: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45); animation: toast-in 0.26s var(--spring) both;
}
.toast.out { animation: toast-out 0.2s var(--ease-out) forwards; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes cal-r { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes cal-l { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- Theme switch (View Transitions) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Keyframes ---------- */
@keyframes logo-rise { from { transform: scaleY(0.1); } to { transform: scaleY(1); } }
@keyframes lens-in { from { opacity: 0; transform: scale(0.4) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes spark-in { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%, 82%, 100% { transform: scale(1); opacity: 1; } 88% { transform: scale(1.45) rotate(45deg); opacity: 0.85; } 94% { transform: scale(0.8); } }
@keyframes spark-spin { from { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(1.5); } to { transform: rotate(180deg) scale(1); } }
@keyframes logo-dance { 0% { transform: scaleY(1); } 40% { transform: scaleY(0.4); } 100% { transform: scaleY(1); } }
@keyframes bounce-bar { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes pop-out { to { opacity: 0; transform: scale(0.6); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes nudge { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--series-3); } 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar, .filters { padding: 10px 16px; }
  .topbar { position: static; }
  main { padding: 16px 16px 32px; }
  .banner { margin: 12px 16px 0; }
  .filters .field { flex: 1 1 calc(50% - 14px); }
  .dd-btn { width: 100%; min-width: 0; max-width: none; }
  select { max-width: none; width: 100%; min-width: 0; }
  input[type="search"] { min-width: 0; width: 100%; }
  .table-tools { width: 100%; }
  .kpi .value { font-size: 22px; }
  .kpis.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chip { max-width: 100%; }
  .entry-grid, .switches { grid-template-columns: 1fr; }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-btn .lbl { display: none; }
  .excl-grid { grid-template-columns: 1fr; }
  .topsearch { order: 3; flex-basis: 100%; max-width: none; }
  .search-box kbd { display: none; }
  .s-big { font-size: 24px; }
  .excl-nav { flex-direction: row; flex-wrap: wrap; }
  .entry-grid > div { grid-template-columns: 112px minmax(0, 1fr); }
  .dlg-head { flex-direction: column; padding: 16px 16px 10px; }
  .dlg-actions { justify-content: flex-start; }
  .dlg-body { padding: 4px 16px 16px; }
  .filterbar .field { flex: 1 1 calc(50% - 12px); }
  .filterbar .ms .dd-btn { max-width: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .reveal, .kpis.reveal .kpi { opacity: 1 !important; transform: none !important; }
  .barrow .fill { transform: none; }
}
