:root {
  --pet: #1F8A8A; --pet-d: #176b6b; --pet-l: #e3f3f2; --yel: #FFC24B; --yel-l: #fff1cf;
  --ink: #12343b; --ink-2: #4a6268; --ink-3: #7b8f93; --bg: #FFF9F0; --card: #ffffff; --line: #eadfcd;
  --good: #3BB273; --mid: #F2A541; --bad: #E4572E; --shadow: 0 3px 0 rgba(18, 52, 59, .9);
  --r: 16px; --font: "Nunito", "Quicksand", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1C2326; --card: #263035; --ink: #f1ece2; --ink-2: #c3ccce; --ink-3: #93a3a6; --line: #38464b;
    --pet-l: #1d3a3c; --yel-l: #3d3420; --shadow: 0 3px 0 rgba(0, 0, 0, .55); color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: var(--pet); font-weight: 700; }
@media (prefers-color-scheme: dark) { a { color: #6fd0cf; } }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--yel); outline-offset: 2px; border-radius: 6px; }

/* Kopf und Navigation */
.top { position: sticky; top: 0; z-index: 10; background: var(--pet); color: #fff; box-shadow: 0 2px 0 var(--ink); }
.top-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand img { width: 40px; height: 40px; border-radius: 11px; border: 2px solid var(--ink); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { color: #fff; text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.nav a img { width: 22px; height: 22px; }
.nav a.on, .nav a:hover { background: rgba(255, 255, 255, .18); }
.bottom { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  .bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--card); border-top: 2px solid var(--ink);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; color: var(--ink-2); text-decoration: none; padding: 4px; border-radius: 12px; }
  .bottom a img { width: 26px; height: 26px; }
  .bottom a.on { color: var(--ink); background: var(--yel-l); }
  .bottom a.plus img { width: 44px; height: 44px; margin-top: -18px; background: var(--yel); border: 2px solid var(--ink); border-radius: 50%; padding: 6px; box-shadow: var(--shadow); }
  main { padding-bottom: 96px !important; }
}
main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; }

/* Karten, Knöpfe, Formulare */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card.soft { border-color: var(--line); box-shadow: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 1rem var(--font); color: #12343b; background: var(--yel);
  border: 2px solid #12343b; border-radius: 999px; padding: 10px 20px; box-shadow: 0 3px 0 #12343b; cursor: pointer; text-decoration: none; min-height: 46px; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #12343b; }
.btn.sec { background: var(--card); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn.pet { background: var(--pet); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn img { width: 22px; height: 22px; }
.linkbtn { background: none; border: 0; padding: 0; font: 700 1rem var(--font); color: var(--pet); cursor: pointer; text-decoration: underline; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
label { display: block; font-weight: 700; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .85rem; color: var(--ink-3); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: 1rem var(--font); color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; }
input:focus, select:focus, textarea:focus { border-color: var(--pet); outline: none; box-shadow: 0 0 0 3px rgba(31, 138, 138, .25); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--pet); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; padding: 0; display: flex; gap: 8px; align-items: center; }
legend img { width: 26px; height: 26px; }
.unit { position: relative; }
.unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; pointer-events: none; }
.unit input { padding-right: 64px; }

/* Anmeldung */
.auth { max-width: 440px; margin: 24px auto; }
.auth .buddy { display: block; width: 170px; height: 170px; margin: 0 auto -8px; }
.auth h1 { text-align: center; }
.auth .sub { text-align: center; color: var(--ink-2); margin-top: -4px; }
.auth .links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: .95rem; }

/* Hinweise */
.msg { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; border: 2px solid; font-weight: 600; }
.msg.err { background: #fde8e2; border-color: var(--bad); color: #7a2410; }
.msg.ok { background: #e2f5ea; border-color: var(--good); color: #1d5a37; }
.msg.info { background: var(--pet-l); border-color: var(--pet); color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 50; animation: up .2s ease-out; max-width: 90vw; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Dashboard */
.hero { display: flex; gap: 18px; align-items: center; background: var(--pet-l); }
.hero img { width: 130px; height: 130px; flex: none; }
.bubble { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 14px 16px; flex: 1; }
.bubble::before { content: ""; position: absolute; left: -11px; top: 30px; width: 18px; height: 18px; background: var(--card); border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.bubble p { margin: 0; }
.bubble strong { font-size: 1.15rem; }
@media (max-width: 560px) { .hero { flex-direction: column; text-align: center; } .bubble::before { left: 50%; top: -11px; transform: translateX(-50%) rotate(135deg); } }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 820px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.tile .k { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.tile .v { font-size: 1.45rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile.y { background: var(--yel-l); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.cols .card { margin-bottom: 0; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.bar img { width: 30px; height: 30px; }
.bar .track { height: 14px; background: var(--pet-l); border-radius: 999px; overflow: hidden; border: 1.5px solid var(--ink); }
.bar .fill { height: 100%; background: var(--pet); width: 0; transition: width .5s ease-out; }
.bar .lbl { font-size: .85rem; color: var(--ink-2); grid-column: 2; margin-top: -8px; }
.bar .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1.5px dashed var(--line); }
.list li:last-child { border-bottom: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid var(--ink); }
.dot.good { background: var(--good); } .dot.mid { background: var(--mid); } .dot.bad { background: var(--bad); }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--yel-l); margin-bottom: 8px; }
.tip img { width: 26px; height: 26px; flex: none; }
.tip.luecke { background: #fde8e2; color: #7a2410; }
@media (prefers-color-scheme: dark) { .tip.luecke { background: #4a2a22; color: #ffd6cb; } .msg.err { background: #4a2a22; color: #ffd6cb; } .msg.ok { background: #1f3d2c; color: #c9f0d8; } }
.soon { display: flex; gap: 14px; align-items: center; border-style: dashed; box-shadow: none; }
.soon img { width: 70px; height: 70px; flex: none; }
.badge { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--yel); color: #12343b; border: 1.5px solid #12343b; }
.badge.grey { background: var(--line); color: var(--ink); border-color: transparent; }

/* Verträge */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 2px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 700 .9rem var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip img { width: 20px; height: 20px; }
.chip.on { background: var(--yel); color: #12343b; }
.contracts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ccard { display: flex; gap: 12px; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); transition: transform .1s; }
.ccard:hover { transform: translateY(-2px); }
.ccard img { width: 48px; height: 48px; flex: none; }
.ccard .t { font-weight: 800; font-size: 1.05rem; }
.ccard .s { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.ccard .p { font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ccard.off { opacity: .6; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); font-weight: 800; text-align: center; }
.sbtn img { width: 56px; height: 56px; }
.sbtn:hover { background: var(--yel-l); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.facts div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.facts dt { font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 800; }
.dhead { display: flex; gap: 14px; align-items: center; }
.dhead img { width: 64px; height: 64px; }
.empty { text-align: center; padding: 24px 12px; }
.empty img { width: 150px; height: 150px; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { margin: 0; }
.pagehead .row { margin-left: auto; }

/* Dialog */
.modal { position: fixed; inset: 0; background: rgba(18, 52, 59, .55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal .card { max-width: 420px; width: 100%; margin: 0; }
footer { text-align: center; color: var(--ink-3); font-size: .85rem; padding: 0 16px 32px; }
footer a { color: var(--ink-3); font-weight: 600; }
table.users { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.users th, table.users td { text-align: left; padding: 8px 6px; border-bottom: 1.5px solid var(--line); vertical-align: middle; }
.scroll { overflow-x: auto; }

/* Phase 2: Analyse */
.linkcard { display: flex; text-decoration: none; color: var(--ink); cursor: pointer; }
.linkcard:hover { filter: brightness(1.02); transform: translateY(-1px); }
.row.center { justify-content: center; }
.drop { display: flex; gap: 14px; align-items: center; padding: 18px; border: 2.5px dashed var(--pet); border-radius: var(--r); background: var(--pet-l); cursor: pointer; margin-bottom: 14px; font-weight: 600; }
.drop img { width: 52px; height: 52px; }
.drop:hover { background: var(--yel-l); }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.pages.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pg { border: 2px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; background: var(--card); text-decoration: none; color: var(--ink); font-size: .85rem; text-align: center; }
.pg.on { border-color: var(--ink); box-shadow: var(--shadow); }
.pg:not(.on) .pgimg img { opacity: .4; }
.pg img { width: 100%; aspect-ratio: 1 / 1.414; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.pgimg { border: 0; padding: 0; background: none; cursor: pointer; }
.check.small { font-size: .9rem; align-items: center; }
.check.small input { width: 18px; height: 18px; }
.seite { display: inline-block; font-size: .72rem; font-weight: 800; color: var(--pet); background: var(--pet-l); border-radius: 999px; padding: 0 7px; vertical-align: middle; }
.badge.good { background: var(--good); color: #fff; border-color: transparent; }
.badge.mid { background: var(--mid); color: #12343b; border-color: transparent; }
.badge.bad { background: var(--bad); color: #fff; border-color: transparent; }
.badge.grey, .dot.grey { background: #b9c4c6; color: #12343b; border-color: transparent; }
.dot.grey { border: 2px solid var(--ink); }
.ampelzahl { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-weight: 700; font-size: .92rem; }
.ampelzahl span { display: inline-flex; gap: 6px; align-items: center; }
.ampelzahl .dot { display: inline-block; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0 6px 28px; position: relative; }
ul.plain.ok li::before, ul.plain.no li::before { position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .8rem; border: 2px solid var(--ink); }
ul.plain.ok li::before { content: "✓"; background: var(--good); color: #fff; }
ul.plain.no li::before { content: "–"; background: var(--mid); color: #12343b; }
ul.plain li.hint::before { display: none; }
.btn.chosen { background: var(--yel); color: #12343b; }
.wackel { animation: wackel 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wackel { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .wackel { animation: none; } }
.noscroll { overflow: hidden; }
.modal.editor { align-items: start; overflow: auto; }
.modal.editor .card { max-width: 900px; }
.canvaswrap { max-height: 72vh; overflow: auto; border: 2px solid var(--ink); border-radius: 10px; background: #888; }
.canvaswrap canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }

/* Phase 3: Werkzeuge, Haushalt, Bedarfscheck, Recherche, Kündigung, Guthaben, 2FA */
h2.sp { margin-top: 22px; }
.h-ic { width: 26px; height: 26px; vertical-align: -5px; margin-right: 8px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tool { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); transition: transform .1s; }
.tool:hover { transform: translateY(-2px); background: var(--yel-l); }
.tool img { width: 44px; height: 44px; flex: none; }
.tool strong { display: block; }
.tool .hint { display: block; margin: 0; }
.modal .card { max-height: calc(100vh - 32px); overflow: auto; }
.steps { padding-left: 22px; margin: 0 0 14px; }
.steps li { margin: 4px 0; }
.qrbox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.qr { background: #fff; border-radius: 10px; border: 2px solid var(--ink); max-width: 100%; height: auto; }
.secret { display: inline-block; font: 700 1rem ui-monospace, Consolas, monospace; background: var(--bg); padding: 6px 10px; border-radius: 8px; word-break: break-all; letter-spacing: .04em; }
.codes { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.codes code { display: block; text-align: center; font: 700 1rem ui-monospace, Consolas, monospace; background: var(--bg); border: 1.5px solid var(--line); padding: 6px; border-radius: 8px; letter-spacing: .06em; }
.frage { margin-bottom: 16px; }
.frage legend { font-size: 1rem; }
.wahl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill { margin: 0; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-block; border: 2px solid var(--ink); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .95rem; }
.pill input:checked + span { background: var(--yel); color: #12343b; box-shadow: 0 2px 0 var(--ink); }
.pill input:focus-visible + span { outline: 3px solid var(--pet); outline-offset: 2px; }
.list.bedarf li { align-items: flex-start; }
.list.bedarf li > img { margin-top: 2px; flex: none; }
.row.small { gap: 8px; margin-top: 6px; font-size: .92rem; }
.tip.hinweis { background: var(--yel-l); }
.tarife { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tarife .card { margin: 0; }
.tarif h3 { margin: 0; }
.tarif .preis { font-size: 1.05rem; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 560px) { .tarif > .row { flex-direction: column; align-items: flex-start; gap: 4px; } .tarif .preis { text-align: left; } }
#zf { margin-bottom: 22px; }
.tarif ul { margin: 8px 0; font-size: .95rem; }
.pakete { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.paket { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); font: 600 .95rem var(--font); cursor: pointer; }
.paket strong { font-size: 1.8rem; font-weight: 900; }
.paket em { font-style: normal; font-weight: 800; font-size: 1.1rem; background: var(--yel); color: #12343b; border-radius: 999px; padding: 2px 12px; margin-top: 6px; }
.paket:hover { background: var(--yel-l); }
.paket[disabled] { opacity: .55; cursor: wait; }
