/* ==========================================================================
   KWS MASTERY - Design System
   Dunkles, technisches SaaS-Dashboard nach den Referenzbildern.
   ========================================================================== */

:root {
  --bg: #0b1120;
  --bg-elevated: #111827;
  --surface: #161f33;
  --surface-2: #1c2740;
  --surface-hover: #223052;
  --border: #263049;
  --border-light: #2f3c5c;

  --text: #e7ecf7;
  --text-muted: #94a3c0;
  --text-dim: #64749a;

  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.15);

  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-soft: rgba(249, 115, 22, 0.15);

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.15);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);

  --sidebar-width: 264px;
  --topbar-height: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
input, button, select, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

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

/* Sichere SVG-Grundgroesse: verhindert riesige Icons ueberall dort, wo kein
   spezifischerer Selektor eine Groesse festlegt (Spezifitaet gewinnt trotzdem). */
svg { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon { display: inline-flex; align-items: center; justify-content: center; }
.mini-card-title svg, .feedback-title svg { width: 16px; height: 16px; }

/* ---------- App Shell ---------- */
#app-root {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 22px; height: 22px; }
.sidebar-brand-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.sidebar-brand-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin: 16px 10px 8px;
}
.sidebar-section-label:first-child { margin-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-light);
  border-color: rgba(59,130,246,0.3);
}
.nav-item-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

.main-col {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text-dim);
  font-size: 13.5px;
}
.topbar-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer;
}
.topbar-icon-btn svg { width: 17px; height: 17px; }
.topbar-icon-btn:hover { color: var(--text); background: var(--surface-hover); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.topbar-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.topbar-user-name { font-size: 13.5px; font-weight: 600; }
.topbar-user-sub { font-size: 11px; color: var(--text-muted); }

.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
}

.view-container {
  flex: 1;
  padding: 28px 32px 60px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Cards & generic components ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-sm { padding: 16px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.link-more { font-size: 12.5px; color: var(--accent-light); font-weight: 600; cursor: pointer; }
.link-more:hover { text-decoration: underline; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.dash-main-grid { grid-template-columns: 1.6fr 1fr; }
.skills-layout-grid { grid-template-columns: 230px 1fr; align-items: start; gap: 22px; }
.skills-cat-nav { position: sticky; top: 80px; }
.skills-count { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
.skill-detail-grid { grid-template-columns: 1fr 320px; align-items: start; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.hstack { display: flex; gap: 12px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 11px; cursor: pointer;
  font-weight: 700; font-size: 14px; padding: 12px 20px;
  transition: transform 0.1s, filter 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-light); }
.btn-danger { background: var(--red-soft); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 15.5px; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Badges / status pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  letter-spacing: 0.01em;
}
.badge-neu { background: var(--surface-2); color: var(--text-muted); }
.badge-lernen { background: var(--accent-soft); color: var(--accent-light); }
.badge-unsicher { background: var(--amber-soft); color: var(--amber); }
.badge-sicher { background: var(--green-soft); color: #4ade80; }
.badge-gemeistert { background: var(--green-soft); color: #34d399; }
.badge-reflex { background: var(--purple-soft); color: #c084fc; }

/* Progress bars */
.progress-track {
  height: 8px; border-radius: 20px; background: var(--surface-2);
  overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.4s ease;
}
.progress-fill.green { background: linear-gradient(90deg, #16a34a, var(--green)); }
.progress-fill.amber { background: linear-gradient(90deg, #d97706, var(--amber)); }
.progress-fill.red { background: linear-gradient(90deg, #b91c1c, var(--red)); }
.progress-track.lg { height: 12px; }

/* Hero panel (Dashboard) */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #101a30 0%, #0d1524 55%, #142035 100%);
  border: 1px solid var(--border);
  padding: 32px 34px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(600px 260px at 85% 20%, rgba(59,130,246,0.16), transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 560px; z-index: 1; }
.hero-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.hero-title .accent-text { color: var(--accent-light); }
.hero-desc { color: var(--text-muted); font-size: 14.5px; margin-top: 10px; max-width: 460px; }
.hero-tags { display: flex; gap: 18px; margin-top: 20px; flex-wrap: wrap; }
.hero-tag { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); }
.hero-tag svg { width: 15px; height: 15px; color: var(--accent-light); }
.hero-side { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; min-width: 200px; }
.hero-quote { font-size: 13px; color: var(--text-muted); text-align: right; font-style: italic; max-width: 220px; border-right: 2px solid var(--accent); padding-right: 14px; }

.hero-photo {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 34%;
  width: auto; height: 100%;
  object-fit: cover;
  object-position: center 58%;
}
/* Verlauf auf BEIDEN Seiten dunkel, damit weder der Text links noch das Zitat
   rechts vom Foto ueberlagert wird - nur ein schmales Fenster in der Mitte
   zeigt das Foto klar sichtbar. */
.hero-photo-fade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    #0d1524 0%,
    #0d1524 27%,
    rgba(13,21,36,0.6) 38%,
    rgba(13,21,36,0.05) 50%,
    rgba(13,21,36,0.05) 68%,
    rgba(13,21,36,0.72) 80%,
    #0d1524 94%,
    #0d1524 100%);
}

/* Kraftwerk-Foto-Banner (zweites Referenzbild) */
.plant-banner {
  position: relative;
  height: 168px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.plant-banner-img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; display: block; }
.plant-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,17,32,0.92) 0%, rgba(11,17,32,0.6) 32%, rgba(11,17,32,0.1) 62%, transparent 88%);
  display: flex; align-items: center;
  padding: 0 32px;
}
.plant-banner-kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-light); font-weight: 700; margin-bottom: 6px; }
.plant-banner-quote { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.01em; max-width: 420px; }

/* Stat tiles */
.stat-tile {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; cursor: default;
}
.stat-tile-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-tile-icon svg { width: 21px; height: 21px; }
.stat-tile-value { font-size: 21px; font-weight: 800; line-height: 1.1; }
.stat-tile-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-tile-arrow { margin-left: auto; color: var(--text-dim); }

.icon-blue { background: rgba(59,130,246,0.15); color: var(--accent-light); }
.icon-orange { background: var(--orange-soft); color: var(--orange); }
.icon-green { background: var(--green-soft); color: var(--green); }
.icon-red { background: var(--red-soft); color: #f87171; }
.icon-amber { background: var(--amber-soft); color: var(--amber); }
.icon-purple { background: var(--purple-soft); color: var(--purple); }

/* Skill progress rows */
.skill-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.skill-row-name { width: 130px; flex-shrink: 0; font-size: 13.5px; font-weight: 600; }
.skill-row-track { flex: 1; }
.skill-row-pct { width: 44px; text-align: right; font-size: 13px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.skill-row:hover { cursor: pointer; }
.skill-row:hover .skill-row-name { color: var(--accent-light); }

/* Small info card variants (weakest skill, rule box) */
.mini-card {
  border-radius: var(--radius); padding: 18px; border: 1px solid var(--border);
}
.mini-card-red { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.25); }
.mini-card-blue { background: rgba(59,130,246,0.07); border-color: rgba(59,130,246,0.25); }
.mini-card-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 12px; }
.mini-card-title.red { color: #fca5a5; }
.mini-card-title.blue { color: #93c5fd; }

/* SI ladder widget */
.si-ladder { display: flex; flex-direction: column; gap: 4px; }
.si-row {
  display: grid; grid-template-columns: 26px 1fr 54px;
  align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 8px; font-size: 13px;
}
.si-row .sym { font-weight: 800; color: var(--text); }
.si-row .name { color: var(--text-muted); }
.si-row .exp { color: var(--text-dim); text-align: right; font-family: var(--font-mono); font-size: 12px; }
.si-row.current { background: var(--accent-soft); border: 1px solid rgba(59,130,246,0.35); }
.si-row.current .sym, .si-row.current .name { color: var(--accent-light); }

/* Heatmap (Lernaktivitaet) */
.heatmap { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.heatmap-cell { width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heatmap-legend { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-dim); margin-top: 8px; justify-content: flex-end; }
.heatmap-legend .heatmap-cell { width: 11px; height: 11px; }

/* ---------- Lernmodus / Flashcard ---------- */
.learn-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb .sep { color: var(--text-dim); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

.session-progress-bar { margin: 6px 0 22px; }
.session-progress-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }

.task-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 30px 32px;
}
.task-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-light);
  font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 18px;
}
.task-question { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; }
.task-question .op { color: var(--text-dim); margin: 0 10px; }
.task-question .target { color: var(--accent-light); }
.task-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.answer-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.answer-input {
  flex: 1; background: var(--bg-elevated); border: 1.5px solid var(--border-light);
  border-radius: 12px; padding: 16px 18px; font-size: 20px; color: var(--text);
  font-weight: 600;
}
.answer-input:focus { border-color: var(--accent); }
.answer-input::placeholder { color: var(--text-dim); font-weight: 400; }
.answer-unit { font-size: 18px; font-weight: 700; color: var(--text-muted); min-width: 60px; }

.task-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.task-actions .btn { flex: 1; min-width: 130px; }

.feedback-panel { border-radius: var(--radius); padding: 20px 22px; margin-top: 18px; border: 1px solid; }
.feedback-panel.correct { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.35); }
.feedback-panel.wrong { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.35); }
.feedback-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.feedback-title.correct { color: #4ade80; }
.feedback-title.wrong { color: #f87171; }
.feedback-detail { font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.feedback-visual { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.feedback-box { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 15px; }
.feedback-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.feedback-arrow svg { width: 26px; height: 14px; color: var(--accent-light); }
.feedback-explain { font-size: 13.5px; color: var(--text-muted); background: var(--bg-elevated); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.feedback-errortype { display: inline-flex; align-items:center; gap:6px; font-size: 11.5px; font-weight: 700; color: #fca5a5; background: rgba(239,68,68,0.12); padding: 3px 10px; border-radius: 20px; margin-top: 10px; }
.retype-row { margin-top: 16px; }
.retype-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }

.hint-panel {
  margin-top: 16px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; font-size: 13.5px; color: var(--text-muted);
}
.hint-panel strong { color: var(--text); }

/* Grundwissen- & Erklärungs-Panels */
.explain-panel {
  margin-top: 16px; background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 18px 20px; font-size: 13.5px; color: var(--text);
}
.explain-panel-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-light); margin-bottom: 12px;
}
.explain-panel-title svg { width: 15px; height: 15px; }
.explain-panel p { margin: 0 0 10px; color: var(--text-muted); line-height: 1.55; }
.explain-panel p:last-child { margin-bottom: 0; }
.explain-visual-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.explain-visual-box { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: 13px; }
.explain-visual-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--orange); font-weight: 800; font-size: 11px; }
.explain-visual-arrow svg { width: 26px; height: 12px; }
.explain-base-rows { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
.explain-example {
  background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); border-radius: 8px;
  padding: 10px 14px; font-family: var(--font-mono); font-size: 13px; margin-top: 12px; color: var(--text);
}
.explain-mistake {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); border-radius: 8px;
  padding: 10px 14px; font-size: 12.5px; color: #fcd34d; margin-top: 10px;
  display: flex; gap: 8px; align-items: flex-start;
}
.explain-mistake svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.explain-mnemonic {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 12.5px; color: var(--accent-light);
}
.explain-mnemonic svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.explain-after-wrong {
  margin-top: 12px; display: flex; align-items: center; gap: 8px; cursor: pointer;
  color: var(--accent-light); font-weight: 700; font-size: 13px;
}
.explain-after-wrong svg { width: 15px; height: 15px; }

/* Merksbox */
.mnemonic-box { border: 1px solid rgba(59,130,246,0.3); background: rgba(59,130,246,0.06); border-radius: var(--radius); overflow: hidden; }
.mnemonic-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; font-weight: 700; font-size: 13.5px; color: var(--accent-light); cursor: pointer; border-bottom: 1px solid rgba(59,130,246,0.2); }
.mnemonic-head svg { width: 16px; height: 16px; }
.mnemonic-head .chev { margin-left: auto; transition: transform 0.2s; }
.mnemonic-box.collapsed .mnemonic-head { border-bottom-color: transparent; }
.mnemonic-box.collapsed .chev { transform: rotate(-90deg); }
.mnemonic-body { padding: 16px 18px 20px; }
.mnemonic-box.collapsed .mnemonic-body { display: none; }
.mnemonic-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 5px; margin-top: 14px; }
.mnemonic-label:first-child { margin-top: 0; }
.mnemonic-rule-pill { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 8px; padding: 9px 12px; font-weight: 700; font-size: 14px; }
.mnemonic-visual { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.mnemonic-visual .vbox { background: var(--surface-2); border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: 14px; text-align: center; flex: 1; }
.mnemonic-visual .vbox.to { background: var(--green-soft); color: #4ade80; }
.mnemonic-visual .varrow { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 800; color: var(--orange); gap: 2px; }
.mnemonic-visual .varrow svg { width: 30px; height: 12px; }
.mnemonic-text { font-size: 13px; color: var(--text-muted); }
.mnemonic-example { font-size: 13px; color: var(--text); font-family: var(--font-mono); }
.mnemonic-brain { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(59,130,246,0.2); font-size: 12.5px; color: var(--accent-light); }
.mnemonic-brain svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.personal-note {
  border: 1px solid rgba(245,158,11,0.35); background: rgba(245,158,11,0.08);
  border-radius: var(--radius); padding: 14px 16px; font-size: 13px; color: #fcd34d;
  display: flex; gap: 10px; align-items: flex-start;
}
.personal-note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.personal-note b { color: #fde68a; }

/* Reference tables (SI-Vorsaetze / Umrechnungstabelle) */
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-table th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; padding: 6px 8px; }
.ref-table td { padding: 7px 8px; border-top: 1px solid var(--border); }
.ref-table tr.highlight td { background: rgba(59,130,246,0.08); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 12.5px; }

/* Skills list / grid */
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: border-color 0.15s, transform 0.1s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.skill-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.skill-card-title { font-size: 15px; font-weight: 700; }
.skill-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.skill-card-stats { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }

.category-tab {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
}
.category-tab:hover { background: var(--surface); color: var(--text); }
.category-tab.active { background: var(--surface); color: var(--text); }
.category-tab .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.category-tab .pct { margin-left: auto; font-size: 12px; color: var(--text-dim); }

/* Onboarding modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3,6,15,0.72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 32px; max-width: 480px; width: 100%; box-shadow: var(--shadow);
}
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.modal-input {
  width: 100%; background: var(--bg-elevated); border: 1.5px solid var(--border-light);
  border-radius: 10px; padding: 13px 15px; font-size: 15px; color: var(--text); margin-bottom: 18px;
}
.modal-actions { display: flex; gap: 10px; }

/* Empty states */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; color: var(--text-dim); margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 360px; margin: 0 auto; }

/* Search */
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 22px; }
.search-box input { flex: 1; background: transparent; border: none; outline: none; font-size: 14.5px; color: var(--text); }
.search-box svg { width: 18px; height: 18px; color: var(--text-dim); }

/* Formula trainer */
.formula-card { text-align: center; padding: 40px 20px; }
.formula-display { font-size: 28px; font-weight: 800; font-family: var(--font-mono); margin-bottom: 8px; }
.formula-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.formula-choice { background: var(--surface-2); border: 1.5px solid var(--border-light); border-radius: 12px; padding: 16px; font-weight: 700; font-family: var(--font-mono); font-size: 16px; cursor: pointer; }
.formula-choice:hover { border-color: var(--accent); }
.formula-choice.correct { border-color: var(--green); background: var(--green-soft); }
.formula-choice.wrong { border-color: var(--red); background: var(--red-soft); }

/* Toggle switch */
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 20px; cursor: pointer; transition: background 0.2s; }
.toggle-track::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); top: 2px; left: 2px; transition: transform 0.2s, background 0.2s; }
.toggle input:checked + .toggle-track { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); background: var(--accent-light); }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-green { color: #4ade80; }
.text-red { color: #f87171; }
.text-amber { color: var(--amber); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.section-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

.kbd { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 5px; padding: 1px 6px; font-size: 11px; font-family: var(--font-mono); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border-light); color: var(--text);
  padding: 12px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 200; opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.sidebar-scrim { display: none; }
