/* Skilly CVI · Lüli v3. Shared design tokens and components for the learning app. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./fonts/PlusJakartaSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --primary: #3657ff;
  --primary-hover: #2743d8;
  --ink: #18233d;
  --muted: #5e687c;
  --bg: #f7f7f2;
  --paper: #fff;
  --line: #d9dde5;
  --lime: #d9f75d;
  --sky: #ddeaff;
  --lilac: #e9e3ff;
  --green: #216e4b;
  --mint: #e4f3e9;
  --orange: #8a5200;
  --peach: #fff0d4;
  --red: #b0343e;
  --error: #fcebed;
  --radius: 20px;
  --shadow: 0 8px 28px #18233d08;
  --ease: cubic-bezier(.2,.7,.2,1);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
  accent-color: var(--primary);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 18px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:where(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px,3.6vw,40px); line-height: 1.2; letter-spacing: -.045em; font-weight: 800; margin-bottom: 16px; overflow-wrap: anywhere; }
h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.035em; font-weight: 750; margin-bottom: 0; }
h3 { font-size: 21px; line-height: 1.35; letter-spacing: -.025em; font-weight: 750; }
p { margin-bottom: 16px; }
small, .tiny { font-size: 14px; line-height: 1.6; }
svg { flex-shrink: 0; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.wide { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 300; background: var(--ink); color: white; padding: 14px 20px; border-radius: 12px; }
.skip-link:focus { top: 12px; }
.header { max-width: 1280px; min-height: 104px; margin: auto; padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; border-radius: 4px; }
.brand img { width: 178px; height: auto; display: block; }
.header nav { display: flex; gap: 6px; align-items: center; }
.header nav a { padding: 11px 15px; font-size: 14px; line-height: 22px; font-weight: 600; white-space: nowrap; color: var(--muted); border-radius: 12px; transition: background 160ms; }
.header nav a:hover { background: white; color: var(--ink); }
.header nav a.active { background: var(--ink); color: white; }
.header nav a.active:focus-visible { outline-offset: 4px; }
.header-note { font-size: 12px; font-weight: 650; padding: 9px 14px; border-radius: 100px; background: var(--lime); color: var(--ink); }
main { max-width: 1280px; padding: 0 40px; margin: 16px auto 64px; min-height: 65vh; }
main:focus { outline: none; }
.eyebrow { font-size: 11px; letter-spacing: .13em; font-weight: 750; color: var(--primary-hover); margin-bottom: 16px; line-height: 1.5; }
.hero { position: relative; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 28px; min-height: 352px; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 32px; padding: 40px 48px; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(40px,4.8vw,60px); line-height: 1.06; letter-spacing: -.055em; margin-bottom: 20px; }
.hero h1 span { color: var(--primary); }
.hero-copy > p:not(.eyebrow) { color: var(--muted); max-width: 440px; margin-bottom: 24px; }
.hero .button-row { gap: 16px; }
.hero-art { align-self: center; display: grid; place-items: center; min-width: 0; width: 100%; }
.hero-illustration { display: block; width: 100%; max-width: 460px; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.button { border: 1px solid transparent; border-radius: 12px; min-height: 48px; padding: 13px 20px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; line-height: 1.45; transition: background 160ms,border-color 160ms,box-shadow 160ms; color: var(--ink); text-align: center; }
.primary { background: var(--primary); color: white; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.secondary { background: white; border-color: var(--line); }
.secondary:hover:not(:disabled) { border-color: var(--primary); background: #f5f7ff; }
.soft { background: var(--sky); color: var(--primary-hover); }
.soft:hover { background: #cadcff; }
.mint-button { background: var(--mint); color: var(--green); }
.small { font-size: 14px; min-height: 44px; padding: 10px 16px; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 0; min-height: 44px; background: none; border: 0; font-size: 14px; font-weight: 650; color: var(--primary-hover); text-underline-offset: 4px; }
.text-button:hover { text-decoration: underline; }
.button-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--sky); color: var(--primary-hover); }
.danger { color: var(--red); }
.danger:hover { color: var(--red); background: var(--error); }
.dashed { border-style: dashed; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 20px; }
.back:hover { color: var(--primary); }
.stats-strip { display: grid; grid-template-columns: repeat(3,1fr); padding: 28px 0; margin: 8px 0 32px; border-bottom: 1px solid var(--line); }
.stats-strip > div { display: flex; gap: 16px; align-items: center; justify-content: center; border-right: 1px solid var(--line); }
.stats-strip > div:last-child { border: 0; }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lilac { background: var(--lilac); color: var(--primary-hover); }
.green { background: var(--mint); color: var(--green); }
.peach { background: var(--peach); color: var(--orange); }
.stats-strip strong { font-size: 28px; font-weight: 800; line-height: 1.25; display: block; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.stats-strip strong small { font-size: 16px; color: var(--muted); font-weight: 500; }
.stats-strip div div > span { font-size: 13px; color: var(--muted); display: block; margin-top: 4px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title .eyebrow { margin-bottom: 8px; font-size: 10px; }
.section-title h2 { font-size: 30px; }
.count { font-size: 14px; display: inline-flex; background: var(--line); color: var(--ink); border-radius: 8px; padding: 4px 9px; vertical-align: middle; margin-left: 8px; letter-spacing: 0; }
.filters { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 20px; }
.filter-tabs { display: flex; gap: 4px; padding: 4px; background: #eceee8; border-radius: 14px; }
.filter { border: 0; background: none; color: var(--muted); border-radius: 10px; padding: 10px 16px; min-height: 44px; font-size: 14px; font-weight: 650; }
.filter:hover { color: var(--ink); }
.filter.selected { color: var(--ink); background: white; box-shadow: 0 2px 5px #18233d09; }
.search { display: flex; align-items: center; gap: 10px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; width: 280px; }
.search:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.search input { border: 0; outline: 0; background: transparent; font-size: 14px; padding: 13px 0; width: 100%; min-width: 0; margin: 0; color: var(--ink); }
.lesson-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.lesson-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; transition: box-shadow 160ms,border-color 160ms; min-width: 0; }
.lesson-card:hover { box-shadow: var(--shadow); border-color: #acb8f4; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 22px; }
.card-book { display: inline-flex; color: var(--primary); }
.lesson-card.en .card-book { color: var(--green); }
.badge { font-size: 11px; font-weight: 750; padding: 6px 10px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lavender { background: var(--sky); color: var(--primary-hover); }
.mint { background: var(--mint); color: var(--green); }
.language-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.lesson-card h3 { font-size: 21px; margin-bottom: 14px; overflow-wrap: anywhere; }
.lesson-card h3 a:hover { color: var(--primary); }
.lesson-meta { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.lesson-meta > span { margin: 0 7px; }
.card-progress { margin-top: auto; }
.card-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 9px; color: var(--muted); }
.card-progress strong { color: var(--primary-hover); font-weight: 700; }
.progress-track { height: 6px; border-radius: 10px; background: #e8ebf2; overflow: hidden; }
.progress-track > div { height: 100%; background: var(--primary); border-radius: 10px; transition: width 240ms; }
.card-bottom { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-bottom > span { font-size: 12px; }
.repeat-count { color: var(--orange); }
.empty-state { grid-column: 1/-1; min-height: 230px; background: white; border: 1px dashed #bcc4d3; border-radius: 20px; text-align: center; padding: 40px 24px; }
.empty-icon { color: var(--primary); display: inline-flex; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 10px; font-size: 23px; }
.empty-state p { font-size: 16px; color: var(--muted); }
.empty-state .button-row { justify-content: center; margin: 24px 0 16px; }
.empty-state small { color: var(--muted); }
.how-strip { margin: 36px 0 0; padding: 24px 28px; background: var(--ink); color: white; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.small-label { font-size: 10px; letter-spacing: .1em; color: #d4dbec; font-weight: 700; }
.how-strip > div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.how-strip > div > span { color: var(--lime); font-size: 11px; font-weight: 750; }
.how-strip > div svg { color: var(--lime); width: 19px; }
.how-strip > i { width: 24px; height: 1px; background: #526079; }
.footer { max-width: 1200px; margin: 0 auto; padding: 26px 0 32px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 20px; }
.footer a { display: inline-flex; }
.footer img { display: block; width: 118px; height: auto; }
.footer span:last-child { font-size: 12px; }
.page-heading { margin: 24px 0 32px; max-width: 900px; }
.page-heading .eyebrow { margin-bottom: 12px; }
.page-heading p.muted { font-size: 17px; max-width: 65ch; }
.panel { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 32px; min-width: 0; }
.panel > h2 { margin-bottom: 16px; }
label { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
input, select, textarea { display: block; width: 100%; background: white; border: 1px solid #b8c0ce; border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--ink); margin-top: 8px; line-height: 1.5; min-height: 48px; }
input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 400; opacity: 1; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { min-height: 0; }
input:disabled, select:disabled { background: #f1f2f5; color: var(--muted); }
.form-row { display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 20px; }
.form-error { font-size: 14px; color: var(--red); }
.notice { padding: 14px 16px; border-radius: 12px; font-size: 14px; margin-top: 16px; background: var(--sky); color: var(--ink); }
.warning { background: var(--peach); color: var(--orange); }
.success { background: var(--mint); color: var(--green); }
.editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 24px; align-items: start; }
.editor-main { padding: 32px; }
.editor-aside { background: var(--sky); border-radius: 20px; padding: 28px; }
.aside-icon { display: inline-flex; color: var(--primary-hover); margin-bottom: 24px; }
.editor-aside h3 { font-size: 24px; line-height: 1.3; }
.editor-aside p, .editor-aside li { font-size: 14px; color: var(--muted); line-height: 1.7; }
.editor-aside ol { padding-left: 20px; margin: 24px 0; }
.editor-aside li { padding-left: 4px; margin-bottom: 10px; }
.aside-note { border-top: 1px solid #bbcbe7; padding-top: 20px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.source-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 28px 0; }
.source-tabs button { border: 0; border-bottom: 3px solid transparent; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 8px; min-height: 48px; background: none; color: var(--muted); font-size: 13px; font-weight: 650; flex: 1; }
.source-tabs button.active { color: var(--primary-hover); border-bottom-color: var(--primary); }
.drop-zone { border: 1px dashed #9caee9; background: #f5f7ff; border-radius: 20px; padding: 32px 20px; text-align: center; }
.drop-zone.dragover { background: var(--sky); border-color: var(--primary); }
.upload-icon { display: flex; align-items: center; justify-content: center; background: var(--sky); border-radius: 18px; width: 64px; height: 64px; color: var(--primary); margin: 0 auto 20px; }
.drop-zone h3 { font-size: 24px; margin-bottom: 10px; }
.drop-zone p { font-size: 15px; color: var(--muted); }
.drop-zone .button-row { justify-content: center; margin: 24px 0; }
.drop-zone small { font-size: 12px; color: var(--muted); }
.file-label { position: relative; cursor: pointer; }
.file-label input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; opacity: 0; overflow: hidden; }
.file-label:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.photo-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.photo-preview { position: relative; width: 100px; height: 112px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview > span { position: absolute; bottom: 5px; left: 5px; font-size: 11px; background: white; padding: 2px 6px; border-radius: 4px; }
.photo-preview button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; background: white; color: var(--ink); border-radius: 0 0 0 12px; }
.heic-preview { display: flex; min-height: 112px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: var(--sky); color: var(--primary-hover); }
.connection-note { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); margin: 24px 0 20px; }
.connection-note svg { margin-top: 2px; }
.connection-note a { color: var(--primary-hover); text-decoration: underline; }
.model-label { margin-bottom: 20px; }
.editor-main > .tiny { margin-top: 16px; }
.paste-guide { background: var(--bg); border-radius: 16px; padding: 24px; margin-bottom: 24px; }
.paste-guide h3 { font-size: 20px; }
.paste-guide p { font-size: 14px; color: var(--muted); line-height: 1.8; }
.paste-guide .text-button { margin-left: 12px; }
.manual-intro { text-align: center; padding: 28px 16px; }
.manual-intro p { font-size: 16px; color: var(--muted); max-width: 440px; margin: 16px auto 24px; }
.review-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 28px 0 20px; }
.review-heading h3 { margin: 0; font-size: 18px; }
.edit-word { border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.edit-word-head { display: flex; align-items: center; justify-content: space-between; margin-top: -8px; margin-bottom: 8px; }
.edit-word-head > span { font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.word-inputs { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }
.edit-word details { margin-top: 16px; }
summary { cursor: pointer; padding: 10px 0; min-height: 44px; }
.edit-word summary { font-size: 14px; color: var(--primary-hover); }
.edit-word details[open] > summary { margin-bottom: 12px; }
.compact-label { margin-top: 16px; }
.save-bar { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; margin-top: 28px; }
/* Lessons and learning materials. */
.lesson-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; }
.lesson-heading h1 { margin-top: 18px; max-width: 900px; }
.lesson-heading .muted { font-size: 16px; margin: 0; }
.lesson-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 28px 0 16px; }
.lesson-toolbar p { font-size: 17px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.word-list { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: white; }
.word-row { display: flex; gap: 24px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.word-row:last-child { border: 0; }
.row-number { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.word-content { flex: 1; min-width: 0; }
.word-content strong { font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.word-content p { font-size: 16px; color: var(--muted); margin: 5px 0 0; overflow-wrap: anywhere; }
.word-content small { display: block; margin-top: 6px; font-size: 13px; }
.word-note { color: var(--orange); }
.word-actions { display: flex; align-items: center; gap: 4px; }
.word-status { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 8px; }
.correct { background: var(--mint); color: var(--green); }
.again { background: var(--peach); color: var(--orange); }
.recorded { color: var(--green); }
.lesson-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; }
.lesson-footer p { margin: 0; max-width: 60%; }
.learning-step { font-size: 11px; font-weight: 650; color: var(--muted); background: var(--bg); padding: 6px 10px; border-radius: 100px; white-space: nowrap; }
.lesson-heading .learning-step { display: inline-block; margin-left: 10px; }
.lesson-materials { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 28px; padding: 20px 24px; background: #eeefe8; border: 1px solid #dfe2d5; border-radius: 16px; }
.lesson-material { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lesson-material > div { display: grid; gap: 3px; min-width: 0; }
.lesson-material strong { font-size: 15px; overflow-wrap: anywhere; }
.lesson-material span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.lesson-material .material-pages { color: var(--ink); font-weight: 650; }
.material-cover { display: block; flex: 0 0 auto; line-height: 0; border-radius: 3px; box-shadow: 0 2px 5px #18233d18; }
.material-cover img { display: block; width: 48px; height: 64px; object-fit: contain; border-radius: 3px; }
.lesson-materials.compact { display: grid; gap: 12px; margin: 0 0 16px; padding: 12px; border: 0; border-radius: 12px; background: var(--bg); }
.compact .lesson-material { gap: 10px; }
.compact .lesson-material strong { font-size: 12px; }
.compact .lesson-material span { font-size: 11px; }
.compact .material-cover img { width: 33px; height: 44px; }
.study-guide { margin-bottom: 24px; }
.study-guide h2 { margin-bottom: 20px; }
.study-goal { font-weight: 700; color: var(--ink); margin: 16px 0; }
.study-text { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.8; max-width: 70ch; }
.study-review { display: flex; align-items: flex-start; gap: 10px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--green); }
.study-review svg { margin-top: 3px; }
.study-help { text-align: left; padding: 4px 16px; margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.study-help summary { color: var(--primary-hover); font-weight: 650; }
.study-help .study-text { padding-bottom: 16px; }
.check-overview { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 32px; border: 1px solid #bfcef2; border-radius: 20px; background: var(--sky); margin-bottom: 28px; }
.check-overview .eyebrow { margin-bottom: 10px; }
.check-overview h2 { font-size: 30px; }
.check-overview p:not(.eyebrow) { font-size: 15px; color: var(--muted); margin: 12px 0 18px; }
.task-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.task-chips span { background: white; border-radius: 7px; padding: 6px 10px; font-size: 12px; color: var(--ink); }
.check-start { display: flex; flex-direction: column; align-items: center; gap: 12px; flex-shrink: 0; }
.check-start small { font-size: 12px; color: var(--muted); }
.lesson-parts { margin-bottom: 24px; }
.lesson-parts h3 { margin-bottom: 10px; }
.guide-editor, .task-editor { margin: 24px 0; padding: 12px 20px; border: 1px solid var(--line); border-radius: 16px; }
.guide-editor > summary, .task-editor > summary { font-weight: 700; font-size: 16px; }
.guide-editor[open], .task-editor[open] { padding-bottom: 20px; }
.guide-editor label, .edit-task label { display: block; font-size: 14px; margin-top: 16px; }
.guide-editor textarea, .guide-editor input, .edit-task input, .edit-task textarea, .edit-task select { width: 100%; margin-top: 8px; }
.materials-editor-title { font-size: 20px; margin: 28px 0 10px; }
.material-editor { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 16px; margin: 20px 0; }
.material-editor legend { font-size: 13px; color: var(--muted); padding: 0 8px; }
.material-editor .text-button { margin-top: 12px; }
.edit-task { border-top: 1px solid var(--line); padding: 12px 0; }
.edit-task summary { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.task-editor-image { display: block; max-width: 180px; max-height: 140px; object-fit: contain; margin: 16px 0; }
.edit-task .danger { margin-left: 16px; }
/* Focused practice: stable controls and explicit, colour-independent feedback. */
body:has(.practice-page) .footer { display: none; }
body:has(.practice-page) .header { min-height: 84px; padding-top: 16px; padding-bottom: 16px; }
main.practice-page { max-width: 1060px; min-height: 0; margin-top: 0; margin-bottom: 24px; }
.practice-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.practice-top .back { margin: 0; }
.practice-top > span:not(.badge) { font-size: 14px; color: var(--muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.practice-progress { display: flex; align-items: center; gap: 16px; margin: 18px auto 22px; max-width: 740px; font-size: 13px; color: var(--muted); }
.practice-progress .progress-track { flex: 1; }
.practice-progress strong { color: var(--ink); }
.practice-card { background: white; border: 1px solid var(--line); border-radius: 24px; padding: 28px 40px; margin: 0 auto; max-width: 740px; text-align: center; box-shadow: var(--shadow); }
.practice-steps { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.practice-steps > span { display: flex; align-items: center; gap: 7px; }
.practice-steps i { height: 1px; width: 32px; background: var(--line); }
.practice-steps .current { color: var(--primary-hover); font-weight: 700; }
.practice-steps .done { color: var(--green); }
.practice-card .eyebrow { font-size: 10px; margin-bottom: 10px; }
.practice-card h1 { font-size: 32px; margin-bottom: 12px; }
.practice-card > .muted { font-size: 15px; margin-bottom: 12px; }
.listen-button { border: 0; border-radius: 24px; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; margin: 24px auto 8px; background: var(--primary); color: white; transition: background 160ms; }
.listen-button:hover { background: var(--primary-hover); }
.listen-tools { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; color: var(--muted); }
.listen-tools .text-button { font-size: 13px; }
.audio-status { font-size: 13px; color: var(--orange); margin: 8px 0 14px; }
.audio-status:empty { display: none; }
.answer-input { text-align: center; font-size: 26px; font-weight: 500; letter-spacing: .02em; padding: 14px; margin: 16px 0 14px; background: var(--bg); border-color: #a9b6d2; }
.answer-input::placeholder { font-size: 17px; letter-spacing: 0; }
.skip { margin-top: 8px; font-size: 13px; color: var(--muted); }
.practice-encouragement { text-align: center; font-size: 13px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 8px; margin: 20px 0 0; }
.spelling-feedback { border-radius: 12px; padding: 14px 16px; text-align: left; display: flex; align-items: center; gap: 12px; font-size: 14px; margin-bottom: 20px; }
.spelling-feedback span { display: block; margin-top: 4px; font-size: 13px; word-break: break-word; }
.spelling-feedback strong { font-weight: 700; }
.revealed-word { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; }
.revealed-word h1 { margin: 0; overflow-wrap: anywhere; }
.meaning-question { font-size: 19px; font-weight: 700; margin: 24px 0 18px; }
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 15px; font-size: 16px; color: var(--ink); min-height: 58px; }
.choice > span:nth-child(2) { flex: 1; overflow-wrap: anywhere; }
.choice:hover:not(:disabled) { border-color: var(--primary); background: #f5f7ff; }
.choice-letter { width: 30px; height: 30px; flex: 0 0 30px; display: flex; justify-content: center; align-items: center; background: #f0f2f6; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.choice:disabled { opacity: 1; }
.choice.right { background: var(--mint); border-color: #8dbda2; color: var(--green); }
.choice.wrong { background: var(--error); border-color: #db9ba1; color: var(--red); }
.choice.dimmed { color: var(--muted); background: var(--bg); }
.meaning-feedback { text-align: left; padding: 16px; border-radius: 12px; margin: 20px 0 16px; font-size: 15px; }
.meaning-feedback p { margin: 6px 0 0; }
.dictation-hint { padding: 14px 16px; margin: 16px 0; border-radius: 12px; background: var(--bg); text-align: left; }
.dictation-hint span { font-size: 10px; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.dictation-hint p { margin: 6px 0 0; font-size: 16px; }
.dictation-definition { color: var(--ink); margin: 16px auto 20px; line-height: 1.5; font-size: 23px; font-weight: 500; max-width: 620px; }
.answer-label { font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
.answer-comparison { margin: 20px 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.large-word, .practice-card h1.large-word { font-size: clamp(28px,5vw,50px); font-weight: 750; letter-spacing: .02em; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; min-width: 0; }
.typed-word { color: var(--ink); }
.letter-right { color: var(--green); }
.letter-wrong { color: var(--red); background: var(--error); border-bottom: 3px solid var(--red); border-radius: 4px; padding: 0 2px; }
.letter-missing { display: inline-block; min-width: .55em; color: var(--red); background: var(--error); border: 2px dashed var(--red); border-radius: 4px; line-height: 1.12; margin: 0 2px; }
.letter-extra { text-decoration: line-through; text-decoration-thickness: 2px; }
.letter-correction { background: var(--mint); color: var(--green); border-radius: 4px; }
.diff-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }
.diff-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.diff-legend i { font-style: normal; font-weight: 750; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; border-radius: 4px; }
.legend-right { color: var(--green); background: var(--mint); }
.legend-wrong, .legend-extra { color: var(--red); background: var(--error); }
.legend-extra { text-decoration: line-through; }
.legend-missing { color: var(--red); border: 1px dashed var(--red); background: var(--error); }
.correct-answer { position: relative; padding: 10px 0 0; }
.correct-answer .revealed-word { margin-top: 0; }
.correct-answer .large-word { color: var(--green); }
.empty-answer { color: var(--muted); font-size: 20px; }
.answer-spark { position: absolute; color: var(--green); font-size: 18px; pointer-events: none; }
.spark-left { left: 5%; top: 24px; }
.spark-right { right: 5%; top: 12px; font-size: 13px; }
.word-arriving { animation: word-arrive 240ms var(--ease) both; }
@keyframes word-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.task-type { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.practice-card .task-instruction { font-size: 26px; line-height: 1.35; letter-spacing: -.025em; max-width: 600px; margin: 0 auto 20px; }
.task-stimulus { padding: 20px 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; font-size: 22px; line-height: 1.6; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.task-stimulus.short { font-size: 38px; font-weight: 750; letter-spacing: .02em; }
.task-stimulus.feedback-stimulus { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin: 16px 0 20px; font-size: 17px; line-height: 1.5; font-weight: 500; }
.stimulus-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.task-hint { font-size: 14px; color: var(--muted); margin: 12px 0 20px; }
.task-explanation { font-size: 19px; font-weight: 500; line-height: 1.6; color: var(--ink); margin: 20px auto; max-width: 590px; overflow-wrap: anywhere; }
.task-picture { display: block; max-width: 100%; width: 240px; height: 160px; object-fit: contain; margin: 0 auto 18px; border-radius: 14px; background: var(--bg); }
.check-card .practice-steps { margin-bottom: 16px; }
.task-source { font-size: 12px; color: var(--muted); margin: 24px 0 0; }
.task-word-bank { padding: 12px 16px; margin: 0 0 16px; background: var(--peach); border: 1px dashed #c9ac78; border-radius: 12px; text-align: left; }
.task-word-bank > span { font-size: 10px; font-weight: 750; letter-spacing: .1em; color: var(--orange); }
.task-word-bank p { font-size: 14px; line-height: 1.6; color: var(--ink); margin: 4px 0 0; }
.task-options { border: 0; padding: 0; margin: 20px 0 24px; display: grid; gap: 12px; text-align: left; min-width: 0; }
.task-option { display: flex; align-items: center; gap: 14px; padding: 16px; min-height: 56px; border: 1px solid #b8c0ce; border-radius: 12px; background: white; cursor: pointer; font-size: 16px; font-weight: 500; }
.task-option:hover { border-color: var(--primary); }
.task-option:has(input:checked) { border-color: var(--primary); background: var(--sky); box-shadow: inset 0 0 0 1px var(--primary); }
.task-option input, .review-checklist input { width: 20px; height: 20px; flex: 0 0 20px; padding: 0; margin: 0; }
.task-option span { overflow-wrap: anywhere; }
.task-order { list-style: none; padding: 0; margin: 16px 0 24px; display: grid; gap: 12px; counter-reset: order; }
.task-order li { counter-increment: order; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; }
.task-order li::before { content: counter(order); color: var(--primary-hover); font-weight: 750; min-width: 20px; }
.task-order li > span { flex: 1; overflow-wrap: anywhere; }
.task-order li > div { display: flex; flex-shrink: 0; gap: 4px; }
.task-order .icon-button { border-color: var(--line); background: white; color: var(--primary-hover); }
.reflection-label { text-align: left; font-size: 15px; margin-top: 20px; }
.reflection-label textarea { margin: 10px 0 14px; font-weight: 400; line-height: 1.7; }
.reflection-feedback { text-align: left; margin: 24px 0; }
.reflection-feedback h2 { font-size: 24px; margin-bottom: 16px; }
.reflection-feedback h3 { margin: 24px 0 10px; }
.reflection-feedback .task-explanation { font-size: 16px; margin: 0; white-space: pre-line; }
.reflection-feedback .study-text { background: var(--bg); border-radius: 12px; padding: 16px; }
.review-checklist { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 4px; }
.review-checklist label { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; padding: 12px 0; min-height: 44px; }
.review-checklist input { margin-top: 3px; }
.check-card .meaning-feedback { margin: 20px 0; padding: 20px; }
.check-card .meaning-feedback h2 { font-size: 24px; margin-bottom: 12px; }
.check-card .meaning-feedback p { margin-bottom: 8px; overflow-wrap: anywhere; }
.check-card.answer-state .task-explanation { font-size: 16px; margin: 20px 0; }
.check-card.answer-state .task-instruction { font-size: 24px; }
.next-key { font: inherit; font-size: 11px; font-weight: 500; padding: 3px 7px; border: 1px solid #ffffff70; background: #ffffff14; border-radius: 6px; white-space: nowrap; }
/* Feedback timer and personal learning rhythm. */
.advance-controls { display: flex; align-items: center; gap: 14px; margin: 12px 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); font-size: 13px; color: var(--muted); text-align: left; }
.advance-copy { flex: 1; min-width: 0; }
.advance-status { display: block; font-weight: 750; color: var(--ink); font-size: 14px; line-height: 1.4; }
.advance-copy > span { display: block; font-size: 12px; line-height: 1.5; margin-top: 4px; }
.advance-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.tempo-link { font-size: 12px; color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; display: flex; align-items: center; }
.advance-controls .advance-toggle { font-size: 13px; padding: 8px 0; }
.delay-button { border: 1px solid #b8c0ce; background: white; color: var(--primary-hover); border-radius: 12px; width: 44px; height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; font-size: 25px; line-height: 1; padding: 0; }
.delay-button:hover:not(:disabled) { background: var(--sky); border-color: var(--primary); }
.countdown-ring { --ring-offset: 100; --ring-color: var(--primary); position: relative; width: 64px; height: 64px; flex: 0 0 64px; color: var(--primary-hover); }
.countdown-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track, .ring-fill { fill: none; stroke-width: 5; }
.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--ring-color); stroke-dasharray: 100; stroke-dashoffset: var(--ring-offset); stroke-linecap: round; transition: stroke-dashoffset 50ms linear,stroke 160ms; }
.ring-center { position: absolute; inset: 10px; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 50%; background: white; line-height: 1; }
.ring-center strong { display: block; font-size: 25px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring-center small { font-size: 8px; font-weight: 650; letter-spacing: .04em; margin-top: 4px; color: var(--muted); }
.ring-center small:empty { display: none; }
.countdown-ring.is-wrong { --ring-color: var(--orange); color: var(--orange); }
.countdown-ring.is-paused { --ring-color: var(--muted); color: var(--muted); }
.countdown-ring.is-complete { --ring-color: var(--green); color: var(--green); }
.ring-spark { position: absolute; font-size: 16px; color: var(--green); opacity: 0; pointer-events: none; }
.spark-one { right: -4px; top: 3px; }
.spark-two { left: -5px; bottom: 3px; font-size: 12px; }
.is-complete .ring-spark { opacity: 1; }
.tempo-settings { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(260px,.85fr); gap: 40px; padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: white; margin-bottom: 28px; }
.tempo-copy h2 { font-size: 30px; margin: 0 0 12px; }
.tempo-copy > p:not(.eyebrow) { font-size: 16px; color: var(--muted); max-width: 460px; }
.tempo-copy .tempo-label { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.tempo-option { padding: 20px; margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.tempo-option.wrong { background: #fffcf6; border-color: #dccbad; }
.tempo-option.correct { background: #f4faf6; border-color: #b9d4c4; }
.tempo-option p { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.tempo-adjust { display: flex; gap: 20px; align-items: center; }
.tempo-value { display: flex; align-items: baseline; gap: 8px; min-width: 116px; justify-content: center; line-height: 1.1; }
.tempo-value output { font-size: 34px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tempo-value > span { font-size: 13px; color: var(--muted); }
.tempo-range { appearance: none; -webkit-appearance: none; border: 0; border-radius: 100px; width: 100%; height: 8px; min-height: 0; padding: 0; margin: 22px 0 14px; background: linear-gradient(to right,var(--primary) var(--range-fill,0%),var(--line) var(--range-fill,0%)); cursor: pointer; box-shadow: none; }
.tempo-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border: 4px solid white; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tempo-range::-moz-range-thumb { width: 16px; height: 16px; border: 4px solid white; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tempo-scale { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.tempo-copy p.tempo-saved { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--green); margin: 20px 0 0; }
.tempo-demo { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 20px; padding: 32px 24px; background: var(--sky); text-align: center; }
.tempo-demo .countdown-ring { width: 160px; height: 160px; flex-basis: 160px; }
.tempo-demo .ring-center { inset: 24px; }
.tempo-demo .ring-center strong { font-size: 54px; }
.tempo-demo .ring-center small { font-size: 11px; letter-spacing: .1em; margin-top: 8px; }
.tempo-demo .ring-track, .tempo-demo .ring-fill { stroke-width: 4; }
.tempo-demo .ring-track { stroke: #b5c8eb; }
.tempo-demo .ring-spark { font-size: 24px; }
.tempo-demo p { font-size: 16px; font-weight: 650; color: var(--ink); margin: 24px 0 16px; min-height: 24px; }
.tempo-demo .button { font-size: 13px; background: white; border-color: transparent; }
.tempo-demo .button + .button { margin-top: 10px; }
.demo-note { display: block; margin-top: 16px; font-size: 12px; color: var(--muted); }
.demo-star { display: none; }
/* Progress, settings and dialogs. */
.results-hero { text-align: center; background: var(--sky); border: 1px solid #bfcef2; border-radius: 28px; padding: 40px 28px; margin-bottom: 28px; }
.result-star { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; background: var(--lime); color: var(--ink); border-radius: 24px; margin-bottom: 20px; }
.results-hero .eyebrow { margin-bottom: 12px; }
.results-hero h1 { font-size: 36px; }
.results-hero > .muted { font-size: 16px; }
.result-stats { display: flex; justify-content: center; margin: 28px 0; gap: 64px; }
.result-stats > div { display: flex; flex-direction: column; }
.result-stats strong { font-size: 48px; color: var(--primary-hover); font-weight: 800; letter-spacing: -.05em; line-height: 1.2; }
.result-stats small { font-size: 24px; color: var(--muted); font-weight: 500; }
.result-stats span { font-size: 14px; color: var(--muted); margin-top: 8px; }
.results-hero .button-row { justify-content: center; }
.results-list h2 { margin-bottom: 24px; }
.result-row { display: flex; align-items: center; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.result-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.result-row strong { font-size: 17px; display: block; }
.result-row > div > span { font-size: 14px; color: var(--muted); }
.result-row small { display: block; margin: 6px 0; font-size: 13px; }
.result-detail { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.good { color: var(--green); }
.needs-work { color: var(--orange); }
.progress-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 28px; }
.summary-card { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.summary-card .stat-icon { margin-bottom: 24px; }
.summary-card strong { font-size: 38px; line-height: 1.3; font-weight: 800; letter-spacing: -.04em; display: block; }
.summary-card small { font-size: 18px; color: var(--muted); font-weight: 500; }
.summary-card p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.check-progress-summary { display: flex; gap: 16px; align-items: center; padding: 24px; border-radius: 16px; background: var(--lilac); color: var(--ink); margin: 0 0 24px; }
.check-progress-summary p { font-size: 14px; margin: 6px 0 0; color: var(--muted); }
.history-list { display: flex; flex-direction: column; margin-top: 20px; }
.history-row { padding: 20px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; }
.history-row:last-child { border: 0; }
.history-row > div:first-child { flex: 1; min-width: 0; }
.history-row strong { font-size: 16px; display: block; overflow-wrap: anywhere; }
.history-row small { font-size: 13px; color: var(--muted); }
.history-row > span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.settings-grid .panel h2 { font-size: 24px; margin-bottom: 16px; }
.settings-grid p { font-size: 16px; color: var(--muted); }
.settings-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--sky); color: var(--primary-hover); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.signin { background: var(--ink); color: white; margin-top: 16px; }
.signin:hover { background: #2b3957; }
.account-row { padding: 16px; border: 1px solid var(--line); border-radius: 12px; margin: 16px 0; }
.account-row strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.account-row small { display: block; color: var(--muted); font-size: 12px; margin: 6px 0; }
.account-row .button-row { margin-top: 10px; }
.account-row.active-account { border-color: var(--primary); background: #f5f7ff; }
.settings-list { padding: 0; list-style: none; margin: 24px 0; }
.settings-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 16px 0; }
.settings-list li > span { font-weight: 750; color: var(--primary-hover); }
.settings-list svg { margin-top: 2px; }
.settings-link { display: inline-block; padding: 8px 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; color: var(--primary-hover); }
.speech-settings select { margin: 8px 0 20px; }
.speech-settings .button-row { margin: 8px 0 16px; }
.speech-settings .button { font-size: 14px; }
.speech-settings p.speech-settings-status { font-size: 14px; min-height: 24px; }
.speech-settings p.speech-disclosure { font-size: 13px; }
.speech-api-note { padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin: 20px 0; }
.speech-api-note strong { font-size: 14px; }
.speech-api-note p { font-size: 13px; margin: 8px 0 0; overflow-wrap: anywhere; }
.speech-settings #voices-info { margin-top: 12px; font-size: 13px; }
.login-panel { max-width: 460px; margin: 64px auto; text-align: center; }
.login-panel h1 { font-size: 30px; }
.login-panel p { font-size: 16px; color: var(--muted); }
.login-panel label { text-align: left; margin: 24px 0 16px; }
.loading { display: flex; justify-content: center; align-items: center; gap: 14px; min-height: 300px; font-size: 16px; color: var(--muted); }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; bottom: max(24px,env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%,16px); background: var(--ink); color: white; padding: 16px 24px; border-radius: 14px; box-shadow: 0 6px 28px #18233d26; z-index: 200; font-size: 14px; max-width: calc(100% - 32px); width: max-content; opacity: 0; pointer-events: none; transition: 160ms; }
#toast.show { opacity: 1; transform: translate(-50%,0); }
#toast.error { background: var(--red); }
dialog { border: 1px solid var(--line); border-radius: 24px; padding: 32px; width: 480px; max-width: calc(100% - 32px); max-height: calc(100dvh - 40px); color: var(--ink); background: white; box-shadow: 0 20px 80px #18233d33; }
dialog::backdrop { background: #18233d66; backdrop-filter: blur(4px); }
dialog h2 { font-size: 26px; margin-bottom: 20px; }
dialog p { font-size: 15px; color: var(--muted); }
dialog .button-row { margin-top: 24px; }
.dialog-close { float: right; margin-top: -16px; margin-right: -16px; }
.recording-dot { display: inline-block; background: var(--red); width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.recording-controls { text-align: center; padding: 20px 0; }
.recording-controls audio { display: block; width: 100%; margin: 16px auto 12px; }
.recording-controls .button-row { justify-content: center; gap: 10px; }
.recording-controls .button-row .button { flex: 1; font-size: 14px; padding: 12px; }
.recording-controls .recording-ready { color: var(--ink); font-size: 16px; font-weight: 600; }
.recording-controls .recording-error { padding: 16px; background: var(--error); border: 1px solid #db9ba1; border-radius: 12px; color: var(--red); margin-bottom: 16px; text-align: left; }
dialog .file-label:has(input:disabled) { opacity: .5; pointer-events: none; }
/* Narrow layouts keep the same hierarchy and comfortable touch targets. */
@media (max-width: 1100px) {
  .header { padding: 22px 28px; gap: 16px; }
  .header nav a { padding: 11px 12px; }
  main { padding: 0 28px; }
  .hero { padding: 36px; gap: 20px; }
  .lesson-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .how-strip > .small-label { display: none; }
  .editor-layout { grid-template-columns: minmax(0,1fr) 240px; }
  .editor-main, .editor-aside { padding: 24px; }
  .word-inputs { grid-template-columns: 1fr; }
  .footer { margin: 0 28px; }
  .check-overview { align-items: flex-start; }
  .check-start { flex-shrink: 1; max-width: 45%; }
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1.5fr 1fr; padding: 32px; }
  .hero h1 { font-size: 46px; }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .stats-strip { gap: 12px; }
  .stats-strip > div { gap: 10px; }
  .stats-strip strong { font-size: 24px; }
  .stats-strip div div > span { font-size: 11px; }
  .stats-strip .stat-icon { width: 38px; height: 38px; border-radius: 12px; }
  .editor-layout, .settings-grid { grid-template-columns: 1fr; }
  .editor-aside { display: none; }
  .tempo-settings { gap: 24px; padding: 28px; grid-template-columns: 1.15fr .85fr; }
  .tempo-demo { padding: 24px 16px; }
  .tempo-adjust { gap: 14px; }
  .tempo-value { min-width: 90px; }
  .summary-card { padding: 24px; }
  .how-strip { padding: 24px; gap: 12px; }
  .how-strip > div { font-size: 12px; }
  .how-strip > i { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .header { padding: 20px 20px 12px; }
  .brand img { width: 154px; }
  main { padding: 0 16px; margin-top: 16px; margin-bottom: 40px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .hero { padding: 28px 24px; min-height: 0; grid-template-columns: 1fr; gap: 24px; border-radius: 24px; }
  .hero h1 { font-size: clamp(38px,10.5vw,52px); }
  .hero .eyebrow { font-size: 10px; margin-bottom: 14px; }
  .hero-copy > p:not(.eyebrow) { margin-bottom: 20px; max-width: 30ch; }
  .hero-art { width: min(100%,252px); justify-self: center; margin: 0; }
  .hero .button-row { gap: 6px 16px; }
  .button { font-size: 14px; padding: 12px 17px; }
  .stats-strip { padding: 24px 0; margin: 4px 0 28px; gap: 8px; }
  .stats-strip > div { flex-direction: column; gap: 10px; text-align: center; }
  .stats-strip strong { font-size: 23px; }
  .stats-strip strong small { font-size: 13px; }
  .stats-strip div div > span { font-size: 11px; max-width: 96px; margin: 4px auto 0; }
  .section-title { gap: 12px; margin-bottom: 20px; }
  .section-title h2 { font-size: 26px; }
  .section-title .eyebrow { font-size: 9px; }
  .section-title .text-button { font-size: 12px; }
  .count { margin-left: 4px; }
  .filters { flex-direction: column; align-items: stretch; gap: 14px; }
  .filter-tabs { justify-content: space-between; }
  .filter { font-size: 12px; flex: 1; padding: 10px 8px; }
  .search { width: 100%; }
  .search input { font-size: 16px; }
  .lesson-grid { grid-template-columns: 1fr; gap: 16px; }
  .lesson-card { padding: 24px; }
  .card-top { margin-bottom: 20px; }
  .lesson-card h3 { font-size: 22px; }
  .card-bottom .button { padding: 10px 14px; font-size: 13px; }
  .compact .lesson-material strong { font-size: 13px; }
  .compact .lesson-material span { font-size: 12px; }
  .how-strip { margin-top: 28px; padding: 24px; flex-direction: column; align-items: flex-start; gap: 20px; }
  .how-strip > .small-label { display: block; }
  .how-strip > div { font-size: 14px; }
  .how-strip > div > span { margin-right: 8px; }
  .footer { margin: 0 20px; padding: 24px 0; font-size: 12px; gap: 12px; }
  .footer img { width: 100px; }
  .footer span:last-child { display: none; }
  .page-heading { margin: 16px 0 28px; }
  .page-heading p.muted { font-size: 15px; }
  .panel { padding: 24px; }
  .editor-main { padding: 20px; }
  .form-row, .word-inputs { grid-template-columns: 1fr; }
  .source-tabs { margin: 24px 0; }
  .source-tabs button { font-size: 11px; gap: 5px; padding: 12px 4px; }
  .source-tabs svg { width: 16px; }
  .drop-zone { padding: 28px 16px; }
  .drop-zone h3 { font-size: 22px; }
  .drop-zone .button-row { gap: 10px; }
  .drop-zone .button { width: 100%; }
  .drop-zone small { font-size: 11px; }
  .review-heading h3 { font-size: 16px; }
  .review-heading .badge { font-size: 10px; }
  .edit-word { padding: 16px; }
  .guide-editor, .task-editor { padding: 10px 14px; }
  .edit-task .danger { margin-left: 0; }
  .paste-guide { padding: 20px; }
  .paste-guide .text-button { margin-left: 0; }
  .lesson-heading { align-items: flex-start; gap: 16px; }
  .lesson-heading .button { font-size: 12px; padding: 10px 12px; }
  .lesson-heading .button svg { width: 16px; }
  .lesson-heading h1 { font-size: 28px; }
  .lesson-heading .muted { font-size: 14px; }
  .lesson-heading .learning-step { margin-left: 0; margin-top: 8px; }
  .lesson-materials { padding: 16px; gap: 18px; }
  .lesson-material strong { font-size: 14px; }
  .lesson-toolbar { align-items: flex-start; gap: 12px; }
  .lesson-toolbar p { font-size: 14px; }
  .lesson-toolbar .text-button { font-size: 12px; text-align: right; max-width: 145px; padding-top: 0; }
  .word-row { padding: 20px 16px; gap: 12px; }
  .word-content strong { font-size: 18px; }
  .word-content p { font-size: 14px; }
  .word-content small { font-size: 12px; }
  .word-actions { flex-direction: column; gap: 0; }
  .row-number { font-size: 11px; }
  .lesson-footer { flex-direction: column; align-items: stretch; gap: 16px; }
  .lesson-footer p { max-width: none; }
  .lesson-footer .button-row { justify-content: space-between; }
  .check-overview { padding: 24px; flex-direction: column; align-items: stretch; gap: 24px; }
  .check-overview h2 { font-size: 26px; }
  .check-start { max-width: none; align-items: stretch; text-align: center; }
  .study-text { font-size: 16px; }
  .study-guide .eyebrow { font-size: 10px; }
  body:has(.practice-page) .header { padding-top: 16px; padding-bottom: 10px; }
  .practice-top > span:not(.badge) { display: none; }
  .practice-top .back { font-size: 12px; }
  .practice-top { gap: 12px; }
  .practice-progress { font-size: 12px; gap: 12px; margin: 12px auto 18px; }
  .practice-card { padding: 24px 20px; border-radius: 20px; }
  .practice-card h1 { font-size: 26px; }
  .practice-card > .muted { font-size: 14px; }
  .practice-steps { gap: 8px; font-size: 11px; margin-bottom: 22px; }
  .practice-steps i { width: 18px; }
  .practice-card .answer-input { font-size: 24px; padding: 14px 10px; }
  .practice-card .button { font-size: 14px; }
  .practice-encouragement { font-size: 12px; align-items: flex-start; }
  .listen-button { width: 76px; height: 76px; margin-top: 20px; }
  .spelling-feedback { padding: 12px; font-size: 13px; gap: 10px; }
  .dictation-definition { font-size: 21px; }
  .dictation-hint p { font-size: 15px; }
  .choice { font-size: 15px; padding: 12px; gap: 10px; }
  .meaning-question { font-size: 18px; }
  .answer-comparison { margin: 18px 0; padding-bottom: 18px; }
  .diff-legend { gap: 6px 10px; font-size: 11px; }
  .answer-spark { display: none; }
  .advance-controls { gap: 10px; padding: 12px; flex-wrap: wrap; }
  .advance-status { font-size: 13px; }
  .advance-copy > span { font-size: 11px; }
  .advance-controls .countdown-ring { width: 56px; height: 56px; flex-basis: 56px; }
  .advance-controls .ring-center { inset: 9px; }
  .advance-controls .ring-center strong { font-size: 22px; }
  .advance-actions { flex-direction: row; width: 100%; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 4px; }
  .tempo-link { min-height: 44px; font-size: 12px; }
  .next-key { display: none; }
  .practice-card .task-instruction, .check-card.answer-state .task-instruction { font-size: 23px; }
  .task-stimulus { font-size: 19px; padding: 16px; }
  .task-stimulus.short { font-size: 32px; }
  .task-stimulus.feedback-stimulus { font-size: 16px; }
  .task-explanation { font-size: 17px; }
  .task-option { padding: 14px 12px; font-size: 15px; }
  .task-order li { gap: 8px; padding: 8px; font-size: 14px; }
  .task-order li > div { flex-direction: column; }
  .task-source { font-size: 11px; }
  .results-hero { padding: 32px 24px; border-radius: 24px; }
  .results-hero h1 { font-size: 28px; }
  .results-hero > .muted { font-size: 14px; }
  .result-stats { gap: 24px; }
  .result-stats strong { font-size: 40px; }
  .result-stats span { font-size: 12px; }
  .results-hero .button-row { flex-direction: column; }
  .results-hero .button { width: 100%; }
  .result-row { gap: 10px; flex-wrap: wrap; }
  .result-row > div { flex-basis: 100%; margin-bottom: 4px; }
  .progress-summary { gap: 10px; }
  .summary-card { padding: 18px 12px; border-radius: 16px; }
  .summary-card .stat-icon { margin-bottom: 16px; width: 36px; height: 36px; border-radius: 10px; }
  .summary-card strong { font-size: 26px; }
  .summary-card small { font-size: 13px; }
  .summary-card p { font-size: 11px; }
  .history-row { gap: 10px; flex-wrap: wrap; }
  .history-row > div:first-child { flex-basis: 100%; }
  .history-row strong { font-size: 15px; }
  .history-row small, .history-row > span { font-size: 12px; }
  .history-row .icon-button { margin-left: auto; }
  .check-progress-summary { align-items: flex-start; padding: 20px; font-size: 15px; }
  .check-progress-summary p { font-size: 13px; }
  .tempo-settings { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .tempo-copy h2 { font-size: 27px; }
  .tempo-copy > p:not(.eyebrow) { font-size: 15px; }
  .tempo-option { padding: 16px; }
  .tempo-adjust { justify-content: space-between; gap: 12px; }
  .tempo-value { min-width: 100px; }
  .tempo-demo { padding: 28px 20px; }
  .tempo-demo .countdown-ring { width: 124px; height: 124px; flex-basis: 124px; }
  .tempo-demo .ring-center { inset: 19px; }
  .tempo-demo .ring-center strong { font-size: 44px; }
  .settings-grid p { font-size: 15px; }
  .settings-grid .panel h2 { font-size: 23px; }
  dialog { padding: 28px 24px; }
  dialog h2 { font-size: 24px; }
}
@media (max-width: 360px) {
  .hero { padding: 24px 20px; }
  .hero-art { max-width: 224px; }
  .card-bottom { flex-wrap: wrap; }
  .practice-card { padding: 22px 16px; }
  .lesson-heading { flex-wrap: wrap; }
  .progress-summary { grid-template-columns: 1fr; }
  .summary-card { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; }
  .summary-card .stat-icon { grid-row: 1 / 3; margin: 0; }
  .summary-card p { grid-column: 2; }
}
@media (max-height: 780px) and (min-width: 601px) {
  .practice-card { padding-top: 22px; padding-bottom: 22px; }
  .practice-steps { margin-bottom: 16px; }
  .practice-card .eyebrow { display: none; }
  .listen-button { margin-top: 16px; width: 72px; height: 72px; }
  .answer-comparison { margin: 16px 0; padding-bottom: 16px; }
  .practice-encouragement { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
