/* Design tokens taken from shadcn/ui's default theme (as used by the
   shadcnblocks "Mainline" template) — oklch values, --radius scale,
   shadow scale — adapted to this page's two-tier page/card surfaces. */
body {
  color-scheme: light;
  --background:        oklch(0.985 0 0);
  --card:               oklch(1 0 0);
  --foreground:         oklch(0.145 0 0);
  --muted:              oklch(0.97 0 0);
  --muted-foreground:   oklch(0.556 0 0);
  --border:             oklch(0.922 0 0);
  --primary:            oklch(0.92 0.04 86.47);
  --primary-foreground: oklch(0.31 0.02 86.64);
  --accent:             oklch(0.97 0 0);
  --accent-foreground:  oklch(0.205 0 0);
  --ring:               oklch(0.708 0 0);
  --radius: 8px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --series-1: #2a78d6; /* overall — blue */
  --series-2: #eb6834; /* orange */
  --series-3: #1baf7a; /* aqua */
  --series-4: #eda100; /* yellow */
  --series-5: #e87ba4; /* magenta */
  --series-6: #008300; /* green */
  --series-7: #4a3aa7; /* violet */
  --series-8: #e34948; /* red */
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) body {
    color-scheme: dark;
    --background:        oklch(0.145 0 0);
    --card:               oklch(0.205 0 0);
    --foreground:         oklch(0.985 0 0);
    --muted:              oklch(0.269 0 0);
    --muted-foreground:   oklch(0.708 0 0);
    --border:             oklch(1 0 0 / 10%);
    --primary:            oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --accent:             oklch(0.269 0 0);
    --accent-foreground:  oklch(0.985 0 0);
    --ring:               oklch(0.556 0 0);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}
:root[data-theme="dark"] body {
  color-scheme: dark;
  --background:        oklch(0.145 0 0);
  --card:               oklch(0.205 0 0);
  --foreground:         oklch(0.985 0 0);
  --muted:              oklch(0.269 0 0);
  --muted-foreground:   oklch(0.708 0 0);
  --border:             oklch(1 0 0 / 10%);
  --primary:            oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --accent:             oklch(0.269 0 0);
  --accent-foreground:  oklch(0.985 0 0);
  --ring:               oklch(0.556 0 0);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

body { --status-good: #0ca30c; --status-critical: #d03b3b; --status-warning: #b45309; --status-warning-bg: rgba(180, 83, 9, 0.15); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}
h1, h2 {
  font-family: "DM Sans", "Inter", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.viz-root { max-width: 1040px; margin: 0 auto; padding: 40px 20px 56px; }

header.page-header { margin-bottom: 28px; }
header.page-header h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
header.page-header h1 .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  background: var(--primary); color: var(--primary-foreground);
  flex: none;
}
header.page-header h1 .brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
header.page-header p { margin: 0; color: var(--muted-foreground); font-size: 0.95rem; }
header.page-header a { color: inherit; }
.page-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-header-top h1 { flex: 1 1 auto; min-width: 200px; }

.tg-promo {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 8px 14px 8px 8px;
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: var(--card); text-decoration: none; color: inherit;
  transition: border-color 120ms ease;
}
.tg-promo:hover { border-color: #29a9eb; }
.tg-promo-qr { width: 52px; height: 52px; flex: none; display: block; }
.tg-promo-copy { display: flex; flex-direction: column; gap: 2px; max-width: 320px; }
.tg-promo-copy > span:first-child { font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.4; }
.tg-promo-handle { font-size: 0.8125rem; font-weight: 600; color: #29a9eb; }

.btn {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--accent); color: var(--accent-foreground); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.btn[aria-pressed="true"]:hover { background: var(--primary); opacity: 0.9; }

.lang-switcher { display: flex; gap: 4px; flex: none; }
.lang-btn { padding: 0 10px; }

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filters .label { color: var(--muted-foreground); font-size: 0.8125rem; margin-right: 4px; }
.table-toggle { margin-left: auto; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-sm);
  padding: 24px 24px 14px;
}
.chart-wrap { position: relative; transition: opacity 120ms ease; }
.chart-wrap.loading { opacity: 0.5; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
.gridline { stroke: var(--border); stroke-width: 1; }
.baseline { stroke: var(--muted-foreground); stroke-width: 1; opacity: 0.4; }
.axis-label { fill: var(--muted-foreground); font-size: 11px; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-line.dashed { stroke-dasharray: 5 4; }
.series-end-dot { stroke: var(--card); stroke-width: 2; }
.series-end-label { font-size: 11px; fill: var(--foreground); font-weight: 600; }
.crosshair { stroke: var(--muted-foreground); stroke-width: 1; opacity: 0.5; pointer-events: none; }
.hit-layer { fill: transparent; cursor: crosshair; }
.hit-layer:focus { outline: none; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--muted-foreground); }
.legend-swatch { width: 16px; height: 2px; border-radius: 1px; flex: none; }

.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--foreground);
  color: var(--background);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 10px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: opacity 100ms ease;
  white-space: nowrap;
  z-index: 5;
}
.tooltip.visible { opacity: 1; }
.tooltip .tt-date { color: var(--background); opacity: 0.6; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.tooltip .tt-row + .tt-row { margin-top: 3px; }
.tooltip .tt-key { width: 12px; height: 2px; flex: none; }
.tooltip .tt-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip .tt-name { color: var(--background); opacity: 0.6; }

.state-msg { padding: 40px 0; text-align: center; color: var(--muted-foreground); }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 12px;
}
table.data-table th, table.data-table td {
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.price-cell { white-space: nowrap; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table thead th {
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td { background: var(--muted); }
.hidden { display: none; }

.section-title { font-size: 1.2rem; margin: 40px 0 14px; }
.table-scroll { overflow-x: auto; }
table.summary-table th:nth-child(-n+4):not(:first-child),
table.summary-table td:nth-child(-n+4):not(:first-child) { text-align: left; }
table.summary-table th:first-child,
table.summary-table td:first-child { text-align: center; width: 1%; white-space: nowrap; }
.summary-table a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.summary-table a:hover { text-decoration-color: currentColor; }
.chart-checkbox { width: 16px; height: 16px; accent-color: var(--foreground); cursor: pointer; vertical-align: middle; }
.chart-checkbox:disabled { cursor: not-allowed; opacity: 0.4; }
.delta-good { color: var(--status-good); }
.delta-bad { color: var(--status-critical); }
.delta-muted { color: var(--muted-foreground); }
tr.row-stale { opacity: 0.6; }
.page-header .vat-notice {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--status-warning);
}
.page-header .legal-notice {
  margin: 8px 0 0;
  font-size: 0.6333rem;
  color: var(--muted-foreground);
  text-align: justify;
}
.stale-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

footer.page-footer { margin-top: 28px; font-size: 0.8rem; color: var(--muted-foreground); }
footer.page-footer a { color: inherit; }
.link-btn {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { text-decoration-color: currentColor; }

.consent-banner.hidden { display: none; }
.consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px -4px rgb(0 0 0 / 0.12);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.consent-banner p { margin: 0; flex: 1 1 260px; font-size: 0.85rem; color: var(--foreground); }
.consent-actions { display: flex; gap: 8px; flex: none; }
