/* ─────────────────────────────────────────────
   LINGSTER DEUTSCH-TRAINER – Design System
   ───────────────────────────────────────────── */

/* ── 1. CSS CUSTOM PROPERTIES ── */
:root {
  /* Hintergrund */
  --bg-primary:    #0d1b2a;
  --bg-secondary:  #162235;
  --bg-card:       #1e3352;
  --bg-card-hover: #243d61;
  --bg-glass:      rgba(30, 51, 82, 0.75);

  /* Akzente */
  --accent-blue:   #3b9ede;
  --accent-cyan:   #00c8d7;
  --accent-gold:   #ffd166;

  /* Feedback */
  --success:       #4ade80;
  --success-bg:    rgba(74, 222, 128, 0.15);
  --error:         #f87171;
  --error-bg:      rgba(248, 113, 113, 0.15);
  --warning:       #fb923c;
  --warning-bg:    rgba(251, 146, 60, 0.12);

  /* Text */
  --text-primary:   #f0f6ff;
  --text-secondary: #94afc8;
  --text-muted:     #506680;

  /* Badges / Level */
  --level-a1:  #4ade80;
  --level-a2:  #60a5fa;
  --level-b1:  #c084fc;

  /* Layout */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);

  /* Header */
  --header-h: 60px;
  --nav-h:    64px;
}

/* ── 2. RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── 3. UTILITY ── */
[hidden]  { display: none !important; }   /* HTML-hidden-Attribut vs. display:flex-Überschreibung */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted { color: var(--text-secondary); }
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm   { gap: 8px; }
.gap-md   { gap: 14px; }
.gap-lg   { gap: 20px; }

/* ── 4. TYPOGRAPHY ── */
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 4vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { font-size: 0.95rem; color: var(--text-secondary); }

/* ── 5. SPLASH SCREEN ── */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #0d1b2a 0%, #0a2a4a 100%);
  display: flex; align-items: center; justify-content: center;
  animation: splashFadeOut 0.4s ease 2.2s forwards;
}
.splash__inner {
  text-align: center;
  animation: splashIn 0.6s cubic-bezier(.34,1.56,.64,1) both;
}
.splash__flag   { font-size: 4rem; margin-bottom: 16px; animation: flagWave 1s ease-in-out infinite alternate; }
.splash__title  { font-size: 2.2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; }
.splash__title span { color: var(--accent-cyan); }
.splash__sub    { font-size: 1.1rem; color: var(--text-secondary); margin-top: 8px; letter-spacing: 4px; }
.splash__loader { margin-top: 40px; height: 4px; width: 200px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.splash__bar    { height: 100%; background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); border-radius: 99px; animation: loadBar 2s ease forwards; }

/* ── 6. APP SHELL ── */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
}

/* ── 7. HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(13, 27, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.header__back {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  flex-shrink: 0;
}
.header__back:hover { background: rgba(255,255,255,0.08); }
.header__back svg { width: 22px; height: 22px; color: var(--text-primary); }
.header__title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem;
  flex: 1;
}
.header__emoji { font-size: 1.3rem; }
.header__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.header__xp {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--accent-gold);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-weight: 700; font-size: 0.85rem;
}
.header__xp svg { width: 14px; height: 14px; }

.header__streak {
  font-size: 0.85rem; font-weight: 600;
  color: var(--warning);
}

.header__reset {
  width: 32px; height: 32px;
  color: var(--text-muted);
  opacity: 0.6;
}
.header__reset:hover { opacity: 1; color: var(--error); }
.header__reset svg { width: 16px; height: 16px; }

/* ── 8. MAIN CONTENT ── */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 16px);
  scroll-behavior: smooth;
}

/* ── 9. VIEWS ── */
.view { display: none; padding: 20px 16px; animation: viewIn 0.25s ease both; }
.view.active { display: block; }

/* ── 10. DASHBOARD ── */

/* Hero-Banner: bricht seitlich aus dem View-Padding aus */
#viewDashboard {
  padding-top: 0;
}
.dashboard-hero {
  margin: 0 -16px 22px;
  height: 200px;
  background:
    linear-gradient(to bottom, transparent 40%, var(--bg-primary) 100%),
    url('../assets/hero.webp') left center / cover no-repeat;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.dashboard__welcome { margin-bottom: 20px; }
.dashboard__greeting { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.dashboard__subtitle { color: var(--text-secondary); font-size: 0.95rem; }

.dashboard__progress-bar-wrap { margin-bottom: 20px; }
.dashboard__progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ── 11. BENTO GRID ── */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "grammar    vocab"
    "grammar    phrases"
    "flash      flash"
    "collection collection";
  gap: 14px;
}

/* ── 12. MODULE CARD ── */
.module-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  -webkit-tap-highlight-color: transparent;
}
.module-card:hover  { transform: translateY(-3px); background: var(--bg-card-hover); box-shadow: var(--shadow-md); }
.module-card:active { transform: scale(0.97); }

/* Grammatik-Karte: 2 Reihen hoch → Inhalt mittig */
.bento-grid [style*="grid-area: grammar"] {
  justify-content: center;
  align-items: flex-start;
  min-height: 200px;
  background: linear-gradient(160deg, var(--bg-card) 0%, #162e4a 100%);
}
.bento-grid [style*="grid-area: grammar"] .module-card__icon {
  font-size: 3.2rem;
  margin-bottom: 20px;
}
.bento-grid [style*="grid-area: grammar"] .module-card__title {
  font-size: 1.1rem;
}
/* Karteikarten-Karte: volle Breite, horizontal */
.bento-grid [style*="grid-area: flash"] {
  flex-direction: row;
  align-items: center;
  min-height: 76px;
  padding: 16px 20px;
  gap: 16px;
}
.bento-grid [style*="grid-area: flash"] .module-card__icon {
  font-size: 2rem;
  margin-bottom: 0;
  flex-shrink: 0;
}

.module-card__glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, var(--card-color, var(--accent-blue)) 0%, transparent 65%);
  opacity: 0.08;
  pointer-events: none;
}
.module-card__icon  { font-size: 2.2rem; margin-bottom: 12px; }
.module-card__title { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.module-card__desc  { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
.module-card__meta  { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.module-card__count { font-size: 0.7rem; color: var(--text-muted); }

.module-card--wide .module-card__icon { font-size: 2.8rem; margin-bottom: 0; margin-right: 16px; flex-shrink: 0; }
.module-card--wide .module-card__body { flex: 1; }

/* ── 13. LEVEL BADGE ── */
.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.level-badge--a1 { background: rgba(74,222,128,0.15); color: var(--level-a1); }
.level-badge--a2 { background: rgba(96,165,250,0.15); color: var(--level-a2); }
.level-badge--b1 { background: rgba(192,132,252,0.15); color: var(--level-b1); }

/* ── 14. PROGRESS BAR ── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(.34,1.56,.64,1);
}

/* ── 15. SRS BANNER ── */
.srs-banner {
  display: flex; align-items: center; gap: 12px;
  background: rgba(251,146,60,0.12);
  border: 1px solid rgba(251,146,60,0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.srs-banner__icon { font-size: 1.5rem; }
.srs-banner__text { flex: 1; font-size: 0.9rem; }
.srs-banner__text strong { color: var(--warning); display: block; font-size: 1rem; }

/* ── 16. BOTTOM NAVIGATION ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: rgba(13, 27, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: grid; grid-template-columns: repeat(5, 1fr);
  z-index: 100;
}
.bottom-nav__item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px;
  color: var(--text-muted);
  font-size: 0.68rem; font-weight: 500;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bottom-nav__item::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--accent-blue);
  border-radius: 0 0 3px 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.bottom-nav__item.active      { color: var(--accent-blue); }
.bottom-nav__item.active::before { opacity: 1; }
.bottom-nav__item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bottom-nav__item.active svg  { fill: rgba(59,158,222,0.15); }

/* Brand-Logo – nur auf Desktop sichtbar */
.nav-brand { display: none; }

/* ── 17. BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
  cursor: pointer;
}
.btn:active { transform: scale(0.96); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent-blue), #1a7ec8);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,158,222,0.35);
}
.btn--primary:hover { box-shadow: 0 6px 24px rgba(59,158,222,0.5); }

.btn--accent {
  background: linear-gradient(135deg, var(--accent-gold), #e8a500);
  color: #0d1b2a;
}
.btn--accent:hover { box-shadow: 0 4px 16px rgba(255,209,102,0.4); }

.btn--ghost {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn--ghost:hover { background: rgba(255,255,255,0.12); }

.btn--success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}
.btn--error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}
.btn--full { width: 100%; }
.btn--sm   { padding: 8px 16px; min-height: 38px; font-size: 0.8rem; border-radius: var(--radius-sm); }

.btn-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── 18. CARD ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.card--glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── 19. TOPIC CARD (Wortschatz) ── */
.topic-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.15s ease;
  margin-bottom: 10px;
}
.topic-card:hover { background: var(--bg-card-hover); transform: translateX(4px); }
.topic-card:active { transform: scale(0.98); }
.topic-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.topic-card__info { flex: 1; }
.topic-card__title { font-size: 0.95rem; font-weight: 700; }
.topic-card__count { font-size: 0.75rem; color: var(--text-muted); }
.topic-card__arrow { color: var(--text-muted); }
.topic-card__arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── 20. LEVEL SELECTOR ── */
.level-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 4px;
}
.level-tab {
  flex: 1; padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s;
  text-align: center;
}
.level-tab.active-a1 { background: rgba(74,222,128,0.2); color: var(--level-a1); }
.level-tab.active-a2 { background: rgba(96,165,250,0.2); color: var(--level-a2); }
.level-tab.active-b1 { background: rgba(192,132,252,0.2); color: var(--level-b1); }

/* ── 21. WORD LIST ── */
.word-list { display: flex; flex-direction: column; gap: 8px; }
.word-item {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.05);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.word-item__de  { flex: 1; min-width: 0; }
.word-item__word {
  font-weight: 600; font-size: 0.95rem;
  display: flex; align-items: center; gap: 4px;
}
.word-item__actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  width: 30px;                     /* feste Breite = ausgerichtete Sternchen */
  justify-content: center;
}
.word-item__trans {
  font-size: 0.85rem; color: var(--text-secondary);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
}
.word-item__ai-col {
  flex-shrink: 0;
  width: 38px;                     /* feste Breite = ausgerichtete KI-Buttons */
  display: flex; align-items: center; justify-content: center;
}
.word-item:hover { background: var(--bg-card-hover); }
.word-item.learned {
  border-left: 3px solid var(--success);
  background: rgba(74, 222, 128, 0.07);
}
.word-item.learned .word-item__word { color: var(--text-primary); }
.word-item.learned::after {
  content: '✓';
  color: var(--success);
  font-weight: 800;
  font-size: 1.05rem;
  margin-left: 8px;
  flex-shrink: 0;
}
.word-item__pl { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── 22. FLASHCARD ── */
.flashcard-wrap {
  perspective: 1200px;
  margin-bottom: 24px;
}
.flashcard {
  position: relative;
  min-height: 240px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(.645,.045,.355,1);
  border-radius: var(--radius-xl);
}
.flashcard.flipped { transform: rotateY(180deg); }

.flashcard__side {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 28px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.flashcard__front {
  background: linear-gradient(135deg, var(--bg-card) 0%, #162840 100%);
}
.flashcard__back {
  background: linear-gradient(135deg, #0f3251 0%, var(--bg-card) 100%);
  transform: rotateY(180deg);
}
.flashcard__label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 16px;
}
.flashcard__word  { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.flashcard__hint  { font-size: 0.85rem; color: var(--text-secondary); margin-top: 12px; }
.flashcard__tap   { font-size: 0.75rem; color: var(--text-muted); margin-top: 24px; }

/* ── 23. QUIZ ── */
.quiz-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.quiz-counter { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.quiz-score   { font-size: 0.85rem; color: var(--accent-gold); font-weight: 700; }

.quiz-question {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.quiz-question__tag {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px;
}
.quiz-question__text {
  font-size: 1rem; font-weight: 600; color: var(--text-primary);
  line-height: 1.5; margin-bottom: 10px;
}
.quiz-question__sentence {
  font-size: 1.1rem; font-weight: 700; color: var(--accent-cyan);
  line-height: 1.5; padding: 12px 16px;
  background: rgba(0,200,215,0.08); border-radius: var(--radius-md);
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-primary);
  transition: all 0.15s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.quiz-option:hover   { border-color: var(--accent-blue); background: rgba(59,158,222,0.08); }
.quiz-option.correct { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.quiz-option.wrong   { border-color: var(--error);   background: var(--error-bg);   color: var(--error); }
.quiz-option.disabled { pointer-events: none; }
.quiz-option__key {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
}
.quiz-option.correct .quiz-option__key { background: var(--success); color: #fff; }
.quiz-option.wrong   .quiz-option__key { background: var(--error);   color: #fff; }

.quiz-explanation {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.6;
  animation: fadeIn 0.3s ease both;
}
.quiz-explanation strong { color: var(--accent-cyan); }

.quiz-actions {
  display: flex; gap: 10px; margin-top: 20px;
}
.quiz-actions .btn { flex: 1; }

/* ── 24. GRAMMAR VIEW ── */
.grammar-hero {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.grammar-hero__glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, var(--card-color, var(--accent-blue)) 0%, transparent 60%);
  opacity: 0.1; pointer-events: none;
}
.grammar-hero__icon  { font-size: 2.8rem; margin-bottom: 12px; }
.grammar-hero__level { margin-bottom: 10px; }
.grammar-hero__title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.grammar-hero__desc  { color: var(--text-secondary); font-size: 0.9rem; }

.theory-section { margin-bottom: 20px; }
.theory-section__title {
  font-size: 1rem; font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.theory-section__text {
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 12px;
}
.theory-example {
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem; color: var(--text-primary);
  margin-bottom: 6px;
  font-style: italic;
}

/* ── 25. TABLE ── */
.grammar-table-wrap { overflow-x: auto; margin-bottom: 16px; border-radius: var(--radius-md); }
.grammar-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 300px;
}
.grammar-table th {
  background: rgba(59,158,222,0.15);
  color: var(--accent-blue);
  font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 12px; text-align: left;
}
.grammar-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
}
.grammar-table tr:last-child td { border-bottom: none; }
.grammar-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.grammar-table td:first-child { color: var(--text-primary); font-weight: 600; }

/* ── 26. PHRASES VIEW ── */
.phrase-category { margin-bottom: 20px; }
.phrase-category__title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: 10px; padding-left: 4px;
}
.phrase-item {
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-size: 0.9rem; color: var(--text-primary);
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer; transition: all 0.15s;
  position: relative;
}
.phrase-item:hover { background: var(--bg-card-hover); padding-left: 20px; }
.phrase-item:hover::before {
  content: ''; position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 60%; background: var(--accent-cyan); border-radius: 2px;
}
.phrase-item.copied { border-color: var(--success); color: var(--success); }

.phrase-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.phrase-row .phrase-item { flex: 1; margin-bottom: 0; }

.btn-phrase-srs {
  display: block; width: 100%; margin-top: 10px;
  padding: 7px 12px; font-size: .78rem; font-family: inherit;
  border: 1px solid rgba(255,209,102,.3); border-radius: var(--radius-sm);
  background: rgba(255,209,102,.07); color: var(--accent-gold);
  cursor: pointer; transition: all .2s; text-align: center;
}
.btn-phrase-srs:hover:not(:disabled) {
  background: rgba(255,209,102,.2); border-color: rgba(255,209,102,.55);
}
.btn-phrase-srs--added {
  border-color: rgba(74,222,128,.3); background: rgba(74,222,128,.07);
  color: var(--success); cursor: default;
}
.btn-phrase-srs--learned {
  border-color: rgba(59,158,222,.35); background: rgba(59,158,222,.08);
  color: var(--accent-blue); cursor: default;
}

/* ── 27. NVV CARD ── */
.nvv-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}
.nvv-card__arrow svg { width: 20px; height: 20px; color: var(--text-muted); fill: none; stroke: currentColor; stroke-width: 2; }
.nvv-card__nvv   { flex: 1; font-weight: 700; font-size: 0.9rem; }
.nvv-card__verb  { color: var(--accent-cyan); font-size: 0.8rem; font-weight: 600; margin-top: 2px; }
.nvv-card__func  { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── 28. REDEWENDUNGEN ── */
.redewendung-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.redewendung-card__ausdruck { font-weight: 700; font-size: 0.95rem; color: var(--accent-gold); margin-bottom: 4px; }
.redewendung-card__bedeutung { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 8px; }
.redewendung-card__beispiel { font-size: 0.85rem; color: var(--text-primary); font-style: italic; padding: 8px 12px; background: rgba(255,255,255,0.04); border-radius: var(--radius-sm); }

/* ── 29. RESULT VIEW ── */
.result-view {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; text-align: center;
}
.result__emoji  { font-size: 5rem; margin-bottom: 16px; animation: bounceIn 0.5s cubic-bezier(.34,1.56,.64,1) both; }
.result__title  { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.result__subtitle { color: var(--text-secondary); margin-bottom: 32px; }
.result__score  {
  width: 100%; background: var(--bg-card);
  border-radius: var(--radius-xl); padding: 24px;
  margin-bottom: 24px; border: 1px solid rgba(255,255,255,0.06);
}
.result__score-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.result__stat-val { font-size: 2rem; font-weight: 800; }
.result__stat-val.green { color: var(--success); }
.result__stat-val.red   { color: var(--error); }
.result__stat-val.gold  { color: var(--accent-gold); }
.result__stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.result__actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* ── 30. TOAST ── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: rgba(30, 50, 80, 0.95);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  padding: 12px 24px; border-radius: var(--radius-full);
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; z-index: 200;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
  animation: toastIn 0.3s ease both;
}

/* ── 31. OVERLAY / MODAL ── */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 20px;
}
.modal {
  background: #162235;
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg);
  width: 100%; max-width: 440px;
  max-height: 80dvh; overflow-y: auto;
  padding: 24px 20px 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.08);
  animation: slideUp 0.35s cubic-bezier(.34,1.56,.64,1) both;
}
.modal__close { position: absolute; top: 16px; right: 16px; }

/* ── 32. LEVEL-UP ── */
.levelup {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.levelup__inner {
  text-align: center;
  animation: levelUpAnim 1.8s ease forwards;
}
.levelup__icon { font-size: 5rem; }
.levelup__text { font-size: 2rem; font-weight: 800; color: var(--accent-gold); text-shadow: 0 0 30px var(--accent-gold); }

/* ── 33. MODULE SELECT ── */
.module-select__header { margin-bottom: 24px; }
.grammar-module-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.15s;
}
.grammar-module-card:hover { background: var(--bg-card-hover); transform: translateX(4px); }
.grammar-module-card__icon { font-size: 1.8rem; flex-shrink: 0; }
.grammar-module-card__info { flex: 1; }
.grammar-module-card__title { font-weight: 700; font-size: 0.95rem; }
.grammar-module-card__desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.grammar-module-card__actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ── 34. DRAG & DROP ── */
.drag-area {
  min-height: 56px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.drag-area.drag-over { border-color: var(--accent-blue); background: rgba(59,158,222,0.06); }
.drag-word {
  padding: 6px 12px;
  background: rgba(59,158,222,0.15);
  border: 1px solid rgba(59,158,222,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
  cursor: grab; user-select: none;
  transition: all 0.15s;
}
.drag-word:hover  { background: rgba(59,158,222,0.25); }
.drag-word:active { cursor: grabbing; transform: scale(1.05); }
.drag-word.placed { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.3); color: var(--success); }

/* ── 35. SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── 36. VOCAB LERNWEG-GUIDE ── */
.vocab-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  margin-bottom: 16px;
  background: rgba(33,150,243,0.07);
  border: 1px solid rgba(33,150,243,0.18);
  border-radius: var(--radius-lg);
}
.vocab-guide__step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.vocab-guide__num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vocab-guide__sep {
  color: var(--text-muted);
  font-size: .85rem;
}

/* ── 37. SPRACH-SELECTOR ── */
.lang-selector-wrap {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.lang-selector__label {
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}
.lang-selector__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.lang-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lang-btn:hover { background: rgba(255,255,255,0.1); }
.lang-btn:active { transform: scale(0.93); }
.lang-btn--active {
  background: rgba(59,158,222,0.18);
  border-color: var(--accent-blue);
}
.lang-btn__flag { font-size: 1.4rem; line-height: 1; }
.lang-btn__code { font-size: .6rem; font-weight: 700; color: var(--text-secondary); letter-spacing: .5px; }
.lang-btn--active .lang-btn__code { color: var(--accent-blue); }

/* Banner: Übersetzungen noch nicht vorhanden */
.lang-missing-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px;
  background: rgba(251,146,60,0.1);
  border: 1px solid rgba(251,146,60,0.25);
  border-radius: var(--radius-md);
}
.lang-missing-banner__icon { font-size: 1.8rem; flex-shrink: 0; }

/* ── 37. SETTINGS ── */
.settings-view { padding: 20px 16px 40px; }

.settings-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.settings-section--disabled {
  opacity: .45;
  pointer-events: none;
}
.settings-section--danger {
  border-color: rgba(248,113,113,0.25);
  background: rgba(248,113,113,0.06);
}
.settings-section__title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
}
.settings-section__title:hover { color: var(--accent-blue); }

.settings-chevron {
  font-size: .75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.25s ease;
  line-height: 1;
}
.settings-section.is-open .settings-chevron {
  transform: rotate(90deg);
}

.settings-section__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding-top 0.25s ease;
  padding-top: 0;
}
.settings-section.is-open .settings-section__body {
  max-height: 2000px;
  padding-top: 16px;
}
.settings-badge {
  font-size: .65rem;
  font-weight: 600;
  background: var(--accent-blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.settings-hint {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}
.settings-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: .9rem;
  font-family: inherit;
  margin-top: 10px;
}
.settings-input:focus { outline: 2px solid var(--accent-blue); }

.backup-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}
.backup-status__icon { font-size: 1.4rem; flex-shrink: 0; }
.backup-status__info { flex: 1; min-width: 0; }
.backup-status__label { font-size: .82rem; font-weight: 600; }
.backup-status__time  { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.header__settings {
  color: var(--text-secondary);
  transition: color .2s;
}
.header__settings:hover { color: var(--text-primary); }
.header__settings svg { width: 20px; height: 20px; }

/* ── 38. KI / AI ── */
.btn-ai-sentence {
  background: rgba(59,158,222,0.18);
  border: 1px solid rgba(59,158,222,0.5);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  font-size: .85rem;
  flex-shrink: 0;
  color: #7dc8f0;
  font-weight: 600;
  transition: background .2s, border-color .2s, color .2s;
  line-height: 1.4;
}
.btn-ai-sentence:hover {
  background: rgba(59,158,222,0.32);
  border-color: rgba(59,158,222,0.7);
  color: #a8daff;
}

.ai-spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(59,158,222,0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: ai-spin .8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-sentence-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(59,158,222,0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ai-sentence-card__text {
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.settings-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 16px 0;
}

.ai-profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-profile-card {
  flex: 1 1 140px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color .2s;
}
.ai-profile-card--active {
  border-color: var(--accent-blue);
  background: rgba(59,158,222,.08);
}
.ai-profile-card__name {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-profile-card__sub  { font-size: .72rem; color: var(--text-muted); }
.ai-profile-card__model {
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.ai-profile-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 6px;
}
.ai-profile-active-label {
  font-size: .72rem;
  color: var(--success);
  font-weight: 600;
}
.btn-delete-profile {
  color: var(--text-muted);
  font-size: .8rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
  line-height: 1;
}
.btn-delete-profile:hover { color: var(--error); background: var(--error-bg); }

.ai-free-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: .8rem;
  color: var(--text-secondary);
}

.settings-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .03em;
  margin: 14px 0 6px;
}
.settings-select {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  appearance: auto;
}
.settings-select:focus { outline: 2px solid var(--accent-blue); }

.settings-key-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-key-wrap .settings-input { flex: 1; margin-top: 0; }

.settings-badge--ok { background: var(--success); }

/* ── 39. BIBLIOTHEK ── */
.library-view { padding: 0; }

.library-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.library-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}
.library-card__word {
  font-size: 1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.library-card__meta {
  font-size: .75rem;
  color: var(--text-muted);
}
.library-sentence {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.library-sentence:last-child { margin-bottom: 0; }
.library-sentence__text {
  font-size: .9rem;
  line-height: 1.65;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.library-sentence__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.library-sentence__date { font-size: .72rem; color: var(--text-muted); }
.btn-delete-sentence {
  color: var(--text-muted);
  transition: color .2s;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.btn-delete-sentence:hover { color: var(--error); }
.btn-delete-sentence svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════ */

/* ── Schmaler Rahmen ab 480px ─────────────────── */
@media (min-width: 480px) {
  .app {
    border-left:  1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
  }
}

/* ── Tablet (≥768px): breiterer Container ─────── */
@media (min-width: 768px) {
  .app {
    max-width: 720px;
  }
  .bottom-nav {
    max-width: 720px;
  }
  .view {
    padding: 24px 28px;
  }
  .dashboard-hero {
    margin: 0 -28px 26px;
    height: 230px;
  }
}

/* ── Desktop (≥1024px): Sidebar-Navigation ─────── */
@media (min-width: 1024px) {
  :root {
    --sidebar-w: 220px;
  }

  /* App-Shell: CSS-Grid mit Sidebar links, Inhalt rechts */
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    max-width: none;
    width: 100%;
    height: 100dvh;
    border: none;
    overflow: hidden;
  }

  /* ── Sidebar (früher Bottom-Nav) ── */
  .bottom-nav {
    grid-column: 1;
    grid-row: 1 / 3;            /* volle Höhe */
    position: static;
    transform: none;
    width: var(--sidebar-w);
    max-width: none;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    grid-template-columns: unset;
    border-right: 1px solid rgba(255,255,255,0.08);
    border-top: none;
    background: var(--bg-secondary);
  }

  /* Brand-Logo oben in der Sidebar */
  .nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: var(--header-h);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
  }
  .nav-brand span { color: var(--accent-cyan); }

  /* Nav-Items: jetzt horizontal (Icon + Label nebeneinander) */
  .bottom-nav__item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 14px 24px;
    font-size: 0.88rem;
    gap: 14px;
    min-height: 52px;
    text-align: left;
    border-radius: 0;
  }
  .bottom-nav__item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
  }
  .bottom-nav__item.active {
    background: rgba(59,158,222,0.08);
  }

  /* Aktiv-Indikator: linker Balken statt oberer */
  .bottom-nav__item::before {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 3px;
    height: 28px;
    border-radius: 0 3px 3px 0;
  }
  .bottom-nav__item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* ── Header ── */
  .header {
    grid-column: 2;
    grid-row: 1;
    position: static;     /* sticky nicht nötig – Grid-Zeile scrollt nicht */
  }

  /* ── Hauptinhalt ── */
  .main {
    grid-column: 2;
    grid-row: 2;
    height: calc(100dvh - var(--header-h));
    padding-bottom: 32px;
  }

  /* Views: zentriert mit sinnvoller Max-Breite */
  .view {
    padding: 32px 48px;
    max-width: 960px;
    margin: 0 auto;
  }
  .dashboard-hero {
    margin: 0 -48px 30px;
    height: 260px;
    background:
      linear-gradient(to bottom, transparent 50%, var(--bg-primary) 100%),
      linear-gradient(to right, transparent 70%, var(--bg-primary) 100%),
      url('../assets/hero.webp') left center / cover no-repeat;
  }

  /* Bento-Grid: 3 Spalten auf Desktop */
  .bento-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    grid-template-areas:
      "grammar vocab        phrases"
      "grammar flash        flash"
      "grammar collection   collection";
    gap: 20px;
  }
}

/* ── TOGGLE SWITCH (Edit-Modus) ───────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.25s;
  border: 1px solid rgba(255,255,255,0.12);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(59,158,222,0.3);
  border-color: var(--accent-blue);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--accent-blue);
}

/* ── EDIT-BUTTON (Übersetzung bearbeiten) ──────── */
.btn-edit-trans {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-edit-trans:hover {
  background: rgba(59,158,222,0.15);
  border-color: rgba(59,158,222,0.3);
  color: var(--accent-blue);
}

/* ── INLINE-EDIT-ROW ──────────────────────────── */
.word-item.is-editing {
  flex-wrap: wrap;
  border-color: rgba(59,158,222,0.35);
}
.word-item__edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-basis: 100%;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  animation: slideDown 0.2s ease both;
}
.word-item__edit-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.word-item__edit-input:focus {
  border-color: var(--accent-blue);
}
.word-item__edit-lang {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.word-item__edit-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-edit-save {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--success);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.btn-edit-save:hover { opacity: 0.85; }
.btn-edit-cancel {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-edit-cancel:hover { background: rgba(255,255,255,0.15); }

/* ── CUSTOM-TRANSLATION INDIKATOR ─────────────── */
.word-item.has-custom-trans .word-item__trans {
  color: var(--accent-cyan);
}

/* ── 41. COLLECTION / SAMMELKORB ─────────────────── */
.collection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.collection-item:hover {
  background: var(--bg-card-hover);
}

.collection-item__index {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,209,102,0.12);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.collection-item__content {
  flex: 1;
  min-width: 0;
}

.collection-item__word {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.collection-item__trans {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.collection-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.collection-item__remove {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.collection-item__remove:hover {
  background: var(--error-bg);
  border-color: rgba(248,113,113,0.3);
  color: var(--error);
}

/* ── 42. COLLECTION SECTION (Sammelkorb-Abschnitte) ── */
.collection-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  border: 1px solid rgba(255,255,255,0.05);
}

.collection-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ── 43. LIBRARY PREVIEW (KI-Sätze im Sammelkorb) ── */
.library-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.library-preview__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.library-preview__word {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.library-preview__count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.library-preview__more {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
  font-style: italic;
}

/* ── 44. MERK-BUTTON (STAR) ──────────────────────── */
.btn-collect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255,209,102,0.08);
  border: 1px solid rgba(255,209,102,0.2);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  flex-shrink: 0;
  color: var(--text-muted);
}

.btn-collect:hover {
  background: rgba(255,209,102,0.2);
  border-color: rgba(255,209,102,0.4);
  transform: scale(1.1);
}

.btn-collect--active {
  background: rgba(255,209,102,0.25);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-collect--sm {
  width: auto;
  height: auto;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  display: block;
  width: 100%;
  margin-top: 8px;
  margin-left: 0;
  text-align: center;
  border-radius: var(--radius-sm);
}

/* ── Reduzierte Bewegung ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
