/* ── GOOGLE FONTS werden in index.html importiert ── */

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Station-Farben */
  --zr:  #C84B12;  --zrl: rgba(200,75,18,.10);   --zrm: rgba(200,75,18,.22);
  --sr:  #1A4ED8;  --srl: rgba(26,78,216,.10);   --srm: rgba(26,78,216,.22);
  --oe:  #047857;  --oel: rgba(4,120,87,.10);     --oem: rgba(4,120,87,.22);
  --al:  #6D28D9;  --all: rgba(109,40,217,.10);   --alm: rgba(109,40,217,.22);

  /* Basis */
  --bg:   #FFFFFF;
  --bg2:  #F3F2EF;
  --sur:  #FFFFFF;
  --sur2: #F5F3EE;
  --bd:   rgba(0,0,0,.07);
  --bd2:  rgba(0,0,0,.10);
  --t1:   #18181B;
  --t2:   #71717A;
  --t3:   #A1A1AA;

  /* Feedback */
  --green:  #059669;
  --red:    #DC2626;
  --yellow: #D97706;
  --orange: #EA580C;

  /* Karten */
  --card-bg: #FFFFFF;
  --card-bd: rgba(0,0,0,.07);

  /* Schatten */
  --sh1: 0 1px 3px rgba(0,0,0,.05);
  --sh2: 0 4px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --sh-h: 0 2px 18px rgba(0,0,0,.07), 0 8px 32px rgba(0,0,0,.05);

  /* Fonts */
  --ff-body:    'DM Sans', system-ui, sans-serif;
  --ff-display: 'DM Serif Display', Georgia, serif;
  --ff-mono:    'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  /* Radius */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 14px;
  --sp-lg: 20px;
  --sp-xl: 28px;

  /* Transitions */
  --ease:   cubic-bezier(.4,0,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --tx-fast: all .10s var(--ease);
  --tx-base: all .18s var(--ease);
  --tx-slow: all .26s var(--ease);
}

@media (prefers-color-scheme: dark) { :root {
  --bg:   #111114;
  --bg2:  #18181B;
  --sur:  #1C1C1F;
  --sur2: #232326;
  --bd:   rgba(255,255,255,.07);
  --bd2:  rgba(255,255,255,.12);
  --t1:   #F2F2F7;
  --t2:   #AEAEB2;
  --t3:   #6C6C70;
  --zr:  #E8663A;  --zrl: rgba(232,102,58,.16);  --zrm: rgba(232,102,58,.28);
  --sr:  #4B7BF5;  --srl: rgba(75,123,245,.16);  --srm: rgba(75,123,245,.28);
  --oe:  #34C77B;  --oel: rgba(52,199,123,.16);  --oem: rgba(52,199,123,.28);
  --al:  #A78BFA;  --all: rgba(167,139,250,.16);  --alm: rgba(167,139,250,.28);
  --green:  #34D399;
  --red:    #F87171;
  --yellow: #FCD34D;
  --orange: #FB923C;
  --card-bg: #1C1C1F;
  --card-bd: rgba(255,255,255,.07);
  --sh1: 0 1px 2px rgba(0,0,0,.30);
  --sh2: 0 4px 20px rgba(0,0,0,.40), 0 1px 4px rgba(0,0,0,.30);
  --sh-h: 0 2px 18px rgba(0,0,0,.36), 0 10px 36px rgba(0,0,0,.20);
}}

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

body {
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--t1);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── TITLEBAR ───────────────────────────────────────────── */
.titlebar {
  height: 44px;
  -webkit-app-region: drag;
  background: transparent;
  display: flex;
  align-items: center;
  padding: 0 16px 0 80px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}

.titlebar-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  letter-spacing: .03em;
}

/* ── SCREENS ────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ── HOME ───────────────────────────────────────────────── */
#screen-home {
  flex-direction: column;
  align-items: center;
  padding: 0 40px 20px;
}

.home-topbar {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 4px;
  flex-shrink: 0;
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-lg);
  width: 100%;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.home-greeting {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.due-count {
  font-family: var(--ff-display);
  font-size: 96px;
  font-weight: 400;
  color: var(--t1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: -2px 0;
}

.due-status {
  font-size: 14px;
  color: var(--t2);
  font-weight: 400;
}

.home-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.btn-start-hero {
  padding: 13px 52px;
  font-size: 14px;
}

.home-alt-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-micro-stats {
  font-size: 11px;
  color: var(--t3);
  letter-spacing: .01em;
}

/* ── TOOL BUTTONS (Zone 3) ──────────────────────────────── */
.home-tools {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
  width: 100%;
  justify-content: center;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--t3);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
  -webkit-app-region: no-drag;
}
.tool-btn:hover { border-color: var(--t2); color: var(--t1); background: var(--bg2); }
.tool-icon { font-size: 13px; line-height: 1; }

/* ── STATION PILLS ──────────────────────────────────────── */
.station-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.station-pill {
  background: transparent;
  color: var(--t3);
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
  -webkit-app-region: no-drag;
}
.station-pill:hover { border-color: var(--t2); color: var(--t1); }
.station-pill.active {
  background: var(--zrl);
  border-color: var(--zrm);
  color: var(--zr);
  font-weight: 600;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-primary {
  background: var(--t1);
  color: var(--bg);
  border: 1px solid var(--t1);
  border-radius: var(--r-sm);
  padding: 11px 32px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
  -webkit-app-region: no-drag;
}
.btn-primary:hover { opacity: .82; }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled {
  background: var(--bg2);
  color: var(--t3);
  border-color: var(--bd2);
  cursor: default;
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  padding: 11px 24px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
}
.btn-secondary:hover { border-color: var(--t2); color: var(--t1); }

/* ── STUDY SCREEN ───────────────────────────────────────── */
#screen-study {
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.study-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.progress-bar-wrap {
  flex: 1;
  height: 3px;
  background: var(--bd2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--zr);
  border-radius: 2px;
  transition: width .35s var(--ease);
}

.progress-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: right;
}

/* ── KARTE ──────────────────────────────────────────────── */
.card-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.card {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh1);
}

.card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}

.tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--zrl);
  color: var(--zr);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tag-rechtsgebiet {
  font-size: 11px;
  color: var(--t3);
  font-weight: 400;
}

.card-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-title {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--t1);
  line-height: 1.25;
  font-style: italic;
}

.card-kontext {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.55;
  padding: 10px 13px;
  background: var(--bg2);
  border-radius: var(--r-sm);
  border-left: 2.5px solid var(--zr);
}

.card-prompt {
  font-size: 13px;
  color: var(--t3);
  text-align: center;
  margin-top: auto;
  padding-top: 16px;
}

/* ── SCHEMA BLOCK ───────────────────────────────────────── */
.schema-block {
  display: none;
  flex-direction: column;
  gap: 1px;
}
.schema-block.visible { display: flex; }

.schema-line {
  font-size: 12.5px;
  font-family: var(--ff-mono);
  color: var(--t1);
  line-height: 1.75;
  white-space: pre;
}
.schema-line.empty { height: 6px; }
.schema-line.highlight {
  color: var(--zr);
  font-weight: 700;
}

/* ── DEFINITION BLOCK ───────────────────────────────────── */
.definition-block {
  display: none;
  font-family: var(--ff-body);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--t1);
  padding: 14px 16px;
  background: var(--bg2);
  border-radius: var(--r-md);
  white-space: pre-wrap;
}
.definition-block.visible { display: block; }

/* ── MERKSATZ BLOCK ─────────────────────────────────────── */
.merksatz-block {
  display: none;
  padding: 10px 14px;
  background: var(--zrl);
  border: 1px solid var(--zrm);
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--zr);
  line-height: 1.5;
}
.merksatz-block.visible { display: block; }
.merksatz-block::before {
  content: '→ ';
  font-weight: 700;
}

/* ── REVEAL BUTTON ──────────────────────────────────────── */
.reveal-area {
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--bd);
}

.btn-reveal {
  width: 100%;
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  padding: 11px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
}
.btn-reveal:hover { border-color: var(--t2); color: var(--t1); background: var(--bg2); }

/* ── RATING BUTTONS ─────────────────────────────────────── */
.rating-area {
  display: none;
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--bd);
  flex-direction: column;
  gap: 8px;
}
.rating-area.visible { display: flex; }

.rating-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

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

.btn-rate {
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  padding: 9px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--bg2);
}
.btn-rate:active { transform: scale(.96); }
.btn-rate .rate-sub {
  font-size: 10px;
  font-weight: 400;
  opacity: .7;
}

.btn-rate-1 { color: var(--red);    border-color: rgba(220,38,38,.20);  background: rgba(220,38,38,.06); }
.btn-rate-2 { color: var(--orange); border-color: rgba(234,88,12,.20);  background: rgba(234,88,12,.06); }
.btn-rate-4 { color: var(--yellow); border-color: rgba(217,119,6,.20);  background: rgba(217,119,6,.06); }
.btn-rate-5 { color: var(--green);  border-color: rgba(5,150,105,.20);  background: rgba(5,150,105,.06); }
.btn-rate-1:hover { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.35); }
.btn-rate-2:hover { background: rgba(234,88,12,.12); border-color: rgba(234,88,12,.35); }
.btn-rate-4:hover { background: rgba(217,119,6,.12); border-color: rgba(217,119,6,.35); }
.btn-rate-5:hover { background: rgba(5,150,105,.12); border-color: rgba(5,150,105,.35); }

/* ── EDIT ICON BUTTON ───────────────────────────────────── */
.btn-edit-icon {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--bd2);
  color: var(--t3);
  border-radius: var(--r-xs);
  width: 26px;
  height: 26px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tx-fast);
  -webkit-app-region: no-drag;
}
.btn-edit-icon:hover { color: var(--zr); border-color: var(--zrm); background: var(--zrl); }

/* ── DONE SCREEN ────────────────────────────────────────── */
#screen-done {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xl);
  padding: var(--sp-xl);
}

.done-icon {
  font-size: 48px;
  line-height: 1;
}

.done-title {
  font-family: var(--ff-display);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--t1);
}

.done-sub {
  font-size: 13.5px;
  color: var(--t2);
  text-align: center;
  max-width: 300px;
  line-height: 1.6;
}

.done-stats {
  display: flex;
  gap: 12px;
}

.done-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-lg);
  box-shadow: var(--sh1);
}

.done-stat-num {
  font-family: var(--ff-display);
  font-size: 32px;
  font-weight: 400;
}
.done-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── ERKENNUNGS-MODUS ───────────────────────────────────── */
#screen-recognize {
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.rec-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.rec-card {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh1);
}

.rec-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rec-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .09em;
}

.rec-situation {
  font-size: 14px;
  line-height: 1.65;
  color: var(--t1);
  padding: 14px 16px;
  background: var(--bg2);
  border-radius: var(--r-md);
  border-left: 2.5px solid var(--zr);
}

.rec-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-choice {
  background: var(--card-bg);
  border: 1px solid var(--bd2);
  border-radius: var(--r-md);
  color: var(--t1);
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--ff-body);
  text-align: left;
  cursor: pointer;
  transition: var(--tx-base);
  line-height: 1.4;
}
.rec-choice:hover:not(:disabled) { border-color: var(--t2); box-shadow: var(--sh-h); transform: translateY(-1px); }
.rec-choice.correct {
  border-color: var(--green);
  background: rgba(5,150,105,.07);
  color: var(--green);
  font-weight: 600;
}
.rec-choice.wrong {
  border-color: var(--red);
  background: rgba(220,38,38,.07);
  color: var(--red);
}
.rec-choice:disabled { cursor: default; }

.rec-next { align-self: flex-end; padding: 10px 24px; }

.rec-back-btn {
  background: transparent;
  border: none;
  color: var(--t3);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  transition: var(--tx-fast);
  font-family: var(--ff-body);
}
.rec-back-btn:hover { color: var(--t1); background: var(--bg2); }

/* ── EDIT MODAL ─────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-xl);
  width: 520px;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}
.modal-title { font-size: 14px; font-weight: 600; color: var(--t1); }
.modal-close {
  background: transparent;
  border: none;
  color: var(--t3);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  transition: var(--tx-fast);
  font-family: var(--ff-body);
}
.modal-close:hover { background: var(--bg2); color: var(--t1); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.modal-hint {
  text-transform: none;
  font-weight: 400;
  color: var(--t3);
  letter-spacing: 0;
  font-size: 10px;
}

.modal-input, .modal-textarea {
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-size: 13px;
  padding: 8px 11px;
  font-family: var(--ff-body);
  resize: vertical;
  transition: var(--tx-base);
}
.modal-input:focus, .modal-textarea:focus {
  outline: none;
  border-color: var(--zr);
  background: var(--sur);
}
.modal-textarea { font-family: var(--ff-mono); line-height: 1.6; }
#edit-definition { font-family: var(--ff-body); }

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--bd);
  flex-shrink: 0;
}

/* ── STREAK BADGE ───────────────────────────────────────── */
.streak-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--zr);
  background: var(--zrl);
  border: 1px solid var(--zrm);
  border-radius: var(--r-sm);
  padding: 4px 12px;
  margin-top: 4px;
}
#streak-count { font-variant-numeric: tabular-nums; }

/* ── TYP BADGE (auf Karte) ──────────────────────────────── */
.tag-typ {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tag-typ.def { background: var(--all); color: var(--al); }
.tag-typ.sch { background: var(--bg2); color: var(--t3); border: 1px solid var(--bd2); }

/* ── TYP TOGGLE (im Modal) ──────────────────────────────── */
.modal-typ-row {
  display: flex;
  gap: 6px;
}
.typ-btn {
  padding: 6px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bd2);
  background: transparent;
  color: var(--t3);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-base);
}
.typ-btn:hover { border-color: var(--t2); color: var(--t1); }
.typ-btn.active {
  background: var(--zrl);
  border-color: var(--zrm);
  color: var(--zr);
}

/* ── MODAL ROW (side-by-side labels) ────────────────────── */
.modal-row {
  display: flex;
  gap: 10px;
}

/* ── DELETE BUTTON ──────────────────────────────────────── */
.btn-delete {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-fast);
}
.btn-delete:hover { background: rgba(220,38,38,.08); border-color: var(--red); }

/* ── KARTEN-BROWSER ─────────────────────────────────────── */
#screen-browser {
  flex-direction: column;
  overflow: hidden;
}

.browser-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}

.browser-back-btn {
  background: transparent;
  border: 1px solid var(--bd2);
  color: var(--t2);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--tx-fast);
}
.browser-back-btn:hover { border-color: var(--t2); color: var(--t1); }

.browser-search-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: var(--ff-body);
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  transition: var(--tx-base);
}
.browser-search-input:focus { border-color: var(--zr); background: var(--sur); }
.browser-search-input::placeholder { color: var(--t3); }

.browser-count {
  font-size: 11px;
  color: var(--t3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.browser-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.browser-chip {
  background: transparent;
  border: 1px solid var(--bd2);
  border-radius: var(--r-xs);
  color: var(--t3);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: var(--tx-fast);
}
.browser-chip:hover { border-color: var(--t2); color: var(--t1); }
.browser-chip.active {
  background: var(--zrl);
  border-color: var(--zrm);
  color: var(--zr);
  font-weight: 600;
}

.browser-chip-sep {
  width: 1px;
  height: 16px;
  background: var(--bd2);
  flex-shrink: 0;
  margin: 0 2px;
}

.browser-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.browser-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--bd);
  background: var(--card-bg);
  cursor: pointer;
  transition: var(--tx-base);
}
.browser-row:hover { box-shadow: var(--sh-h); transform: translateY(-1px); border-color: var(--bd2); }

.br-typ {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.br-typ.def { background: var(--all); color: var(--al); }
.br-typ.sch { background: var(--bg2); color: var(--t3); border: 1px solid var(--bd2); }

.br-info {
  flex: 1;
  min-width: 0;
}
.br-titel {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.br-meta {
  font-size: 11px;
  color: var(--t3);
  margin-top: 1px;
}

.br-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.br-due {
  font-size: 11px;
  color: var(--t3);
  font-variant-numeric: tabular-nums;
}
.br-due.due {
  color: var(--zr);
  font-weight: 600;
}
.br-edit-btn {
  background: transparent;
  border: 1px solid var(--bd2);
  color: var(--t3);
  border-radius: var(--r-xs);
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tx-fast);
  flex-shrink: 0;
}
.br-edit-btn:hover { color: var(--zr); border-color: var(--zrm); background: var(--zrl); }

.browser-empty {
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--t3);
}

/* ── RECOGNIZE — Tastatur-Hint ──────────────────────────── */
.rec-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--bd2);
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  margin-right: 8px;
  flex-shrink: 0;
  font-family: var(--ff-mono);
}

/* ── QUIZ-SCREEN ────────────────────────────────────────── */
#screen-quiz {
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.quiz-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.quiz-card {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh1);
}

.quiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-typ-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--t3);
}

.quiz-rechtsgebiet {
  font-size: 11px;
  color: var(--t3);
  margin-top: -8px;
}

.quiz-frage {
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--t1);
  line-height: 1.6;
  padding: 14px 16px;
  background: var(--bg2);
  border-radius: var(--r-md);
  border-left: 2.5px solid var(--zr);
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-choice {
  background: var(--card-bg);
  border: 1px solid var(--bd2);
  border-radius: var(--r-md);
  color: var(--t1);
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--ff-body);
  text-align: left;
  cursor: pointer;
  transition: var(--tx-base);
  line-height: 1.4;
  display: flex;
  align-items: center;
}
.quiz-choice:hover:not(:disabled) {
  border-color: var(--t2);
  box-shadow: var(--sh-h);
  transform: translateY(-1px);
}
.quiz-choice.correct {
  border-color: var(--green);
  background: rgba(5,150,105,.07);
  color: var(--green);
  font-weight: 600;
}
.quiz-choice.wrong {
  border-color: var(--red);
  background: rgba(220,38,38,.07);
  color: var(--red);
}
.quiz-choice:disabled { cursor: default; transform: none; }

.quiz-erläuterung {
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-weight: 400;
}
.quiz-erläuterung.correct {
  background: rgba(5,150,105,.07);
  border: 1px solid rgba(5,150,105,.20);
  color: var(--green);
}
.quiz-erläuterung.wrong {
  background: rgba(220,38,38,.07);
  border: 1px solid rgba(220,38,38,.20);
  color: var(--red);
}

.quiz-next-btn {
  align-self: flex-end;
  padding: 10px 24px;
  margin-top: auto;
}

/* ── ANIMATIONEN ────────────────────────────────────────── */

/* Animation 2: Perfekt-Flash */
@keyframes flashCorrect {
  0%   { transform: scale(1); box-shadow: none; }
  40%  { transform: scale(1.07); box-shadow: 0 0 0 5px rgba(5,150,105,.25); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1); box-shadow: none; }
}
.btn-rate-5.flash { animation: flashCorrect .38s var(--spring) both; }

/* Animation 4: Streak-Milestone-Glow */
@keyframes streakMilestone {
  0%,100% { transform: scale(1); box-shadow: none; }
  35% { transform: scale(1.14); box-shadow: 0 0 0 6px rgba(200,75,18,.28), 0 0 24px rgba(200,75,18,.22); }
  65% { transform: scale(1.04); }
}
.streak-badge.milestone { animation: streakMilestone .65s var(--spring) both; }

/* Animation 7: Quiz-Shimmer */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.quiz-choice.correct.shimmer {
  background: linear-gradient(90deg,
    rgba(5,150,105,.07) 0%,
    rgba(5,150,105,.22) 50%,
    rgba(5,150,105,.07) 100%);
  background-size: 200% 100%;
  animation: shimmer .55s ease both;
}


/* ── LERNANALYSE-SCREEN ─────────────────────────────────── */
#screen-stats {
  flex-direction: column;
  overflow: hidden;
}

.stats-screen-title {
  font-family: var(--ff-display);
  font-size: 17px;
  font-style: italic;
  color: var(--t1);
}

.stats-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stats-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-sec-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--t3);
}

/* Übersicht-Tiles */
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stats-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--sh1);
}
.stats-tile.accent { border-color: var(--zrm); background: var(--zrl); }
.stats-tile.accent .stats-tile-num { color: var(--zr); }

.stats-tile-num {
  font-family: var(--ff-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--t1);
  line-height: 1;
}
.stats-tile-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* 7-Tage-Forecast */
.stats-forecast {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 100px;
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-md);
  padding: 12px 16px 10px;
  box-shadow: var(--sh1);
}

.forecast-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.forecast-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--t3);
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}

.forecast-bar-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
}

.forecast-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--bd2);
  min-height: 3px;
  transition: height .4s var(--ease);
}
.forecast-bar.today { background: var(--zr); }

.forecast-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Schwierigkeitsverteilung */
.stats-diff-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--sh1);
}

.diff-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diff-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  width: 52px;
  flex-shrink: 0;
}

.diff-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
}

.diff-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s var(--ease);
  min-width: 3px;
}

.diff-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  width: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Schwierigste Karten */
.hard-ef {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Quiz Zur-Karte-Link */
.quiz-card-link {
  align-self: flex-start;
  font-size: 12px;
  padding: 6px 14px;
  margin-top: -8px;
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* ── USER SELECT SCREEN ─────────────────────────────────── */
.screen-user-select {
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.user-select-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 40px 24px;
  width: 100%;
  max-width: 380px;
}

.user-select-header {
  text-align: center;
}

.user-select-serif {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 32px;
  color: var(--t1);
  line-height: 1.1;
}

.user-select-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.user-profiles {
  display: flex;
  gap: 16px;
}

.profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 32px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-bd);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: var(--tx-base);
  box-shadow: var(--sh1);
  -webkit-app-region: no-drag;
}
.profile-btn:hover { box-shadow: var(--sh-h); transform: translateY(-2px); border-color: var(--bd2); }
.profile-btn.selected { border-color: var(--zr); background: var(--zrl); box-shadow: 0 0 0 3px var(--zrl); }

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1.5px solid var(--bd2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 22px;
  color: var(--t1);
}
.profile-btn.selected .profile-avatar {
  background: var(--zrl);
  border-color: var(--zrm);
  color: var(--zr);
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
}

/* PIN Section */
.pin-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.pin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.pin-dots {
  display: flex;
  gap: 12px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bd2);
  background: transparent;
  transition: var(--tx-fast);
}
.pin-dot.filled {
  background: var(--t1);
  border-color: var(--t1);
}

.pin-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  text-align: center;
}

.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 200px;
}

.pin-num, .pin-del {
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--r-md);
  color: var(--t1);
  font-family: var(--ff-display);
  font-size: 20px;
  height: 52px;
  cursor: pointer;
  transition: var(--tx-fast);
  box-shadow: var(--sh1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-num:hover, .pin-del:hover { background: var(--bg2); box-shadow: var(--sh-h); }
.pin-num:active, .pin-del:active { transform: scale(0.94); }

.pin-del {
  font-family: var(--ff-body);
  font-size: 16px;
  color: var(--t3);
}

/* User Badge on Home */
.home-user-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 15px;
  font-weight: 400;
  color: var(--t3);
  background: transparent;
  border: 1.5px solid var(--bd2);
  cursor: pointer;
  transition: var(--tx-fast);
  -webkit-app-region: no-drag;
}
.home-user-badge:hover { color: var(--t1); border-color: var(--t2); }

/* Due count color */
.due-count.has-due { color: var(--zr); }

/* PWA safe areas */
@supports (padding: env(safe-area-inset-bottom)) {
  #app { padding-bottom: env(safe-area-inset-bottom); }
  .home-tools { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* Mobile touch targets */
@media (hover: none) {
  .btn-rate { min-height: 52px; }
  .rec-choice, .quiz-choice { min-height: 50px; }
  .pin-num, .pin-del { min-height: 56px; }
}

/* ── MOBILE FIXES ───────────────────────────────────────── */

/* Doppel-Tap-Zoom verhindern auf allen interaktiven Elementen */
button, a, input, select, textarea, [role="button"] {
  touch-action: manipulation;
}

/* Home-Screen: scrollbar wenn Inhalt zu hoch (z.B. Landscape) */
#screen-home {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Horizontal padding auf kleinen Screens reduzieren */
@media (max-width: 430px) {
  #screen-home { padding: 16px 20px 16px; }
  .home-tools  { gap: 6px; }
  .tool-btn    { padding: 7px 12px; font-size: 11px; }
  .due-count   { font-size: 80px; }
  #screen-study, #screen-recognize { padding: 14px 14px; }
}

/* Sehr kleine Screens (SE, 375px) */
@media (max-width: 375px) {
  .due-count         { font-size: 68px; }
  .home-main         { gap: 16px; }
  .btn-start-hero    { padding: 12px 36px; }
  .rating-btns       { grid-template-columns: repeat(2, 1fr); }
  .pin-numpad        { width: 180px; }
  .pin-num, .pin-del { height: 46px; font-size: 18px; }
}

/* Kurze Screens (Landscape oder kleine Phones) */
@media (max-height: 680px) {
  .due-count      { font-size: 64px; }
  .home-main      { gap: 14px; }
  .home-hero      { gap: 4px; }
  .home-greeting  { display: none; }
  .btn-start-hero { padding: 11px 40px; }
  .home-micro-stats { display: none; }
  #screen-study   { padding: 12px; gap: 10px; }
  .card-body      { padding: 16px; }
}

/* Study-Screen: sicherstellen dass Rating-Buttons immer sichtbar */
#screen-study {
  overflow: hidden;
}
.card-wrap {
  min-height: 0;
}
.card {
  min-height: 0;
}
.card-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Browser + Stats: smooth scroll */
.browser-list, .stats-body, .rec-body, .quiz-body {
  -webkit-overflow-scrolling: touch;
}

/* User Select: auf kleinen Screens scrollen */
.screen-user-select {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.user-select-wrap {
  min-height: min-content;
}

/* Safe area bottom padding für Home-Tools */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .home-tools {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .rating-area {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* ── TYP-TOGGLE (Home) ──────────────────────────────────── */
.typ-toggle-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--bd2);
  border-radius: var(--r-sm);
  overflow: hidden;
  -webkit-app-region: no-drag;
}

.typ-toggle-btn {
  flex: 1;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ff-body);
  background: transparent;
  color: var(--t3);
  border: none;
  border-right: 1px solid var(--bd2);
  cursor: pointer;
  transition: var(--tx-fast);
  touch-action: manipulation;
}
.typ-toggle-btn:last-child { border-right: none; }
.typ-toggle-btn:hover { background: var(--bg2); color: var(--t1); }
.typ-toggle-btn.active {
  background: var(--t1);
  color: var(--bg);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   DESIGN REFRESH
   ═══════════════════════════════════════════════════════════ */

/* Station-Farben */
:root {
  --c-alle:   #c85a1e;
  --c-zivil:  #2f5fc4;
  --c-straf:  #b02828;
  --c-verw:   #1e8f5e;
  --c-anwalt: #b07a1a;
}

/* Warmes Off-White */
body { background: #f7f5f2; }
#app { background: #f7f5f2; }

/* ── HOME: Glow-Container ─────────────────────────────────── */
#screen-home {
  --glow-color: #1a4080;
  --cta-color:  #1a4080;
  background: #ffffff;
}

.home-hero { position: relative; }

.due-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--glow-color) 0%, transparent 68%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  animation: glowPulse 4s ease-in-out infinite;
}
.due-glow.visible { opacity: 1; }

@keyframes glowPulse {
  0%, 100% { opacity: .08; transform: translate(-50%,-50%) scale(.88); }
  50%      { opacity: .18; transform: translate(-50%,-50%) scale(1.06); }
}

/* Greeting als Serif Italic */
.home-greeting {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  color: var(--t3);
  letter-spacing: 0;
  text-transform: none;
  position: relative;
  z-index: 1;
}

/* Riesige Due-Zahl */
.due-count {
  font-size: 130px !important;
  position: relative;
  z-index: 1;
  transition: color .4s ease;
  line-height: .95 !important;
}

.due-status, .streak-badge, .home-micro-stats {
  position: relative;
  z-index: 1;
}

/* ── STATION CARDS ─────────────────────────────────────────── */
.station-pills {
  flex-direction: row;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0 4px;
  justify-content: center;
}
.station-pills::-webkit-scrollbar { display: none; }

.station-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--bd2);
  background: var(--card-bg);
  cursor: pointer;
  transition: var(--tx-base);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--ff-body);
  box-shadow: var(--sh1);
  -webkit-app-region: no-drag;
  touch-action: manipulation;
}
.station-card:hover { box-shadow: var(--sh-h); transform: translateY(-1px); }

.sc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
}

.sc-due {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg2);
  color: var(--t3);
  font-variant-numeric: tabular-nums;
}

.station-card.active {
  border-color: var(--station-color, var(--t2));
  background: color-mix(in srgb, var(--station-color, var(--t1)) 8%, var(--card-bg));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--station-color, var(--t1)) 12%, transparent);
}
.station-card.active .sc-name { color: var(--station-color, var(--t1)); }
.station-card.active .sc-due  {
  background: color-mix(in srgb, var(--station-color, var(--t1)) 15%, transparent);
  color: var(--station-color, var(--t1));
}

/* ── BUTTONS: Einheitliche Breite ──────────────────────────── */
.home-cta { width: 100%; max-width: 300px; }

.btn-start-hero {
  width: 100%;
  background: var(--cta-color, var(--zr)) !important;
  border-color: var(--cta-color, var(--zr)) !important;
  color: #fff !important;
  font-size: 15px;
  padding: 14px 0;
  border-radius: var(--r-md);
  transition: background .3s ease, border-color .3s ease, opacity .15s ease !important;
}
.btn-start-hero:hover { opacity: .88; }
.btn-start-hero:disabled {
  background: var(--bg2) !important;
  border-color: var(--bd2) !important;
  color: var(--t3) !important;
}

.home-alt-modes { width: 100%; }
.home-alt-modes .btn-secondary {
  width: 100%;
  text-align: center;
  padding: 11px 0;
}

/* Typ-Toggle volle Breite */
.typ-toggle-row { width: 100%; max-width: 300px; }
.typ-toggle-btn { padding: 8px 0; }

/* ── KARTEN: Typ-Streifen ──────────────────────────────────── */
.card { border-top: 3px solid var(--bd); transition: border-color .3s ease; }
.card[data-typ="schema"]     { border-top-color: #2f5fc4; }
.card[data-typ="definition"] { border-top-color: var(--zr); }

/* ── TOOL BUTTONS: schlank ─────────────────────────────────── */
.tool-btn {
  border: none !important;
  color: var(--t3);
  font-size: 11px;
  padding: 6px 14px;
  background: transparent !important;
}
.tool-btn:hover {
  background: var(--bg2) !important;
  color: var(--t1);
  border-radius: var(--r-sm);
}

/* ── CARD + SURFACES: wärmerer Hintergrund ─────────────────── */
.card, .rec-card, .quiz-card,
.stats-tile, .browser-row,
.stats-forecast, .stats-diff-bars { background: #fff; }

/* ── FLOATING DUE-COUNT ─────────────────────────────────── */
.home-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.due-count {
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.15));
  position: relative;
  z-index: 1;
}
.home-greeting, .due-status, .streak-badge {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   BUTTON SYSTEM + GLOW FIX
   ═══════════════════════════════════════════════════════════ */

/* ── GLOW: viel dezenter ────────────────────────────────── */
.due-glow {
  width: 220px !important;
  height: 220px !important;
}
@keyframes glowPulse {
  0%, 100% { opacity: .04; transform: translate(-50%,-50%) scale(.90); }
  50%      { opacity: .08; transform: translate(-50%,-50%) scale(1.05); }
}

/* ── DUE-COUNT: Farbe wird per JS inline gesetzt ────────── */
.due-count         { color: var(--t3); }
.due-count.has-due { color: var(--cta-color, var(--zr)); }

/* ═══════════════════════════════════════════════════════════
   TIER 1 — PRIMARY
   Orange, voll, 52px, volle Breite im home-cta-Kontext
   ═══════════════════════════════════════════════════════════ */
.btn-primary {
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}

/* ═══════════════════════════════════════════════════════════
   TIER 2 — SECONDARY
   Transparent, dünner Border, 48px, volle Breite
   ═══════════════════════════════════════════════════════════ */
.btn-secondary {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 14px;
  border: 1px solid var(--bd2);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--t1);
}
.btn-secondary:hover { border-color: var(--t2); }

/* ═══════════════════════════════════════════════════════════
   TIER 3 — CHIP
   Kompakt, 36px, pill-förmig. Typ-Toggle + Station Cards
   ═══════════════════════════════════════════════════════════ */

/* Typ-Toggle als Chip-Gruppe */
.typ-toggle-row {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bd2) !important;
  background: var(--bg) !important;
}
.typ-toggle-btn {
  min-height: 36px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2) !important;
  background: transparent !important;
  border-right: 1px solid var(--bd2) !important;
}
.typ-toggle-btn:last-child { border-right: none !important; }
.typ-toggle-btn.active {
  background: var(--t1) !important;
  color: var(--bg) !important;
  font-weight: 600 !important;
}

/* ── STATION TABS ───────────────────────────────────────── */
.station-tabs {
  display: flex;
  width: 100%;
  max-width: 300px;
  border-bottom: 1px solid var(--bd2);
}

.station-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: var(--ff-body);
  transition: color .18s ease, border-color .18s ease;
  color: var(--t3);
  -webkit-app-region: no-drag;
  touch-action: manipulation;
}

.st-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

.st-badge {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--station-color, var(--t2));
}

.station-tab.active {
  color: var(--station-color, var(--t1));
  border-bottom-color: var(--station-color, var(--t1));
}

.station-tab.active .st-name {
  color: var(--station-color, var(--t1));
}

/* Browser-Chips */
.browser-chip {
  min-height: 32px;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════
   TIER 4 — GHOST / TEXT
   Nur Text, kein Border, navigation-artig
   ═══════════════════════════════════════════════════════════ */

/* Tool-Buttons */
.tool-btn {
  min-height: 36px;
  border: none !important;
  background: transparent !important;
  color: var(--t3) !important;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  padding: 6px 14px;
}
.tool-btn:hover { background: var(--bg2) !important; color: var(--t1) !important; }

/* Back-Buttons (Browser/Stats) */
.browser-back-btn {
  min-height: 36px;
  border: 1px solid var(--bd2);
  border-radius: 8px;
  font-size: 12px;
  padding: 6px 12px;
}

/* Reveal-Button */
.btn-reveal {
  min-height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--bd2);
  background: transparent;
  color: var(--t2);
}
.btn-reveal:hover { background: var(--bg2); color: var(--t1); border-color: var(--t2); }

/* ── Rating-Buttons: einheitliche Größe + Radius ────────── */
.rating-btns { gap: 8px; }
.btn-rate {
  min-height: 54px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  gap: 4px;
}
.rate-sub { font-size: 10px; font-weight: 400; opacity: .75; }

/* ── Rec/Quiz-Choices: größer für Touch ─────────────────── */
.rec-choice, .quiz-choice {
  min-height: 50px;
  border-radius: 12px;
  font-size: 13.5px;
  padding: 13px 14px;
}

/* ── Modal-Footer: Buttons ausrichten ───────────────────── */
.modal-footer { gap: 8px; }
.modal-footer .btn-primary   { min-height: 44px; padding: 10px 24px; font-size: 14px; }
.modal-footer .btn-secondary { min-height: 44px; padding: 10px 20px; font-size: 13px; }
.btn-delete { min-height: 44px; padding: 10px 14px; font-size: 13px; border-radius: 10px; }

/* ── Edit-Icon auf Karte ────────────────────────────────── */
.btn-edit-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--bd2);
}

/* ── Home-Alt-Modes: Secondary Tier 2 ──────────────────── */
.home-alt-modes .btn-secondary {
  background: transparent !important;
  border: 1px solid var(--bd2) !important;
  color: var(--t1) !important;
  width: 100%;
}

/* ── Konsistente Active-States ──────────────────────────── */
.btn-primary:active,
.btn-secondary:active,
.btn-rate:active,
.rec-choice:active,
.quiz-choice:active,
.station-card:active,
.typ-toggle-btn:active { transform: scale(0.97); }

