:root{font-family:"Apple SD Gothic Neo","Malgun Gothic",sans-serif;color:#183b48;background:#edf2f5;font-synthesis:none;--teal:#087e8b;--orange:#cf582c;--muted:#617681}
*{box-sizing:border-box}
body{margin:0}
main{max-width:1200px;margin:auto;padding:24px 32px}
header{display:flex;justify-content:space-between;align-items:center;padding-bottom:18px}
.brand{text-decoration:none;color:inherit;font-size:28px;font-weight:800;letter-spacing:-2px}
.brand span{display:inline-block;font:11px ui-monospace,monospace;letter-spacing:2px;margin-left:18px}
.privacy,.caption{font-size:12px;color:var(--muted)}
h1{font-size:23px;letter-spacing:-.7px;margin:0 0 12px}
h2{font-size:16px;margin:0}
p{line-height:1.7}
button{font:inherit;font-size:14px;font-weight:650;padding:12px 18px;border:1px solid transparent;border-radius:8px;background:#194b5d;color:#fff;cursor:pointer}
button:disabled{opacity:.45;cursor:not-allowed}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #d88d35;outline-offset:3px}
.secondary{background:transparent;border-color:#b6cbd4;color:#254b5b}
.studio,.panel{background:#fff;border:1px solid #d5e0e6;border-radius:14px;padding:24px}
.studio-head{display:flex;justify-content:space-between;align-items:center;gap:14px}
.legend{display:flex;gap:20px;font-size:12px}
.legend span:before{content:"";display:inline-block;width:18px;height:3px;margin-right:7px;vertical-align:middle;background:var(--teal)}
.legend .voice:before{background:var(--orange)}
.mic-control{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
#mic[aria-pressed=true]{background:#087e8b}
#mic-state{font-size:12px;color:var(--muted)}
.reading{display:flex;gap:40px;padding:22px 0 18px}
.reading>div{display:flex;flex-direction:column;gap:6px}
.reading strong{font:500 30px ui-monospace,monospace;letter-spacing:-1px}
.reading>div:first-child strong{color:var(--orange)}
.reading .difference{margin-left:auto;text-align:right}
.difference>span:last-child{font-size:12px;color:var(--muted)}
canvas{display:block;width:100%;height:260px;background:#f7fafb;border-radius:8px}
.keyboard-section{padding-top:20px}
.keyboard-hint{font-size:12px;color:var(--muted);line-height:1.7;margin:10px 0}
.keyboard-hint a,.singer-section a{color:var(--teal);text-underline-offset:3px}
kbd{font:11px ui-monospace,monospace}
.keyboard-scroll{overflow-x:auto;padding:4px 3px 12px;overscroll-behavior-x:contain}
.keyboard-scroll:focus-visible{outline:3px solid #d88d35;outline-offset:2px}
.keyboard{height:150px;width:1470px;min-width:1470px;position:relative;background:#183b48;border-radius:6px}
.piano-key{position:absolute;top:0;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px;padding:0 0 12px;letter-spacing:0;font:11px ui-monospace,monospace;border:1px solid #a6b9c3}
.piano-key.white{height:150px;background:#fff;color:#183b48;border-radius:0 0 5px 5px;z-index:1}
.piano-key.black{height:96px;background:#24424e;color:#fff;border-radius:0 0 4px 4px;z-index:2;font-size:9px;padding-bottom:8px}
.piano-key small{font:10px "Apple SD Gothic Neo",sans-serif}
.piano-key kbd{position:absolute;top:12px;font-size:10px;opacity:.75}
.piano-key.in-range{box-shadow:inset 0 -7px #dba459}
.piano-key[aria-pressed=true]{background:var(--teal);color:#fff}
.piano-key:focus-visible{outline:3px solid var(--orange);outline-offset:-4px}
#status{font-size:13px;color:var(--muted);margin:12px 0 0;min-height:22px}
.panel{margin-top:20px}
.practice{background:#e1eeee}
.practice-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap}
.practice-note{display:flex;align-items:center;gap:8px;font-size:13px}
.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.seek-label{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-top:18px}
progress{display:block;width:100%;height:8px;accent-color:var(--teal);margin:12px 0 18px;border:0}
.results{display:flex;align-items:center;gap:40px;padding:24px 8px}
.results>div:first-child{margin-right:auto}
.results p{font-size:12px;color:var(--muted);margin:7px 0 0}
.results strong{display:block;font:500 28px ui-monospace,monospace}
.results span{font-size:12px;color:var(--muted)}
.singer-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.singer-head button{font-size:12px;padding:8px 10px}
.singer-tools{display:flex;gap:18px;align-items:end;flex-wrap:wrap;margin:16px 0}
.gender-switch{display:flex;border:1px solid #b6cbd4;border-radius:9px;overflow:hidden}
.gender-switch button{background:transparent;color:#254b5b;border-radius:0;font-size:13px}
.gender-switch button[aria-pressed=true]{background:#194b5d;color:#fff}
.gender-switch button:focus-visible{outline-offset:-4px}
.singer-tools label{font-size:12px;display:flex;flex-direction:column;gap:7px;flex:1;min-width:180px}
.singer-tools input{padding:11px 13px;font:inherit;font-size:14px;border:1px solid #b6cbd4;border-radius:8px;background:#fff;color:#183b48}
.singer-list{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:8px;max-height:320px;overflow-y:auto;padding:3px}
.singer{display:flex;flex-direction:column;gap:8px;text-align:left;background:#f3f7f9;color:#183b48;border:1px solid #d5e0e6;padding:13px 12px}
.singer span{font:12px ui-monospace,monospace;color:var(--muted)}
.singer small{font-size:11px;font-weight:400;color:var(--muted)}
.singer[aria-pressed=true]{border-color:#b77b2f;box-shadow:inset 0 -3px #dba459;background:#fff8ee}
footer{padding:16px 8px 22px}
footer p{font-size:12px;color:var(--muted);margin:3px 0}
@media(max-width:650px){main{padding:18px 12px}.privacy{max-width:130px;text-align:right;line-height:1.7;font-size:10px}.brand span{display:block;margin:6px 0 0;letter-spacing:1px}.studio,.panel{padding:18px 14px}h1{font-size:19px}.studio-head{align-items:flex-start}.legend{gap:10px;font-size:10px}.mic-control{max-width:145px;text-align:right}#mic{padding:10px 14px}#mic-state{font-size:10px}.reading{gap:20px}.reading strong{font-size:25px}.reading .caption{font-size:10px}.difference>span:last-child{max-width:145px;line-height:1.5}canvas{height:220px}.keyboard-section>.studio-head{flex-direction:column;gap:8px}.results{gap:24px;flex-wrap:wrap}.results>div:first-child{width:100%}.singer-list{grid-template-columns:repeat(2,1fr)}.actions{gap:8px}.practice-note{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
.octave-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px}
.octave-controls button{padding:8px 16px}
#octave-range{font:12px ui-monospace,monospace;color:var(--muted)}
.audio-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.audio-actions button{padding:10px 13px;font-size:13px}
#record[aria-pressed=true]{background:#b63f32;color:white;border-color:#b63f32}
#recording-status{font-size:11px;color:var(--muted);max-width:380px;text-align:right;line-height:1.5}
.exercise-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
.exercise-card{display:flex;flex-direction:column;gap:12px;text-align:left;background:#f7fbfc;color:#183b48;border:1px solid #b6cbd4;padding:20px 18px}
.exercise-card strong{font-size:17px}
.exercise-card span{font-size:13px;font-weight:400;line-height:1.6}
.exercise-card small{font-size:12px;color:var(--muted);font-weight:400}
.exercise-card[aria-pressed=true]{background:#d1e9e9;border-color:#087e8b;box-shadow:inset 0 -4px #087e8b}
.piano-key.sounding{background:#23a1a8;color:#fff;transform:translateY(3px);box-shadow:inset 0 -5px #075c66}
@media(max-width:650px){.studio>.studio-head{flex-wrap:wrap}.mic-control{max-width:none;width:100%}.audio-actions{width:100%;justify-content:flex-start}#recording-status{max-width:none;text-align:left;align-self:flex-start}.exercise-cards{grid-template-columns:1fr}.exercise-card{gap:8px;padding:16px}.exercise-card strong{font-size:16px}}
@media(max-width:650px){.audio-actions{display:grid;grid-template-columns:1fr 1.4fr 1fr}.audio-actions button{min-width:0;padding:10px 5px;font-size:12px}}
.download{font-size:12px;color:#087e8b;text-underline-offset:3px}
.download:focus-visible{outline:3px solid #d88d35;outline-offset:3px}
#note-length{width:76px;border:1px solid #b6cbd4;border-radius:7px;padding:9px;font:inherit;color:#183b48;background:white}
.chart-wrap{position:relative}
.game-hud{position:absolute;z-index:3;display:flex;align-items:center;flex-direction:column;gap:3px;width:150px;padding:9px 8px;background:#183b48;color:white;border:1px solid #6b9ba9;border-radius:11px;transform:translate(-50%,-100%);pointer-events:none;box-shadow:0 5px 16px #183b4824}
.game-hud[hidden]{display:none}
.game-hud>span{font-size:12px}
.game-hud strong{font:800 25px ui-monospace,monospace;letter-spacing:-1px}
.game-hud small{font-size:9px;color:#bcd9df}
.game-hud[data-hit=true]{background:#075f68;border-color:#49d8cb;box-shadow:0 0 18px #087e8b45}
.exercise-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
.exercise-option{display:flex;flex-direction:column;border:1px solid #b6cbd4;border-radius:9px;background:#f7fbfc;overflow:hidden}
.exercise-option .exercise-card{width:100%;border:0;border-radius:0;flex:1}
.exercise-option>.keyboard-hint{margin:12px 18px}
.sequence-settings{display:flex;align-items:center;gap:9px;padding:8px 18px;font-size:13px}
#rise-count{width:65px;padding:8px;font:inherit;border:1px solid #b6cbd4;border-radius:6px;background:white;color:#183b48}
@media(max-width:650px){.exercise-cards{grid-template-columns:1fr}}

.header-actions{display:flex;align-items:center;gap:16px}
.settings-panel{inset:76px 24px auto auto;margin:0;width:min(360px,calc(100vw - 24px));padding:22px;border:1px solid #b6cbd4;border-radius:12px;background:#fff;color:#183b48;box-shadow:0 12px 40px #183b4826;max-height:calc(100dvh - 100px);overflow:auto}
.settings-panel::backdrop{background:#183b4812}
.settings-panel>label,.setting-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;font-size:14px}
.setting-row label{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1}
.settings-panel>label input{width:76px;border:1px solid #b6cbd4;border-radius:7px;padding:9px;font:inherit;color:#183b48;background:#fff}
.setting-row input[type="checkbox"]{width:20px;height:20px;flex-shrink:0;accent-color:var(--teal)}
.heading-with-help{display:inline-flex;align-items:center;gap:5px;max-width:100%}
.heading-with-help h1{margin:0}
.studio>.studio-head>div:first-child>.heading-with-help{margin-bottom:12px}
button.help-button{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 15px;width:15px;height:15px;padding:0;border:1px solid #b6cbd4;border-radius:50%;background:transparent;color:var(--muted);font-size:10px;font-weight:400;line-height:1}
button.help-button::after{content:"";position:absolute;inset:-5px}
button.help-button:hover{color:var(--teal);border-color:var(--teal)}
.help-popover{width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 48px);overflow:auto;padding:24px;border:1px solid #b6cbd4;border-radius:12px;background:#fff;color:#183b48;box-shadow:0 12px 40px #183b4826}
.help-popover::backdrop{background:#183b4826}
.help-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.help-heading>button{padding:7px 12px;font-size:12px}
.help-popover p{font-size:13px;color:var(--muted);margin:12px 0}
.help-popover p:last-child{margin-bottom:0}
.help-popover a{color:var(--teal);text-underline-offset:3px}
.help-popover kbd{padding:2px 4px;border:1px solid #d5e0e6;border-radius:4px}
footer{display:flex;align-items:center;gap:8px}
#settings-status:empty,#recording-status:empty,#exercise-error:empty{display:none}
.recording-review{width:min(800px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid #b6cbd4;border-radius:14px;background:#fff;color:#183b48;overflow:auto;box-shadow:0 16px 60px #183b4833}
.recording-review::backdrop{background:#183b4866}
.recording-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
#recording-time{display:block;margin-bottom:10px;font:12px ui-monospace,monospace;color:var(--muted);white-space:nowrap;text-align:right}
#recording-chart{display:block;width:100%;height:160px;background:#f7fafb;border-radius:8px;cursor:ew-resize;touch-action:none}
#recording-chart path{fill:none;stroke-width:2;vector-effect:non-scaling-stroke}
#recording-chart .recording-grid{stroke:#dfe9ee;stroke-width:1}
.recording-guide{stroke:var(--teal)}
.recording-pitch{stroke:var(--orange)}
.recording-cursor{stroke:#183b48;stroke-width:2;vector-effect:non-scaling-stroke}
#recording-seek{display:block;width:100%;margin:12px 0 0;accent-color:var(--teal)}
.recording-controls{display:flex;gap:8px;margin-top:18px}
.recording-download{display:flex;align-items:end;gap:12px;margin-top:18px}
.recording-download label{flex:1;min-width:0;display:flex;flex-direction:column;gap:7px;font-size:12px;color:var(--muted)}
.recording-filename{display:flex;align-items:center;gap:8px}
#recording-name{width:100%;min-width:0;padding:11px;border:1px solid #b6cbd4;border-radius:8px;font:inherit;font-size:14px;color:#183b48}
.settings-panel>label select,.recording-download select{max-width:170px;padding:10px;border:1px solid #b6cbd4;border-radius:8px;background:#fff;color:#183b48;font:inherit;font-size:16px}
.recording-download .export-format{flex:0 0 auto}
#recording-name{font-size:16px}
.recording-download .download{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 16px;border-radius:8px;background:#194b5d;color:#fff;text-decoration:none;font-size:14px;white-space:nowrap}
.recording-download .download[hidden]{display:none}
#recording-review-status:empty{display:none}
@media(max-width:650px){.recording-review{padding:18px}.recording-download{flex-direction:column;align-items:stretch}.recording-controls button{flex:1}.audio-actions #play{font-size:11px}}
@media(max-width:650px){.header-actions{gap:10px}.header-actions .privacy{display:none}.settings-panel{right:12px}}
