:root {
  --bg: #0f172a;
  --surface: #17213b;
  --surface-2: #1f2b4a;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --accent: #60a5fa;
  --accent-2: #38bdf8;
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --border: #2a3757;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#app {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 48px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3 {
  margin: 0 0 8px;
}

/* ---------- shared bits ---------- */
.btn-back, .btn-back-list {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  padding: 8px 0;
}

.btn-back:hover, .btn-back-list:hover {
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  color: #05101f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  text-decoration: underline;
}

/* ---------- home screen ---------- */
.home-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 24px;
}

.home-screen h1 {
  font-size: 32px;
}

.home-subtitle {
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.home-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-cta p {
  margin: 0;
  color: var(--text);
}

.home-cta-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.home-modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mode-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: border-color 120ms ease;
}

.mode-card:hover {
  border-color: var(--accent);
}

.mode-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.mode-card-desc {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- conjugation cycle ---------- */
.conjugation-options-accordion {
  margin-bottom: 12px;
}
.conjugation-options-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 8px 0 6px;
}
.conjugation-idk-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  cursor: pointer;
}
.conjugation-modal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.conjugation-modal-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.conjugation-modal-chip input {
  accent-color: var(--accent);
}
.conjugation-modal-en {
  color: var(--text-dim);
  font-size: 12px;
}
.conjugation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.conjugation-uk {
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.conjugation-translit {
  color: var(--accent-2);
  font-size: 14px;
}
.conjugation-en {
  color: var(--text-dim);
  font-size: 16px;
}
.conjugation-next-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  font-size: 16px;
}

.conjugation-mode-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.conjugation-mode-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.conjugation-mode-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.conjugation-score {
  margin-left: auto;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.conjugation-test-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.conjugation-test-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.conjugation-test-option:hover {
  border-color: var(--accent);
}
.conjugation-test-option.is-correct {
  border-color: var(--good);
  background: rgba(52,211,153,0.12);
  color: var(--good);
}
.conjugation-test-option.is-incorrect {
  border-color: var(--bad);
  background: rgba(248,113,113,0.12);
  color: var(--bad);
}
.conjugation-test-option.is-selected {
  border-color: var(--accent);
  background: rgba(96,165,250,0.14);
}
/* 2 columns, not 3 — 3-across squeezed tiles down to ~113px wide on
   mobile, too cramped for longer Ukrainian words at the same font size
   used everywhere else in this screen. 3 rows of 2 instead. */
.conjugation-haystack {
  grid-template-columns: 1fr 1fr;
}
.conjugation-haystack .conjugation-test-option {
  font-size: 15px;
  padding: 12px 8px;
}
.conjugation-pronoun-hint {
  font-size: 13px;
  color: var(--text-dim);
}
.conjugation-test-type-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.conjugation-test-feedback {
  margin-top: 16px;
  text-align: center;
}
.conjugation-feedback-good {
  color: var(--good);
  font-weight: 700;
  margin-bottom: 6px;
}
.conjugation-feedback-bad {
  color: var(--bad);
  font-weight: 700;
  margin-bottom: 6px;
}

/* Compact "where am I / what's next" summary — immediate-impact read
   above the Drill/Lessons cards, replacing a wall of stats as the first
   thing seen. Mobile-first: stacked rows, generous tap-friendly padding. */
.level-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.level-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}
.level-summary-label {
  color: var(--text-dim);
}
.level-summary-value {
  font-weight: 700;
  color: var(--text);
}
.level-summary-next {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
}

/* Detailed stats accordion — native <details>, collapsed by default. */
.stats-accordion {
  margin-top: 4px;
}
.stats-accordion summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 10px 4px;
  list-style: none;
  user-select: none;
}
.stats-accordion summary::-webkit-details-marker {
  display: none;
}
.stats-accordion summary::after {
  content: '▾';
  float: right;
  transition: transform 120ms ease;
}
.stats-accordion[open] summary::after {
  transform: rotate(180deg);
}

/* ---------- drill screen ---------- */
.drill-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.drill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drill-score {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 14px;
}

.drill-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: 1fr 1.6fr 1fr;
  grid-template-areas:
    ".    up    ."
    "left card  right"
    ".    down  .";
  gap: 10px;
  height: min(62vh, 460px);
  margin-top: 8px;
}

.drill-card {
  grid-area: card;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  touch-action: none;
  user-select: none;
  text-align: center;
  z-index: 2;
  cursor: grab;
}

.drill-card.is-dragging {
  cursor: grabbing;
}

.drill-card-kind {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.drill-card-main {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}

.drill-card-translit {
  color: var(--accent-2);
  font-size: 14px;
}

/* Free pronunciation playback via the browser's built-in speechSynthesis —
   see core/speech.js. Only rendered when a real uk-UA voice is available. */
.speak-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  vertical-align: middle;
  opacity: 0.85;
}
.speak-btn:hover {
  opacity: 1;
}
.speak-btn:active {
  transform: scale(0.92);
}

/* "Listen & Choose" round — no text shown until after answering, so the
   speaker icon itself is the whole prompt and needs real visual weight. */
.listen-prompt {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}
.listen-prompt .speak-btn {
  font-size: 48px;
  opacity: 1;
}
.listen-reveal {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.drill-card.is-correct {
  border-color: var(--good);
}

.drill-card.is-incorrect {
  border-color: var(--bad);
}

.tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  line-height: 1.25;
  color: var(--text);
  transition: background 120ms ease, border-color 120ms ease;
}

.tile-up { grid-area: up; }
.tile-down { grid-area: down; }
.tile-left { grid-area: left; }
.tile-right { grid-area: right; }

.tile-text {
  font-weight: 600;
}

.tile-translit {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 2px;
}

.tile.is-correct {
  background: rgba(52, 211, 153, 0.18);
  border-color: var(--good);
}

.tile.is-incorrect {
  background: rgba(248, 113, 113, 0.18);
  border-color: var(--bad);
}

.drill-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
}

/* ---------- diagnostic screen ---------- */
.diagnostic-screen, .lesson-detail-screen, .lessons-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.diagnostic-header, .lessons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.diagnostic-progress {
  color: var(--text-dim);
  font-size: 13px;
}

.diagnostic-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  min-height: 40vh;
  justify-content: center;
}

.diagnostic-prompt-label {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
}

.diagnostic-word {
  font-size: 28px;
  font-weight: 700;
}

.diagnostic-translit {
  color: var(--accent-2);
  font-size: 15px;
  margin-bottom: 8px;
}

.diagnostic-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.option-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  text-align: left;
}

.option-btn.is-correct {
  background: rgba(52, 211, 153, 0.18);
  border-color: var(--good);
}

.option-btn.is-incorrect {
  background: rgba(248, 113, 113, 0.18);
  border-color: var(--bad);
}

.diagnostic-summary {
  align-items: stretch;
  text-align: left;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
}

/* ---------- lessons list ---------- */
.lesson-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.lesson-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-order {
  color: var(--text-dim);
  font-size: 12px;
}

.lesson-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.lesson-card.status-not-started { border-left-color: var(--border); }
.lesson-card.status-learning { border-left-color: var(--accent); }
.lesson-card.status-learned { border-left-color: var(--good); }
.lesson-card.status-needs-review { border-left-color: var(--warn); }

.lesson-badge.status-learning { color: var(--accent); background: rgba(96,165,250,0.12); }
.lesson-badge.status-learned { color: var(--good); background: rgba(52,211,153,0.12); }
.lesson-badge.status-needs-review { color: var(--warn); background: rgba(251,191,36,0.12); }

.lesson-title {
  font-weight: 700;
  font-size: 16px;
}

.lesson-summary {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
}

.progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 200ms ease;
  min-width: 3px;
}

.status-learned .progress-bar-fill {
  background: var(--good);
}

.status-needs-review .progress-bar-fill {
  background: var(--warn);
}

.progress-line {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 4px;
}

/* Compact lesson list rows — one line per lesson instead of title + summary +
   two badges + a labelled progress line, per "too much info, overwhelming"
   feedback. The detail page still shows the full breakdown. */
/* Compound selector for higher specificity than both the base .lesson-list
   rule above AND the >=600px .lesson-list media-query override below — one
   lesson per row at every viewport width is the whole point of this layout. */
.lesson-list.lesson-list--compact {
  grid-template-columns: 1fr;
  gap: 4px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 24px 30px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
}

/* Completion leans on green throughout the row, not just the medal icon —
   a completed row is visually unmistakable at a glance while scrolling.
   Bumped up hard (was a barely-visible 6% tint / 3px border) per direct
   "not using enough green" feedback — this needs to read at a glance while
   scrolling fast, not on close inspection. */
.lesson-row.status-learned { border-left-color: var(--good); border-left-width: 5px; background: rgba(52,211,153,0.16); }
.lesson-row.status-needs-review { border-left-color: var(--warn); }
.lesson-row.status-learning { border-left-color: var(--accent); }

.lesson-row-order {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

.lesson-row-badge {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid transparent;
  box-sizing: border-box;
}

/* Confirmed-mastery tiers (bronze/silver/gold) are real Drill evidence, so
   they ALL get a solid green ring — green means "confirmed," full stop,
   with the medal color only differentiating tier within that. The
   fast-track lightning bolt gets the opposite treatment on purpose: a
   dashed, hollow, blue outline that reads as "pending / not yet confirmed"
   — a structural (not just color) difference from the solid ring, so it
   can't be mistaken for a real badge even at a glance. */
.lesson-row-badge.badge-gold { background: rgba(251,191,36,0.35); border-color: var(--good); }
.lesson-row-badge.badge-silver { background: rgba(148,163,184,0.35); border-color: var(--good); }
.lesson-row-badge.badge-bronze { background: rgba(217,119,6,0.3); border-color: var(--good); }
.lesson-row-badge.badge-fasttrack { background: transparent; border: 2px dashed var(--accent-2); color: var(--accent-2); }
.lesson-row-badge.badge-progress { background: var(--surface-2); color: var(--text-dim); font-size: 10px; font-weight: 700; border-color: var(--border); }
.lesson-row-badge.badge-none { color: var(--text-dim); border-color: var(--border); }
.lesson-row-badge.badge-locked { color: var(--text-dim); border-color: var(--border); }

.lesson-row-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-row-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.lesson-row-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  min-width: 2px;
}

.lesson-row.status-learned .lesson-row-bar-fill { background: var(--good); }
.lesson-row.status-needs-review .lesson-row-bar-fill { background: var(--warn); }

.lesson-detail-progress {
  margin-bottom: 4px;
}

/* "Confirm what you already know" lessons stay in their normal scroll
   position — no separate duplicate section — just visually greyed/tinted
   here, and the list auto-scrolls to the first one on open (see
   lessons-ui.js renderList). Blue to match the lightning-bolt badge. */
.lesson-row.is-fasttrack {
  background: rgba(96,165,250,0.08);
  border-left-color: var(--accent-2);
}

/* ---------- lesson detail ---------- */
.lesson-detail-title {
  font-size: 22px;
}

.lesson-detail-summary {
  color: var(--text-dim);
  margin: 0 0 4px;
}

.lesson-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.lesson-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.pattern-block, .example-block, .sub-block {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.pattern-block:first-child, .example-block:first-child, .sub-block:first-child {
  border-top: none;
  padding-top: 0;
}

.pattern-uk, .example-uk, .sub-template {
  font-size: 17px;
  font-weight: 600;
}

.pattern-translit, .example-translit {
  color: var(--accent-2);
  font-size: 13px;
  margin-top: 2px;
}

.pattern-en, .example-en, .sub-en {
  margin-top: 4px;
  color: var(--text);
}

.pattern-cz, .example-cz {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 13px;
}

.sub-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sub-chip, .item-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.lesson-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lesson-note p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Word tokens styling for interactive modals */
.interactive-word-token {
  display: inline-block;
  cursor: pointer;
  border-bottom: 1px dashed var(--accent-2);
  padding: 0 2px;
  margin: 0 1px;
  border-radius: 3px;
}
.interactive-word-token:hover {
  background: var(--surface-2);
  color: var(--accent);
}

/* Modal styling */
.word-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.word-modal-content {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  position: relative;
  text-align: left;
}
.word-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.word-modal-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 16px;
  margin-bottom: 6px;
}
.word-modal-meanings {
  font-size: 16px;
  line-height: 1.4;
}
.word-modal-related-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.word-modal-related-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.word-modal-related-item:hover {
  border-color: var(--accent-2);
}
.word-modal-related-word {
  font-weight: 600;
  color: var(--text);
}
.word-modal-related-en {
  font-size: 13px;
  color: var(--text-dim);
}
.word-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}
.word-modal-close:hover {
  color: var(--text);
}

/* Remediation modal (3-wrong-in-a-row / "I don't know") */
.remediation-modal-content {
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  border-color: var(--warn);
}
.remediation-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--warn);
  margin-bottom: 8px;
}
.remediation-modal-summary {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.remediation-pattern {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.remediation-pattern-uk {
  font-weight: 600;
  color: var(--text);
}
.remediation-translit {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 13px;
}
.remediation-pattern-en {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.remediation-example {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.remediation-example-uk {
  font-weight: 600;
}
.remediation-example-en {
  color: var(--text-dim);
}

/* Badge celebration screen (batched, confirmed-only) */
.badge-modal-content {
  max-width: 420px;
  border-color: var(--good);
  text-align: center;
}
.badge-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--good);
  margin-bottom: 4px;
}
.badge-modal-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.badge-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.badge-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid var(--good);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
}
.badge-modal-icon {
  font-size: 26px;
}
.badge-modal-tier {
  font-weight: 700;
  color: var(--good);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-modal-lesson {
  font-size: 14px;
  color: var(--text);
}

/* Sentence Builder Container Styles */
.sentence-builder-slots {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: var(--surface-2);
  width: 100%;
}
.sentence-builder-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  width: 100%;
}
.sentence-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}
.sentence-chip:hover {
  border-color: var(--accent);
}
.sentence-chip.is-active {
  background: var(--surface-2);
  opacity: 0.5;
}

/* Modifiers Container Styles */
.modifiers-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
.modifier-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.modifier-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #05101f;
  font-weight: bold;
}

/* Drill text input style for semantic match */
.drill-text-input {
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  width: 100%;
  margin-top: 12px;
  outline: none;
}
.drill-text-input:focus {
  border-color: var(--accent);
}

/* IDK Button */
.btn-idk {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 12px;
}
.btn-idk:hover {
  border-color: var(--warn);
  color: var(--warn);
}

/* ---------- wider screens ---------- */
@media (min-width: 600px) {
  .home-modes {
    grid-template-columns: 1fr 1fr;
  }
  .lesson-list {
    grid-template-columns: 1fr 1fr;
  }
  .diagnostic-options--wide {
    max-width: 480px;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --text: #0f172a;
    --text-dim: #64748b;
    --border: #e2e8f0;
  }
}
