:root{--page:#f6f7f9;--surface:#fff;--soft:#f4f7fc;--text:#17212d;--muted:#68798a;--border:#dfe5ed;--accent:#176bd6;--tint:#edf4ff;--good-bg:#dff7e8;--good:#176c37;--bad-bg:#fff0f1;--bad:#a12737;color-scheme:light}
:root[data-theme=dark]{--page:#121923;--surface:#1b2532;--soft:#243142;--text:#e4edf7;--muted:#a5b4c5;--border:#3c4d63;--accent:#88baff;--tint:#263b58;--good-bg:#183e30;--good:#9fe0b6;--bad-bg:#472935;--bad:#ffadb7;color-scheme:dark}
:root{background:var(--page);color:var(--text)}
.top-actions{display:flex;align-items:center;gap:10px}.theme-switch{display:flex;gap:2px;padding:3px;border:1px solid var(--border);border-radius:99px;background:var(--surface)}
.theme-switch [data-theme-icon]{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--muted);background:transparent}
.theme-switch [data-theme-icon].active{background:var(--tint);color:var(--accent)}.theme-switch svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-switch:hover [data-theme-icon]{color:var(--accent)}button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.native-select-hidden{display:none!important}.stable-select{position:relative;display:block;min-width:0}.select-trigger{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;min-height:46px;text-align:left;padding:13px;border:1px solid transparent;border-radius:13px;background:var(--soft);color:var(--text);font:inherit}
.select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-arrow{flex:none;color:var(--muted);font-size:18px;line-height:1}
.select-trigger[aria-expanded=true]{border-color:var(--accent)}.select-list{position:fixed;display:block;z-index:1200;overflow-y:auto;overscroll-behavior:contain;padding:5px;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--text);box-shadow:0 12px 32px #07132326;scrollbar-width:thin}
.select-list[hidden]{display:none}.select-option{position:relative;display:block;padding:10px 29px 10px 11px;border-radius:8px;cursor:pointer;font-size:14px;line-height:1.4;white-space:nowrap}
.select-option.highlighted{background:var(--soft)}.select-option[aria-selected=true]{color:var(--accent);font-weight:650}.select-option[aria-selected=true]::after{content:'✓';position:absolute;right:10px}.select-option[aria-disabled=true]{opacity:.45;cursor:default}
[data-theme=dark] .panel,[data-theme=dark] .pill,[data-theme=dark] .nav button.active,[data-theme=dark] .ear-mode-nav button.active,[data-theme=dark] .degree-answer,[data-theme=dark] .phrase-slot{background:var(--surface);color:var(--text);border-color:var(--border)}
[data-theme=dark] .training-stage,[data-theme=dark] .ear-mode-nav,[data-theme=dark] .stat-chip,[data-theme=dark] .phrase-stat-card,[data-theme=dark] .chord-note-item,[data-theme=dark] .note,[data-theme=dark] .songbox,[data-theme=dark] .phrase-developer pre{background:var(--soft);color:var(--text)}
[data-theme=dark] .sub,[data-theme=dark] .hint,[data-theme=dark] .center,[data-theme=dark] .foot,[data-theme=dark] .options label,[data-theme=dark] .training-settings label,[data-theme=dark] .phrase-meta,[data-theme=dark] .nav button,[data-theme=dark] .ear-mode-nav button,[data-theme=dark] .phrase-result-row b,[data-theme=dark] .stats-reset,[data-theme=dark] .stat-chip small,[data-theme=dark] .phrase-developer{color:var(--muted)}
[data-theme=dark] .context-chip,[data-theme=dark] .training-play-row .next-question,[data-theme=dark] .training-actions button:not(.primary-action),[data-theme=dark] .actions button,[data-theme=dark] .phrase-developer button{background:var(--tint);color:var(--accent);border-color:var(--border)}
[data-theme=dark] .training-badge{background:var(--tint);color:var(--accent)}[data-theme=dark] .ear-mode-nav button.active{color:var(--accent)}
[data-theme=dark] .phrase-stat-card span,[data-theme=dark] .stat-chip b,[data-theme=dark] .chord-note-item strong,[data-theme=dark] .chord-actual-key,[data-theme=dark] .note b{color:var(--accent)}
[data-theme=dark] .phrase-slot.playing{background:var(--tint);border-color:var(--accent)}
[data-theme=dark] .phrase-slot.correct,[data-theme=dark] .degree-answer.correct-choice,[data-theme=dark] .training-feedback.correct{background:var(--good-bg);color:var(--good);border-color:#4daf72}
[data-theme=dark] .phrase-slot.wrong,[data-theme=dark] .degree-answer.wrong-choice,[data-theme=dark] .training-feedback.wrong{background:var(--bad-bg);color:var(--bad);border-color:#df4354}
[data-theme=dark] .phrase-result-row .ok{color:var(--good)}[data-theme=dark] .phrase-result-row .bad{color:var(--bad)}
[data-theme=dark] .options,[data-theme=dark] .phrase-preview{border-color:var(--border)}[data-theme=dark] .scroll-indicator{background:var(--border)}
.next-question-dialog{width:min(340px,calc(100vw - 40px));max-height:calc(100dvh - 40px);overflow:auto;margin:auto;padding:26px;border:1px solid var(--border);border-radius:24px;background:var(--surface);color:var(--text);font:inherit;text-align:center;box-shadow:0 24px 72px #07132333}
.next-question-dialog::backdrop{background:#07132366;backdrop-filter:blur(4px)}
.next-dialog-symbol{display:grid;place-items:center;width:46px;height:46px;margin:0 auto 16px;border-radius:50%;background:var(--tint);color:var(--accent)}
.next-dialog-symbol svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.next-question-dialog h2{font-size:21px;font-weight:700;letter-spacing:-.03em;margin:0 0 24px;line-height:1.3}
.next-dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.next-dialog-actions button{min-width:0;min-height:44px;border:0;border-radius:12px;padding:10px 14px;font:inherit;font-size:14px;font-weight:650;background:var(--soft);color:var(--text)}
.next-dialog-actions #nextQuestionConfirm{background:#2075ef;color:#fff}.next-dialog-actions button:hover{filter:brightness(.96)}
@media(max-width:560px){.phrase-setting-notice{top:calc(env(safe-area-inset-top,0px) + 68px);padding:10px 16px;border-radius:11px;font-size:15px}.next-question-dialog{padding:24px;border-radius:22px}.next-question-dialog h2{font-size:20px}}
@media(max-width:400px){.top-actions{gap:6px}.top-actions .pill{font-size:11px;padding:7px 8px}.theme-switch [data-theme-icon]{width:29px;height:29px}}
