:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --fg: #e7ecf3;
  --muted: #8b9aab;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f9;
    --fg: #1a2332;
    --muted: #5c6b7f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.shell--narrow {
  max-width: 22rem;
}

.error {
  color: #f87171;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

input[type="text"],
input[type="password"] {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-size: 1rem;
}

:root {
  --accent: #3d8bfd;
  --border: #2a3544;
}

@media (prefers-color-scheme: light) {
  :root {
    --border: #d8dee8;
  }
}

button {
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

button.is-busy {
  cursor: wait;
}

.btn-secondary {
  width: auto;
  margin-top: 1.5rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

[hidden] {
  display: none !important;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.app-header h1 {
  margin: 0;
}

.build-tag {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
}

.screen-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.screen-title--lesson {
  text-transform: none;
  letter-spacing: normal;
  font-size: 1.35rem;
  color: var(--fg);
}

.stub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0.5rem 0 0;
}

.mode-panel {
  margin-top: 0.5rem;
}

.exercises-skip-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 0.35rem 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exercise-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.exercise-row--skipped {
  opacity: 0.45;
}

.exercise-skip {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.exercise-text {
  font-size: 1.05rem;
  line-height: 1.45;
  flex: 1;
}

.exercise-prefix {
  color: var(--muted);
}

.exercise-text strong {
  font-weight: 700;
}

.btn-enable-all {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
}

.menu-btn--primary {
  border-color: var(--accent);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-btn {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  font-weight: 500;
}

.menu-btn:not(:disabled):hover {
  border-color: var(--accent);
  filter: none;
}

.menu-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.btn-back {
  width: auto;
  margin: 0 0 1rem;
  padding: 0.4rem 0;
  background: transparent;
  color: var(--accent);
  border: none;
  font-size: 0.95rem;
}

.btn-back:hover {
  filter: none;
  text-decoration: underline;
}

.btn-compact {
  margin-top: 0;
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.train-prompt {
  font-size: 1.2rem;
  line-height: 1.45;
  margin: 0 0 0.75rem;
}

.train-prompt-en {
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.train-build-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.train-word-btn {
  width: auto;
  padding: 0.45rem 0.65rem;
  font-size: 0.95rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.train-build-answer {
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.train-text-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-size: 1rem;
}

.train-feedback {
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
}

.train-feedback--ok {
  color: #4ade80;
}

.train-feedback--bad {
  color: #f87171;
}

.train-correct {
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.train-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.train-actions button {
  width: auto;
  flex: 1;
  min-width: 7rem;
}
