/* strecka | Visuelle Bausteine für Wissensartikel (nur auf Seiten, die sie nutzen)
   Farben der Diagramme mit dem dataviz-Validator geprüft (hell auf #FFFFFF, dunkel auf #121D20):
   Fahrtenbuch = Petrol, 1-%-Regelung = Bernstein. */
:root { --wv-fb: #0F8C7A; --wv-pz: #C28A1C; --wv-grid: rgba(14, 26, 28, 0.08); --wv-axis: rgba(14, 26, 28, 0.18); }
@media (prefers-color-scheme: dark) { :root { --wv-fb: #1FA68F; --wv-pz: #BC8628; --wv-grid: rgba(255, 255, 255, 0.08); --wv-axis: rgba(255, 255, 255, 0.2); } }

/* Kennzahlen-Kacheln */
.wv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 32px; }
.wv-stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.wv-stat b { display: block; font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); }
.wv-stat span { display: block; margin-top: 6px; color: var(--ink-3); font-size: 0.88rem; line-height: 1.35; }

/* Vergleichstabelle mit Vorteil-Markierung */
.wissen table.compare td .wv-plus { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.wv-plus::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--petrol-soft-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F8C7A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.wv-legend-note { font-size: 0.85rem; color: var(--ink-3); margin-top: -8px; }

/* Rechner */
.wv-calc { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); margin: 20px 0 28px; }
.wv-calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; }
.wv-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.wv-field .wv-in { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); overflow: hidden; }
.wv-field .wv-in:focus-within { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-soft); }
.wv-field input[type="number"], .wv-field select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 600 1rem/1.2 var(--font); padding: 11px 12px; font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none; -moz-appearance: textfield; }
.wv-field input::-webkit-outer-spin-button, .wv-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wv-field select { cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636F75' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; padding-right: 32px; }
.wv-field select option { color: #0E1A1C; }
.wv-field input:focus, .wv-field select:focus { outline: none; }
.wv-unit { padding: 0 12px; color: var(--ink-3); font-size: 0.9rem; font-weight: 600; }
.wv-hint { display: block; margin-top: 5px; font-size: 0.78rem; color: var(--ink-3); line-height: 1.35; }
.wv-range { grid-column: 1 / -1; }
.wv-range-head { display: flex; justify-content: space-between; align-items: baseline; }
.wv-range-head output { font-weight: 700; color: var(--petrol-text); font-variant-numeric: tabular-nums; }
.wv-range input[type="range"] { width: 100%; accent-color: var(--petrol); margin: 8px 0 0; }

.wv-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 22px; }
.wv-res { position: relative; border-radius: var(--radius-sm); padding: 16px 18px 16px 22px; background: var(--bg); border: 1px solid var(--line); }
.wv-res::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.wv-res.fb::before { background: var(--wv-fb); }
.wv-res.pz::before { background: var(--wv-pz); }
.wv-res small { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-3); }
.wv-res b { display: block; margin-top: 4px; font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -0.03em; color: var(--ink); }
.wv-res span { display: block; font-size: 0.8rem; color: var(--ink-3); margin-top: 2px; }
.wv-res.is-better { border-color: var(--petrol); background: var(--petrol-soft); }
.wv-res .wv-badge { position: absolute; top: 12px; right: 12px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--petrol-ink); background: var(--petrol-soft-2); border-radius: 999px; padding: 4px 9px; display: none; }
.wv-res.is-better .wv-badge { display: inline-block; }
.wv-verdict { margin: 16px 0 0; font-size: 1.02rem; color: var(--ink); }
.wv-verdict strong { color: var(--ink); }
.wv-notes { margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--ink-3); }
.wv-notes li { margin-top: 4px; padding-left: 18px; position: relative; }
.wv-notes li::before { content: "i"; position: absolute; left: 0; top: 1px; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--ink-3); font: 700 9px/12px var(--font); text-align: center; }

/* Diagramm */
.wv-figure { margin: 20px 0 8px; }
.wv-figure figcaption { font-size: 0.85rem; color: var(--ink-3); margin-top: 8px; }
.wv-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 8px; }
.wv-chart-head strong { font-size: 1rem; color: var(--ink); }
.wv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--ink-2); }
.wv-legend span { display: inline-flex; align-items: center; gap: 7px; }
.wv-legend i { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.wv-chart { position: relative; width: 100%; height: 320px; }
.wv-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wv-chart text { font-family: var(--font); fill: var(--ink-3); font-size: 12px; }
.wv-chart .wv-lbl { fill: var(--ink); font-weight: 700; font-size: 12.5px; paint-order: stroke; stroke: var(--bg-elev); stroke-width: 4px; stroke-linejoin: round; }
.wv-tip { position: absolute; pointer-events: none; background: var(--bg-elev); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 0.82rem; color: var(--ink-2); min-width: 180px; opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; z-index: 2; }
.wv-tip.on { opacity: 1; transform: none; }
.wv-tip .h { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.wv-tip .r { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.wv-tip .r i { width: 12px; height: 2px; border-radius: 2px; }
.wv-tip .r b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.wv-table-toggle { margin-top: 10px; font-size: 0.85rem; }
.wv-table-toggle summary { cursor: pointer; color: var(--petrol-text); font-weight: 600; }
.wv-table-toggle .tab { margin-top: 10px; }

/* Heatmap-Tabelle (sequenziell, ein Farbton) */
.wv-heat td.h { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-left: 2px solid var(--bg-elev); }
.wv-heat th.c { text-align: center; }
.wv-heat-legend { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--ink-3); margin: 8px 0 22px; }
.wv-heat-legend .bar { flex: 0 1 220px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #E3F2EF, #B9E2D9, #7CC8B8, #1D8070, #0A5C54); }

/* Balken in Tabellen (Beispiele) */
.wv-mini { display: grid; gap: 5px; min-width: 160px; }
.wv-mini div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 0.82rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.wv-mini i { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 2px; }
.wv-mini .pz i { background: var(--wv-pz); }
.wv-mini .fb i { background: var(--wv-fb); }
.wv-win { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.wv-win.fb { background: var(--petrol-soft-2); color: var(--petrol-ink); }
.wv-win.pz { background: rgba(194, 138, 28, 0.16); color: #7A560F; }
@media (prefers-color-scheme: dark) { .wv-win.pz { background: rgba(224, 170, 67, 0.18); color: #F0C878; } }

/* Entscheidungshilfe */
.wv-flow { list-style: none; margin: 18px 0 24px; padding: 0; counter-reset: wvq; }
.wv-flow > li { position: relative; padding: 0 0 18px 46px; counter-increment: wvq; }
.wv-flow > li::before { content: counter(wvq); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--petrol); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 0.95rem; }
@media (prefers-color-scheme: dark) { .wv-flow > li::before { color: #0B1416; } }
.wv-flow > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--line-2); }
.wv-flow > li:last-child::after { display: none; }
.wv-flow .q { font-weight: 700; color: var(--ink); padding-top: 5px; }
.wv-flow .a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wv-flow .a span { font-size: 0.88rem; border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; background: var(--bg-elev); color: var(--ink-2); }
.wv-flow .a span b { color: var(--ink); }
.wv-flow .a span.end { border-color: var(--petrol); background: var(--petrol-soft); }

/* Zeitleiste */
.wv-time { position: relative; margin: 22px 0 28px; padding: 34px 0 0; }
.wv-time .track { position: relative; height: 10px; border-radius: 5px; background: var(--bg-elev-2); }
.wv-time .track::before { content: ""; position: absolute; inset: 0; border-radius: 5px; background: linear-gradient(90deg, var(--petrol-soft-2), var(--petrol-soft)); }
.wv-time .m { position: absolute; top: -26px; transform: translateX(-50%); font-size: 0.75rem; color: var(--ink-3); }
.wv-time .pin { position: absolute; top: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--petrol); border: 3px solid var(--bg); transform: translateX(-50%); }
.wv-time ol { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.wv-time ol li { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 0.9rem; color: var(--ink-2); }
.wv-time ol li b { display: block; color: var(--ink); margin-bottom: 4px; }
.wv-time ol li .tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; vertical-align: 1px; background: var(--petrol-soft-2); color: var(--petrol-ink); }
.wv-time ol li.no .tag { background: var(--bg-elev-2); color: var(--ink-3); }

/* Hinweisbox */
.wv-box { border: 1px solid var(--line); border-left: 4px solid var(--petrol); border-radius: 12px; background: var(--bg-elev); padding: 14px 18px; margin: 18px 0 24px; }
.wv-box p { margin: 0; }
.wv-box p + p { margin-top: 8px; }
.wv-formel { display: block; margin: 10px 0; padding: 14px 16px; border-radius: 12px; background: var(--bg-elev-2); font-weight: 700; color: var(--ink); font-size: 1.05rem; text-align: center; }

@media (prefers-reduced-motion: reduce) { .wv-tip { transition: none; } }

/* Heatmap-Stufen (ein Farbton, hell -> dunkel) */
.wv-heat td.q1 { background: #E3F2EF; color: #0E1A1C; }
.wv-heat td.q2 { background: #B9E2D9; color: #0E1A1C; }
.wv-heat td.q3 { background: #7CC8B8; color: #0E1A1C; }
.wv-heat td.q4 { background: #1D8070; color: #FFFFFF; }
.wv-heat td.q5 { background: #0A5C54; color: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  .wv-heat td.q1 { background: #16302C; color: #C3CDD1; }
  .wv-heat td.q2 { background: #1D4A42; color: #E6EEF0; }
  .wv-heat td.q3 { background: #23685B; color: #FFFFFF; }
  .wv-heat td.q4 { background: #29A18B; color: #0B1416; }
  .wv-heat td.q5 { background: #2FC4AA; color: #0B1416; }
  .wv-heat-legend .bar { background: linear-gradient(90deg, #16302C, #1D4A42, #23685B, #29A18B, #2FC4AA); }
}
.wv-time .pin.no { background: var(--bg-elev-2); border-color: var(--bg); box-shadow: inset 0 0 0 2px var(--ink-3); }

/* Tabellen: schmale Varianten und gestapelte Mobilansicht */
.tab table.compare.fit { min-width: 0; }
.wv-heat .sm { display: none; }
.wv-legend-top { margin: 4px 0 -6px; }
@media (max-width: 600px) {
  .tab table.compare.stack, .tab table.compare.wv-bsp, .tab table.compare.wv-heat { min-width: 0; }
  table.compare.stack thead, table.compare.wv-bsp thead { display: none; }
  table.compare.stack, table.compare.stack tbody, table.compare.stack tr, table.compare.stack td { display: block; }
  table.compare.stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.compare.stack tr:last-child { border-bottom: 0; }
  .tab table.compare.stack td { border: 0; padding: 4px 0; }
  .tab table.compare.stack td:first-child { padding: 0 0 6px; font-size: 1rem; }
  table.compare.stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
  .tab table.compare.stack td.strecka { margin-top: 6px; padding: 8px 10px; border-radius: 10px; }
  table.compare.wv-bsp, table.compare.wv-bsp tbody { display: block; }
  table.compare.wv-bsp tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.compare.wv-bsp tr:last-child { border-bottom: 0; }
  .tab table.compare.wv-bsp td { display: block; border: 0; padding: 0; }
  .tab table.compare.wv-bsp td:first-child { grid-column: 1 / -1; padding: 0; }
  table.compare.wv-bsp td:last-child { text-align: right; }
  .wv-mini { min-width: 0; }
  .tab table.wv-heat { table-layout: fixed; }
  .tab table.wv-heat th, .tab table.wv-heat td { padding: 10px 2px; font-size: 0.75rem; white-space: nowrap; text-align: center; }
  .tab table.wv-heat th:first-child { width: 68px; padding-left: 10px; text-align: left; }
  .tab table.wv-heat thead th:first-child { white-space: normal; }
  .tab table.compare.fit th, .tab table.compare.fit td { padding: 10px 12px; }
  .wv-heat .lg { display: none; }
  .wv-heat .sm { display: inline; }
}
