:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b1d2a; color: #f2f5f7; font: 20px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom)); max-width: 32rem; margin: 0 auto; }
h1 { margin: 0; font-size: 2.6rem; font-weight: 700; text-align: center; }
#detail { margin: 0; min-height: 1.4em; text-align: center; color: #b9c7d1; }
form { display: flex; flex-direction: column; gap: 0.8rem; }
label { font-size: 1rem; color: #b9c7d1; }
input { font: inherit; font-size: 1.8rem; letter-spacing: 0.3em; text-align: center; padding: 0.8rem; border-radius: 0.8rem; border: 2px solid #5b7a8e; background: #102a3b; color: inherit; }
input:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
button { font: inherit; font-size: 1.5rem; font-weight: 700; padding: 1.4rem 1rem; border: 0; border-radius: 1rem; background: #2a9d8f; color: #04130f; min-height: 4.5rem; }
button:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }
#end { background: #e76f51; color: #1d0a04; }
#resume { background: #ffd166; color: #2b1d00; font-size: 2rem; min-height: 8rem; }
[hidden] { display: none !important; }
body.speaking h1 { color: #8ecae6; }
body.listening h1 { color: #95d5b2; }
#sources { margin-top: 0.6rem; padding-top: 0.8rem; border-top: 1px solid #2c4a5e; }
#sources h2 { margin: 0 0 0.2rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b9c7d1; }
#source-list { list-style: none; margin: 0; padding: 0; }
#source-list li { position: relative; padding: 0.6rem 0; border-bottom: 1px solid #1d3a4d; }
#source-list a { font-size: 1rem; line-height: 1.35; color: #8ecae6; text-underline-offset: 0.15em; overflow-wrap: anywhere; unicode-bidi: isolate; }
#source-list a:visited { color: #c9b8ea; }
#source-list a:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
/* The whole row is the link's tap area, its host line too. */
#source-list a::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
#source-list .host { display: block; margin-top: 0.15rem; font-size: 0.8rem; color: #b9c7d1; overflow-wrap: anywhere; unicode-bidi: isolate; }
/* The coach's panel: the passage and mode, its words as said so far, the lines to fix. States show by more than colour. */
#coach { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; padding-top: 0.8rem; border-top: 1px solid #2c4a5e; }
#coach h2 { margin: 0; font-size: 1.2rem; font-weight: 700; color: #8ecae6; }
#coach p { margin: 0; }
#coach-message { color: #ffd166; font-size: 1rem; }
#coach-words { display: flex; flex-wrap: wrap; gap: 0.2em 0.42em; font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; }
#coach-words span { unicode-bidi: isolate; }
#coach-words .ok { color: #95d5b2; }
#coach-words .wrong { color: #ffb4a2; font-weight: 700; text-decoration: underline wavy #e76f51; text-underline-offset: 0.22em; }
#coach-words .pending { color: #5b7a8e; }
#coach-fixes { font-size: 1rem; color: #b9c7d1; }
