:root {
  color-scheme: light dark;
  --bg: #fafafa; --fg: #1a1a1a; --card: #fff; --border: #ddd; --accent: #2b6cb0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181c; --fg: #e8e8e8; --card: #21242b; --border: #383c44; --accent: #6ea8fe; }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 1.5rem; background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 640px; margin-inline: auto;
}
header { margin-bottom: 1.5rem; }
h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.tagline { margin: 0; opacity: 0.7; font-size: 0.9rem; }
h2 { font-size: 1.1rem; margin-top: 0; }
.hint { font-size: 0.85rem; opacity: 0.7; }

.sourceRow {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.sourceRow label { flex: 0 0 11rem; font-size: 0.9rem; }
.sourceRow input { flex: 1; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--fg); }
.note { font-size: 0.8rem; opacity: 0.65; }
.note.warn { color: #c05621; opacity: 1; }

button {
  padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--fg); cursor: pointer; font-size: 0.9rem; margin-top: 0.75rem; margin-right: 0.5rem;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }

.status { font-size: 0.85rem; opacity: 0.75; margin-top: 0.5rem; min-height: 1.2em; }

#summaryList { list-style: none; padding: 0; font-size: 0.9rem; }
#summaryList li { padding: 0.25rem 0; border-bottom: 1px solid var(--border); }

.progress { text-align: right; font-size: 0.8rem; opacity: 0.6; margin-bottom: 0.5rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem; text-align: center;
}
.cardSource { font-size: 0.75rem; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.04em; }
.cardFront { font-size: 1.8rem; margin: 0.5rem 0; }
.cardMedia iframe, .cardMedia audio { width: 100%; margin-top: 0.5rem; }
.cardBack { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.cardGloss div { font-size: 1.1rem; margin: 0.15rem 0; }
.cardExample { font-size: 0.95rem; margin-top: 0.75rem; opacity: 0.9; }
.exTranslation { opacity: 0.65; font-size: 0.85rem; }

.grades { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.gradeBtn { display: flex; flex-direction: column; align-items: center; min-width: 4.5rem; text-transform: capitalize; }
.gradePreview { font-size: 0.7rem; opacity: 0.6; }
.grade-again { border-color: #c53030; }
.grade-hard { border-color: #c05621; }
.grade-good { border-color: #2f855a; }
.grade-easy { border-color: #2b6cb0; }

#done { text-align: center; margin-top: 2rem; }
