/* Ruhig und hell wie eine Apple-Einrichtung: eine Frage je Bildschirm, gruppierte Listen, Pillen-Knöpfe.
   Überschriften in Archivo (katsu.media), Fließtext in der Systemschrift. */
@font-face {
  font-family: "Archivo"; font-weight: 800; font-display: swap;
  src: url("/fonts/Archivo-ExtraBold.ttf") format("truetype");
}

:root {
  --bg: #f5f5f7; --karte: #ffffff; --text: #1d1d1f; --leise: #6e6e73; --linie: #d2d2d7;
  --trenner: rgba(0, 0, 0, .08); --gewaehlt: #f0f0f3; --haupt: #1d1d1f; --auf-haupt: #ffffff;
  --akzent: #e2000a; --fehler: #c8000a; --link: #0066cc; --fokus: #0071e3; --vorschlag: #eaf1fb;
  --glas: rgba(245, 245, 247, .82); --segment: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --karte: #1c1c1e; --text: #f5f5f7; --leise: #a1a1a6; --linie: #424245;
    --trenner: rgba(255, 255, 255, .1); --gewaehlt: #2c2c2e; --haupt: #f5f5f7; --auf-haupt: #000000;
    --akzent: #ff453a; --fehler: #ff6961; --link: #2997ff; --fokus: #0a84ff; --vorschlag: #13243a;
    --glas: rgba(0, 0, 0, .78); --segment: #636366;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
[hidden] { display: none !important; }
.nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.springen:focus { position: fixed; top: .5rem; left: .5rem; width: auto; height: auto; clip: auto; z-index: 20;
  background: var(--karte); padding: .5rem 1rem; border-radius: 8px; }
.innen { width: 100%; max-width: 40rem; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Kopf mit Wortmarke, Speicherstatus, DE/EN und Fortschrittslinie */
.kopf { position: sticky; top: 0; z-index: 10; background: var(--glas); padding-top: env(safe-area-inset-top, 0px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.kopf-innen { display: flex; align-items: center; gap: 1rem; min-height: 56px; }
.wortmarke { width: 104px; height: auto; flex: none; color: var(--text); }
.status { flex: 1; min-width: 0; margin: 0; font-size: .8125rem; color: var(--leise); text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.fehler { color: var(--fehler); font-weight: 600; white-space: normal; }
.sprachwahl { display: flex; flex: none; background: var(--gewaehlt); border-radius: 9px; padding: 2px; }
.sprachwahl button { font: inherit; font-size: .8125rem; font-weight: 600; border: 0; border-radius: 7px;
  background: transparent; color: var(--leise); min-width: 44px; min-height: 32px; cursor: pointer; }
.sprachwahl button[aria-pressed=true] { background: var(--segment); color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.balken { height: 3px; background: var(--trenner); }
.balken span { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .35s ease; }

main { flex: 1; padding-block: 2.5rem 9rem; outline: none; }
.laden { color: var(--leise); }

/* Ein Schritt */
.schritt { display: grid; gap: .9rem; animation: herein .32s ease both; }
/* nur Bewegung, keine Deckkraft: in Hintergrund-Tabs laufen Animationen nicht, der Inhalt bliebe unsichtbar */
@keyframes herein { from { transform: translateY(12px); } to { transform: none; } }
.teil-name { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; color: var(--leise); }
.teil-intro { margin: 0; color: var(--leise); }
h1, h2, h3 { text-wrap: balance; }
.frage, .start-titel { font-family: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 800;
  letter-spacing: -.02em; margin: 0; outline: none; }
.frage { font-size: clamp(1.65rem, 6.2vw, 2.25rem); line-height: 1.12; }
.start-titel { font-size: clamp(2.4rem, 11vw, 3.5rem); line-height: 1.05; }
.start-text { margin: 0; font-size: 1.1875rem; color: var(--leise); max-width: 34rem; }
.hinweis { margin: 0; color: var(--leise); font-size: .9375rem; }
.wichtig { margin: 0; justify-self: start; font-size: .75rem; font-weight: 600; color: var(--leise);
  background: var(--gewaehlt); border-radius: 999px; padding: .15rem .6rem; }
.art { margin: .4rem 0 -.4rem; font-size: .8125rem; color: var(--leise); }
.vorschlag { margin: 0; background: var(--vorschlag); border-radius: 12px; padding: .75rem 1rem; font-size: .9375rem; }
.vorschlag::before { content: "✦ "; color: var(--link); }

/* Gruppierte Auswahlliste */
.liste { background: var(--karte); border-radius: 14px; overflow: hidden; }
.zeile { position: relative; display: flex; align-items: center; gap: .75rem; min-height: 52px;
  padding: .7rem 1rem; cursor: pointer; transition: background-color .15s; }
.zeile + .zeile { box-shadow: inset 0 1px 0 var(--trenner); }
.zeile .text { flex: 1; min-width: 0; }
.wahl { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.haken { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--linie);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s; }
.zeile:has(.wahl:checked) { background: var(--gewaehlt); }
.zeile:has(.wahl:checked) .haken { background: var(--haupt); border-color: var(--haupt); }
.zeile:has(.wahl:checked) .haken::after { content: ""; width: 6px; height: 11px; margin-top: -2px;
  border: solid var(--auf-haupt); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.zeile:has(.wahl:focus-visible) { outline: 3px solid var(--fokus); outline-offset: -3px; border-radius: 14px; }
.anders-zeile { cursor: text; }
.anders { flex: 1; min-width: 0; font: inherit; color: var(--text); background: transparent; border: 0;
  padding: .25rem 0; outline: none; }
.anders::placeholder, .feld::placeholder { color: var(--leise); opacity: .8; }
.anders-zeile:focus-within { outline: 3px solid var(--fokus); outline-offset: -3px; border-radius: 14px; }

/* Texteingabe */
.feld { width: 100%; font: inherit; font-size: 1.125rem; color: var(--text); background: var(--karte);
  border: 1px solid var(--linie); border-radius: 12px; padding: .85rem 1rem; min-height: 52px; outline: none;
  transition: border-color .15s, box-shadow .15s; }
.feld:focus { border-color: var(--fokus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fokus) 22%, transparent); }
textarea.feld { min-height: 9rem; resize: vertical; line-height: 1.45; }
.farbzeile { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.farben { display: flex; flex-wrap: wrap; gap: .5rem; }
.farbe { width: 2rem; height: 2rem; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--trenner); }
.farbwaehler { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Knöpfe */
.knopf { font: inherit; font-weight: 600; border-radius: 980px; padding: .65rem 1.4rem; min-height: 44px;
  cursor: pointer; border: 0; background: transparent; color: var(--text); position: relative;
  transition: opacity .15s, transform .1s; }
.knopf:active { transform: scale(.98); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.haupt { background: var(--haupt); color: var(--auf-haupt); }
.knopf.gross { justify-self: start; font-size: 1.0625rem; padding: .85rem 2rem; min-height: 52px; margin-top: .5rem; }
.knopf.text { padding-inline: .75rem; justify-self: start; }
.knopf.leise { color: var(--leise); }
.knopf.link { color: var(--link); font-weight: 400; padding: .25rem .5rem; min-height: 44px; }
.knopf.klein { background: var(--karte); box-shadow: inset 0 0 0 1px var(--linie); font-size: .9375rem;
  padding: .5rem 1rem; display: inline-flex; align-items: center; }
.knopf.fokus, .knopf.klein:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }

/* Untere Leiste: Zurück · Überspringen · Weiter */
.steuerung { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--glas);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -1px 0 var(--trenner); padding-bottom: env(safe-area-inset-bottom, 0px); }
.steuerung .innen { display: flex; align-items: center; gap: .25rem; padding-block: .6rem; }
.steuerung .luecke { flex: 1; }
.steuerung .knopf.haupt { min-width: 7.5rem; }

/* Willkommen */
.punkte { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .8rem; }
.punkte li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .5rem; }
.punkte li::before { content: "✓"; font-weight: 700; color: var(--akzent); }

/* Upload */
.upload { border: 1.5px dashed var(--linie); border-radius: 14px; padding: 1rem; display: grid; gap: .6rem;
  background: var(--karte); }
.upload.ueber { border-color: var(--fokus); background: var(--vorschlag); }
.upload .zeile { padding: 0; min-height: 0; cursor: default; flex-wrap: wrap; gap: .5rem 1rem; }
.upload ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .9375rem; }
.upload li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; min-width: 0;
  overflow-wrap: anywhere; }
.upload li .groesse { color: var(--leise); }
.upload li.fehler { color: var(--fehler); }
.upload progress { width: min(16rem, 100%); height: .5rem; accent-color: var(--fokus); }

/* Übersicht */
.gruppe { display: grid; gap: .5rem; margin-top: .75rem; }
.gruppe h3 { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; color: var(--leise); }
.gruppe dl { margin: 0; background: var(--karte); border-radius: 14px; overflow: hidden; }
.eintrag { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: .8rem .5rem .8rem 1rem;
  align-items: center; }
.eintrag + .eintrag { box-shadow: inset 0 1px 0 var(--trenner); }
.eintrag dt { font-weight: 600; font-size: .9375rem; min-width: 0; }
.eintrag dd { margin: 0; grid-column: 1; color: var(--text); font-size: .9375rem; min-width: 0;
  overflow-wrap: anywhere; }
.eintrag dd.leer, .eintrag dd.offen { color: var(--leise); }
.eintrag .knopf { grid-column: 2; grid-row: 1 / span 2; }

.fuss { padding-block: 1.5rem 7rem; color: var(--leise); font-size: .8125rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
