/* Eine Familie: Literata (variabel, mit optischer Größe) – ruhig, seriös, gut lesbar */
@font-face { font-family: 'Literata'; src: url('../fonts/literata.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('../fonts/literata-italic.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --ink: #1F2421;
  --muted: #5B635E;
  --line: #E4DED3;
  --accent: #1E6B4F;
  --accent-soft: #DCEBE3;
  --accent-fill: #1E6B4F;   /* Füllfläche gefüllter Buttons */
  --tile: #FBF8F3;          /* Zahlenkacheln in Karten – im Dunkeln heller als die Karte */
  --accent-ink: #FFFFFF;
  --danger: #B4413C;
  --danger-soft: #F7E5E3;
  --band: #1F2421;
  --paid: #A8C7B6; --paid-ink: #1F2421;
  --gold: #B08A2E;          /* Rahmen für die empfohlene Wahl */
  --gold-ink: #7E6114;      /* Gold als Schrift, kontraststark */
  --apple-0: #B5493F; --apple-1: #6B9A52; --apple-2: #D2A546;  /* Obstkorb: rot, grün, gelb */
  --leaf: #4E8A3A; --stem: #6B4A2B; --rot: #7A5B3C; --rot-spot: #4A3422;
  --wicker: #BC9B68; --wicker-dark: #94764A;
  --radius: 6px;          /* eine Form für Karten, Buttons, Pillen, Felder */
  --font: 'Literata', Charter, 'Iowan Old Style', Georgia, serif;
  --fs-meta: .8125rem;   /* 13px Kleingedrucktes, Labels */
  --fs-small: .9375rem;  /* 15px Sekundärtext, Bedienelemente */
  --fs-body: 1.0625rem;  /* 17px Fließtext */
  --fs-h3: 1.375rem;     /* 22px Zwischenüberschriften, Fragen */
  --fs-h2: clamp(1.9rem, 7vw, 2.75rem);
  --fs-h1: clamp(2.5rem, 11vw, 4rem);
  color-scheme: light;
}
/* Dunkel: per System (wenn nicht manuell „Hell“) oder manuell gewählt */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151916; --surface: #1D2320; --ink: #ECEAE4; --muted: #A3ABA6; --line: #2E3631;
    --accent: #5FBF94; --accent-soft: #1F3A2F; --accent-ink: #0E1311; --accent-fill: #469873;
    --tile: #262D29;
    --danger: #E3807A; --danger-soft: #3A2423; --band: #ECEAE4; --paid: #3D5E4F; --paid-ink: #ECEAE4; --gold: #D4AF5A; --gold-ink: #E2C47A; --apple-0: #D9645A; --apple-1: #82B85C; --apple-2: #E8B95A; --leaf: #6BA453; --stem: #A07A55; --rot: #6E5640; --rot-spot: #3C2C1E; --wicker: #A9824F; --wicker-dark: #7C5E36;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151916; --surface: #1D2320; --ink: #ECEAE4; --muted: #A3ABA6; --line: #2E3631;
  --accent: #5FBF94; --accent-soft: #1F3A2F; --accent-ink: #0E1311; --accent-fill: #469873;
  --tile: #262D29;
  --danger: #E3807A; --danger-soft: #3A2423; --band: #ECEAE4; --paid: #3D5E4F; --paid-ink: #ECEAE4; --gold: #D4AF5A; --gold-ink: #E2C47A; --apple-0: #D9645A; --apple-1: #82B85C; --apple-2: #E8B95A; --leaf: #6BA453; --stem: #A07A55; --rot: #6E5640; --rot-spot: #3C2C1E; --wicker: #A9824F; --wicker-dark: #7C5E36;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.checkin legend, .chapter h1, .chapter h2 { scroll-margin-top: 80px; }
[tabindex="-1"]:focus { outline: none; } /* programmatischer Fokus für Screenreader, ohne Rahmen */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-body)/1.65 var(--font);
  hyphens: auto; overflow-wrap: break-word;
  hyphenate-limit-chars: 8 4 4;  /* erst lange Wörter trennen */
  -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4;
}
/* Große oder fette Kurztexte nie trennen */
.flip-front, .flip-back, .widget-result, .stats, .steps-done, .worries-done, .worry-q, .broker, .pager, .aha strong { hyphens: manual; }
h1, h2, h3 { line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; hyphens: manual; text-wrap: balance; }
h1 { font-size: var(--fs-h1); margin: .15em 0 .4em; }
h2 { font-size: var(--fs-h2); margin: .2em 0 .35em; }
h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.01em; margin: 1.6em 0 .5em; }
em { font-style: italic; }
h1 em { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; }
strong { font-weight: 600; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 20; display: inline-flex; align-items: center; min-height: 44px; background: var(--surface); padding: 8px 12px; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 664px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent); }
.progress { min-width: 0; height: 28px; display: flex; align-items: center; gap: 10px; justify-self: center; width: min(100%, 190px); }
.progress svg { flex: 1; min-width: 0; width: 100%; height: 100%; overflow: visible; }
.progress-count { font: 600 var(--fs-meta) var(--font); font-variant-numeric: tabular-nums lining-nums; color: var(--muted); white-space: nowrap; }
.progress-track { stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.progress-line { fill: none; stroke: var(--accent); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; transition: all .5s ease; }
.menu-btn { white-space: nowrap; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); font: 600 var(--fs-small) var(--font); cursor: pointer; }

.toc {
  position: fixed; top: 65px; right: max(0px, calc((100vw - 696px) / 2)); z-index: 9; width: min(360px, 100%);
  max-height: calc(100dvh - 73px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 16px 16px; box-shadow: 0 12px 32px rgb(0 0 0 / .12);
}
.toc ol { list-style: none; margin: 0 0 16px; padding: 0; }
.toc-jump { display: flex; flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 2px; min-height: 56px; margin: 8px 0 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-fill); color: var(--accent-ink) !important; font-weight: 600; text-decoration: none; border: 0 !important; }
.toc-jump small { font-weight: 400; font-size: var(--fs-meta); opacity: .9; }
.toc-label { font-size: var(--fs-meta); font-weight: 600; color: var(--muted); margin: 0 0 4px; padding: 0; }
.theme-pick { border: 0; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-pick legend { grid-column: 1 / -1; margin-bottom: 6px; }
.theme-pick label { cursor: pointer; }
.theme-pick input { position: absolute; opacity: 0; }
.theme-pick span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius); font-size: var(--fs-small); }
.theme-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-pick input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.toc a { display: flex; gap: 10px; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.toc a[aria-current] { color: var(--accent); font-weight: 600; }
.toc .tick { font-variant-numeric: tabular-nums lining-nums; width: 1.4em; text-align: center; color: var(--accent); }
.toc .opt { margin-left: auto; font-size: var(--fs-meta); color: var(--muted); }

/* Kapitel */
main { max-width: 696px; margin: 0 auto; padding: 24px 16px 32px; }
.js .chapter:not(.active) { display: none; }
.chapter { padding-bottom: 24px; }
.no-js-hide { display: none; }
html:not(.js) .chapter { border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.meta { margin: -4px 0 20px; }
.lead { hyphens: manual; font-size: clamp(1.125rem, 4.6vw, var(--fs-h3)); line-height: 1.45; color: var(--muted); margin-top: 0; }
.badge { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: var(--fs-meta); padding: 4px 10px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.aha { padding: 14px 18px; background: var(--accent-soft); border-radius: var(--radius); margin: 28px 0 0; }
.shortcut { margin: 0 0 24px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-small); }
.shortcut a { font-weight: 600; white-space: nowrap; }
.personal { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 24px; }
.personal p { margin: 0 0 6px; } .personal p:last-child { margin: 0; }
.optional-note { font-size: var(--fs-small); color: var(--muted); }
.fineprint { font-size: .875rem; color: var(--muted); line-height: 1.5; max-width: 65ch; }
.widget .fineprint, .card .fineprint { max-width: none; } /* in Widgets und Karten die volle Breite nutzen */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 20px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: transparent;
  color: var(--ink); font: 600 1rem/1.35 var(--font); text-decoration: none; cursor: pointer; text-align: center; hyphens: manual;
  transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btn-block { display: flex; width: 100%; margin: 4px 0 12px; }
.btn-row .btn { flex: 1 1 220px; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Check-in */
.checkin fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.checkin legend { float: left; width: 100%; padding: 0; font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 10px; }
.checkin .choice { clear: both; }
.opt-hint { display: block; font: 400 var(--fs-small) var(--font); letter-spacing: 0; color: var(--muted); }
.choice { display: block; margin-bottom: 8px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 14px 16px; min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background .15s; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.choice input[type=checkbox] + span::before { content: ''; display: inline-block; width: 1em; height: 1em; margin: 0 10px -2px 0; border: 1.5px solid var(--muted); border-radius: 3px; }
.choice input[type=checkbox]:checked + span::before { content: '✓'; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-size: .8em; line-height: 1.15em; text-align: center; }
.multi-hint { display: block; font: 400 var(--fs-small) var(--font); letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-height: 44px; padding: 6px 0; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.disclaimer-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.disclaimer-box h2 { font-size: var(--fs-h3); }
.disclaimer-box p { font-size: var(--fs-small); }
.disclaimer-box .more { margin-bottom: 8px; }
.checkin .btn-primary { width: 100%; }
.checkin .btn[aria-disabled=true] { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.start-hint { margin: 8px 0 0; text-align: center; font-size: var(--fs-small); color: var(--muted); }
.checkin:has(.checkin-error:not([hidden])) .start-hint { display: none; }
.start-hint[hidden] { display: none; }
.checkin-progress { font: 400 var(--fs-small) var(--font); font-variant-numeric: tabular-nums lining-nums; color: var(--muted); margin: 0 0 6px; }
.checkin-nav { display: flex; justify-content: space-between; gap: 12px; }
/* Tab-Reihenfolge: Weiter vor Zurück, die Anordnung bleibt */
.checkin-nav [data-step-back] { order: -1; }
.checkin-nav [data-step-skip] { order: 1; margin-left: auto; }
.checkin-nav [data-step-next] { order: 2; margin-left: auto; }
.checkin-error { color: var(--danger); font-weight: 600; margin: 0 0 12px; }
/* Fehlende Pflichtangaben erst nach dem Startversuch markieren */
.checkin.tried fieldset:has(:invalid) { box-shadow: 0 0 0 2px var(--danger); background: var(--danger-soft); border-radius: var(--radius); padding: 14px; }
.checkin.tried fieldset:has(:invalid) legend::after { display: block; content: 'Bitte wähle eine Antwort'; font: 600 var(--fs-small) var(--font); letter-spacing: 0; color: var(--danger); }
.checkin.tried fieldset:has(:invalid) .choice span { border-color: var(--danger); }
.checkin.tried .disclaimer-box:has(:invalid) .check input { outline: 2px solid var(--danger); outline-offset: 2px; }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Widgets */
.widget, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 24px 0; }
.widget-title { font-size: var(--fs-h3); margin-top: 0; }
/* Innenabstand oben und unten gleich: Außenabstände des ersten/letzten Elements neutralisieren */
.widget > :first-child, .card > :first-child, .worry > :first-child, .aha > :first-child { margin-top: 0; }
.widget > :last-child, .card > :last-child, .worry > :last-child, .worry-a > :last-child, .aha > :last-child, .steps-card > :last-child, [role=tabpanel] > :last-child { margin-bottom: 0; }
.widget > h3:first-child, .card > h3:first-child, details > h3:first-child { margin-top: 0; }
.widget-result { font-weight: 600; }
.widget-result:empty { display: none; }  /* kein leerer Platzhalter vor dem ersten Klick */
.slider { display: block; margin: 14px 0; }
.slider span { display: block; font-weight: 400; margin-bottom: 4px; }
.slider output { font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums lining-nums; }
input[type=range] { width: 100%; height: 44px; accent-color: var(--accent); margin: 0; }
.calc-headline { position: sticky; top: 64px; z-index: 1; margin: 0 -16px 8px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: var(--fs-h3); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; hyphens: manual; }
.band-toggle { min-height: 44px; font-size: var(--fs-small); }
.chart { width: 100%; height: auto; display: block; margin: 8px 0; overflow: visible; }
.chart text { font: 400 calc(12px * var(--u, 1)) var(--font);  /* --u gleicht die Skalierung der viewBox aus → überall ~12px */ font-variant-numeric: tabular-nums lining-nums; fill: var(--muted); }

.bars { display: grid; gap: 10px; margin: 8px 0; }
.bar-label { display: flex; justify-content: space-between; font-size: var(--fs-small); margin-bottom: 4px; }
.bar-label strong { font-variant-numeric: tabular-nums lining-nums; }
.bar-track { height: 14px; background: var(--bg); border-radius: var(--radius); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--radius); background: var(--muted); transition: width .35s ease; }
.bar-fill.good { background: var(--accent); }
.bar-fill.bad { background: var(--danger); }

.basket-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.basket-col { display: flex; flex-direction: column; padding: 12px; border: 1.5px dashed color-mix(in srgb, var(--line) 50%, var(--muted)); border-radius: var(--radius); }
.basket-col > svg { flex: 1; }
.basket-label { font-size: var(--fs-small); margin: 0 0 8px; }
.basket-value { font-weight: 600; font-variant-numeric: tabular-nums lining-nums; margin: 8px 0 0; }
.single, .fruit-basket { display: block; width: 100%; height: auto; }
.single { max-width: 120px; margin: auto; } /* Apfel mittig, Beträge unten auf einer Linie */
.apple { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .7s ease; }
.apple-body { fill: var(--apple-1); transition: fill .7s ease; }
.apple.a0 .apple-body { fill: var(--apple-0); }
.apple.a2 .apple-body { fill: var(--apple-2); }
.apple-stem { fill: none; stroke: var(--stem); stroke-width: 1.3; stroke-linecap: round; }
.apple-leaf { fill: var(--leaf); transition: fill .7s ease; }
.apple-shine { fill: #fff; opacity: .35; transition: opacity .7s ease; }
.apple-spot { fill: var(--rot-spot); opacity: 0; transition: opacity .7s ease .2s; }
.apple.rotten { transform: scale(.9, .78) rotate(-8deg); }
.apple.rotten .apple-body, .apple.rotten .apple-leaf { fill: var(--rot); }
.apple.rotten .apple-shine { opacity: 0; }
.apple.rotten .apple-spot { opacity: .9; }
.apple.rotten .apple-body { stroke: var(--rot-spot); stroke-width: .6; transition: fill .7s ease, stroke-width .7s ease; }
.wicker-rim { fill: none; stroke: var(--wicker-dark); stroke-width: 7; stroke-linecap: round; }
.basket-inside { fill: var(--wicker-dark); }
.basket-shadow { fill: var(--ink); opacity: .1; }
.wicker { fill: var(--wicker); }
.wicker-weave { fill: none; stroke: var(--wicker-dark); stroke-width: 1.4; opacity: .65; }
.fruit-basket .apple-body { stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: .5; }
.fruit-basket .apple.rotten .apple-body { stroke-width: 1.5; }
.basket-eq { display: block; color: var(--muted); }
@media (max-width: 559px) {
  .basket-grid { grid-template-columns: 1fr; }
  .fruit-basket { max-width: 300px; margin: 0 auto; }
}
.basket-depth { fill: #1A120A; opacity: .5; }
.basket-result { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius); font-size: var(--fs-small); line-height: 1.4; hyphens: auto; }
.basket-result:empty { display: none; }
.basket-result strong { display: block; font-size: var(--fs-body); font-variant-numeric: tabular-nums lining-nums; }
.basket-result.bad { background: var(--danger-soft); }
.basket-result.bad strong { color: var(--danger); }
.basket-result.good { background: var(--accent-soft); }
.basket-result.good strong { color: var(--accent); }
.basket-result { animation: rise .5s cubic-bezier(.16, 1, .3, 1); }

.crash-step p { margin-top: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-meta); color: var(--muted); align-items: center; }
.legend span { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-paid { background: var(--paid); }
.key-gain { background: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 8px; }
.stats div { background: var(--tile); border-radius: var(--radius); padding: 8px 6px 8px 8px; min-width: 0; }
.stats dt { font-size: var(--fs-meta); hyphens: manual; overflow-wrap: normal; line-height: 1.3; color: var(--muted); }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; font-size: var(--fs-body); letter-spacing: -0.01em; }

/* Kriterien, ETF-Tabelle */
.checks { list-style: none; padding: 0; margin: 0 0 8px; }
.checks li { position: relative; padding: 6px 0 6px 30px; }
.checks li::before { content: '✓'; position: absolute; left: 4px; top: 6px; font-weight: 700; color: var(--accent); }
.more summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.more[open] summary { margin-bottom: 4px; }
.more p { margin: 0 0 12px; }
.worries { margin: 20px 0 8px; border-top: 1px solid var(--line); }
.worries-head { padding: 12px 0; }
.worries-count { margin: 0 0 8px; font-size: var(--fs-small); font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums lining-nums; }
.worry-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.worry-bar i { height: 6px; border-radius: 3px; background: var(--line); transition: background .4s ease; }
.worry-bar i.on { background: var(--accent); }
/* Sorgen als ruhige Zeilen: die Frage ist selbst der Knopf, keine Karten */
.worry { margin: 0 -12px; padding: 0 12px; border-bottom: 1px solid var(--line); transition: background .4s ease; }
.worry-q { margin: 0; font-size: var(--fs-h3); line-height: 1.3; hyphens: manual; }
.worry-btn { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 64px; padding: 14px 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.worry-btn::after { content: ''; flex: none; width: 10px; height: 10px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s ease, border-color .25s ease; }
.worry.resolved .worry-btn::after { border-color: var(--accent); }
.worry-btn[aria-expanded=true]::after { transform: rotate(-135deg) translate(-2px, -2px); }
.worry.open { margin-top: 10px; margin-bottom: 10px; padding: 0 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.worry-a { padding-bottom: 16px; }
.worry-a p { margin: 0 0 10px; }
.worry-tag { display: inline-block; font-size: var(--fs-small); font-weight: 600; color: var(--accent); }
.worry-tag::before { content: '✓'; margin-right: .4em; }
.worry-tag.small::before { content: none; }
.worry-tag.partial { color: var(--ink); font-size: var(--fs-small); }

.worry-a .more summary { font-size: var(--fs-small); min-height: 44px; }
.worry-tag.partial::before { content: '−'; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: .35em; border: 1.5px solid currentColor; border-radius: 50%; line-height: 1; vertical-align: -.2em; }
/* Die ehrliche Sorge bleibt neutral – kein 'grünes Häkchen'-Gefühl */
.worry.partial.resolved .worry-btn::after { border-color: var(--ink); }
.worries-done { font-weight: 600; margin: 14px 0 0; }
.worry-a.rise, .worries-done.rise { animation: rise .5s cubic-bezier(.16, 1, .3, 1); }
.mine { border-color: var(--accent); }
.etf-facts { font-size: var(--fs-small); hyphens: manual; }
.etf-row { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.mono { font: 400 var(--fs-meta) var(--font); font-variant-numeric: tabular-nums lining-nums; color: var(--muted); }
.pill { display: inline-block; font-size: var(--fs-meta); padding: 4px 10px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); margin: 2px 2px 2px 0; font-weight: 600; }

/* Flip-Karten */
.flips { display: grid; gap: 12px; }
.flip { position: relative; display: grid; min-height: 120px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; perspective: 900px; }
.flip-front, .flip-back { grid-area: 1 / 1; padding: 18px; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s ease; display: flex; flex-direction: column; justify-content: center; }
.flip-front { background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--line) 70%, var(--ink)); font-size: var(--fs-h3); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.flip-hint { display: block; margin-top: 10px; font-size: .875rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.flip-back { background: var(--surface); border: 1.5px solid var(--accent); color: var(--ink); transform: rotateY(180deg); font-size: var(--fs-small); }
.flip-back-q { display: block; margin-bottom: 8px; font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.flip-back .flip-hint { color: var(--accent); }
.flip[aria-expanded=true] .flip-front { transform: rotateY(-180deg); }
.flip[aria-expanded=true] .flip-back { transform: rotateY(0); }


/* Listen, Tabs, Vergleich */
.facts { padding-left: 1.1em; } .facts li { margin-bottom: 12px; }
/* Kacheln außerhalb von Karten brauchen eigene Fläche und Linie */
.chapter > .stats div { background: var(--surface); border: 1px solid var(--line); }
/* Steuern: drei Stationen auf dem Weg des Geldes */
.stations { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 14px; }
.station { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.station p { margin: 0; font-size: var(--fs-small); }
.station-title { margin: 0 0 6px; font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.01em; hyphens: manual; }
.station .tax-line { margin: 0 0 8px; }
.tax-tag { font-size: var(--fs-meta); font-weight: 600; padding: 2px 8px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tax-tag.tax-yes { background: var(--tile); color: var(--ink); border: 1px solid var(--line); }
.station + .station::before { content: ''; position: absolute; left: 24px; top: -11px; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
@media (min-width: 720px) {
  .stations { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .station + .station::before { left: -14px; top: 22px; transform: rotate(-45deg); }
}
.tablist { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius); margin-bottom: 14px; }
.tablist button { min-height: 44px; border: 0; border-radius: 4px; background: none; color: var(--ink); font: 600 var(--fs-small) var(--font); cursor: pointer; }
.tablist button[aria-selected=true] { background: var(--accent-fill); color: var(--accent-ink); }
.pros-cons { list-style: none; padding: 0; }
.pros-cons li { padding: 8px 0 8px 30px; position: relative; border-top: 1px solid var(--line); }
.pros-cons li::before { position: absolute; left: 4px; top: 8px; font-weight: 700; }
.pro::before { content: '✓'; color: var(--accent); }
.con::before { content: '!'; color: var(--danger); }
.note { border-style: dashed; }
.compare, .compare * { hyphens: manual; }
.compare { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); font-size: var(--fs-small); margin: 12px 0 20px; }
.compare > div { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.compare > div:first-child { border-top: 0; }
.compare span { padding: 10px; }
.compare-head span { font-weight: 600; font-size: var(--fs-body); padding: 12px 10px; border-bottom: 2px solid var(--ink); }
.compare-head span + span { border-left: 1px solid var(--line); }
.compare [role=cell] + [role=cell] { border-left: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.compare-head [role=columnheader]:last-child { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-bottom-color: var(--accent); }
.compare [role=rowheader] { grid-column: 1 / -1; text-align: center; font-weight: 400; font-size: var(--fs-meta); color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.compare-head span:first-child { display: none; }
.compare .good { color: var(--accent); }
.compare .good::before { content: '✓ '; font-weight: 700; }  /* Vorteil nicht nur über Farbe */
.compare .bad { color: var(--muted); }

/* Schritte, Broker, Zusammenfassung */
.steps-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 8px 0 32px; transition: background .5s ease; }
.steps-count { font-size: var(--fs-small); font-weight: 600; color: var(--accent); margin: 0 0 10px; font-variant-numeric: tabular-nums lining-nums; }
.steps-when { font-size: var(--fs-meta); font-weight: 600; color: var(--muted); margin: 14px 0 0; }
.steps-when:first-of-type { margin-top: 0; }
.steps-after { margin: 6px 0 0; padding: 6px 0 0 1.2em; border-top: 1px solid var(--line); font-size: var(--fs-small); }
.steps-after li { margin: 6px 0 0; padding-left: .2em; }
.steps-after li::marker { color: var(--accent); }
.steps-after .after-link { display: flex; align-items: center; min-height: 44px; width: fit-content; }
.steps-done { margin: 14px 0 0; font-weight: 600; }
.steps-done.rise { animation: rise .6s cubic-bezier(.16, 1, .3, 1); }
.steps-card.complete { background: var(--accent-soft); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.steps { padding-left: 0; list-style: none; margin: 0; }
.steps li { border-top: 1px solid var(--line); padding: 6px 0; }
.steps li:first-child { border-top: 0; }
.steps input:checked + span { color: var(--muted); }
.brokers { display: grid; gap: 10px; margin: 12px 0 10px; }
@media (min-width: 560px) { .brokers { grid-template-columns: repeat(2, 1fr); } }
/* Anbieter und Hinweise unter einem Listenpunkt: bündig mit dem Text neben der Checkbox */
.steps .brokers, .steps .step-note { margin-left: 34px; }
/* In der Liste kompakter, damit Schritt 1 nicht ausufert */
.steps .brokers { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; margin-bottom: 8px; }
.steps .broker { padding: 12px 14px; gap: 2px; }
.steps .broker strong { font-size: 1.125rem; }
.steps .broker-go { margin-top: 4px; }
.broker strong, .broker-go { hyphens: manual; }
.broker-go { white-space: nowrap; }
@media (max-width: 559px) { .steps .brokers { margin-left: 0; grid-template-columns: minmax(0, 1fr); } } /* eingerückt ist für zwei Spalten zu schmal */
.steps .step-note { margin-top: 4px; margin-bottom: 6px; }
.steps-more { margin-left: 34px; }
.steps .fineprint.wide { max-width: none; margin: 12px 0 0 34px; } /* bündig mit dem Text neben der Checkbox */
.steps-more summary { hyphens: manual; }
.steps-more .brokers, .steps-more .step-note { margin-left: 0; }
.steps .step-note a { display: inline-flex; align-items: center; min-height: 44px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.broker { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s ease; }
.broker:hover, .broker:focus-visible { border-color: var(--accent); }
.broker.broker-top, .broker.broker-top:hover { border: 2px solid var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.broker-pick { font-size: var(--fs-meta); color: var(--gold-ink); font-weight: 600; }
.broker strong { font-size: var(--fs-h3); line-height: 1.2; }
.broker strong small { font-size: var(--fs-meta); font-weight: 400; color: var(--muted); }
.broker-kind { font-size: var(--fs-meta); color: var(--muted); }
.broker > span:not([class]) { font-size: var(--fs-small); flex: 1; }
.broker-go { margin-top: 8px; color: var(--accent); font-weight: 600; }
.summary-text { hyphens: manual; white-space: pre-wrap; font: var(--fs-small)/1.55 var(--font); background: var(--bg); padding: 14px; border-radius: var(--radius); margin: 0 0 8px; max-height: 320px; overflow: auto; }
.share { text-align: left; }
.share h3 { margin-top: 0; }
.share p { max-width: 46ch; margin: 0 0 4px; }
.share-row { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 14px; }
.share-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 var(--fs-small) var(--font); text-decoration: none; cursor: pointer; transition: border-color .2s ease; }
.share-btn:hover, .share-btn:focus-visible { border-color: var(--accent); }
.share-note:empty { display: none; }
.share-note { margin-top: 10px !important; }
.reset-note { font-size: var(--fs-small); color: var(--muted); text-align: center; }
.reset-note .link-btn { min-height: 0; padding: 0; }
.kofi { border: 1.5px solid var(--accent); text-align: left; margin-top: 8px; }
.kofi h3 { margin-top: 0; }
.kofi p { max-width: 46ch; margin: 0 0 4px; }
.kofi .btn-block { margin: 12px 0 0; }
.chart .chart-strong { font-weight: 600; fill: var(--ink); }
.chart .chart-on-fill { fill: var(--paid-ink); }
/* Beschriftung mit Hintergrund in Kartenfarbe – Linien laufen sichtbar dahinter durch */
.chart .chart-halo { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; fill: var(--ink); }
.finale { hyphens: manual; text-wrap: balance; font-weight: 700; letter-spacing: -0.01em; font-size: clamp(1.5rem, 5.5vw, 2rem); line-height: 1.2; text-align: center; margin: 40px 0; }
.finale span { display: block; text-wrap: balance; }
.finale em { color: var(--accent); }

/* Blättern & Footer */
.pager { display: flex; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
/* Disclaimer-Sperre für Direktlinks */
.consent { background: var(--surface); border: 1.5px solid var(--accent); border-radius: var(--radius); padding: 20px; margin: 8px 0 24px; }
.consent h2 { font-size: var(--fs-h3); margin-top: 0; }
main.needs-consent .chapter.active { display: none; }
.pager .btn { flex: 1; }
.pager [data-next] { flex-direction: column; gap: 2px; }
.pager [data-next] small { font-weight: 400; font-size: var(--fs-meta); opacity: .9; }
.pager .skip-link { flex-basis: 100%; }
.footer { max-width: 696px; margin: 0 auto; padding: 16px 16px 40px; font-size: var(--fs-meta); color: var(--muted); border-top: 1px solid var(--line); text-align: center; hyphens: manual; }
.footer p { margin: 4px 0; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* Rechtstexte */
.legal h1 { font-size: var(--fs-h2); }
.legal h2 { font-size: var(--fs-h3); margin-top: 1.8em; }
.legal h3 { font-size: var(--fs-body); }

@media (min-width: 720px) {
  main { padding-top: 64px; }
  .etf-row { grid-template-columns: 1fr 1fr; align-items: center; }
  .flips { grid-template-columns: 1fr 1fr; }
  .flips { grid-auto-rows: 1fr; }
  .flip:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .widget, .card { padding: 24px; }
  .calc-headline { margin: 0 -24px 8px; padding: 8px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .toc, .pager, .footer, .no-print, .chapter > :not(#zusammenfassung) { display: none !important; }
  .js .chapter:not(.active) { display: none; }
  body { background: #fff; color: #000; }
  .summary { border: 0; padding: 0; }
  .summary-text { display: block; max-height: none; overflow: visible; background: none; font-size: 11pt; }
  .summary-peek > summary { display: none; }
  .finale, .kofi, .consent { display: none !important; }
}

.mypick { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.share > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.share > summary::-webkit-details-marker { display: none; }
.share > summary h3 { margin: 0; }
.share > summary::after { content: ''; width: 10px; height: 10px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s ease; }
.share[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.reset-note .link-btn { display: inline-flex; align-items: center; min-height: 44px; }
