/* Ã¢â‚¬Å¾So funktioniert'sÃ¢â‚¬Å“: animiertes Handy mit App-Bildschirmen (Nachbau nach src/ui/bausteine.tsx + theme.ts, helles Theme).
   Steuerung: assets/js/ablauf.js setzt data-schritt / data-sz und Zustandsklassen auf .ablauf. */

.ablauf {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

/* ---------- Handy-Rahmen ---------- */
.phone { --s: .76; margin: 0; position: relative; justify-self: center; }
.ph-frame {
  width: calc(390px * var(--s) + 24px);
  height: calc(844px * var(--s) + 24px);
  padding: 12px;
  border-radius: calc(56px * var(--s) + 12px);
  background: linear-gradient(145deg, #3a3e45, #16181c 45%, #2b2f35);
  box-shadow: 0 0 0 1.5px #565b63 inset, 0 0 0 4px #0c0d0f inset, var(--shadow-lg), 0 50px 80px -50px rgba(20, 22, 26, .6);
  position: relative;
}
.ph-frame::before, .ph-frame::after { content: ""; position: absolute; width: 4px; border-radius: 2px; background: #2b2f35; }
.ph-frame::before { left: -3px; top: 22%; height: 9%; box-shadow: 0 calc(844px * var(--s) * .12) 0 #2b2f35; }
.ph-frame::after { right: -3px; top: 28%; height: 13%; }
.ph-screen {
  width: 390px; height: 844px;
  transform: scale(var(--s)); transform-origin: 0 0;
  border-radius: 56px; overflow: hidden; position: relative;
  background: #f3f4f5; color: #121417;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ph-screen svg { width: 24px; height: 24px; flex: none; }
.ph-status {
  position: absolute; inset: 0 0 auto; height: 54px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; padding: 6px 34px 0 46px;
  color: #fff; font-size: 17px; pointer-events: none;
}
.ph-island { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; border-radius: 20px; background: #000; }
.ph-bat { width: 27px; height: 13px; border: 1.5px solid rgba(255,255,255,.55); border-radius: 4px; padding: 1.5px; }
.ph-bat i { display: block; height: 100%; width: 78%; background: #fff; border-radius: 1.5px; }
.ph-home { position: absolute; left: 50%; bottom: 8px; width: 140px; height: 5px; margin-left: -70px; border-radius: 3px; background: #121417; z-index: 6; }
.ablauf[data-sz="kamera"] .ph-home { background: #fff; }

/* ---------- Szenen ---------- */
.sz { position: absolute; inset: 0; display: flex; flex-direction: column; background: #f3f4f5; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s, transform .45s ease; transform: translateX(24px); }
.ablauf[data-sz="start"] [data-szene="start"],
.ablauf[data-sz="geraet"] [data-szene="geraet"],
.ablauf[data-sz="kamera"] [data-szene="kamera"],
.ablauf[data-sz="sprechen"] [data-szene="sprechen"],
.ablauf[data-sz="ergebnis"] [data-szene="ergebnis"] { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease, visibility 0s, transform .45s ease; }

/* Kopfleiste (Stack-Header) */
.ah { flex: none; height: 110px; padding: 54px 16px 0; background: #121417; color: #fff; display: flex; align-items: center; gap: 4px; position: relative; }
.ah-t { position: absolute; left: 0; right: 0; text-align: center; font-size: 17px; font-weight: 700; pointer-events: none; padding-top: 54px; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; }
.ah-back { color: #3bd671; display: flex; }
.ah-back svg { width: 22px; height: 22px; }
.ah-start { justify-content: space-between; }
.ah-marke { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: 1.5px; }
.ah-marke img { width: 30px; height: 30px; border-radius: 7px; }
.ah-icons { display: flex; gap: 18px; color: #3bd671; }
.ah-icons svg { width: 26px; height: 26px; }

.ab { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.ab-start { padding-bottom: 30px; }
.a-schritt { margin: 0; font-size: 14px; font-weight: 700; color: #13843f; }
.a-titel { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.25; }
.a-label { margin: 0; font-size: 18px; font-weight: 700; }

/* GroÃƒÅ¸e Kacheln (Start) */
.gk { flex: 1; min-height: 180px; border-radius: 20px; background: #121417; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; transition: background .2s; }
.gk-i { width: 96px; height: 96px; border-radius: 48px; background: #1d2a22; color: #3bd671; display: flex; align-items: center; justify-content: center; }
.gk-i svg { width: 52px; height: 52px; }
.gk b { font-size: 30px; font-weight: 700; }
.gk > span:last-child { font-size: 17px; color: #a7aeb6; }
.ablauf.tap-start .gk-tap { background: #22262b; }

/* Zeilen */
.zn { background: #fff; border: 1px solid #dcdfe3; border-radius: 14px; overflow: hidden; }
.z { display: flex; align-items: center; gap: 14px; padding: 16px; min-height: 72px; border-bottom: 1px solid #dcdfe3; transition: background .2s; }
.z:last-child { border-bottom: 0; }
.z-i { width: 44px; height: 44px; border-radius: 10px; background: #e4f6ea; color: #13843f; display: flex; align-items: center; justify-content: center; flex: none; }
.z-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.z-t b { font-size: 18px; font-weight: 700; }
.z-t span { font-size: 15px; color: #59616b; margin-top: 2px; }
.z-c { color: #59616b; width: 20px !important; height: 20px !important; }
.ablauf.tap-foto .z-foto, .ablauf.tap-sag .z-sag { background: #e4f6ea; }
.bestand { flex: none; display: flex; background: #121417; padding: 14px 12px 34px; }
.bestand span { flex: 1; text-align: center; font-size: 13px; color: #a7aeb6; display: flex; flex-direction: column; }
.bestand b { color: #3bd671; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Kamera */
.sz-kamera { background: #000; }
.kam-bild { position: absolute; left: 0; top: 110px; width: 390px; height: 560px; object-fit: cover; transform: scale(1.06); transition: transform 2.4s ease; }
.ablauf.kam-scharf .kam-bild { transform: scale(1); }
.kam-fokus { position: absolute; left: 70px; top: 210px; width: 250px; height: 160px; transition: opacity .3s, transform .4s; transform: scale(1.25); opacity: 0; }
.ablauf.kam-scharf .kam-fokus { transform: scale(1); opacity: 1; }
.kam-fokus i { position: absolute; width: 26px; height: 26px; border: 3px solid #ffd60a; }
.kam-fokus i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.kam-fokus i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.kam-fokus i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.kam-fokus i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.kam-hint { position: absolute; left: 0; right: 0; top: 686px; margin: 0; text-align: center; color: #ffd60a; font-size: 13px; font-weight: 600; letter-spacing: 2px; }
.kam-leiste { position: absolute; left: 0; right: 0; bottom: 0; height: 130px; display: flex; align-items: center; justify-content: center; }
.kam-ausl { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; }
.kam-ausl::after { content: ""; width: 62px; height: 62px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ablauf.kam-klick .kam-ausl::after { transform: scale(.86); }
.kam-blitz { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.ablauf.kam-klick .kam-blitz { animation: ab-blitz .5s ease-out; }
@keyframes ab-blitz { 0% { opacity: .9; } 100% { opacity: 0; } }

/* Sprechen: groÃƒÅ¸er Mikrofon-Knopf wie SprachKnopf.tsx (112 px, App-GrÃƒÂ¼n) */
.mikro-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mikro { width: 112px; height: 112px; border-radius: 56px; background: #13843f; color: #fff; display: flex; align-items: center; justify-content: center; position: relative; transition: background .25s; }
.mikro svg { width: 52px !important; height: 52px !important; }
.mikro .m-stop, .ablauf.hoert .mikro .m-mic { display: none; }
.ablauf.hoert .mikro .m-stop { display: block; }
.ablauf.hoert .mikro { background: #b3261e; }
.ablauf.hoert .mikro::before, .ablauf.hoert .mikro::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid #b3261e; animation: ab-welle 1.4s ease-out infinite; }
.ablauf.hoert .mikro::after { animation-delay: .7s; }
@keyframes ab-welle { from { transform: scale(1); opacity: .6; } to { transform: scale(1.55); opacity: 0; } }
.mikro-t { font-size: 15px; font-weight: 600; color: #59616b; }
.mikro-t .m-an, .ablauf.hoert .mikro-t .m-aus { display: none; }
.ablauf.hoert .mikro-t .m-an { display: inline; color: #b3261e; }
.feld { background: #fff; border: 1px solid #dcdfe3; border-radius: 12px; padding: 14px; min-height: 130px; font-size: 17px; line-height: 1.4; }
.feld-p { color: #59616b; }
.ablauf.tippt-text .feld-p { display: none; }
.feld-t:empty { display: none; }
.ablauf.hoert .feld-t::after { content: ""; display: inline-block; width: 2px; height: 1.1em; vertical-align: -3px; margin-left: 1px; background: #13843f; animation: ab-caret 1s steps(1) infinite; }
@keyframes ab-caret { 50% { opacity: 0; } }
.knopf { border: 1px solid #13843f; background: #13843f; color: #fff; border-radius: 12px; padding: 16px; text-align: center; font-size: 18px; font-weight: 700; opacity: .45; transition: opacity .3s; }
.ablauf.text-da .knopf-weiter { opacity: 1; }

/* Ergebnis */
.ab-scroll { overflow: hidden; padding: 0; }
.ab-inhalt { padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 16px; transition: transform .9s cubic-bezier(.3, .7, .2, 1); }
.ablauf.scroll-1 .ab-inhalt { transform: translateY(-300px); }
.ablauf.scroll-2 .ab-inhalt { transform: translateY(-470px); }
.gkopf { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #dcdfe3; border-radius: 14px; padding: 12px; }
.gkopf .z-t b { font-size: 18px; }
.kt { background: #fff; border: 1px solid #dcdfe3; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kt p { margin: 0; }
.kt-gelb { background: #ffe066; border-color: #ffe066; color: #2b2300; }
.kt-titel { font-size: 18px; font-weight: 700; }
.kt ul { margin: 0; padding-left: 20px; font-size: 17px; line-height: 24px; display: grid; gap: 6px; }
.e-code { font-size: 34px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; }
.e-titel { font-size: 22px; font-weight: 700; line-height: 1.25; }
.e-text { font-size: 17px; line-height: 24px; }
.marken { display: flex; gap: 6px; }
.marken span { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #f3f4f5; color: #59616b; }
.marken .mk-hoch { background: #fff1d6; color: #6b4a00; }
.aufklapp { display: flex; align-items: center; justify-content: space-between; border-radius: 14px; padding: 18px; background: #13843f; color: #fff; font-size: 19px; font-weight: 800; transition: opacity .15s; }
.aufklapp svg { width: 26px !important; height: 26px !important; transition: transform .3s; }
.ablauf.tap-auf .aufklapp { opacity: .85; }
.ablauf.offen .aufklapp svg { transform: rotate(180deg); }
.kt-schritte { display: none; }
.ablauf.offen .kt-schritte { display: flex; animation: ab-auf .4s ease-out; }
@keyframes ab-auf { from { opacity: 0; transform: translateY(-8px); } }
.ps { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #dcdfe3; }
.ps:last-child { border-bottom: 0; }
.ps-nr { width: 30px; height: 30px; border-radius: 15px; background: #e4f6ea; color: #13843f; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.ps-t { flex: 1; font-size: 17px; line-height: 24px; transition: color .3s; }
.ps svg { width: 26px !important; height: 26px !important; color: #59616b; }
.ps .ps-on { display: none; color: #13843f; }
.ablauf.h1 [data-ps="1"] .ps-t, .ablauf.h2 [data-ps="2"] .ps-t, .ablauf.h3 [data-ps="3"] .ps-t, .ablauf.h4 [data-ps="4"] .ps-t { color: #59616b; text-decoration: line-through; }
.ablauf.h1 [data-ps="1"] .ps-b, .ablauf.h2 [data-ps="2"] .ps-b, .ablauf.h3 [data-ps="3"] .ps-b, .ablauf.h4 [data-ps="4"] .ps-b { display: none; }
.ablauf.h1 [data-ps="1"] .ps-on, .ablauf.h2 [data-ps="2"] .ps-on, .ablauf.h3 [data-ps="3"] .ps-on, .ablauf.h4 [data-ps="4"] .ps-on { display: block; animation: ab-hak .3s ease-out; }
@keyframes ab-hak { from { transform: scale(.4); } 70% { transform: scale(1.15); } }

/* Finger-Tipp */
.tipp { position: absolute; z-index: 7; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(18, 20, 23, .28); box-shadow: 0 0 0 2px rgba(255,255,255,.7); opacity: 0; transform: scale(.6); pointer-events: none; left: var(--tx, 50%); top: var(--ty, 50%); }
.ablauf.tippt .tipp { animation: ab-tipp .7s ease-out; }
@keyframes ab-tipp { 0% { opacity: 0; transform: scale(1.3); } 35% { opacity: 1; transform: scale(.85); } 100% { opacity: 0; transform: scale(.85); } }

/* Pause-Knopf */
.ablauf-pause { display: block; margin: 14px auto 0; font: 500 13px/1 var(--f-mono); letter-spacing: .04em; color: var(--ink-3); background: none; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.ablauf-pause[hidden] { display: none; }
.ablauf-pause:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------- Schritt-Texte ---------- */
.ablauf-schritte { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: none; }
.as-knopf {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 6px; width: 100%;
  padding: 20px 22px 18px; border-radius: 14px; border: 1px solid var(--rule); background: transparent;
  transition: background .3s, border-color .3s, box-shadow .3s, opacity .3s; opacity: .62; position: relative; overflow: hidden;
}
.as-knopf:hover { opacity: .9; }
.as-knopf:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 3px; }
.as-no { font: 600 12px/1 var(--f-mono); letter-spacing: .08em; color: var(--ink-3); }
.as-h { font: 700 clamp(20px, 2.2vw, 25px)/1.2 var(--f-display); color: var(--ink); }
.as-p { font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.as-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.as-bar i { display: block; height: 100%; width: 0; background: var(--green-ink); }
.ablauf[data-schritt="1"] [data-zu="1"] .as-knopf,
.ablauf[data-schritt="2"] [data-zu="2"] .as-knopf,
.ablauf[data-schritt="3"] [data-zu="3"] .as-knopf { opacity: 1; background: var(--card); border-color: var(--rule-strong); box-shadow: inset 4px 0 0 var(--green-ink); }
.ablauf[data-schritt="1"] [data-zu="1"] .as-no,
.ablauf[data-schritt="2"] [data-zu="2"] .as-no,
.ablauf[data-schritt="3"] [data-zu="3"] .as-no { color: var(--green-ink); }
.ablauf.laeuft[data-schritt="1"] [data-zu="1"] .as-bar i,
.ablauf.laeuft[data-schritt="2"] [data-zu="2"] .as-bar i,
.ablauf.laeuft[data-schritt="3"] [data-zu="3"] .as-bar i { animation: ab-bar var(--dauer, 8s) linear forwards; }
@keyframes ab-bar { to { width: 100%; } }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .ablauf { grid-template-columns: 1fr; gap: 28px; }
  .phone { --s: .66; }
  .ablauf-schritte { gap: 10px; }
  .as-knopf { padding: 16px 18px 14px; }
}
@media (max-width: 380px) { .phone { --s: .6; } }

/* Keine Bewegung: feste Bilder je Schritt, keine ÃƒÅ“bergÃƒÂ¤nge */
@media (prefers-reduced-motion: reduce) {
  .ablauf *, .ablauf *::before, .ablauf *::after { animation: none !important; transition: none !important; }
  .tipp { display: none; }
}

.ablauf.pausiert *, .ablauf.pausiert *::before, .ablauf.pausiert *::after { animation-play-state: paused !important; }
