/* Designauswahl – Coverflow für Praxisinhaberinnen. Dunkel wie die Albumansicht, umschaltbar auf Weiß. */
:root {
  color-scheme: dark;
  --bg: #000;
  --glow: rgba(38, 38, 42, .9);
  --ink: #f5f5f7;
  --brand: #f5f5f7;                         /* Doktor-Homepage-Marke: im Hellen Original-Navy */
  --mute: #98989d;
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .2);
  --accent: #0a84ff;
  --accent-ink: #fff;
  --edge: rgba(255, 255, 255, .06);        /* Haarlinie um jedes Cover */
  --fog-a: rgba(0, 0, 0, .25);              /* Seitencover treten zurück: dunkel bzw. im Hellen in den Nebel */
  --fog-b: rgba(0, 0, 0, .9);
  --floor: rgba(255, 255, 255, .07);
  --refl: .3;
  --scrim: rgba(0, 0, 0, .62);
  --frame: #1c1c1e;
  --frame-edge: rgba(255, 255, 255, .1);
  --frame-shadow: 0 50px 120px rgba(0, 0, 0, .65);
  --bar-a: #2d2d30;
  --bar-b: #252527;
  --bar-line: rgba(0, 0, 0, .55);
  --soft: rgba(255, 255, 255, .08);
  --sheet: linear-gradient(#232326, #1c1c1e);
  --sheet-text: #c7c7cc;
  --sheet-wrap: rgba(0, 0, 0, .55);
  --scrub-a: #0d0d0e;
  --scrub-b: #1b1b1d;
  --scrub-sh: inset 0 1px 2px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .07);
  --thumb: linear-gradient(#5d5d62, #3a3a3e 55%, #2e2e32);
  --thumb-sh: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 3px rgba(0, 0, 0, .6);
  --grip: rgba(255, 255, 255, .25);
  --arrow: #8e8e93;
  --wait: #151517;
  --wait-glanz: rgba(255, 255, 255, .06);
  --ease: cubic-bezier(.22, .9, .24, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --glow: rgba(242, 242, 245, 1);
  --ink: #1d1d1f;
  --brand: #132f3d;
  --mute: #6e6e73;
  --line: rgba(0, 0, 0, .1);
  --line-2: rgba(0, 0, 0, .18);
  --accent: #0071e3;
  --edge: rgba(0, 0, 0, .09);
  --fog-a: rgba(255, 255, 255, .15);
  --fog-b: rgba(255, 255, 255, .82);
  --floor: rgba(0, 0, 0, .06);
  --refl: .22;
  --scrim: rgba(250, 250, 252, .72);
  --frame: #fff;
  --frame-edge: rgba(0, 0, 0, .08);
  --frame-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 40px 110px rgba(0, 0, 0, .2);
  --bar-a: #fbfbfc;
  --bar-b: #f0f0f2;
  --bar-line: #dcdce0;
  --soft: rgba(0, 0, 0, .05);
  --sheet: #fff;
  --sheet-text: #515154;
  --sheet-wrap: rgba(240, 240, 243, .6);
  --scrub-a: #e6e6e9;
  --scrub-b: #f1f1f3;
  --scrub-sh: inset 0 1px 2px rgba(0, 0, 0, .14), 0 1px 0 #fff;
  --thumb: linear-gradient(#fff, #f3f3f5 55%, #e9e9ec);
  --thumb-sh: 0 0 0 .5px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .18);
  --grip: rgba(0, 0, 0, .2);
  --arrow: #8e8e93;
  --wait: #f1f1f3;
  --wait-glanz: rgba(255, 255, 255, .9);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hell/Dunkel: ganze Seite blendet in einem Zug über (View Transitions), sonst sofort */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .42s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }

/* ---------- Rahmen ---------- */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(90% 60% at 50% -8%, var(--glow) 0%, transparent 70%), var(--bg); }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: max(22px, env(safe-area-inset-top)) 28px 0 32px; }
.marke { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--brand); font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.marke svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.top h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.top p { margin: 4px 0 0; color: var(--mute); font-size: 13px; max-width: 46ch; }
.top-r { display: flex; align-items: center; gap: 12px; }
.wahl { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--mute); white-space: nowrap; animation: auftauchen .5s var(--ease) both; }
.wahl b { color: var(--ink); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* Schalter Hell/Dunkel */
.thema { position: relative; width: 56px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); cursor: pointer; transition: background .25s, border-color .25s; }
.thema:hover { border-color: var(--line-2); }
.thema-knopf { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #2c2c2e; box-shadow: 0 1px 2px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1); transition: transform .5s var(--ease), background .3s; }
[aria-checked="true"] .thema-knopf { transform: translateX(24px); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .08); }
.thema svg { position: absolute; inset: 5px; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: opacity .3s, transform .5s var(--ease); }
.i-mond { color: #f5f5f7; fill: #f5f5f7 !important; stroke: none !important; }
.i-sonne { color: #1d1d1f; opacity: 0; transform: rotate(-90deg) scale(.6); }
[aria-checked="true"] .i-mond { opacity: 0; transform: rotate(90deg) scale(.6); }
[aria-checked="true"] .i-sonne { opacity: 1; transform: none; }

/* ---------- Bühne ---------- */
.stage { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab; outline: none; }
.stage.zieht { cursor: grabbing; }
.stage::after { /* Boden: feine Linie unter den Spiegelungen */
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--cy) + var(--h) / 2); height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--floor) 30%, var(--floor) 70%, transparent);
}
.flow { position: absolute; inset: 0; transform-style: preserve-3d; opacity: 0; transition: opacity .9s var(--ease); }
.bereit .flow { opacity: 1; }

.card { position: absolute; left: 50%; top: var(--cy); width: var(--w); height: var(--h); margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2); transform-style: preserve-3d; will-change: transform; }
.inner { position: absolute; inset: 0; }
.face { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; overflow: hidden; background: #111; border-radius: 2px; }
.front { cursor: pointer; display: block; width: 100%; }
.front img, .refl img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.front::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--edge); pointer-events: none; }
.sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(158deg, rgba(255, 255, 255, .11) 0%, rgba(255, 255, 255, .03) 26%, rgba(255, 255, 255, 0) 42%); mix-blend-mode: screen; transition: opacity .3s; }
.shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(var(--sd, 90deg), var(--fog-a), var(--fog-b)); }
.front:focus-visible { outline: none; }
.front:focus-visible::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 80%, transparent); }
.badge { position: absolute; top: 5%; left: 3%; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); transform: scale(.6); opacity: 0; transition: transform .45s var(--ease), opacity .3s; pointer-events: none; }
.badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gewaehlt .badge { transform: none; opacity: 1; }
.refl { position: absolute; left: 0; top: 100%; width: 100%; height: 100%; transform: scaleY(-1); pointer-events: none; margin-top: 1px; opacity: var(--refl); transition: opacity .35s var(--ease);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .3) 22%, transparent 45%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .3) 22%, transparent 45%); }
/* Während das Cover als Rahmen offen ist, bleibt sein Platz leer */
.card.weg .inner { visibility: hidden; }
.card.weg .refl { opacity: 0; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 15px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s; }
.btn:active { transform: scale(.96); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--soft); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-accent:hover { filter: brightness(1.08); }
.btn-accent.ist { background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: none; }

/* ---------- Schieber wie in der Albumansicht ---------- */
.bottom { display: grid; justify-items: center; padding: 0 16px max(22px, env(safe-area-inset-bottom)); }
.scrub { display: flex; align-items: center; gap: 2px; width: min(620px, 100%); height: 18px; padding: 0 2px; border-radius: 999px; background: linear-gradient(var(--scrub-a), var(--scrub-b)); box-shadow: var(--scrub-sh); }
.scrub-arrow { width: 22px; height: 14px; padding: 0; border: 0; border-radius: 999px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--arrow); }
.scrub-arrow svg { width: 8px; height: 8px; fill: currentColor; }
.scrub-arrow:hover { color: var(--ink); }
.scrub-track { position: relative; flex: 1; height: 14px; cursor: pointer; }
.scrub-thumb { position: absolute; top: 1px; height: 12px; left: 0; width: 60px; border-radius: 999px; cursor: grab; background: var(--thumb); box-shadow: var(--thumb-sh); }
.scrub-thumb::after { content: ""; position: absolute; left: 50%; top: 3px; width: 10px; height: 6px; margin-left: -5px; background: repeating-linear-gradient(90deg, var(--grip) 0 1px, transparent 1px 3px); border-radius: 1px; }
.scrub-thumb:active { cursor: grabbing; }

/* ---------- Umgedrehtes Cover = Rahmen mit der echten Seite ---------- */
.vorhang { position: fixed; inset: 0; z-index: 55; background: var(--scrim); backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%); opacity: 0; visibility: hidden; }
.vorhang.offen { visibility: visible; }
.b3d { position: fixed; inset: 0; z-index: 60; pointer-events: none; visibility: hidden; }
.b3d.offen { visibility: visible; }
.flipper { position: absolute; transform-style: preserve-3d; will-change: transform; pointer-events: auto; }
.f-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.f-front { transform: rotateY(180deg); border-radius: 2px; background: #111; }
.f-front img { display: block; width: 100%; height: 100%; object-fit: fill; }
.f-back { display: grid; grid-template-rows: 46px 1fr; border-radius: 12px; background: var(--frame); box-shadow: 0 0 0 1px var(--frame-edge), var(--frame-shadow); }
.f-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 8px 0 8px; background: linear-gradient(var(--bar-a), var(--bar-b)); border-bottom: 1px solid var(--bar-line); }
.f-zu { justify-self: start; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--mute); transition: background .2s, color .2s; }
.f-zu:hover { background: var(--soft); color: var(--ink); }
.f-zu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.f-name { display: flex; align-items: baseline; gap: 8px; font-size: 13px; white-space: nowrap; }
.f-name b { font-weight: 600; }
.f-name span { color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.f-bar .btn { justify-self: end; height: 30px; padding: 0 14px; font-size: 12.5px; }
.f-view { position: relative; overflow: hidden; background: #fff; }
.f-platz { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.f-view iframe { position: absolute; left: 0; top: 0; border: 0; background: #fff; transform-origin: 0 0; opacity: 0; transition: opacity .4s var(--ease); }
.f-view.live iframe { opacity: 1; }
.v-spinner { position: absolute; right: 16px; bottom: 16px; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, .12); border-top-color: rgba(0, 0, 0, .55); animation: dreh .8s linear infinite; opacity: 0; transition: opacity .3s; pointer-events: none; }
.f-view.warte .v-spinner { opacity: 1; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Bestätigung ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--sheet-wrap); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.sheet-wrap.offen { opacity: 1; pointer-events: auto; }
.sheet { position: relative; width: min(440px, 100%); padding: 26px; border-radius: 22px; background: var(--sheet); border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(0, 0, 0, .35); transform: translateY(16px) scale(.97); transition: transform .5s var(--ease); overflow: hidden; }
.sheet-wrap.offen .sheet { transform: none; }
.s-step { transition: opacity .3s, transform .45s var(--ease); }
.s-fertig { position: absolute; inset: 26px; display: grid; align-content: center; justify-items: center; text-align: center; opacity: 0; transform: translateY(10px); pointer-events: none; }
.sheet.fertig .s-frage { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.sheet.fertig .s-fertig { opacity: 1; transform: none; pointer-events: auto; }
.s-head { display: flex; gap: 16px; align-items: center; }
.s-head img { width: 96px; height: 60px; object-fit: cover; object-position: top; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25), 0 0 0 1px var(--edge); }
.s-kicker { margin: 0 0 2px; font-size: 12px; color: var(--mute); }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.s-text { margin: 16px 0 0; color: var(--sheet-text); font-size: 14px; }
.s-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.s-fertig .s-actions { justify-content: center; }
.s-check { width: 64px; height: 64px; margin-bottom: 14px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.s-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; }
.s-check path { stroke-dasharray: 36; stroke-dashoffset: 36; }
.sheet.fertig .s-check circle { animation: strich .6s var(--ease) .1s forwards; }
.sheet.fertig .s-check path { animation: strich .4s var(--ease) .55s forwards; }
@keyframes strich { to { stroke-dashoffset: 0; } }
@keyframes auftauchen { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Live-Modus: Cover warten, bis ihr Design gebaut ist ---------- */
@view-transition { navigation: auto; }
.warten { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; color: var(--mute); background: var(--wait); opacity: 0; transition: opacity .7s var(--ease); pointer-events: none; overflow: hidden; }
.warten::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, var(--wait-glanz) 50%, transparent 70%) 0 0 / 250% 100%; animation: glanz 2.2s ease-in-out infinite; }
.warten b { position: relative; font-size: clamp(13px, calc(var(--w) * .034), 22px); font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.warten span { position: relative; font-size: clamp(11px, calc(var(--w) * .022), 14px); }
.wartet .warten { opacity: 1; }
.wartet .front img, .wartet .refl img { opacity: 0; }
.wartet .front { cursor: default; }
.ausgefallen .warten::before { animation: none; opacity: 0; }
.entwickelt .front img { animation: entwickeln 1.2s var(--ease) both; }
.entwickelt .refl img { animation: auftauchen2 1.2s var(--ease) both; }
@keyframes entwickeln { from { opacity: 0; filter: blur(16px) brightness(1.2); transform: scale(1.05); } }
@keyframes auftauchen2 { from { opacity: 0; } }
@keyframes glanz { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.stupsen .inner { animation: stupsen .42s var(--ease); }
@keyframes stupsen { 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.status { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; animation: auftauchen .5s var(--ease) both; transition: opacity .6s; }
.status svg { width: 16px; height: 16px; transform: rotate(-90deg); fill: none; stroke-width: 2.4; }
.status circle { stroke: var(--line); }
.status .ring { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 50.3; stroke-dashoffset: 50.3; transition: stroke-dashoffset .8s var(--ease); }
.status.komplett { color: var(--ink); }

/* ---------- Schmal ---------- */
@media (max-width: 760px) {
  .top { padding: max(16px, env(safe-area-inset-top)) 16px 0; }
  .top h1 { font-size: 17px; }
  .top p { font-size: 12.5px; }
  .wahl { display: none; }
  .f-back { border-radius: 14px; }
  .f-name span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
