/*
  FinanzPilot guides («Ratgeber»): the hubs /finanzpilot/ratgeber and /finanzpilot/en/guides
  and every guide page linked from them.
  Same navy palette and type as the other /finanzpilot/ pages (always dark, like
  support and datenschutz). No external requests: system fonts only.
  Contrast: every text colour is >= 4.5:1 on the background it sits on.
  Motion: /assets/motion.js sets html.motion (never with "reduce motion" or without
  JavaScript); every rule that hides or moves content needs it, see the end.
*/
:root {
  color-scheme: dark;
  --navy-900: #0A1628; --navy-800: #0F1D32; --navy-700: #13243D; --navy-600: #1B2D4A; --navy-500: #243B5C;
  --emerald: #00C48C; --emerald-ink: #5EE0B5; --gold: #FFD700; --text: #E5E7EB; --body: #CBD2DC; --muted: #8B96A5;
  --gutter: 16px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
@media (min-width: 720px) { :root { --gutter: 24px; } }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { max-width: 100%; }
body { background: var(--navy-900); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; line-height: 1.65; overflow-wrap: break-word; }
a { color: var(--emerald); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: var(--gutter); top: -200px; z-index: 10; background: var(--text); color: var(--navy-900); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { position: fixed; top: 12px; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

header { padding: 24px 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: 700; color: var(--text); text-decoration: none; }
.logo b { color: var(--emerald); }
.logo .by { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; }

.crumbs { font-size: 13px; color: var(--muted); margin-top: 12px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; }
.crumbs li { font-size: 13px; margin: 0; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--navy-500); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--body); }

.eyebrow { margin-top: 28px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--emerald-ink); }
h1 { font-size: clamp(30px, 6.4vw, 44px); line-height: 1.15; font-weight: 750; letter-spacing: -0.015em; margin: 10px 0 14px; text-wrap: balance; }
.lead { font-size: 18px; color: var(--body); }
.byline { font-size: 14px; color: var(--muted); margin-top: 14px; }
h2 { font-size: clamp(22px, 4.6vw, 27px); line-height: 1.25; margin: 48px 0 12px; letter-spacing: -0.01em; scroll-margin-top: 16px; text-wrap: balance; }
h3 { font-size: 17px; margin: 22px 0 6px; }
p, li { font-size: 16px; color: var(--body); }
p { margin: 10px 0; }
ul, ol { margin: 10px 0 10px 22px; }
li { margin: 6px 0; }
li::marker { color: var(--muted); }
strong, b { color: var(--text); }
.src { font-size: 13px; color: var(--muted); }
.src a { color: var(--muted); }

.box { background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 14px; padding: 18px 20px; margin: 22px 0; }
.box > :first-child { margin-top: 0; }
.box h2 { margin: 0 0 8px; font-size: 18px; }
.box ul { margin-bottom: 0; }
.summary { border-color: var(--emerald); }
.toc ol { margin: 6px 0 0 22px; }
.toc li { margin: 2px 0; font-size: 15px; }

.figures { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin: 18px 0 8px; }
.figure { background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 14px; padding: 16px 18px; }
.figure .label { font-size: 14px; color: var(--muted); font-weight: 600; }
.figure .amount { font-size: 30px; font-weight: 750; color: var(--text); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.2; }
.figure .amount small { font-size: 15px; font-weight: 500; color: var(--muted); }
.figure p { font-size: 14px; margin: 6px 0 0; }

.mistakes { list-style: none; margin: 14px 0 0; display: grid; gap: 10px; }
.mistakes li { background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 12px; padding: 14px 16px; margin: 0; }
.mistakes b { display: block; margin-bottom: 2px; }

.app { background: linear-gradient(180deg, var(--navy-700), var(--navy-800)); border: 1px solid var(--navy-500); border-radius: 16px; padding: 20px; margin-top: 16px; }
.app-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-head img { width: 48px; height: 48px; border-radius: 11px; flex: none; }
.app-head strong { font-size: 18px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--navy-900); background: var(--text); border-radius: 999px; padding: 3px 10px; }
a.badge { text-decoration: none; }
a.badge:hover, a.badge:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 12px; padding: 10px 18px; border-radius: 10px; background: var(--emerald); color: var(--navy-900); font-weight: 700; text-decoration: none; }
.btn { transition: transform .35s var(--ease-out), filter .2s ease; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: scale(.97); transition-duration: .08s; }

.sources li { font-size: 15px; }
.sources a { overflow-wrap: anywhere; }
.disclaimer { border-color: var(--navy-500); }
.disclaimer p { font-size: 15px; }

footer { padding: 44px 0 48px; margin-top: 48px; border-top: 1px solid var(--navy-600); font-size: 13px; color: var(--muted); text-align: center; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 8px; }
footer a { color: var(--muted); }

/* ---------- Guide extras ---------- */
.updated { font-size: 14px; color: var(--muted); margin-top: 4px; }
.timeline { list-style: none; margin: 18px 0 8px; padding: 0; }
.timeline li { position: relative; margin: 0; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--emerald); background: var(--navy-900); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 23px; bottom: 0; width: 2px; background: var(--navy-600); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { background: var(--emerald); }
.timeline .age { display: block; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 16px 0 8px; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.steps > li { counter-increment: step; position: relative; margin: 0; padding: 14px 16px 14px 56px; background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 12px; }
.steps > li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--navy-900); background: var(--emerald); }
.steps > li > b { display: block; margin-bottom: 2px; }
.compare { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 18px 0 8px; }
.compare .figure h3 { margin: 0 0 4px; font-size: 16px; }
.compare .figure ul { margin: 6px 0 0 18px; }
.compare .figure li { font-size: 14px; margin: 3px 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--emerald-ink); border: 1px solid var(--navy-500); border-radius: 999px; padding: 1px 9px; margin-left: 6px; vertical-align: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 6px; padding: 0 5px; color: var(--text); }

/* Related guides at the end of a guide, and the guide list on the hub */
.guide-list { list-style: none; margin: 16px 0 0; display: grid; gap: 12px; }
.guide-list.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.guide-list li { margin: 0; }
.guide-card { display: flex; flex-direction: column; height: 100%; padding: 18px 20px; text-decoration: none; color: var(--text);
  background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 14px;
  transition: transform .5s var(--ease-out), border-color .25s ease, box-shadow .5s var(--ease-out); }
.guide-card:hover { transform: translateY(-3px); border-color: var(--navy-500); box-shadow: 0 16px 36px -16px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 196, 140, .25); }
.guide-card:active { transform: translateY(-1px) scale(.99); transition-duration: .1s; }
.guide-topic { font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--emerald-ink); }
.guide-title { display: block; margin: 6px 0 6px; font-size: 19px; font-weight: 700; line-height: 1.3; }
.guide-card:hover .guide-title { text-decoration: underline; text-decoration-color: var(--emerald); text-underline-offset: .16em; }
.guide-text { display: block; font-size: 15px; color: var(--body); flex: 1; }
.guide-meta { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.hub-principles { margin-top: 36px; }
@media (prefers-reduced-motion: reduce) {
  .btn, .guide-card { transition: none; }
  .btn:hover, .btn:active, .guide-card:hover, .guide-card:active { transform: none; }
}

/* Reading progress: a thin emerald line, CSS scroll timeline only (no JavaScript).
   Browsers without scroll timelines simply don't show it. */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { display: block; position: fixed; inset: 0 0 auto; z-index: 30; height: 3px; background: var(--emerald);
      transform-origin: 0 50%; transform: scaleX(0); animation: g-progress linear both; animation-timeline: scroll(root); }
  }
}
@keyframes g-progress { to { transform: scaleX(1); } }

/* ---------- Motion (html.motion from /assets/motion.js, never with reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .motion [data-reveal] {
    opacity: 0; transform: translate3d(0, 24px, 0);
    transition: opacity .8s var(--ease-out), transform 1.1s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .motion [data-reveal].in { opacity: 1; transform: none; }
  .motion .intro > * { animation: g-rise 1s var(--ease-out) both; }
  .motion .intro > :nth-child(2) { animation-delay: .06s; }
  .motion .intro > :nth-child(3) { animation-delay: .14s; }
  .motion .intro > :nth-child(4) { animation-delay: .22s; }
}
@keyframes g-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@media print { .progress { display: none !important; } .motion [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ---------- App box near the top of a guide, reading-time line, 3a calculator ---------- */
.updated { margin-top: 10px; }
.app-top { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(180deg, var(--navy-700), var(--navy-800)); border-color: var(--navy-500); }
.app-top > img { width: 44px; height: 44px; border-radius: 10px; flex: none; margin-top: 2px; }
.app-top-body { min-width: 0; }
.app-top-body p { margin: 0 0 8px; font-size: 15px; }
.app-top-body .app-top-label { margin: 0 0 2px; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--emerald-ink); }
.app-top-body .badge { margin-top: 2px; }

.calc { background: var(--navy-800); border: 1px solid var(--navy-500); border-radius: 14px; padding: 18px 20px; margin: 18px 0; }
.calc[hidden] { display: none; }
.calc h3 { margin: 0 0 12px; font-size: 18px; }
.calc-row { margin: 12px 0; }
.calc-row label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.calc-row input[type="number"] { width: 100%; max-width: 280px; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 18px; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--navy-900); border: 1px solid var(--navy-500); border-radius: 10px; }
.calc-row input[type="range"] { display: block; width: 100%; min-height: 32px; accent-color: var(--emerald); }
.calc-row output { color: var(--emerald-ink); font-variant-numeric: tabular-nums; }
.calc-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.calc-quick span { font-size: 14px; color: var(--muted); }
.calc-quick button { min-height: 44px; padding: 8px 14px; font: inherit; font-size: 14px; color: var(--text); background: var(--navy-700); border: 1px solid var(--navy-500); border-radius: 10px; cursor: pointer; text-align: left; }
.calc-quick button:hover { border-color: var(--emerald); }
.calc-explain, .calc-note { font-size: 14px; color: var(--muted); margin: 8px 0; }
.calc-result { display: block; margin: 14px 0 6px; padding: 12px 14px; font-size: 20px; font-weight: 750; color: var(--text); background: var(--navy-900); border: 1px solid var(--emerald); border-radius: 10px; font-variant-numeric: tabular-nums; }
.calc-example { font-size: 15px; }
.calc-result-label { display: block; font-size: 14px; font-weight: 600; color: var(--body); }
.calc-result-val { font-size: 26px; }
