/* ============================================================
   Ferment-Wiki · App-Seite (app.html)
   Vorlage: Design-Canvas „[App-Name] – App-Seite“ (claude.ai-Artefakt
   https://claude.ai/artifact/4rgSTxPmwxESMxRwJUEsY5, privat).
   Alle Werte aus tokens.css. Klassenpräfix: ap-

   §Web: Die Handy-Screens sind in HTML/CSS nachgebaute App-Ansichten,
   keine Screenshots. Sie laufen in den Wiki-Schriften (Bricolage statt
   Instrument Serif, Hanken statt IBM Plex), weil das Wiki nur diese
   drei Schriften selbst hostet (DSGVO, siehe tokens.css). Texte und
   Farben entsprechen der App (app_de.arb, tokens.dart).
   ============================================================ */

.ap-page {
  max-width: calc(var(--page-wide) + 2 * var(--gutter-wide));
  margin: 0 auto;
  padding: 0 var(--gutter-wide);
}
.ap-section { margin-top: var(--section-gap); }
.ap-section-head { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin-bottom: 40px; }
.ap-section-head .h-section { margin: 0; }
.ap-section-head .fw-eyebrow,
.ap-hero .fw-eyebrow { color: var(--color-accent-pressed); }

/* ---------- Hero ---------- */
.ap-hero {
  padding-top: clamp(32px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 620px);
  gap: var(--column-gap);
  align-items: center;
}
.ap-hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-lg); }
.ap-hero__text .h-display { margin: 0; }
.ap-hero__text .lede { margin: 0; max-width: 540px; }
.ap-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); padding-top: var(--space-sm); }
.ap-meta { margin: 0; font-size: 14px; color: var(--color-text-muted); }

.ap-stage {
  position: relative;
  height: 760px;
  border-radius: var(--radius-card);
  background: var(--type-kombucha-fill);
  overflow: hidden;
}
.ap-stage .ap-phone { position: absolute; }
.ap-stage .ap-phone:first-child { left: 6.5%; top: 64px; }
.ap-stage .ap-phone:last-child { left: 42%; top: 24px; filter: drop-shadow(0 24px 40px rgba(46, 42, 38, .22)); }

.ap-facts { margin-top: var(--section-gap); }

/* ---------- Funktionen ---------- */
.ap-feature {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 560px);
  justify-content: space-between;
  gap: var(--column-gap);
  align-items: center;
}
.ap-feature + .ap-feature { margin-top: var(--section-gap); }
.ap-feature--flip .ap-panel { order: 2; }
.ap-panel {
  height: 760px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-feature__text { display: flex; flex-direction: column; gap: var(--space-md); }
.ap-feature__text .h-section { margin: 0; }
.ap-feature__text .lede { margin: 0 0 12px; }
.ap-num-row { display: flex; align-items: center; gap: 12px; }
.ap-num {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent-tint);
  color: var(--color-accent-pressed);
  font-family: var(--font-mono); font-weight: 500; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.ap-points { list-style: none; margin: 0; padding: 0; }
.ap-points li { padding: 20px 0; border-top: 1px solid var(--color-hairline); }
.ap-points .ap-h { margin: 0 0 4px; font-size: 17px; line-height: 1.4; font-weight: 600; }
.ap-points p { margin: 0; color: var(--color-text-muted); }
.ap-status-pills { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: 10px; }
.ap-scale { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; font-family: var(--font-mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ap-scale small { font-size: 13px; color: var(--color-text-muted); }
.ap-scale__arrow { color: var(--color-accent-pressed); }

/* Status-Pill wie in der App: Wort + Fläche, nie Farbe allein */
.ap-status {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.ap-status--plan { background: var(--color-accent-tint); color: var(--color-accent-pressed); }
.ap-status--ready { background: var(--color-success); color: var(--color-on-accent); }
.ap-status--feed { background: var(--color-warning); color: var(--color-text); }  /* ink auf warning 4,9:1; surface nur 2,7:1 */
.ap-status--mould { background: var(--color-danger); color: var(--color-on-accent); }

/* ---------- Begleiter ---------- */
.ap-band {
  margin-top: var(--section-gap);
  background: var(--color-surface);
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
  padding: clamp(48px, 7vw, 96px) 0;
}
.ap-band__head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--column-gap); margin-bottom: 40px; }
.ap-band__head .ap-section-head { margin-bottom: 0; }
.ap-band__head p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--color-text-muted); max-width: 520px; }
.ap-companions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-lg); }
.ap-companion__tile {
  height: 188px; border-radius: var(--radius-tile);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.ap-companion__tile img { width: 150px; height: 150px; }
.ap-companion strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.4; }
.ap-companion span { display: block; font-size: 14px; color: var(--color-text-muted); }

/* ---------- Schritte ---------- */
.ap-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: ap-step; }
.ap-steps li { counter-increment: ap-step; padding-top: var(--space-lg); border-top: 1px solid var(--color-hairline); display: flex; flex-direction: column; gap: 12px; }
.ap-steps li::before {
  content: counter(ap-step);
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  background: var(--color-accent-tint); color: var(--color-accent-pressed);
  font-family: var(--font-mono); font-weight: 500; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.ap-steps h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.15; letter-spacing: -0.03em; }
.ap-steps p { margin: 0; color: var(--color-text-muted); }

/* ---------- Abschluss ---------- */
.ap-cta { display: flex; align-items: center; gap: 56px; padding: 48px; }
.ap-cta__art {
  width: 260px; height: 260px; flex-shrink: 0;
  border-radius: var(--radius-tile); background: var(--color-disabled-fill);
  display: flex; align-items: center; justify-content: center;
}
.ap-cta__art img { width: 200px; height: 200px; filter: grayscale(.6); }  /* ruhender Begleiter wie im Leerzustand der App */
.ap-cta__text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-md); }
.ap-cta__text .h-section, .ap-cta__text .lede { margin: 0; }

/* ---------- Warteliste (Formular im Abschluss-Card) ---------- */
.ap-wait { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 560px; }
.ap-wait__label { font-size: 14px; font-weight: 600; color: var(--color-text); }
.ap-wait__platforms { margin: 0 0 4px; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ap-wait__platforms legend { padding: 0; margin-bottom: 8px; }
.ap-wait__choices { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.ap-wait__choice { position: relative; cursor: pointer; }
/* Radio bleibt echt (Tastatur, Screenreader), nur optisch als Pill. */
.ap-wait__choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ap-wait__choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-hairline);
  font-size: 15px; font-weight: 500; color: var(--color-text);
}
.ap-wait__choice input:checked + span { background: var(--color-text); color: var(--color-surface); box-shadow: none; }
.ap-wait__choice input:focus-visible + span { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.ap-wait__row { display: flex; gap: var(--space-sm); }
.ap-wait__input {
  flex: 1; min-width: 0; min-height: 48px;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: 16px/1.4 var(--font-sans);   /* 16 px: iOS zoomt sonst beim Fokus */
}
.ap-wait__input::placeholder { color: var(--color-disabled-text); }
.ap-wait__input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: var(--color-accent); }
.ap-wait__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--color-text-muted); cursor: pointer; }
.ap-wait__consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--color-accent); }
.ap-wait__consent a { color: var(--color-accent-pressed); }
.ap-wait__status { margin: 0; min-height: 1.5em; font-size: 14px; line-height: 1.5; color: var(--color-text-muted); }
.ap-wait__status--ok { color: var(--color-success-ink); font-weight: 600; }
.ap-wait__status--error { color: var(--color-danger); font-weight: 600; }
.ap-wait .btn:disabled { opacity: .6; cursor: wait; }
/* Nach dem Abschicken/Bestätigen: Formular weg, Begleiter in Farbe (waitlist.js). */
.ap-cta.is-sent .ap-cta__art img, .ap-cta.is-confirmed .ap-cta__art img { filter: none; }
#warteliste-titel:focus { outline: none; }
.ap-wait[hidden], .ap-meta[hidden] { display: none; }
/* Honeypot: aus dem Layout und der Vorlese-Reihenfolge, aber für Bots im DOM. */
.ap-wait__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ap-next { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); }

/* ============================================================
   Handy-Rahmen und App-Screens (nachgebaut)
   ============================================================ */
.ap-phone {
  --p-ink: var(--color-text);
  width: 320px; height: 680px; box-sizing: border-box; flex-shrink: 0;
  border: 8px solid var(--color-text); border-radius: 50px;
  background: var(--color-bg); overflow: hidden;
  display: flex; flex-direction: column;
  font-family: var(--font-sans); color: var(--p-ink); line-height: 1.35;
  text-align: left;
}
.ap-phone svg { display: inline-block; }
.ap-scr { flex: 1; display: flex; flex-direction: column; padding: 22px 16px 12px; gap: 8px; overflow: hidden; position: relative; min-height: 0; }
.ap-scr__kicker { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted); }
.ap-scr__h1 { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.06; letter-spacing: -0.03em; }
.ap-scr__h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.15; letter-spacing: -0.02em; }
.ap-scr__bar { display: flex; align-items: center; justify-content: space-between; font-size: 14.5px; font-weight: 500; }
.ap-scr__bar--start { justify-content: flex-start; gap: 8px; font-size: 13px; font-weight: 400; color: var(--color-text-muted); }
.ap-mono { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

.ap-card { background: var(--color-surface); border-radius: 18px; box-shadow: var(--shadow-card); }
.ap-care { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ap-care__head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.ap-care__count { background: var(--color-warning); color: var(--color-text); font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; }
.ap-care__row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.ap-care__row::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--color-warning); flex-shrink: 0; }
.ap-care__row span { flex: 1; }
.ap-care__row b { font-weight: 600; color: var(--color-accent); }

.ap-jar { padding: 10px; display: flex; gap: 12px; align-items: center; }
.ap-jar__tile { width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ap-jar__tile img { width: 50px; height: 50px; }
.ap-jar__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ap-jar__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ap-jar__title { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-jar__meta { font-size: 12px; color: var(--color-text-muted); }
.ap-jar .ap-status { font-size: 9.5px; padding: 4px 8px; flex-shrink: 0; }
.ap-jar .ap-mono { font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; }
.ap-track { height: 6px; border-radius: 999px; overflow: hidden; background: var(--color-accent-tint); }
.ap-track i { display: block; height: 100%; border-radius: 999px; background: var(--color-accent); }
.ap-track--ready { background: var(--color-success-tint); } .ap-track--ready i { background: var(--color-success); }
.ap-track--feed { background: var(--color-warning-tint); } .ap-track--feed i { background: var(--color-warning); }
.ap-fab { position: absolute; right: 16px; bottom: 14px; width: 52px; height: 52px; border-radius: 16px; background: var(--color-accent); box-shadow: var(--shadow-sheet); display: flex; align-items: center; justify-content: center; }

.ap-nav { flex-shrink: 0; height: 62px; box-sizing: border-box; background: var(--color-surface); border-top: 1px solid var(--color-hairline); display: flex; align-items: center; padding: 0 6px 6px; }
.ap-nav span { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--color-text-muted); }
.ap-nav .is-active { color: var(--color-accent); font-weight: 600; }

/* Detail */
.ap-ring { position: relative; height: 196px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-ring svg { position: absolute; transform: rotate(-90deg); }
.ap-ring img { width: 146px; height: 146px; position: relative; }
.ap-center { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.ap-center small { font-size: 13px; color: var(--color-text-muted); }
.ap-seg { display: flex; gap: 4px; background: var(--color-accent-tint); border-radius: 12px; padding: 4px; flex-shrink: 0; }
.ap-seg span { flex: 1; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--color-text-muted); border-radius: 9px; }
.ap-seg .is-on { background: var(--color-surface); color: var(--color-text); font-weight: 600; box-shadow: var(--shadow-card); }
.ap-seg--accent span { color: var(--color-text); font-family: var(--font-mono); font-weight: 500; }
.ap-seg--accent .is-on { background: var(--color-accent); color: var(--color-on-accent); box-shadow: none; font-weight: 500; }
.ap-vitals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-vital { padding: 10px 12px; border-radius: 14px; }
.ap-vital small, .ap-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted); }
.ap-vital .ap-mono { font-size: 16px; }
.ap-road { display: flex; flex-direction: column; }
.ap-road div { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; font-size: 13px; }
.ap-road div + div { border-top: 1px solid var(--color-hairline); color: var(--color-text-muted); }
.ap-road b { width: 84px; flex-shrink: 0; font-size: 9.5px; font-weight: 600; letter-spacing: .1em; color: var(--color-text-muted); }
.ap-road div:first-child b { color: var(--color-accent); }
.ap-actionbar { flex-shrink: 0; background: var(--color-surface); border-top: 1px solid var(--color-hairline); padding: 12px 16px 16px; display: flex; gap: 10px; }
.ap-pbtn { flex: 1; height: 46px; border-radius: 14px; background: var(--color-accent); color: var(--color-on-accent); display: flex; align-items: center; justify-content: center; font-size: 14.5px; font-weight: 500; flex-shrink: 0; }
.ap-obtn { height: 46px; box-sizing: border-box; border-radius: 14px; border: 1.5px solid var(--color-accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; }
.ap-obtn--icon { width: 46px; flex-shrink: 0; }
.ap-obtn--danger { flex: 1; border-color: var(--color-danger); color: var(--color-danger); }

/* Rechner */
.ap-typepill { align-self: flex-start; font-size: 11px; font-weight: 600; background: var(--type-kombucha-fill); color: var(--type-kombucha-ink); padding: 4px 10px; border-radius: 999px; }
.ap-ings { padding: 4px 14px; list-style: none; margin: 0; }
.ap-ings li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; font-size: 14px; font-weight: 500; }
.ap-ings li + li { border-top: 1px solid var(--color-hairline); }
.ap-ings small { display: block; font-size: 12px; font-weight: 400; color: var(--color-text-muted); }
.ap-ings .ap-mono { font-size: 14.5px; white-space: nowrap; }
.ap-ings .ap-mono small { display: inline; }
.ap-duration { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--color-success-tint); color: var(--color-success-ink); font-size: 12px; }
.ap-duration .ap-label { color: var(--color-success-ink); }
.ap-duration .ap-mono { font-size: 15px; white-space: nowrap; }

/* Hilfe (Sheet) */
.ap-scr--sheet { padding: 34px 0 0; background: #E9E2D4; }  /* abgedunkelter Grund hinter dem Sheet */
.ap-sheet { flex: 1; background: var(--color-bg); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-sheet); padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ap-sheet__grip { align-self: center; width: 40px; height: 4px; border-radius: 999px; background: var(--color-hairline); }
.ap-sheet p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--color-text-muted); }
.ap-opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--color-surface); border: 1px solid var(--color-hairline); font-size: 13.5px; }
.ap-opt::before { content: ""; width: 18px; height: 18px; box-sizing: border-box; border-radius: 999px; border: 1.5px solid var(--color-disabled-text); flex-shrink: 0; }
.ap-opt.is-on { border: 1.5px solid var(--color-accent); font-weight: 500; }
.ap-opt.is-on::before { border: 0; background: var(--color-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 13l4.5 4.5L19 7' fill='none' stroke='%23FFFDFA' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.ap-sheet .ap-guidance { background: var(--notice-bg); color: var(--notice-text); border-radius: 14px; padding: 10px 12px; font-size: 12px; }
.ap-sheet__actions { display: flex; gap: 8px; margin-top: auto; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .ap-companions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ap-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .ap-hero, .ap-feature { grid-template-columns: minmax(0, 1fr); }
  .ap-feature--flip .ap-panel { order: 0; }
  .ap-feature__text { order: -1; }
  .ap-stage { height: 760px; display: flex; align-items: center; justify-content: center; }
  .ap-stage .ap-phone { position: static; }
  .ap-stage .ap-phone:first-child { display: none; }  /* Handy: nur ein Screen im Hero */
  .ap-panel { height: 740px; }
  .ap-band__head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .ap-cta { flex-direction: column; align-items: stretch; text-align: center; padding: 28px 24px; gap: 16px; }
  .ap-cta__art { width: auto; height: auto; background: none; }
  .ap-cta__art img { width: 140px; height: 140px; }
  .ap-cta__text { align-items: stretch; }
  .ap-cta__text .ap-actions { flex-direction: column; }
  .ap-wait { max-width: none; text-align: left; }
  .ap-cta__text .btn { justify-content: center; }
  .ap-next { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ap-wait__row { flex-direction: column; }
  .ap-hero__text .btn-secondary { display: none; }  /* Handy: ein Button, voll breit */
  .ap-hero__text .ap-actions, .ap-hero__text .btn-primary { width: 100%; justify-content: center; }
  .ap-companions { gap: 12px; }
  .ap-companion__tile { height: 104px; }
  .ap-companion__tile img { width: 88px; height: 88px; }
  .ap-companion strong { font-size: 14px; }
  .ap-companion span { font-size: 13px; }
  .ap-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ap-steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; padding: 18px 0; }
  .ap-steps li::before { grid-row: span 2; }
  .ap-steps h3 { font-family: var(--font-sans); font-size: 17px; letter-spacing: 0; padding-top: 8px; }
}
/* Sehr schmale Handys: Rahmen schrumpft mit, Inhalt bleibt lesbar */
@media (max-width: 359px) {
  .ap-phone { width: 100%; }
}
