:root {
  color-scheme: dark;
  --navy: #142334;
  --slate: #213348;
  --mist: #eaf2fb;
  --periwinkle: #b8b6f8;
  --blue: #87c9ec;
  --ink: #20364c;
  --bg: var(--navy);
  --text: var(--mist);
  --muted: #afbed0;
  --dim: #afbed0;
  --line: #405369;
  --surface: var(--slate);
  --surface-2: #2b4057;
  --display: "Manrope", sans-serif;
  --lyrics: "Noto Sans", "Noto Sans Hebrew", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-gutter: stable; }
::selection { background: var(--periwinkle); color: var(--navy); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
input { caret-color: currentColor; }
button, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible, a:focus-visible, .line:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
#backdrop, #backdropOverlay { display: none; }
main { max-width: 1248px; margin: 0 auto; padding: 0 24px 64px; }

.topbar {
  min-height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.035em;
}
.wordmark .brand-icon { flex: 0 0 auto; width: 40px; height: 40px; object-fit: contain; }
.wordmark span { white-space: nowrap; }
.wordmark b { font-weight: 800; }

.home-intro { max-width: 850px; padding: 58px 0 28px; }
.home-intro h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.5rem, 5.3vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.08;
  text-wrap: balance;
}
.home-intro p {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}
.search {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 850px;
  margin: 12px 0 0;
  padding: 8px 9px 8px 22px;
  border: 1px solid #61778c;
  border-radius: 12px;
  background: var(--mist);
  color: var(--ink);
}
.search:focus-within { outline: 3px solid var(--blue); outline-offset: 4px; }
.search svg { width: 21px; height: 21px; flex: 0 0 auto; color: #526b83; }
.search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}
.search input::placeholder { color: #52687e; opacity: 1; }
.search input:focus-visible { outline: none; }
.search .pill.on { min-width: 102px; color: var(--mist); background: var(--navy); border-color: var(--navy); }
.search .pill.on:hover { background: #2d445e; }
.search-help { margin: 12px 0 0; color: var(--muted); font-size: .8rem; }
body:not(.mode-home) .home-intro, body:not(.mode-home) #home { display: none; }
body:not(.mode-results) #results { display: none; }
body:not(.mode-home) .search { max-width: 100%; margin-top: 24px; }
body.mode-play .search-help { display: none; }

.shelf { margin-top: 38px; }
.shelf h2 {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -.025em;
}
.cards {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  margin: -4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #5c728b transparent;
}
.card {
  flex: 0 0 144px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  scroll-snap-align: start;
}
.card .art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 144px;
  height: 144px;
  object-fit: cover;
  border: 1px solid #48617a;
  border-radius: 8px;
  background: #2a415b;
  color: var(--periwinkle);
  font-size: 2.3rem;
  font-weight: 600;
}
.card:hover .art { border-color: var(--blue); }
.card .ct, .card .cs { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card .ct { margin-top: 11px; font-size: .87rem; font-weight: 600; }
.card .cs { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.shelf-empty { padding: 12px 0; color: var(--muted); font-size: .88rem; }
.starter-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.starter-song {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 96px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--slate);
  color: var(--text);
  text-align: left;
}
.starter-song:hover { background: var(--surface-2); border-color: var(--blue); }
.starter-song strong { font-size: 1rem; font-weight: 600; }
.starter-song span { color: var(--muted); font-size: .78rem; }
.learning-note {
  max-width: 75ch;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.8;
}
.learning-note p { margin: 0; }
.learning-note strong { color: var(--text); font-weight: 600; }

#results { max-width: 850px; margin-top: 24px; }
.result {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 94px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.result:hover { background: var(--slate); }
.result img { flex: 0 0 auto; width: 116px; height: 66px; border-radius: 5px; object-fit: cover; background: var(--slate); }
.result .info { flex: 1; min-width: 0; }
.result .rt { font-size: .96rem; font-weight: 600; overflow-wrap: anywhere; }
.result .ru { margin-top: 5px; color: var(--muted); font-size: .8rem; }

.listening-layout { display: none; }
body.mode-play .listening-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: 32px;
  margin-top: 32px;
}
.player-column, .lyrics-column { min-width: 0; }
.player-column { position: sticky; top: 24px; }
#playerWrap {
  display: none;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  overflow: hidden;
  border: 1px solid #4a5e75;
  border-radius: 12px;
  background: #101b29;
}
#playerWrap.show { display: block; }
#player { display: block; width: 100%; height: 100%; border: 0; }
#nowPlaying { display: none; margin-top: 24px; }
#nowPlaying.show { display: block; }
#nowPlaying .np { display: flex; align-items: center; gap: 14px; }
#nowPlaying .npart { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--slate); }
#nowPlaying .npmeta { min-width: 0; flex: 1; }
#nowPlaying .t { font-size: 1.45rem; font-weight: 600; letter-spacing: -.04em; line-height: 1.35; overflow-wrap: anywhere; }
#nowPlaying .a { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.playback-controls {
  margin-top: 20px;
  padding: 16px 18px 12px;
  border: 1px solid #536880;
  border-radius: 16px;
  background: var(--slate);
  color: var(--mist);
}
.playback-timeline { display: flex; align-items: center; gap: 12px; direction: ltr; }
.playback-timeline output { min-width: 3.5ch; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--muted); }
#playbackDuration { text-align: right; }
#playbackSeek { flex: 1; min-width: 0; width: 100%; min-height: 32px; margin: 0; cursor: pointer; accent-color: var(--blue); }
#playbackSeek:disabled { cursor: not-allowed; opacity: .5; }
.playback-actions { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 4px 0 10px; direction: ltr; }
.playback-actions button { display: inline-flex; align-items: center; justify-content: center; border: 0; }
.transport-toggle { gap: 8px; min-width: 126px; min-height: 52px; padding: 10px 18px; border-radius: 28px; background: var(--periwinkle); color: var(--navy); font-size: .9rem; font-weight: 800; }
.transport-toggle:hover:not(:disabled) { background: #ceccff; }
.transport-toggle span { display: inline-flex; align-items: center; }
.transport-skip { position: relative; width: 48px; min-height: 48px; padding: 0; border-radius: 50%; background: transparent; color: var(--mist); }
.transport-skip:hover:not(:disabled) { background: var(--surface-2); }
.transport-skip span { position: absolute; top: 18px; left: 0; right: 0; font-size: .75rem; font-weight: 700; line-height: 1; }
.playback-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; font-size: .75rem; line-height: 1.5; }
#playbackStatus { flex: 1 1 100px; margin: 0; color: var(--muted); }
.playback-controls:has(#playbackRetry:not([hidden])) #playbackStatus { flex-basis: 100%; text-align: center; }
#playbackRetry { min-height: 44px; padding: 6px 12px; border: 1px solid var(--blue); border-radius: 7px; background: transparent; color: var(--mist); font-size: .78rem; font-weight: 700; }
#playbackRetry:hover { background: var(--surface-2); }
#playbackSource { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); }
.np-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.pill {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #536880;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
}
.pill:hover { background: var(--surface-2); border-color: var(--blue); }
.pill.on, .pill[aria-pressed="true"] { border-color: var(--periwinkle); background: var(--periwinkle); color: var(--navy); }
.pill.on:hover, .pill[aria-pressed="true"]:hover { background: #ceccff; border-color: #ceccff; }
.linkbtn {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #61778c;
}
.linkbtn:hover { color: var(--text); }
#practiceControls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding: 22px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
#practiceControls label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .76rem; }
.practice-row { display: grid; grid-template-columns: 126px minmax(132px, max-content); align-items: end; gap: 8px 12px; width: 100%; }
.practice-row label { grid-column: 1 / -1; }
#playbackSpeed {
  min-width: 126px;
  min-height: 44px;
  padding: 9px 32px 9px 12px;
  border: 1px solid #536880;
  border-radius: 7px;
  background-color: var(--slate);
  color: var(--text);
  font-size: .83rem;
}
#repeatLine { min-width: 132px; }
.practice-help { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
#timingControls { margin-top: 14px; }
#timingControls summary { width: fit-content; min-height: 44px; padding: 10px 2px; color: var(--muted); font-size: .8rem; cursor: pointer; }
#timingControls summary:hover { color: var(--text); }
#timingControls[open] summary { margin-bottom: 10px; color: var(--text); }
.timing-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sync { display: flex; align-items: center; overflow: hidden; max-width: 100%; border: 1px solid #536880; border-radius: 7px; background: var(--slate); }
.sync button { min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--text); font-size: .78rem; }
.sync button:hover { background: var(--surface-2); }
.sync button:focus-visible { outline-offset: -4px; }
.sync output, .sync span { min-width: 82px; padding: 0 8px; color: var(--text); text-align: center; font-size: .78rem; font-variant-numeric: tabular-nums; }
#syncHelp { margin: 12px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.7; }
#fixMatch { display: none; gap: 12px; margin-top: 18px; }
#fixMatch.show { display: flex; flex-wrap: wrap; align-items: flex-end; }
#fixMatch .field { display: flex; flex: 1 1 140px; flex-direction: column; gap: 6px; min-width: 0; }
#fixMatch label { color: var(--muted); font-size: .76rem; }
#fixMatch input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #536880; border-radius: 7px; background: var(--slate); color: var(--text); }
#fixMatch button { min-height: 44px; padding: 9px 16px; border: 0; border-radius: 7px; background: var(--blue); color: var(--navy); font-size: .83rem; font-weight: 700; }
.status { margin-top: 18px; color: var(--muted); font-size: .81rem; line-height: 1.7; overflow-wrap: anywhere; }
.status:empty { display: none; }
.status.error { color: #ffb8ae; }
body.mode-play .status:not(.error) { display: none; }

.lyrics-column {
  overflow: hidden;
  border: 1px solid #d0ddeb;
  border-radius: 16px;
  background: var(--mist);
  color: var(--ink);
  color-scheme: light;
  scroll-margin-top: 16px;
}
.lyrics-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px; min-height: 74px; padding: 14px 24px; border-bottom: 1px solid #cad7e6; }
.lyrics-heading h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.03em; }
#lyricsMode { color: #4a6279; font-size: .75rem; text-align: right; }
.lyric-follow, .lyric-focus { min-height: 44px; padding: 8px 11px; border: 1px solid #9eb4c8; border-radius: 7px; background: transparent; color: #254968; font-size: .75rem; font-weight: 600; line-height: 1.4; }
.lyric-follow:hover { background: #c7deef; border-color: #729bb9; }
.lyric-focus { border-color: #294760; background: #294760; color: var(--mist); }
.lyric-focus:hover { border-color: #365a78; background: #365a78; }
.lyric-follow:focus-visible, .lyric-focus:focus-visible { outline-color: #286b9d; }
.lyrics-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0; padding: 15px 30px 3px; color: #324b64; font-size: .75rem; font-weight: 600; }
.lyrics-legend span { display: none; color: #506078; font-weight: 400; }
.lyrics-legend span:first-of-type { font-style: italic; }
body.show-rom .lyrics-legend span:first-of-type, body.show-en .lyrics-legend span:last-child { display: inline; }
.lyrics-credit { margin: 0; padding: 13px 28px 15px; border-top: 1px solid #cad7e6; color: #4a6279; font-size: .75rem; line-height: 1.7; }
#lyricsBox {
  display: none;
  min-height: 280px;
  max-height: min(650px, calc(100dvh - 420px));
  padding: 12px 12px 30vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #94aabd transparent;
}
#lyricsBox.show { display: block; }
#lyricsBox.timed { height: min(650px, calc(100dvh - 420px)); overflow-anchor: none; }
#lyricsBox:focus-visible { outline: 3px solid #286b9d; outline-offset: -4px; }
#lyricsEmpty { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; min-height: 280px; padding: 28px; color: #445c73; }
#lyricsEmpty p { max-width: 42ch; margin: 0; font-size: .9rem; line-height: 1.8; }
#retryLyrics, #retryTranslation { min-height: 44px; padding: 8px 12px; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: inherit; font-size: .78rem; font-weight: 600; }
#retryLyrics:hover, #retryTranslation:hover { background: #c7deef; }
#retryLyrics:focus-visible, #retryTranslation:focus-visible { outline-color: #286b9d; }
.translation-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 10px 24px 0; padding: 10px 12px; border-radius: 7px; background: #dce8f5; color: #294760; font-size: .76rem; line-height: 1.6; }
.translation-feedback p { flex: 1 1 180px; margin: 0; }
.translation-feedback[data-state="ready"] { padding: 0; background: transparent; color: #4a6279; }
.translation-feedback[data-state="error"] { background: #f6e5df; color: #753e32; }
.translation-feedback[data-state="error"] #retryTranslation:hover { background: #eed4ca; }
.line {
  position: relative;
  padding: 17px 18px 19px;
  border: 2px solid transparent;
  border-radius: 8px;
  text-align: left;
  scroll-margin-block: 24px;
}
.line + .line { margin-top: 3px; }
.line.synced { cursor: pointer; }
.line.synced:hover { background: #dfeaf6; }
.line:focus-visible { outline-color: #286b9d; outline-offset: -3px; }
.line[dir="rtl"] { text-align: right; }
.line-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #536b82; direction: ltr; text-align: left; font-size: .75rem; font-variant-numeric: tabular-nums; }
.line-number { min-width: 15px; }
.line-time { padding-left: 10px; border-left: 1px solid #b5c6d7; }
.line .orig { color: #324b64; font-family: var(--lyrics); font-size: 1.45rem; font-weight: 600; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.line .rom, .line .trans { display: none; direction: ltr; text-align: left; overflow-wrap: anywhere; }
.line .rom { margin-top: 8px; color: #506078; font-family: var(--lyrics); font-size: .91rem; font-style: italic; line-height: 1.7; }
.line .trans { margin-top: 7px; color: #445c73; font-size: .94rem; line-height: 1.7; }
body.show-en .line .trans { display: block; }
body.show-rom .line .rom { display: block; }
.line .rom:empty, .line .trans:empty { display: none !important; }
.line.active { background: #d3e6f5; }
.line.active::before { content: ""; position: absolute; top: 17px; bottom: 17px; left: -2px; width: 3px; border-radius: 3px; background: #2b6b98; }
.line.active .orig { color: #142e47; }
.line.active .trans { color: #2c4962; }
.line.active .rom { color: #405573; }
.line.repeat-target { border-color: #7974ba; }
.line.repeat-target .line-meta { color: #5a508c; }
.line .prog { display: none; }

#immersiveBtn {
  display: none;
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border: 1px solid #6b829a;
  border-radius: 12px;
  background: var(--slate);
  color: var(--mist);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 4px 16px #14233426;
}
#immersiveBtn.show { display: flex; align-items: center; justify-content: center; }
#immersiveBtn svg { display: block; width: 20px; height: 20px; }
#immersiveBtn:hover { background: #304a64; }
body.immersive { background: var(--mist); color: var(--ink); }
body.immersive .topbar, body.immersive .search, body.immersive .search-help,
body.immersive .home-intro, body.immersive #home, body.immersive #results,
body.immersive .np-controls, body.immersive #practiceControls,
body.immersive #timingControls, body.immersive #fixMatch,
body.immersive .status, body.immersive .lyrics-heading,
body.immersive .lyrics-legend, body.immersive .lyrics-credit { display: none !important; }
body.immersive { --transport-height: 184px; --listening-header-height: 232px; }
body.immersive main { max-width: 900px; padding-top: var(--listening-header-height); padding-bottom: var(--transport-height); }
body.immersive.mode-play .listening-layout { display: block; margin-top: 0; }
body.immersive .player-column { position: static; }
body.immersive .lyrics-column { overflow: visible; border: 0; border-radius: 0; }
body.immersive #nowPlaying { position: fixed; z-index: 20; top: 0; right: 0; left: 0; max-width: 900px; min-height: var(--listening-header-height); margin: 0 auto; padding: 28px 88px 20px 288px; background: var(--mist); }
body.immersive #nowPlaying .npart { display: none; }
body.immersive #nowPlaying .t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 1.15rem; }
body.immersive #nowPlaying .a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4a6279; }
body.immersive #lyricsBox { min-height: 0; height: max(0px, calc(100dvh - var(--listening-header-height) - var(--transport-height))); max-height: none; padding-bottom: 45vh; }
body.immersive .line { padding: 24px; }
body.immersive .line .orig { font-size: 2rem; }
body.immersive #playerWrap { position: fixed; z-index: 30; top: 16px; left: max(24px, calc((100vw - 900px) / 2 + 24px)); width: 240px; height: 200px; aspect-ratio: auto; border-radius: 7px; }
body.immersive .playback-controls { position: fixed; z-index: 35; right: 12px; bottom: max(8px, env(safe-area-inset-bottom)); left: 12px; max-width: 852px; margin: 0 auto; padding: 10px 18px 6px; }
body.immersive .playback-actions { margin-block: 0 4px; }
body.immersive #lyricsEmpty { min-height: 120px; padding-block: 24px; }
body.immersive #immersiveBtn { top: 20px; bottom: auto; }
body.immersive .translation-feedback { position: fixed; z-index: 25; right: 24px; bottom: calc(var(--transport-height) + 8px); left: 24px; max-width: 640px; margin-inline: auto; }
body.immersive .translation-feedback[data-state="ready"] { display: none; }

@media (min-width: 1400px) {
  body.mode-play .listening-layout { gap: 40px; }
}
@media (max-width: 900px) {
  .topbar { min-height: 84px; }
  body.mode-play .listening-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }
  .lyrics-heading { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 20px; }
  .lyrics-heading h2 { grid-column: 1; grid-row: 1; }
  #focusLyrics { grid-column: 2; grid-row: 1; }
  #lyricsMode { grid-column: 1; grid-row: 2; text-align: left; }
  #followLyrics { grid-column: 2; grid-row: 2; }
  #lyricsBox { padding-right: 8px; padding-left: 8px; }
  .line { padding-right: 12px; padding-left: 12px; }
  .line .orig { font-size: 1.3rem; }
  .np-controls { gap: 6px; }
  .pill { padding-right: 11px; padding-left: 11px; }
}
@media (max-width: 720px) {
  main { padding: 0 20px 48px; }
  .topbar { min-height: 78px; gap: 16px; }
  body.mode-play .topbar { min-height: 60px; }
  body.mode-play .search { margin-top: 12px; }
  .wordmark { gap: 9px; font-size: .9rem; }
  .wordmark .brand-icon { width: 36px; height: 36px; }
  .home-intro { padding-top: 38px; padding-bottom: 25px; }
  .home-intro h1 { max-width: 520px; font-size: clamp(2.55rem, 8.3vw, 3.5rem); }
  .home-intro p { margin-top: 21px; font-size: .94rem; }
  .search { gap: 10px; padding: 7px 7px 7px 15px; }
  .search .pill.on { min-width: 82px; }
  .search-help { font-size: .75rem; }
  .starter-list { grid-template-columns: 1fr; gap: 8px; }
  .starter-song { min-height: 78px; gap: 3px; }
  .shelf { margin-top: 30px; }
  .cards { gap: 16px; }
  .card { flex-basis: 132px; }
  .card .art { width: 132px; height: 132px; }
  body.mode-play .listening-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
  .player-column { position: static; }
  #nowPlaying { margin-top: 12px; }
  #nowPlaying .npart { width: 44px; height: 44px; }
  #nowPlaying .t { font-size: 1.2rem; letter-spacing: -.025em; }
  #nowPlaying .a { margin-top: 3px; font-size: .8rem; }
  .np-controls { margin-top: 12px; gap: 6px; }
  .np-controls .pill { padding: 8px 10px; font-size: .75rem; }
  #fixToggle { padding-inline: 3px; font-size: .75rem; }
  #practiceControls { gap: 6px; margin-top: 12px; padding: 12px 0 10px; }
  .practice-row { grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1.3fr); align-items: center; gap: 8px; }
  .practice-row label { grid-column: auto; line-height: 1.4; }
  #playbackSpeed { min-width: 0; width: 100%; padding-inline: 8px 22px; font-size: .8rem; }
  #repeatLine { min-width: 0; width: 100%; padding-inline: 6px; font-size: .75rem; }
  .practice-help { font-size: .75rem; line-height: 1.6; }
  #timingControls { margin-top: 0; }
  #lyricsBox { min-height: 240px; max-height: clamp(240px, calc(100dvh - 280px), 620px); padding-right: 8px; padding-left: 8px; }
  #lyricsBox.timed { height: clamp(240px, calc(100dvh - 280px), 620px); }
  .lyrics-heading { min-height: 66px; padding: 10px 18px; gap: 4px 12px; }
  .lyrics-legend { padding: 12px 24px 3px; gap: 8px 14px; }
  .lyrics-credit { padding: 10px 20px; }
  .translation-feedback { margin: 8px 20px 0; font-size: .75rem; }
  #lyricsEmpty { min-height: 240px; padding: 24px; }
  .line { padding: 16px 14px 18px; }
  .line .orig { font-size: 1.4rem; }
  .line .trans { font-size: .93rem; }
  .result { gap: 12px; padding: 12px 0; }
  .result img { width: 96px; height: 54px; }
  .result .rt { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .88rem; }
  .result .ru { font-size: .75rem; }
  #fixMatch input { font-size: 16px; }
  #immersiveBtn { right: 12px; bottom: 12px; width: 44px; height: 44px; }
  body.immersive main { padding-right: 8px; padding-left: 8px; }
  body.immersive #nowPlaying { padding: 74px 16px 16px 232px; }
  body.immersive #nowPlaying .t { font-size: .9rem; letter-spacing: -.02em; line-height: 1.5; }
  body.immersive #nowPlaying .a { font-size: .75rem; }
  body.immersive #playerWrap { width: 200px; left: 16px; top: 16px; }
  body.immersive .line { padding: 20px 16px; }
  body.immersive .line .orig { font-size: 1.5rem; }
}
@media (max-width: 400px) {
  main { padding-right: 16px; padding-left: 16px; }
  .home-intro h1 { font-size: 2.45rem; }
  .search { gap: 7px; padding-left: 11px; }
  .search svg { display: none; }
  .search .pill.on { min-width: 76px; padding-right: 11px; padding-left: 11px; }
  .sync button { padding-right: 10px; padding-left: 10px; }
  .lyrics-heading { padding-right: 16px; padding-left: 16px; }
  #lyricsMode { font-size: .75rem; }
}
@media (max-height: 540px) and (min-width: 600px) {
  body.immersive { --listening-header-height: 20px; }
  body.immersive main { max-width: none; padding-left: 240px; padding-right: 20px; }
  body.immersive #playerWrap { left: 20px; width: 200px; top: 20px; }
  body.immersive #nowPlaying { left: 20px; right: auto; top: 232px; width: 200px; min-height: 0; padding: 0; background: transparent; }
  body.immersive #nowPlaying .t { font-size: .85rem; -webkit-line-clamp: 2; }
  body.immersive #nowPlaying .a { font-size: .75rem; }
  body.immersive .playback-controls { left: 240px; right: 20px; }
  body.immersive #immersiveBtn { top: 20px; right: 20px; }
  body.immersive .translation-feedback { left: 240px; right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
