/* ============================================================
   Tanuki — Italienisch lernen · Design-System (Phase 0)
   Mobile-first, Referenz-Viewport 390 × 844 (iPhone)
   ============================================================ */

/* ---------- Design-Tokens ---------- */

:root {
  --bg:      #FAF6F0;
  --surface: #FFFFFF;
  --ink:     #2B211B;
  --muted:   #8B7D71;
  --brand:   #8C5A3C;
  --verde:   #1E7F4F;
  --rosso:   #C4453C;
  --giallo:  #E9B44C;
  --line:    #EADFD3;

  --radius:    16px;
  --radius-sm: 10px;

  --brand-ink:   #FFFFFF;
  --focus-ring:  rgba(140, 90, 60, 0.22);
  --shadow-card: 0 10px 30px rgba(43, 33, 27, 0.07), 0 2px 8px rgba(43, 33, 27, 0.05);
  --shadow-btn:  0 6px 16px rgba(140, 90, 60, 0.26);
  --tabbar-bg:   rgba(255, 255, 255, 0.85);

  --giallo-soft: rgba(233, 180, 76, 0.18);
  --verde-soft:  rgba(30, 127, 79, 0.12);
  --rosso-soft:  rgba(196, 69, 60, 0.10);

  /* rosso für kleinen Text direkt auf --surface (Neg-Zahlen im Battle):
     im Light Mode = --rosso, im Dark Mode aufgehellt für WCAG-AA. */
  --rosso-text:  #C4453C;

  --font: -apple-system, "SF Pro", system-ui, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #17120E;
    --surface: #221B15;
    --ink:     #F1E8DF;
    --muted:   #A0917F;
    --brand:   #C98F63;
    --line:    #38302A;

    --brand-ink:   #1C130C;
    --focus-ring:  rgba(201, 143, 99, 0.30);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-btn:  0 6px 16px rgba(0, 0, 0, 0.35);
    --tabbar-bg:   rgba(34, 27, 21, 0.86);

    --giallo-soft: rgba(233, 180, 76, 0.14);
    --verde-soft:  rgba(30, 127, 79, 0.22);
    --rosso-soft:  rgba(196, 69, 60, 0.20);

    /* #C4453C hätte auf --surface #221B15 nur ~3,4:1 — aufgehellt ~5,2:1 */
    --rosso-text:  #E06A5F;
  }
}

/* ---------- Reset & Basis ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, p { margin: 0; }

button, input {
  font: inherit;
  color: inherit;
}

img, svg { display: block; max-width: 100%; }

[hidden] { display: none !important; }

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

::selection { background: var(--giallo-soft); }

/* ---------- Layout ---------- */

.view {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top, 0px))
           max(20px, env(safe-area-inset-left, 0px))
           32px
           max(20px, env(safe-area-inset-right, 0px));
}

body.has-tabbar .view {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.view > * {
  animation: view-in 0.28s ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Boot-Spinner ---------- */

.boot {
  min-height: calc(100svh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}

.boot__text { font-size: 0.88rem; font-weight: 600; }

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: none;
  border-radius: 14px;
  background: transparent;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.btn:active:not(:disabled) { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.btn--primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: var(--shadow-btn);
}

.btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--line);
}

.btn--ghost:active:not(:disabled) { background: var(--giallo-soft); }

.btn--rosso { color: var(--rosso); }
.btn--rosso:active:not(:disabled) { background: var(--rosso-soft); }

.btn--block { width: 100%; }

/* ---------- Formulare ---------- */

.field { display: block; margin-bottom: 14px; }

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  caret-color: var(--brand);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder { color: var(--muted); opacity: 0.7; }

.field__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px var(--focus-ring);
}

.form-msg {
  margin: 2px 2px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.form-msg--error   { color: var(--rosso); background: var(--rosso-soft); }
.form-msg--success { color: var(--verde); background: var(--verde-soft); }

/* ---------- Bottom-Tab-Bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 8px max(16px, env(safe-area-inset-left, 0px))
           calc(8px + env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-right, 0px));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 50px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.tabbar__item:active { transform: scale(0.95); }

.tabbar__item.is-active {
  color: var(--brand);
  background: var(--giallo-soft);
}

.tabbar__icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: grayscale(1) opacity(0.55);
  transition: filter 0.15s ease;
}

.tabbar__item.is-active .tabbar__icon { filter: none; }

/* ---------- Tanuki-Container ---------- */

.tanuki-box { margin: 0 auto; }

.tanuki-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tanuki-box--login { width: 132px; height: 132px; margin-bottom: 6px; }
.tanuki-box--home  { width: 212px; height: 212px; margin: 6px auto 14px; }

/* ---------- Login ---------- */

.login {
  min-height: calc(100svh - 80px - env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
}

.login__card {
  width: 100%;
  max-width: 400px;
  padding: 28px 22px 24px;
  text-align: center;
}

.login__title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.login__subtitle {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.login__form { text-align: left; }

.login__form .btn { margin-top: 6px; }

/* ---------- Home ---------- */

.home__head { text-align: center; margin-bottom: 4px; }

.home__date {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.home__title {
  margin-top: 2px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--giallo-soft);
  border: 1px solid var(--giallo);
  font-size: 0.88rem;
  font-weight: 700;
}

.chip__icon { font-size: 0.95rem; line-height: 1; }

.training-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.training-card__title { font-size: 1.15rem; font-weight: 750; }

.badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--giallo-soft);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.training-card__text {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Profil ---------- */

.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 4px 2px 16px;
}

.profil__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 1.45rem;
  font-weight: 800;
}

.profil__name { font-size: 1.2rem; font-weight: 750; }

.profil__level { color: var(--muted); font-size: 0.88rem; }

.info-list { padding-top: 2px; }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child { border-bottom: none; padding-bottom: 0; }

.info-row__label { color: var(--muted); font-size: 0.92rem; }

.info-row__value { font-weight: 700; text-align: right; }

.section-title {
  margin: 26px 6px 10px;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .view > * { animation: none; }

  .btn,
  .tabbar__item,
  .field__input,
  .tabbar__icon { transition: none; }

  .btn:active:not(:disabled),
  .tabbar__item:active { transform: none; }
}

/* ============================================================
   Phase 1 — Lern-Session (#/lernen) + Home-Kachel live
   ============================================================ */

/* Platz für die feste Rating-Leiste unter der View. */
body.in-session .view {
  padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px));
}

/* Keine Einblend-Animation für die Session-View: der transform der
   view-in-Animation (fill: both) würde die Session sonst zum Containing
   Block für die position:fixed-Bottom-Leiste machen. */
.view > .session {
  animation: none;
}

/* ---------- Session-Header: X · Fortschritt · Mini-Tanuki ---------- */

.session__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.session__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.session__close:active {
  transform: scale(0.94);
  background: var(--rosso-soft);
}

.session__progress {
  flex: 1;
  min-width: 0;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--verde);
  transition: width 0.3s ease;
}

.session__count {
  margin-top: 5px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.session__tanuki {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

/* ---------- Lernkarten ---------- */

.session-card {
  padding: 28px 20px;
  text-align: center;
}

.session-card__meta {
  margin-bottom: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.session-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.session-card__word {
  margin: 8px 0 6px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.session-card__example {
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
}

.session-card__tap {
  margin-top: 20px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

/* 3D-Flip (it→de); bei prefers-reduced-motion wird daraus ein Fade (s. unten). */

.flip {
  perspective: 1200px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flip__inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.flip.is-flipped .flip__inner {
  transform: rotateY(180deg);
}

.flip__face {
  grid-area: 1 / 1;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip__face--back {
  transform: rotateY(180deg);
}

/* Texteingabe (de→it) */

.session-form__input {
  margin-top: 20px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 650;
}

/* Ergebnis-Screen (de→it) */

.session-card--result {
  border-width: 2px;
}

.session-card--ok   { border-color: var(--verde); }
.session-card--near { border-color: var(--giallo); }
.session-card--bad  { border-color: var(--rosso); }

.session-result__verdict {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.session-card--ok   .session-result__verdict { color: var(--verde); background: var(--verde-soft); }
.session-card--near .session-result__verdict { color: #8C6412; background: var(--giallo-soft); }
.session-card--bad  .session-result__verdict { color: var(--rosso); background: var(--rosso-soft); }

.session-result__own {
  margin-top: 18px;
  font-size: 0.95rem;
}

/* ---------- Feste Bottom-Leiste (Aufdecken / Prüfen / Ratings) ---------- */

.session-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px max(16px, env(safe-area-inset-left, 0px))
           calc(12px + env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-right, 0px));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line);
}

.session-actions__inner {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rating-btn {
  min-height: 54px;
  padding: 6px 4px;
  border: none;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.rating-btn:active:not(:disabled) { transform: scale(0.95); }

.rating-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.rating-btn--again { background: var(--rosso); }
.rating-btn--hard  { background: var(--giallo); color: #4A3313; }
.rating-btn--good  { background: var(--verde); }
.rating-btn--easy  { background: var(--brand); color: var(--brand-ink); }

/* Auswahl-Modus (de→it): Auto-Rating vorausgewählt, per Tap änderbar. */
.rating-row--select .rating-btn { opacity: 0.45; }

.rating-row--select .rating-btn.is-selected {
  opacity: 1;
  box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--ink);
}

/* ---------- Summary ---------- */

.session-summary {
  text-align: center;
}

.tanuki-box--summary {
  width: 156px;
  height: 156px;
}

.session-summary__title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.session-summary__sub {
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.session-summary .card {
  text-align: left;
  margin-bottom: 18px;
}

/* ---------- Zero-State & Fehler (#/lernen) ---------- */

.session-zero {
  min-height: calc(100svh - 260px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tanuki-box--zero {
  width: 156px;
  height: 156px;
  margin-bottom: 4px;
}

.session-zero__title {
  font-size: 1.5rem;
  font-weight: 800;
}

.session-zero__text {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 32ch;
}

.session-zero__actions {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

/* ---------- Home-Kachel „Heutiges Training" (live) ---------- */

.training-card__counts {
  font-size: 1.02rem;
  font-weight: 750;
  color: var(--ink);
}

.training-card__pending {
  margin: -8px 0 14px;
  font-size: 0.8rem;
  font-weight: 650;
  color: #8C6412;
}

/* ---------- Dark Mode (Phase-1-Feinheiten) ---------- */

@media (prefers-color-scheme: dark) {
  .session-card--near .session-result__verdict { color: var(--giallo); }
  .training-card__pending { color: var(--giallo); }
}

/* ---------- Reduced Motion (Phase 1): Flip wird zum Fade ---------- */

@media (prefers-reduced-motion: reduce) {
  .progress__fill,
  .session__close,
  .rating-btn { transition: none; }

  .session__close:active,
  .rating-btn:active:not(:disabled) { transform: none; }

  .flip__inner { transition: none; }
  .flip.is-flipped .flip__inner { transform: none; }

  .flip__face {
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    transition: opacity 0.25s ease;
  }

  .flip__face--back { transform: none; opacity: 0; }
  .flip.is-flipped .flip__face--front { opacity: 0; }
  .flip.is-flipped .flip__face--back { opacity: 1; }
}

/* ============================================================
   Phase 2 — Lernplan (#/plan) & Einstufungstest (#/einstufung)
   ============================================================ */

/* ---------- Level-Chips (Plan + Einstufung) ---------- */

.level-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--verde-soft);
  color: var(--verde);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.level-chip--target { background: var(--giallo-soft); color: #8C6412; }

.level-chip--muted { background: var(--line); color: var(--muted); }

.level-chip--big {
  font-size: 2.2rem;
  padding: 14px 30px;
  border-radius: 24px;
  letter-spacing: 0.06em;
}

/* ---------- Kleine Buttons (Bearbeiten / Empfehlung übernehmen) ---------- */

.btn--small {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 0.85rem;
}

/* ---------- Home: Hinweis-Card „Finde dein Level" ---------- */

.hint-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}

.hint-card:active { transform: scale(0.98); }

.hint-card__icon { font-size: 1.6rem; line-height: 1; }

.hint-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hint-card__title { font-size: 0.98rem; font-weight: 750; }

.hint-card__text { color: var(--muted); font-size: 0.82rem; }

.hint-card__chevron {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 600;
}

/* ---------- Plan: Hero-Card „Wo stehst du?" ---------- */

.plan-hero {
  text-align: center;
  padding: 24px 20px;
}

.plan-hero__tanuki {
  width: 132px;
  height: 132px;
  margin-bottom: 4px;
}

.plan-hero__title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.plan-hero__text {
  margin: 6px auto 18px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 34ch;
}

/* ---------- Plan: Ziel-Card + Inline-Formular ---------- */

.goal-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.goal-card__levels {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.goal-card__arrow { color: var(--muted); font-weight: 700; }

.goal-card__summary { font-size: 0.95rem; }

.goal-card__summary strong { font-weight: 750; }

.goal-card__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.goal-card__reco {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--verde-soft);
  color: var(--verde);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.goal-card__reco strong { font-weight: 800; }

.goal-card .form-msg { margin: 12px 0 0; }

.goal-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.goal-form .form-msg { margin: 2px 2px 12px; }

/* appearance:none (field__input) nimmt Selects den Pfeil — eigener Chevron
   in einem Zwischenton, der in Light und Dark funktioniert. */
select.field__input {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2397887A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field__input:disabled { opacity: 0.45; }

/* iOS rendert date-Inputs sonst als schmale zentrierte Pille. */
input[type="date"].field__input {
  display: flex;
  align-items: center;
  -webkit-appearance: none;
}

/* iOS Safari zentriert den Datums-Wert im UA-Pseudo-Element — text-align auf
   dem Input greift dort nicht durch. min-height/min-width verhindern, dass das
   leere Feld als inhaltslose Box kollabiert. */
input[type="date"].field__input::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.2em;
  min-width: 1px;
}

.goal-form__reco {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.goal-form__hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--verde);
  white-space: nowrap;
}

.goal-card__retest {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.goal-card__retest:active { color: var(--brand); }

/* ---------- Plan: Fehlerkarte ---------- */

.plan-error { text-align: center; }

.plan-error__text {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Plan: Wochen-Card (reine CSS-Balken) ---------- */

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.week__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 2px 6px;
  border-radius: var(--radius-sm);
}

.week__day.is-today { background: var(--giallo-soft); }

.week__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 76px;
}

.week__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
  width: 15px;
  /* Zahl-Label (14px) + gap (3px) aus der Prozent-Basis der Balken heraushalten:
     border-box bleibt 76px, Content-Box (= Balken-Track) wird 59px. So erreicht
     100% wirklich die Track-Höhe und Werte im oberen Viertel bleiben proportional. */
  padding-top: 17px;
}

.week__num {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 14px; /* fixiert die im padding-top von .week__col reservierte Höhe */
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.week__bar {
  flex-shrink: 0; /* nie stauchen — bei 100% ragt das Label exakt in die padding-Zone */
  width: 100%;
  min-height: 3px; /* 0-Werte bleiben als Sockel sichtbar */
  border-radius: 4px 4px 2px 2px;
}

.week__bar--rev { background: var(--verde); }
.week__bar--new { background: var(--brand); }
.week__bar--due { background: var(--line); }

.week__day.is-future .week__num { opacity: 0.75; }

.week__label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.week__day.is-today .week__label { color: var(--brand); }

.week-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 14px;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
}

.week-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.week-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.week-legend__dot--rev { background: var(--verde); }
.week-legend__dot--new { background: var(--brand); }
.week-legend__dot--due { background: var(--line); }

/* ---------- Einstufungstest: Header + Frage ---------- */

.placement__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 48px;
}

.placement__progress {
  flex: 1;
  min-width: 0;
}

.placement__tanuki {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.placement-card {
  padding: 22px 20px;
  text-align: center;
}

.placement-card__content {
  margin-top: 8px;
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.answer-btn {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.15s ease,
              background-color 0.15s ease, opacity 0.15s ease;
}

.answer-btn:active:not(:disabled) { transform: scale(0.98); }

.answer-btn:disabled { cursor: default; }

.answer-btn.is-correct {
  border-color: var(--verde);
  background: var(--verde-soft);
  color: var(--verde);
  font-weight: 750;
}

.answer-btn.is-wrong {
  border-color: var(--rosso);
  background: var(--rosso-soft);
  color: var(--rosso);
}

.answer-btn.is-faded { opacity: 0.45; }

.placement-verdict {
  margin-top: 14px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 750;
}

.placement-verdict--ok { color: var(--verde); }
.placement-verdict--bad { color: var(--rosso); }

.placement-expl {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--giallo-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.placement-q .form-msg { margin: 12px 0 0; }

.placement-q__next { margin-top: 14px; }

.placement-q__next:empty { display: none; }

/* ---------- Einstufungstest: Start-/Fehler-/Ergebnis-Screens ---------- */

.placement-intro,
.placement-result {
  min-height: calc(100svh - 260px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.placement-intro__title {
  font-size: 1.5rem;
  font-weight: 800;
}

.placement-intro__text {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36ch;
}

.placement-intro__actions,
.placement-result__actions {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.placement-result__eyebrow {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.placement-result .level-chip--big { margin: 10px 0 14px; }

.placement-result__text {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 34ch;
}

/* ---------- Dark Mode (Phase-2-Feinheiten) ---------- */

@media (prefers-color-scheme: dark) {
  .level-chip--target { color: var(--giallo); }
}

/* ---------- Reduced Motion (Phase 2) ---------- */

@media (prefers-reduced-motion: reduce) {
  .hint-card,
  .answer-btn { transition: none; }

  .hint-card:active,
  .answer-btn:active:not(:disabled) { transform: none; }
}

/* ============================================================
   Phase 3 — Fortschritt (#/fortschritt), Achievements & Ziel-Fortschritt
   ============================================================ */

/* Heatmap-Intensitäten: 5 Stufen über --verde (#1E7F4F) als Opacity-
   Abstufung — rgba-Ableitungen nach dem Muster von --verde-soft. --verde
   ist in Light und Dark identisch, die Stufen funktionieren in beiden Modi. */
:root {
  --heat-1: rgba(30, 127, 79, 0.22);
  --heat-2: rgba(30, 127, 79, 0.42);
  --heat-3: rgba(30, 127, 79, 0.62);
  --heat-4: rgba(30, 127, 79, 0.82);
  --heat-5: var(--verde);
}

/* ---------- Home: Streak-Warnung (ab 18:00, done_today == 0) ---------- */

.training-card__streak {
  margin: -2px 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--giallo-soft);
  color: #8C6412;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
}

/* ---------- Fortschritt: Overview-Chips ---------- */

.stats-overview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.chip--stat {
  font-size: 0.82rem;
  padding: 6px 12px;
}

/* ---------- Ziel-Fortschritt (Fortschritt-Screen + Plan-Ziel-Card) ----------
   Die goal-progress__*-Bausteine werden an zwei Stellen benutzt:
   im .goal-progress-Block der Plan-Ziel-Card und direkt in .stats-goal. */

.goal-progress {
  margin: 2px 0 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--verde-soft);
}

.goal-progress__head {
  font-size: 0.95rem;
  font-weight: 650;
}

.goal-progress__pct {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--verde);
  font-variant-numeric: tabular-nums;
}

.progress--goal {
  height: 14px;
  margin: 8px 0 6px;
}

.goal-progress__nums {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.goal-card__pool {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Feier-Zustand: Ziel erreicht (Mini-Tanuki cheer + „Neues Ziel"-Button) */

.goal-progress--reached {
  border: 1.5px solid var(--verde);
}

.goal-progress__reached-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.goal-progress__tanuki {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  margin: 0;
}

.goal-progress__reached-text { min-width: 0; }

.goal-progress__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--verde);
}

.goal-progress__next { margin-top: 12px; }

/* Ziel-Karte im Fortschritt-Screen (gleiche Bausteine, eigene Karte) */

.stats-goal--reached { border-color: var(--verde); }

.stats-goal--reached .goal-progress__head {
  color: var(--verde);
  font-weight: 800;
}

/* ---------- Fortschritt: Kalender-Heatmap ---------- */

.heatmap-card { padding: 18px; }

.heatmap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.heatmap__labels {
  flex-shrink: 0;
  display: grid;
  grid-template-rows: repeat(7, 18px);
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
}

.heatmap__labels span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Eigener overflow-x-Container: bei schmalen Viewports scrollt NUR die
   Heatmap horizontal, nie die Seite (stats-ui setzt scrollLeft auf heute). */
.heatmap__scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

/* 15 Wochen × 7 Tage: Spalten = Wochen (auto-flow column), Zeilen = Mo–So.
   Die erste Zelle setzt ihren Wochentag inline, der Rest fließt nach. */
.heatmap__grid {
  display: inline-grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 18px);
  grid-auto-columns: 18px;
  gap: 4px;
}

.heat {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--line); /* Stufe 0: keine Reviews */
}

.heat--1 { background: var(--heat-1); }
.heat--2 { background: var(--heat-2); }
.heat--3 { background: var(--heat-3); }
.heat--4 { background: var(--heat-4); }
.heat--5 { background: var(--heat-5); }

/* ---------- Fortschritt: CEFR-Balken ---------- */

.cefr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 5px 0;
}

.cefr-row__level {
  flex-shrink: 0;
  width: 30px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.progress--cefr {
  flex: 1;
  height: 12px;
}

.cefr-row__nums {
  flex-shrink: 0;
  min-width: 74px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Fortschritt: Kategorie-Karten ---------- */

.cat-card {
  padding: 16px 18px;
  margin-bottom: 12px;
}

.cat-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cat-card__icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  line-height: 1;
}

.cat-card__name {
  flex: 1;
  min-width: 0;
  font-weight: 750;
  overflow-wrap: break-word;
}

.cat-card__pct {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--verde);
  font-variant-numeric: tabular-nums;
}

.progress--cat { height: 10px; }

.cat-card__nums {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Achievements-Grid (Profil) ---------- */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ach {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}

.ach--earned {
  border-color: var(--giallo);
  background: var(--giallo-soft);
}

/* Gesperrt: graue Silhouette (grayscale + opacity), Beschreibung bleibt lesbar. */
.ach--locked {
  filter: grayscale(1);
  opacity: 0.55;
}

.ach__icon {
  font-size: 1.75rem;
  line-height: 1.15;
}

.ach__name {
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.25;
}

.ach__sub {
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted);
}

.ach__sub--date {
  color: var(--verde);
  font-weight: 700;
}

.ach-empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Unlock-Overlay (Vollbild + Konfetti) ---------- */

body.has-unlock-overlay { overflow: hidden; }

.unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 50; /* über Tab-Bar (20) und Session-Leiste (30) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px))
           max(20px, env(safe-area-inset-left, 0px))
           calc(20px + env(safe-area-inset-bottom, 0px))
           max(20px, env(safe-area-inset-right, 0px));
  background: rgba(23, 18, 14, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.unlock-overlay__box {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: unlock-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes unlock-pop {
  from { opacity: 0; transform: scale(0.85) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.unlock-overlay__tanuki {
  width: 120px;
  height: 120px;
  margin-bottom: 2px;
}

.unlock-overlay__eyebrow {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.unlock-overlay__icon {
  margin-top: 8px;
  font-size: 3rem;
  line-height: 1.15;
}

.unlock-overlay__name {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.unlock-overlay__desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.unlock-overlay__xp {
  display: inline-block;
  margin: 14px 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--giallo-soft);
  border: 1px solid var(--giallo);
  font-size: 0.9rem;
  font-weight: 800;
}

/* CSS-Konfetti: 12 Teilchen, Position/Farbe/Timing über nth-child. */

.unlock-overlay__confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.unlock-conf {
  position: absolute;
  top: -4vh;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  opacity: 0;
  animation: conf-fall 3.2s linear infinite;
}

@keyframes conf-fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  6%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(108vh) rotate(560deg); }
}

.unlock-conf:nth-child(1)  { left: 6%;  background: var(--giallo); animation-delay: 0s;    animation-duration: 3.1s; }
.unlock-conf:nth-child(2)  { left: 14%; background: var(--verde);  animation-delay: 0.7s;  animation-duration: 3.6s; }
.unlock-conf:nth-child(3)  { left: 23%; background: var(--rosso);  animation-delay: 1.4s;  animation-duration: 2.9s; }
.unlock-conf:nth-child(4)  { left: 31%; background: var(--brand);  animation-delay: 0.3s;  animation-duration: 3.4s; width: 8px; height: 11px; }
.unlock-conf:nth-child(5)  { left: 40%; background: var(--giallo); animation-delay: 1.9s;  animation-duration: 3.2s; }
.unlock-conf:nth-child(6)  { left: 48%; background: var(--verde);  animation-delay: 0.9s;  animation-duration: 2.8s; width: 8px; height: 11px; }
.unlock-conf:nth-child(7)  { left: 57%; background: var(--rosso);  animation-delay: 0.1s;  animation-duration: 3.5s; }
.unlock-conf:nth-child(8)  { left: 65%; background: var(--giallo); animation-delay: 1.2s;  animation-duration: 3.0s; }
.unlock-conf:nth-child(9)  { left: 73%; background: var(--brand);  animation-delay: 2.2s;  animation-duration: 3.3s; width: 8px; height: 11px; }
.unlock-conf:nth-child(10) { left: 81%; background: var(--verde);  animation-delay: 0.5s;  animation-duration: 3.7s; }
.unlock-conf:nth-child(11) { left: 89%; background: var(--rosso);  animation-delay: 1.7s;  animation-duration: 3.1s; }
.unlock-conf:nth-child(12) { left: 95%; background: var(--giallo); animation-delay: 2.6s;  animation-duration: 2.9s; width: 8px; height: 11px; }

/* ---------- Session-Summary: XP-Zeile ---------- */

.session-summary__xp { color: #8C6412; }

/* ---------- Dark Mode (Phase-3-Feinheiten) ---------- */

@media (prefers-color-scheme: dark) {
  .training-card__streak { color: var(--giallo); }
  .session-summary__xp { color: var(--giallo); }
  .unlock-overlay { background: rgba(0, 0, 0, 0.66); }
}

/* ---------- Reduced Motion (Phase 3) ---------- */

@media (prefers-reduced-motion: reduce) {
  .unlock-overlay__box { animation: none; }
  .unlock-conf { animation: none; display: none; }
}

/* ============================================================
   Phase 3.5 — Kategorie-Detailansicht (#/kategorie/<slug>)
   ============================================================ */

/* ---------- Fortschritt: Kategorie-Karten sind klickbar ---------- */

/* .cat-card ist jetzt ein <button> (ganze Karte tappbar, ≥ 44 px) —
   Button-Defaults zurücksetzen, Karten-Optik kommt weiter aus .card. */
.cat-card--link {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease;
}

.cat-card--link:active { transform: scale(0.98); }

.cat-card__chevron {
  flex-shrink: 0;
  margin-left: 2px;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 600;
}

/* ---------- Kategorie: Header ---------- */

.kat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 16px;
}

.kat__back {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.kat__back:active {
  transform: scale(0.94);
  background: var(--giallo-soft);
}

.kat__heading { flex: 1; min-width: 0; }

.kat__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.kat__icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.kat__name {
  min-width: 0;
  overflow-wrap: break-word;
}

.kat__sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ---------- Kategorie: Summary-Card (Balken + Zahlen) ---------- */

.kat-summary {
  padding: 15px 18px 13px;
  margin-bottom: 14px;
}

.kat-summary__nums {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Kategorie: Suche + Filter-Chips ---------- */

.kat-search { margin-bottom: 10px; }

/* Filter-Chips scrollen bei 390 px in einer Zeile — nur die Chip-Leiste,
   nie die Seite. Negative Ränder geben dem Focus-Ring der Chips Platz. */
.filter-chips {
  display: flex;
  gap: 8px;
  margin: 0 -2px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease,
              border-color 0.15s ease, color 0.15s ease;
}

.filter-chip:active { transform: scale(0.96); }

.filter-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.filter-chip__count {
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* ---------- Kategorie: Wortliste (Akkordeon) ---------- */

.kat-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.word { border-bottom: 1px solid var(--line); }

.word:last-child { border-bottom: none; }

.word__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.word__row:active { background: var(--giallo-soft); }

.word__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.word__dot--neu     { background: var(--muted); }
.word__dot--lernend { background: var(--giallo); }
.word__dot--reif    { background: var(--verde); }

/* Fällig: rosso-Ring um den Status-Punkt (mit Luftspalt zur Fläche). */
.word__dot--due {
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--rosso);
}

.word__main { flex: 1; min-width: 0; }

.word__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.word__it {
  min-width: 0;
  font-weight: 750;
  overflow-wrap: break-word;
}

.word__cefr {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.word__de {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: break-word;
}

.word__chevron {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease;
}

.word__row[aria-expanded="true"] .word__chevron { transform: rotate(180deg); }

.word__detail { padding: 0 16px 14px 38px; }

.word__example-it {
  font-style: italic;
  font-size: 0.92rem;
}

.word__example-de {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
}

.word__meta {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Kategorie: Zero-State (leerer Filter / leere Suche) ---------- */

.kat-empty {
  padding: 26px 18px;
  text-align: center;
}

.kat-empty__text {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Wiederholungsmodus (§14.2, punktfrei) ---------- */

/* Deutlicher „hier zählt nichts"-Hinweis oben in der Liste. */
.recap-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--verde-soft);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.recap-note__icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

/* „neu heute"-Badge in der Wortzeile — grün statt des gelben Default-Badges. */
.recap-badge {
  background: var(--verde-soft);
  color: var(--verde);
}

/* Kategorie-Zeile im aufgeklappten Detail (statt der Status-Meta). */
.recap-cat {
  margin-top: 8px;
}

/* ---------- Reduced Motion (Phase 3.5) ---------- */

@media (prefers-reduced-motion: reduce) {
  .cat-card--link,
  .kat__back,
  .filter-chip,
  .word__chevron { transition: none; }

  .cat-card--link:active,
  .kat__back:active,
  .filter-chip:active { transform: none; }
}

/* ============================================================
   Phase 4 — Battle-Modus (#/battle)
   ============================================================ */

/* ---------- Tab-Bar: 5 Tabs auf schmalen Viewports (390 px) ----------
   Mit dem fünften Tab (Battle 🥊) wird „Fortschritt" bei 0.68rem zu breit —
   Labels kleiner, Abstände enger (SPEC Phase 4: „Labels ggf. kleiner"). */

@media (max-width: 430px) {
  .tabbar { gap: 4px; }

  .tabbar__item {
    font-size: 0.6rem;
    letter-spacing: 0;
  }
}

/* ---------- Arena / Duell-Kopf: zwei Tanukis + VS-Badge ---------- */

/* Gespiegelte Tanuki-Container (rechter Kämpfer, Unentschieden-Duo):
   scaleX(-1) auf dem SVG-Root — die Zustands-Animationen (t-figure etc.)
   laufen auf inneren Gruppen und bleiben davon unberührt. */
.battle-mirror .tanuki { transform: scaleX(-1); }

.battle-face {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.battle-face__fighter {
  flex: 1;
  max-width: 136px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Kronen-Zeile reserviert ihre Höhe immer (Layout bleibt stabil),
   sichtbar wird sie nur über dem Führenden. */
.battle-face__crown {
  height: 26px;
  font-size: 1.35rem;
  line-height: 26px;
  visibility: hidden;
}

.battle-face__fighter.is-leading .battle-face__crown {
  visibility: visible;
  animation: crown-bob 1.6s ease-in-out infinite;
}

@keyframes crown-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.battle-face__tanuki {
  width: 104px;
  height: 104px;
  margin: 0;
}

.battle-face__name {
  max-width: 100%;
  font-size: 0.85rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-vs {
  flex-shrink: 0;
  align-self: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--rosso);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(196, 69, 60, 0.35);
}

/* ---------- Zustand 1: Arena-Intro ---------- */

.battle-arena {
  padding: 22px 18px 20px;
  text-align: center;
}

.battle-arena__text {
  margin: 12px auto 16px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 36ch;
}

.battle-arena .form-msg { text-align: left; }

/* Letztes Ergebnis (kompakte Zeile) + Revanche */

.battle-last {
  margin-top: 14px;
  padding: 16px 18px;
}

.battle-last__text {
  margin-bottom: 12px;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

/* Fairness-Text (aufklappbares <details>) */

.battle-info {
  margin-top: 14px;
  padding: 0 18px;
}

.battle-info summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  list-style: none;
}

.battle-info summary::-webkit-details-marker { display: none; }

.battle-info summary::after {
  content: '›';
  margin-left: auto;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.battle-info[open] summary::after { transform: rotate(90deg); }

.battle-info__icon { font-size: 1rem; line-height: 1; }

.battle-info__text {
  padding: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ---------- Zustand 2: Aktives Battle (Duell-Karte) ---------- */

.battle-duel { padding: 16px 18px 18px; }

.battle-duel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.battle-duel__meta {
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.battle-reload {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.battle-reload:active:not(:disabled) {
  transform: rotate(80deg);
  background: var(--giallo-soft);
}

.battle-reload:disabled { cursor: default; }

.battle-reload.is-loading { animation: spin 0.8s linear infinite; }

/* Gesamt-Balken: me = brand, opp = giallo, relativ zum Maximum */

.battle-totals {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.battle-total__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.battle-total__name {
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-total__num {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Negative Gesamtsumme: Balkenlänge 0 (JS), Zahl in rosso (SPEC). */
.battle-total__num--neg { color: var(--rosso-text); }

.progress--battle { height: 14px; }

.progress__fill--me  { background: var(--brand); }
.progress__fill--opp { background: var(--giallo); }

/* Tagesverlauf: Mo–So-Raster der Plan-Woche, Battle-Farben + breitere
   Spalten (Tagespunkte mit 2 Dezimalen brauchen mehr Platz als Zähler).
   Die Spaltenbreite ist nur ein Maximum (flex-basis 17px, shrink erlaubt):
   minmax(0, 1fr)-Tracks + width: 100% auf .week__bars geben den Spalten
   echten Breitendruck, sodass 7 Tage auch auf 390/375 px in der Karte
   bleiben — die nowrap-Zahlen („2,35" / „2,30") ragen mittig in die
   Lücken, statt das Raster aufzudrücken. */

.battle-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }

.battle-days .week__bars {
  gap: 8px;
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.battle-days .week__col {
  flex: 0 1 17px;
  min-width: 0;
}

.battle-days .week__num {
  font-size: 0.55rem;
  white-space: nowrap;
}

.week__num--neg {
  color: var(--rosso-text);
  font-weight: 800;
}

.week__bar--me  { background: var(--brand); }
.week__bar--opp { background: var(--giallo); }

.week-legend__dot--me  { background: var(--brand); }
.week-legend__dot--opp { background: var(--giallo); }

/* Statuszeile über dem Inhalt (battle_exists-Hinweis, Reload-Fehler) */

.battle-flash { margin: 0 0 12px; }

/* ---------- Zustand 3: Ergebnis-Panel ---------- */

.battle-result {
  padding: 22px 20px 20px;
  text-align: center;
}

.battle-result__eyebrow {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.battle-result__tanukis {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

.battle-result__tanuki {
  width: 136px;
  height: 136px;
  margin: 0;
}

/* Unentschieden: zwei idle-Tanukis nebeneinander, etwas kleiner. */
.battle-result__tanukis--duo .battle-result__tanuki {
  width: 108px;
  height: 108px;
}

.battle-result__title {
  margin-top: 2px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.battle-result__text {
  margin: 6px auto 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 34ch;
  font-variant-numeric: tabular-nums;
}

.battle-result .battle-totals {
  margin: 0 0 18px;
  text-align: left;
}

.battle-result .form-msg { text-align: left; }

/* ---------- Fehler-View (sad-Tanuki + Retry) ---------- */

.battle-error {
  padding: 24px 20px;
  text-align: center;
}

.battle-error__tanuki {
  width: 132px;
  height: 132px;
  margin-bottom: 4px;
}

.battle-error__text {
  margin: 4px auto 18px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 34ch;
}

/* ---------- Reduced Motion (Phase 4) ---------- */

@media (prefers-reduced-motion: reduce) {
  .battle-face__fighter.is-leading .battle-face__crown { animation: none; }

  .battle-reload,
  .battle-info summary::after { transition: none; }

  .battle-reload:active:not(:disabled) { transform: none; }

  .battle-reload.is-loading {
    animation: none;
    opacity: 0.55;
  }
}

/* ============================================================
   Phase 5 — KI-Module (#/coach, #/grammatik[/<slug>], #/pruefung)
   Header von Coach/Grammatik/Prüfung nutzt bewusst die bestehenden
   .kat__head/.kat__back/.kat__heading/.kat__title/.kat__icon/.kat__name/
   .kat__sub-Klassen aus Phase 3.5 (gleiches Muster: Zurück-Pfeil + Titel).
   ============================================================ */

/* ---------- Kleiner Kopf-Tanuki (wie .session__tanuki, 48 px) ---------- */

.ai-head__tanuki {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

/* ---------- Home: „Üben mit KI"-Einstieg ---------- */

.ai-hub { margin-top: 14px; }

.ai-hub__title {
  font-size: 1.05rem;
  font-weight: 750;
  margin-bottom: 2px;
}

.ai-hub__links { margin-top: 4px; }

.ai-hub__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 12px 2px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease;
}

.ai-hub__link:first-child { border-top: none; }

.ai-hub__link:active { transform: scale(0.98); }

.ai-hub__link-icon { flex-shrink: 0; font-size: 1.3rem; line-height: 1; }

.ai-hub__link-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ai-hub__link-title { font-weight: 700; font-size: 0.92rem; }

.ai-hub__link-text { color: var(--muted); font-size: 0.8rem; }

.ai-hub__link-chevron { flex-shrink: 0; color: var(--muted); font-size: 1.2rem; font-weight: 600; }

/* ---------- Übersetzungs-Coach (#/coach) ---------- */

.ai-direction {
  display: flex;
  gap: 8px;
  margin: 2px 0 14px;
}

.ai-direction__btn {
  flex: 1;
  min-height: 44px;
  padding: 0 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease,
              border-color 0.15s ease, color 0.15s ease;
}

.ai-direction__btn:active { transform: scale(0.97); }

.ai-direction__btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.ai-coach__card {
  text-align: center;
  padding: 26px 20px;
  margin-bottom: 14px;
}

.ai-coach__source {
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.ai-coach__form { margin-bottom: 14px; }

.ai-coach__input { margin-bottom: 12px; }

.ai-coach__result { margin-bottom: 14px; }

.ai-coach__correction { font-size: 1.1rem; overflow-wrap: break-word; }

.ai-coach__explanation {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.ai-coach__next { margin-top: 2px; }

/* ---------- „✨ Mehr Beispiele" (kategorie-ui.js + srs-ui.js) ---------- */

.ai-examples { margin-top: 12px; }

.ai-examples__btn {
  min-height: 44px;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ai-examples__btn:disabled { opacity: 0.55; }

.ai-examples__body { margin-top: 6px; }

.ai-examples__badge { margin-bottom: 6px; }

.ai-examples__it { font-style: italic; font-size: 0.92rem; }

.ai-examples__de {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.ai-examples__de:last-child { margin-bottom: 0; }

.ai-examples__error {
  margin-top: 6px;
  color: var(--rosso-text);
  font-size: 0.8rem;
}

/* ---------- Grammatik (#/grammatik, #/grammatik/<slug>) ---------- */

/* Lektions-Karten sind .cat-card/.cat-card--link (Muster Phase 3.5) mit
   einer .badge statt der Prozent-Zahl. */
.ai-lesson__badge--ready {
  background: var(--verde-soft);
  color: var(--verde);
}

.ai-grammar-intro {
  margin-bottom: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ai-grammar-section { margin-bottom: 22px; }

.ai-grammar-section__heading {
  font-size: 1.05rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.ai-grammar-section__text {
  font-size: 0.92rem;
  line-height: 1.55;
}

.ai-grammar-examples {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.ai-grammar-examples__it { font-style: italic; font-size: 0.9rem; }

.ai-grammar-examples__de {
  margin: 1px 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.ai-grammar-examples__de:last-child { margin-bottom: 0; }

.ai-grammar-exercises { margin-top: 26px; }

.ai-exercise {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.ai-exercise:first-of-type { border-top: none; padding-top: 10px; }

.ai-exercise__q { font-size: 0.92rem; font-weight: 650; margin-bottom: 10px; line-height: 1.4; }

.ai-exercise__toggle {
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ai-exercise__answer {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--verde-soft);
  color: var(--verde);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
}

.ai-grammar-empty { color: var(--muted); font-size: 0.92rem; }

/* ---------- Interaktive Grammatik-Lektion (Stepper) ---------- */

.ai-lesson-progress { margin-bottom: 14px; }

.ai-lesson-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.ai-lesson-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.25s ease;
}

.ai-lesson-progress__label {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
}

.ai-lesson-nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.ai-lesson-nav .btn { flex: 1; }

/* Übungskarte */
.ai-ex__label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.ai-ex__instruction {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  margin-bottom: 12px;
}

.ai-ex__sentence {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 12px;
}

.ai-ex__input {
  display: inline-block;
  width: auto;
  min-width: 7ch;
  max-width: 100%;
  margin: 0 2px;
  padding: 4px 10px;
  font-size: 1rem;
  vertical-align: baseline;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ai-ex__inputwrap { margin-bottom: 12px; }
.ai-ex__inputwrap .ai-ex__input { display: block; width: 100%; margin: 0; }

.ai-ex__hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.ai-ex__controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ai-ex__controls .ai-ex__check { flex: 1; }

.ai-ex__mic {
  min-width: 48px;
  flex: 0 0 auto;
  font-size: 1.1rem;
}

.ai-ex__mic.is-listening {
  background: var(--rosso-soft);
  border-color: var(--rosso);
}

.ai-ex__feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--muted);
  background: var(--giallo-soft);
}

.ai-ex__feedback--ok { border-left-color: var(--verde); background: var(--verde-soft); }
.ai-ex__feedback--bad { border-left-color: var(--rosso); background: var(--rosso-soft); }
.ai-ex__feedback--neutral { border-left-color: var(--giallo); background: var(--giallo-soft); }

.ai-ex__verdict {
  font-size: 0.9rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.ai-ex__feedback--ok .ai-ex__verdict { color: var(--verde); }
.ai-ex__feedback--bad .ai-ex__verdict { color: var(--rosso); }

.ai-ex__solution {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 6px;
}

.ai-ex__solution strong { color: var(--verde); }

.ai-ex__explanation {
  font-size: 0.86rem;
  color: var(--ink);
  line-height: 1.45;
}

.ai-lesson-done { text-align: center; padding: 26px 18px; }
.ai-lesson-done__title { font-size: 1.3rem; margin-bottom: 8px; }
.ai-lesson-done__text { color: var(--muted); font-size: 0.95rem; }

/* ---------- Prüfungssimulator (#/pruefung) ---------- */

.ai-exam__text-card { margin-bottom: 14px; }

.ai-exam__text {
  margin-top: 6px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-line;
}

.ai-exam__score {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--giallo-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.ai-exam__questions { margin-bottom: 4px; }

.ai-question { margin-bottom: 12px; padding: 16px 18px; }

.ai-question__text { font-weight: 700; margin-bottom: 12px; line-height: 1.4; }

.ai-question__options { display: grid; gap: 8px; }

.ai-option {
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.ai-option:active { transform: scale(0.98); }

.ai-option.is-selected {
  border-color: var(--brand);
  background: var(--giallo-soft);
}

.ai-option:disabled { cursor: default; }

.ai-option.is-correct {
  border-color: var(--verde);
  background: var(--verde-soft);
  color: var(--verde);
}

.ai-option.is-wrong {
  border-color: var(--rosso);
  background: var(--rosso-soft);
  color: var(--rosso-text);
}

.ai-question__explanation {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.ai-exam__eval { margin-top: 6px; margin-bottom: 10px; }

/* ---------- Reduced Motion (Phase 5) ---------- */

@media (prefers-reduced-motion: reduce) {
  .ai-direction__btn,
  .ai-hub__link,
  .ai-option { transition: none; }

  .ai-direction__btn:active,
  .ai-hub__link:active,
  .ai-option:active { transform: none; }
}

/* ============================================================
   Phase 6 — Vorlesen (🔊-Buttons, speak.js)
   Dezenter Icon-Button neben italienischem Text: Review-Karten
   (srs-ui.js), Kategorie-Detail (kategorie-ui.js), KI-Beispielsätze +
   Coach-Musterlösung (ai-ui.js). Touch-Ziel ≥ 44 px über min-width/
   min-height, Icon selbst bleibt klein und dezent.
   ============================================================ */

.speak-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-left: 2px;
  padding: 8px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
}

.speak-btn:hover { background: var(--giallo-soft); color: var(--brand); }

.speak-btn:active {
  transform: scale(0.9);
  background: var(--giallo-soft);
  color: var(--brand);
}

/* Wortzeile im Kategorie-Detail: italienisches Wort + 🔊 nebeneinander. */
.word__detail-word {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
  font-weight: 750;
  font-size: 1rem;
}

.word__detail-it { overflow-wrap: break-word; }

/* ---------- Reduced Motion (Phase 6) ---------- */

@media (prefers-reduced-motion: reduce) {
  .speak-btn { transition: none; }
  .speak-btn:active { transform: none; }
}

/* ============ Phase 6 — Erinnerungen (Push-Toggle im Profil) ============ */
.push-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.push-row__title {
  font-weight: 600;
  margin: 0 0 2px;
}
.push-row__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}
.push-toggle {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}
.push-toggle.is-on {
  border-color: var(--verde);
  color: var(--verde);
}
.push-toggle:disabled {
  opacity: 0.55;
}
