/* Kontaktcode – Optik nach DESIGN.md (helles Monochrom, shadcn-Stil), dunkel = reines Schwarz. */
:root {
  --canvas: #f5f5f5; --paper: #ffffff; --alt: #fafafa; --ink: #0a0a0a; --ink-soft: #171717;
  --mid: #737373; --hairline: #e5e5e5; --ember: #e7000b;
  --akzent: #1d3f9e; --akzent-weich: rgba(29, 63, 158, .07); --auf-akzent: #ffffff;
  --font: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 0 0 1px rgba(23,23,23,.05), 0 1px 3px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  --shadow-dock: 0 1px 1px rgba(23,23,23,.06), 0 12px 32px rgba(23,23,23,.14), 0 4px 12px rgba(23,23,23,.08);
  --glass: rgba(255,255,255,.72); --glass-border: rgba(255,255,255,.6);
  --r-card: 24px; --r-pill: 18px; --r-nested: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #000; --paper: #000; --alt: #050505; --ink: #fff; --ink-soft: #f2f2f2; --mid: #8f8f8f;
    --hairline: #262626; --shadow: none; --glass: rgba(20,20,20,.72); --glass-border: rgba(255,255,255,.12);
    --akzent: #6d97ff; --akzent-weich: rgba(109, 151, 255, .12); --auf-akzent: #061029;
    --shadow-dock: 0 12px 32px rgba(0,0,0,.6);
  }
}
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('./geist.woff2') format('woff2'); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.43; -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11"; }
#app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(120px + env(safe-area-inset-bottom)); min-height: 100dvh; }

.topbar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.marke { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.marke-zeichen { width: 22px; height: 22px; }
.marke-zeichen rect { fill: var(--ink); }
.marke-zeichen .punkte { fill: var(--paper); }

.view { display: none; }
.view.aktiv { display: block; animation: einblenden .22s ease-out; }
@keyframes einblenden { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.75px; font-weight: 600; margin: 12px 0 4px; }
h2 { font-size: 18px; line-height: 1.56; font-weight: 600; margin: 0 0 8px; letter-spacing: -.2px; }
p { margin: 0 0 12px; }
.sub { color: var(--mid); margin: 0 0 20px; }
.hinweis { color: var(--mid); font-size: 13px; margin: 8px 0 0; }
.hinweis.fehler { color: var(--ember); }
.lbl { display: block; font-size: 12px; line-height: 1.33; letter-spacing: .6px; text-transform: uppercase; color: var(--mid); font-weight: 500; margin: 0 0 6px; }

.karte { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 20px; margin-bottom: 12px; }
.banner { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 0; font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink); background: var(--canvas); transition: opacity .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { background: var(--canvas); color: var(--ink); }
.btn-outline { background: transparent; border: 1px solid var(--hairline); }
.btn-gefahr { color: var(--ember); }
.btn-breit { width: 100%; margin-top: 12px; }
.btn-klein { height: 32px; padding: 0 12px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; margin-top: 12px; font: inherit; color: var(--mid); text-decoration: underline; cursor: pointer; }
.reihe { display: flex; gap: 8px; margin-top: 12px; }
.reihe .btn { flex: 1; }
.reihe input { flex: 1; min-width: 0; }

.feld { margin-bottom: 12px; }
.feld input, .reihe input { width: 100%; height: 40px; padding: 8px 12px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--canvas); color: var(--ink); font: inherit; font-size: 16px; outline: 0; -webkit-appearance: none; appearance: none; }
.feld input:focus, .reihe input:focus { border-color: var(--hairline); background: var(--paper); }
.notiz { display: block; width: 100%; min-height: 84px; margin-top: 14px; padding: 10px 12px; border-radius: 14px; border: 1px solid transparent; background: var(--canvas); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; resize: vertical; outline: 0; }
.notiz:focus { border-color: var(--hairline); background: var(--paper); }
@media (prefers-color-scheme: dark) { .feld input, .reihe input, .notiz { border-color: var(--hairline); } }

/* Code-Eingabe: vier Zellen, ein unsichtbares Eingabefeld darüber (Einfügen + iOS-Vorschlag bleiben möglich) */
.otp { position: relative; height: 84px; }
.otp input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; z-index: 2; caret-color: transparent; color: transparent; background: transparent; }
.otp-zellen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 100%; }
.otp-zellen span { display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill); background: var(--canvas); border: 1px solid transparent; font-size: 36px; font-weight: 600; font-variant-numeric: tabular-nums; transition: border-color .15s, background .15s; }
.otp-zellen span.voll { background: var(--paper); border-color: var(--hairline); }
.otp.fokus .otp-zellen span.aktiv { border-color: var(--ink); background: var(--paper); transform: translateY(-2px); }
.otp-zellen span b { display: block; font-weight: inherit; }
.otp-zellen span.neu { animation: zellePop .38s cubic-bezier(.2, 1.5, .4, 1); }
.otp-zellen span.neu b { animation: zifferRein .38s cubic-bezier(.16, 1, .3, 1); }
@keyframes zifferRein { 0% { opacity: 0; transform: scale(2.4); filter: blur(7px); } 55% { opacity: 1; } 100% { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes zellePop { 0% { transform: scale(1); } 45% { transform: scale(1.09); } 100% { transform: scale(1); } }
.otp.gut .otp-zellen span { animation: zelleGut .5s ease-out both; border-color: var(--akzent); }
.otp.gut .otp-zellen span:nth-child(2) { animation-delay: .06s; }
.otp.gut .otp-zellen span:nth-child(3) { animation-delay: .12s; }
.otp.gut .otp-zellen span:nth-child(4) { animation-delay: .18s; }
@keyframes zelleGut { 0% { background: var(--paper); } 40% { background: var(--akzent); color: var(--auf-akzent); transform: translateY(-6px); } 100% { background: var(--paper); transform: none; } }
.otp.schlecht { animation: wackeln .4s ease-in-out; }
@keyframes wackeln { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@media (prefers-color-scheme: dark) { .otp-zellen span { border-color: var(--hairline); } .otp-zellen span.voll { background: #111; } }

.seg { display: flex; gap: 4px; background: var(--canvas); border-radius: var(--r-pill); padding: 4px; margin-bottom: 8px; }
.seg button { flex: 1; height: 32px; border: 0; border-radius: 14px; background: transparent; color: var(--mid); font: inherit; font-weight: 500; cursor: pointer; }
.seg button.an { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .seg { border: 1px solid var(--hairline); } .seg button.an { background: #1a1a1a; } }
#code-zurueck { margin-top: 16px; }

.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kachel { text-align: left; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 16px; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 100px; box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s; }
.kachel.an { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.kachel-titel { font-weight: 600; font-size: 16px; }
.kachel-felder { color: var(--mid); font-size: 13px; line-height: 1.4; }

.karte-code { text-align: center; padding: 30px 20px 24px; }
.code-anzeige { font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: .18em; text-indent: .18em; font-variant-numeric: tabular-nums; }
.code-anzeige span { display: inline-block; animation: pop .4s cubic-bezier(.2,.8,.2,1) both; }
.code-anzeige span:nth-child(2) { animation-delay: .05s; }
.code-anzeige span:nth-child(3) { animation-delay: .1s; }
.code-anzeige span:nth-child(4) { animation-delay: .15s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }
.code-anzeige.aus { color: var(--mid); text-decoration: line-through; }
.code-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-weight: 500; }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: puls 1.6s ease-in-out infinite; }
.code-status.fertig .punkt { animation: none; }
.code-status.aus .punkt { background: var(--mid); animation: none; }
@keyframes puls { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.7); } }

.schritte { padding-left: 20px; margin: 0 0 8px; }
.schritte li { margin-bottom: 8px; }
.punkte-liste { padding-left: 18px; margin: 0; }
.punkte-liste li { margin-bottom: 6px; }

.kkarte .kname { font-size: 24px; font-weight: 600; letter-spacing: -.6px; line-height: 1.3; }
.kunter { color: var(--mid); margin-top: 2px; }
.kzeilen { margin: 12px 0 4px; }
.kzeile { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); color: var(--ink); text-decoration: none; }
.kzeile:last-child { border-bottom: 1px solid var(--hairline); }
.kzeile svg { width: 18px; height: 18px; flex: none; stroke: var(--mid); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.klabel { color: var(--mid); flex: none; width: 72px; }
.kwert { flex: 1; text-align: right; word-break: break-all; }
.kkarte .reihe { flex-direction: column; }
.kkarte .reihe .btn { flex: none; }
.kkarte.erfolg { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent), 0 18px 40px -22px var(--akzent); }
.erfolg-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.haken { width: 40px; height: 40px; border-radius: 50%; background: var(--akzent); display: flex; align-items: center; justify-content: center; flex: none; animation: hakenPop .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.haken svg { width: 22px; height: 22px; stroke: var(--auf-akzent); stroke-width: 2.75; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; animation: hakenMalen .4s .22s cubic-bezier(.6, 0, .3, 1) forwards; }
@keyframes hakenPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes hakenMalen { to { stroke-dashoffset: 0; } }
.erfolg-titel { font-weight: 600; font-size: 15px; color: var(--akzent); line-height: 1.3; }
.erfolg .kname, .erfolg .kunter, .erfolg .kzeile, .erfolg .reihe { animation: zeileRein .4s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.12s + var(--i, 0) * .055s); }
@keyframes zeileRein { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.btn-akzent { background: var(--akzent); color: var(--auf-akzent); }
.kompakt .kname { font-size: 18px; }
.kompakt .kzeile { padding: 7px 0; }
.kompakt .kzeilen { margin-top: 8px; }
.vorschau { border: 1px dashed var(--hairline); border-radius: 14px; padding: 12px 14px 4px; }

.kontakt-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); color: inherit; text-decoration: none; }
.kontakt-zeile:first-child { border-top: 0; padding-top: 0; }
.kontakt-zeile:last-child { padding-bottom: 0; }
.kavatar { width: 40px; height: 40px; border-radius: 50%; background: var(--canvas); border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.kinfo { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kinfo .hinweis { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kname-klein { font-weight: 500; }
.kdatum { color: var(--mid); font-size: 12px; flex: none; }
.zurueck { display: inline-block; color: var(--mid); text-decoration: none; margin: 12px 0; }
.leer { text-align: center; color: var(--mid); padding: 12px 0; }
.leer svg { width: 32px; height: 32px; stroke: var(--mid); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.leer p { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--canvas); border: 1px solid transparent; font-weight: 500; font-size: 13px; cursor: pointer; user-select: none; transition: background .15s, color .15s; }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:disabled + span { opacity: .65; cursor: default; }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .chip span { border-color: var(--hairline); } .chip input:checked + span { border-color: var(--ink); } }

.dock { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: 28px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow-dock); z-index: 10; }
.dock a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 68px; padding: 8px 4px; border-radius: 22px; color: var(--mid); text-decoration: none; font-size: 11px; font-weight: 500; }
.dock a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.dock a.an { color: var(--ink); background: var(--canvas); }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-pill); font-weight: 500; z-index: 20; box-shadow: var(--shadow-dock); animation: einblenden .2s ease-out; }
.toast.fehler { background: var(--ember); color: #fff; }

.fuss { text-align: center; color: var(--mid); font-size: 12px; margin-top: 40px; }
.fuss a { color: inherit; }
.rechtstext h2 { margin-top: 16px; }
.rechtstext ul { padding-left: 20px; }
