:root { color-scheme: light; --bg:#f6f4ee; --surface:#fffdf7; --ink:#273c38; --muted:#64736b; --line:#d9dfd4; --accent:#315d4c; --button-text:#fff; }
:root[data-theme="dark"] { color-scheme:dark; --bg:#18231f; --surface:#202e28; --ink:#e8ede3; --muted:#afbcaf; --line:#405047; --accent:#b8d7bc; --button-text:#18231f; }
@media (prefers-color-scheme:dark) { :root[data-theme="system"] { color-scheme:dark; --bg:#18231f; --surface:#202e28; --ink:#e8ede3; --muted:#afbcaf; --line:#405047; --accent:#b8d7bc; --button-text:#18231f; } }
* { box-sizing:border-box; }
:root[data-contrast="high"] { --bg:#fff; --surface:#fff; --ink:#111; --muted:#222; --line:#555; --accent:#164430; --button-text:#fff; }
:root[data-contrast="high"][data-theme="dark"] { --bg:#000; --surface:#000; --ink:#fff; --muted:#eee; --line:#aaa; --accent:#c2ffd7; --button-text:#000; }
@media (prefers-color-scheme:dark) { :root[data-contrast="high"][data-theme="system"] { --bg:#000; --surface:#000; --ink:#fff; --muted:#eee; --line:#aaa; --accent:#c2ffd7; --button-text:#000; } }
:root[data-contrast="high"] :focus-visible { outline-width:4px; }
body { margin:0; background:var(--bg); color:var(--ink); font:17px/1.6 system-ui,sans-serif; }
a { color:var(--accent); text-underline-offset:5px; }
header { max-width:1200px; margin:auto; padding:28px 36px; display:flex; align-items:center; gap:40px; border-bottom:1px solid var(--line); }
.brand { color:var(--ink); text-decoration:none; font-size:28px; font-weight:750; letter-spacing:-1px; }
.brand span { display:block; font-size:11px; text-transform:uppercase; letter-spacing:2px; font-weight:500; }
nav { display:flex; gap:28px; margin-left:auto; }
nav a { text-decoration:none; color:var(--muted); padding:8px 0; }
nav a[aria-current] { color:var(--ink); border-bottom:2px solid var(--accent); }
main { max-width:1060px; margin:auto; padding:78px 28px; min-height:70vh; }
h1,h2 { font-family:Georgia,serif; font-weight:400; line-height:1.15; }
h1 { font-size:clamp(42px,6vw,76px); max-width:750px; margin:20px 0 24px; letter-spacing:-2px; }
h2 { font-size:32px; margin:12px 0; }
p { max-width:610px; color:var(--muted); }
.eyebrow { text-transform:uppercase; font-size:12px; font-weight:700; letter-spacing:2px; color:var(--accent); }
.intro { font-size:20px; margin-bottom:36px; }
button,.button { display:inline-block; font:inherit; font-weight:600; text-decoration:none; background:var(--accent); color:var(--button-text); border:1px solid var(--accent); border-radius:8px; padding:10px 20px; cursor:pointer; }
.secondary { background:transparent; color:var(--ink); border-color:var(--line); }
.card { margin-top:64px; padding:28px 32px; border:1px solid var(--line); background:var(--surface); border-radius:12px; }
.card p:last-child { margin-bottom:0; }
.settings { max-width:560px; }
.exercise-json { white-space:pre-wrap; overflow-wrap:anywhere; padding:24px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.syllable-choices { display:flex; flex-wrap:wrap; gap:16px; margin:24px 0; }
.syllable-choices fieldset { flex:1 1 160px; border:1px solid var(--line); border-radius:10px; padding:16px; }
.syllable-choices legend { font-weight:700; padding:0 6px; }
.contour-choice { display:flex; align-items:center; gap:12px; margin:10px 0; padding:8px; border:1px solid var(--line); border-radius:6px; }
.contour-choice input { width:20px; height:20px; accent-color:var(--accent); }
.syllable-result { padding:12px; margin:12px 0; border-left:4px solid var(--accent); }
.result-incorrect { border-left-style:dashed; border-left-color:var(--ink); }
.recording-waveform { margin:16px 0; max-width:640px; color:var(--accent); }
.recording-waveform svg { width:100%; height:auto; }
.recording-waveform figcaption,.waveform-note { font-size:13px; }
.frequency-player { max-width:none; padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.frequency-player figcaption { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.frequency-player figcaption span,.frequency-player small { color:var(--muted); }
.frequency-player svg { display:block; cursor:crosshair; margin-top:16px; }
.frequency-seek-label { font-size:12px; margin:8px 0; }
.frequency-seek-label input { padding:0; accent-color:var(--accent); cursor:pointer; }
.frequency-player output { display:block; text-align:right; font-variant-numeric:tabular-nums; font-size:13px; }
.frequency-player small { display:block; margin-top:8px; }
.exercise-category { margin-top:40px; }
.exercise-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:20px; }
.exercise-tile { aspect-ratio:1; display:flex; flex-direction:column; justify-content:center; padding:24px; background:var(--surface); border:1px solid var(--line); border-radius:12px; text-decoration:none; }
.exercise-tile:hover { border-color:var(--accent); }
.exercise-tile h3 { color:var(--ink); font-size:24px; margin:12px 0 0; }
.exercise-tile p { font-size:15px; }
.exercise-tile > span:last-child { margin-top:auto; }
.exercise-setup { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin-top:36px; }
.exercise-setup .test-settings { margin:0; padding:24px; }
.exercise-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.exercise-heading h1 { font-size:clamp(36px,5vw,56px); margin:12px 0 24px; }
.exercise-tabs { display:flex; gap:28px; margin:0 0 24px; border-bottom:1px solid var(--line); }
.exercise-tabs a { padding:12px 4px; }
.panel { border:1px solid var(--line); border-radius:14px; background:var(--surface); padding:24px; }
.panel h2 { font:700 14px/1.5 system-ui,sans-serif; text-transform:uppercase; letter-spacing:.5px; margin:0 0 16px; }
.exercise-setup .preferences { margin:0; padding:24px; }
.preferences .checkbox { padding:14px; border:1px solid var(--line); border-radius:10px; font-size:14px; }
.test-settings.panel { min-height:100px; }
.history-title { margin-top:32px; }
.history-plots { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:24px 0; }
.history-plots figure { margin:0; }
.history-plots h3 { margin:0; }
.history-plots p { font-size:14px; }
.history-plots svg { width:100%; height:auto; color:var(--accent); }
.history-plots svg text { fill:var(--muted); font:12px system-ui,sans-serif; }
.history-plots circle,.history-plots rect { fill:var(--accent); }
.plot-grid { stroke:var(--line); fill:none; }
@media(max-width:700px) { .history-plots { grid-template-columns:1fr; } }
.history-scroll { overflow-x:auto; }
table { border-collapse:collapse; width:100%; font-size:14px; }
.preferences,.test-settings { border-top:1px solid var(--line); padding-top:24px; margin-top:32px; }
.answer-review { padding:12px 0; border-bottom:1px solid var(--line); }
.answer-review audio { width:100%; max-width:320px; display:block; }
.answer-review small { display:block; color:var(--muted); }
.pitch-graph { width:160px; height:60px; display:block; color:var(--accent); }
details { margin:12px 0; }
summary { cursor:pointer; }
button:disabled { opacity:.5; cursor:default; }
th,td { text-align:left; padding:12px 8px; border-bottom:1px solid var(--line); }
@media(max-width:700px) { .exercise-setup { grid-template-columns:1fr; } }
.test-columns { display:grid; grid-template-columns:1fr 2fr 1fr; gap:24px; }
.test-columns audio { width:100%; }
.test-columns h2 { font-size:26px; }
.answer-correct { border:3px solid var(--ink); }
.answer-incorrect { background:var(--surface); color:var(--ink); }
@media(max-width:700px) { .test-columns { grid-template-columns:1fr; } }
label { display:block; margin:20px 0 8px; font-weight:600; }
input,select { width:100%; padding:12px; font:inherit; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--ink); }
.checkbox { display:flex; align-items:center; gap:12px; }
.checkbox input { width:20px; height:20px; flex-shrink:0; accent-color:var(--accent); }
.actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:28px; }
footer { max-width:1128px; margin:auto; border-top:1px solid var(--line); padding:24px 28px; font-size:13px; color:var(--muted); }
dialog { max-width:480px; width:calc(100% - 32px); background:var(--surface); color:var(--ink); padding:32px; border:1px solid var(--line); border-radius:12px; }
dialog::backdrop { background:#10251f88; }
:focus-visible { outline:3px solid var(--accent); outline-offset:5px; }
.skip { position:absolute; top:-100px; left:16px; background:var(--surface); padding:8px; }
.skip:focus { top:8px; }
#status { position:fixed; bottom:16px; right:20px; background:var(--surface); border-radius:8px; padding:8px 16px; }
#status:empty { display:none; }
@media(max-width:600px) { header { padding:20px; gap:16px; flex-wrap:wrap; } nav { order:3; width:100%; margin:0; } #account { margin-left:auto; } main { padding:48px 20px; } .card { margin-top:44px; padding:24px; } }
