:root {
  --page-bg: #f5f5f5;
  --surface: #fff;
  --text: #222;
  --text-muted: #536176;
  --accent: #1d4ed8;
  --play: #166534;
  --play-hover: #14532d;
  --score-good: #1a6b1a;
  --score-good-bg: #e6f4ea;
  --score-fair: #8a5000;
  --score-fair-bg: #fff7e6;
  --danger: #b91c1c;
  --danger-bg: #fff0f0;
}

.exercises { margin: 1rem 0; }
.exercises[hidden] { display: none; }
.samples[hidden] { display: none; }
.exercises label { display: block; margin-bottom: .4rem; font-weight: 600; }
.exercises select { max-width: 100%; padding: .5rem; font: inherit; color: inherit; background: var(--surface); border: 1px solid #888; border-radius: 6px; }
.exercise-sentences { display: flex; flex-wrap: wrap; gap: .5rem; }
.exercises button { padding: .5rem .75rem; font: inherit; text-align: left; color: inherit; background: transparent; border: 1px solid #888; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.exercises button[aria-pressed="true"] { border-width: 2px; font-weight: 600; }
.exercises button:disabled, .exercises select:disabled { opacity: .55; cursor: default; }
.exercises :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.exercises p { margin: .75rem 0 .4rem; }
.top-bar .axis-label, .top-bar .home-link { color: var(--text-muted); }
.top-bar .lang-btn:hover { color: var(--accent); }
.top-bar .lang-btn.active { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.top-bar .practice-btn:hover { color: var(--play); }
.top-bar .practice-btn.active { background: var(--play); border-color: var(--play); color: var(--surface); }

@media (max-width: 680px), (pointer: coarse) {
  .top-bar { flex-wrap: wrap; }
  .top-bar .top-controls { min-width: 0; align-items: flex-start; flex-shrink: 1; }
  .top-bar .axis-group, .top-bar .lang-bar, .top-bar .practice-bar { flex-wrap: wrap; }
  .top-bar .lang-btn, .top-bar .practice-btn, .top-bar .home-link,
  .exercises select, .exercises button, .controls button.ctrl { min-height: 44px; min-width: 44px; }
  .top-bar .home-link { display: inline-flex; align-items: center; }
}
.word-chip[aria-expanded] {
  min-width: 44px;
  min-height: 44px;
  padding-inline: .5rem;
}
button.word-chip {
  font-family: inherit;
  background-color: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
}
.word-chip[aria-expanded]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.standalone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.standalone-content button.history-header-label {
  min-height: 44px;
  padding-inline: .5rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.standalone-content .history-header {
  flex-wrap: wrap;
}
.standalone-content .history-header .btn-try-again { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
