/* Kernsatz — Gesprächsoberfläche
 *
 * Dieselben Marken-Tokens wie die Akquiseseite (web/public/styles.css),
 * aber fuer eine Ein-Bildschirm-App statt eine mehrgliedrige Landingpage.
 * Mobil zuerst: die eigentliche Nutzung ist ein Telefon in der Hand, nicht
 * ein Browserfenster auf dem Schreibtisch.
 */

:root {
  --paper:      #f6f3ee;
  --paper-2:    #efeae1;
  --ink:        #14130f;
  --ink-2:      #4c4840;
  --ink-3:      #706a5f;
  --line:       #ded7ca;
  --line-2:     #ebe5da;

  --ember:      #b8461f;
  --ember-tief: #8f3616;
  --ember-soft: #f7e7dd;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, Cantarell,
          "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #121210;
    --paper-2:    #1a1815;
    --ink:        #ebe6dd;
    --ink-2:      #b3ada2;
    --ink-3:      #857f74;
    --line:       #2d2a24;
    --line-2:     #242118;

    --ember:      #e07a4f;
    --ember-tief: #ef9068;
    --ember-soft: #2a1a12;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Ohne !important wuerde jede spaetere display-Regel mit derselben
   Spezifitaet (z.B. .start{display:flex}, .app-inhalt{display:contents})
   das [hidden]-Attribut unbemerkt aufheben - Autorenregeln schlagen die
   UA-Stylesheet-Regel bei gleicher Spezifitaet. */
[hidden] { display: none !important; }

.app-inhalt { display: contents; }

html, body {
  height: 100%;
  /* dvh statt vh: iOS Safari zieht die Adressleiste sonst vom Layout ab und
     die Eingabeleiste haengt hinter der Tastatur. */
  height: 100dvh;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}

:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ------------------------------------------------------------------- Kopf */

header.kopf {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.marke {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink);
}
.marke em { font-style: normal; color: var(--ember); }
.kopf-rechts { display: flex; align-items: center; gap: 10px; }
.fortschritt {
  font-size: .78rem; color: var(--ink-3); font-weight: 600;
  letter-spacing: .02em;
}
.stumm {
  background: none; border: 1px solid var(--line); border-radius: 20px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); cursor: pointer; flex: none;
}
.stumm[aria-pressed="true"] { color: var(--ember); border-color: var(--ember); }
.stumm svg { width: 16px; height: 16px; }

/* -------------------------------------------------------------- Verlauf */

main#verlauf {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 22px 18px 8px;
  display: flex; flex-direction: column; gap: 22px;
}

.zug { max-width: 68ch; }
.zug.assistent {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.42;
  letter-spacing: -0.006em; color: var(--ink);
}
.zug.nutzer {
  align-self: flex-end; text-align: right; color: var(--ink-2);
  font-size: .98rem; max-width: 80%;
  background: var(--paper-2); border-radius: 14px 14px 4px 14px;
  padding: 9px 14px;
}
.zug.hinweis {
  align-self: center; font-size: .78rem; color: var(--ember-tief);
  letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
}
.zug.denkt { color: var(--ink-3); font-style: italic; font-size: .95rem; }
.weiter-knopf {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 20px;
  padding: 10px 20px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.zug.feedback {
  max-width: 100%; background: var(--paper-2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 12px 14px; display: grid; gap: 8px;
}
.zug.feedback textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--paper); color: var(--ink); resize: vertical;
}
.zug.feedback .klein { margin: 0; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.zug.hinweis-lang {
  font-family: var(--sans); font-size: .92rem; color: var(--ink-2);
  background: var(--ember-soft); border-radius: 12px; padding: 12px 14px; cursor: pointer;
}

/* Krise: bewusst NICHT die Ember-Markenfarbe (die steht fuer normales
   Engagement) - ruhig, klar abgesetzt, mit anklickbaren Ressourcen. */
.zug.krise {
  max-width: 100%; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; font-family: var(--sans);
  font-size: 1rem; line-height: 1.6; white-space: pre-line;
}
.zug.krise a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* -------------------------------------------------------------- Eingabe */

footer.eingabe {
  flex: none; padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--paper);
}

button.mikro {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--ink); color: var(--paper); border: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, transform .1s;
}
button.mikro:active { transform: scale(.94); }
button.mikro[aria-pressed="true"] {
  background: var(--ember); animation: puls 1.4s ease-in-out infinite;
}
button.mikro svg { width: 22px; height: 22px; }
button.mikro:disabled { opacity: .35; cursor: default; animation: none; }

@keyframes puls {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ember) 45%, transparent); }
  50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ember) 0%, transparent); }
}

.text-box {
  flex: 1; display: flex; align-items: flex-end; gap: 6px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 22px;
  padding: 6px 6px 6px 16px;
}
textarea#text {
  flex: 1; resize: none; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.4; padding: 8px 0;
  min-height: 24px; max-height: 120px;
}
textarea#text:focus { outline: none; }
textarea#text::placeholder { color: var(--ink-3); }

button.senden {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ember); color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
button.senden:disabled { opacity: .35; cursor: default; }
button.senden svg { width: 17px; height: 17px; }

.transkript-hinweis {
  flex: none; padding: 0 18px 8px; font-size: .78rem; color: var(--ember-tief);
  display: none;
}
.transkript-hinweis.aktiv { display: block; }

/* ----------------------------------------------------------- Startschirm */

.start {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 40px 24px; gap: 18px;
}
.start .marke-gross {
  font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -0.02em;
}
.start .marke-gross em { font-style: normal; color: var(--ember); }
.start p { color: var(--ink-2); max-width: 42ch; line-height: 1.55; margin: 0; }
.start button {
  margin-top: 8px; background: var(--ink); color: var(--paper); border: 0;
  border-radius: 24px; padding: 14px 30px; font: inherit; font-weight: 600;
  font-size: 1rem; cursor: pointer;
}

.start .seite-titel {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.015em; margin: 0; max-width: 24ch;
}
.start .klein, .blatt .klein { font-size: .9rem; color: var(--ink-3); }
.start .fehler { color: var(--ember-tief); }
.start button.leise, .start a.leise, .blatt button.leise {
  background: none; color: var(--ink-3); border: 0; margin-top: 0; padding: 8px 12px;
  font-size: .9rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.start a.knopf {
  display: inline-block; margin-top: 8px; background: var(--ink); color: var(--paper);
  border-radius: 24px; padding: 14px 30px; font-weight: 600; text-decoration: none;
}
.start a.knopf.leise { background: none; color: var(--ink-3); padding: 8px 12px; font-weight: 500; text-decoration: underline; }
.start form button, .blatt button {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 24px;
  padding: 12px 22px; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer;
}
button.gefaehrlich, .blatt button.gefaehrlich { background: var(--ember-tief); }
.formular {
  display: flex; gap: 8px; width: 100%; max-width: 420px; margin-top: 6px;
}
.formular input, .formular select {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 22px; background: var(--paper-2); color: var(--ink);
}
#einladungCode { text-transform: uppercase; letter-spacing: .12em; text-align: center; }

/* ------------------------------------------------------------- Konto-Blatt */

.blatt {
  position: fixed; inset: 0; z-index: 10; background: color-mix(in srgb, var(--ink) 35%, transparent);
  display: flex; align-items: flex-end; justify-content: center;
}
.blatt-inhalt {
  background: var(--paper); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 18px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.blatt h2 { font-family: var(--serif); font-size: 1.4rem; margin: 0; }
.blatt h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ember-tief); margin: 0 0 4px; }
.blatt section { padding: 16px 0; border-top: 1px solid var(--line); }
.blatt section:first-of-type { border-top: 0; }
.blatt p { margin: 0 0 8px; }
.blatt .links a { color: var(--ink); font-weight: 600; }
.blatt .formular { margin-top: 10px; }
.blatt button.stumm { background: none; color: var(--ink-2); padding: 0; font-weight: 500; }

.wahl { display: grid; gap: 8px; margin-top: 8px; }
.wahl label { font-size: .95rem; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.wahl input { margin-top: 5px; accent-color: var(--ember); }
.schalter { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.schalter input { width: 20px; height: 20px; accent-color: var(--ember); }
.blatt .stand-knoepfe { margin-top: 4px; }
.blatt button.leise { background: none; color: var(--ink-2); border: 1px solid var(--line); font-weight: 500; font-size: .95rem; }

/* ------------------------------------------------------------- Ansichten */

.ansicht { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ansicht.liste { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.liste-inhalt { padding: 22px 18px 30px; max-width: 680px; margin: 0 auto; width: 100%; }
.liste-inhalt h2, .stand h2, .review h2 {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.015em; margin: 0 0 8px;
}
.liste-inhalt h3, .review h3 {
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ember-tief);
  margin: 26px 0 10px; font-weight: 700;
}
.eyebrow {
  font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ember-tief);
  font-weight: 700; margin: 0 0 .6em;
}
.leer { color: var(--ink-3); font-size: .95rem; margin-top: 20px; }

nav.reiter {
  flex: none; display: flex; border-top: 1px solid var(--line); background: var(--paper);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.reiter button {
  flex: 1; background: none; border: 0; padding: 12px 6px 10px; font: inherit; font-size: .8rem;
  font-weight: 600; color: var(--ink-3); cursor: pointer; border-top: 2px solid transparent; margin-top: -1px;
}
nav.reiter button[aria-current="page"] { color: var(--ember); border-top-color: var(--ember); }

/* ----------------------------------------------------------------- Karten */

.karte {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.karte.status-abgelehnt { opacity: .55; }
.karte.status-bestaetigt { border-color: color-mix(in srgb, var(--ember) 45%, var(--line)); }
.karten { display: grid; gap: 10px; }
.aussage { font-family: var(--serif); font-size: 1.1rem; line-height: 1.35; margin: 0 0 6px; color: var(--ink); }
.durchgestrichen { text-decoration: line-through; margin: 0 0 6px; }
.zitat { font-size: .9rem; color: var(--ink-2); margin: 4px 0; font-style: italic; }
.zitat .beleg { font-style: normal; color: var(--ink-3); font-size: .8rem; }
.marke-status {
  display: inline-block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-3); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px;
  margin: 2px 6px 6px 0;
}
.karte-fuss { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.knoepfe { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.knoepfe textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); resize: vertical; }
.klein-knopf, .blatt .klein-knopf {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  padding: 7px 13px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.klein-knopf[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.feld { margin: 10px 0 4px; }
.feld h4 { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; font-weight: 700; }
.feld-zeile { font-size: .95rem; margin: 4px 0; color: var(--ink-2); }
.feld-zeile b { color: var(--ink); font-weight: 600; }
ul.einfach { margin: 4px 0 4px 1.1em; padding: 0; font-size: .95rem; color: var(--ink-2); }
ul.einfach li { margin-bottom: 4px; }
.felder > .feld:first-child { margin-top: 0; }
.ergebnis { padding: 22px 0; border-top: 1px solid var(--line); }
.ergebnis:first-child { border-top: 0; padding-top: 6px; }
.ergebnis h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; text-transform: none; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 4px; }
.aenderung { font-size: .92rem; color: var(--ink-2); background: var(--ember-soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
details { margin-top: 12px; }
summary { cursor: pointer; font-size: .9rem; color: var(--ink-3); font-weight: 600; }

/* ------------------------------------------------------- Stand & Prüfung */

.stand, .review {
  flex: 1; overflow-y: auto; padding: 36px 24px 30px; max-width: 620px; margin: 0 auto; width: 100%;
}
.stand { display: flex; flex-direction: column; justify-content: center; text-align: center; }
.stand h2 { font-size: 1.7rem; }
.stand p { color: var(--ink-2); margin: 0 auto 18px; max-width: 42ch; }
.stand-knoepfe { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.stand-knoepfe button, .review .stand-knoepfe button {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 24px;
  padding: 13px 26px; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer;
}
.stand-knoepfe button.leise { background: none; color: var(--ink-2); border: 1px solid var(--line); font-weight: 500; }
.review .karte { margin-bottom: 12px; }
.review textarea { width: 100%; margin-top: 8px; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); resize: vertical; }
.review .stand-knoepfe { margin: 24px 0 10px; }

@media (min-width: 720px) {
  .blatt { align-items: center; }
  .blatt-inhalt { border-radius: 18px; }
  main#verlauf { padding-left: max(18px, calc(50% - 340px)); padding-right: max(18px, calc(50% - 340px)); }
  footer.eingabe { padding-left: max(14px, calc(50% - 340px)); padding-right: max(14px, calc(50% - 340px)); }
}
