.viz-root {
  color-scheme: light;
  --page: #f6f5f2;
  --surface-1: #fcfcfb;
  --flag-ring: rgba(0, 0, 0, .14);
  --border: #e4e2dc;
  --grid: #ebe9e4;
  --axis: #c9c7bf;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77766f;
  --accent: #2a78d6;
  --good-text: #006300;
  --bad-text: #b42323;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --ref: #a3a199;
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    color-scheme: dark;
    --page: #121211;
    --surface-1: #1a1a19;
    --flag-ring: rgba(255, 255, 255, .22);
    --border: #2e2e2b;
    --grid: #2a2a28;
    --axis: #4a4a46;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #96958c;
    --accent: #3987e5;
    --good-text: #4cc24c;
    --bad-text: #ee8080;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --ref: #6b6a64;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #f6f5f2; }
@media (prefers-color-scheme: dark) { body { background: #121211; } }
.viz-root {
  min-height: 100vh;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.top { padding: 14px 0 12px; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--text-primary); text-decoration: none; font-size: 16px; }
.brand span { color: var(--text-muted); font-weight: 500; }
.nav-links { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 14px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a[aria-current="page"] { color: var(--text-primary); border-bottom-color: var(--accent); }
.crumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.crumbs a { color: var(--text-secondary); }
a { color: var(--accent); }
table.countries th a { color: var(--text-primary); text-decoration: none; border-bottom: 1px dotted var(--axis); }
table.countries th a:hover { color: var(--accent); }
.faq-item h3 { font-size: 15px; margin: 16px 0 4px; color: var(--text-primary); }
.faq-item p, .prose p, .prose li { margin: 0 0 8px; color: var(--text-secondary); max-width: 75ch; }
.prose h3 { font-size: 15px; margin: 16px 0 4px; color: var(--text-primary); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 10px 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; color: var(--text-secondary); }
.foot h2 { font-size: 13px; margin: 0 0 6px; color: var(--text-secondary); }
.country-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media (max-width: 520px) { .nav { gap: 8px; } .facts { grid-template-columns: 1fr; } }
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.01em; }
.lede { margin: 0; color: var(--text-secondary); max-width: 62ch; }

.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0; position: sticky; top: 0; z-index: 5; background: var(--page); }
.filters-label { font-size: 13px; color: var(--text-secondary); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-1); }
.seg button {
  font: inherit; font-size: 13px; padding: 6px 12px; border: 0; background: transparent;
  color: var(--text-secondary); cursor: pointer; border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.seg button:focus-visible, .chip:focus-visible, .chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.asof { font-size: 13px; color: var(--text-muted); margin-left: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 45%), 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile .label { font-size: 13px; color: var(--text-secondary); }
.tile .value { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 4px 0 2px; }
.tile .delta { font-size: 13px; color: var(--text-muted); }
.tile .delta b { font-weight: 600; }
.tile .delta b { color: var(--text-primary); }
.tile .note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
/* Basispunkte zusätzlich als Prozentpunkte */
.tile .pp { font-size: 13px; color: var(--text-secondary, var(--text-muted)); margin: -2px 0 4px; }
td .pp { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.section-title { font-size: 22px; margin: 32px 0 4px; }
.section-lede { margin: 0 0 14px; color: var(--text-secondary); max-width: 70ch; font-size: 14px; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 18px 18px 12px; margin-bottom: 16px; min-width: 0; }
.card h2 { font-size: 17px; margin: 0; }
.card h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text-secondary); font-weight: 600; }
.sub { margin: 2px 0 10px; font-size: 13px; color: var(--text-secondary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin-bottom: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
/* Landesflaggen (assets/flags.svg, in jede Seite eingebettet) */
.flag-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.flag { display: inline-block; width: 18px; height: 12px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px var(--flag-ring); vertical-align: -1px; overflow: hidden; }
.nav-links a .flag { margin-right: 5px; }
.tooltip .r span.n .flag, th .flag { margin-right: 6px; }
.chart .flag-ring { fill: none; stroke: var(--flag-ring); stroke-width: 1; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2px solid; border-radius: 2px; }
.key.dash { border-top-style: dashed; }
.chips .chip {
  font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
}
.chips .chip[aria-pressed="false"] { color: var(--text-muted); }
.chips .chip[aria-pressed="false"] .key { border-top-color: var(--axis) !important; }
.chips .chip[aria-pressed="true"] { color: var(--text-primary); border-color: var(--axis); }

.chart { position: relative; height: 300px; }
.chart.short { height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { font-size: 11px; fill: var(--text-muted); }
.chart .endlabel { font-size: 12px; fill: var(--text-secondary); }
.chart .leader { fill: none; stroke: var(--axis); stroke-width: 1; }
.chart .endlabel tspan.v { fill: var(--text-primary); font-weight: 600; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--axis); stroke-width: 1; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .xhair { stroke: var(--axis); stroke-width: 1; }
.chart .dot { stroke: var(--surface-1); stroke-width: 2; }
.chart .empty { font-size: 13px; fill: var(--text-muted); }

.tooltip {
  position: fixed; z-index: 20; pointer-events: none; min-width: 150px;
  background: var(--surface-1, #fcfcfb); color: var(--text-primary, #0b0b0b);
  border: 1px solid var(--border, #e4e2dc); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); font: 12px/1.4 system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.tooltip .t { color: var(--text-secondary, #52514e); margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 8px; }
.tooltip .r b { font-weight: 600; min-width: 64px; }
.tooltip .r span.n { color: var(--text-secondary, #52514e); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 600; }
td.num, th.num { text-align: right; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

.foot { font-size: 12px; color: var(--text-muted); padding-top: 8px; padding-bottom: 40px; }
.foot a { color: var(--text-secondary); }

@media (max-width: 520px) {
  .tile { padding: 12px; }
  .tile .value { font-size: 22px; }
  .tile .label, .tile .delta { font-size: 12px; }
  .card { padding: 14px 12px 8px; }
  .asof { margin-left: 0; width: 100%; }
}

.optout { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 8px 0; max-width: 75ch; }
.optout label { display: flex; gap: 10px; align-items: flex-start; color: var(--text-primary); cursor: pointer; }
.optout input { margin-top: 4px; }

.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; max-width: 760px; margin: 0 auto;
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16); padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.consent p { margin: 0; flex: 1 1 320px; font-size: 14px; color: var(--text-secondary); }
.consent-buttons { display: flex; gap: 8px; }
.consent button {
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--surface-1); color: var(--accent); min-width: 110px;
}
.consent button:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-1)); }
.consent button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ratgeber */
.article { padding: 22px 24px 18px; }
.article h2 { font-size: 20px; margin: 26px 0 8px; }
.article h2:first-of-type { margin-top: 8px; }
.article p, .article li { color: var(--text-secondary); font-size: 15.5px; line-height: 1.65; max-width: 72ch; }
.article ol, .article ul { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article strong { color: var(--text-primary); }
.article table { font-size: 14px; margin: 8px 0 12px; }
.article caption { caption-side: bottom; text-align: left; font-size: 12px; color: var(--text-muted); padding-top: 6px; }
.article td { white-space: normal; }
.article-meta { font-size: 12.5px !important; color: var(--text-muted) !important; margin-bottom: 4px; }
.disclaimer { font-size: 13px !important; color: var(--text-muted) !important; border-top: 1px solid var(--grid); padding-top: 12px; margin-top: 24px; }
.article .faq { margin-top: 28px; }
.related ul, .article-list { list-style: none; padding: 0; margin: 8px 0 0; }
.related li { padding: 6px 0; border-bottom: 1px solid var(--grid); }
.related li:last-child { border-bottom: 0; }
.related a { text-decoration: none; font-weight: 600; }
.article-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.article-list .card { margin: 0; }
.article-list h2 { font-size: 17px; margin: 0 0 6px; }
.article-list h2 a { color: var(--text-primary); text-decoration: none; }
.article-list h2 a:hover { color: var(--accent); }
.article-list p { margin: 0; color: var(--text-secondary); font-size: 14px; }

/* Partner-Box */
.partner-box { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 10px; margin: 22px 0; background: color-mix(in srgb, var(--accent) 4%, var(--surface-1)); max-width: 72ch; }
.partner-box h3 { margin: 0 0 4px; font-size: 16px; color: var(--text-primary); }
.partner-box > p { font-size: 14px !important; margin: 0 0 10px; }
.partner-box ul { list-style: none; padding: 0 !important; margin: 0; }
.partner-box li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--grid); margin: 0 !important; }
.partner-box li div { display: flex; flex-direction: column; }
.partner-box li span { font-size: 13px; color: var(--text-muted); }
.partner-box .btn { flex: none; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; background: var(--surface-1); }
.partner-box .btn:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-1)); }
.partner-box .ad-label { position: absolute; top: 10px; right: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.partner-box .aff-mark { color: var(--text-muted); margin-left: 2px; font-size: 13px !important; }
.partner-box .partner-risk { font-size: 14px !important; color: var(--text-secondary) !important; margin: 10px 0 0 !important; padding-top: 10px; border-top: 1px solid var(--grid); }
.partner-note { font-size: 12px !important; color: var(--text-muted) !important; margin: 8px 0 4px !important; }
@media (max-width: 520px) { .article { padding: 16px 14px; } .partner-box li { flex-direction: column; align-items: flex-start; } }

.article .sources { margin-top: 28px; border-top: 1px solid var(--grid); padding-top: 8px; }
.article .sources h2 { font-size: 15px; margin: 8px 0 6px; }
.article .sources li, .article .sources p { font-size: 13px; line-height: 1.5; color: var(--text-muted); margin-bottom: 3px; }

/* Diagramme in Ratgebern */
.article-chart { margin: 18px 0 22px; }
.article-chart h3 { font-size: 14px; margin: 14px 0 4px; }
.article-chart details { margin-top: 8px; font-size: 14px; }
.article-chart summary { cursor: pointer; color: var(--text-secondary); }
.ad-inline { font-size: 12px; color: var(--text-muted); }
