/* Preisstatistik: Diagramme und Kennzahlen. Farben kommen aus --ch-* (vom jeweiligen Seitenstil gesetzt). */
.stat, .de-card, .cmp {
  --ch-ink: var(--ink, #1c2024);
  --ch-muted: var(--muted, #5c5f63);
  --ch-grid: var(--line, #d9d4cc);
  --ch-surface: var(--raised, #fff);
  --ch-sunken: var(--sunken, #e6e2dc);
  --ch-border: var(--line-2, #c4beb4);
  --ch-series: #2456d6;
  --ch-band: rgba(36, 86, 214, .16);
  --ch-focus: var(--focus, #2456d6);
  --ch-font-display: var(--font-display, 'Syne', sans-serif);
  --ch-font-text: var(--font-text, 'DM Sans', sans-serif);
}
:root[data-theme="dark"] .stat, :root[data-theme="dark"] .de-card, :root[data-theme="dark"] .cmp { --ch-series: #8db1ff; --ch-band: rgba(141, 177, 255, .2); }

.ch-sr, .pf-sr, .lc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.stat { container: stat / inline-size; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; color: var(--ch-ink); font-family: var(--ch-font-text); min-width: 0; }
.stat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.stat-title { font-family: var(--ch-font-display); font-weight: 800; font-size: 1rem; letter-spacing: -.005em; margin: 0; }
.stat-seg { display: inline-flex; padding: 3px; border: 1.5px solid var(--ch-border); border-radius: 10px; background: var(--ch-surface); }
.stat-seg button { border: 0; background: transparent; color: var(--ch-ink); font: 600 .86rem var(--ch-font-text); padding: 7px 13px; border-radius: 7px; cursor: pointer; line-height: 1.2; min-height: 34px; }
.stat-seg button:hover { background: var(--ch-sunken); }
.stat-seg button[aria-pressed="true"] { background: var(--ch-ink); color: var(--ch-surface); }
.stat-seg button:focus-visible, .stat-retry:focus-visible, .de-tile:focus-visible, .ch:focus-visible, .pf:focus-visible, .lcw:focus-visible, .stat-pdf:focus-visible { outline: 3px solid var(--ch-focus); outline-offset: 2px; }
.stat-msg { background: var(--ch-sunken); border-radius: 10px; padding: 12px 14px; color: var(--ch-ink); font-size: .92rem; margin: 0; }
.stat-retry { border: 1.5px solid var(--ch-border); background: transparent; color: var(--ch-ink); border-radius: 8px; padding: 5px 10px; font: 600 .86rem var(--ch-font-text); margin-left: 6px; cursor: pointer; }

/* Diagramm */
.ch { position: relative; min-width: 0; border-radius: 8px; }
.ch-plot { line-height: 0; }
.ch-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--ch-grid); stroke-width: 1; }
.ch-grid-v { stroke-dasharray: 2 3; }
.ch-tick { stroke: var(--ch-border); stroke-width: 1; }
.ch-tx { fill: var(--ch-muted); font: 500 11px var(--ch-font-text); }
.ch-line { fill: none; stroke: var(--ch-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-band { fill: var(--ch-band); stroke: none; }
.ch-band-line { stroke: var(--ch-band); stroke-width: 6; stroke-linecap: round; }
.ch-ref { stroke: var(--ch-muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ch-dot-fix { fill: var(--ch-series); }
.ch-guide { stroke: var(--ch-muted); stroke-width: 1; }
.ch-dot { fill: var(--ch-series); stroke: var(--ch-surface); stroke-width: 2; }
.ch-empty { margin: 0; line-height: 1.5; padding: 28px 0; text-align: center; color: var(--ch-muted); font-size: .9rem; }
.ch-tip, .pf-tip, .lc-tip { position: absolute; z-index: 3; pointer-events: none; display: grid; gap: 1px; padding: 7px 10px; line-height: 1.3; background: var(--ch-surface); color: var(--ch-ink); border: 1px solid var(--ch-border); border-radius: 9px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .35); font-size: .8rem; white-space: nowrap; max-width: calc(100% - 4px); }
.ch-tip[hidden], .pf-tip[hidden], .lc-tip[hidden] { display: none; }
.ch-tip b, .pf-tip b, .lc-tip b { font-weight: 600; }
.ch-tip-p, .pf-tip .ch-tip-p { font-family: var(--ch-font-display); font-weight: 800; font-size: 1.05rem; }
.ch-tip sup, .pf-tip sup, .stat-facts sup, .de-med sup, .de-p sup { font-size: .6em; position: relative; top: -.5em; vertical-align: baseline; line-height: 0; margin-left: 1px; }
.ch-tip-s, .pf-tip .ch-tip-s { color: var(--ch-muted); font-size: .76rem; }

.ch-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--ch-muted); }
.ch-legend li { display: inline-flex; align-items: center; gap: 7px; }
.ch-legend i { display: inline-block; width: 20px; height: 0; }
.ch-legend .lg-line { border-top: 2px solid var(--ch-series); }
.ch-legend .lg-band { height: 10px; background: var(--ch-band); border-radius: 2px; }
.ch-legend .lg-ref { border-top: 2px dashed var(--ch-muted); }

.stat-table summary, .zt-table summary { cursor: pointer; font-size: .86rem; font-weight: 600; padding: 6px 0; width: fit-content; }
.stat-table summary:focus-visible, .zt-table summary:focus-visible { outline: 3px solid var(--ch-focus); outline-offset: 2px; border-radius: 4px; }
.stat-table-body, .zt-table-body { max-height: 240px; overflow: auto; margin-top: 6px; border: 1px solid var(--ch-grid); border-radius: 8px; }
.stat-table table, .zt-tbl { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.stat-table th, .stat-table td, .zt-tbl th, .zt-tbl td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--ch-grid); font-weight: 500; }
.stat-table th[scope="row"], .stat-table thead th:first-child, .zt-tbl th[scope="row"], .zt-tbl thead th:first-child { text-align: left; }
.stat-table thead th, .zt-tbl thead th { position: sticky; top: 0; background: var(--ch-sunken); font-weight: 600; }

.stat-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .93rem; }
.stat-facts li { padding-left: 14px; position: relative; line-height: 1.4; }
.stat-facts li::before { content: ''; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 2px; background: var(--ch-series); }
.stat-facts b { font-weight: 700; }
.stat-foot { margin: 0; font-size: .78rem; color: var(--ch-muted); }

/* Deutschland heute */
.de-card { background: var(--surface, #fbfaf8); border: 1px solid var(--line, #d9d4cc); border-radius: var(--radius, 14px); padding: 20px; box-shadow: var(--shadow, none); color: var(--ch-ink); display: grid; gap: 16px; }
.de-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.de-head h2 { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); margin: 0; }
.de-stand { margin: 0; color: var(--ch-muted); font-size: .86rem; }
.de-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px 28px; align-items: start; }
.de-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.de-tile { display: grid; gap: 2px; text-align: left; padding: 12px 12px 10px; border-radius: 12px; border: 1.5px solid var(--ch-border); background: var(--ch-surface); color: var(--ch-ink); cursor: pointer; font: inherit; min-width: 0; align-content: start; }
.de-tile:hover { border-color: var(--ch-ink); }
.de-tile[aria-pressed="true"] { border-color: var(--ch-ink); box-shadow: inset 0 0 0 1px var(--ch-ink); }
.de-fuel { font-family: var(--ch-font-display); font-weight: 700; font-size: .95rem; }
.de-med { font-family: var(--ch-font-display); font-weight: 800; font-size: 1.55rem; line-height: 1.1; letter-spacing: -.02em; display: inline-flex; align-items: baseline; gap: 4px; }
.de-med small { font: 500 .72rem var(--ch-font-text); color: var(--ch-muted); letter-spacing: 0; }
.de-sub { font-size: .78rem; color: var(--ch-muted); }
.de-spark { width: 100%; height: 34px; margin-top: 6px; display: block; }
.de-spark path { fill: none; stroke: var(--ch-series); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.de-cheap h3 { font-size: .95rem; margin: 0 0 8px; }
.de-list { list-style: none; margin: 0; padding: 0; display: grid; }
.de-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ch-grid); }
.de-list li:last-child { border-bottom: 0; }
.de-list a, .de-row { display: grid; padding: 9px 0; text-decoration: none; color: inherit; min-width: 0; flex: 1; }
.de-list a:hover .de-name { text-decoration: underline; }
.de-name { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.de-city { color: var(--ch-muted); font-size: .84rem; }
.de-p { font-family: var(--ch-font-display); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
@media (max-width: 760px) {
  .de-grid { grid-template-columns: 1fr; }
  .de-card { padding: 16px; }
  .de-med { font-size: 1.3rem; }
  .de-tile { padding: 10px 9px 8px; }
}
@media (max-width: 400px) { .de-sub { font-size: .72rem; } }
@media (max-width: 480px) {
  .de-tiles { gap: 6px; }
  .de-med { font-size: 1.12rem; letter-spacing: -.03em; }
  .de-med small { display: none; }
  .de-tile { padding: 9px 8px 8px; overflow: hidden; }
}

/* ---------- Farben für Zeitprofil, Vergleich und Druck ---------- */
.stat, .de-card, .cmp { --ch-low: #15803f; --ch-high: #c0392b; --ch-neutral: #7d8896; --lc-0: #2456d6; --lc-1: #b0307f; --lc-2: #0b7285; }
:root[data-theme="dark"] .stat, :root[data-theme="dark"] .de-card, :root[data-theme="dark"] .cmp { --ch-low: #34c77b; --ch-high: #ff7262; --ch-neutral: #7f8a99; --lc-0: #8db1ff; --lc-1: #f08fd0; --lc-2: #4fd1da; }

/* Zwei Spalten, wenn der Platz reicht (Diagramm neben „Beste Zeit“); sonst untereinander */
.stat-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.stat-col { display: grid; gap: 10px; min-width: 0; align-content: start; }
.stat-col + .stat-col { border-top: 1px solid var(--ch-grid); padding-top: 18px; }
@container stat (min-width: 760px) {
  .stat-cols.has-zt { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .stat-cols.has-zt .stat-col + .stat-col { border-top: 0; padding-top: 0; border-left: 1px solid var(--ch-grid); padding-left: 32px; }
}
.stat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border-top: 1px solid var(--ch-grid); padding-top: 12px; }
.stat-pdf { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--ch-border); border-radius: 10px; background: transparent; color: var(--ch-ink); font: 600 .9rem var(--ch-font-text); cursor: pointer; }
.stat-pdf:hover { background: var(--ch-sunken); }
.stat-hint { font-size: .8rem; color: var(--ch-muted); }

/* Beste Zeit zum Tanken */
.zt { display: grid; gap: 10px; min-width: 0; }
.zt-title { font-family: var(--ch-font-display); font-weight: 800; font-size: 1rem; letter-spacing: -.005em; margin: 0; }
.pf { position: relative; min-width: 0; border-radius: 8px; }
.pf-plot { line-height: 0; }
.pf-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pf-bar { fill: var(--ch-neutral); }
.pf-bar.is-low { fill: var(--ch-low); }
.pf-bar.is-high { fill: var(--ch-high); }
.pf-null { fill: none; stroke: var(--ch-border); stroke-width: 1; stroke-dasharray: 2 2; }
.pf-mk.is-low { fill: var(--ch-low); }
.pf-mk.is-high { fill: var(--ch-high); }
.pf-rise { stroke: var(--ch-ink); stroke-width: 1.5; stroke-dasharray: 4 3; fill: none; }
.ch-tx.pf-rise-t { fill: var(--ch-ink); font-weight: 600; }
.pf-guide { fill: var(--ch-ink); opacity: .09; pointer-events: none; }
.zt-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--ch-muted); }
.zt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.zt-lead, .zt-cycle { font-size: .93rem; line-height: 1.5; margin: 0; }
.zt-cycle { padding-left: 12px; border-left: 3px solid var(--ch-ink); }
.zt-lead b, .zt-cycle b, .zt-best b { font-weight: 700; }
.zt-note, .zt-na { font-size: .78rem; color: var(--ch-muted); margin: 0; line-height: 1.45; }
.zt-msg { background: var(--ch-sunken); border-radius: 10px; padding: 12px 14px; font-size: .92rem; margin: 0; }
.zt-pick { border: 0; padding: 0; margin: 8px 0 0; min-width: 0; }
.zt-pick legend { font-family: var(--ch-font-display); font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.zt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.zt-chip { position: relative; display: block; cursor: pointer; }
.zt-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.zt-chip-b { display: grid; align-content: center; min-height: 44px; padding: 6px 12px; border: 1.5px solid var(--ch-border); border-radius: 10px; background: var(--ch-surface); line-height: 1.2; }
.zt-chip-b b { font-weight: 600; font-size: .88rem; }
.zt-chip-b small { font-size: .74rem; color: var(--ch-muted); }
.zt-chip:hover .zt-chip-b { border-color: var(--ch-ink); }
.zt-chip input:checked + .zt-chip-b { background: var(--ch-sunken); border-color: var(--ch-ink); box-shadow: inset 0 0 0 1px var(--ch-ink); }
.zt-chip input:checked + .zt-chip-b small { color: var(--ch-ink); }
.zt-chip input:checked + .zt-chip-b b::before { content: '✓ '; }
.zt-chip input:focus-visible + .zt-chip-b { outline: 3px solid var(--ch-focus); outline-offset: 2px; }
.zt-result { display: grid; gap: 8px; min-width: 0; }
.zt-best { font-size: .96rem; line-height: 1.5; margin: 0; }
.zt-rank { list-style: none; margin: 2px 0 0; padding: 0; display: grid; }
.zt-w { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n p" "b d"; gap: 5px 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--ch-grid); }
.zt-w:last-child { border-bottom: 0; }
.zt-w-n { grid-area: n; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.zt-w-n b { font-weight: 600; }
.zt-w-n small { font-size: .78rem; color: var(--ch-muted); }
.zt-w-p { grid-area: p; font-family: var(--ch-font-display); font-weight: 800; font-size: 1.02rem; white-space: nowrap; }
.zt-w-bar { grid-area: b; height: 8px; border-radius: 4px; background: var(--ch-sunken); overflow: hidden; }
.zt-w-bar i { display: block; height: 100%; border-radius: 4px; background: var(--ch-neutral); }
.zt-w.is-best .zt-w-bar i { background: var(--ch-low); }
.zt-w-p small { font: 500 .78rem var(--ch-font-text); color: var(--ch-muted); }
.zt-w-d { grid-area: d; font-size: .8rem; color: var(--ch-muted); text-align: right; white-space: nowrap; }
.zt-w.is-best .zt-w-d { color: var(--ch-ink); font-weight: 600; }

/* Deutschland heute: günstigste Stunde */
.de-time { margin: 0; font-size: .92rem; line-height: 1.5; padding-top: 14px; border-top: 1px solid var(--ch-grid); color: var(--ch-ink); }
.de-time b { font-weight: 700; }

/* Mehrere Stationen in einem Liniendiagramm */
.lcw { position: relative; min-width: 0; border-radius: 8px; }
.lc-plot { line-height: 0; }
.lc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.lc-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.lc-line.is-best { stroke-width: 3.8; }
.lc-s0 { stroke: var(--lc-0); }
.lc-s1 { stroke: var(--lc-1); stroke-dasharray: 9 5; }
.lc-s2 { stroke: var(--lc-2); stroke-dasharray: .1 6; }
.lc-m { stroke: var(--ch-surface); stroke-width: 1.4; }
.lc-m0, .lc-d0 { fill: var(--lc-0); }
.lc-m1, .lc-d1 { fill: var(--lc-1); }
.lc-m2, .lc-d2 { fill: var(--lc-2); }
.lc-dot { stroke: var(--ch-surface); stroke-width: 2; }
.lc-tip-h { font-weight: 600; }
.lc-tip-r { display: flex; align-items: center; gap: 8px; }
.lc-tip-n { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; }
.lc-tip-r b { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.lc-tip .lc-key { flex: none; }
.lc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .84rem; color: var(--ch-ink); }
.lc-legend li { display: inline-flex; align-items: center; gap: 8px; }
.lc-key { flex: none; overflow: visible; }
.lc-best { font-style: normal; font-weight: 700; font-size: .74rem; border: 1px solid var(--ch-border); border-radius: 999px; padding: 1px 8px; }

/* ---------- Druckansicht: Preisreport (A4, immer hell) ---------- */
#rptRoot { display: none; page: rpt; }
@page rpt { size: A4; margin: 13mm 14mm 14mm; background: #fff; }
#rptRoot {
  --ch-ink: #16191c; --ch-muted: #566069; --ch-grid: #d9d4cc; --ch-surface: #fff; --ch-sunken: #efece6; --ch-border: #b9b2a7;
  --ch-series: #2456d6; --ch-band: rgba(36, 86, 214, .16); --ch-focus: #2456d6;
  --ch-low: #15803f; --ch-high: #c0392b; --ch-neutral: #7d8896; --lc-0: #2456d6; --lc-1: #b0307f; --lc-2: #0b7285;
  --ch-font-display: 'Syne', 'DM Sans', sans-serif; --ch-font-text: 'DM Sans', system-ui, sans-serif;
  font-family: var(--ch-font-text); font-size: 10pt; line-height: 1.45; color: var(--ch-ink); background: #fff;
}
@media print {
  html:has(body.rpt-on), body.rpt-on { background: #fff !important; height: auto !important; overflow: visible !important; color-scheme: light !important; }
  body.rpt-on { display: block !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; color: #16191c !important; }
  body.rpt-on > *:not(#rptRoot) { display: none !important; }
  body.rpt-on #rptRoot { display: block; }
  #rptRoot, #rptRoot * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#rptRoot *, #rptRoot *::before, #rptRoot *::after { box-sizing: border-box; }
#rptRoot h1, #rptRoot h2, #rptRoot h3, #rptRoot h4 { font-family: var(--ch-font-display); font-weight: 800; letter-spacing: -.01em; margin: 0; line-height: 1.15; color: var(--ch-ink); }
#rptRoot p { margin: 0; }
#rptRoot .rp { display: flex; flex-direction: column; min-height: 258mm; }
#rptRoot .rp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding-bottom: 10px; border-bottom: 2px solid var(--ch-ink); }
#rptRoot .rp-logo { display: block; height: 30px; width: auto; }
#rptRoot .rp-head-t h1 { font-size: 17pt; }
#rptRoot .rp-head-t p { font-size: 9pt; color: var(--ch-muted); }
#rptRoot .rp-created { text-align: right; font-size: 8.5pt; color: var(--ch-muted); line-height: 1.35; }
#rptRoot .rp-created b { color: var(--ch-ink); font-weight: 600; }
#rptRoot .rp-body { flex: 1 1 auto; }
#rptRoot .rp-station { margin-top: 14px; }
#rptRoot .rp-station h2 { font-size: 15pt; }
#rptRoot .rp-station p { font-size: 10pt; color: var(--ch-ink); }
#rptRoot .rp-station .rp-sub { color: var(--ch-muted); font-size: 9pt; }
#rptRoot .rp-sec { margin-top: 14px; break-inside: avoid; }
#rptRoot .rp-sec > h3 { font-size: 11pt; margin-bottom: 6px; break-after: avoid; }
#rptRoot .rp-win { margin-top: 10px; }
#rptRoot .rp-win h4 { font-size: 10pt; margin-bottom: 4px; }
#rptRoot .rp-tbl { width: 100%; border-collapse: collapse; font-size: 9.5pt; font-variant-numeric: tabular-nums; }
#rptRoot .rp-tbl th, #rptRoot .rp-tbl td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--ch-grid); font-weight: 400; vertical-align: top; }
#rptRoot .rp-tbl thead th { background: var(--ch-sunken); font-weight: 600; font-size: 9pt; }
#rptRoot .rp-tbl th[scope="row"] { font-weight: 600; }
#rptRoot .rp-tbl .num { text-align: right; }
#rptRoot .rp-tbl tr.is-sel th, #rptRoot .rp-tbl tr.is-sel td { background: #f7f4ee; }
#rptRoot .rp-svg svg { display: block; width: 100%; height: auto; overflow: visible; }
#rptRoot .rp-text { font-size: 10pt; margin-top: 6px; }
#rptRoot .rp-note, #rptRoot .zt-note, #rptRoot .zt-na { font-size: 8.5pt; color: var(--ch-muted); margin-top: 5px; }
#rptRoot .rp-none { font-size: 9.5pt; color: var(--ch-muted); }
#rptRoot .ch-legend, #rptRoot .zt-legend, #rptRoot .lc-legend { margin-top: 6px; font-size: 8.5pt; }
#rptRoot .stat-facts { font-size: 10pt; gap: 4px; }
#rptRoot .zt-best { font-size: 10pt; }
#rptRoot .zt-w { padding: 6px 0; break-inside: avoid; }
#rptRoot .rp-foot { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--ch-border); font-size: 8pt; color: var(--ch-muted); break-inside: avoid; }
#rptRoot .rp-foot p + p { margin-top: 2px; }
#rptRoot .rp-station-cols { display: grid; gap: 4px; }
