:root {
  --bg: #f4f5f6; --karte: #ffffff; --text: #15181b; --leise: #5c6670; --rand: #d9dde1;
  --akzent: #0a8f3c; --akzent-text: #ffffff; --akzent-hell: #e3f5ea; --warn: #b3261e;
  --banner: #fff3cd; --banner-text: #5c4400; --mock: #22262c; --mock-text: #e6e9ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214; --karte: #1a1d21; --text: #eef1f3; --leise: #9aa4ad; --rand: #2c3138;
    --akzent: #19b354; --akzent-text: #06200f; --akzent-hell: #12301f; --warn: #ff8a80;
    --banner: #3a3000; --banner-text: #ffe28a; --mock: #0b0d0f; --mock-text: #e6e9ec;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 17px/1.45 -apple-system, "Helvetica Neue", "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
header {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; gap: 4px; padding: 8px 10px;
  padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--rand);
}
header h1 { flex: 1; margin: 0; font-size: 18px; padding-left: 8px; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
h2 { margin: 8px 0 12px; font-size: 24px; line-height: 1.2; }
h3 { margin: 22px 0 8px; font-size: 16px; white-space: pre; }
p { margin: 8px 0; }
.klein { font-size: 14px; color: var(--leise); }
.fehler { color: var(--warn); }
.warn { color: var(--warn); font-size: 14px; margin: 6px 0; }
.banner { background: var(--banner); color: var(--banner-text); font-size: 14px; padding: 8px 16px; }

textarea, input[type=text], input[type=url], select {
  width: 100%; font: inherit; color: inherit; background: var(--karte);
  border: 1px solid var(--rand); border-radius: 12px; padding: 12px 14px;
}
textarea { resize: vertical; }
button, .knopf {
  font: inherit; border: 0; border-radius: 12px; padding: 13px 16px; cursor: pointer;
  text-align: center; text-decoration: none; display: block; color: inherit;
}
.haupt { width: 100%; margin-top: 18px; background: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.haupt:disabled { opacity: .5; }
.neben, .knopf { background: var(--karte); color: var(--text); border: 1px solid var(--rand); }
.knopf { margin: 8px 0 6px; font-weight: 600; border-color: var(--akzent); color: var(--akzent); }
.link { background: none; color: var(--akzent); padding: 8px 4px; display: inline; }
.link.mitte { display: block; margin: 8px auto 0; }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; }
.icon { background: none; font-size: 22px; padding: 4px 8px; min-width: 40px; min-height: 40px; }
.icon.sprache { font-size: 14px; font-weight: 700; border: 1px solid var(--rand); border-radius: 8px; min-width: 0;
  min-height: 0; padding: 5px 8px; margin: 0 4px; }
.zeile { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.zeile > input { flex: 1; min-width: 0; }
.zeile > .neben { flex: 1; }
.zeile > input + .neben { flex: 0 0 auto; }
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 16px; padding: 14px; margin: 12px 0; }
.karte.hinweis { border-color: var(--akzent); background: var(--akzent-hell); }
.karte .neben { margin-top: 6px; }

.foto { display: block; margin-top: 10px; padding: 12px 14px; border: 1px dashed var(--rand);
  border-radius: 12px; color: var(--leise); }
.foto.gewaehlt { border-style: solid; color: var(--text); }

.warte { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 80px 0; text-align: center; }
.kreisel { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--rand);
  border-top-color: var(--akzent); animation: dreh 0.9s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Auswahlkästchen */
fieldset.frage { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
fieldset.frage legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chips.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.chips.spalte { flex-direction: column; }
.chip { background: var(--karte); border: 1.5px solid var(--rand); border-radius: 12px; padding: 10px 14px;
  text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.chip small { font-size: 13px; color: var(--leise); }
.chip[aria-checked="true"] { border-color: var(--akzent); background: var(--akzent-hell); }
.chip[aria-checked="true"] > span::before { content: "✓ "; color: var(--akzent); font-weight: 700; }
.chip:disabled { opacity: .45; cursor: not-allowed; }

#ansicht { width: 100%; aspect-ratio: 1 / 1; max-height: 52vh; border-radius: 16px; overflow: hidden;
  background: var(--karte); border: 1px solid var(--rand); touch-action: none; }
#ansicht canvas { display: block; width: 100%; height: 100%; }
.masse { margin: 12px 0 4px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.schritte { list-style: none; padding: 0; margin: 16px 0; counter-reset: s; }
.schritte li { counter-increment: s; position: relative; background: var(--karte); border: 1px solid var(--rand);
  border-radius: 16px; padding: 14px 14px 14px 52px; margin-bottom: 10px; }
.schritte li > b { display: block; }
.schritte li > .klein { display: block; margin-top: 4px; }
.schritte li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--akzent); color: var(--akzent-text); font-weight: 700; font-size: 15px;
  display: grid; place-items: center; }
.schritte li.erledigt::before { content: "✓"; }
.schritte li.erledigt { opacity: .7; }
.schritte .neben { margin-top: 8px; }
.schritte .zeile { margin-top: 8px; }

/* Projekte */
.projekte { list-style: none; padding: 0; margin: 12px 0; }
.projekte li { display: flex; align-items: center; gap: 4px; background: var(--karte); border: 1px solid var(--rand);
  border-radius: 16px; margin-bottom: 10px; overflow: hidden; }
.projekt { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px; text-align: left; background: none;
  min-width: 0; border-radius: 0; }
.projekt > span { display: flex; flex-direction: column; min-width: 0; }
.projekt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projekt small { color: var(--leise); font-size: 13px; }
.daumen { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; object-fit: cover; background: var(--rand); }
.loeschen { color: var(--leise); font-size: 18px; margin-right: 6px; }

/* Anleitung */
.ablage { padding: 0; overflow: hidden; }
.ablage img { display: block; width: 100%; height: auto; background: #16181d; }
.ablage figcaption { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.mock { margin-top: 10px; background: var(--mock); color: var(--mock-text); border-radius: 12px; padding: 12px;
  font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.mock-wahl { display: flex; gap: 8px; }
.mock-chip { border: 1px solid #4a535c; border-radius: 8px; padding: 4px 12px; }
.mock .an { outline: 2px solid #19b354; outline-offset: 2px; }
.mock-chip.an { border-color: #19b354; color: #19b354; }
.mock-datei { background: #2c3138; border-radius: 8px; padding: 6px 10px; font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; overflow-wrap: anywhere; }
.mock-feld { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid #2c3138;
  padding-bottom: 6px; border-radius: 4px; }
.mock-feld i { font-style: normal; color: #9aa4ad; text-align: right; }
.mock-bild { width: 34px; height: 34px; border-radius: 6px; background: linear-gradient(135deg, #16181d 55%, #19b354); }
.mock-knopf { align-self: flex-end; background: #19b354; color: #06200f; font-weight: 700; border-radius: 8px;
  padding: 6px 16px; }

dialog { width: min(92vw, 460px); max-height: 90vh; border: 1px solid var(--rand); border-radius: 18px; padding: 20px;
  background: var(--bg); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog label { display: block; margin: 12px 0; font-weight: 600; }
dialog label > input, dialog label > select { margin-top: 6px; font-weight: 400; }
[hidden] { display: none !important; }

/* ---------- Konto und Bezahlen ---------- */
.banner.ok { background: var(--akzent-hell); color: var(--text); }
.banner.test, .testkasse { background: repeating-linear-gradient(-45deg, #ffe08a, #ffe08a 12px, #ffd04d 12px, #ffd04d 24px);
  color: #3b2a00; font-weight: 600; }
.testkasse { border: 2px dashed #8a5a00; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.testkasse p { font-weight: 400; margin: 4px 0 0; }
input[type=email] { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--rand); border-radius: 10px;
  background: var(--karte); color: var(--text); margin-bottom: 12px; }
.preise { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.preise li { background: var(--karte); border: 1px solid var(--rand); border-radius: 12px; padding: 14px;
  display: flex; align-items: center; gap: 12px; }
.preise li > span { flex: 1; display: flex; flex-direction: column; }
.preise li small { color: var(--leise); font-size: 14px; }
.preise li .preis { font-weight: 700; font-size: 18px; white-space: nowrap; }
.preise li.abo { border-color: var(--akzent); }
.aufstellung { margin: 6px 0 0; padding-left: 18px; font-size: 15px; color: var(--leise); }
footer { text-align: center; font-size: 13px; color: var(--leise);
  padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
footer a { color: var(--leise); }

/* ---------- Export: speichern oder weiterschicken ---------- */
.export summary { font-weight: 600; cursor: pointer; }
.export-liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.export-liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--rand);
  padding-top: 10px; }
.export-liste li > span { flex: 1 1 100%; display: flex; flex-direction: column; min-width: 0; }
.export-liste li small { color: var(--leise); font-size: 13px; }
.export-liste .neben { flex: 1; padding: 8px 12px; }

.werbevideo { display: block; height: min(56vh, 520px); aspect-ratio: 9 / 16; margin: 12px auto; border-radius: 16px;
  background: #000; border: 1px solid var(--rand); }

.zustimmung { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.zustimmung input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--akzent); }
.rechtstext h3 { white-space: normal; margin-top: 20px; }
.rechtstext mark { background: var(--banner); color: var(--banner-text); padding: 0 3px; border-radius: 4px; }

.kuendigung label { display: block; margin: 12px 0; }
.kuendigung fieldset { border: 1px solid var(--rand); border-radius: 12px; padding: 8px 14px; margin: 12px 0; }
.kuendigung fieldset label { display: flex; gap: 10px; align-items: flex-start; }
.kuendigung input[type=email] { width: 100%; font: inherit; color: inherit; background: var(--karte);
  border: 1px solid var(--rand); border-radius: 12px; padding: 12px 14px; margin-top: 4px; }
.kuendigung input[type=radio] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--akzent); }
.leise { color: var(--leise); font-size: 14px; }
