/* Schrift lokal statt über Google Fonts (Recursive, SIL Open Font License – siehe assets/fonts/OFL.txt) */
@font-face {
  font-family: 'Recursive';
  font-style: normal;
  font-weight: 300 1000;
  font-display: swap;
  src: url('../assets/fonts/recursive-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Recursive';
  font-style: normal;
  font-weight: 300 1000;
  font-display: swap;
  src: url('../assets/fonts/recursive-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Layout: eine schmale Spalte (max. 560px) – Countdown oben, darunter Verlauf, Schuldenliste und Zahlungsplan; Eingaben kommen als Sheet von unten. */
:root {
  /* Farbe: Papier mit leichtem Salbeiton, Tinte für alles Bedienbare, Farbe nur für die Schulden selbst */
  --bg: #eef1ed;
  --surface: #fafbf9;
  --ink: #131916;
  --ink-2: #4a554f;
  --muted: #76817b;
  --line: #dbe1db;
  --line-strong: #bcc5be;
  --accent: #131916;
  --on-accent: #fafbf9;
  --hover: rgba(19, 25, 22, .045);
  --good: #0ca30c;
  --good-ink: #006300;
  --critical: #d03b3b;
  --critical-ink: #a62d2d;
  --scrim: rgba(19, 25, 22, .42);
  --shadow: 0 24px 60px -18px rgba(19, 25, 22, .38);
  --shadow-sm: 0 1px 3px rgba(19, 25, 22, .10);
  /* Schulden-Farben: validierte Reihenfolge, Farbe folgt der Schuld */
  --s0: #8b948f; --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  /* Schrift: Recursive – Sans für Text und Countdown, Mono-Achse für Beträge */
  --font-sans: "Recursive", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Recursive", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-hero: clamp(76px, 25vw, 116px);
  --t-xl: 24px;
  --t-lg: 20px;
  --t-md: 16px;
  --t-sm: 14px;
  --t-xs: 12px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e110f; --surface: #161a17; --ink: #ecf0ed; --ink-2: #aab5ae; --muted: #7d8882;
    --line: #242a26; --line-strong: #39413c; --accent: #ecf0ed; --on-accent: #0e110f;
    --hover: rgba(236, 240, 237, .05); --good-ink: #0ca30c; --critical-ink: #f0928a;
    --scrim: rgba(0, 0, 0, .62); --shadow: 0 24px 60px -18px rgba(0, 0, 0, .75); --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --s0: #6f7872; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e110f; --surface: #161a17; --ink: #ecf0ed; --ink-2: #aab5ae; --muted: #7d8882;
  --line: #242a26; --line-strong: #39413c; --accent: #ecf0ed; --on-accent: #0e110f;
  --hover: rgba(236, 240, 237, .05); --good-ink: #0ca30c; --critical-ink: #f0928a;
  --scrim: rgba(0, 0, 0, .62); --shadow: 0 24px 60px -18px rgba(0, 0, 0, .75); --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --s0: #6f7872; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
/* Als App vom Homescreen: Inhalt beim Scrollen nicht hinter Uhrzeit und Statusleiste zeigen */
body::before {
  content: ""; position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px); background: var(--bg); pointer-events: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-family: var(--font-num); font-variation-settings: "MONO" 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.app {
  max-width: 560px; margin-inline: auto;
  padding: calc(4px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 132px max(16px, env(safe-area-inset-left, 0px));
}

/* Kopf */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 760; letter-spacing: -.015em; }
.brand-mark { width: 20px; height: 20px; flex: none; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px 6px 10px;
  border: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-size: var(--t-sm); font-weight: 650; cursor: pointer;
}
.chip-btn:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.chip-btn svg { width: 16px; height: 16px; flex: none; }

/* Hinweise */
.notice {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-size: var(--t-sm); color: var(--ink-2);
}
.notice p { flex: 1; min-width: 0; }
.notice.warn { color: var(--critical-ink); }
.notice .link-btn { flex: none; }
.badge {
  flex: none; padding: 1px 8px; border-radius: 6px; background: var(--ink); color: var(--on-accent);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.7;
}

/* Countdown */
.hero { padding-block: 26px 4px; }
.eyebrow, .chart-cap, .sec-head h2, .sub-h {
  font-size: var(--t-xs); font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2);
}
.hero-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; margin-top: 4px; }
.hero-n { font-size: var(--t-hero); font-weight: 800; line-height: .9; letter-spacing: -.05em; }
.hero-unit { font-size: var(--t-xl); font-weight: 650; letter-spacing: -.015em; }
.hero.is-word .hero-n { font-size: clamp(40px, 12vw, 64px); line-height: 1; letter-spacing: -.035em; }
.hero.is-alert .hero-n { color: var(--critical-ink); }
.hero-sub { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; color: var(--ink-2); }
.hero.is-alert .hero-sub { color: var(--critical-ink); font-weight: 600; }
.hero-sub .ico { margin-top: 4px; }

/* Fortschritt */
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 22px; }
.meter-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.meter-label { font-size: var(--t-sm); font-weight: 650; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.stats > div { min-width: 0; }
.stats dt { font-size: var(--t-xs); color: var(--ink-2); }
.stats dd { margin-top: 2px; font-size: clamp(17px, 5vw, 21px); font-weight: 680; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* Verlauf */
.chart { margin-top: 32px; }
.chart-cap { margin-bottom: 10px; }
.chart-box { position: relative; touch-action: pan-y; border-radius: 6px; outline: none; -webkit-user-select: none; user-select: none; }
.chart-box:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.chart-box svg { display: block; width: 100%; height: auto; }
.area { fill-opacity: .12; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grid { stroke: var(--line); stroke-width: 1; }
.base { stroke: var(--line-strong); stroke-width: 1; }
.tick, .xlab { fill: var(--muted); font-family: var(--font-sans); font-size: 11px; }
.mark { stroke: var(--bg); stroke-width: 2; }
.xh { stroke: var(--ink-2); stroke-width: 1; }
.xh-dot { fill: var(--ink); stroke: var(--bg); stroke-width: 2; }
.tip {
  position: absolute; left: 0; top: 4px; z-index: 2; min-width: 156px; max-width: 230px; padding: 9px 11px;
  border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  font-size: var(--t-xs); pointer-events: none; opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.tip-h { margin-bottom: 5px; font-weight: 650; color: var(--ink-2); }
.tip-l { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 10px auto minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.tip-l li { display: contents; }
.tip-l .key { width: 10px; height: 2px; border-radius: 2px; }
.tip-l b { font-weight: 650; text-align: right; }
.tip-l span { color: var(--ink-2); overflow-wrap: anywhere; }
.tip-t { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-weight: 650; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-xs); color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .lg-name { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.chart-note { display: flex; gap: 6px; margin-top: 10px; font-size: var(--t-xs); font-weight: 600; color: var(--critical-ink); }
.chart-note .ico { margin-top: 1px; }

/* Abschnitte */
.sec { margin-top: 36px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sec-meta { font-size: var(--t-xs); color: var(--ink-2); }
.panel { background: var(--surface); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }

/* Schuldenliste */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li + li { border-top: 1px solid var(--line); }
.debt {
  all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto;
  column-gap: 12px; row-gap: 10px; align-items: center; padding: 14px 16px; cursor: pointer;
}
.debt:hover { background: var(--hover); }
.debt:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--s0)); flex: none; }
.debt .dot { align-self: start; margin-top: 7px; }
.debt-main { display: grid; gap: 3px; min-width: 0; }
.debt-name { font-weight: 650; overflow-wrap: anywhere; }
.debt-meta { font-size: var(--t-xs); color: var(--ink-2); }
.debt-amt { align-self: start; font-size: 15px; font-weight: 600; text-align: right; white-space: nowrap; }
.debt.is-paid .debt-name, .debt.is-paid .debt-amt { color: var(--ink-2); }
.bar { display: block; grid-column: 2 / -1; height: 4px; border-radius: 999px; background: color-mix(in oklab, var(--c, var(--s0)) 18%, var(--surface)); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--s0)); }
.state { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 650; }
.state.good { color: var(--good-ink); }
.state.alert { color: var(--critical-ink); }
.ico { width: 14px; height: 14px; flex: none; }

/* Zahlungen */
.pay-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px 10px; font-size: var(--t-sm); font-weight: 700; }
.pay-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pay-list + .pay-head { border-top: 1px solid var(--line-strong); }
.pay { display: grid; grid-template-columns: auto 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 16px; font-size: var(--t-sm); }
.pay + .pay { border-top: 1px solid var(--line); }
.pay-date { color: var(--ink-2); }
.pay .dot { width: 8px; height: 8px; }
.pay-name { min-width: 0; overflow-wrap: anywhere; }
.pay-amt { text-align: right; white-space: nowrap; }
.tag {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--bg);
  color: var(--ink-2); font-size: 11px; font-weight: 650; line-height: 1.7; vertical-align: 1px; white-space: nowrap;
}
.tag-last { color: var(--good-ink); }
.tag-extra { color: var(--ink); }
.more { margin-top: 12px; }

/* Leerer Zustand */
.empty { display: grid; justify-items: start; gap: 16px; padding-block: 36px 12px; }
.empty-art { width: 168px; height: auto; color: var(--ink); }
.empty h2 { font-size: clamp(28px, 8vw, 38px); font-weight: 780; letter-spacing: -.03em; line-height: 1.08; }
.empty p { color: var(--ink-2); max-width: 46ch; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Fußnote */
.foot { display: grid; gap: 8px; margin-top: 36px; max-width: 62ch; font-size: var(--t-xs); line-height: 1.55; color: var(--ink-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 20px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: var(--t-md); font-weight: 650; text-align: center; cursor: pointer;
}
.btn:hover { opacity: .9; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { opacity: 1; background: var(--hover); }
.btn.danger { color: var(--critical-ink); }
.btn.block { width: 100%; }
.link-btn {
  padding: 2px 0; border: 0; background: none; color: var(--ink); font-weight: 650; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
:where(.btn, .link-btn, .icon-btn, .chip-btn, .fab):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fab {
  position: fixed; z-index: 10; right: max(16px, calc(50% - 264px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 60px; height: 60px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.94); }
.fab svg { transition: transform .18s; }
.fab.is-open svg { transform: rotate(45deg); }

/* Auswahl am Plus-Button */
.fab-menu {
  position: fixed; z-index: 11; right: max(16px, calc(50% - 264px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 4px; width: min(280px, calc(100% - 32px)); padding: 6px;
  border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  transform-origin: bottom right; animation: menu-pop .16s cubic-bezier(.2, .8, .2, 1);
}
.fab-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 14px; background: none; color: var(--ink); text-align: left; cursor: pointer;
}
.fab-item:hover:not(:disabled) { background: var(--hover); }
.fab-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fab-item:disabled { cursor: not-allowed; opacity: .5; }
.fab-item svg { width: 36px; height: 36px; flex: none; padding: 8px; border-radius: 50%; background: var(--bg); }
.fab-item span { display: grid; gap: 1px; min-width: 0; }
.fab-item b { font-size: var(--t-md); font-weight: 650; }
.fab-item small { font-size: var(--t-xs); color: var(--ink-2); }
@keyframes menu-pop { from { transform: translateY(8px) scale(.96); opacity: 0; } }

/* Sheet */
.sheet {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.sheet::backdrop { background: var(--scrim); opacity: var(--sheet-fade, 1); }
.sheet[open]::backdrop { animation: fade .2s ease-out; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; max-width: 560px; max-height: calc(100% - 32px);
  margin-inline: auto; display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow); animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet-panel::before { content: ""; display: block; flex: none; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: var(--line-strong); }
.sheet-head { touch-action: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 6px 20px; }
.sheet-head h2 { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--t-lg); font-weight: 720; letter-spacing: -.015em; overflow-wrap: anywhere; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 640px) {
  .sheet-panel { top: 50%; bottom: auto; max-height: min(88vh, 780px); border-radius: var(--r-lg); transform: translateY(-50%); animation-name: sheet-pop; }
  .sheet-panel::before { display: none; }
  .sheet-head { padding-top: 18px; }
}
@keyframes sheet-up { from { transform: translateY(28px); opacity: 0; } }
@keyframes sheet-pop { from { transform: translateY(calc(-50% + 12px)); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Formular */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: var(--t-sm); font-weight: 650; }
.opt { font-weight: 400; color: var(--ink-2); }
.input { display: flex; align-items: center; min-width: 0; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .12s; }
.input:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.field.invalid .input { box-shadow: inset 0 0 0 2px var(--critical); }
.input input { flex: 1; width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 0; background: transparent; font-size: 16px; outline: none; }
.input input::placeholder { color: var(--muted); }
.input select {
  flex: 1; width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 0; background: transparent;
  font: inherit; font-size: 16px; color: inherit; outline: none; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.input.select::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: -4px 16px 0 0; pointer-events: none;
  border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: rotate(45deg);
}
.unit { padding-right: 12px; color: var(--ink-2); font-size: var(--t-sm); white-space: nowrap; }
.hint { font-size: var(--t-xs); color: var(--ink-2); }
.form-hint { margin-top: -8px; }
.err { font-size: var(--t-xs); font-weight: 650; color: var(--critical-ink); }
.err:empty { display: none; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.group { display: grid; gap: 8px; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg label { padding: 10px 8px; border-radius: 10px; text-align: center; font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.data-sec .seg { margin-top: 4px; }
.data-sec .seg + .hint { margin-top: 8px; }
.seg input:disabled + label { cursor: not-allowed; opacity: .55; }
.soon {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--line);
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.7; vertical-align: 1px;
}
.preview { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg); font-size: var(--t-sm); color: var(--ink-2); }
.preview strong { color: var(--ink); font-size: var(--t-md); }
.preview .alert { display: flex; gap: 6px; color: var(--critical-ink); }
.preview .alert .ico { margin-top: 3px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
/* Detailansicht: Abstand zwischen Tilgungsplan und Buttons */
.sheet-body > .sheet-actions { margin-top: 24px; }
.sheet-actions .btn { flex: 1 1 140px; }

/* Detail */
.detail-top { display: grid; gap: 6px; }
.detail-amt { font-size: clamp(34px, 10vw, 44px); font-weight: 780; letter-spacing: -.035em; line-height: 1.05; }
.bar.lg { grid-column: auto; height: 6px; margin-top: 6px; }
.status { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg); font-size: var(--t-sm); font-weight: 600; }
.status.good { color: var(--good-ink); }
.status.alert { color: var(--critical-ink); }
.status .ico { margin-top: 3px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-top: 20px; }
.kv > div { min-width: 0; }
.kv dt { font-size: var(--t-xs); color: var(--ink-2); }
.kv dd { margin-top: 2px; font-weight: 650; overflow-wrap: anywhere; }
.sub-h { margin: 28px 0 8px; }
.table-wrap { overflow-x: auto; }
.plan { width: 100%; border-collapse: collapse; font-size: 13px; }
.plan caption { caption-side: bottom; padding-top: 8px; text-align: left; font-size: var(--t-xs); color: var(--ink-2); }
.plan th { padding: 0 0 8px; border-bottom: 1px solid var(--line-strong); font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); text-align: right; white-space: nowrap; }
.plan td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-family: var(--font-num); font-variation-settings: "MONO" 1; font-variant-numeric: tabular-nums; }
.plan :is(th, td):first-child { text-align: left; }
.plan :is(th, td) + :is(th, td) { padding-left: 12px; }
.plan tr.is-last td { color: var(--good-ink); font-weight: 650; }
.plan tr.is-extra td { font-weight: 650; }
.plan td.lbl { font-family: var(--font-sans); font-variation-settings: normal; font-size: 11px; font-weight: 650; color: var(--ink-2); }

/* Liste der Sondertilgungen */
.xlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.xlist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.xl-date { color: var(--ink-2); }
.xl-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; min-width: 0; font-weight: 650; }
.xl-main .tag { font-family: var(--font-sans); font-weight: 650; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 14px; height: 14px; }

/* Import / Export */
.data-sec .sub-h { margin-top: 20px; }
.data-sec:first-child .sub-h { margin-top: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1 1 150px; }
.code {
  display: block; width: 100%; min-height: 140px; margin-top: 12px; padding: 12px; border: 0; border-radius: var(--r-sm);
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--font-num); font-variation-settings: "MONO" 1;
  font-size: 12px; line-height: 1.5; resize: vertical;
}
.code:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.paste { display: grid; gap: 10px; }
.x-msg { margin-top: 10px; }
.x-msg:empty { display: none; }
.data-sec .err { margin-top: 10px; }
.choice { display: grid; gap: 4px; margin-top: 12px; padding: 14px; border-radius: var(--r-md); background: var(--bg); font-size: var(--t-sm); }

/* Ladebildschirm beim Update-Check (js/update.js) */
.boot { display: none; }
html.checking { overflow: hidden; }
html.checking .boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 16px;
  background: var(--bg); color: var(--ink-2); font-size: var(--t-sm); text-align: center;
}
.boot-mark { width: 44px; height: 44px; color: var(--ink); }
.boot-spin {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--line-strong); border-top-color: var(--ink); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Meldung */
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 32px); padding: 11px 16px;
  border-radius: 14px; background: var(--ink); color: var(--on-accent); font-size: var(--t-sm); box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-act { flex: none; padding: 4px 0; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *:not(.boot-spin), *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .boot-spin { animation-duration: 2s; }
}

/* Elemente mit dem hidden-Attribut immer ausblenden, auch wenn eine Klasse display setzt */
[hidden]:not([hidden=until-found i]) { display: none !important; }
img { max-width: 100%; }
