:root {
  color-scheme: light;
  --ink: #302521;
  --muted: #685c56;
  --brand: #ab402c;
  --border: #e7deda;
  --focus: #204fb1;
  font: 100%/1.6 "DM Sans", system-ui, "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; }
header, main { max-width: 1200px; margin: auto; padding: 16px; }
header { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
header > a { font-size: 1.5rem; font-weight: 750; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 16px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.13; margin: 16px 0; }
h2 { font-size: 1.375rem; line-height: 1.35; }
p { max-width: 68ch; white-space: pre-line; }
section, details { padding: 16px; border: 1px solid var(--border); border-radius: 16px; margin: 16px 0; min-width: 0; }
a { color: var(--brand); }
button, input, .primary { font: inherit; min-height: 48px; border-radius: 12px; padding: 8px 16px; max-width: 100%; }
button, .primary { background: var(--brand); color: white; border: 0; cursor: pointer; font-weight: 600; }
.primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:hover, .primary:hover { background: #913524; }
button:disabled { background: #eeeae8; color: var(--muted); cursor: default; }
input { border: 1px solid #897973; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
summary { cursor: pointer; min-height: 44px; font-weight: 600; }
.hero { display: grid; gap: 16px; align-items: center; }
.hero img { width: min(100%, 260px); height: auto; justify-self: center; }
.classroom { display: grid; gap: 16px; align-items: start; }
#activity { display: grid; gap: 12px; }
#activity h2 { margin: 0; }
#activity label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid #897973; border-radius: 12px; }
#activity label:has(:checked) { background: #fff1ec; border-color: var(--brand); }
#activity input[type="radio"] { min-height: auto; accent-color: var(--brand); }
#feedback:empty { display: none; }
@media (min-width: 640px) {
  header, main, section, details { padding: 24px; }
  .hero { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  header, main { padding-inline: 32px; }
  .classroom { grid-template-columns: 3fr 2fr; gap: 32px; }
}
@media (max-width: 639px) { .primary { width: 100%; } }

.answer-form { display: grid; gap: 12px; }

.answer-controls { display: grid; gap: 12px; }
.answer-form #feedback { display: block; min-height: 3.2em; margin: 0; }
.answer-form .hint { justify-self: start; background: #fff1ec; color: var(--brand); }

.travel-card { max-width: 760px; }
.travel-card label { display: grid; gap: 8px; margin-top: 16px; }
.travel-card textarea { font: inherit; border: 1px solid #897973; border-radius: 12px; padding: 12px; resize: vertical; }
.travel-card details { margin-bottom: 0; }

:root { --brand: #176755; --ink: #18372e; --border: #dce8de; }
body { background: #fbfdf8; }
header { background: #fbfdf8; }
.hero { background: #e9f6dc; border-radius: 32px; padding: clamp(20px,5vw,56px); }
.hero img,.guide img,.voice-character img { object-fit: contain; mix-blend-mode: multiply; }
button,.primary { box-shadow: 0 4px 0 #114737; }
button:hover,.primary:hover { background: #125342; }
button:active,.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #114737; }
button:disabled { box-shadow: none; }
.setup,.voice-room { max-width: 700px; margin: 24px auto; background: white; padding: clamp(16px,4vw,36px); border-radius: 28px; }
.guide { display:flex; align-items:center; gap:20px; }
.guide h2 { flex:1; }

#setup-options { display:grid; gap:12px; margin:20px 0; }
#setup-options label { border:2px solid var(--border); border-radius:16px; padding:14px; min-height:56px; display:flex; align-items:center; gap:12px; cursor:pointer; }
#setup-options label:has(:checked) { border-color:#4e9e48; background:#e9f6dc; }
.setup-actions,.voice-actions { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.voice-room { text-align:center; }
.voice-character { background:#e9f6dc; border-radius:24px; padding:16px; }
.voice-character img { max-width:100%; height:auto; }
.voice-actions { justify-content:center; }
.voice-room p { max-width:none; }
.secondary { background:#e9f6dc; color:#18372e; box-shadow:none; }
.secondary:hover { background:#d9efcb; }

.app-page main { max-width: 760px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.app-tabs { position: fixed; z-index: 5; inset: auto 0 0; background: white; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.app-tabs a { text-decoration:none; font-size: .75rem; font-weight: 700; text-align:center; border-radius: 14px; display:grid; place-items:center; align-content:center; min-height: 58px; }
.app-tabs [aria-current] { background:#e9f6dc; }
.tab-icon { color:#b04b2e; font-size:1.15rem; line-height:28px; }
.tab-icon img { width:28px; height:28px; object-fit:contain; vertical-align:middle; mix-blend-mode:multiply; }
.today { display:grid; grid-template-columns:minmax(0,1fr) minmax(72px,30%); align-items:center; background:#e9f6dc; border-radius:24px; }
.today img { width:100%; height:auto; mix-blend-mode:multiply; }
.today h2,.speak-card h2 { margin-top:0; }
.speak-card { background:#fff3e6; border-color:#f4dcc4; }
.paths ol { padding-left: 24px; }
.paths li a { display:inline-flex; align-items:center; min-height:44px; }
.tool-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.tool-grid > a { padding:14px; background:white; border:1px solid var(--border); border-radius:14px; font-weight:650; }
.match-column { display:grid; gap:10px; }
.match-column [aria-pressed=true] { outline:2px solid var(--brand); }
.focus-page .app-tabs { display:none; }

/* Keep the learning interface at phone scale on every viewport. */
:root { --phone-width: 440px; }
html { background: #fff; }
body { width: min(100%, var(--phone-width)); min-height: 100dvh; margin-inline: auto; }
body > header, body > main { padding-inline: 16px; }
body > header { padding-block: 12px; }
body > main { padding-top: 16px; }
body > main h1 { font-size: 1.875rem; }
body > main section, body > main details { padding: 16px; }
.classroom, .hero { grid-template-columns: minmax(0, 1fr); }
.app-tabs { width: min(100%, var(--phone-width)); margin-inline: auto; }
.app-tabs a { min-height: 60px; line-height: 1.2; }
.tab-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 3px; border-radius: 10px; background: #ffecd9; font-size: 1.25rem; }
.tab-icon img { width: 30px; height: 30px; }
.app-tabs a:nth-child(2) .tab-icon { background: #e1f2ff; color: #176897; }
.app-tabs a:nth-child(3) .tab-icon { background: #e9f6dc; color: #176755; }
.app-tabs a:nth-child(4) .tab-icon { background: #f3e9ff; color: #71459e; }
.match-column button { min-width: 0; overflow-wrap: anywhere; }

/* Phone-first learning, study and conversation components. */
body:has(.learn-stage), body:has(.study-menu), body:has(#screen), body:has(.voice-room) { background: #fff; }
body > main .plip-stage { display:grid; place-items:center; margin:0; border:0; border-radius:24px; overflow:hidden; background:radial-gradient(ellipse at 50% 100%, #f5d9bc, #fdf2e6 74%); }
.plip-stage img { display:block; max-width:100%; height:auto; object-fit:contain; mix-blend-mode:multiply; }
.path-level { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:14px; padding:12px 14px; border:1px solid var(--border); border-radius:18px; background:#f3faed; }
.course-route { border:0; }
.course-route h2 { margin:0 0 22px; }
.lesson-path { list-style:none; padding:0; margin:0; }
.lesson-path li { position:relative; padding-bottom:20px; }
.lesson-path li:last-child { padding-bottom:0; }
.lesson-path li:not(:last-child)::after { content:''; position:absolute; left:31px; top:64px; height:20px; border-left:2px dashed #cbd7e8; pointer-events:none; }
.lesson-path a { display:grid; grid-template-columns:64px minmax(0,1fr); grid-template-rows:auto auto; column-gap:16px; align-items:center; min-height:64px; color:#344056; text-decoration:none; border-radius:14px; }
.lesson-node { grid-row:1 / 3; display:grid; place-items:center; width:64px; height:64px; border:6px solid #e7edf6; border-radius:50%; background:#f4f7fb; }
.lesson-node::after { content:''; width:26px; height:26px; background:center/contain no-repeat url('/icons/book.webp'); }
.lesson-path a[aria-current="step"] .lesson-node { background:#2878d1; border-color:#dceafb; }
.lesson-path a[aria-current="step"] .lesson-node::after { background-image:url('/icons/play.webp'); filter:brightness(0) invert(1); }
.lesson-path a[data-complete] .lesson-node { background:#dff2e6; border-color:#edf7ef; }
.lesson-path a[data-complete] .lesson-node::after { background-image:url('/icons/check.webp'); }
.lesson-path-title { align-self:end; font-size:1.05rem; font-weight:750; overflow-wrap:anywhere; }
.lesson-path a:not(:has(.lesson-path-state)) .lesson-path-title { grid-row:1 / 3; align-self:center; }
.lesson-path a:hover .lesson-path-title { text-decoration:underline; }
.study-menu { display:grid; gap:14px; }
.study-tile { display:grid; grid-template-columns:76px minmax(0,1fr) auto; gap:16px; align-items:center; min-height:108px; padding:14px; border-radius:22px; font-size:1.2rem; text-decoration:none; font-weight:750; color:var(--ink); background:#eaf6e1; }
.study-tile.words { background:#e4f3ff; }
.study-tile.phonetics { background:#f3ebfd; }
.study-tile span { display:grid; place-items:center; min-height:66px; border-radius:17px; background:#fff; color:var(--brand); font-weight:850; }
.study-tile b { font-size:1.6rem; }
#screen { padding:0; border:0; }
.test-unit { padding:18px; border-radius:20px; background:#534678; color:#fff; }
.test-unit h2 { margin:0 0 10px; }

.test-note { color:var(--muted); font-size:.875rem; }
.test-tasks,.test-options { display:grid; gap:10px; }
.test-tasks { list-style:none; padding:0; }
.test-options button { padding:12px 16px; border:1px solid var(--border); border-radius:14px; background:#f6f8f3; color:var(--ink); text-align:left; box-shadow:none; }
.test-options button:hover { background:#e9f6dc; }
body > main .voice-room { margin:0; padding:0; border:0; text-align:left; }
.prompt-bubble,.answer-bubble,#voice-example { padding:12px 14px; border-radius:18px; background:#eef5ea; }
.prompt-bubble { display:flex; justify-content:space-between; gap:8px; align-items:center; margin:16px 0; }
.prompt-bubble h2 { margin:0; font-size:1.125rem; }
#record-status:empty { display:none; }
#voice-text { margin-block:14px; }
#voice-text textarea { display:block; width:100%; padding:10px; margin:6px 0 10px; border:1px solid var(--brand); border-radius:12px; font:inherit; }
.voice-actions { background:#fff; border-top:1px solid var(--border); align-items:center; padding:8px 0 calc(8px + env(safe-area-inset-bottom)); }
#record { min-width:72px; min-height:48px; border-radius:24px; }

.sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
body > header { position:sticky; top:0; z-index:6; padding-top:env(safe-area-inset-top); background:#fff; }
.status-bar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) 44px; width:100%; align-items:center; text-align:center; font-weight:700; font-variant-numeric:tabular-nums; }
.status-bar > a { min-height:44px; display:grid; place-items:center; border-radius:12px; text-decoration:none; }
.status-bar > a:first-child strong { background:#eaf6e1; border-radius:9px; padding:3px 9px; }
.status-bar > a:last-child { font-size:1.4rem; background:#f1f7ed; }
.study-reminder { margin:0; font-size:.875rem; color:var(--brand); }
.settings-list section,.settings-links { background:#fff; border-radius:22px; }
.settings-list h2 { margin:0 0 12px; }
.settings-list label { display:block; margin-top:10px; font-weight:650; }
.settings-list input,.settings-list select { width:100%; min-height:44px; padding:8px 12px; color:var(--ink); background:#f6faf4; border:1px solid var(--border); border-radius:12px; font:inherit; }
.settings-list a { display:flex; align-items:center; justify-content:space-between; min-height:44px; font-weight:650; text-decoration:none; }
.settings-links > a { border-bottom:1px solid var(--border); }
#settings-status:empty { display:none; }
#target,#profile { scroll-margin-top:88px; }

.status-bar > span { display:flex; gap:5px; align-items:center; justify-content:center; }
.status-bar > a:last-child { background:#eef4ed; }
.english-flag { width:30px; height:21px; border-radius:5px; position:relative; overflow:hidden; background:repeating-linear-gradient(#cf4d5c 0 1.62px,#fff 1.62px 3.24px); box-shadow:0 2px #e9dfe3; }
.english-flag::before { content:''; position:absolute; inset:0 auto auto 0; width:45%; height:54%; background:#315a8d radial-gradient(circle,#fff .65px,transparent .9px) 0 0/4px 3.5px; }
.status-icon { display:inline-block; width:22px; height:24px; position:relative; flex:none; }
.flame-mark { background:#ef762b; clip-path:path('M 11 0 C 20 8 23 12 21 17 C 19 26 3 26 1 17 C 0 12 4 8 7 5 C 7 9 10 10 11 0 Z'); }
.flame-mark::after { content:''; position:absolute; width:9px; height:11px; left:7px; bottom:1px; background:#ffd18a; border-radius:75% 35% 65% 50%; transform:rotate(-18deg); }
.gem-mark { background:linear-gradient(145deg,#70daf2 0 40%,#26aed9 41% 68%,#168bb8 69%); clip-path:polygon(50% 0,94% 25%,94% 75%,50% 100%,6% 75%,6% 25%); }
.gear-mark { width:23px; height:23px; background:#32765f; display:grid; place-items:center; clip-path:polygon(38% 0,62% 0,68% 15%,82% 11%,95% 26%,89% 40%,100% 46%,100% 64%,85% 70%,87% 83%,72% 96%,58% 89%,51% 100%,33% 97%,28% 82%,14% 84%,3% 68%,11% 54%,0 46%,5% 28%,20% 25%,20% 12%,35% 13%); }
.gear-mark::after { content:''; width:9px; height:9px; background:#eef4ed; border-radius:50%; }
body:has(.settings-list) { background:#f7faf5; }
body > main .settings-list section, body > main .settings-links { border:2px solid #e3ece0; box-shadow:0 3px #e3ece0; padding:16px; }
.settings-list h2,.settings-list a { display:flex; align-items:center; gap:11px; }
.settings-list a { justify-content:flex-start; gap:14px; padding:7px 0; min-height:54px; }
.settings-chevron { margin-left:auto; color:#678276; font-size:1.4rem; }
.settings-list :is(input,select) { border-width:2px; background:#f7faf5; }
.settings-icon { display:grid; place-items:center; flex:0 0 34px; height:34px; border-radius:11px; position:relative; background:#e5f3de; color:#276845; font-weight:850; }
.settings-icon::before,.settings-icon::after { position:absolute; }
.person-mark::before { content:''; width:8px; height:8px; border-radius:50%; background:#367a59; top:7px; }
.person-mark::after { content:''; width:16px; height:9px; border-radius:8px 8px 4px 4px; background:#367a59; bottom:7px; }
.book-mark { background:#e6f3ff; }
.book-mark::before { content:''; width:17px; height:14px; border-radius:4px; background:linear-gradient(90deg,#2779ac 45%,#b6e3f8 46% 53%,#2779ac 54%); }
.login-mark { background:#e6f3ff; color:#246f9e; font-size:1.45rem; }
.privacy-mark { background:#f5eafb; }
.privacy-mark::before { content:''; width:16px; height:17px; background:#8862ac; clip-path:polygon(50% 0,100% 20%,93% 70%,50% 100%,7% 70%,0 20%); }
.terms-mark { background:#fff0df; }
.terms-mark::before { content:''; width:13px; height:17px; border-radius:3px; background:repeating-linear-gradient(#bc6929 0 3px,#fff0df 3px 4px); border:2px solid #bc6929; }
.about-mark,.info-mark { background:#e6f3ff; color:#246f9e; }

.test-levels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:16px; }
.test-levels button { padding:6px 2px; background:#f4f0fa; border:1px solid #e4dbf1; color:#493264; box-shadow:0 2px #e4dbf1; font-size:clamp(.75rem,3.2vw,.9rem); }
.test-levels button[aria-pressed="true"] { background:#63458b; border-color:#63458b; color:#fff; box-shadow:0 2px #493264; }
#screen .test-unit { background:linear-gradient(120deg,#4f3874,#71579c); }
#screen .test-unit h2 { margin-top:6px; }
.test-plan { margin-block:16px; padding:14px; border:1px solid var(--border); border-radius:18px; }
.test-plan h2 { margin:0 0 12px; }
.test-tasks .test-task { display:grid; grid-template-columns:36px 1fr auto; align-items:center; gap:10px; background:#fff; color:var(--ink); text-align:left; padding:8px; border:1px solid #e4dbf1; box-shadow:0 2px #e4dbf1; }
.test-task small { display:block; color:var(--muted); }
.test-task-icon { display:grid; place-items:center; height:36px; border-radius:10px; background:#f0e8fb; color:#63458b; }
.test-task > :last-child { font-size:.8rem; color:#63458b; }
#screen > .test-unit + button { margin-top:12px; }

/* Use the same native progress semantics with a consistent track and fill. */
:where(.test-unit, .setup, #activity) progress {
  --progress-track:#e4eee2;
  --progress-fill:#28806a;
  appearance:none;
  display:block;
  width:100%;
  height:8px;
  border:0;
  border-radius:999px;
  background:var(--progress-track);
  color:var(--progress-fill);
}
.test-unit progress { --progress-track:#a38cbd; --progress-fill:#e4f8c9; margin-top:14px; }
:where(.test-unit, .setup, #activity) progress::-webkit-progress-bar { border-radius:999px; background:var(--progress-track); }
:where(.test-unit, .setup, #activity) progress::-webkit-progress-value { border-radius:999px; background:var(--progress-fill); }
:where(.test-unit, .setup, #activity) progress::-moz-progress-bar { border-radius:999px; background:var(--progress-fill); }
.test-levels button:active,.test-task:active { transform:translateY(1px); }
.test-levels button:focus-visible,.test-task:focus-visible { outline-offset:3px; }
.test-task small { font-weight:500; }
.test-task .test-done { border-radius:12px; background:#e8f5e7; color:#176755; padding:2px 7px; }
.test-task .test-chevron { font-size:1.25rem; padding-right:4px; }
#screen #start { width:100%; }
.test-note { margin:10px 0 0; }
.test-question { font-size:1.125rem; line-height:1.45; margin:18px 0 12px; }
.test-result-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.test-back { margin-top:16px; }
.test-unit h2:focus { outline-offset:4px; }
.test-unit h2 { scroll-margin-top:94px; }

body > main .lesson-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(80px,39%); align-items:center; gap:8px; margin:0; padding:16px; border:0; border-radius:24px; background:#fbefdf; }
.lesson-hero img { width:100%; height:auto; mix-blend-mode:multiply; }
.lesson-hero h2 { margin:2px 0 12px; font-size:clamp(1.15rem,5vw,1.5rem); overflow-wrap:anywhere; }
.lesson-level { margin:0; color:#765535; font-weight:700; font-size:.875rem; }
.lesson-hero .primary { padding-inline:12px; }
.speaking-entry,.voice-back { display:flex; align-items:center; gap:8px; min-height:44px; text-decoration:none; font-weight:700; }
.speaking-entry { justify-content:space-between; padding:0 12px; margin-top:10px; background:#edf6e8; border-radius:12px; }
.voice-back { width:fit-content; margin-bottom:8px; }
.status-bar .daily-goal { padding-inline:2px; font-size:.78rem; line-height:1.15; }
.status-bar [aria-current] { background:#dcecd7; box-shadow:inset 0 0 0 2px #98bea5; }
.setting-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,46%); align-items:center; gap:10px; min-height:54px; border-top:1px solid var(--border); padding:4px 0; }
.setting-row label { margin:0; line-height:1.3; }
.setting-label { font-weight:650; }
.setting-row > span:last-child { text-align:right; padding-inline:8px; }
.setting-row :is(input,select) { min-width:0; }
#duration { scroll-margin-top:88px; }
.settings-save { width:100%; }
.test-intro { margin-bottom:20px; }
.practice-title { font-size:1.125rem; margin:0 0 10px; }

.answer-form #feedback:empty { display:none; }
.answer-form #feedback:not(:empty) { min-height:0; padding:10px 12px; border-radius:12px; }
.answer-correct { background:#e8f6e7; color:#21543b; }
.answer-retry { background:#fff0e5; color:#7d3d21; }
.answer-hint { background:#f1ebfa; color:#514070; }
#activity h2, #voice-prompt, #voice-answer { scroll-margin-top:80px; }
#activity label { cursor:pointer; border-color:#b7cbbd; }
#activity label:has(:checked) { background:#e9f6e7; border-color:var(--brand); }
#voice-text button + button { margin-left:6px; }

.ui-icon { display:inline-block; width:24px; height:24px; object-fit:contain; vertical-align:middle; flex:none; }
.status-bar > a .ui-icon { width:29px; height:29px; }
.app-tabs .tab-icon .ui-icon { width:28px; height:28px; mix-blend-mode:normal; }
.study-tile > .ui-icon:first-child { width:66px; height:66px; }
.study-tile > .ui-icon:last-child,.settings-list a > .ui-icon:last-child { width:18px; height:18px; }
.settings-list a > .ui-icon:last-child { margin-left:auto; }
.settings-list h2 .ui-icon,.settings-list a > .ui-icon:first-child { width:32px; height:32px; }
.control-icon { display:inline-flex; align-items:center; justify-content:center; gap:4px; }
.control-icon::before { content:''; width:20px; height:20px; flex:none; background:var(--control-image) center/contain no-repeat; }
[data-control="microphone"] { --control-image:url('/icons/microphone.webp'); }
[data-control="stop"] { --control-image:url('/icons/stop.webp'); }
[data-control="keyboard"] { --control-image:url('/icons/keyboard.webp'); }
[data-control="hint"] { --control-image:url('/icons/hint.webp'); }
[data-control="speaker"] { --control-image:url('/icons/speaker.webp'); }
#record::before { filter:brightness(0) invert(1); }
[data-control="close"] { --control-image:url('/icons/close.webp'); }
[data-control="skip"] { --control-image:url('/icons/skip.webp'); }
.test-passage { margin-top:14px; padding:0 14px; border:1px solid var(--border); border-radius:14px; background:#f6f8f3; }

.plip-state-art { display:block; max-width:100%; object-fit:contain; margin-inline:auto; }
.plip-celebration { margin-block:4px 16px; }
.plip-result { margin-top:8px; }
.plip-feedback {
  --plip-state:url('/plip-states/interrupted.webp');
  min-height:64px;
  padding:12px 12px 12px 70px;
  background-image:var(--plip-state);
  background-position:8px center;
  background-size:54px 54px;
  background-repeat:no-repeat;
}
.answer-form #feedback.plip-feedback:not(:empty), #voice-example.plip-feedback { min-height:64px; padding-left:70px; }
.plip-feedback.answer-hint { --plip-state:url('/plip-states/hint.webp'); }
.plip-feedback.answer-retry { --plip-state:url('/plip-states/retry.webp'); }
.plip-feedback.plip-typing { --plip-state:url('/plip-states/typing.webp'); }
.plip-feedback.plip-listening { --plip-state:url('/plip-states/listening.webp'); }
.plip-dialog { width:min(calc(100% - 32px),360px); padding:20px; border:1px solid var(--border); border-radius:22px; text-align:center; color:var(--ink); }
.plip-dialog::backdrop { background:#122c24a8; }
.plip-dialog h2 { margin-block:8px; }
.plip-dialog form { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.test-options button[aria-pressed="true"] { background:#e4f3e7; border-color:var(--brand); color:#164f40; }
.test-submit { width:100%; margin-top:14px; }

.site-footer { display:flex; flex-wrap:wrap; gap:4px 16px; margin-top:24px; padding-top:10px; border-top:1px solid var(--border); }
.site-footer a { display:inline-flex; min-height:44px; align-items:center; font-size:.875rem; }
.lesson-path-state { grid-column:2; align-self:start; color:#536c60; font-weight:600; }
.lesson-path a[aria-current="step"] .lesson-path-state { color:#195dab; }
#reading { scroll-margin-top:80px; }

/* Speaking room */
[hidden] { display:none !important; }
.voice-turn-meter, .voice-form-actions { display:flex; align-items:center; gap:12px; }
body > main .voice-character { grid-template-columns:auto 1fr; justify-items:start; gap:12px; padding:4px 12px; border-radius:16px; }
.voice-character img { width:64px; }
.voice-character a { justify-self:end; display:inline-flex; align-items:center; min-height:44px; }
.voice-turn-meter { font-variant-numeric:tabular-nums; color:var(--muted); }
.voice-turn-meter progress { flex:1; min-width:0; accent-color:var(--brand); height:12px; }
#voice-room .prompt-bubble { align-items:flex-start; }
#voice-room [data-control="speaker"] { flex-shrink:0; }
#voice-thread { overflow-wrap:anywhere; }
#voice-thread .past-prompt { color:var(--muted); padding-inline:12px; margin-bottom:6px; }
#voice-thread .answer-bubble { display:flex; align-items:center; gap:8px; background:#edf5eb; width:fit-content; margin:0 0 12px auto; }
.recording-speaker { width:44px; min-height:44px; padding:0; }
#voice-result { text-align:center; padding-block:16px; }
#voice-result a { display:inline-flex; min-height:44px; align-items:center; margin-inline:8px; }
.voice-room .voice-actions { display:grid; grid-template-columns:1fr auto 1fr; gap:8px; margin-bottom:0; z-index:5; }
.voice-actions button { padding-inline:8px; line-height:1.15; }
.voice-actions .secondary { flex-direction:column; }
#record[data-control="stop"] { background:#993024; }

body > main:has(#voice-room) {
  display:flex;
  flex-direction:column;
  height:var(--voice-viewport, 100dvh);
  padding-bottom:0;
}
.voice-page-heading { flex:none; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:8px; margin-bottom:12px; }
.voice-page-heading h1 { margin:0; overflow-wrap:anywhere; font-size:1.75rem; line-height:1.214; }
main:has(#voice-room) > footer { display:none; }
body > main .voice-room {
  display:grid;
  flex:1;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:8px;
  min-height:0;
}
.voice-header { display:grid; gap:8px; }
.voice-header > p { margin:0; }
.voice-dialogue { overflow-y:auto; overscroll-behavior:contain; min-width:0; }
.voice-dock { align-self:end; background:white; }
#voice-room .prompt-bubble, #voice-room #voice-text, #record-status { margin:0; }
#voice-room .prompt-bubble { align-items:center; }
#voice-room .prompt-bubble:not(:first-child) { margin-top:8px; }
#voice-room #voice-text textarea { min-height:48px; max-height:96px; resize:vertical; }
.voice-dock:has(#voice-text:not([hidden])) .voice-actions { display:none; }
.voice-room:has(#voice-text:not([hidden])) :is(.voice-character, #voice-example) { display:none; }
.voice-dock:has(#voice-text:not([hidden])) { padding:8px 0 max(8px, env(safe-area-inset-bottom)); border-top:1px solid var(--border); }
#voice-result { padding:0; }
#voice-result img { width:56px; height:56px; }

@media (max-width:999px) {
  body:has(#voice-room) > header { display:none; }
  html:has(#voice-room), body:has(#voice-room) { overflow:hidden; }
  body > main:has(#voice-room) {
    position:fixed;
    inset:var(--voice-viewport-top, 0px) 0 auto;
    margin:0 auto;
    padding:12px 16px 0;
  }
}
@media (min-width:1000px) {
  body > main:has(#voice-room) { height:calc(var(--voice-viewport, 100dvh) - 55px); }
}
@media (max-width:999px) and (max-height:600px) {
  .voice-character img { width:48px; }
  #voice-room .prompt-bubble { padding:8px 12px; }
}

.preview-goals { padding-inline-start:22px; }
.preview-words { display:grid; gap:10px; }
.preview-words > div { border:1px solid var(--border); border-radius:14px; padding:12px; }
.preview-words dt { font-weight:800; }
.preview-words dd { margin:0; }
.preview-words p { margin-block:4px 8px; }
#lesson-preview-start { width:100%; }
#lesson-preview h2, .sound-group { scroll-margin-top:82px; }
.sound-jump { gap:8px 16px; padding-block:4px; }
.sound-grid { display:grid; gap:8px; }
.sound-card { display:grid; grid-template-columns:48px minmax(0,1fr); align-items:center; gap:8px; padding:8px; border:1px solid var(--border); border-radius:14px; }
.sound-card h3 { margin:0; text-align:center; }
.sound-card > div { display:flex; flex-wrap:wrap; gap:6px; }
.sound-card button { min-height:44px; padding:4px 9px; }
.test-band-scores { list-style:none; display:flex; flex-wrap:wrap; gap:6px; padding:0; }
.test-band-scores li { border:1px solid var(--border); border-radius:10px; padding:4px 8px; font-variant-numeric:tabular-nums; }

.skip-link { position:fixed; z-index:10; inset:8px auto auto 8px; padding:12px; background:white; transform:translateY(calc(-100% - 16px)); }
.skip-link:focus { transform:none; }
#main-content { scroll-margin-top:80px; }

@media (min-width: 1000px) {
  .app-tabs {
    inset:20px auto auto calc((100% - var(--phone-width)) / 2 - 264px);
    width:240px;
    grid-template-columns:1fr;
    gap:8px;
    padding:16px;
    border:1px solid var(--border);
    border-radius:18px;
  }
  .app-tabs a { grid-template-columns:42px minmax(0,1fr); gap:12px; min-height:64px; padding:8px; justify-items:start; text-align:start; font-size:1rem; }
  .app-tabs .tab-icon { width:42px; height:42px; margin:0; }
  .app-tabs .tab-icon .ui-icon { width:34px; height:34px; }
  .app-page > main { padding-bottom:28px; }
}

.study-pagination { justify-content:space-between; align-items:center; gap:8px 16px; padding-block:8px; }
.study-pagination span[aria-current] { font-variant-numeric:tabular-nums; }


.app-tabs .desktop-settings-tab { display:none; }
#lesson-preview {
  inset:16px 0 auto;
  margin:0 auto;
  width:min(calc(100% - 24px),440px);
  max-height:calc(100dvh - 32px);
  padding:0;
  overflow:hidden;
  text-align:start;
}
#lesson-preview[open] { display:flex; flex-direction:column; }
.preview-sheet-body { overflow:auto; overscroll-behavior:contain; padding:12px 16px 4px; }
.preview-sheet-actions { flex:none; padding:10px 16px; border-top:1px solid var(--border); background:white; }
#lesson-preview .preview-words > div { padding:8px; }
#lesson-preview .preview-words dd .secondary { padding-block:4px; }
html:has(#lesson-preview[open]) { overflow:hidden; }

@media (min-width: 1000px) {
  .focus-page .app-tabs, .app-tabs .desktop-settings-tab { display:grid; }
  .status-bar .mobile-settings-link { display:none; }
  .status-bar { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .app-tabs { max-height:calc(100dvh - 40px); overflow:auto; }
}

.dictation-controls { display:grid; justify-items:start; gap:4px; margin-block:8px; }
.dictation-controls small { color:var(--muted); }
.dictation-controls p { margin:0; }
.dictation-controls p:empty { display:none; }

.breadcrumbs {
  margin-block: 8px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.breadcrumbs a { text-underline-offset: 0.16em; }

/* Dialogue courses, learning status and room accessories. */
.status-bar { grid-template-columns:repeat(3,minmax(0,1fr)) minmax(56px,1.25fr) 44px; }
.status-bar details { position:relative; padding:0; margin:0; border:0; background:none; }
.status-bar summary { display:flex; min-height:44px; align-items:center; justify-content:center; gap:4px; cursor:pointer; }
.status-bar summary::-webkit-details-marker { display:none; }
.status-popover { position:absolute; top:100%; left:0; z-index:8; min-width:148px; max-width:calc(100vw - 32px); padding:12px; border:1px solid var(--border); background:#fff; border-radius:16px; text-align:left; }
.status-popover button { width:100%; min-height:44px; margin-bottom:4px; }
.status-popover button[aria-pressed="true"] { outline:2px solid var(--brand); outline-offset:-2px; }
.diamond-balance { display:inline-flex; min-height:44px; align-items:center; justify-content:center; gap:4px; }
.course-tabs { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; }
.course-tabs button { min-height:48px; }
#dialogue-scenes details:first-child { margin-top:0; }
#dialogue-scenes li a, #dialogue-topics li a { display:flex; min-height:44px; align-items:center; padding-block:4px; }
.voice-header { position:relative; }
.voice-tools { display:flex; justify-content:flex-end; align-items:center; gap:8px; }
.voice-tools button { min-width:44px; min-height:44px; padding:4px 8px; font-size:.875rem; }
#voice-language { font-size:1.25rem; }
.voice-preview-open { min-height:44px; margin-bottom:8px; }
.course-preview { max-height:min(85dvh,720px); }
.course-preview[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:12px; }
#voice-preview-content { max-height:calc(min(85dvh,720px) - 128px); overflow:auto; overscroll-behavior:contain; text-align:left; }
#voice-preview-content h3 { margin-bottom:8px; }
#voice-preview-content li { padding-block:4px; }
#voice-report-form { display:grid; gap:8px; text-align:left; }
#voice-report-text { width:100%; font:inherit; padding:12px; border:1px solid var(--border); border-radius:12px; }
#voice-report-status:empty { display:none; }
@media (min-width:1000px) { .status-bar { grid-template-columns:repeat(4,minmax(0,1fr)); } }

/* Keep native time controls inside the settings column on narrow screens. */
.setting-row input[type="time"] { width:100%; max-width:100%; box-sizing:border-box; font-size:1rem; }
.setting-row:has(#reminder) { grid-template-columns:minmax(0,1fr) minmax(116px,46%); }
.study-reminder { max-width:100%; overflow-wrap:anywhere; padding:6px 16px; }
.test-launch button { width:100%; min-height:48px; }
.settings-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.settings-heading h1 { margin-block:0 16px; }
.settings-heading .settings-save { width:auto; min-height:44px; }
.setting-choice { width:100%; min-height:44px; overflow-wrap:anywhere; }
#settings-picker-options { display:grid; gap:8px; overflow:auto; max-height:calc(80dvh - 130px); }
#settings-picker-options label { display:flex; min-height:44px; align-items:center; gap:12px; padding:4px 12px; text-align:start; }
#settings-picker-options input { flex:none; width:1.25rem; margin:0; }
.sound-card { grid-template-columns:1fr; gap:8px; padding:12px; }
.sound-group[data-sound-group="vowels"] { --sound-tone:#eaf6e1; }
.sound-group[data-sound-group="diphthongs"] { --sound-tone:#e4f3ff; }
.sound-group[data-sound-group="consonants"] { --sound-tone:#fff0e5; }
.sound-group .sound-card, .sound-group .sound-symbol button { background:var(--sound-tone); }
.sound-symbol button:first-child { min-width:56px; font-size:1.25rem; }
.sound-symbol button:last-child { min-width:44px; }
.study-group { padding:0; border:0; }
.study-library-card { margin-block:12px; padding:12px 16px; border:1px solid var(--border); border-radius:16px; }
.study-library-card[data-tone="0"] { background:#eaf6e1; }
.study-library-card[data-tone="1"] { background:#e4f3ff; }
.study-library-card[data-tone="2"] { background:#fff0e5; }
.study-library-card > summary { display:flex; align-items:center; gap:8px; min-height:44px; cursor:pointer; }
.study-library-card > summary::after { content:'›'; margin-inline-start:auto; }
.study-library-card[open] > summary::after { transform:rotate(90deg); }
.study-library-card .study-audio-row { padding:8px 0; border-top:1px solid var(--border); overflow-wrap:anywhere; }
.study-library-card .study-audio-row button { min-height:44px; }
#settings-picker-options.setting-time-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
.setting-time-options label { grid-column:1/-1; }
.setting-time-options select { min-width:0; min-height:44px; font-size:1rem; }
#settings-picker { box-sizing:border-box; }
.voice-word-cards { display:grid; gap:12px; list-style:none; padding:0; margin:0; }
.voice-word-card { border:1px solid var(--border); border-radius:16px; background:#f4f8ed; padding:8px 12px; }
.voice-word-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.voice-word-card p { margin:0; }
.speaker-button { width:44px; min-width:44px; height:44px; padding:0; }
.course-tabs { grid-template-columns:repeat(var(--tab-count,2),minmax(0,1fr)); }
.course-tabs button { padding-inline:6px; overflow-wrap:anywhere; }
.course-route ol { list-style:none; display:grid; gap:12px; padding:0; }
.course-card { background:#f4f8ed; border:1px solid var(--border); border-radius:16px; }
.course-route .course-card a { display:grid; grid-template-columns:24px minmax(0,1fr) 20px; align-items:center; gap:8px; min-height:56px; padding:12px; text-decoration:none; }
.course-card:nth-child(3n+2) { background:#eef5fa; }
.course-card:nth-child(3n+3) { background:#fff3e9; }
.course-card a[data-complete] { border-inline-start:3px solid var(--brand); border-radius:16px; }
#dialogue-scenes > details { border:1px solid var(--border); border-radius:16px; padding:12px; }
#dialogue-scenes > details > summary { min-height:44px; align-content:center; font-weight:650; cursor:pointer; }
#voice-room .prompt-bubble { border-radius:16px; }
.word-audio { display:inline-flex; align-items:center; gap:4px; }
.recording-speaker[data-control="speaker"] { width:44px; height:44px; }

.course-card a strong, .course-card a small { display:block; }
.course-card a small { margin-top:4px; color:var(--muted); }
