:root { color-scheme: dark; --bg: #0f1115; --panel: #171a20; --line: #2a2e37; --text: #f5f2ed; --muted: #9ba0aa; --accent: #f06d5f; --accent-soft: #30201f; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
body.online-demo #settingsButton, body.online-demo [data-tab-target="uploadTab"], body.online-demo #uploadTab { display: none !important; }
.mobile-shell { display: flex; flex-direction: column; width: min(100%, 720px); margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 14px calc(112px + env(safe-area-inset-bottom)); }
.now-playing { order: 2; }.lyrics-panel { order: 3; }.record-panel { order: 4; }.library-panel { order: 5; }.upload-panel { order: 6; }
.mobile-header, .section-head, .now-playing, .song-row, .upload-panel { display: flex; align-items: center; }
.mobile-header { justify-content: space-between; gap: 10px; }.header-actions { display: flex; align-items: center; gap: 6px; }
.mobile-header, .section-head { justify-content: space-between; }
.header-home { display: inline-flex; min-height: 30px; align-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 11px; text-decoration: none; }
.header-home:hover, .header-home:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }
.mobile-header { min-height: 46px; margin-bottom: 10px; }.mobile-brand { display: flex; align-items: center; min-width: 0; gap: 10px; }.mobile-brand-mark { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: var(--bg); font-weight: 900; }.mobile-brand div { display: grid; min-width: 0; line-height: 1.2; }.mobile-brand strong { font-size: 17px; }.mobile-brand div span { color: var(--muted); font-size: 11px; }
.mobile-tabs { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: 0 0 10px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #12151af2; backdrop-filter: blur(12px); }.mobile-tab { min-width: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 9px 3px; font-size: 12px; }.mobile-tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }.mobile-tab-panel { display: none; }.mobile-tab-panel.active { display: block; }
.mini-player { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto 3px; align-items: center; gap: 0 8px; width: min(calc(100% - 20px), 692px); padding: 8px 10px 7px; transform: translateX(-50%); border: 1px solid #45404a; border-radius: 9px; background: #1b1d24f2; box-shadow: 0 14px 36px #050609d9; backdrop-filter: blur(16px); }.mini-player[hidden] { display: none; }.mini-player-song { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; }.mini-cover { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--accent); color: var(--bg); font-size: 15px; font-weight: 800; }.mini-copy { min-width: 0; display: grid; gap: 1px; }.mini-copy strong, .mini-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.mini-copy strong { font-size: 12px; }.mini-copy small { color: var(--muted); font-size: 10px; }.mini-seek { grid-column: 1 / -1; width: 100%; height: 3px; margin-top: 7px; accent-color: var(--accent); }.mini-control { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 13px; }.mini-control:hover { color: var(--accent); background: var(--accent-soft); }.mini-control-play { background: var(--accent); color: var(--bg); font-size: 12px; }.mini-control-play:hover { color: var(--bg); filter: brightness(1.08); }
.eyebrow { color: var(--muted); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
h1, h2, p { margin: 0; } h1 { margin-top: 5px; font-size: 26px; } h2 { margin-top: 4px; font-size: 19px; }
.icon-button, .text-button { border: 0; background: transparent; color: var(--muted); padding: 8px; } .icon-button { font-size: 19px; }.compact-action { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; }
.text-button:disabled { opacity: .4; cursor: default; }
.now-playing, .lyrics-panel, .library-panel, .upload-panel { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; }
.record-panel { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.record-status { color: var(--muted); font-size: 12px; }
.record-status.recording { color: var(--accent); }
.record-meter { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 12px; border-radius: 7px; background: #101319; }
.record-meter > span:first-child { font: 700 24px ui-monospace, SFMono-Regular, Consolas, monospace; }
.record-meter > span:last-child { color: var(--muted); font-size: 12px; text-align: right; }
.record-actions, .record-result-actions { display: flex; gap: 8px; align-items: center; }
.record-button, .secondary-button { border: 0; border-radius: 7px; padding: 10px 13px; }
.record-button { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #17100f; font-weight: 700; }
.record-button:disabled, .secondary-button:disabled { opacity: .4; cursor: default; }
.record-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.record-button.active .record-dot { animation: record-pulse 1s infinite; }
@keyframes record-pulse { 50% { opacity: .35; transform: scale(.72); } }
.secondary-button { background: #242932; color: var(--text); }
.record-result { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.record-result audio { grid-column: 1 / -1; }
.record-result-actions { grid-column: 1 / -1; }
.record-result-actions .download-button { padding: 10px 13px; }
.now-playing { position: relative; gap: 12px; padding: 14px; margin-bottom: 10px; flex-wrap: wrap; }.player-page-head { width: 100%; display: flex; align-items: center; justify-content: space-between; }.player-page-head > span:last-child { color: var(--muted); font-size: 11px; }.player-page-actions { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; margin: 2px 0 0; }.player-control { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #20242b; color: var(--text); }.player-control-main { width: 56px; height: 56px; border-color: var(--accent); background: var(--accent); color: var(--bg); font-size: 16px; }
.cover { flex: 0 0 52px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: var(--bg); font-size: 24px; font-weight: 800; }
.now-copy { min-width: 0; flex: 1; } .now-copy h2, .now-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .now-copy p { color: var(--muted); margin-top: 3px; font-size: 13px; }
audio { width: 100%; height: 40px; } #audio { display: none; }
.player-progress { width: 100%; padding: 8px 2px 0; }.player-progress input { width: 100%; height: 36px; padding: 0; border: 0; background: transparent; accent-color: var(--accent); cursor: pointer; touch-action: pan-y; }.player-progress input::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: #4b5059; }.player-progress input::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -10px; border: 0; border-radius: 50%; background: #ff8e7a; box-shadow: 0 2px 8px #0008; -webkit-appearance: none; }.player-progress > div { display: flex; justify-content: space-between; margin-top: 3px; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.volume-control { display: grid; grid-template-columns: 38px minmax(0, 1fr) 40px; align-items: center; gap: 8px; width: 100%; padding: 3px 2px 0; }.volume-control button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #20242b; color: var(--text); font-size: 16px; }.volume-control input { width: 100%; height: 30px; padding: 0; accent-color: var(--accent); }.volume-control output { color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; }
.practice-stats { width: 100%; border: 1px solid #302d36; border-radius: 7px; background: #13161c; padding: 10px; }.practice-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.practice-stats-head > span:last-child { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 9px; }.stat-grid > div { display: grid; gap: 1px; min-width: 0; padding: 7px 8px; border-radius: 5px; background: #1c2028; }.stat-grid strong { color: var(--accent); font: 700 18px ui-monospace, SFMono-Regular, Consolas, monospace; }.stat-grid span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }.playback-controls { display: flex; align-items: center; gap: 5px; width: 100%; margin-top: 2px; }.play-mode, .song-single { min-width: 0; flex: 1 1 42px; border: 1px solid var(--line); border-radius: 5px; background: #20242b; color: var(--muted); padding: 6px 5px; font-size: 11px; white-space: nowrap; }.play-mode.active, .song-single.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }.play-mode:disabled { opacity: .42; cursor: default; }.source-toggle { flex: 0 0 auto; }.source-toggle.vocal-off { background: #242932; border-color: var(--accent); color: var(--text); }
.stem-list { display: grid; gap: 8px; width: 100%; }
.stem-track { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
.stem-track strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.stem-track input { accent-color: var(--accent); padding: 0; }
.practice-loop, .player-lyrics-section, .queue-panel { width: 100%; border-top: 1px solid var(--line); padding-top: 14px; }.practice-loop-head, .practice-loop .section-head, .queue-panel .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.practice-loop h3, .player-lyrics-section h3, .queue-panel h3 { margin: 3px 0 0; font-size: 15px; }.loop-status { min-height: 36px; margin: 8px 0; color: var(--muted); font-size: 12px; }.loop-actions { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 7px; }.loop-actions button, .playlist-tools button { min-height: 42px; border: 1px solid var(--line); border-radius: 6px; background: #20242b; color: var(--text); font-size: 12px; }.loop-actions button:first-child { border-color: var(--accent); color: var(--accent); }.loop-actions button:disabled, .playlist-tools button:disabled { opacity: .45; cursor: default; }.lyrics-select-hint { color: var(--muted); font-size: 11px; }.player-lyrics { max-height: 420px; overflow-y: auto; margin-top: 10px; border: 1px solid #252a33; border-radius: 7px; background: #11141a; touch-action: pan-y; }.player-lyrics-line { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 13px 10px; border: 0; border-bottom: 1px solid #20252e; background: transparent; color: #dcd8d2; text-align: left; line-height: 1.5; touch-action: none; user-select: none; -webkit-user-select: none; }.player-lyrics-line:last-child { border-bottom: 0; }.player-lyrics-line > span { color: #77808c; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }.player-lyrics-line.active { color: var(--accent); background: var(--accent-soft); }.player-lyrics-line.selected, .player-lyrics-line.drag-selected { box-shadow: inset 3px 0 0 var(--accent); background: #2c2021; }.player-lyrics.selecting-range { overflow: hidden; }.playlist-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 10px 0; }.playlist-tools select { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #101319; color: var(--text); padding: 0 10px; }.playlist-tools button { padding: 0 12px; }.quick-song-list { display: grid; gap: 6px; }.quick-song { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; align-items: center; width: 100%; padding: 7px; border: 1px solid #262b34; border-radius: 6px; background: #151920; color: var(--text); text-align: left; }.quick-song:hover { border-color: var(--accent); }.quick-song > span { grid-row: 1 / 3; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }.quick-song strong, .quick-song small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.quick-song strong { font-size: 12px; }.quick-song small { color: var(--muted); font-size: 10px; }
.loop-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }.loop-toggle input { appearance: none; width: 38px; height: 22px; margin: 0; padding: 2px; border: 1px solid var(--line); border-radius: 20px; background: #242932; cursor: pointer; transition: background .18s; }.loop-toggle input::after { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: #9ba0aa; transition: transform .18s; }.loop-toggle input:checked { border-color: var(--accent); background: var(--accent-soft); }.loop-toggle input:checked::after { transform: translateX(16px); background: var(--accent); }.lyrics-tools { display: flex; gap: 3px; }.lyrics-tools .icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }.player-lyrics.selection-locked { touch-action: pan-y; }.player-lyrics.selection-locked .player-lyrics-line { touch-action: pan-y; }.lyrics-fullscreen { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; background: var(--bg); color: var(--text); padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); }.lyrics-fullscreen::backdrop { background: var(--bg); }.lyrics-fullscreen-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }.lyrics-fullscreen-head h2 { margin-top: 4px; }.fullscreen-lyrics { height: calc(100dvh - 95px); overflow-y: auto; padding: 28px 2px 80px; }.fullscreen-lyrics p { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; margin: 0; padding: 16px 8px; color: #dcd8d2; font-size: 18px; line-height: 1.65; }.fullscreen-lyrics p > span { color: #77808c; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; padding-top: 6px; }.fullscreen-lyrics p.active { color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lyrics-panel, .library-panel, .upload-panel { padding: 14px; margin-bottom: 10px; }
.lyrics { min-height: 240px; max-height: none; overflow: visible; color: #ddd8d0; margin: 12px 0 0; font: 15px/1.9 ui-monospace, SFMono-Regular, Consolas, monospace; }
.lyrics-line { display: block; padding: 2px 8px; border-radius: 5px; transition: color .18s, background .18s; }
.lyrics-line.active { color: var(--accent); background: var(--accent-soft); }
.lyrics-line { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: baseline; column-gap: 4px; }
.lyric-countdown { display: inline-grid; width: 22px; height: 22px; place-items: center; color: transparent; font: 800 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; transform: scale(.5); opacity: 0; }
.lyric-countdown.counting { color: #fff8de; border: 1px solid var(--accent); border-radius: 50%; background: #ff796922; box-shadow: 0 0 12px #ff796966; transform: scale(1); opacity: 1; animation: lyric-countdown-pulse .7s ease-out; }
.player-lyrics-line, .fullscreen-lyrics p { grid-template-columns: 30px minmax(0, 1fr); }
.player-lyrics-line .lyric-countdown, .fullscreen-lyrics .lyric-countdown { justify-self: center; }
@keyframes lyric-countdown-pulse { from { transform: scale(1.45); opacity: .25; } to { transform: scale(1); opacity: 1; } }
.lyric-char { display: inline-block; color: inherit; white-space: pre; transition: color .1s ease, text-shadow .1s ease, transform .14s ease; }
.lyric-char.played { color: var(--accent); }
.lyric-char.singing { color: #fff6d8; text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 74%, transparent); }
.player-lyrics-line { grid-template-columns: minmax(0, 1fr); }
.fullscreen-lyrics p { grid-template-columns: minmax(0, 1fr); }
.lyrics-line.active .lyric-char, .player-lyrics-line.active .lyric-char, .fullscreen-lyrics p.active .lyric-char { color: #dcd8d2; }
.lyrics-line.active .lyric-char.played, .player-lyrics-line.active .lyric-char.played, .fullscreen-lyrics p.active .lyric-char.played { color: var(--accent); }
.lyrics-line.active .lyric-char.singing, .player-lyrics-line.active .lyric-char.singing, .fullscreen-lyrics p.active .lyric-char.singing { color: #fff6d8; }
.player-lyrics .lyric-char, .fullscreen-lyrics .lyric-char { transform-origin: center 78%; will-change: transform; }
.player-lyrics .lyric-focus, .fullscreen-lyrics .lyric-focus { color: #fff8de !important; font-weight: 800; text-shadow: 0 0 12px #ff7969cc; transform: translateY(-2px) scale(1.20); }
.player-lyrics .lyric-near, .fullscreen-lyrics .lyric-near { font-weight: 700; transform: translateY(-1px) scale(1.09); }
.player-lyrics .lyric-near.lyric-before, .fullscreen-lyrics .lyric-near.lyric-before { color: #ff9f92; }
.player-lyrics .lyric-near.lyric-after, .fullscreen-lyrics .lyric-near.lyric-after { color: #f3d2ca; }
.player-lyrics .lyric-trail.lyric-before, .fullscreen-lyrics .lyric-trail.lyric-before { color: #e67970; transform: scale(1.03); }
.player-lyrics .lyric-trail.lyric-after, .fullscreen-lyrics .lyric-trail.lyric-after { color: #b9a9a5; transform: scale(1.03); }
.player-lyrics-line, .fullscreen-lyrics p { position: relative; grid-template-columns: minmax(0, 1fr); text-align: left; }
.player-lyrics-line .lyric-copy, .fullscreen-lyrics p .lyric-copy { min-width: 0; color: inherit; text-align: center; white-space: nowrap; }
.player-lyrics-line .lyric-countdown, .fullscreen-lyrics .lyric-countdown { position: absolute; z-index: 1; left: 10px; top: calc(50% - 11px); }
.player-lyrics-line .lyric-copy { font-size: 21px; line-height: 1.8; }
.fullscreen-lyrics p .lyric-copy { font-size: 28px; line-height: 1.72; }
@media (orientation: landscape) and (min-width: 560px) {
  .player-lyrics { max-width: 920px; margin-inline: auto; }
  .player-lyrics-line { grid-template-columns: 34px minmax(0, 1fr); padding-block: 14px; }
  .player-lyrics-line .lyric-copy { font-size: 27px; line-height: 1.7; }
  .fullscreen-lyrics { max-width: 1080px; margin-inline: auto; padding-inline: 24px; }
  .fullscreen-lyrics p { grid-template-columns: 38px minmax(0, 1fr); padding-block: 18px; }
  .fullscreen-lyrics p .lyric-copy { font-size: 32px; line-height: 1.62; }
}
@media (prefers-reduced-motion: reduce) { .player-lyrics .lyric-char, .fullscreen-lyrics .lyric-char { transform: none; } }

/* Player popovers and explicit lyric-selection states. */
.volume-menu { position: relative; }
.volume-popover { position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 10px); display: grid; justify-items: center; gap: 8px; width: 64px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 8px; background: #171a20; box-shadow: 0 10px 24px #0008; transform: translateX(-50%); }
.volume-popover[hidden] { display: none; }
.volume-popover button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #20242b; color: var(--text); }
.volume-popover input { width: 34px; height: 124px; margin: 0; accent-color: var(--accent); writing-mode: vertical-lr; direction: rtl; touch-action: none; }
.volume-popover output { color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.lyrics-tool-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #20242b; color: var(--text); font-size: 11px; }
.lyrics-tool-button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.lyrics-fullscreen.fallback-open { display: block; position: fixed; inset: 0; z-index: 100; }

/* Keep the large seek handle centred on its visual track across mobile WebKit. */
.player-progress input { appearance: none; -webkit-appearance: none; }
.player-progress input::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: #4b5059; }
.player-progress input::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -10px; border: 0; border-radius: 50%; background: #ff8e7a; box-shadow: 0 2px 8px #0008; -webkit-appearance: none; appearance: none; }
.player-progress input::-moz-range-track { height: 8px; border-radius: 999px; background: #4b5059; }
.player-progress input::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #ff8e7a; box-shadow: 0 2px 8px #0008; }

/* Compact the playback header so singing controls and lyrics stay above the fold. */
.now-playing { gap: 8px; padding: 10px; }
.player-page-head { display: none; }
.cover { flex-basis: 46px; width: 46px; height: 46px; font-size: 22px; }
.now-copy h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.now-copy p { margin-top: 2px; font-size: 12px; }
.player-page-actions { gap: 8px; margin: 0; }
.player-control { width: 40px; height: 40px; }
.player-control-main { width: 48px; height: 48px; }
.player-progress { padding-top: 2px; }
.player-progress input { height: 28px; }
.player-progress input::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -8px; }
.player-progress input::-moz-range-thumb { width: 24px; height: 24px; }
.player-progress > div { margin-top: 0; }
.practice-stats { padding: 7px; border-radius: 6px; }
.practice-stats-head { min-height: 14px; }
.practice-stats-head .eyebrow { font-size: 10px; }
.practice-stats-head > span:last-child { font-size: 9px; }
.stat-grid { gap: 5px; margin-top: 5px; }
.stat-grid > div { gap: 0; padding: 5px 6px; }
.stat-grid strong { font-size: 16px; }
.stat-grid span { font-size: 9px; }
.playback-controls { margin-top: 0; }
.play-mode { min-height: 34px; padding: 0 8px; font-size: 12px; }
.practice-loop, .player-lyrics-section, .queue-panel { padding-top: 10px; }
.practice-loop h3, .player-lyrics-section h3, .queue-panel h3 { margin-top: 1px; font-size: 14px; }
.loop-status { min-height: 0; margin: 5px 0; }
.lyrics-tool-button { min-height: 32px; padding: 0 8px; }

/* Tabs must not cover the timed lyric focus line while the page is scrolling. */
.mobile-tabs { position: static; }
.player-lyrics { scroll-padding-top: 12px; scroll-padding-bottom: 12px; }
.player-lyrics::before, .player-lyrics::after, .fullscreen-lyrics::before, .fullscreen-lyrics::after { content: ''; display: block; height: min(32dvh, 230px); pointer-events: none; }
.player-lyrics.at-lyric-start::before, .fullscreen-lyrics.at-lyric-start::before { height: 0; }

/* Compact neon playback artwork: static when paused, gently alive while playing. */
.cover { position: relative; overflow: hidden; border: 1px solid #2dd5ca; background: #10161a; color: #d9fff8; box-shadow: inset 0 0 0 1px #2dd5ca33, 0 0 10px #2dd5ca33; isolation: isolate; }
.cover::before { content: ''; position: absolute; inset: 7px; z-index: -1; border: 1px solid #ff7667; border-radius: 50%; box-shadow: 0 0 8px #ff766799, inset 0 0 8px #2dd5ca66; }
.cover::after { content: ''; position: absolute; right: 5px; bottom: 5px; width: 18px; height: 11px; z-index: -1; opacity: .9; background: repeating-linear-gradient(90deg, #2dd5ca 0 2px, transparent 2px 4px); box-shadow: 0 0 6px #2dd5ca; transform-origin: bottom; }
.cover { font-size: 15px; text-indent: 2px; }
.cover.is-playing { animation: neon-cover-pulse 1.25s ease-in-out infinite; }
.cover.is-playing::after { animation: neon-equalizer .72s ease-in-out infinite alternate; }
@keyframes neon-cover-pulse { 50% { box-shadow: inset 0 0 0 1px #2dd5ca88, 0 0 15px #2dd5ca99, 0 0 22px #ff766755; } }
@keyframes neon-equalizer { from { transform: scaleY(.45); } to { transform: scaleY(1.25); } }
@media (prefers-reduced-motion: reduce) { .cover.is-playing, .cover.is-playing::after { animation: none; } }

/* Keep lyric reading independent from the surrounding player controls. */
.player-lyrics-section { position: sticky; top: 8px; z-index: 2; background: var(--panel); isolation: isolate; padding-bottom: 10px; }
.player-lyrics { height: min(50dvh, 420px); max-height: none; overscroll-behavior-y: contain; }

/* One-line sing-along toolbar. The detailed A-B controls stay collapsed by default. */
.practice-loop { padding-top: 8px; }
.practice-loop-head { min-height: 34px; justify-content: flex-start; gap: 7px; }
.practice-loop h3 { margin: 0; font-size: 14px; }
.loop-toggle { margin-left: auto; gap: 5px; }
.loop-toggle span { font-size: 11px; }
.lyrics-tools { gap: 5px; }
.lyrics-tool-button { min-height: 30px; padding: 0 9px; }
.player-lyrics-section { border-top: 0; padding-top: 4px; }

/* Keep artwork and title on one compact row. */
.now-playing.active { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; }
.cover { grid-column: 1; grid-row: 1; }
.now-copy { grid-column: 2; grid-row: 1; }
.now-copy h2 { font-size: 22px; line-height: 1.18; }
.player-page-actions, .player-progress, .practice-stats, .playback-controls, .practice-loop, .player-lyrics-section, .queue-panel, .stem-list { grid-column: 1 / -1; }

/* The seek bar is an on-demand control so lyrics retain the vertical space. */
.player-progress { max-height: 0; margin: 0; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height .2s ease, opacity .2s ease, padding .2s ease; }
.now-playing.progress-visible .player-progress { max-height: 62px; padding: 2px 2px 0; opacity: 1; pointer-events: auto; }
.now-playing.controls-auto-hidden .practice-stats, .now-playing.controls-auto-hidden .playback-controls { display: none; }

/* Make the neon playback state readable in motion, not only as a static glow. */
.cover.is-playing::after { z-index: 1; animation-duration: .38s; animation-timing-function: steps(2, end); }
.cover.is-playing { animation-duration: .72s; }
.song-list { display: grid; gap: 8px; margin-top: 13px; } .song-row { justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); } .song-info { min-width: 0; } .song-info strong, .song-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .song-info span, .empty, .form-status { color: var(--muted); font-size: 13px; }
.song-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; } .play-button, .download-button, .primary-button { border: 0; border-radius: 7px; padding: 9px 12px; } .play-button { background: var(--accent-soft); color: var(--accent); } .download-button { background: #242932; color: var(--text); text-decoration: none; font-size: 13px; }
.upload-panel[hidden] { display: none; } form { display: grid; gap: 13px; margin-top: 14px; } label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; } .align-option { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }.align-option input { width: auto; accent-color: var(--accent); } input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #101319; color: var(--text); padding: 11px; } textarea { resize: vertical; }
.primary-button { background: var(--accent); color: #17100f; font-weight: 700; padding: 12px; } .form-status { min-height: 20px; }
.install-dialog { width: min(calc(100% - 28px), 430px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); padding: 20px; box-shadow: 0 18px 60px #000b; }.install-dialog::backdrop { background: #050608c7; }.install-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }.install-dialog p { margin: 14px 0 0; color: var(--muted); }.install-steps { display: grid; gap: 10px; margin: 16px 0 20px; padding-left: 22px; }.install-steps li { padding-left: 3px; }.install-dialog .primary-button { width: 100%; }
@media (min-width: 620px) { .mobile-shell { padding-top: 28px; } .now-playing { padding: 18px; } }
@media (min-width: 620px) { .mini-player { bottom: 18px; } }

/* v46: focused music-player layout */
:root { --bg: #0a0c11; --panel: #12161e; --line: #252b35; --text: #f5f4f0; --muted: #969eaa; --accent: #ff7467; --accent-soft: #351f22; }
body { background: var(--bg); }
.mobile-shell { width: min(100%, 780px); padding: max(10px, env(safe-area-inset-top)) 12px calc(98px + env(safe-area-inset-bottom)); }
.mobile-header { min-height: 42px; margin-bottom: 8px; }
.mobile-brand { gap: 8px; }.mobile-brand-mark { flex-basis: 30px; width: 30px; height: 30px; border-radius: 6px; }.mobile-brand strong { font-size: 16px; }.mobile-brand div span { font-size: 10px; }
.mobile-tabs { gap: 2px; margin-bottom: 12px; padding: 3px; border-radius: 7px; background: #11151d; }.mobile-tab { padding: 8px 2px; font-size: 12px; }.mobile-tab.active { background: #442326; color: #ff9187; }
.now-playing { gap: 10px; margin-bottom: 0; padding: 12px 0 0; border: 0; border-radius: 0; background: transparent; }
.player-page-head { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; min-height: 25px; padding: 0 2px; }.player-page-head > span:last-child { font-size: 10px; }
.now-playing.active { grid-template-columns: 48px minmax(0, 1fr); }.cover { flex-basis: 48px; width: 48px; height: 48px; border-radius: 8px; }.now-copy h2 { font-size: 21px; }.now-copy p { font-size: 12px; }
.player-page-actions { justify-content: flex-start; gap: 9px; margin: 5px 0 0; padding-left: 1px; }.player-control { width: 42px; height: 42px; border-color: #2a303a; background: #171c25; }.player-control-main { width: 52px; height: 52px; box-shadow: 0 5px 18px #ff746744; }
.player-progress { padding: 3px 2px 0; }.now-playing.progress-visible .player-progress { max-height: 58px; }.player-progress > div { font-size: 10px; }
.practice-stats { border-color: #242a34; border-radius: 6px; background: #0f131a; padding: 8px; }.practice-stats-head { margin-bottom: 5px; }.stat-grid { gap: 0; margin-top: 0; }.stat-grid > div { padding: 5px 8px; border-radius: 0; background: transparent; }.stat-grid > div + div { border-left: 1px solid #242a34; }.stat-grid strong { font-size: 17px; }
.playback-controls { gap: 4px; padding: 1px 0; }.play-mode { min-height: 32px; padding: 0 5px; border-color: transparent; border-radius: 5px; background: #161b23; font-size: 11px; }.play-mode.active { border-color: #ff7467; background: #392022; }.source-toggle { color: #d8dde4; }
.practice-loop { padding: 9px 0 7px; border-top-color: #252b35; }.practice-loop-head { min-height: 32px; }.practice-loop h3 { font-size: 15px; }.lyrics-tool-button { min-height: 30px; border-color: #2a303a; background: #171c25; }
.player-lyrics-section { position: relative; z-index: auto; margin: 0 -12px; padding: 10px 12px 0; background: #0d1016; }.player-lyrics { height: min(54dvh, 500px); margin-top: 0; border-color: #202631; border-radius: 6px; background: #0b0e14; }.player-lyrics-line { padding: 15px 10px; border-bottom-color: #1d232d; }.player-lyrics-line.active { background: #3a2022; box-shadow: inset 3px 0 0 #ff7467; }.player-lyrics-line .lyric-copy { letter-spacing: 0; }
.queue-panel { padding: 14px 0 4px; border-top-color: #252b35; }.queue-panel .section-head { padding: 0 2px; }.playlist-tools { margin: 8px 0; }.playlist-tools select { min-height: 38px; border-radius: 5px; }.quick-song-list { gap: 4px; }.quick-song { padding: 6px; border-color: #222833; border-radius: 5px; background: #11161e; }.quick-song > span { width: 28px; height: 28px; border-radius: 4px; }
.stem-list { margin-top: 8px; }.stem-track { padding: 8px 2px; }
.lyrics-panel, .library-panel, .upload-panel, .record-panel { border-radius: 7px; background: #12161e; }.lyrics-panel, .library-panel, .upload-panel { padding: 14px; }.song-row { padding: 11px 0; }.song-actions { gap: 3px; }.play-button, .download-button { padding: 8px 10px; border-radius: 5px; }
.mini-player { width: min(calc(100% - 16px), 760px); border-color: #333945; border-radius: 8px; background: #151a22f5; }.mini-cover { border-radius: 5px; }
@media (orientation: landscape) and (min-width: 560px) { .mobile-shell { width: min(100%, 1080px); padding-inline: 24px; }.now-playing.active { grid-template-columns: 54px minmax(0, 1fr); }.cover { flex-basis: 54px; width: 54px; height: 54px; }.player-lyrics-section { margin-inline: -24px; padding-inline: 24px; }.player-lyrics { height: min(66dvh, 560px); }.queue-panel { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 18px; align-items: start; }.queue-panel .section-head { grid-column: 1; grid-row: 1; }.playlist-tools { grid-column: 1; grid-row: 2; }.quick-song-list { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }.player-page-actions { justify-content: center; } }

/* Queue lives in a modal sheet so it never competes with the lyric reading area. */
.queue-open { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 7px; border: 1px solid #2a303a; border-radius: 5px; background: #151a22; color: #dce1e8; font-size: 11px; }
.queue-open span:first-child { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-open:hover, .queue-open:focus-visible { border-color: var(--accent); color: #ffaaa2; }
.queue-dialog { position: fixed; right: 0; bottom: 0; left: 0; width: min(100%, 780px); max-height: min(78dvh, 680px); margin: 0 auto; padding: 0; overflow: hidden; border: 1px solid #303744; border-bottom: 0; border-radius: 14px 14px 0 0; background: #12161e; color: var(--text); box-shadow: 0 -14px 44px #000a; }
.queue-dialog::backdrop { background: #05070bb8; }
.queue-dialog.fallback-open { display: block; z-index: 100; }
.queue-dialog .queue-panel { display: block; width: auto; max-height: min(78dvh, 680px); padding: 14px 12px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; border: 0; background: transparent; }
.queue-dialog .queue-panel .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 10px; border-bottom: 1px solid #282e38; }
.queue-dialog .queue-panel h3 { font-size: 17px; }
.queue-dialog-actions { display: flex; align-items: center; gap: 6px; }
.queue-dialog .icon-button { width: 32px; height: 32px; padding: 0; border: 1px solid #303744; border-radius: 5px; background: #1a202a; color: #e5e8ed; font-size: 21px; line-height: 1; }
.queue-dialog .playlist-tools { margin: 12px 0; }
.queue-dialog .quick-song-list { max-height: min(49dvh, 410px); overflow-y: auto; padding-right: 2px; }
@media (orientation: landscape) and (min-width: 560px) { .queue-dialog { width: min(calc(100% - 48px), 780px); }.queue-dialog .queue-panel { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0 16px; }.queue-dialog .queue-panel .section-head { grid-column: 1; grid-row: 1; }.queue-dialog .playlist-tools { grid-column: 1; grid-row: 2; align-self: start; }.queue-dialog .quick-song-list { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: min(60dvh, 430px); } }

/* Local-only singing workbench. The roll is intentionally canvas-based so pitch updates never reflow lyrics. */
.karaoke-workbench { padding: 0; background: #080b10; color: #f6f7f9; }
.karaoke-import[hidden], .karaoke-stage[hidden], .karaoke-summary[hidden] { display: none; }
.mobile-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }.mobile-tab { font-size: 11px; }
.karaoke-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid #202833; background: #10151d; }.karaoke-head .icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid #313b48; border-radius: 6px; background: #171e28; color: #e7edf6; font-size: 23px; line-height: 1; }.karaoke-head h2 { margin: 1px 0 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }.karaoke-import { display: grid; gap: 11px; margin: 14px 12px; padding: 18px; border: 1px solid #273342; border-radius: 8px; background: #10161f; }.karaoke-import strong { font-size: 17px; }.karaoke-import span, .karaoke-guide { color: #9daabc; font-size: 12px; line-height: 1.55; }.karaoke-import > div { display: flex; gap: 8px; }.karaoke-import label { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin: 0; cursor: pointer; }.karaoke-stage { display: grid; gap: 10px; padding: 10px 12px max(18px, env(safe-area-inset-bottom)); }.karaoke-status { display: flex; justify-content: space-between; color: #a9b6c8; font-size: 11px; }.karaoke-status span:last-child { color: #7fd6ca; }.pitch-roll-wrap { position: relative; height: min(30dvh, 230px); min-height: 160px; overflow: hidden; border: 1px solid #263244; border-radius: 7px; background: repeating-linear-gradient(0deg, #101722 0 1px, transparent 1px 25% ), repeating-linear-gradient(90deg, #0d131d 0 1px, transparent 1px 12.5%); }.pitch-roll { display: block; width: 100%; height: 100%; }.pitch-cursor { position: absolute; top: 0; bottom: 0; left: 33.333%; width: 2px; background: #f3f5f8; box-shadow: 0 0 10px #fff8; }.pitch-label { position: absolute; right: 7px; color: #66758b; font-size: 10px; }.pitch-label-high { top: 7px; }.pitch-label-low { bottom: 7px; }.karaoke-lyrics { min-height: 132px; max-height: 32dvh; overflow: hidden auto; padding: 10px 4px 52px; text-align: center; scroll-snap-type: y proximity; }.karaoke-line { display: block; padding: 8px 10px; color: #6f7b8d; font-size: 17px; line-height: 1.65; transition: color .15s, transform .15s; }.karaoke-line.active { color: #f9fafb; font-size: 23px; font-weight: 700; transform: scale(1.025); }.karaoke-word { display: inline-block; transition: color .12s, text-shadow .12s; }.karaoke-word.played { color: #72dccd; }.karaoke-word.singing { color: #fff3be; text-shadow: 0 0 13px #ffca5b99; }.karaoke-guide { min-height: 19px; margin: 0; text-align: center; }.karaoke-tools { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 6px; }.tool-chip { display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 6px; border: 1px solid #2a3748; border-radius: 5px; background: #151d28; color: #dce6f3; font-size: 11px; }.tool-chip:disabled { opacity: .46; }.tool-chip select { width: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; }.karaoke-score-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #273545; border-radius: 7px; background: #101722; }.karaoke-score-strip > div { display: grid; gap: 2px; padding: 9px 5px; text-align: center; }.karaoke-score-strip > div + div { border-left: 1px solid #273545; }.karaoke-score-strip strong { color: #fff1bc; font-size: 21px; }.karaoke-score-strip span { color: #8391a4; font-size: 10px; }.karaoke-progress input { width: 100%; padding: 0; accent-color: #68d5c7; }.karaoke-progress > div { display: flex; justify-content: space-between; color: #8290a4; font: 10px ui-monospace, monospace; }.karaoke-controls { display: grid; grid-template-columns: 1fr 1fr 54px 1fr; align-items: center; gap: 8px; }.karaoke-action, .karaoke-play { min-height: 40px; border: 1px solid #2c394a; border-radius: 6px; background: #151e29; color: #e6edf5; font-size: 12px; }.karaoke-action[aria-pressed="true"] { border-color: #72dccd; background: #153634; color: #9ef2e6; }.karaoke-play { width: 54px; min-width: 54px; border-color: #72dccd; background: #2b716b; color: #fff; font-size: 19px; box-shadow: 0 5px 16px #3ab6aa44; }.karaoke-summary { margin: 12px; padding: 14px; border: 1px solid #2a3746; border-radius: 8px; background: #101720; }.karaoke-final-score { display: grid; justify-items: center; padding: 13px; }.karaoke-final-score strong { color: #fff0bb; font-size: 52px; line-height: 1; }.karaoke-final-score span, .karaoke-breakdown { color: #91a0b2; font-size: 12px; }.karaoke-breakdown { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #263241; }.karaoke-breakdown strong { color: #e6edf6; }.karaoke-line-scores { display: grid; gap: 5px; max-height: 32dvh; overflow-y: auto; }.karaoke-line-score { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px; border: 1px solid #263241; border-radius: 5px; background: #151d28; color: #dce4ee; text-align: left; }.karaoke-line-score span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.karaoke-line-score strong { color: #fff0bb; }
@media (min-width: 700px) and (min-device-width: 700px) { .karaoke-workbench { max-width: 980px; margin: 0 auto; }.karaoke-stage { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: start; }.karaoke-status, .pitch-roll-wrap, .karaoke-tools, .karaoke-score-strip, .karaoke-progress, .karaoke-controls { grid-column: 1; }.karaoke-lyrics, .karaoke-guide { grid-column: 2; }.karaoke-lyrics { grid-row: 1 / span 5; max-height: 480px; padding-top: 48px; }.karaoke-guide { grid-row: 6; } }

/* Immersive karaoke stage: lyric-first, with all secondary controls tucked away. */
body.karaoke-mode { overflow: hidden; background: #0b0f12; }
body.karaoke-mode .mobile-shell { width: 100%; max-width: none; min-height: 100dvh; padding: 0; }
body.karaoke-mode .mobile-header,
body.karaoke-mode .mobile-tabs,
body.karaoke-mode .mini-player { display: none !important; }
body.karaoke-mode .karaoke-workbench.active { display: flex; min-height: 100dvh; flex-direction: column; background: radial-gradient(ellipse at 50% 44%, #29344a 0%, #15202a 42%, #0b1011 100%); }
body.karaoke-mode .karaoke-head { grid-template-columns: 42px minmax(0, 1fr) 42px 42px; min-height: max(62px, env(safe-area-inset-top)); padding: max(8px, env(safe-area-inset-top)) 12px 8px; border: 0; background: #0d1216d9; backdrop-filter: blur(12px); }
.karaoke-head-copy { min-width: 0; text-align: center; }
.karaoke-head-copy span { display: block; color: #aeb6bb; font-size: 10px; }
.karaoke-head h2 { margin: 2px 0 0; color: #fff; font-size: 19px; font-weight: 700; letter-spacing: 0; }
.karaoke-head-button { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #f4f5f6; font-size: 29px; line-height: 1; }
.karaoke-head-button:focus-visible, .karaoke-head-button:hover { background: #ffffff1c; outline: 1px solid #ffffff66; }
.karaoke-head-button[aria-expanded="true"] { background: #ffffff20; color: #ffcb7b; }
body.karaoke-mode .karaoke-import { margin: auto 14px; }
body.karaoke-mode .karaoke-stage { position: relative; display: grid; min-height: 0; flex: 1; grid-template-columns: 1fr; grid-template-rows: auto clamp(126px, 22dvh, 190px) minmax(0, 1fr) auto auto auto auto; gap: 0; padding: 0 12px max(10px, env(safe-area-inset-bottom)); }
body.karaoke-mode .karaoke-status { align-items: center; min-height: 30px; padding: 0 4px; color: #c7d0d6; font-size: 11px; }
body.karaoke-mode .karaoke-status #karaokeMode { color: #ffd27b; }
body.karaoke-mode .pitch-roll-wrap { height: auto; min-height: 0; overflow: hidden; border: 1px solid #ffffff1e; border-radius: 0; background: repeating-linear-gradient(0deg, #ffffff0e 0 1px, transparent 1px 25%), repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 12.5%), #101a22aa; }
body.karaoke-mode .pitch-cursor { width: 3px; background: #ffd368; box-shadow: 0 0 5px #ffe79c, 0 0 18px #ffbd4a; }
body.karaoke-mode .pitch-cursor::before { position: absolute; top: 0; left: -4px; width: 9px; height: 100%; content: ''; background: linear-gradient(90deg, transparent, #ffe481, transparent); filter: blur(2px); }
body.karaoke-mode .pitch-label { color: #ffffff80; }
body.karaoke-mode .karaoke-score-strip { position: absolute; z-index: 2; top: 36px; left: 12px; display: flex; width: auto; overflow: hidden; border: 1px solid #ffffff20; border-radius: 14px; background: #0a0d11a6; backdrop-filter: blur(8px); }
body.karaoke-mode .karaoke-score-strip > div { display: flex; align-items: baseline; gap: 3px; padding: 4px 8px; }
body.karaoke-mode .karaoke-score-strip > div + div { border-left: 1px solid #ffffff18; }
body.karaoke-mode .karaoke-score-strip strong { color: #ffd17d; font-size: 13px; }
body.karaoke-mode .karaoke-score-strip span { color: #e8e9e8b0; font-size: 9px; }
body.karaoke-mode .karaoke-lyrics { display: flex; min-height: 0; max-height: none; flex-direction: column; justify-content: center; padding: 10px 0; overflow: hidden; text-align: center; scroll-snap-type: none; }
body.karaoke-mode .karaoke-line { width: 100%; margin: 0; padding: 6px 0; overflow: hidden; color: #ffffff73; font-size: var(--karaoke-line-size, 25px); font-weight: 500; line-height: 1.28; text-align: center; text-overflow: ellipsis; white-space: nowrap; transform: none; }
body.karaoke-mode .karaoke-line.active { color: #fff; font-size: calc(var(--karaoke-line-size, 25px) * 1.17); font-weight: 750; text-shadow: 0 2px 18px #0008; transform: none; }
body.karaoke-mode .karaoke-word { transform-origin: 50% 70%; transition: color .15s ease, text-shadow .15s ease, transform .15s ease; }
body.karaoke-mode .karaoke-word.played { color: #aab4b8; text-shadow: none; }
body.karaoke-mode .karaoke-line.active .karaoke-word.singing { color: #ffe08b; text-shadow: 0 0 13px #ffb743b3; transform: translateY(-2px) scale(1.12); }
body.karaoke-mode .karaoke-guide { min-height: 20px; margin: 0; color: #e6ece9b8; font-size: 12px; line-height: 20px; text-align: center; }
body.karaoke-mode .karaoke-progress { padding: 1px 3px 3px; }
body.karaoke-mode .karaoke-progress input { height: 18px; accent-color: #ffd06b; }
body.karaoke-mode .karaoke-progress > div { color: #d5dadd99; font-size: 10px; }
.karaoke-settings { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; padding: 8px; border: 1px solid #ffffff1f; border-radius: 8px; background: #10171de8; }
.karaoke-settings[hidden] { display: none; }
.karaoke-settings label, .karaoke-settings button { display: flex; min-width: 0; align-items: center; justify-content: center; min-height: 34px; gap: 3px; margin: 0; padding: 0 5px; border: 1px solid #ffffff22; border-radius: 5px; background: #ffffff0d; color: #e7ebed; font-size: 11px; }
.karaoke-settings select { min-width: 0; border: 0; outline: 0; background: transparent; color: #ffda8d; font: inherit; }
body.karaoke-mode .karaoke-controls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 4px; min-height: 86px; padding: 6px 1px 0; }
body.karaoke-mode .karaoke-action { display: grid; min-width: 0; min-height: 62px; place-items: center; align-content: center; gap: 3px; padding: 2px; border: 0; border-radius: 8px; background: transparent; color: #f2f4f3; font-size: 27px; }
body.karaoke-mode .karaoke-action span { height: 29px; line-height: 29px; }
body.karaoke-mode .karaoke-action small { max-width: 100%; overflow: hidden; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
body.karaoke-mode .karaoke-action:disabled { color: #9ba4a8; opacity: .45; }
body.karaoke-mode .karaoke-action[aria-pressed="true"] { background: #ffffff12; color: #ffd06b; }
body.karaoke-mode .karaoke-play { width: 66px; min-width: 66px; height: 66px; justify-self: center; align-self: center; border: 0; border-radius: 50%; background: #ff5358; color: #fff; font-size: 29px; line-height: 1; box-shadow: 0 8px 22px #ff53585c; }
body.karaoke-mode .karaoke-play:hover, body.karaoke-mode .karaoke-play:focus-visible { background: #ff686b; outline: 2px solid #fff5; }
body.karaoke-mode .karaoke-summary { position: fixed; z-index: 12; inset: auto 12px max(12px, env(safe-area-inset-bottom)); max-height: 72dvh; margin: 0; overflow: auto; border-color: #ffffff23; background: #10161ef5; backdrop-filter: blur(14px); }
@media (min-width: 700px) and (min-device-width: 700px) { body.karaoke-mode .mobile-shell { width: min(100%, 1100px); } body.karaoke-mode .karaoke-stage { grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr); grid-template-rows: 30px minmax(250px, 1fr) auto auto auto; column-gap: 20px; padding: 0 24px 18px; } body.karaoke-mode .karaoke-status { grid-column: 1; grid-row: 1; } body.karaoke-mode .pitch-roll-wrap { grid-column: 1; grid-row: 2; } body.karaoke-mode .karaoke-lyrics { grid-column: 2; grid-row: 1 / span 2; } body.karaoke-mode .karaoke-guide { grid-column: 2; grid-row: 3; } body.karaoke-mode .karaoke-progress { grid-column: 1; grid-row: 3; } body.karaoke-mode .karaoke-settings { grid-column: 1 / -1; grid-row: 4; } body.karaoke-mode .karaoke-controls { grid-column: 1 / -1; grid-row: 5; } body.karaoke-mode .karaoke-score-strip { position: absolute; top: 34px; left: 24px; } }

/* PWA K歌复用桌面练唱数据；播放时钟直接控制逐字与音高，不使用视觉缓动。 */
body.karaoke-mode .karaoke-line,
body.karaoke-mode .karaoke-word { transition: none; }
body.karaoke-mode .karaoke-progress input {
  height: 22px;
  appearance: none;
  background: linear-gradient(to right, var(--app-warm) 0 var(--karaoke-progress, 0%), var(--app-line) var(--karaoke-progress, 0%) 100%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 3px;
}
body.karaoke-mode .karaoke-progress input::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  appearance: none;
  border: 2px solid var(--app-panel);
  border-radius: 50%;
  background: var(--app-warm);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-warm) 30%, transparent);
}
body.karaoke-mode #karaokeMic[aria-pressed="true"] small::after {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--status-error-text);
  content: '';
  vertical-align: 1px;
}
.karaoke-recording-result {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--app-panel) 90%, transparent);
}
.karaoke-recording-result[hidden] { display: none; }
.karaoke-recording-result > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.karaoke-recording-result strong { color: var(--app-text); font-size: 13px; }
.karaoke-recording-result span { color: var(--app-muted); font-size: 10px; }
.karaoke-recording-result audio { width: 100%; height: 36px; }
.karaoke-recording-actions { display: flex; justify-content: flex-end; gap: 8px; }
.karaoke-recording-actions :is(button, a) { min-height: 34px; }
@media (max-height: 720px) and (orientation: portrait) {
  body.karaoke-mode .karaoke-stage { grid-template-rows: auto clamp(112px, 20dvh, 150px) minmax(0, 1fr) auto auto auto auto; }
  body.karaoke-mode .karaoke-controls { min-height: 72px; }
  body.karaoke-mode .karaoke-action { min-height: 54px; }
  body.karaoke-mode .karaoke-play { width: 58px; min-width: 58px; height: 58px; }
}

/* Core workflow: one song, four simple actions. Secondary material management stays outside the main tab bar. */
.mobile-core-brief { display: grid; gap: 3px; margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid #68d5c7; background: #111b20; color: #dce9e8; }
.mobile-core-brief strong { font-size: 13px; }
.mobile-core-brief span { color: #8fa5a8; font-size: 11px; }
.mobile-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(52px, .58fr); }
.mobile-tab-secondary { color: #8d9aa6; }
.header-actions { gap: 6px; }
.header-actions .compact-action { min-height: 32px; padding-inline: 9px; border: 1px solid #29343e; border-radius: 5px; background: #151b23; }
.header-actions .compact-action:hover, .header-actions .compact-action:focus-visible { border-color: #68d5c7; color: #9ef2e6; }
.upload-panel { margin-top: 12px; }
@media (min-width: 900px) and (min-device-width: 900px) {
  body.online-demo .mobile-core-brief { display: flex; align-items: baseline; gap: 16px; margin: 0 0 16px; padding: 12px 16px; }
  body.online-demo .mobile-core-brief strong { font-size: 15px; }
  body.online-demo .mobile-core-brief span { font-size: 12px; }
  body.online-demo .mobile-tabs { grid-template-columns: repeat(5, minmax(120px, 1fr)) minmax(72px, .58fr); }
}

/* Android Chrome can ignore the viewport meta tag when "Desktop site" is enabled.
   Restore the device-width layout while preserving the browser's current page scale. */
html.desktop-site-viewport { overflow-x: clip; }
html.desktop-site-viewport body {
  width: var(--desktop-site-layout-width);
  min-width: var(--desktop-site-layout-width);
  transform: scale(var(--desktop-site-scale));
  transform-origin: top left;
}
html.desktop-site-viewport .mobile-shell { width: 100%; max-width: none; margin: 0; }

/* Keep the full K-song transport in the viewport on both phone and desktop-site layouts. */
body.karaoke-mode .mobile-core-brief { display: none !important; }
body.karaoke-mode .karaoke-workbench.active {
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}
body.karaoke-mode .karaoke-stage { overflow: hidden; }
body.karaoke-mode .karaoke-line { display: none; }
body.karaoke-mode .karaoke-line.is-visible { display: block; }

.karaoke-progress {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 0 7px;
}
.karaoke-progress > input { grid-column: 2; grid-row: 1; }
.karaoke-progress > div { grid-column: 2; grid-row: 2; }
.karaoke-seek-line {
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--app-line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--app-panel) 78%, transparent);
  color: var(--app-text);
  font-size: 25px;
  line-height: 1;
}
#karaokePreviousLine { grid-column: 1; }
#karaokeNextLine { grid-column: 3; }
.karaoke-seek-line:hover,
.karaoke-seek-line:focus-visible {
  border-color: var(--app-accent);
  color: var(--app-accent);
}
.karaoke-seek-line:disabled { opacity: .42; cursor: not-allowed; }
body.karaoke-mode .karaoke-record[aria-pressed="true"] {
  background: color-mix(in srgb, var(--app-coral) 14%, transparent);
  color: var(--app-coral);
}
body.karaoke-mode .karaoke-recording-result {
  position: absolute;
  z-index: 8;
  right: 12px;
  bottom: max(94px, calc(82px + env(safe-area-inset-bottom)));
  left: 12px;
  max-height: min(230px, 36dvh);
  margin: 0;
  overflow: auto;
  background: color-mix(in srgb, var(--app-panel) 96%, transparent);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--app-shadow) 72%, transparent);
  backdrop-filter: blur(14px);
}
@media (min-width: 700px) and (min-device-width: 700px) {
  body.karaoke-mode .karaoke-recording-result {
    right: 24px;
    bottom: 104px;
    left: auto;
    width: min(430px, calc(100% - 48px));
  }
}
