/* Torpatenschaft TVB IV — eine Spalte in Handybreite, Flyer-Kopf oben, ein Schritt pro Bildschirm.
   Bewusst nur ein helles Erscheinungsbild mit hohem Kontrast (auch für ältere Paten). */

@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("/fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("/fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 900; font-display: swap; src: url("/fonts/archivo-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy: #071a33;
  --blue: #0b5cad;
  --blue-dark: #094c90;
  --sky: #1fa0e8;
  --ground: #eef3f9;
  --card: #ffffff;
  --ink: #0d1b2e;
  --muted: #4d5f75;
  --line: #c9d5e3;
  --good: #11804a;
  --good-soft: #e3f4ea;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --info-soft: #e2effb;
  --note: #fff8e1;
  --wa: #128c4b;
  --font-display: "Archivo", "Arial Black", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--ground); color: var(--ink);
  font-family: var(--font-body); font-size: 18px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--navy);
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.1; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.app { max-width: 460px; margin: 0 auto; padding-bottom: 110px; }

.band {
  background: var(--navy); color: #fff; border-bottom: 6px solid var(--sky);
  padding-block: 22px 26px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: grid; gap: 8px;
}
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.band h1 { font-size: 32px; font-weight: 900; text-transform: uppercase; }
.band .sub { color: #d6e2f1; }
.price-chip { justify-self: start; background: var(--blue); border-radius: 14px; padding: 10px 16px; display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.price-chip strong { font-family: var(--font-display); font-size: 30px; font-weight: 900; }
.price-chip span { font-size: 13px; font-weight: 700; letter-spacing: .08em; }

.body {
  display: grid; gap: 18px; padding-block: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.card { background: var(--card); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; border: 1px solid var(--line); min-width: 0; }
.card h2 { font-size: 20px; color: var(--blue); text-transform: uppercase; letter-spacing: .02em; }
.page-title { font-size: 28px; }
.muted { color: var(--muted); font-size: 16px; }
.small { font-size: 14px; }
.big-number { font-family: var(--font-display); font-size: 26px; font-weight: 900; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.steps .num { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; }
.steps b { display: block; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 60px; padding: 14px 18px; border-radius: 14px;
  border: 2px solid transparent; cursor: pointer; font-weight: 700; font-size: 19px;
  text-decoration: none; text-align: center; background: none;
}
.btn svg { width: 24px; height: 24px; flex: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--card); color: var(--blue); border-color: var(--blue); }
.btn-danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-small { min-height: 48px; font-size: 16px; padding: 10px 14px; width: auto; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; padding: 8px 0; font-size: 16px; }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 700; }
.field .hint { font-size: 15px; color: var(--muted); }
.input, .field input:not([type="checkbox"]), .field textarea, .field select {
  width: 100%; min-height: 56px; padding: 12px 14px; font-size: 18px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); outline: none; }
.field.invalid input, .field.invalid canvas, .check.invalid { border-color: var(--bad); }
.error { color: var(--bad); font-size: 16px; font-weight: 600; }

.check { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.check input { width: 30px; height: 30px; margin: 2px 0 0; accent-color: var(--blue); }
.check.boxed { border: 2px solid var(--sky); border-radius: var(--radius); padding: 16px; background: #fff; }

.sign-wrap { position: relative; }
.sign-pad { width: 100%; height: 180px; background: #fff; border: 2px dashed var(--line); border-radius: 12px; touch-action: none; display: block; cursor: crosshair; }
.sign-line { position: absolute; left: 18px; right: 18px; bottom: 38px; border-top: 1px solid var(--line); pointer-events: none; }
.sign-hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 14px; color: var(--muted); pointer-events: none; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }
.spread { justify-content: space-between; }

.balance { text-align: center; display: grid; gap: 4px; padding: 24px 18px; }
.balance .label { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.balance .amount { font-family: var(--font-display); font-size: 56px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.balance.ok { background: var(--good-soft); border-color: #b5e0c6; }
.balance.ok .amount, .balance.ok .label { color: var(--good); }
.balance.low { background: var(--bad-soft); border-color: #f3c1bb; }
.balance.low .amount, .balance.low .label { color: var(--bad); }

.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .meta { font-size: 15px; color: var(--muted); }
.list a.row-link { color: inherit; text-decoration: none; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.neg { color: var(--bad); }
.pos { color: var(--good); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--blue); }

.msgs { display: grid; gap: 12px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.msg .when { font-size: 13px; color: var(--muted); }
.msg.team { background: #fff; border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--blue); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.msg.me .when { color: #cfe0f4; }
.msg.bill { background: var(--navy); color: #fff; justify-self: stretch; max-width: 100%; }
.msg.bill .when { color: #9fb6d3; }
.msg.bill b { font-family: var(--font-display); font-size: 22px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.composer input { min-height: 56px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 18px; width: 100%; min-width: 0; }

.stepper { display: grid; grid-template-columns: 72px 1fr 72px; gap: 10px; align-items: center; }
.stepper button { height: 72px; border-radius: 16px; border: 2px solid var(--blue); background: #fff; color: var(--blue); cursor: pointer; display: grid; place-items: center; }
.stepper button svg { width: 30px; height: 30px; }
.stepper input { height: 72px; text-align: center; font-family: var(--font-display); font-size: 44px; font-weight: 900; border: 2px solid var(--line); border-radius: 16px; width: 100%; font-variant-numeric: tabular-nums; min-width: 0; }
.sum-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 2px; }
.sum-box b { font-family: var(--font-display); font-size: 28px; font-variant-numeric: tabular-nums; }

.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.chips button { min-height: 64px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-family: var(--font-display); font-size: 24px; font-weight: 800; cursor: pointer; }
.chips button[aria-pressed="true"] { border-color: var(--blue); background: var(--info-soft); color: var(--blue); }
.note-value { font-family: var(--font-display); font-size: 24px; font-weight: 900; user-select: all; }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 2px; min-width: 0; }
.stat b { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }

.topnav {
  display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1px solid var(--line);
  padding-block: 10px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topnav a { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 700; text-decoration: none; padding: 8px; min-height: 44px; }
.topnav a svg { width: 22px; height: 22px; }
.topnav h1 { font-size: 20px; min-width: 0; overflow-wrap: anywhere; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar nav { max-width: 460px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; position: relative; }
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--blue); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }

details.card summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary svg { width: 22px; height: 22px; transition: transform .2s; }
details[open] summary svg { transform: rotate(180deg); }

.wa-preview { background: #e7f6ec; border-radius: 12px; padding: 12px 14px; font-size: 16px; white-space: pre-line; border: 1px solid #bfe3cb; overflow-wrap: anywhere; }
.note-box { font-size: 15px; color: var(--muted); background: var(--note); border: 1px solid #f0dc9b; border-radius: 12px; padding: 10px 12px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); }
.sig-img { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 110px; display: grid; place-items: center; padding: 8px; }
.sig-img img { max-width: 100%; max-height: 120px; }
.legal { white-space: pre-line; overflow-wrap: anywhere; }

.footer {
  text-align: center; color: var(--muted); font-size: 14px; display: grid; gap: 6px;
  padding-block: 8px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.footer a { color: var(--muted); }
.version { position: fixed; right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(6px + env(safe-area-inset-bottom, 0px)); font-size: 11px; color: var(--muted); z-index: 4; pointer-events: none; }
.has-tabbar .version { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.mt { margin-top: 10px; }
.center { text-align: center; }
.inline-icon svg { width: 22px; height: 22px; vertical-align: -5px; }
.success-card { background: var(--good-soft); border-color: #b5e0c6; }
.link-box { font-size: 15px; overflow-wrap: anywhere; background: var(--ground); border-radius: 10px; padding: 10px 12px; user-select: all; }
.sig-preview { width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.row-actions { grid-column: 1 / -1; }
.row-actions summary { list-style: none; display: inline-block; }
.row-actions summary::-webkit-details-marker { display: none; }
.goals-input { width: 96px; min-height: 48px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; font-size: 18px; }
