[data-resume-dialog] > button { margin: 8px 8px 0 0; }
.resume-source { margin: 16px 0; padding: 16px; border: 1px solid var(--line, #dbe5d6); border-radius: 14px; }
.resume-source h3 { overflow-wrap: anywhere; }
.resume-source .small-note { margin-bottom: 12px; }
@media (max-width: 480px) {
  [data-resume-dialog] > button, .resume-source > button { width: 100%; margin-right: 0; }
}

.restore-panel { min-width: 0; overflow-wrap: anywhere; }
.restore-controls { padding: 0; border: 0; margin: 0; min-width: 0; }
.restore-panel fieldset:not(.restore-controls) { min-width: 0; margin: 16px 0; padding: 12px; border: 1px solid var(--line, #dbe5d6); border-radius: 12px; }
.restore-panel .field { display: grid; gap: 8px; margin: 16px 0; }
.restore-panel select, .restore-panel input[type=file] { width: 100%; max-width: 100%; min-width: 0; font: inherit; }
.restore-panel select { padding: 10px; }
.restore-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; }
.restore-check input[type=checkbox] { flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; }
.restore-check span { min-width: 0; }
.restore-originals { margin-top: 24px; border-top: 1px solid var(--line, #dbe5d6); padding-top: 12px; }
.restore-panel .button-row { flex-wrap: wrap; }
@media (max-width: 480px) { .restore-panel .button-row > button { width: 100%; } }

.restore-check small { display: block; color: var(--muted, #536a60); font-size: 14px; margin-top: 4px; }

/* Keep every learner avatar visible within narrow onboarding and add-learner forms.
   G2-W1 U04: the four companions share one row down to 320px instead of wrapping 3+1. */
#profile-form .avatar-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 76px)); gap: 8px; flex-wrap: nowrap; }
#profile-form .avatar-choice { min-width: 0; width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
#profile-form .avatar-choice .avatar.big { width: 100%; height: 100%; font-size: clamp(24px, 9vw, 38px); }

/* G2-W1 U02: a visible sign-in entry on the first screen, before any guest learner exists. */
.welcome-sign-in { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 18px; padding: 10px 14px; border: 1px solid var(--line, #dbe5d6); border-radius: 14px; font-size: 14px; color: var(--ink, #294439); }
.welcome-sign-in .secondary { min-height: 44px; padding: 8px 18px; }

/* G2 R1-H4: a confirmed deletion waits 10 seconds with an Undo button. */
.undo-delete-bar { position: fixed; left: 16px; right: 16px; bottom: 96px; z-index: 50; max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--paper, #fff); border: 1px solid var(--line, #dbe5d6); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); color: var(--ink, #294439); font-size: 14px; }
.undo-delete-bar .secondary { min-height: 44px; flex: none; }

/* G2 R1-M3: Jyutping help is open, at least 15px and in the ink colour (contrast well above 4.5:1).
   The build also lifts every font size below 14px in the copied stylesheets to 14px. */
.jyutping, .help-details, .help-details p { font-size: 16px !important; color: var(--ink, #294439) !important; }
.word-card .jyutping { font-size: 15px !important; }
.tone-note { margin: 6px 0 0; font-size: 14px; color: var(--ink, #294439); }
.quiz-jyutping { margin: 8px 0 0; }
.quiz-jyutping span { margin-right: 4px; }
.hint-answer .jyutping, .choice-help .jyutping { display: block; margin: 4px 0; }

/* G2 R1-M5: the parent chooses an age group. */
.age-label { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink, #294439); }
#age-error:empty { display: none; }

/* G2 R1-M10: restore a guest backup from the first screen. */
.welcome-restore { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--line, #dbe5d6); border-radius: 14px; font-size: 14px; color: var(--ink, #294439); }
.welcome-restore .secondary { min-height: 44px; padding: 8px 18px; }

/* G2 R1-M6: who is shown, the due words, and a learner switcher. */
.learner-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.learner-switch button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; }
.learner-switch button span:last-child { overflow-wrap: anywhere; }
.progress-learner { margin: 0 0 16px; font-size: 15px; color: var(--ink, #294439); }
.due-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.due-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; min-width: 0; }
.due-list li > span[aria-hidden] { grid-row: span 3; font-size: 22px; }
.due-list li > * { overflow-wrap: anywhere; }

/* G2 R1-M1: each lesson says whether it is free or part of the family course. */
.lesson-tag { display: inline-block; margin: 4px 0; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.lesson-tag.free { background: var(--mint, #e3eee1); color: #1d4a37; }
.lesson-tag.family { background: var(--peach, #f6e4d8); color: #6b3412; }

/* G2 R1-M11: account data in the privacy note. */
.privacy-account { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line, #dbe5d6); }
.privacy-account h3 { font-size: 16px; margin: 8px 0; }
