/* Gestaltung nach PLAN.md §5.5: hell, lebendig, Farbe trägt Bedeutung.
   Textkontraste geprüft (WCAG AA ≥ 4,5 : 1). */

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fffaf3;
  --card: #ffffff;
  --text: #1e1b4b;
  --muted: #5b5880;
  --line: #ece6f5;

  --action: #6d28d9;      /* Aktion / Sprechen */
  --action-2: #7c3aed;
  --action-soft: #ede4fc;
  --coach: #14b8a6;       /* Coach spricht */
  --coach-soft: #d5f5f0;
  --better: #fbbf24;      /* Verbesserung, nie Rot */
  --better-soft: #fef3c7;
  --tr: #fb923c;          /* Türkisch */
  --tr-soft: #ffedd5;
  --ok: #16a34a;
  --ok-text: #15803d;
  --der: #2563eb;
  --die: #dc2626;
  --das: #15803d;
  --error: #b91c1c;

  --radius: 22px;
  --shadow: 0 8px 24px rgba(30, 27, 75, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, "Noto Sans", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

.view { display: flex; flex-direction: column; gap: 16px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 900; font-size: 20px; color: var(--action); letter-spacing: 0.2px; }

.tr { color: var(--muted); font-size: 16px; margin: 0; }
.muted { color: var(--muted); font-size: 16px; margin: 0; }
.error { color: var(--error); font-weight: 700; margin: 0; }

/* Buttons --------------------------------------------------------------- */

button { font: inherit; color: inherit; cursor: pointer; }

.btn {
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 800;
}
.btn-primary { background: var(--action); color: #fff; box-shadow: 0 6px 16px rgba(109, 40, 217, 0.3); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--action); }

.icon-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--action);
}

/* Start ------------------------------------------------------------------ */

.hero {
  background: linear-gradient(135deg, var(--action) 0%, var(--action-2) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.28);
}
.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; font-weight: 900; }
.hero p { margin: 0; font-size: 17px; opacity: 0.95; }

.topics { display: grid; gap: 12px; }
.topic {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.topic:active { transform: scale(0.99); border-color: var(--action); }
.topic .ico {
  flex: none;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--action-soft);
  color: var(--action);
}
.topic .de { display: block; font-weight: 800; font-size: 19px; }
.topic .tr { display: block; }

/* Gespräch --------------------------------------------------------------- */

.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--action-soft);
  color: var(--action);
  font-weight: 800;
  font-size: 15px;
}

.stage { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; }
.status { margin: 8px 0 0; font-weight: 900; font-size: 22px; }

.orb {
  --level: 0;
  position: relative;
  width: 184px; height: 184px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: var(--muted);
  transition: background 0.25s ease, transform 0.08s linear;
  transform: scale(calc(1 + var(--level) * 0.12));
}
.orb::before, .orb::after {
  content: "";
  position: absolute; inset: -14px;
  border-radius: 50%;
  border: 6px solid transparent;
  opacity: 0;
}
.orb[data-state="connecting"] { background: #a79fcf; animation: breathe 1.6s ease-in-out infinite; }
.orb[data-state="listening"] { background: var(--action); }
.orb[data-state="listening"]::before { border-color: var(--action); animation: ring 1.2s ease-out infinite; }
.orb[data-state="thinking"] { background: var(--action-soft); color: var(--action); }
.orb[data-state="speaking"] { background: var(--coach); color: var(--text); }
.orb[data-state="speaking"]::before { border-color: var(--coach); animation: ring 1.4s ease-out infinite; }
.orb[data-state="speaking"]::after { border-color: var(--coach); animation: ring 1.4s ease-out 0.7s infinite; }
.orb[data-state="yourturn"] { background: var(--card); color: var(--action); box-shadow: inset 0 0 0 6px var(--action), var(--shadow); }
.orb[data-state="paused"] { background: #d6d3e3; color: var(--text); }
.orb[data-state="error"] { background: #d6d3e3; color: var(--error); }

.dots { display: none; gap: 8px; }
.orb[data-state="thinking"] .dots { display: flex; }
.orb[data-state="thinking"] .mic { display: none; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--action); animation: dot 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes ring { from { transform: scale(0.92); opacity: 0.85; } to { transform: scale(1.25); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(0.95); } }
@keyframes dot { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .orb, .orb::before, .orb::after, .dots i { animation: none !important; transition: none; }
}

.subtitles {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 34dvh;
  overflow-y: auto;
  padding: 2px;
}
.line {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 18px;
}
.line.coach { align-self: flex-start; background: var(--coach-soft); border-bottom-left-radius: 6px; }
.line.learner { align-self: flex-end; background: var(--card); border: 2px solid var(--line); border-bottom-right-radius: 6px; }
.line.live { opacity: 0.75; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--action);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.25;
}
.action small { display: block; color: var(--muted); font-weight: 700; font-size: 14px; }
.action-tr { background: var(--tr); border-color: var(--tr); color: var(--text); }
.action-tr small { color: var(--text); }
.action[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: #fff; }
.action[aria-pressed="true"] small { color: #fff; }
.action:disabled { opacity: 0.45; }

.toggle { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 16px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--action); }

/* Ende ------------------------------------------------------------------- */

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.stat b { font-weight: 900; }
.done-title { margin: 8px 0 0; font-size: 26px; font-weight: 900; }

/* Einstellungen ---------------------------------------------------------- */

dialog {
  width: min(520px, calc(100vw - 32px));
  border: none;
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(30, 27, 75, 0.25);
}
dialog::backdrop { background: rgba(30, 27, 75, 0.35); }
dialog h2 { margin: 0 0 12px; font-size: 22px; font-weight: 900; }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 800; }
.field select {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--bg);
  font: inherit;
  color: var(--text);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ======================================================================
   Ab hier: Üben, Fortschritt, Navigation (Phase 1b ff.)
   ====================================================================== */

main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.bi { display: inline-flex; flex-direction: column; line-height: 1.25; }
.bi .de { font-weight: 800; }
.bi .tr { font-size: 15px; }

.section { margin: 10px 0 0; font-size: 19px; }
.section .tr { font-weight: 600; }
h3 { margin: 4px 0; font-size: 18px; font-weight: 900; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wide { width: 100%; }
.small { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.icon-btn.small { width: 36px; height: 36px; min-height: 0; padding: 0; vertical-align: middle; }
.tr-block { color: var(--muted); margin: 0; border-left: 4px solid var(--tr); padding: 2px 0 2px 10px; }
.btn-coach { background: var(--coach); color: var(--text); display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn-ghost.small { border-width: 2px; }
.chip-ok { background: #dcfce7; color: var(--ok-text); }
.chip-better { background: var(--better-soft); color: var(--text); }

/* Reiterleiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 560px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 2px solid var(--line);
  backdrop-filter: blur(8px);
}
.tabbar button {
  display: grid; justify-items: center; gap: 0;
  min-height: 56px; border: none; background: none; color: var(--muted);
  border-radius: 16px; font-weight: 800; font-size: 14px; line-height: 1.1;
}
.tabbar button small { font-weight: 600; font-size: 12px; }
.tabbar button[aria-current="page"] { color: var(--action); background: var(--action-soft); }

/* Start: Rollenspiele */
.scenario-group h3 { margin: 6px 0; color: var(--muted); font-size: 16px; }
.scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scenario {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 12px; min-height: 96px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.scenario .bi .de { font-size: 16px; }
.scenario .bi .tr { font-size: 13px; }
.scenario .chip { font-size: 12px; padding: 2px 8px; }
.goal { font-size: 16px; }

/* Üben: Übersicht */
.hero-btn { display: grid; gap: 4px; text-align: left; border: none; width: 100%; cursor: pointer; }
.hero-title { font-size: 24px; font-weight: 900; }
.hero-sub { font-size: 16px; opacity: 0.95; }
.hero-cta { justify-self: start; margin-top: 8px; background: #fff; color: var(--action); border-radius: 999px; padding: 8px 18px; font-weight: 900; }
.ptiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ptile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-height: 104px; padding: 14px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.ptile .ico {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; background: var(--action-soft); color: var(--action);
}
.ptile:active, .scenario:active { transform: scale(0.98); border-color: var(--action); }
.badge {
  position: absolute; top: -6px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--action); color: #fff; font-size: 13px; font-weight: 900;
  display: grid; place-items: center;
}

/* Übungsrunde */
.run-title { font-weight: 900; font-size: 18px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--action-soft); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--action), var(--coach)); transition: width 0.3s ease; }
.exercise { display: grid; gap: 12px; }
.ex-kind { display: flex; align-items: center; gap: 10px; color: var(--action); }
.ex-kind .tr { color: var(--muted); }
.prompt-tr { margin: 0; color: var(--muted); font-size: 17px; }
.big-word { margin: 0; font-size: 34px; font-weight: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-word.tr-word { font-size: 28px; color: var(--text); }
.big-sentence { font-size: 24px; font-weight: 800; margin: 0; line-height: 1.4; }
.example { margin: 0; font-style: italic; }
.done-card { text-align: center; display: grid; gap: 8px; }

.article-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.article-btn { min-height: 64px; border-radius: 18px; border: 3px solid transparent; color: #fff; font-size: 24px; font-weight: 900; }
.article-btn.g-der { background: var(--der); }
.article-btn.g-die { background: var(--die); }
.article-btn.g-das { background: var(--das); }
.article-btn:disabled { opacity: 0.35; }
.article-btn.right { opacity: 1; box-shadow: 0 0 0 4px var(--better); }
.article-btn.wrong { opacity: 0.6; text-decoration: line-through; }
span.g-der { color: var(--der); font-weight: 900; }
span.g-die { color: var(--die); font-weight: 900; }
span.g-das { color: var(--das); font-weight: 900; }

.tile-line {
  min-height: 64px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border: 3px dashed var(--line); border-radius: 18px; background: var(--bg);
}
.tile-line.ok { border-style: solid; border-color: var(--ok); }
.tile-line.wrong { border-style: solid; border-color: var(--better); }
.tile-line:first-letter { text-transform: uppercase; }
.tile-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; }
.tile {
  min-height: 46px; padding: 8px 14px; border-radius: 14px;
  border: 2px solid var(--action); background: var(--card); color: var(--text); font-weight: 800; font-size: 18px;
}
.tile-line .tile { background: var(--action-soft); }

.cloze-text { font-size: 22px; line-height: 1.6; margin: 0; }
.gap { display: inline-block; min-width: 72px; border-bottom: 3px solid var(--action); text-align: center; font-weight: 900; padding: 0 6px; }
.gap.ok { color: var(--ok-text); border-color: var(--ok); }
.gap.fixed { background: var(--better-soft); border-color: var(--better); border-radius: 8px 8px 0 0; }
.options { display: grid; gap: 8px; }
.options.two { grid-template-columns: 1fr 1fr; }
.option {
  min-height: 52px; padding: 10px 14px; text-align: left;
  border: 2px solid var(--line); border-radius: 16px; background: var(--card); font-size: 18px; font-weight: 700;
}
.option.big { font-size: 24px; font-weight: 900; text-align: center; min-height: 72px; }
.option.selected { border-color: var(--action); background: var(--action-soft); }
.option.right { border-color: var(--ok); background: #dcfce7; }
.option.wrong { border-color: var(--better); background: var(--better-soft); text-decoration: line-through; }

.verdict { padding: 12px 14px; border-radius: 16px; display: grid; gap: 4px; }
.verdict.ok { background: #dcfce7; border: 2px solid var(--ok); }
.verdict.better { background: var(--better-soft); border: 2px solid var(--better); }
.verdict .solution { font-size: 20px; font-weight: 800; }
.feedback { display: grid; gap: 10px; }
.feedback:empty { display: none; }

.expl { border: 2px solid var(--action-soft); border-radius: 16px; background: #fbf8ff; }
.expl summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.expl summary::-webkit-details-marker { display: none; }
.expl .why { background: var(--action); color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 900; font-size: 15px; }
.expl-title { font-weight: 800; color: var(--action); }
.expl-body { padding: 0 14px 14px; display: grid; gap: 8px; }
.expl-rule { font-weight: 700; margin: 0; }
.bridge { margin: 0; background: var(--tr-soft); border-radius: 12px; padding: 8px 10px; }
.memo { margin: 0; background: var(--better-soft); border-radius: 12px; padding: 8px 10px; }
.examples { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.examples li span { display: block; }
.more summary { cursor: pointer; font-weight: 800; color: var(--action); padding: 6px 0; }

.reading-text { font-size: 19px; background: var(--bg); border-radius: 16px; padding: 4px 14px; }
.gloss { border: none; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline dotted var(--action); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gloss-tip { background: var(--tr-soft); border-radius: 12px; padding: 10px 12px; }
.questions { display: grid; gap: 14px; }
.question p { margin: 0 0 6px; }
.transcript { background: var(--coach-soft); border-radius: 16px; padding: 6px 14px; }

.input {
  width: 100%; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--card); font: inherit; color: var(--text);
}
.input:focus { outline: 3px solid var(--action-soft); border-color: var(--action); }
.direct { font-size: 22px; font-weight: 800; margin: 0; }
.points { margin: 0; padding-left: 20px; color: var(--muted); }
.improved { white-space: pre-wrap; background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 0; }
.corrections { display: grid; gap: 10px; }
.correction { background: var(--better-soft); border-left: 6px solid var(--better); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.correction p { margin: 0; }
.said { text-decoration: line-through; text-decoration-color: rgba(30, 27, 75, 0.45); color: var(--muted); }
.said.big { font-size: 22px; text-decoration: none; color: var(--text); font-weight: 700; }
.arrow { font-size: 19px; }

.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate-row p { grid-column: 1 / -1; margin: 0; }
.rate { min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); padding: 6px; }
.rate .bi .de { font-size: 15px; }
.rate .bi .tr { font-size: 12px; }
.rate-1 { border-color: var(--better); }
.rate-3, .rate-4 { border-color: var(--ok); }

.rec-btn {
  justify-self: center; width: 132px; height: 132px; border-radius: 50%; border: none;
  background: var(--action); color: #fff; display: grid; place-items: center; align-content: center; gap: 4px;
  font-weight: 800; font-size: 14px; touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 10px 24px rgba(109, 40, 217, 0.35);
}
.rec-btn svg { width: 44px; height: 44px; }
.rec-btn small { font-size: 12px; font-weight: 700; opacity: 0.9; }
.rec-btn.active { background: var(--die); transform: scale(1.06); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0.18); }
.rec-btn:disabled { opacity: 0.5; }
.w-ok { color: var(--ok-text); }
.w-miss { background: var(--better-soft); border-radius: 6px; }

/* Fortschritt */
.level-card { display: flex; gap: 16px; align-items: center; }
.level-big {
  flex: none; width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--action), var(--action-2)); color: #fff; font-size: 32px; font-weight: 900;
}
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px; display: grid; gap: 2px; }
.stat-value { font-size: 24px; font-weight: 900; color: var(--action); }
.stat-tile .bi .de { font-size: 14px; }
.stat-tile .bi .tr { font-size: 12px; }
.cat-list { display: grid; gap: 10px; }
.cat { display: grid; gap: 8px; padding: 14px 16px; }
.cat-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meter { height: 10px; border-radius: 999px; background: var(--better-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); }
.cando { display: grid; gap: 10px; margin-bottom: 10px; padding: 14px 16px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg { min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); padding: 4px; }
.seg .bi .de { font-size: 14px; }
.seg .bi .tr { font-size: 12px; }
.seg.on { border-color: var(--action); background: var(--action-soft); }
.seg.seg-kann.on { border-color: var(--ok); background: #dcfce7; }

/* Nachbesprechung */
.debrief { display: grid; gap: 12px; }
.loading { display: flex; gap: 14px; align-items: center; }
.loading .dots { display: flex; }
.strengths ul { margin: 4px 0 0; padding-left: 20px; }
.answer { display: grid; gap: 8px; }

/* Meldungen */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: 528px; margin: 0 auto; padding: 12px 16px; border-radius: 16px;
  background: var(--text); color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(30, 27, 75, 0.3);
}
.toast.info { background: var(--action); }

.glossary { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* ======================================================================
   Führung: Heute, Lernweg, Etappe, Begrüßung
   ====================================================================== */

.small-text { font-size: 14px; }
.link-btn { background: none; border: none; color: var(--action); font-weight: 800; text-decoration: underline; padding: 8px 0; justify-self: start; }

/* Heute */
.plan { display: grid; gap: 12px; }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plan-head .bi .de { font-size: 20px; font-weight: 900; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 64px; padding: 10px 12px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--bg);
}
.plan-item.next { border-color: var(--action); background: var(--action-soft); }
.plan-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--action); color: #fff; font-weight: 900;
}
.plan-text { flex: 1; display: grid; gap: 2px; }
.unit-card { display: grid; gap: 6px; text-align: left; border: 2px solid var(--line); width: 100%; cursor: pointer; }
.unit-card .bi .de { font-size: 18px; }
.tip { border-left: 6px solid var(--coach); display: grid; gap: 8px; }
.tip ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* Lernweg */
.level-block { display: grid; gap: 8px; }
details.level-block > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
details.level-block > summary::-webkit-details-marker { display: none; }
.level-head { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.level-badge {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--action), var(--action-2)); color: #fff; font-weight: 900;
}
.path-list { list-style: none; margin: 0; padding: 0 0 0 20px; display: grid; gap: 8px; border-left: 4px solid var(--action-soft); margin-left: 20px; }
.path-unit {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 64px; padding: 10px 12px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.path-unit.current { border-color: var(--action); box-shadow: 0 0 0 4px var(--action-soft); }
.path-unit.fertig { background: #f0fdf4; }
.path-dot {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--action-soft); color: var(--action); font-weight: 900; margin-left: -34px;
  border: 3px solid var(--bg);
}
.path-unit.fertig .path-dot { background: var(--ok); color: #fff; }
.path-unit.current .path-dot { background: var(--action); color: #fff; }
.path-text { display: grid; gap: 4px; justify-items: start; }

/* Etappe */
.unit-head h3 { margin: 0; }
.goal-line { margin: 8px 0 0; font-size: 16px; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 60px; padding: 8px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card);
}
.step .bi { flex: 1; }
.step-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--action-soft); color: var(--action);
}
.step.done { background: #f0fdf4; }
.step.done .step-icon { background: var(--ok); color: #fff; }
.step.next { border-color: var(--action); box-shadow: 0 0 0 4px var(--action-soft); }
.ptiles.one { grid-template-columns: 1fr; }
.big-tile { min-height: 120px; }

/* Begrüßung */
.dots-row { display: flex; justify-content: center; gap: 8px; padding: 6px 0; }
.dots-row span { width: 10px; height: 10px; border-radius: 50%; background: var(--action-soft); }
.dots-row span.on { background: var(--action); width: 28px; border-radius: 999px; }
.onb-title { margin: 8px 0; font-size: 22px; }
.onb-title .bi .de { font-size: 22px; font-weight: 900; }
.onb-points { display: grid; gap: 14px; }
.onb-point { display: grid; grid-template-columns: 48px 1fr; gap: 4px 12px; align-items: start; }
.onb-point .ico { grid-row: span 2; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--action-soft); color: var(--action); }
.onb-point p { margin: 0; grid-column: 2; }
.choices { display: grid; gap: 10px; }
.choice {
  width: 100%; text-align: left; min-height: 64px; padding: 12px 14px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.choice.on { border-color: var(--action); background: var(--action-soft); }
.choice.recommended { border-color: var(--coach); }
.choice.recommended.on { border-color: var(--action); }
.onb-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.onb-nav .btn-primary:disabled { opacity: 0.45; }

/* Üben: Rollenspiele ausklappbar */
.scenario-group > summary { cursor: pointer; font-weight: 800; color: var(--action); padding: 8px 0; }

.lt-hints ul { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.lt-hints:empty { display: none; }

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

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .field { margin-bottom: 0; }
.auth-title .de { font-weight: 900; font-size: 20px; }
.field-label { font-weight: 800; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 16px; }
.check input { width: 22px; height: 22px; accent-color: var(--action); }
.notice { background: var(--coach-soft); border-radius: 14px; padding: 12px 14px; margin: 0; }
.center { text-align: center; }
.account { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--line); padding-top: 12px; margin-top: 4px; }
.account a.btn { text-decoration: none; }
.account .admin { display: flex; flex-direction: column; gap: 8px; }
.account .admin summary { cursor: pointer; font-weight: 800; color: var(--action); }
.account .admin[open] { display: flex; }
.account .admin .input { margin-bottom: 8px; }

/* Motivation: Wochenziel, Meilensteine, Teilen (PLAN.md §4.11) ---------------- */

.week { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.week-dots { display: grid; grid-template-columns: repeat(7, minmax(0, 36px)); gap: 6px; }
.week-dot {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--muted); background: var(--bg); border: 2px solid var(--line);
}
.week-dot.on { background: var(--coach); border-color: var(--coach); color: var(--text); }
.week-dot.today { border-color: var(--action); }
.week-text { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.week-text .de { font-weight: 800; }
.week.reached { background: var(--coach-soft); }

.celebrate { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--better); }
.celebrate.big { background: linear-gradient(135deg, var(--better-soft) 0%, var(--card) 70%); }
.celebrate-kicker { font-size: 14px; font-weight: 900; color: var(--action); text-transform: uppercase; letter-spacing: 0.4px; }
.celebrate-title .de { font-size: 22px; font-weight: 900; }
.celebrate .row { margin-top: 4px; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; width: 10px; height: 10px; border-radius: 50%; opacity: 0; }
.burst .b1 { right: 18%; top: 22%; background: var(--better); }
.burst .b2 { right: 8%; top: 40%; background: var(--coach); }
.burst .b3 { right: 26%; top: 12%; background: var(--tr); }
.burst .b4 { right: 12%; top: 14%; background: var(--action); }
.burst .b5 { right: 30%; top: 34%; background: var(--coach); }
.burst .b6 { right: 5%; top: 24%; background: var(--better); }
@media (prefers-reduced-motion: no-preference) {
  .celebrate { animation: pop 0.45s ease-out both; }
  .burst i { animation: float 1.6s ease-out 0.2s 1 both; }
  .burst .b2, .burst .b5 { animation-delay: 0.35s; }
  .burst .b3, .burst .b6 { animation-delay: 0.5s; }
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float {
  0% { opacity: 0; transform: translateY(14px) scale(0.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px) scale(1); }
}

.milestones { display: flex; flex-direction: column; gap: 12px; }
.milestones .card { display: flex; flex-direction: column; gap: 10px; }
.next-goal { display: flex; flex-direction: column; gap: 6px; }
.earned-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.earned { display: flex; align-items: center; gap: 12px; }
.earned-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.earned-ico {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--better-soft); color: #b45309; font-weight: 900; font-size: 20px;
}
.earned-ico.big { background: var(--action); color: #fff; }

.share-dialog { max-width: 440px; width: calc(100% - 32px); }
.share-dialog h2 { margin-top: 0; }
.share-preview { display: block; width: 100%; max-height: 52vh; object-fit: contain; aspect-ratio: 4 / 5; border-radius: 16px; background: var(--action-soft); margin-bottom: 12px; }
.share-format { grid-template-columns: repeat(2, 1fr); margin-bottom: 10px; }
.share-format .seg { min-height: 44px; font-weight: 800; color: var(--action); }
.share-dialog .check { margin-bottom: 6px; }
