:root {
  color-scheme: light;
  --bg: #f3f7f4;
  --surface: #ffffff;
  --surface-soft: #eaf3ee;
  --ink: #143528;
  --muted: #667a70;
  --primary: #205c47;
  --primary-2: #2d775c;
  --accent: #e3b83f;
  --danger: #9f2d2d;
  --border: #d7e2db;
  --shadow: 0 14px 35px rgba(26, 73, 55, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, #edf5f0 0, var(--bg) 230px); color: var(--ink); min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(980px, 100%); margin: 0 auto; padding: 0 18px 100px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 4px 20px; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(1.65rem, 4vw, 2.25rem); }
.mobile-menu-toggle, .mobile-nav, .mobile-nav-backdrop { display: none; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .13em; color: var(--primary-2); font-weight: 800; font-size: .72rem; }
.header-stats { display: flex; gap: 10px; }
.stat-pill { display: grid; grid-template-columns: auto auto; gap: 0 7px; align-items: center; background: rgba(255,255,255,.78); border: 1px solid rgba(215,226,219,.8); padding: 9px 12px; border-radius: 16px; box-shadow: var(--shadow); }
.stat-pill small { grid-column: 2; color: var(--muted); font-size: .67rem; }
.stat-pill strong { line-height: 1; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: .3; transform: translateY(4px); } }
.hero-card { background: linear-gradient(135deg, var(--primary), #143e31); color: white; padding: 28px; border-radius: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; box-shadow: var(--shadow); }
.hero-card .eyebrow { color: #aed9c7; }
.hero-card h2 { margin: 8px 0 6px; font-size: clamp(1.45rem, 4vw, 2.2rem); }
.hero-card p:last-child { color: #d8ece3; margin-bottom: 0; }
.progress-ring { width: 90px; aspect-ratio: 1; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) var(--progress, 0%), rgba(255,255,255,.18) 0); position: relative; }
.progress-ring::before { content: ""; position: absolute; width: 70px; aspect-ratio: 1; border-radius: 50%; background: #184634; }
.progress-ring span { z-index: 1; font-weight: 900; }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.primary-card, .secondary-card { border: 0; border-radius: 22px; padding: 20px; display: flex; text-align: left; gap: 15px; align-items: center; box-shadow: var(--shadow); }
.primary-card { background: var(--primary-2); color: white; }
.secondary-card { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.button-icon { font-size: 1.6rem; }
.primary-card span:last-child, .secondary-card span:last-child { display: grid; gap: 3px; }
.primary-card small { color: #d8ece3; }
.secondary-card small { color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.summary-card small, .summary-card span { display: block; color: var(--muted); }
.summary-card strong { display: block; font-size: 1.8rem; margin: 6px 0 2px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 22px; margin: 18px 0; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; }
.panel h3 { margin: 4px 0 10px; }
.panel-meta { color: var(--muted); font-size: .82rem; font-weight: 700; }
.question-bank-panel { overflow: hidden; }
.question-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.question-stat { min-width: 0; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 18px; padding: 15px; }
.question-stat small, .question-stat span { display: block; color: var(--muted); }
.question-stat small { font-weight: 750; }
.question-stat strong { display: block; margin: 6px 0 2px; font-size: clamp(1.35rem, 3.5vw, 1.85rem); overflow-wrap: anywhere; }
.question-stat span { font-size: .75rem; }
.stats-note { margin: 14px 2px 0; color: var(--muted); font-size: .8rem; }
.stack { display: grid; gap: 12px; }
.stack p { margin: 0; color: var(--muted); }
.activity-bars { height: 175px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; padding-top: 20px; }
.day-bar { display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; text-align: center; color: var(--muted); font-size: .72rem; }
.day-bar div { width: 100%; align-self: end; min-height: 4px; background: linear-gradient(180deg, #4d9c79, var(--primary)); border-radius: 12px 12px 5px 5px; }
.section-heading { padding: 10px 2px 2px; }
.section-heading h2 { margin: 6px 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.practice-topline { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin: 10px 0 18px; }
.icon-button { border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.4rem; }
.session-progress { height: 10px; background: #dce7e0; border-radius: 999px; overflow: hidden; }
.session-progress div { height: 100%; width: 0%; background: var(--primary-2); transition: width .2s ease; }
.question-card { background: var(--surface); border: 1px solid var(--border); border-radius: 26px; padding: 24px; min-height: 190px; display: grid; align-content: center; box-shadow: var(--shadow); }
.question-card h2 { margin: 10px 0 0; line-height: 1.45; font-size: clamp(1.35rem, 4vw, 2rem); white-space: pre-wrap; }
.answer-area { display: grid; gap: 12px; margin: 18px 0 12px; }
.answer-area input[type="text"] { width: 100%; padding: 17px 18px; border-radius: 16px; border: 2px solid var(--border); background: white; color: var(--ink); font-size: 1.05rem; outline: none; }
.answer-area input[type="text"]:focus { border-color: var(--primary-2); }
.option-button { width: 100%; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); padding: 15px 16px; text-align: left; color: var(--ink); }
.option-button.selected { border-color: var(--primary); background: var(--surface-soft); }
.option-button.correct { border-color: #2f855a; background: #e6f6ed; }
.option-button.incorrect { border-color: #c84d4d; background: #fdecec; }
.primary-action, .secondary-action, .danger-action, .file-button { border: 0; border-radius: 16px; padding: 15px 18px; font-weight: 800; text-align: center; }
.primary-action { width: 100%; background: var(--primary); color: white; }
.practice-actions { display: grid; grid-template-columns: minmax(120px, .55fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.practice-actions .secondary-action, .practice-actions .primary-action { width: 100%; }
.practice-actions button:disabled { cursor: not-allowed; opacity: .45; }
.secondary-action, .file-button { background: var(--surface-soft); color: var(--primary); border: 1px solid var(--border); }
.file-button { display: inline-block; cursor: pointer; }
.file-button input { display: none; }
.file-button.muted { background: white; }
.danger-action { background: var(--danger); color: white; }
.hint-card, .feedback-card, .notice { margin-top: 14px; padding: 15px 17px; border-radius: 16px; border: 1px solid var(--border); white-space: pre-wrap; }
.hint-card { background: #fff9e6; color: #6d5719; }
.hint-card summary { cursor: pointer; font-weight: 800; list-style-position: outside; user-select: none; }
.hint-card summary:hover { color: #4f3d0c; }
.hint-card[open] summary { margin-bottom: 10px; }
.hint-text { line-height: 1.5; }
.feedback-card.correct { background: #e6f6ed; border-color: #b9e1c8; color: #215f3c; }
.feedback-card.incorrect { background: #fdecec; border-color: #f0c2c2; color: #8b2929; }
.feedback-title { font-size: 1.08rem; font-weight: 900; margin-bottom: 10px; }
.feedback-line { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 12px; align-items: baseline; line-height: 1.5; }
.feedback-label { font-weight: 800; }
@media (max-width: 520px) {
  .feedback-line { grid-template-columns: 1fr; gap: 0; margin-top: 7px; }
}
.notice { background: var(--surface-soft); color: var(--primary); }
.hidden { display: none !important; }
.mastery-list { display: grid; gap: 12px; }
.mastery-list div { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.mastery-list div:last-child { border-bottom: 0; }
.settings-form { display: grid; gap: 18px; }
.settings-form label { display: grid; gap: 7px; }
.settings-form label > span { font-weight: 800; }
.settings-form label > small { color: var(--muted); }
.settings-form input { padding: 14px; border-radius: 14px; border: 2px solid var(--border); max-width: 220px; }
.danger-zone { border-color: #ebc4c4; }
.bottom-nav { position: fixed; z-index: 20; bottom: 12px; left: 50%; transform: translateX(-50%); width: min(680px, calc(100% - 24px)); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; border-radius: 24px; border: 1px solid rgba(215,226,219,.9); box-shadow: 0 18px 45px rgba(25, 66, 51, .18); }
.bottom-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 16px; padding: 8px; display: grid; gap: 2px; place-items: center; }
.bottom-nav button.active { color: var(--primary); background: var(--surface-soft); }
.bottom-nav span { font-size: 1.25rem; }
.bottom-nav small { font-size: .7rem; }

@media (max-width: 680px) {
  .app-shell { padding: 0 18px 32px; }
  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    row-gap: 14px;
    padding: 18px 4px 18px;
  }
  .mobile-menu-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 11px 9px;
    align-content: space-between;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.88);
    color: var(--ink);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 62;
  }
  .mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }
  .brand-block { min-width: 0; padding-top: 2px; }
  .topbar h1 { font-size: clamp(1.7rem, 8vw, 2.15rem); }
  .header-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }
  .stat-pill {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 16px;
    box-shadow: none;
  }
  .stat-pill small { white-space: normal; }
  .bottom-nav { display: none !important; }
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 58;
    border: 0;
    padding: 0;
    background: rgba(20,53,40,.18);
  }
  .mobile-nav {
    display: grid;
    position: absolute;
    top: 68px;
    left: 4px;
    z-index: 61;
    width: min(285px, calc(100vw - 44px));
    padding: 8px;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 18px 45px rgba(25,66,51,.22);
  }
  .mobile-nav button {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: transparent;
    color: var(--muted);
    text-align: left;
  }
  .mobile-nav button span { font-size: 1.15rem; text-align: center; }
  .mobile-nav button strong { font-size: .95rem; }
  .mobile-nav button.active {
    color: var(--primary);
    background: var(--surface-soft);
  }
  .button-grid, .summary-grid { grid-template-columns: 1fr; }
  .question-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-bank-panel .panel-heading { align-items: flex-start; gap: 8px; }
  .hero-card { padding: 22px; }
  .progress-ring { width: 78px; }
  .progress-ring::before { width: 60px; }
  .question-card { min-height: 165px; }
}
.feedback-line-simple { display: flex; flex-wrap: wrap; gap: 0 0.35rem; line-height: 1.5; }
@media (max-width: 520px) {
  .feedback-line-simple { display: flex; gap: 0 0.35rem; margin-top: 0; }
}

/* Structured Analyze & Translate answer fields */
.analysis-answer-grid { display: grid; gap: 14px; }
.analysis-answer-field { display: grid; gap: 7px; }
.analysis-answer-field > span { font-weight: 800; color: var(--ink); }
.analysis-answer-field input[type="text"], .analysis-answer-field select { width: 100%; padding: 15px 17px; border-radius: 16px; border: 2px solid var(--border); background: white; color: var(--ink); font-size: 1rem; outline: none; }
.analysis-answer-field select { cursor: pointer; }
.analysis-answer-field input[type="text"]:focus, .analysis-answer-field select:focus { border-color: var(--primary-2); }
.analysis-answer-field input[type="text"]:disabled, .analysis-answer-field select:disabled { background: var(--surface-soft); opacity: .92; cursor: default; }


/* Focused practice modes */
.practice-type-grid { margin-bottom: 0; }
.secondary-card:disabled, .primary-card:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
}
.practice-type-grid .button-icon {
  min-width: 34px;
  text-align: center;
  font-weight: 900;
  font-size: .95rem;
}


/* Focused practice: content vs question type */
.practice-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 14px;
}
.practice-column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,.35);
}
.practice-column-heading {
  margin-bottom: 12px;
}
.practice-column-heading h4 {
  margin: 2px 0 0;
  font-size: 1rem;
}
.practice-column-kicker {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.practice-column-buttons {
  display: grid;
  gap: 12px;
}
.practice-column-buttons .secondary-card {
  width: 100%;
  min-height: 76px;
  height: auto;
}
.practice-column-buttons .secondary-card small {
  line-height: 1.35;
}

@media (max-width: 720px) {
  .practice-columns {
    grid-template-columns: 1fr;
  }
}


.feedback-explanation {
  margin-top: 8px;
  line-height: 1.55;
}


/* Matching / Zuordnen */
.matching-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 64px;
  row-gap: 12px;
  align-items: start;
}
.matching-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.matching-column-heading {
  font-size: .78rem;
  font-weight: 850;
  color: var(--muted);
  padding: 0 4px 2px;
}
.matching-card {
  width: 100%;
  min-height: 64px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.matching-card:not(:disabled) {
  cursor: pointer;
}
.matching-card.selected {
  border-color: var(--primary);
  background: var(--surface-soft);
  box-shadow: 0 0 0 2px rgba(32, 92, 71, .08);
}
.matching-card.matched {
  border-color: #2f855a;
  background: #e6f6ed;
  color: #215f3c;
  opacity: 1;
}
.matching-card.incorrect {
  border-color: #c84d4d;
  background: #fdecec;
  color: #8b2929;
}
.matching-card:disabled:not(.matched):not(.incorrect) {
  opacity: .55;
  cursor: default;
}
.practice-actions.matching-mode {
  grid-template-columns: minmax(120px, .55fr) minmax(0, 1fr);
}

@media (max-width: 520px) {
  .matching-board {
    column-gap: 34px;
    row-gap: 8px;
  }
  .matching-card {
    min-height: 58px;
    padding: 11px 10px;
    font-size: .9rem;
  }
}


/* Deferred-check matching connections */
.matching-board {
  position: relative;
}
.matching-column {
  position: relative;
  z-index: 2;
}
.matching-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.matching-connection {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .9;
}
.matching-connection.pending {
  stroke: #667085;
}
.matching-connection.correct {
  stroke: #2f855a;
}
.matching-connection.incorrect {
  stroke: #c84d4d;
}
.matching-card.paired:not(.matched):not(.incorrect) {
  border-color: #98a2b3;
  background: #f7f8fa;
}


.matching-connection {
  stroke-width: 3;
}


/* Matching connectors: plain lines without arrowheads */
.matching-connection {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* Matching pair connectors: plain visible lines, no arrowheads. */
.matching-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
.matching-column {
  position: relative;
  z-index: 2;
}
.matching-connection {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 1;
}
.matching-connection.pending {
  stroke: #667085;
}
.matching-connection.correct {
  stroke: #2f855a;
}
.matching-connection.incorrect {
  stroke: #c84d4d;
}


/* Matching pair connectors: smooth curved paths through the center lane. */
.matching-connection {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
}


/* Matching connectors share one common junction in the center lane. */
.matching-connection {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .92;
}


/* Matching connectors: direct smooth curves with no midpoint or junction. */
.matching-connection {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .92;
}


/* Data import: randomize-after-import option */
.import-randomize-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: pointer;
}
.import-randomize-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.import-randomize-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.import-randomize-option strong {
  line-height: 1.3;
}
.import-randomize-option small {
  color: var(--muted);
  line-height: 1.4;
}


/* Data page: CEFR level visibility toggles */
.level-toggle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.level-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: pointer;
}
.level-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.level-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.level-toggle strong {
  font-size: 1rem;
}
.level-toggle small {
  color: var(--muted);
  line-height: 1.25;
}
.level-toggle:has(input:not(:checked)) {
  opacity: .58;
}

@media (max-width: 720px) {
  .level-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Final matching connector style: thin straight lines */
.matching-connection {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}
.matching-connection.pending {
  stroke: #667085;
}
.matching-connection.correct {
  stroke: #2f855a;
}
.matching-connection.incorrect {
  stroke: #c84d4d;
}


/* Matching feedback: reveal correct answers for incorrectly paired questions. */
.matching-feedback-summary {
  white-space: pre-line;
}
.matching-corrections {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.matching-correction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}
.matching-correction-prompt {
  font-weight: 700;
}
.matching-correction-separator {
  color: var(--muted);
}
.matching-correction-answer {
  font-weight: 700;
}
@media (max-width: 520px) {
  .matching-correction-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    font-size: .92rem;
  }
}


/* Mobile home compaction -------------------------------------------------- */
.mobile-start-section {
  display: contents;
}
.mobile-section-label,
.mobile-dropdown-summary {
  display: none;
}

@media (min-width: 681px) {
  .mobile-home-dropdown {
    display: block;
  }
  .mobile-home-dropdown > .mobile-dropdown-summary {
    display: none;
  }
}

@media (max-width: 680px) {
  /* 1. Daily Mix + Quick Mix in one compact section */
  .mobile-start-section {
    display: block;
    margin: 14px 0 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .mobile-section-label {
    display: block;
    margin: 0 2px 9px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
  }
  .mobile-start-section .button-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
  }
  .mobile-start-section .primary-card,
  .mobile-start-section .secondary-card {
    min-height: 58px;
    padding: 13px 14px;
    border-radius: 14px;
    box-shadow: none;
  }
  .mobile-start-section .secondary-card {
    background: var(--surface-soft);
  }
  .mobile-start-section .button-icon {
    min-width: 28px;
    font-size: 1.25rem;
    text-align: center;
  }

  /* Shared mobile dropdown header */
  .mobile-home-dropdown {
    overflow: hidden;
  }
  .mobile-dropdown-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 13px 14px;
    list-style: none;
    cursor: pointer;
    color: var(--ink);
    font-weight: 850;
    user-select: none;
  }
  .mobile-dropdown-summary::-webkit-details-marker {
    display: none;
  }
  .mobile-dropdown-summary::after {
    content: "⌄";
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .16s ease;
  }
  .mobile-home-dropdown[open] > .mobile-dropdown-summary::after {
    transform: rotate(180deg);
  }

  /* 2. Inhalt and Fragetyp as dropdowns */
  .focused-practice-panel {
    padding: 14px;
  }
  .focused-practice-panel > .panel-heading {
    margin-bottom: 10px;
  }
  .focused-practice-panel > .panel-heading h3 {
    margin-bottom: 0;
    font-size: 1rem;
  }
  .practice-columns {
    gap: 8px;
    margin-top: 0;
  }
  .practice-column.mobile-home-dropdown {
    padding: 0;
    border-radius: 14px;
    background: var(--surface-soft);
  }
  .practice-column.mobile-home-dropdown > .practice-column-heading {
    display: none;
  }
  .practice-column.mobile-home-dropdown > .practice-column-buttons {
    gap: 8px;
    padding: 0 10px 10px;
  }
  .practice-column-buttons .secondary-card {
    min-height: 54px;
    padding: 11px 12px;
    border-radius: 12px;
    box-shadow: none;
    background: var(--surface);
  }
  .practice-column-buttons .button-icon {
    min-width: 26px;
    font-size: 1rem;
  }

  /* 3. Fragenkatalog / Beantwortet / Gemeistert in one dropdown */
  .summary-overview-dropdown {
    margin: 16px 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .summary-overview-dropdown > .summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0 14px 8px;
  }
  .summary-overview-dropdown .summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: baseline;
    padding: 11px 2px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .summary-overview-dropdown .summary-card:last-child {
    border-bottom: 0;
  }
  .summary-overview-dropdown .summary-card small {
    font-weight: 750;
    color: var(--ink);
  }
  .summary-overview-dropdown .summary-card strong {
    margin: 0;
    font-size: 1.05rem;
  }
  .summary-overview-dropdown .summary-card span {
    font-size: .72rem;
  }

  /* 4. Inhaltsstatistiken as a dropdown with information rows */
  .question-bank-panel.mobile-home-dropdown {
    padding: 0;
    border-radius: 18px;
  }
  .question-bank-panel.mobile-home-dropdown > .panel-heading {
    padding: 0 14px 8px;
    margin: 0;
  }
  .question-bank-panel.mobile-home-dropdown > .panel-heading > div {
    display: none;
  }
  .question-bank-panel.mobile-home-dropdown .panel-meta {
    width: 100%;
    padding: 8px 2px 4px;
    border-top: 1px solid var(--border);
    text-align: left;
  }
  .question-bank-panel.mobile-home-dropdown .question-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0 14px 8px;
  }
  .question-bank-panel.mobile-home-dropdown .question-stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    align-items: center;
    padding: 10px 2px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
  }
  .question-bank-panel.mobile-home-dropdown .question-stat:last-child {
    border-bottom: 0;
  }
  .question-bank-panel.mobile-home-dropdown .question-stat small {
    grid-column: 1;
    grid-row: 1;
    color: var(--ink);
    font-weight: 750;
  }
  .question-bank-panel.mobile-home-dropdown .question-stat span {
    grid-column: 1;
    grid-row: 2;
    font-size: .7rem;
  }
  .question-bank-panel.mobile-home-dropdown .question-stat strong {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    font-size: 1rem;
    text-align: right;
  }
}


/* Mobile header/view visibility and keyboard-safe question entry */
@media (max-width: 680px) {
  /* "Offline Deutsch üben" always stays on one line on every page. */
  .brand-block .eyebrow {
    white-space: nowrap;
    overflow: visible;
    font-size: clamp(.62rem, 3.1vw, .72rem);
    letter-spacing: .11em;
  }

  /* Header streak/accuracy are homepage-only on mobile. */
  .header-stats {
    display: none;
  }
  .app-shell.home-active .header-stats {
    display: grid;
  }
}


/* First bundled-data import loading screen */
.initial-data-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 248, 245, .96);
  backdrop-filter: blur(6px);
}
.initial-data-loader-card {
  width: min(440px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 30px 26px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.initial-data-loader-card h2 {
  margin: 2px 0 0;
  font-size: 1.3rem;
}
.initial-data-loader-card p:not(.eyebrow) {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
}
.initial-data-loader-card small {
  color: var(--muted);
  line-height: 1.4;
}
.initial-data-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: initial-data-spin .8s linear infinite;
}
.initial-data-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}
.initial-data-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .18s ease;
}
@keyframes initial-data-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .initial-data-spinner { animation: none; }
  .initial-data-progress span { transition: none; }
}
