body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: #f7fbff;
  color: #243b53;
  margin: 0;
  padding: 1.5rem;
}
.app-shell {
  max-width: 38rem;
  margin: 0 auto;
}
.hero h1 {
  margin: 0 0 1rem;
}
.hidden {
  display: none !important;
}
.panel {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
label {
  display: block;
  margin: 0.75rem 0;
}
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #cfd8e3;
  border-radius: 0.25rem;
  box-sizing: border-box;
}
input::-ms-reveal {
  display: none;
}
button {
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #243b53;
  border-radius: 0.25rem;
  background: #243b53;
  color: #fff;
  margin-top: 0.5rem;
}
button.primary {
  background: #2557a7;
  border-color: #2557a7;
}
button.secondary {
  background: #fff;
  color: #243b53;
}
button.subtle {
  background: transparent;
  color: #243b53;
  border-color: transparent;
}
button.danger {
  color: #b00020;
}
.quiz-type-block {
  border: 1px solid #cfd8e3;
  border-radius: 0.25rem;
  margin: 0.75rem 0;
  padding: 0.25rem 0.75rem 0.5rem;
}
.quiz-type-block legend {
  padding: 0 0.25rem;
}
.quiz-type-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  align-items: baseline;
  margin: 0.5rem 0;
}
.quiz-type-choice input {
  margin: 0;
}
.quiz-type-name {
  font-weight: 600;
}
.quiz-type-description {
  grid-column: 2;
  font-size: 0.8125rem;
  color: #486581;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #486581;
}
.card {
  background: #eef4fb;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}
.french {
  font-style: italic;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.card-top h2 {
  margin: 0;
}
.person-badge {
  background: #243b53;
  color: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.form-line {
  font-size: 1.125rem;
  margin: 0.5rem 0 0;
}
.english-tip {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
}
.tip-parallel {
  background: #cfe1fb;
  color: inherit;
  padding: 0 0.15em;
  border-radius: 0.2em;
}
.dictation-instruction {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #486581;
}
/* Grammatical jargon is italicized; the gloss itself stays roman. */
.pos-badge {
  font-style: italic;
  color: #486581;
  white-space: nowrap;
}
.flashcard-context {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #486581;
}
.flashcard-banner {
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  background: #fdf3d7;
  color: #7a5900;
  font-size: 0.875rem;
}
.flashcard-excluded {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #b00020;
}
.dictation-controls {
  display: flex;
  gap: 0.5rem;
}
.dictation-controls button {
  margin-top: 0.75rem;
}
.dictation-controls button.loading {
  opacity: 0.6;
  cursor: progress;
}
/* Dictation answers are full sentences: let the blank wrap. */
.dictation .answer-template {
  font-size: 1.25rem;
}
.dictation .answer-template-underline {
  white-space: normal;
}
.dictation .answer-template-blank {
  white-space: pre-wrap;
}
.answer-block-label {
  display: block;
  margin: 0.75rem 0 0.25rem;
}
.form-row {
  position: relative;
  margin-bottom: 0.75rem;
}
/* Keep inputs focusable while the template blank displays the answer. */
.form-row .quiz-answer {
  position: absolute;
  inset: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}
.answer-template {
  font-size: 1.5rem;
  text-align: center;
  margin: 0.75rem 0 0.5rem;
  color: #243b53;
  letter-spacing: 0.02em;
  line-height: 1.6;
  cursor: text;
  user-select: none;
}
.form-row .answer-template {
  margin: 0.25rem 0;
}
.form-label-chip {
  display: inline-block;
  margin-left: 0.5em;
  padding: 0 0.5em;
  border-radius: 999px;
  background: #eef4fb;
  color: #486581;
  font-size: 0.75rem;
  letter-spacing: normal;
  vertical-align: 0.25em;
}
.answer-echo-mirror {
  color: #829ab1;
}
.mirror-note {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #486581;
}
.answer-template-hint {
  margin-right: 0.4em;
}
.answer-template-underline {
  border-bottom: 2px solid #243b53;
  padding-bottom: 0.15em;
  white-space: nowrap;
}
.answer-template-underline.focused {
  border-bottom-color: #2557a7;
}
.answer-template-blank {
  display: inline-block;
  min-width: 9em;
  white-space: pre;
}
.answer-echo-placeholder {
  color: #829ab1;
}
.answer-echo-selection {
  background: #cfe1fb;
}
.answer-echo-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin: 0 -1px;
  vertical-align: -0.1em;
  background: #2557a7;
  animation: answer-echo-blink 1.1s steps(2) infinite;
}
@keyframes answer-echo-blink {
  to {
    visibility: hidden;
  }
}
.answer-template-underline.off-track {
  border-bottom-color: #b45309;
}
.answer-template-underline.off-track .answer-template-blank {
  color: #b45309;
}
.answer-warning {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #b45309;
}
.character-palette {
  margin: 0.5rem 0;
}
.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.palette-row + .palette-row {
  margin-top: 0.25rem;
}
.character-button {
  background: #fff;
  color: #243b53;
  border-color: #cfd8e3;
  padding: 0.25rem 0.5rem;
  margin: 0;
  min-width: 2.1em;
  box-sizing: border-box;
}
.palette-shift.active {
  background: #243b53;
  border-color: #243b53;
  color: #fff;
}
.input-mode-row {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #486581;
}
.input-mode-row button {
  margin: 0;
  padding: 0.1rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #2557a7;
  font-size: inherit;
}
.input-mode-row button.active {
  background: #eef4fb;
  border-color: #cfd8e3;
  color: #243b53;
  cursor: default;
}
body.keyboard-docked {
  padding-bottom: 14rem;
}
.onscreen-keyboard {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0.4rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: #dde5ee;
  user-select: none;
  touch-action: manipulation;
}
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  max-width: 30rem;
  margin: 0 auto 0.3rem;
}
.keyboard-row:last-child {
  margin-bottom: 0;
}
.key {
  flex: 1 1 0;
  max-width: 2.75rem;
  margin: 0;
  padding: 0.65rem 0;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
  background: #fff;
  color: #243b53;
  border: 1px solid #b9c6d6;
  border-radius: 0.3rem;
  box-shadow: 0 1px 0 #b9c6d6;
}
.key-shift,
.key-backspace {
  flex: 1.6 1 0;
  max-width: 4.25rem;
  background: #eef4fb;
}
.key-shift.active {
  background: #243b53;
  border-color: #243b53;
  color: #fff;
}
.key-space {
  flex: 5 1 0;
  max-width: 15rem;
}
.key-enter {
  flex: 2 1 0;
  max-width: 6rem;
  background: #2557a7;
  border-color: #2557a7;
  color: #fff;
}
.feedback-line {
  margin: 0.5rem 0;
}
.feedback-line.hidden {
  display: none;
}
.feedback-forms {
  margin: 0.75rem 0;
}
.feedback-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em;
  margin: 0.4rem 0;
  font-size: 1.125rem;
}
.feedback-form-row .form-label-chip {
  margin-left: 0;
  vertical-align: baseline;
}
.feedback-mark.correct {
  color: #1b5e20;
}
.feedback-mark.incorrect {
  color: #b00020;
}
.feedback-blank {
  color: #b00020;
}
.feedback-expected {
  font-weight: 600;
}
.feedback-diff-row {
  margin: -0.2rem 0 0.5rem 1.6em;
  font-size: 1.125rem;
  white-space: pre-wrap;
}
.feedback-alternatives {
  margin: 0.75rem 0;
}
.feedback-alternatives-heading {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: #486581;
}
.feedback-alternative {
  margin: 0.3rem 0;
}
.feedback-alternative .form-label-chip {
  margin-left: 0.6em;
}
.feedback-ipa {
  color: #486581;
}
.example-translation.approx {
  color: #829ab1;
}
.diff-equal {
  color: #486581;
}
.diff-remove {
  color: #b00020;
  background: #fbd5d5;
  text-decoration: line-through;
  border-radius: 0.15em;
}
.diff-add {
  color: #1b5e20;
  background: #d1f0d3;
  border-radius: 0.15em;
}
.status-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  margin: 0;
}
.status-pill.correct {
  background: #d1f0d3;
  color: #1b5e20;
}
.status-pill.incorrect {
  background: #fbd5d5;
  color: #b00020;
}
.results-list {
  padding-left: 1.25rem;
}
.results-list li {
  margin-bottom: 0.5rem;
}
.result-mark {
  display: inline-block;
  min-width: 1.2em;
  font-weight: 600;
}
.result-mark.first-try {
  color: #1b5e20;
}
.result-mark.retried {
  color: #b45309;
}
.result-mark.missed {
  color: #b00020;
}
.notice {
  padding: 0.5rem 0.75rem;
  background: #fff3cd;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
}
.version-badge {
  position: fixed;
  right: 0.5rem;
  bottom: 0.25rem;
  margin: 0;
  font-size: 0.7rem;
  color: #486581;
}
body:not([data-env="prod"]) {
  background: #fffbeb;
  padding-top: 2.75rem;
}
body:not([data-env="prod"])::before {
  content: attr(data-env);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0.2rem 0;
  background: #b45309;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}
