* { box-sizing: border-box; margin: 0; padding: 0; }
button, .lesson-chip, .type-chip, .card-scene, .vocab-list-header, .filter-header {
  touch-action: manipulation;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  color: #1a202c;
  transition: background 0.25s, color 0.25s;
}

h1 { font-size: 1.5rem; margin-bottom: 4px; color: #2d3748; text-align: center; }
.subtitle { font-size: 0.88rem; color: #718096; margin-bottom: 20px; text-align: center; }

/* ─── App layout (when logged in) ────────────────────────────────────────── */
body.app-active { padding: 0; align-items: stretch; }

/* ─── Sidebar (desktop ≥ 700px) ─────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0;
  width: 210px; height: 100vh;
  background: #f8fafc; border-right: 1px solid #e2e8f0;
  display: flex; flex-direction: column;
  padding: 22px 12px 18px; z-index: 50; overflow-y: auto;
}
body.dark .sidebar { background: #0d1117; border-right-color: #1e293b; }

.sidebar-brand {
  font-size: 1.4rem; font-weight: 700; color: #1a202c;
  letter-spacing: -0.3px; padding: 0 10px; margin-bottom: 26px;
}
body.dark .sidebar-brand { color: #f1f5f9; }

.brand-series-badge {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.3px;
  padding: 2px 7px; border-radius: 20px;
  background: #dbeafe; color: #1e40af;
  vertical-align: middle; line-height: 1;
  margin-left: 7px;
}
.brand-series-badge.badge-aby {
  background: #ccfbf1; color: #0f766e;
}
body.dark .brand-series-badge { background: #1e3a8a; color: #93c5fd; }
body.dark .brand-series-badge.badge-aby { background: #134e4a; color: #5eead4; }

.sidebar-section-label {
  font-size: 0.67rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: #94a3b8; padding: 0 10px; margin-bottom: 4px;
}

.sidebar-tab {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px 9px 13px; border-radius: 10px;
  border: none; border-left: 3px solid transparent;
  background: none; margin-bottom: 2px;
  font-size: 0.87rem; font-weight: 500; color: #4a5568;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s, color 0.15s;
}
.sidebar-tab:hover:not(.active) { background: #edf2f7; color: #2d3748; }
.sidebar-tab.active { background: #ebf4ff; color: #2b6cb0; font-weight: 600; border-left-color: #4f7df0; }
body.dark .sidebar-tab { color: #94a3b8; }
body.dark .sidebar-tab:hover:not(.active) { background: #1e293b; color: #e2e8f0; }
body.dark .sidebar-tab.active { background: #172035; color: #60a5fa; border-left-color: #4f7df0; }

.sidebar-sep { height: 1px; background: #e2e8f0; margin: 10px 10px; }
body.dark .sidebar-sep { background: #1e293b; }

.sidebar-series-switch {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 0; padding: 8px 12px;
  border-radius: 8px; border: 1px dashed #cbd5e1;
  background: transparent; color: #64748b;
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.sidebar-series-switch:hover { background: #f1f5f9; color: #2b6cb0; border-color: #4f7df0; border-style: solid; }
.sidebar-series-switch i { font-size: 0.75rem; }
body.dark .sidebar-series-switch { border-color: #334155; color: #94a3b8; }
body.dark .sidebar-series-switch:hover { background: #1e293b; color: #60a5fa; border-color: #4f7df0; }

.home-series-switch-wrap { width: 100%; display: flex; justify-content: center; margin: 4px 0 20px; }
.home-series-switch {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 10px;
  background: transparent; border: 1px dashed #cbd5e1;
  color: #64748b; font-size: 0.9rem; font-weight: 500;
  font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.15s;
}
.home-series-switch:hover { background: #f8fafc; color: #2b6cb0; border-color: #4f7df0; border-style: solid; }
.home-series-switch i { font-size: 0.8rem; }
body.dark .home-series-switch { border-color: #334155; color: #94a3b8; }
body.dark .home-series-switch:hover { background: #1e293b; color: #60a5fa; border-color: #4f7df0; }
.sidebar-spacer { flex: 1; min-height: 12px; }

.sidebar-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding-top: 12px; border-top: 1px solid #e2e8f0;
  padding-left: 40px; /* space for the absolute-positioned settings gear */
}
body.dark .sidebar-footer { border-top-color: #1e293b; }

.sidebar-icon-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 7px; border: none; background: none; border-radius: 8px;
  cursor: pointer; font-size: 1.05rem; color: #718096;
  transition: background 0.15s, color 0.15s;
}
.sidebar-icon-btn:hover { background: #edf2f7; color: #2d3748; }
body.dark .sidebar-icon-btn { color: #64748b; }
body.dark .sidebar-icon-btn:hover { background: #1e293b; color: #e2e8f0; }

.sidebar-icon-btn.profile-btn-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: #2b6cb0; color: white;
  font-size: 0.78rem; font-weight: 700; padding: 0;
}
.sidebar-icon-btn.profile-btn-avatar:hover { filter: brightness(1.15); }

/* Settings gear — pinned to bottom-left corner of sidebar */
.sidebar-settings-btn {
  position: absolute; bottom: 18px; left: 14px;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  font-size: 1.1rem; color: #718096;
  transition: background 0.15s, color 0.15s, transform 0.22s;
}
.sidebar-settings-btn:hover {
  background: #edf2f7; color: #2d3748;
  transform: rotate(35deg);
}
body.dark .sidebar-settings-btn { color: #64748b; }
body.dark .sidebar-settings-btn:hover { background: #1e293b; color: #e2e8f0; }

/* ─── Main content area ──────────────────────────────────────────────────── */
.app-main {
  margin-left: 210px;
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 24px 60px; min-height: 100vh;
}


/* ─── Desktop search bar (top of main content) ───────────────────────────── */
.desktop-topbar {
  display: none; /* shown via media query below */
  width: 100%; max-width: 820px;
  margin-bottom: 20px;
}
.desktop-search-trigger {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 12px;
  background: #fff; border: 1.5px solid #e2e8f0;
  cursor: pointer; font-family: 'Inter', sans-serif;
  color: #94a3b8; font-size: 0.88rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  text-align: left;
}
.desktop-search-trigger:hover { border-color: #4f7df0; box-shadow: 0 0 0 3px rgba(79,125,240,0.1); }
.desktop-search-trigger svg   { flex-shrink: 0; color: #a0aec0; }
.desktop-search-trigger span:nth-child(2) { flex: 1; }
.dsearch-kbd {
  font-size: 0.72rem; color: #cbd5e0; background: #f7fafc;
  border: 1px solid #e2e8f0; border-radius: 5px; padding: 2px 6px;
}
body.dark .desktop-search-trigger { background: #1e293b; border-color: #334155; color: #64748b; }
body.dark .desktop-search-trigger:hover { border-color: #4f7df0; }
body.dark .dsearch-kbd { background: #0d1117; border-color: #334155; color: #475569; }

@media (min-width: 700px) { .desktop-topbar { display: block; } }

/* ─── Mobile top bar + bottom nav (hidden on desktop) ───────────────────── */
.mobile-topbar { display: none; }
.bottom-nav    { display: none; }

/* ─── Mobile layout (< 700px) ───────────────────────────────────────────── */
@media (max-width: 699px) {
  .sidebar { display: none; }
  .app-main { margin-left: 0; padding-top: 16px; padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; width: 100%; height: 52px; z-index: 50;
    background: #f0f4f8; border-bottom: 1px solid #e2e8f0; padding: 0 16px;
  }
  body.dark .mobile-topbar { background: #0d1117; border-bottom-color: #1e293b; }

  .topbar-brand {
    font-size: 1.2rem; font-weight: 700; color: #1a202c; letter-spacing: -0.3px;
  }
  body.dark .topbar-brand { color: #f1f5f9; }

  .topbar-actions { display: flex; align-items: center; gap: 6px; }
  .topbar-actions .settings-btn { position: static; transform: none; }
  .topbar-actions .settings-btn:hover { transform: rotate(30deg); }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    height: 62px; background: #ffffff; border-top: 1px solid #e2e8f0;
    z-index: 50; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  body.dark .bottom-nav { background: #0d1117; border-top-color: #1e293b; }

  .bottom-tab {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; flex: 1; min-width: 68px;
    border: none; background: none; cursor: pointer;
    color: #94a3b8; padding: 6px 4px;
    transition: color 0.15s; font-family: 'Inter', sans-serif;
  }
  .bottom-tab.active { color: #4f7df0; }
  body.dark .bottom-tab { color: #64748b; }
  body.dark .bottom-tab.active { color: #60a5fa; }

  .bottom-tab-icon  { font-size: 1.25rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
  .bottom-tab-icon i { font-size: 1.1rem; }
  .bottom-tab-label { font-size: 0.62rem; font-weight: 600; white-space: nowrap; }

  .bottom-tab-sep {
    width: 1px; align-self: center; height: 36px;
    background: #e2e8f0; flex-shrink: 0; margin: 0 4px;
  }
  body.dark .bottom-tab-sep { background: #1e293b; }
}

/* Buch 3 work-in-progress notice */
.buch3-notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 18px;
  font-size: 0.82rem; color: #92400e; line-height: 1.5;
  width: 100%; max-width: 820px;
}
.buch3-notice-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
body.dark .buch3-notice {
  background: #1c1a0f; border-color: #854d0e; color: #fcd34d;
}

/* Header row with settings button */
.header-row {
  position: relative; width: 100%; max-width: 820px;
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 4px;
}
.header-row h1 { flex: 1; }
.settings-btn {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: #a0aec0; transition: color 0.2s, transform 0.2s;
  padding: 4px 6px; border-radius: 8px;
}
.settings-btn:hover { color: #4a5568; transform: translateY(-50%) rotate(30deg); }
/* Settings-btn inside header-actions: reset absolute positioning */
.header-actions .settings-btn {
  position: static; transform: none;
}
.header-actions .settings-btn:hover { transform: rotate(30deg); }

/* Filter panel */
.filter-panel {
  width: 100%;
  max-width: 820px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 18px;
  overflow: hidden;
}
.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.filter-header:hover { background: #f7fafc; }
.filter-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a5568;
  letter-spacing: 0.3px;
}
.filter-summary {
  font-size: 0.78rem;
  color: #718096;
  flex: 1;
  text-align: center;
}
.filter-chevron {
  font-size: 0.75rem;
  color: #a0aec0;
  transition: transform 0.2s;
}
.filter-chevron.open { transform: rotate(180deg); }
.filter-body {
  display: none;
  padding: 10px 14px 14px;
  border-top: 1px solid #e2e8f0;
}
.filter-body.open { display: block; }
.filter-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.filter-ctrl-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #cbd5e0;
  background: white;
  color: #4a5568;
  transition: all 0.15s;
}
.filter-ctrl-btn:hover { border-color: #2b6cb0; color: #2b6cb0; }
.lesson-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.lesson-chip {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid #cbd5e0;
  background: white;
  color: #718096;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lesson-chip.selected {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: white;
}
.lesson-chip:hover:not(.selected) { border-color: #90cdf4; color: #2b6cb0; }
.lesson-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lesson-dot-green  { background: #48bb78; }
.lesson-dot-yellow { background: #ecc94b; }
.lesson-dot-red    { background: #fc8181; }

/* Type chips — distinct color per type */
.type-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.filter-section-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #a0aec0; margin: 10px 0 6px;
}
.type-chip {
  padding: 5px 13px; border-radius: 999px; font-size: 0.78rem;
  font-weight: 700; cursor: pointer; border: 2px solid #cbd5e0;
  background: white; color: #718096;
  transition: all 0.15s; white-space: nowrap; user-select: none;
}
.type-chip.selected { color: white; }
.type-chip[data-type="Substantiv"].selected  { background: #2b6cb0; border-color: #2b6cb0; }
.type-chip[data-type="Verb"].selected         { background: #276749; border-color: #276749; }
.type-chip[data-type="Adjektiv"].selected     { background: #744210; border-color: #744210; }
.type-chip[data-type="Adverb"].selected       { background: #553c9a; border-color: #553c9a; }
.type-chip[data-type="Pronomen"].selected     { background: #97266d; border-color: #97266d; }
.type-chip[data-type="Ausdruck"].selected     { background: #c05621; border-color: #c05621; }
.type-chip[data-type="Partikel"].selected     { background: #2c7a7b; border-color: #2c7a7b; }
.type-chip[data-type="Land"].selected         { background: #b7791f; border-color: #b7791f; }
.type-chip[data-type="Zahl"].selected         { background: #0e7490; border-color: #0e7490; }
.type-chip[data-type="Ordnungszahl"].selected { background: #9f1239; border-color: #9f1239; }
.type-chip[data-type="Wochentag"].selected    { background: #3f6212; border-color: #3f6212; }
.type-chip[data-type="Monat"].selected        { background: #6b21a8; border-color: #6b21a8; }

.type-chip[data-type="Substantiv"]:hover:not(.selected)    { border-color: #90cdf4; color: #2b6cb0; }
.type-chip[data-type="Verb"]:hover:not(.selected)           { border-color: #68d391; color: #276749; }
.type-chip[data-type="Adjektiv"]:hover:not(.selected)       { border-color: #f6ad55; color: #744210; }
.type-chip[data-type="Adverb"]:hover:not(.selected)         { border-color: #b794f4; color: #553c9a; }
.type-chip[data-type="Pronomen"]:hover:not(.selected)       { border-color: #f687b3; color: #97266d; }
.type-chip[data-type="Ausdruck"]:hover:not(.selected)       { border-color: #fbd38d; color: #c05621; }
.type-chip[data-type="Partikel"]:hover:not(.selected)       { border-color: #81e6d9; color: #2c7a7b; }
.type-chip[data-type="Land"]:hover:not(.selected)           { border-color: #f6ad55; color: #b7791f; }
.type-chip[data-type="Zahl"]:hover:not(.selected)           { border-color: #67e8f9; color: #0e7490; }
.type-chip[data-type="Ordnungszahl"]:hover:not(.selected)   { border-color: #fda4af; color: #9f1239; }
.type-chip[data-type="Wochentag"]:hover:not(.selected)      { border-color: #86efac; color: #3f6212; }
.type-chip[data-type="Monat"]:hover:not(.selected)          { border-color: #d8b4fe; color: #6b21a8; }

/* Card area */
.card-area {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.progress-bar-wrap { width: 100%; background: #e2e8f0; border-radius: 999px; height: 6px; }
.progress-bar-fill { height: 6px; border-radius: 999px; background: #2b6cb0; transition: width 0.3s; }
.progress-label { font-size: 0.8rem; color: #718096; text-align: right; width: 100%; margin-top: 4px; }

/* Flashcard */
.card-scene { width: 100%; height: 290px; perspective: 900px; cursor: pointer; overflow: hidden; border-radius: 18px; }
.card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.card-scene.flipped .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 18px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: safe center;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  gap: 12px;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}
.card-front, .card-back {
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  will-change: transform;
}
.card-front { transform: rotateY(0deg); }
.card-face::-webkit-scrollbar,
.card-front::-webkit-scrollbar,
.card-back::-webkit-scrollbar { width: 6px; }
.card-face::-webkit-scrollbar-thumb,
.card-front::-webkit-scrollbar-thumb,
.card-back::-webkit-scrollbar-thumb { background: rgba(160,174,192,0.4); border-radius: 3px; }
body.dark .card-face::-webkit-scrollbar-thumb,
body.dark .card-front::-webkit-scrollbar-thumb,
body.dark .card-back::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.card-front { background: white; }
.card-back  { background: #ebf4ff; transform: rotateY(180deg); }

.card-label { font-size: 0.7rem; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: #a0aec0; }
.card-front .card-label { color: #90cdf4; }
.card-back  .card-label { color: #76b3e8; }

.arabic-main {
  font-size: 2.7rem; direction: rtl; text-align: center;
  line-height: 1.8; color: #1a365d;
  font-family: 'Noto Naskh Arabic',serif;
}
.arabic-sub {
  font-size: 1.25rem; direction: rtl; text-align: center;
  color: #4a6fa5; line-height: 1.7;
  font-family: 'Noto Naskh Arabic',serif;
}
.arabic-note {
  font-size: 0.78rem; text-align: center; color: #718096;
  background: #edf2f7; border-radius: 6px; padding: 3px 10px;
  font-family: 'Noto Naskh Arabic',serif;
  direction: ltr;
}
.german-main { font-size: 1.5rem; font-weight: 700; text-align: center; color: #1a365d; }
.german-sub  { font-size: 0.92rem; text-align: center; color: #4a6fa5; }
.hint { font-size: 0.75rem; color: #b0b8c8; margin-top: 4px; text-align: center; }
.type-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
  background: #bee3f8; color: #2b6cb0; letter-spacing: 0.5px;
}
.lesson-badge {
  position: absolute; top: 14px; right: 18px;
  font-size: 0.68rem; font-weight: 700;
  color: #90cdf4; letter-spacing: 0.5px;
}

/* Direction toggle */
.dir-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dir-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px; font-size: 0.8rem;
  font-weight: 700; cursor: pointer; border: 2px solid #e2e8f0;
  background: white; color: #718096; transition: all 0.2s;
  letter-spacing: 0.3px;
}
.dir-btn:hover { border-color: #2b6cb0; color: #2b6cb0; }
.dir-btn.de-ar { border-color: #48bb78; background: #f0fff4; color: #276749; }
.dir-btn.ar-de { border-color: #ed8936; background: #fffaf0; color: #7b341e; }
.dir-label { font-size: 0.75rem; color: #a0aec0; }

/* Nav */
.nav { display: flex; gap: 10px; align-items: center; }
.nav-btn {
  padding: 10px 20px; border-radius: 10px; font-size: 0.88rem;
  font-weight: 600; cursor: pointer; border: none;
  background: #2b6cb0; color: white; transition: background 0.18s, transform 0.1s;
}
.nav-btn:hover { background: #2c5282; }
.nav-btn:active { transform: scale(0.96); }
.nav-btn:disabled { background: #cbd5e0; cursor: default; }
.flip-btn {
  padding: 10px 20px; border-radius: 10px; font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
  border: 2px solid #2b6cb0; background: white; color: #2b6cb0;
  transition: all 0.18s;
}
.flip-btn:hover { background: #ebf4ff; }

/* Shuffle */
.shuffle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px; font-size: 0.8rem;
  font-weight: 700; cursor: pointer; border: 2px solid #e2e8f0;
  background: white; color: #718096; transition: all 0.2s;
  letter-spacing: 0.3px;
}
.shuffle-btn:hover { border-color: #805ad5; color: #553c9a; }
.shuffle-btn.active { border-color: #805ad5; background: #faf5ff; color: #553c9a; }

/* Vocab list */
.vocab-list { width: 100%; max-width: 820px; margin-top: 20px; }
.vocab-list-header {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #a0aec0; margin-bottom: 10px;
  text-align: center; cursor: pointer; user-select: none;
}
.vocab-list-header:hover { color: #718096; }
.vocab-items { display: none; }
.vocab-items.open { display: block; }
.lesson-heading {
  font-size: 0.75rem; font-weight: 700; color: #a0aec0;
  text-transform: uppercase; letter-spacing: 1px;
  margin: 16px 0 6px; text-align: center;
}
.vocab-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 14px; border-radius: 8px;
  background: white; margin-bottom: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); gap: 12px;
}
.vi-arabic {
  font-size: 1.15rem; direction: rtl; flex-shrink: 0;
  font-family: 'Noto Naskh Arabic',serif;
  color: #1a365d;
}
.vi-german { font-size: 0.86rem; color: #4a5568; text-align: right; }

/* ── Settings modal ────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 18px;
  width: min(360px, 92vw); padding: 26px 24px 22px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1rem; font-weight: 700; color: #2d3748; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: #a0aec0; line-height: 1;
  padding: 2px 6px; border-radius: 6px; transition: color 0.15s;
}
.modal-close:hover { color: #4a5568; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid #e2e8f0;
}
.setting-label { font-size: 0.88rem; color: #4a5568; font-weight: 600; }
.setting-desc  { font-size: 0.75rem; color: #a0aec0; margin-top: 2px; }

/* Toggle switch */
.toggle-wrap { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-wrap input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #cbd5e0; cursor: pointer; transition: background 0.2s;
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-wrap input:checked + .toggle-track { background: #2b6cb0; }
.toggle-wrap input:checked + .toggle-track::after { transform: translateX(20px); }

/* ── Dark mode ─────────────────────────────────────────────────── */
body.dark { background: #111827; color: #e2e8f0; }
body.dark h1 { color: #e2e8f0; }
body.dark .subtitle { color: #718096; }
body.dark .settings-btn { color: #4a5568; }
body.dark .settings-btn:hover { color: #a0aec0; }

body.dark .filter-panel { background: #1f2937; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
body.dark .filter-header:hover { background: #27303f; }
body.dark .filter-title { color: #a0aec0; }
body.dark .filter-summary { color: #718096; }
body.dark .filter-chevron { color: #4a5568; }
body.dark .filter-body { border-top-color: #374151; }
body.dark .filter-ctrl-btn { background: #1f2937; border-color: #374151; color: #a0aec0; }
body.dark .filter-ctrl-btn:hover { border-color: #63b3ed; color: #90cdf4; }
body.dark .filter-section-label { color: #4a5568; }
body.dark .lesson-chip { background: #1f2937; border-color: #374151; color: #718096; }
body.dark .lesson-chip.selected { background: #2b6cb0; border-color: #2b6cb0; color: white; }
body.dark .lesson-chip:hover:not(.selected) { border-color: #4299e1; color: #90cdf4; }
body.dark .type-chip { background: #1f2937; border-color: #374151; color: #9ca3af; }
body.dark .type-chip.selected { color: white; }

body.dark .progress-bar-wrap { background: #374151; }
body.dark .progress-label { color: #718096; }

body.dark .dir-btn { background: #1f2937; border-color: #374151; color: #718096; }
body.dark .dir-btn.de-ar { background: #1a2e22; border-color: #276749; color: #68d391; }
body.dark .dir-btn.ar-de { background: #2d1f0e; border-color: #c05621; color: #fbd38d; }
body.dark .shuffle-btn { background: #1f2937; border-color: #374151; color: #718096; }
body.dark .shuffle-btn.active { background: #1e1a2e; border-color: #805ad5; color: #b794f4; }

body.dark .card-front { background: #1f2937; box-shadow: 0 4px 20px rgba(0,0,0,0.35); }
body.dark .card-back  { background: #1e3a5f; box-shadow: 0 4px 20px rgba(0,0,0,0.35); }
body.dark .card-front .card-label { color: #4a6fa5; }
body.dark .card-back  .card-label { color: #4a6fa5; }
body.dark .arabic-main { color: #bee3f8; }
body.dark .arabic-sub  { color: #90cdf4; }
body.dark .arabic-note { background: #2d3748; color: #a0aec0; }
body.dark .german-main { color: #e2e8f0; }
body.dark .german-sub  { color: #90cdf4; }
body.dark .hint { color: #4a5568; }
body.dark .type-badge { background: #2c5282; color: #bee3f8; }
body.dark .lesson-badge { color: #4a6fa5; }

body.dark .nav-btn { background: #2b6cb0; }
body.dark .nav-btn:hover { background: #2c5282; }
body.dark .nav-btn:disabled { background: #2d3748; color: #4a5568; }
body.dark .flip-btn { background: #1f2937; border-color: #2b6cb0; color: #90cdf4; }
body.dark .flip-btn:hover { background: #1e3a5f; }

body.dark .vocab-list-header { color: #4a5568; }
body.dark .vocab-list-header:hover { color: #718096; }
body.dark .lesson-heading { color: #4a5568; }
body.dark .vocab-item { background: #1f2937; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
body.dark .vi-arabic { color: #bee3f8; }
body.dark .vi-german { color: #a0aec0; }

body.dark .modal { background: #1f2937; }
body.dark .modal-title { color: #e2e8f0; }
body.dark .modal-close { color: #4a5568; }
body.dark .modal-close:hover { color: #a0aec0; }
body.dark .setting-row { border-top-color: #374151; }
body.dark .setting-label { color: #a0aec0; }

/* ── Arabic font switcher ──────────────────────────────────────── */
.setting-row.col { flex-direction: column; align-items: flex-start; gap: 10px; }
.font-chips { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.font-chip {
  flex: 1; min-width: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 2px solid #e2e8f0; background: white; transition: all 0.15s;
}
.font-chip:hover { border-color: #90cdf4; }
.font-chip.active { border-color: #2b6cb0; background: #ebf4ff; }
.font-chip-name { font-size: 0.7rem; font-weight: 700; color: #718096; letter-spacing: 0.3px; }
.font-chip.active .font-chip-name { color: #2b6cb0; }
.font-chip-preview { font-size: 1.35rem; direction: rtl; color: #1a365d; line-height: 1.6; }

body.dark .font-chip { background: #111827; border-color: #374151; }
body.dark .font-chip:hover { border-color: #4299e1; }
body.dark .font-chip.active { border-color: #2b6cb0; background: #1e3a5f; }
body.dark .font-chip-name { color: #718096; }
body.dark .font-chip.active .font-chip-name { color: #90cdf4; }
body.dark .font-chip-preview { color: #bee3f8; }

/* ── Arabic font overrides ─────────────────────────────────────── */
body.arabic-amiri .arabic-main,
body.arabic-amiri .arabic-sub,
body.arabic-amiri .arabic-note,
body.arabic-amiri .vi-arabic { font-family: 'Amiri', serif; }

body.arabic-cairo .arabic-main,
body.arabic-cairo .arabic-sub,
body.arabic-cairo .arabic-note,
body.arabic-cairo .vi-arabic { font-family: 'Cairo', sans-serif; }

/* ── Card flash animations ──────────────────────────────────────── */
@keyframes flash-correct {
  0%   { box-shadow: 0 4px 20px rgba(0,0,0,0.10); outline: 3px solid transparent; }
  25%  { box-shadow: 0 0 0 4px #48bb78, 0 4px 20px rgba(72,187,120,0.25); outline: 3px solid #48bb78; }
  100% { box-shadow: 0 4px 20px rgba(0,0,0,0.10); outline: 3px solid transparent; }
}
@keyframes flash-wrong {
  0%   { box-shadow: 0 4px 20px rgba(0,0,0,0.10); outline: 3px solid transparent; }
  25%  { box-shadow: 0 0 0 4px #f56565, 0 4px 20px rgba(245,101,101,0.25); outline: 3px solid #f56565; }
  100% { box-shadow: 0 4px 20px rgba(0,0,0,0.10); outline: 3px solid transparent; }
}
.card-scene.flash-correct { animation: flash-correct 0.45s ease-out; }
.card-scene.flash-wrong   { animation: flash-wrong   0.45s ease-out; }

/* ── Mode Toggle ────────────────────────────────────────────────── */
.mode-toggle-row {
  display: flex; gap: 0; width: 100%;
  background: #e2e8f0; border-radius: 12px; padding: 3px;
  margin-bottom: 4px;
}
.mode-btn {
  flex: 1; padding: 8px 16px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  border: none; background: transparent; color: #718096;
  transition: all 0.2s; letter-spacing: 0.3px;
}
.mode-btn.active { background: white; color: #2d3748; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
body.dark .mode-toggle-row { background: #374151; }
body.dark .mode-btn { color: #6b7280; }
body.dark .mode-btn.active { background: #1f2937; color: #e2e8f0; }

/* ── Quiz buttons ───────────────────────────────────────────────── */
.quiz-show-btn {
  padding: 12px 40px; border-radius: 12px; font-size: 0.95rem;
  font-weight: 700; cursor: pointer; border: 2px solid #2b6cb0;
  background: white; color: #2b6cb0; transition: all 0.18s;
}
.quiz-show-btn:hover { background: #ebf4ff; }
body.dark .quiz-show-btn { background: #1f2937; border-color: #2b6cb0; color: #90cdf4; }
body.dark .quiz-show-btn:hover { background: #1e3a5f; }

.quiz-eval-row { display: flex; gap: 12px; width: 100%; }
.quiz-btn {
  flex: 1; padding: 13px 16px; border-radius: 12px; font-size: 1rem;
  font-weight: 700; cursor: pointer; border: none; transition: all 0.18s;
}
.quiz-btn:active { transform: scale(0.96); }
.quiz-btn-correct { background: #48bb78; color: white; }
.quiz-btn-correct:hover { background: #38a169; }
.quiz-btn-wrong { background: #f56565; color: white; }
.quiz-btn-wrong:hover { background: #e53e3e; }

.quiz-end-msg { text-align: center; padding: 8px 0; }
.quiz-end-title { font-size: 1.05rem; font-weight: 700; color: #2d3748; margin-bottom: 6px; }
.quiz-end-sub { font-size: 0.85rem; color: #718096; margin-bottom: 12px; }
.quiz-restart-btn {
  padding: 9px 24px; border-radius: 10px; font-size: 0.88rem;
  font-weight: 700; cursor: pointer; border: 2px solid #2b6cb0;
  background: white; color: #2b6cb0; transition: all 0.18s;
}
.quiz-restart-btn:hover { background: #ebf4ff; }
body.dark .quiz-end-title { color: #e2e8f0; }
body.dark .quiz-restart-btn { background: #1f2937; color: #90cdf4; border-color: #2b6cb0; }
body.dark .quiz-restart-btn:hover { background: #1e3a5f; }

/* ── Wrong cards banner ─────────────────────────────────────────── */
.wrong-banner {
  width: 100%; background: #fff5f5; border: 1.5px solid #feb2b2;
  border-radius: 12px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.wrong-banner-left { display: flex; align-items: center; gap: 8px; }
.wrong-banner-label { font-size: 0.85rem; font-weight: 700; color: #c53030; }
.wrong-banner-count {
  background: #fed7d7; color: #c53030; border-radius: 999px;
  padding: 2px 9px; font-size: 0.8rem; font-weight: 700;
}
.wrong-banner-actions { display: flex; gap: 7px; flex-shrink: 0; }
.wrong-action-btn {
  padding: 5px 12px; border-radius: 999px; font-size: 0.75rem;
  font-weight: 700; cursor: pointer; transition: all 0.15s; border: 1.5px solid;
}
.wrong-action-btn.practice { border-color: #c53030; color: #c53030; background: white; }
.wrong-action-btn.practice:hover { background: #fff5f5; }
.wrong-action-btn.clear { border-color: #cbd5e0; color: #718096; background: white; }
.wrong-action-btn.clear:hover { border-color: #a0aec0; }
body.dark .wrong-banner { background: #2d1515; border-color: #742a2a; }
body.dark .wrong-banner-label { color: #fc8181; }
body.dark .wrong-banner-count { background: #742a2a; color: #fc8181; }
body.dark .wrong-action-btn.practice { border-color: #fc8181; color: #fc8181; background: #2d1515; }
body.dark .wrong-action-btn.clear { border-color: #374151; color: #718096; background: #1f2937; }

/* Wrong-only indicator */
.wrong-only-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: #fed7d7; color: #c53030; border: 1.5px solid #feb2b2;
}
.wrong-only-chip button {
  background: none; border: none; cursor: pointer;
  color: #c53030; font-size: 0.85rem; padding: 0; line-height: 1; font-weight: 700;
}
body.dark .wrong-only-chip { background: #742a2a; color: #fc8181; border-color: #c53030; }
body.dark .wrong-only-chip button { color: #fc8181; }

/* ── Tutorial ───────────────────────────────────────────────────── */
.tut-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.55);
  transition: opacity 0.25s;
}
.tut-overlay.hidden { display: none; }

.tut-spotlight {
  position: absolute; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
  pointer-events: none;
  z-index: 201;
}

.tut-tooltip {
  position: absolute; z-index: 202;
  background: white; border-radius: 14px;
  padding: 18px 20px 14px; width: min(340px, 88vw);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  animation: tut-pop 0.25s ease;
}
@keyframes tut-pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tut-step-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #90cdf4; margin-bottom: 6px;
}
.tut-title {
  font-size: 1rem; font-weight: 700; color: #2d3748; margin-bottom: 6px;
}
.tut-desc {
  font-size: 0.85rem; color: #4a5568; line-height: 1.5; margin-bottom: 16px;
}
.tut-actions {
  display: flex; align-items: center; justify-content: space-between;
}
.tut-skip {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; color: #a0aec0; font-weight: 600;
  padding: 4px 0; transition: color 0.15s;
}
.tut-skip:hover { color: #718096; }
.tut-next {
  padding: 8px 22px; border-radius: 10px; font-size: 0.85rem;
  font-weight: 700; cursor: pointer; border: none;
  background: #2b6cb0; color: white; transition: background 0.15s;
}
.tut-next:hover { background: #2c5282; }
.tut-dots {
  display: flex; gap: 5px; align-items: center;
}
.tut-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #cbd5e0; transition: background 0.2s;
}
.tut-dot.active { background: #2b6cb0; }

body.dark .tut-tooltip { background: #1f2937; }
body.dark .tut-title { color: #e2e8f0; }
body.dark .tut-desc { color: #a0aec0; }
body.dark .tut-skip { color: #4a5568; }
body.dark .tut-skip:hover { color: #718096; }
body.dark .tut-dot { background: #374151; }
body.dark .tut-dot.active { background: #63b3ed; }

/* ─── App content wrapper ──────────────────────────────────────────────────── */
#app-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Loading Spinner ──────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: #f0f4f8;
  display: flex; align-items: center; justify-content: center;
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #2b6cb0;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.dark .loading-overlay { background: #111827; }
body.dark .loading-spinner { border-color: #374151; border-top-color: #63b3ed; }

/* ─── Auth Overlay ─────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: #f0f4f8;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-modal {
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  padding: 32px 28px 28px;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 0;
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo {
  font-size: 1.8rem; font-weight: 700; color: #2d3748;
  margin-bottom: 4px;
}
.auth-subtitle { font-size: 0.85rem; color: #718096; }

.auth-error {
  font-size: 0.82rem; color: #c53030;
  background: #fff5f5; border: 1px solid #fed7d7;
  border-radius: 8px; padding: 8px 12px;
  margin-bottom: 12px; display: none;
}
.auth-error:not(:empty) { display: block; }

.auth-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 0.95rem; font-family: 'Inter', sans-serif;
  color: #2d3748; background: #f7fafc;
  outline: none; transition: border-color 0.2s;
  margin-bottom: 10px; display: block;
}
.auth-input:focus { border-color: #2b6cb0; background: white; }

.auth-btn-primary {
  width: 100%; padding: 12px;
  background: #2b6cb0; color: white;
  border: none; border-radius: 10px;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
  margin-bottom: 0;
}
.auth-btn-primary:hover { background: #2c5282; }

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0;
  color: #a0aec0; font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}

.auth-btn-google {
  width: 100%; padding: 11px;
  background: white; color: #2d3748;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'Inter', sans-serif;
}
.auth-btn-google:hover { border-color: #a0aec0; background: #f7fafc; }

.auth-switch {
  text-align: center; margin-top: 16px;
  font-size: 0.85rem; color: #718096;
}
.auth-switch a {
  color: #2b6cb0; font-weight: 600; text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-footer {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.auth-footer a {
  font-size: 0.75rem; color: #b0bec5; text-decoration: none; transition: color 0.2s;
}
.auth-footer a:hover { color: #a0aec0; }

body.dark .auth-footer { border-color: #374151; }
body.dark .auth-footer a { color: #374151; }
body.dark .auth-footer a:hover { color: #718096; }

/* ─── Header with logout ───────────────────────────────────────────────────── */
.header-actions {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px;
}
.user-display {
  font-size: 0.75rem; color: #a0aec0;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 480px) {
  .user-display { display: none; }
}
.logout-btn {
  background: none; border: 1px solid #e2e8f0; cursor: pointer;
  font-size: 0.72rem; color: #a0aec0; font-weight: 600;
  padding: 3px 8px; border-radius: 6px; transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.logout-btn:hover { color: #4a5568; border-color: #a0aec0; }

/* Dark mode for auth */
body.dark .auth-overlay { background: #111827; }
body.dark .auth-modal { background: #1f2937; box-shadow: 0 4px 32px rgba(0,0,0,0.4); }
body.dark .auth-logo { color: #e2e8f0; }
body.dark .auth-input { background: #111827; border-color: #374151; color: #e2e8f0; }
body.dark .auth-input:focus { border-color: #63b3ed; background: #1a202c; }
body.dark .auth-btn-google { background: #111827; border-color: #374151; color: #e2e8f0; }
body.dark .auth-btn-google:hover { background: #1a202c; }
body.dark .auth-divider { color: #4a5568; }
body.dark .auth-divider::before, body.dark .auth-divider::after { background: #374151; }
body.dark .logout-btn { border-color: #374151; }
body.dark .logout-btn:hover { color: #a0aec0; border-color: #4a5568; }

/* ─── Legal pages (impressum.html, datenschutz.html) ──────────────────────── */
.legal-page {
  width: 100%; max-width: 640px;
  display: flex; flex-direction: column; gap: 0;
}
.legal-back {
  display: inline-block; margin-bottom: 24px;
  font-size: 0.85rem; color: #718096; text-decoration: none;
  transition: color 0.2s;
}
.legal-back:hover { color: #2d3748; }
.legal-title {
  font-size: 1.6rem; font-weight: 700; color: #2d3748;
  margin-bottom: 6px; text-align: left;
}
.legal-subtitle {
  font-size: 0.82rem; color: #a0aec0; margin-bottom: 32px; text-align: left;
}
.legal-section {
  margin-bottom: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.legal-section h2 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: #4a5568;
}
.legal-section p, .legal-section li {
  font-size: 0.9rem; line-height: 1.7; color: #4a5568;
}
.legal-section ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.legal-section a { color: #2b6cb0; text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }
.legal-date { font-size: 0.78rem; color: #a0aec0; margin-top: 16px; }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.app-footer {
  width: 100%; max-width: 820px;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 32px; padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.footer-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; color: #b0bec5; font-family: 'Inter', sans-serif;
  padding: 2px 0; text-decoration: none; transition: color 0.2s;
}
.footer-btn:hover { color: #a0aec0; }
.bug-btn { font-weight: 500; }
.footer-legal {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
}

body.dark .app-footer { border-color: #2d3748; }
body.dark .footer-btn { color: #374151; }
body.dark .footer-btn:hover { color: #718096; }

/* ─── Profile button (header avatar) ──────────────────────────────────────── */
.profile-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: #2b6cb0; color: white;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.3px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s, filter 0.18s;
  flex-shrink: 0; user-select: none;
}
.profile-btn:hover { transform: scale(1.08); filter: brightness(1.15); }

/* ─── Profile modal internals ──────────────────────────────────────────────── */
.profile-avatar-large {
  width: 60px; height: 60px; border-radius: 50%;
  background: #2b6cb0; color: white;
  font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 4px auto 20px; user-select: none;
}
.profile-name-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #e2e8f0; border-radius: 9px;
  font-size: 0.95rem; font-family: 'Inter', sans-serif;
  color: #2d3748; background: #f7fafc; outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.profile-name-input:focus { border-color: #2b6cb0; background: white; }
.profile-email-display {
  font-size: 0.88rem; color: #718096; word-break: break-all;
  padding: 2px 0;
}
.profile-readonly-hint {
  font-size: 0.72rem; color: #b0bec5; font-weight: 400; margin-left: 4px;
}
.profile-save-msg {
  font-size: 0.82rem; min-height: 18px; margin-top: 6px;
  text-align: center;
}
.profile-divider {
  height: 1px; background: #e2e8f0; margin: 14px 0 10px;
}
.profile-logout-btn {
  width: 100%; padding: 10px;
  background: none; color: #c53030;
  border: 1.5px solid #feb2b2; border-radius: 10px;
  font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: background 0.18s;
  font-family: 'Inter', sans-serif;
}
.profile-logout-btn:hover { background: #fff5f5; }

/* ─── Profile setup email row ──────────────────────────────────────────────── */
.setup-email-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 14px;
  background: #f7fafc; border-radius: 9px;
  border: 1px solid #e2e8f0;
}
.setup-email-text {
  font-size: 0.85rem; color: #4a5568; word-break: break-all;
}

/* Account löschen */
.profile-delete-trigger {
  width: 100%; padding: 7px;
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; color: #b0bec5; font-family: 'Inter', sans-serif;
  margin-top: 6px; transition: color 0.18s;
  text-decoration: underline; text-underline-offset: 2px;
}
.profile-delete-trigger:hover { color: #c53030; }

.delete-confirm-section {
  margin-top: 12px; padding: 14px;
  background: #fff5f5; border: 1.5px solid #feb2b2; border-radius: 12px;
  display: flex; flex-direction: column; gap: 10px;
  animation: modal-in 0.15s ease;
}
.delete-confirm-warning {
  font-size: 0.82rem; color: #742a2a; line-height: 1.5;
}
.delete-confirm-label {
  font-size: 0.82rem; color: #c53030; font-weight: 500;
}
.delete-confirm-error {
  font-size: 0.78rem; color: #c53030; min-height: 16px;
}
.delete-confirm-actions {
  display: flex; gap: 8px;
}
.delete-cancel-btn {
  flex: 1; padding: 8px; border-radius: 8px;
  background: white; border: 1.5px solid #e2e8f0;
  font-size: 0.82rem; font-weight: 600; color: #718096;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: border-color 0.15s;
}
.delete-cancel-btn:hover { border-color: #a0aec0; }
.delete-confirm-btn {
  flex: 1; padding: 8px; border-radius: 8px;
  background: #c53030; border: none;
  font-size: 0.82rem; font-weight: 700; color: white;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: background 0.15s;
}
.delete-confirm-btn:hover { background: #9b2c2c; }
.delete-confirm-btn:disabled { background: #feb2b2; cursor: default; }

/* Dark mode — profile */
body.dark .profile-name-input { background: #111827; border-color: #374151; color: #e2e8f0; }
body.dark .profile-name-input:focus { border-color: #63b3ed; background: #1a202c; }
body.dark .profile-email-display { color: #718096; }
body.dark .profile-readonly-hint { color: #4a5568; }
body.dark .profile-divider { background: #374151; }
body.dark .profile-logout-btn { border-color: #742a2a; color: #fc8181; }
body.dark .profile-logout-btn:hover { background: #2d1515; }
body.dark .setup-email-row { background: #111827; border-color: #374151; }
body.dark .setup-email-text { color: #a0aec0; }

/* ─── Username input ─────────────────────────────────────────────────────────── */
.username-input-wrap {
  position: relative; display: flex; align-items: center;
  width: 100%; margin-bottom: 4px;
}
.username-at {
  position: absolute; left: 14px;
  font-size: 0.95rem; font-weight: 600; color: #718096;
  pointer-events: none; z-index: 1; line-height: 1;
}
.username-input-wrap .username-input {
  padding-left: 30px;
  margin-bottom: 0;
}
.username-status {
  font-size: 0.78rem; min-height: 18px;
  margin-bottom: 10px; padding: 0 2px;
  color: #718096;
}
.username-status.valid   { color: #276749; }
.username-status.invalid { color: #c53030; }
.username-status.checking { color: #718096; }

.username-req-desc {
  font-size: 0.85rem; color: #4a5568; line-height: 1.5;
  margin-bottom: 14px; text-align: center;
}
body.dark .username-req-desc { color: #a0aec0; }
body.dark .username-at { color: #6b7280; }
body.dark .username-status.valid   { color: #68d391; }
body.dark .username-status.invalid { color: #fc8181; }

/* ─── Search button (header) ───────────────────────────────────────────────── */
.search-btn {
  background: none; border: 1px solid #e2e8f0; cursor: pointer;
  color: #a0aec0; padding: 4px 7px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.search-btn:hover { color: #2b6cb0; border-color: #2b6cb0; background: #ebf4ff; }
body.dark .search-btn { border-color: #374151; color: #6b7280; }
body.dark .search-btn:hover { color: #90cdf4; border-color: #4a6fa5; background: #1e3a5f; }

/* ─── Search Overlay ───────────────────────────────────────────────────────── */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 250;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px) saturate(1.4);
  -webkit-backdrop-filter: blur(6px) saturate(1.4);
  padding: 72px 16px 24px;
  align-items: flex-start; justify-content: center;
}
.search-overlay.open {
  display: flex;
  animation: search-fade-in 0.15s ease;
}
@keyframes search-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.search-box {
  width: min(640px, 100%);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 96px);
  animation: search-box-in 0.18s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes search-box-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f7;
  flex-shrink: 0;
}
.search-icon-svg { color: #a0aec0; flex-shrink: 0; }
.search-input {
  flex: 1; border: none; outline: none;
  font-size: 1.05rem; font-family: 'Inter', sans-serif;
  color: #1a202c; background: transparent; min-width: 0;
}
.search-input::placeholder { color: #b0bec5; }
.search-clear {
  background: none; border: none; cursor: pointer;
  color: #a0aec0; padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.search-clear:hover { color: #4a5568; background: #edf2f7; }
.search-kbd {
  font-size: 0.68rem; color: #b0bec5; background: #f7fafc;
  border: 1px solid #e2e8f0; border-radius: 5px;
  padding: 2px 7px; white-space: nowrap; flex-shrink: 0;
  font-family: 'Inter', sans-serif; font-weight: 600;
}

.search-status {
  padding: 7px 18px;
  font-size: 0.75rem; color: #a0aec0; font-weight: 600;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #edf2f7;
  display: none; flex-shrink: 0;
}
.search-status.visible { display: block; }

.search-results { overflow-y: auto; flex: 1; }

.search-prompt {
  padding: 28px 20px;
  text-align: center;
  font-size: 0.88rem; color: #a0aec0; line-height: 1.6;
}
.search-prompt strong { color: #718096; }
.search-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 0.9rem; color: #a0aec0;
}
.search-loading {
  padding: 28px 20px;
  text-align: center;
  font-size: 0.88rem; color: #a0aec0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.search-spinner {
  width: 18px; height: 18px;
  border: 2px solid #e2e8f0; border-top-color: #4f7df0;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* Result items */
.search-result-item {
  padding: 13px 18px;
  border-bottom: 1px solid #f7fafc;
  cursor: pointer;
  transition: background 0.1s;
  display: flex; flex-direction: column; gap: 5px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f7fafc; }
.search-result-item:active { background: #edf2f7; }

.sri-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sri-location {
  font-size: 0.7rem; font-weight: 700; color: #b0bec5;
  text-transform: uppercase; letter-spacing: 0.7px;
}
.sri-type-badge {
  font-size: 0.68rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  color: white; white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.2px;
}
.sri-arabic {
  font-size: 1.45rem; direction: rtl; text-align: right;
  color: #1a365d; line-height: 1.65;
  font-family: 'Noto Naskh Arabic', serif;
}
.sri-sub {
  font-size: 1rem; direction: rtl; text-align: right;
  color: #4a6fa5; line-height: 1.5;
  font-family: 'Noto Naskh Arabic', serif;
}
.sri-german {
  font-size: 0.88rem; color: #4a5568; font-weight: 500;
}
.search-result-item mark {
  background: #fef9c3; color: inherit;
  border-radius: 2px; padding: 0 1px;
}

/* Arabic font overrides for search */
body.arabic-amiri .sri-arabic,
body.arabic-amiri .sri-sub { font-family: 'Amiri', serif; }
body.arabic-cairo .sri-arabic,
body.arabic-cairo .sri-sub { font-family: 'Cairo', sans-serif; }

/* Dark mode */
body.dark .search-box {
  background: #1e2736;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
}
body.dark .search-input-wrap { border-bottom-color: #2d3748; }
body.dark .search-input { color: #e2e8f0; }
body.dark .search-input::placeholder { color: #4a5568; }
body.dark .search-icon-svg { color: #4a5568; }
body.dark .search-clear { color: #4a5568; }
body.dark .search-clear:hover { color: #a0aec0; background: #2d3748; }
body.dark .search-kbd { background: #111827; border-color: #2d3748; color: #4a5568; }
body.dark .search-status { border-bottom-color: #2d3748; color: #4a5568; }
body.dark .search-prompt { color: #4a5568; }
body.dark .search-prompt strong { color: #718096; }
body.dark .search-empty { color: #4a5568; }
body.dark .search-loading { color: #4a5568; }
body.dark .search-spinner { border-color: #2d3748; border-top-color: #4f7df0; }
body.dark .search-result-item { border-bottom-color: #1a2030; }
body.dark .search-result-item:hover { background: #232f42; }
body.dark .search-result-item:active { background: #2a3a52; }
body.dark .sri-location { color: #4a5568; }
body.dark .sri-arabic { color: #bee3f8; }
body.dark .sri-sub { color: #76b3e8; }
body.dark .sri-german { color: #a0aec0; }
body.dark .search-result-item mark { background: #44370a; color: #fde68a; }

@media (max-width: 480px) {
  .search-overlay { padding: 52px 10px 16px; }
  .search-box { border-radius: 16px; }
  .search-input-wrap { padding: 13px 14px; }
  .search-kbd { display: none; }
  .search-result-item { padding: 11px 14px; }
  .sri-arabic { font-size: 1.25rem; }
}

/* (book-tab-custom removed — replaced by sidebar-sep + bottom-tab-sep) */

/* ── Meine Sammlung: Tab switcher ────────────────────────────────────────────── */
.custom-view-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.custom-view-tab {
  flex: 1; padding: 9px 14px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; background: none;
  font-size: 0.85rem; font-weight: 600; color: #718096;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.custom-view-tab.active { background: #4f7df0; border-color: #4f7df0; color: #fff; }
.custom-view-tab:hover:not(.active) { border-color: #4f7df0; color: #4f7df0; }
body.dark .custom-view-tab { border-color: #374151; color: #6b7280; }
body.dark .custom-view-tab.active { background: #4f7df0; border-color: #4f7df0; color: #fff; }

/* ── Community search row ────────────────────────────────────────────────────── */
.community-search-row {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.community-search-input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; background: #f7fafc;
  font-size: 0.88rem; font-family: 'Inter', sans-serif; color: #2d3748;
  outline: none; transition: border-color 0.15s;
}
.community-search-input:focus { border-color: #4f7df0; background: #fff; }
.community-reload-btn {
  padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; background: none;
  font-size: 1rem; cursor: pointer; color: #718096;
  transition: border-color 0.15s, color 0.15s;
}
.community-reload-btn:hover { border-color: #4f7df0; color: #4f7df0; }
.community-loading {
  text-align: center; padding: 24px; color: #718096; font-size: 0.88rem;
}
body.dark .community-search-input { background: #111827; border-color: #374151; color: #e2e8f0; }
body.dark .community-search-input:focus { border-color: #63b3ed; background: #1a202c; }
body.dark .community-reload-btn { border-color: #374151; color: #6b7280; }

/* ── Community set card extras ────────────────────────────────────────────────── */
.community-stack-author {
  font-size: 0.75rem; color: #718096; margin-bottom: 4px;
}
body.dark .community-stack-author { color: #6b7280; }

.custom-stack-modified {
  font-size: 0.72rem; color: #a0aec0; margin-top: 2px; margin-bottom: 2px;
}
body.dark .custom-stack-modified { color: #6b7280; }

.stack-published-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  background: #ebf8ff; color: #2b6cb0; border-radius: 6px;
  padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}
body.dark .stack-published-badge { background: #1a2a3a; color: #63b3ed; }

.stack-needs-sync-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  background: #fffbeb; color: #b45309; border-radius: 6px;
  padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}
body.dark .stack-needs-sync-badge { background: #1c1a0f; color: #fcd34d; }

/* ── Source-deleted state ────────────────────────────────────────────────────── */
.custom-stack-card.source-deleted {
  opacity: 0.55; pointer-events: auto;
}
.source-deleted-msg {
  font-size: 0.78rem; color: #c53030; margin-top: 6px; font-weight: 500;
}
body.dark .source-deleted-msg { color: #fc8181; }
.source-deleted-remove-btn {
  margin-top: 8px; padding: 5px 12px; border-radius: 8px;
  border: 1.5px solid #fc8181; background: none; color: #c53030;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.source-deleted-remove-btn:hover { background: #fff5f5; }
body.dark .source-deleted-remove-btn { border-color: #c53030; color: #fc8181; }
body.dark .source-deleted-remove-btn:hover { background: #2d1212; }

.stack-publish-btn {
  padding: 6px 12px; border-radius: 8px;
  border: 1.5px solid #e2e8f0; background: none;
  font-size: 0.78rem; font-weight: 600; color: #4f7df0;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s; white-space: nowrap;
}
.stack-publish-btn:hover { background: #ebf4ff; border-color: #4f7df0; }
.stack-publish-btn.published { color: #276749; border-color: #9ae6b4; background: #f0fff4; }
.stack-publish-btn.needs-sync { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.stack-publish-btn.needs-sync:hover { background: #fef3c7; border-color: #b45309; }
body.dark .stack-publish-btn { border-color: #374151; color: #60a5fa; }
body.dark .stack-publish-btn.published { color: #68d391; border-color: #276749; background: #0d2414; }
body.dark .stack-publish-btn.needs-sync { color: #fcd34d; border-color: #854d0e; background: #1c1a0f; }
body.dark .stack-publish-btn.needs-sync:hover { background: #2d2208; }

/* ── Stack detail author line ────────────────────────────────────────────────── */
.stack-detail-author {
  font-size: 0.75rem; color: #718096; margin-top: 2px;
}
body.dark .stack-detail-author { color: #6b7280; }

.stack-detail-description-wrap {
  margin: 0 0 18px 0;
  padding: 12px 14px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  max-width: 820px;
}
body.dark .stack-detail-description-wrap {
  background: #1a202c; border-color: #2d3748;
}
.stack-detail-description {
  font-size: 0.9rem; color: #4a5568;
  line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.stack-detail-description.expanded {
  -webkit-line-clamp: unset; display: block; overflow: visible;
}
body.dark .stack-detail-description { color: #cbd5e0; }
.stack-detail-description-toggle {
  background: none; border: none; padding: 4px 0; margin-top: 6px;
  font: inherit; font-size: 0.82rem; font-weight: 600;
  color: #4f7df0; cursor: pointer;
}
.stack-detail-description-toggle:hover { text-decoration: underline; }
body.dark .stack-detail-description-toggle { color: #60a5fa; }

.discover-card-description {
  font-size: 0.82rem; color: #718096; margin-top: 6px;
  line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; word-wrap: break-word;
}
body.dark .discover-card-description { color: #9ca3af; }

/* ── Publish modal ────────────────────────────────────────────────────────────── */
.publish-info-text {
  font-size: 0.85rem; color: #4a5568; line-height: 1.5; margin-bottom: 14px;
}
.publish-disclaimer {
  background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px;
}
.publish-disclaimer-label {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.83rem; color: #92400e; line-height: 1.5; cursor: pointer;
}
.publish-disclaimer-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
body.dark .publish-info-text { color: #a0aec0; }
body.dark .publish-disclaimer { background: #1c1a0f; border-color: #854d0e; }
body.dark .publish-disclaimer-label { color: #fcd34d; }

/* ── Custom Stacks: Stacks overview ─────────────────────────────────────────── */
#custom-stacks-view {
  width: 100%; max-width: 820px;
  margin-bottom: 40px;
}
.custom-stacks-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.custom-section-title {
  font-size: 1.1rem; font-weight: 700; color: #2d3748;
}
body.dark .custom-section-title { color: #e2e8f0; }

.custom-create-btn {
  padding: 8px 18px; border-radius: 20px;
  background: #4f7df0; color: #fff;
  font-size: 0.82rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.custom-create-btn:hover { background: #3b6de0; }

.custom-stacks-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.custom-import-btn {
  padding: 8px 16px; border-radius: 20px;
  background: transparent; color: #4f7df0;
  font-size: 0.82rem; font-weight: 700;
  border: 1.5px solid #4f7df0; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s, color 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.custom-import-btn:hover { background: #4f7df0; color: #fff; }
body.dark .custom-import-btn { color: #8aa9f0; border-color: #8aa9f0; }
body.dark .custom-import-btn:hover { background: #8aa9f0; color: #0f1420; }
.custom-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.custom-import-btn-large {
  padding: 10px 22px; border-radius: 20px;
  background: transparent; color: #4f7df0;
  font-size: 0.9rem; font-weight: 700;
  border: 1.5px solid #4f7df0; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s, color 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.custom-import-btn-large:hover { background: #4f7df0; color: #fff; }
body.dark .custom-import-btn-large { color: #8aa9f0; border-color: #8aa9f0; }
body.dark .custom-import-btn-large:hover { background: #8aa9f0; color: #0f1420; }

/* ── Import-Modal ────────────────────────────────────────────────────────── */
.modal-wide { max-width: 520px; }
.import-hint {
  font-size: 0.82rem; color: #64748b; line-height: 1.5;
  padding: 10px 12px; background: #f1f5f9; border-radius: 10px;
  margin-bottom: 14px;
}
body.dark .import-hint { background: #1a2233; color: #94a3b8; }
.import-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: #475569; margin-bottom: 6px;
}
body.dark .import-label { color: #cbd5e1; }
.import-file { padding: 8px 12px; }
.import-row { margin-top: 12px; }
.import-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.import-chip {
  padding: 6px 14px; border-radius: 16px;
  background: #f1f5f9; color: #475569;
  font-size: 0.82rem; font-weight: 600;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s, color 0.15s;
}
.import-chip.active { background: #4f7df0; color: #fff; }
.import-chip:hover:not(.active) { background: #e2e8f0; }
body.dark .import-chip { background: #1e293b; color: #94a3b8; }
body.dark .import-chip.active { background: #4f7df0; color: #fff; }
body.dark .import-chip:hover:not(.active) { background: #2a3648; }
.import-mapping-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.import-preview {
  margin-top: 14px; padding: 10px 12px;
  background: #f8fafc; border-radius: 10px;
  font-size: 0.82rem; color: #475569; line-height: 1.5;
}
body.dark .import-preview { background: #0f1628; color: #94a3b8; }
.import-preview-count { font-weight: 700; color: #2d3748; }
body.dark .import-preview-count { color: #e2e8f0; }
.import-preview-sample {
  margin-top: 8px; font-size: 0.78rem;
  max-height: 120px; overflow-y: auto;
  border-top: 1px solid #e2e8f0; padding-top: 8px;
}
body.dark .import-preview-sample { border-top-color: #2a3648; }
.import-preview-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 3px 0;
}
.import-preview-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.custom-stacks-empty {
  text-align: center; padding: 48px 24px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
body.dark .custom-stacks-empty { background: #1e2533; }
.custom-empty-icon { font-size: 2.8rem; margin-bottom: 12px; color: #94a3b8; }
.custom-empty-icon i { font-size: 2.4rem; }
.custom-empty-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: #2d3748; }
body.dark .custom-empty-title { color: #e2e8f0; }
.custom-empty-desc { font-size: 0.85rem; color: #718096; margin-bottom: 22px; line-height: 1.6; }
body.dark .custom-empty-desc { color: #9ca3af; }
.custom-create-btn-large {
  padding: 10px 24px; border-radius: 20px;
  background: #4f7df0; color: #fff;
  font-size: 0.9rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.custom-create-btn-large:hover { background: #3b6de0; }

.custom-stacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.custom-loading {
  text-align: center; color: #a0aec0; font-size: 0.88rem; padding: 24px 0;
}
.custom-stack-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  padding: 18px 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.15s;
}
.custom-stack-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.12); }
body.dark .custom-stack-card { background: #1e2533; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.custom-stack-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.custom-stack-name {
  font-size: 0.95rem; font-weight: 700; color: #2d3748; word-break: break-word;
}
body.dark .custom-stack-name { color: #e2e8f0; }
.custom-stack-delete-btn {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: #cbd5e0; font-size: 0.85rem; padding: 0 2px;
  transition: color 0.15s;
}
.custom-stack-delete-btn:hover { color: #e53e3e; }
body.dark .custom-stack-delete-btn { color: #4b5563; }
body.dark .custom-stack-delete-btn:hover { color: #fc8181; }
.custom-stack-count {
  font-size: 0.78rem; color: #a0aec0;
}
body.dark .custom-stack-count { color: #6b7280; }
.custom-stack-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: auto; padding-top: 4px;
}

.community-own-badge {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  color: #2b6cb0; background: #ebf8ff;
  border-radius: 8px; padding: 0 12px;
  height: 36px; white-space: nowrap;
}
body.dark .community-own-badge { background: #1a2a3a; color: #63b3ed; }
.custom-stack-edit-btn,
.custom-stack-learn-btn {
  flex: 1; padding: 7px 0; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600;
  border: 1.5px solid #e2e8f0; background: none;
  cursor: pointer; font-family: 'Inter', sans-serif;
  color: #4a5568; transition: all 0.15s;
}
.custom-stack-edit-btn:hover { border-color: #4f7df0; color: #4f7df0; background: rgba(79,125,240,0.06); }
.custom-stack-learn-btn { background: #4f7df0; border-color: #4f7df0; color: #fff; }
.custom-stack-learn-btn:hover:not(:disabled) { background: #3b6de0; border-color: #3b6de0; }
.custom-stack-learn-btn.disabled,
.custom-stack-learn-btn:disabled { opacity: 0.4; cursor: not-allowed; }
body.dark .custom-stack-edit-btn { border-color: #374151; color: #9ca3af; }
body.dark .custom-stack-edit-btn:hover { border-color: #60a5fa; color: #60a5fa; background: rgba(96,165,250,0.08); }
body.dark .custom-stack-learn-btn { background: #4f7df0; border-color: #4f7df0; color: #fff; }

/* ── Custom Stacks: Stack detail ─────────────────────────────────────────────── */
#stack-detail-view {
  width: 100%; max-width: 820px; margin-bottom: 40px;
}
.stack-detail-header {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.stack-detail-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding-top: 2px; flex-wrap: wrap;
}

@media (max-width: 640px) {
  .stack-detail-header {
    gap: 8px;
  }
  .stack-back-btn { flex: 0 0 auto; }
  .stack-detail-info { flex: 1 1 100%; order: 2; min-width: 0; }
  .stack-detail-actions {
    order: 3; width: 100%; padding-top: 0;
    justify-content: stretch; gap: 6px;
  }
  .stack-detail-actions > button {
    flex: 1 1 0; min-width: 0;
    padding-left: 8px; padding-right: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
}
.stack-rename-btn {
  background: none; border: 1.5px solid #e2e8f0; border-radius: 8px;
  cursor: pointer; font-size: 0.9rem; padding: 6px 9px;
  color: #718096; transition: all 0.15s;
}
.stack-rename-btn:hover { border-color: #4f7df0; color: #4f7df0; background: rgba(79,125,240,0.06); }
body.dark .stack-rename-btn { border-color: #374151; color: #6b7280; }
body.dark .stack-rename-btn:hover { border-color: #60a5fa; color: #60a5fa; background: rgba(96,165,250,0.08); }
.stack-back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: #718096;
  padding: 6px 0; font-family: 'Inter', sans-serif;
  transition: color 0.15s; white-space: nowrap;
}
.stack-back-btn:hover { color: #4f7df0; }
body.dark .stack-back-btn { color: #9ca3af; }
body.dark .stack-back-btn:hover { color: #60a5fa; }
.stack-detail-info { flex: 1; min-width: 0; }
.stack-detail-name {
  font-size: 1rem; font-weight: 700; color: #2d3748;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.dark .stack-detail-name { color: #e2e8f0; }
.stack-detail-count { font-size: 0.78rem; color: #a0aec0; }
.stack-learn-btn {
  padding: 8px 18px; border-radius: 20px;
  background: #4f7df0; color: #fff;
  font-size: 0.82rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s; white-space: nowrap;
}
.stack-learn-btn:hover:not(:disabled) { background: #3b6de0; }
.stack-learn-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.stack-add-form {
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  padding: 18px 16px; margin-bottom: 16px;
}
body.dark .stack-add-form { background: #1e2533; }
.stack-add-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: #a0aec0; margin-bottom: 10px;
}
.stack-add-inputs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.stack-input {
  flex: 1; min-width: 120px;
  padding: 9px 12px; border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.88rem; font-family: 'Inter', sans-serif;
  background: #f7fafc; color: #1a202c;
  outline: none; transition: border-color 0.15s;
}
.stack-input:focus { border-color: #4f7df0; background: #fff; }
body.dark .stack-input {
  background: #111827; border-color: #374151; color: #e2e8f0;
}
body.dark .stack-input:focus { border-color: #60a5fa; background: #1a2234; }
.stack-sub-toggles {
  display: flex; gap: 8px; margin-top: 8px;
}
.stack-sub-toggle {
  padding: 5px 14px; border-radius: 20px;
  border: 1.5px solid #e2e8f0; background: none;
  font-size: 0.78rem; font-weight: 600; color: #718096;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.stack-sub-toggle:hover { border-color: #4f7df0; color: #4f7df0; }
.stack-sub-toggle.active { background: #eef2ff; border-color: #4f7df0; color: #4f7df0; }
body.dark .stack-sub-toggle { border-color: #374151; color: #6b7280; }
body.dark .stack-sub-toggle:hover { border-color: #60a5fa; color: #60a5fa; }
body.dark .stack-sub-toggle.active { background: #1e2d4a; border-color: #60a5fa; color: #60a5fa; }

.stack-sub-row {
  display: flex; align-items: center; gap: 0;
  margin-top: 8px;
}
.stack-sub-prefix {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1rem; color: #2d3748; padding: 9px 8px 9px 12px;
  background: #f0f4f8; border: 1.5px solid #e2e8f0;
  border-right: none; border-radius: 8px 0 0 8px;
  white-space: nowrap; direction: rtl;
  min-width: 28px; text-align: center;
}
body.dark .stack-sub-prefix { background: #111827; border-color: #374151; color: #e2e8f0; }
.stack-sub-row .stack-input {
  border-radius: 0 8px 8px 0; flex: 1;
}

.stack-add-error {
  font-size: 0.78rem; color: #e53e3e; min-height: 16px; margin-top: 6px;
}
.stack-add-btn {
  margin-top: 10px; width: 100%;
  padding: 9px; border-radius: 8px;
  background: #4f7df0; color: #fff;
  font-size: 0.88rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.stack-add-btn:hover { background: #3b6de0; }

.stack-cards-list { display: flex; flex-direction: column; gap: 8px; }
.stack-empty-hint {
  text-align: center; color: #a0aec0; font-size: 0.85rem; padding: 32px 0;
}
.stack-card-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
body.dark .stack-card-row { background: #1e2533; }
.stack-card-content {
  flex: 1; display: flex; align-items: flex-start;
  gap: 16px; min-width: 0;
}
.stack-card-german {
  flex: 1 1 0; min-width: 0;
  font-size: 0.92rem; color: #4a5568; line-height: 1.45;
  overflow-wrap: anywhere; word-break: break-word;
}
body.dark .stack-card-german { color: #cbd5e0; }
.stack-card-arabic-wrap {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-end;
}
.stack-card-arabic {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.15rem; color: #2d3748; direction: rtl;
  line-height: 1.7; text-align: right;
  overflow-wrap: anywhere; word-break: break-word;
  max-width: 100%;
}
body.dark .stack-card-arabic { color: #e2e8f0; }
.stack-card-sub {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 0.88rem; color: #718096; direction: rtl;
  line-height: 1.6; text-align: right;
  overflow-wrap: anywhere; word-break: break-word;
  max-width: 100%; margin-top: 2px;
}
body.dark .stack-card-sub { color: #6b7280; }
.stack-card-btns {
  display: flex; gap: 2px; flex-shrink: 0;
}
.stack-card-edit,
.stack-card-delete {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 4px 6px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  color: #cbd5e0;
}
.stack-card-edit:hover { color: #4f7df0; background: rgba(79,125,240,0.08); }
.stack-card-delete:hover { color: #e53e3e; background: rgba(229,62,62,0.08); }
body.dark .stack-card-edit,
body.dark .stack-card-delete { color: #4b5563; }
body.dark .stack-card-edit:hover { color: #60a5fa; background: rgba(96,165,250,0.08); }
body.dark .stack-card-delete:hover { color: #fc8181; background: rgba(252,129,129,0.08); }

.stack-card-row.editing { flex-direction: column; align-items: stretch; gap: 8px; }
.stack-card-edit-form {
  display: flex; flex-direction: column; gap: 6px;
}
.stack-card-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.stack-card-save-btn {
  padding: 6px 18px; border-radius: 8px;
  background: #4f7df0; color: #fff;
  font-size: 0.85rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.stack-card-save-btn:hover { background: #3b6de0; }
.stack-card-cancel-btn {
  padding: 6px 14px; border-radius: 8px;
  background: none; color: #718096;
  font-size: 0.85rem; font-weight: 600;
  border: 1.5px solid #e2e8f0; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.stack-card-cancel-btn:hover { border-color: #a0aec0; color: #4a5568; }
body.dark .stack-card-cancel-btn { border-color: #374151; color: #6b7280; }
body.dark .stack-card-cancel-btn:hover { border-color: #6b7280; color: #9ca3af; }

/* ── Custom Stacks: Learn back-bar ───────────────────────────────────────────── */
.custom-learn-bar {
  width: 100%; max-width: 820px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.custom-learn-back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: #718096;
  padding: 4px 0; font-family: 'Inter', sans-serif;
  transition: color 0.15s;
}
.custom-learn-back-btn:hover { color: #4f7df0; }
body.dark .custom-learn-back-btn { color: #9ca3af; }
body.dark .custom-learn-back-btn:hover { color: #60a5fa; }
.custom-learn-stack-name {
  font-size: 0.88rem; font-weight: 700; color: #2d3748;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.dark .custom-learn-stack-name { color: #e2e8f0; }

@media (max-width: 500px) {
  .custom-stacks-grid { grid-template-columns: 1fr; }
  .stack-add-inputs { flex-direction: column; }
}

/* ─── Desktop: bigger card and fonts ────────────────────────────────────── */
@media (min-width: 700px) {
  .card-scene { height: 380px; }
  .card-face  { padding: 40px 48px; gap: 16px; }

  .arabic-main { font-size: 3.2rem; }
  .arabic-sub  { font-size: 1.45rem; }
  .german-main { font-size: 1.8rem; }
  .german-sub  { font-size: 1.05rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW DESIGN SYSTEM — Home, View routing, Modern navigation
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Sidebar: flex-based tabs with icons ───────────────────────────────── */
.sidebar-tab {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-tab-icon {
  font-size: 0.95rem; line-height: 1; flex-shrink: 0;
  width: 18px; text-align: center;
}
.sidebar-tab-icon i { font-size: 0.95rem; }
.sidebar-tab-sub {
  font-size: 0.83rem; padding-left: 28px;
  color: #64748b;
}
body.dark .sidebar-tab-sub { color: #94a3b8; }

/* Streak pill in sidebar (above footer) */
.sidebar-streak {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 10px 10px; padding: 8px 12px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa; border-radius: 10px;
  font-weight: 700; color: #9a3412;
}
.sidebar-streak .streak-flame { font-size: 1.05rem; }
.streak-flame i          { color: #f97316; }
.home-streak-flame i     { color: #f97316; }

/* Stats hero icon colors */
.stats-streak   .stats-hero-icon i { color: #f97316; }
.stats-learned  .stats-hero-icon i { color: #22c55e; }
.stats-wrong    .stats-hero-icon i { color: #ef4444; }
.stats-accuracy .stats-hero-icon i { color: #6366f1; }

/* Profile mini stat icon colors */
.profile-mini-label .fa-fire         { color: #f97316; }
.profile-mini-label .fa-circle-check { color: #22c55e; }
.profile-mini-label .fa-circle-xmark { color: #ef4444; }

/* Warning & status icons */
.delete-confirm-warning i { color: #d97706; }
.source-deleted-msg i     { color: inherit; }

/* Hadith label icons */
.hadith-label .fa-lightbulb { color: #eab308; }
.hadith-label .fa-mosque    { color: #10b981; }
.sidebar-streak .streak-count { font-size: 0.95rem; letter-spacing: 0.3px; }
body.dark .sidebar-streak {
  background: linear-gradient(135deg, #2a1a0e, #3a2010);
  border-color: #7c2d12; color: #fdba74;
}

/* Streak pill in mobile topbar */
.topbar-streak {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa; color: #9a3412;
  font-size: 0.82rem; font-weight: 700;
}
.topbar-streak .streak-flame { font-size: 0.9rem; }
body.dark .topbar-streak {
  background: linear-gradient(135deg, #2a1a0e, #3a2010);
  border-color: #7c2d12; color: #fdba74;
}

/* ─── View container generic ────────────────────────────────────────────── */
.view-container { width: 100%; display: flex; flex-direction: column; align-items: center; }

.view-placeholder {
  width: 100%; max-width: 820px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 60px 24px;
}
.view-placeholder-icon { font-size: 3rem; margin-bottom: 16px; }
.view-placeholder-title { font-size: 1.5rem; font-weight: 700; color: #1a202c; margin-bottom: 8px; }
.view-placeholder-desc { font-size: 0.95rem; color: #718096; margin-bottom: 24px; max-width: 420px; }
body.dark .view-placeholder-title { color: #f1f5f9; }
body.dark .view-placeholder-desc { color: #94a3b8; }

/* ─── Home view ─────────────────────────────────────────────────────────── */
#home-view { width: 100%; max-width: 1040px; gap: 24px; }

/* Hero: greeting + streak */
.home-hero {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 4px 0 8px;
}
.home-greeting-label { font-size: 1.6rem; font-weight: 700; color: #1a202c; letter-spacing: -0.4px; }
.home-greeting-sub { font-size: 0.9rem; color: #718096; margin-top: 2px; }
body.dark .home-greeting-label { color: #f1f5f9; }
body.dark .home-greeting-sub { color: #94a3b8; }

.home-streak-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: 16px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
}
.home-streak-flame { font-size: 1.8rem; line-height: 1; }
.home-streak-num { font-size: 1.6rem; font-weight: 800; color: #9a3412; line-height: 1; }
.home-streak-label { font-size: 0.7rem; font-weight: 700; color: #c2410c; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
body.dark .home-streak-card {
  background: linear-gradient(135deg, #2a1a0e, #3a2010);
  border-color: #7c2d12;
}
body.dark .home-streak-num { color: #fdba74; }
body.dark .home-streak-label { color: #fb923c; }

/* Stats grid: 3 small cards */
.home-stats-grid {
  width: 100%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.home-stat {
  background: white; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 18px 16px; text-align: center;
}
.home-stat-num { font-size: 1.8rem; font-weight: 800; color: #1a202c; line-height: 1.1; }
.home-stat-label { font-size: 0.75rem; font-weight: 600; color: #718096; margin-top: 6px; }
body.dark .home-stat { background: #1e293b; border-color: #334155; }
body.dark .home-stat-num { color: #f1f5f9; }
body.dark .home-stat-label { color: #94a3b8; }

/* Daily Hadith card */
.home-hadith {
  width: 100%;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #86efac; border-radius: 16px;
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.hadith-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: #047857;
}
.hadith-arabic {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.4rem; direction: rtl; text-align: right;
  color: #064e3b; line-height: 1.9;
}
.hadith-german {
  font-size: 0.98rem; font-style: italic; color: #1f2937;
  line-height: 1.55;
}
.hadith-source {
  font-size: 0.78rem; color: #6b7280; font-weight: 600;
  align-self: flex-end;
}
body.dark .home-hadith {
  background: linear-gradient(135deg, #052e26, #064e36);
  border-color: #065f46;
}
body.dark .hadith-label   { color: #6ee7b7; }
body.dark .hadith-arabic  { color: #d1fae5; }
body.dark .hadith-german  { color: #e2e8f0; }
body.dark .hadith-source  { color: #94a3b8; }

/* Section header inside home */
.home-section-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.home-section-title {
  font-size: 1.1rem; font-weight: 700; color: #1a202c; letter-spacing: -0.2px;
}
body.dark .home-section-title { color: #f1f5f9; }

/* Sets grid */
.home-sets-grid {
  width: 100%;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.home-set-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 20px 18px; border-radius: 16px;
  border: 1px solid transparent; cursor: pointer;
  font-family: 'Inter', sans-serif; text-align: left;
  transition: transform 0.15s, box-shadow 0.2s;
}
.home-set-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.home-set-icon  { font-size: 1.6rem; line-height: 1; margin-bottom: 4px; }
.home-set-title { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.home-set-sub   { font-size: 0.78rem; opacity: 0.75; font-weight: 500; }
.home-set-progress { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.home-set-progress-bar { height: 6px; background: rgba(0,0,0,0.08); border-radius: 999px; overflow: hidden; }
.home-set-progress-fill { display: block; height: 100%; background: currentColor; opacity: 0.7; border-radius: 999px; transition: width 0.3s ease; }
.home-set-progress-label { font-size: 0.72rem; opacity: 0.75; font-weight: 600; }
body.dark .home-set-progress-bar { background: rgba(255,255,255,0.12); }

/* ── Review (Wiederholen) ───────────────────────────────────────── */
.home-cta-secondary {
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border, #e5e7eb);
  background: transparent; color: var(--fg, #111); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: background 0.15s ease;
}
.home-cta-secondary:hover { background: rgba(0,0,0,0.04); }
body.dark .home-cta-secondary { border-color: #2a2a2a; color: #f3f4f6; }
body.dark .home-cta-secondary:hover { background: rgba(255,255,255,0.06); }

#review-view { padding: 16px; max-width: 820px; margin: 0 auto; }
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.review-back-btn {
  background: transparent; border: none; font-size: 1rem; cursor: pointer;
  color: var(--fg, #111); padding: 6px 10px; border-radius: 8px;
}
.review-back-btn:hover { background: rgba(0,0,0,0.05); }
body.dark .review-back-btn { color: #f3f4f6; }
body.dark .review-back-btn:hover { background: rgba(255,255,255,0.08); }
.review-title { font-size: 1.3rem; font-weight: 700; margin: 0; }

.review-book-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.review-book-chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border, #e5e7eb);
  background: transparent; font-weight: 600; font-size: 0.85rem; cursor: pointer;
  color: var(--fg, #111);
}
.review-book-chip.active { background: #111; color: #fff; border-color: #111; }
body.dark .review-book-chip { border-color: #2a2a2a; color: #f3f4f6; }
body.dark .review-book-chip.active { background: #f3f4f6; color: #111; border-color: #f3f4f6; }

.review-status-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.review-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid transparent;
  background: rgba(0,0,0,0.04); color: var(--fg, #111);
  font-weight: 600; font-size: 0.85rem; cursor: pointer; opacity: 0.55;
  transition: all 0.15s ease;
}
.review-chip.active { opacity: 1; }
.review-chip .chip-dot { width: 10px; height: 10px; border-radius: 50%; }
.review-chip.chip-red    .chip-dot { background: #ef4444; }
.review-chip.chip-yellow .chip-dot { background: #f59e0b; }
.review-chip.chip-green  .chip-dot { background: #22c55e; }
.review-chip.chip-red.active    { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.review-chip.chip-yellow.active { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.review-chip.chip-green.active  { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.review-chip .chip-count { opacity: 0.7; font-weight: 500; }
body.dark .review-chip { background: rgba(255,255,255,0.06); color: #f3f4f6; }
body.dark .review-chip.chip-red.active    { background: #2a0f0f; border-color: #5f1f1f; color: #fecaca; }
body.dark .review-chip.chip-yellow.active { background: #2a1f0a; border-color: #5f4a1f; color: #fde68a; }
body.dark .review-chip.chip-green.active  { background: #0f2a1a; border-color: #1f5f3a; color: #bbf7d0; }

.review-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px;
  max-height: calc(100vh - 360px); overflow-y: auto;
  border-radius: 12px;
}
.review-item {
  display: grid; grid-template-columns: 16px 1fr 1fr; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px; background: rgba(0,0,0,0.03);
}
body.dark .review-item { background: rgba(255,255,255,0.04); }
.review-dot { width: 10px; height: 10px; border-radius: 50%; }
.review-dot.dot-wrong   { background: #ef4444; }
.review-dot.dot-open    { background: #f59e0b; }
.review-dot.dot-correct { background: #22c55e; }
.review-arabic { font-family: 'Amiri', serif; font-size: 1.1rem; direction: rtl; text-align: right; }
.review-german { font-size: 0.9rem; opacity: 0.85; }
.review-empty { padding: 20px; text-align: center; opacity: 0.6; font-size: 0.9rem; }

.review-actions { display: flex; justify-content: center; padding-bottom: 24px; }
.review-actions .home-cta-primary:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 520px) {
  .review-item { grid-template-columns: 12px 1fr; }
  .review-item .review-german { grid-column: 2; font-size: 0.82rem; }
}

/* ── Stats ──────────────────────────────────────────────────────── */
.stats-wrap { padding: 16px; max-width: 820px; margin: 0 auto; }
.stats-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 16px; }

.stats-hero-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px;
}
@media (min-width: 700px) { .stats-hero-grid { grid-template-columns: repeat(4, 1fr); } }
.stats-hero-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border-radius: 14px; background: rgba(0,0,0,0.04);
}
body.dark .stats-hero-card { background: rgba(255,255,255,0.05); }
.stats-hero-icon { font-size: 1.6rem; display: flex; align-items: center; justify-content: center; }
.stats-hero-icon i { font-size: 1.4rem; }
.stats-hero-num { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.stats-hero-label { font-size: 0.78rem; opacity: 0.7; font-weight: 500; }

.stats-section-title {
  font-size: 1rem; font-weight: 700; margin: 20px 0 12px;
  text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7;
}

.stats-books { display: flex; flex-direction: column; gap: 12px; }
.stats-book-row {
  padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,0.03);
}
body.dark .stats-book-row { background: rgba(255,255,255,0.04); }
.stats-book-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.stats-book-label { font-weight: 600; font-size: 0.95rem; }
.stats-book-pct { font-weight: 700; font-size: 1rem; }
.stats-book-bar {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(0,0,0,0.08);
}
body.dark .stats-book-bar { background: rgba(255,255,255,0.08); }
.stats-book-bar .seg { display: block; height: 100%; }
.seg-green  { background: #22c55e; }
.seg-red    { background: #ef4444; }
.seg-yellow { background: #f59e0b; }
.stats-book-legend {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px;
  font-size: 0.78rem; opacity: 0.8;
}
.stats-book-legend .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.dot-green  { background: #22c55e; }
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }

.stats-lessons { display: flex; flex-direction: column; gap: 6px; }
.stats-lesson-row {
  display: grid; grid-template-columns: 44px 1fr 48px 80px; gap: 10px;
  align-items: center; padding: 8px 12px; border-radius: 10px;
  background: rgba(0,0,0,0.03); font-size: 0.85rem;
}
body.dark .stats-lesson-row { background: rgba(255,255,255,0.04); }
.stats-lesson-num { font-weight: 700; }
.stats-lesson-bar {
  height: 8px; border-radius: 999px; background: rgba(0,0,0,0.08); overflow: hidden;
}
body.dark .stats-lesson-bar { background: rgba(255,255,255,0.08); }
.stats-lesson-bar .seg { display: block; height: 100%; }
.stats-lesson-acc { font-weight: 600; text-align: right; }
.stats-lesson-ago { opacity: 0.65; font-size: 0.78rem; text-align: right; }

.stats-empty { padding: 20px; text-align: center; opacity: 0.6; font-size: 0.9rem; }

@media (max-width: 520px) {
  .stats-lesson-row { grid-template-columns: 36px 1fr 44px; }
  .stats-lesson-ago { display: none; }
}

/* ── Discover (Entdecken) ───────────────────────────────────────── */
.discover-wrap { padding: 16px; max-width: 1100px; margin: 0 auto; }
.discover-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.discover-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.discover-refresh-btn {
  background: transparent; border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 1rem;
}
.discover-refresh-btn:hover { background: rgba(0,0,0,0.05); }
body.dark .discover-refresh-btn { border-color: #2a2a2a; color: #f3f4f6; }
body.dark .discover-refresh-btn:hover { background: rgba(255,255,255,0.08); }
.discover-sub { font-size: 0.88rem; opacity: 0.7; margin: 0 0 14px; }

.discover-search { margin-bottom: 16px; }
.discover-search input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb); font-size: 0.9rem;
  background: transparent; color: var(--fg, #111);
}
body.dark .discover-search input { border-color: #2a2a2a; color: #f3f4f6; }

.discover-loading, .discover-empty {
  padding: 40px 20px; text-align: center; opacity: 0.6; font-size: 0.9rem;
}

.discover-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 600px) { .discover-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .discover-grid { grid-template-columns: repeat(3, 1fr); } }

.discover-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border-radius: 14px;
  background: rgba(0,0,0,0.03); border: 1px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
body.dark .discover-card { background: rgba(255,255,255,0.04); }
.discover-card:hover { border-color: rgba(0,0,0,0.1); transform: translateY(-1px); }
body.dark .discover-card:hover { border-color: rgba(255,255,255,0.12); }

.discover-card-head { display: flex; justify-content: space-between; align-items: center; }
.discover-card-icon { font-size: 1.4rem; }
.discover-card-count {
  font-size: 0.75rem; font-weight: 600; opacity: 0.7;
  padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,0.06);
}
body.dark .discover-card-count { background: rgba(255,255,255,0.08); }
.discover-card-name { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.discover-card-author { font-size: 0.8rem; opacity: 0.7; }

.discover-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.discover-view-btn, .discover-add-btn {
  flex: 1; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: 1px solid transparent;
}
.discover-view-btn { background: transparent; border-color: var(--border, #e5e7eb); color: var(--fg, #111); }
.discover-view-btn:hover { background: rgba(0,0,0,0.04); }
.discover-add-btn { background: #111; color: #fff; }
.discover-add-btn:hover { background: #000; }
.discover-add-btn.added { background: #22c55e; opacity: 0.7; cursor: default; }
body.dark .discover-view-btn { border-color: #2a2a2a; color: #f3f4f6; }
body.dark .discover-view-btn:hover { background: rgba(255,255,255,0.08); }
body.dark .discover-add-btn { background: #f3f4f6; color: #111; }
body.dark .discover-add-btn:hover { background: #fff; }

.discover-admin-delete-btn {
  flex: 0 0 auto; padding: 8px 10px; border-radius: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: 1px solid #fecaca;
  background: #fff1f2; color: #b91c1c; display: inline-flex; align-items: center; gap: 6px;
}
.discover-admin-delete-btn:hover { background: #fee2e2; border-color: #fca5a5; }
body.dark .discover-admin-delete-btn {
  background: rgba(185, 28, 28, 0.15); color: #fca5a5; border-color: rgba(252, 165, 165, 0.3);
}
body.dark .discover-admin-delete-btn:hover { background: rgba(185, 28, 28, 0.25); border-color: rgba(252, 165, 165, 0.5); }

.discover-admin-ban-btn {
  flex: 0 0 auto; padding: 8px 10px; border-radius: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: 1px solid #fed7aa;
  background: #fff7ed; color: #c2410c; display: inline-flex; align-items: center; gap: 6px;
}
.discover-admin-ban-btn:hover { background: #ffedd5; border-color: #fdba74; }
body.dark .discover-admin-ban-btn {
  background: rgba(194, 65, 12, 0.15); color: #fdba74; border-color: rgba(253, 186, 116, 0.3);
}
body.dark .discover-admin-ban-btn:hover { background: rgba(194, 65, 12, 0.25); border-color: rgba(253, 186, 116, 0.5); }

.discover-own-badge {
  flex: 1; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem;
  font-weight: 600; text-align: center; background: rgba(0,0,0,0.05); opacity: 0.7;
}
body.dark .discover-own-badge { background: rgba(255,255,255,0.08); }

/* ── Profile View ───────────────────────────────────────────────── */
.profile-wrap { padding: 16px; max-width: 720px; margin: 0 auto; }
.profile-top {
  display: flex; align-items: center; gap: 16px; padding: 18px;
  border-radius: 16px; background: rgba(0,0,0,0.04); margin-bottom: 16px;
}
body.dark .profile-top { background: rgba(255,255,255,0.05); }
.profile-avatar-xl {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.profile-top-name { font-size: 1.2rem; font-weight: 700; }
.profile-top-username { font-size: 0.88rem; color: #4a9eff; font-weight: 500; margin-top: 1px; }
body.dark .profile-top-username { color: #5aabff; }
.profile-top-email { font-size: 0.85rem; opacity: 0.7; }

.profile-mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px;
}
.profile-mini-stat {
  padding: 14px 12px; border-radius: 12px; text-align: center;
  background: rgba(0,0,0,0.04);
}
body.dark .profile-mini-stat { background: rgba(255,255,255,0.05); }
.profile-mini-num { font-size: 1.3rem; font-weight: 700; }
.profile-mini-label { font-size: 0.75rem; opacity: 0.7; margin-top: 2px; }

.profile-section { margin-bottom: 24px; }
.profile-section-title {
  font-size: 0.8rem; font-weight: 700; margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.6;
}
.profile-row-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border, #e5e7eb);
  background: transparent; color: var(--fg, #111); font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
}
.profile-row-btn:hover { background: rgba(0,0,0,0.04); }
.profile-row-chev { opacity: 0.5; font-size: 1.2rem; }
body.dark .profile-row-btn { border-color: #2a2a2a; color: #f3f4f6; }
body.dark .profile-row-btn:hover { background: rgba(255,255,255,0.06); }

.profile-section-danger { border-top: 1px solid rgba(0,0,0,0.08); padding-top: 20px; }
body.dark .profile-section-danger { border-top-color: rgba(255,255,255,0.08); }
.profile-section-danger .profile-logout-btn,
.profile-section-danger .profile-delete-trigger { width: 100%; margin-bottom: 8px; }

.home-set-card.set-blue   { background: #dbeafe; color: #1e3a8a; }
.home-set-card.set-green  { background: #dcfce7; color: #14532d; }
.home-set-card.set-purple { background: #ede9fe; color: #4c1d95; }
.home-set-card.set-orange { background: #ffedd5; color: #7c2d12; }
.home-set-card.set-teal   { background: #ccfbf1; color: #134e4a; }
body.dark .home-set-card.set-blue   { background: #172554; color: #bfdbfe; }
body.dark .home-set-card.set-green  { background: #052e16; color: #bbf7d0; }
body.dark .home-set-card.set-purple { background: #2e1065; color: #ddd6fe; }
body.dark .home-set-card.set-orange { background: #2a1a0e; color: #fed7aa; }
body.dark .home-set-card.set-teal   { background: #042f2e; color: #99f6e4; }

/* CTA row */
.home-cta-row { width: 100%; display: flex; justify-content: center; margin-top: 4px; margin-bottom: 20px; }
.home-cta-primary {
  padding: 14px 28px; border-radius: 12px;
  background: #4f7df0; color: white; border: none;
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, transform 0.1s;
}
.home-cta-primary:hover  { background: #3b65d4; }
.home-cta-primary:active { transform: scale(0.97); }

/* Desktop: more columns for sets + more generous spacing */
@media (min-width: 700px) {
  #home-view { gap: 28px; padding-top: 8px; }
  .home-sets-grid { grid-template-columns: repeat(4, 1fr); }
  .home-greeting-label { font-size: 2rem; }
  .home-stats-grid { gap: 16px; }
  .home-stat { padding: 24px 18px; }
  .home-stat-num { font-size: 2.2rem; }
  .hadith-arabic { font-size: 1.6rem; }
}

/* Mobile: stack hero vertically, ensure nothing overflows */
@media (max-width: 520px) {
  .home-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .home-streak-card { align-self: stretch; justify-content: center; }
  .home-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .home-stat { padding: 12px 8px; }
  .home-stat-num { font-size: 1.4rem; }
  .home-stat-label { font-size: 0.68rem; }
  .home-sets-grid { grid-template-columns: repeat(2, 1fr); }
  .hadith-arabic { font-size: 1.2rem; }
}


/* ═══════════════════════════════════════════════════════════════
   Phase 7 — Lernen/Quiz Visual Refresh
   Überschreibt bestehende Regeln mit modernerem, ruhigerem Look.
   ═══════════════════════════════════════════════════════════════ */

.card-area { gap: 14px; }

/* Progress bar — schlanker, mit Gradient */
.progress-bar-wrap {
  height: 8px; background: rgba(0,0,0,0.06); border-radius: 999px;
}
.progress-bar-fill {
  height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1);
}
.progress-label {
  font-size: 0.78rem; color: #64748b; font-weight: 600;
  letter-spacing: 0.02em;
}
body.dark .progress-bar-wrap { background: rgba(255,255,255,0.08); }
body.dark .progress-label    { color: #94a3b8; }

/* Flashcard — softer, more premium */
.card-scene {
  height: 320px; border-radius: 22px;
}
.card-face {
  border-radius: 22px; padding: 32px 36px; gap: 14px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.04), 0 12px 32px rgba(15,23,42,0.08);
  border: 1px solid rgba(15,23,42,0.05);
}
.card-front {
  background: #ffffff;
}
.card-back {
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
}
body.dark .card-face {
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.35);
}
body.dark .card-front { background: #1e293b; }
body.dark .card-back  { background: linear-gradient(145deg, #1e293b 0%, #312e5a 100%); }

.card-label {
  font-size: 0.66rem; letter-spacing: 1.6px; color: #94a3b8;
}
.card-front .card-label, .card-back .card-label { color: #94a3b8; }
body.dark .card-label { color: #64748b; }

.arabic-main { color: #0f172a; line-height: 1.7; }
.arabic-sub  { color: #475569; }
.german-main { color: #0f172a; font-weight: 700; letter-spacing: -0.01em; }
.german-sub  { color: #475569; }
body.dark .arabic-main, body.dark .german-main { color: #f1f5f9; }
body.dark .arabic-sub, body.dark .german-sub   { color: #cbd5e1; }

.type-badge {
  background: #e0e7ff; color: #4338ca; padding: 3px 12px;
  font-size: 0.68rem; letter-spacing: 0.4px;
}
body.dark .type-badge { background: #312e5a; color: #a5b4fc; }

.lesson-badge {
  top: 16px; right: 20px; color: #94a3b8; font-size: 0.68rem;
  background: rgba(0,0,0,0.04); padding: 3px 9px; border-radius: 999px;
}
body.dark .lesson-badge { background: rgba(255,255,255,0.06); color: #64748b; }

.arabic-note {
  background: rgba(0,0,0,0.04); color: #475569; border-radius: 8px;
  padding: 4px 12px;
}
body.dark .arabic-note { background: rgba(255,255,255,0.06); color: #cbd5e1; }

/* Mode toggle — sleeker segmented control */
.mode-toggle-row {
  background: rgba(0,0,0,0.05); border-radius: 14px; padding: 4px;
}
.mode-btn {
  padding: 9px 18px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.2px; color: #64748b;
}
.mode-btn.active {
  background: #ffffff; color: #0f172a;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 2px 8px rgba(15,23,42,0.04);
}
body.dark .mode-toggle-row { background: rgba(255,255,255,0.06); }
body.dark .mode-btn { color: #94a3b8; }
body.dark .mode-btn.active { background: #0f172a; color: #f1f5f9; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* Direction + shuffle — flache Chips */
.dir-row { gap: 8px; flex-wrap: wrap; }
.dir-btn, .shuffle-btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  background: rgba(0,0,0,0.04); color: #334155;
  font-weight: 600; font-size: 0.82rem; letter-spacing: 0.2px;
  transition: all 0.15s ease;
}
.dir-btn:hover, .shuffle-btn:hover { background: rgba(0,0,0,0.07); border-color: transparent; color: #0f172a; }
.dir-btn.de-ar {
  background: #dcfce7; border-color: transparent; color: #166534;
}
.dir-btn.ar-de {
  background: #ffedd5; border-color: transparent; color: #9a3412;
}
.shuffle-btn.active {
  background: #ede9fe; border-color: transparent; color: #6d28d9;
}
body.dark .dir-btn, body.dark .shuffle-btn { background: rgba(255,255,255,0.06); color: #cbd5e1; }
body.dark .dir-btn:hover, body.dark .shuffle-btn:hover { background: rgba(255,255,255,0.1); color: #f1f5f9; }
body.dark .dir-btn.de-ar { background: #052e16; color: #bbf7d0; }
body.dark .dir-btn.ar-de { background: #2a1a0e; color: #fed7aa; }
body.dark .shuffle-btn.active { background: #2e1065; color: #ddd6fe; }

/* Nav (prev/next/flip) */
.nav-btn {
  background: #0f172a; color: #fff;
  padding: 11px 22px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 1px 3px rgba(15,23,42,0.15);
}
.nav-btn:hover { background: #1e293b; }
.nav-btn:disabled { background: rgba(0,0,0,0.1); color: rgba(0,0,0,0.3); box-shadow: none; }
.flip-btn {
  border: 1.5px solid rgba(15,23,42,0.15); background: #fff; color: #0f172a;
  padding: 11px 22px; border-radius: 12px; font-weight: 600;
}
.flip-btn:hover { background: rgba(15,23,42,0.04); border-color: rgba(15,23,42,0.25); }
body.dark .nav-btn { background: #f1f5f9; color: #0f172a; }
body.dark .nav-btn:hover { background: #fff; }
body.dark .nav-btn:disabled { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.3); }
body.dark .flip-btn { background: transparent; color: #f1f5f9; border-color: rgba(255,255,255,0.15); }
body.dark .flip-btn:hover { background: rgba(255,255,255,0.06); }

/* Quiz Show-Card-Button */
.quiz-show-btn {
  border: 1.5px solid rgba(15,23,42,0.15); background: #fff; color: #0f172a;
  padding: 13px 44px; border-radius: 14px; font-weight: 600; font-size: 0.95rem;
}
.quiz-show-btn:hover { background: rgba(15,23,42,0.04); border-color: rgba(15,23,42,0.25); }
body.dark .quiz-show-btn { background: transparent; color: #f1f5f9; border-color: rgba(255,255,255,0.15); }
body.dark .quiz-show-btn:hover { background: rgba(255,255,255,0.06); }

/* Quiz Eval-Buttons — modernisiert */
.quiz-eval-row { gap: 10px; }
.quiz-btn {
  padding: 14px 18px; border-radius: 14px; font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.quiz-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.quiz-btn-correct { background: #22c55e; }
.quiz-btn-correct:hover { background: #16a34a; }
.quiz-btn-wrong { background: #ef4444; }
.quiz-btn-wrong:hover { background: #dc2626; }

/* Quiz end */
.quiz-end-title { font-size: 1.1rem; color: #0f172a; font-weight: 700; }
.quiz-end-sub   { color: #64748b; }
.quiz-restart-btn {
  border: 1.5px solid rgba(15,23,42,0.15); background: #fff; color: #0f172a;
  padding: 10px 26px; border-radius: 12px; font-weight: 600;
}
.quiz-restart-btn:hover { background: rgba(15,23,42,0.04); }
body.dark .quiz-restart-btn { background: transparent; color: #f1f5f9; border-color: rgba(255,255,255,0.15); }
body.dark .quiz-restart-btn:hover { background: rgba(255,255,255,0.06); }
body.dark .quiz-end-title { color: #f1f5f9; }
body.dark .quiz-end-sub   { color: #94a3b8; }

/* Wrong banner — ruhigerer Look */
.wrong-banner {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 14px;
}
.wrong-banner-label { color: #991b1b; }
.wrong-banner-count { background: #fecaca; color: #991b1b; }
.wrong-action-btn { border-width: 1px; font-weight: 600; }
.wrong-action-btn.practice { border-color: #fca5a5; color: #991b1b; background: transparent; }
.wrong-action-btn.practice:hover { background: #fee2e2; }
.wrong-action-btn.clear { border-color: rgba(15,23,42,0.15); color: #64748b; background: transparent; }
.wrong-action-btn.clear:hover { background: rgba(15,23,42,0.04); }
body.dark .wrong-banner { background: rgba(127,29,29,0.15); border-color: #7f1d1d; }

/* Card-area mobile padding */
@media (max-width: 520px) {
  .card-scene { height: 280px; }
  .card-face  { padding: 24px 20px; }
  .arabic-main { font-size: 2.2rem; }
  .german-main { font-size: 1.3rem; }
  .quiz-btn    { padding: 13px 14px; font-size: 0.92rem; }
}

/* ─── Einheitliche, breitere Bücher-View ────────────────────────
   app-main ist flex-column mit align-items:center → Kinder ohne explizite Breite
   schrumpfen. Jetzt alle Hauptspalten auf stretch + margin:auto zentriert. */
html, body { overflow-x: hidden; }
#app-content { align-items: stretch; min-width: 0; }
.app-main { box-sizing: border-box; align-items: stretch; min-width: 0; width: calc(100% - 210px) !important; margin-left: 210px !important; padding-left: 24px !important; padding-right: 24px !important; }
@media (max-width: 768px) {
  .app-main { width: 100% !important; margin-left: 0 !important; padding-left: 16px !important; padding-right: 16px !important; }
}
@media (max-width: 900px) { .app-main { padding-left: 16px; padding-right: 16px; } }
.app-main > * { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
#books-view, .view-container { align-items: stretch; }
#books-view > .filter-panel,
#books-view > .card-area,
#books-view > .vocab-list,
#books-view > .custom-learn-bar,
#books-view > .wrong-banner {
  width: 100%;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.filter-body { position: static; box-shadow: none; background: transparent; }
body.dark .filter-body { background: transparent; }
