/* Browser layout. Portrait scales a phone scene to fit the visible viewport. */
:root {
  color-scheme: dark;
  --app-height: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --app-top-gap: 0px;
  --app-bottom-gap: max(4px, env(safe-area-inset-bottom));
  --message-height: 22px;
  --build-footer-height: 14px;
  --toolbar-height: calc(56px + env(safe-area-inset-top) + var(--app-top-gap));
  --home-cover-height: 50%;
  --compact-info-height: 30%;
  --compact-content-gap: 6px;
}
:root.web-standalone { --app-top-gap: 4px; }
/* RPWeb.portraitScene supplies the shared phone dimensions for every portrait screen. */
#web-stage { display: contents; }
:root.web-scaled-portrait #web-stage {
  display: block; position: absolute; width: var(--portrait-width); height: var(--portrait-height);
  transform-origin: top left;
  --safe-top: 0px; --safe-bottom: 0px; --safe-left: 0px; --safe-right: 0px;
  --app-top-gap: 0px; --app-bottom-gap: 4px; --toolbar-height: 56px;
}
:root.web-scaled-portrait body { height: 100%; }
:root.web-scaled-portrait #welcome h1 { font-size: 34px; }
:root.web-scaled-portrait #welcome .welcome-about { font-size: 15.6px; }
html, body { width: 100%; height: 100%; min-height: 100%; overflow: hidden; }
/* Paint one continuous background across the viewport, including the player margins. */
body { height: var(--app-height); background: radial-gradient(ellipse at 14% 52%, #394320 0, #283015 39%, #191e0d 76%); }
:root:has(#rp-player.rp-dimmed), body:has(#rp-player.rp-dimmed) { background: #000; }
[hidden] { display: none !important; }
#shared-song-overlay { position: fixed; z-index: 1000002; inset: 0; display: grid; place-items: center; box-sizing: border-box; padding: 24px; background: #000b; pointer-events: none; }
#shared-song-overlay p { box-sizing: border-box; max-width: 480px; margin: 0; padding: 24px; border: 1px solid #a4af8c; border-radius: 14px; background: #202716; color: #f4f5ec; font-size: clamp(18px, 3vw, 24px); line-height: 1.5; text-align: center; }
button { touch-action: manipulation; }
#share-song, #web-options #web-fullscreen { box-sizing: border-box; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 10px; border: 1px solid #a4af8c; border-radius: 7px; background: #202716e6; color: #f4f5ec; cursor: pointer; }
#share-song { position: absolute; z-index: 2; right: 0; top: calc(var(--share-top, 0px) + 44px / 3); }
#rp-player:not(.rp-view-compact) #share-song { top: var(--share-top, 0px); }
#share-song svg, #web-fullscreen svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#web-options #web-fullscreen { flex: 0 0 44px; min-width: 44px; max-width: 44px; appearance: none; -webkit-appearance: none; }
#web-fullscreen svg { display: block; flex: none; overflow: visible; }
/* Portrait navigation is outside the player; hide it together with every button. */
:root.web-portrait:has(#rp-player.rp-dimmed) button { visibility: hidden; pointer-events: none; }
:root:has(#rp-player.rp-dimmed) #web-options { visibility: hidden; pointer-events: none; }
#share-dialog { box-sizing: border-box; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid #a4af8c; border-radius: 14px; background: #202716; color: #f4f5ec; }
#share-dialog::backdrop { background: #000b; }
#share-dialog h2 { margin: 0 0 12px; }
#share-dialog p { line-height: 1.5; overflow-wrap: anywhere; }
#share-dialog label { display: block; margin-bottom: 6px; }
#share-dialog input { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid #647146; border-radius: 7px; background: #191e0d; color: #f4f5ec; font: inherit; }
#share-dialog button { padding: 10px 16px; min-height: 44px; border: 1px solid #a4af8c; border-radius: 7px; background: #394320; color: #f4f5ec; font: inherit; }
#share-dialog > div { display: flex; gap: 8px; }
#share-message { min-height: 24px; }
button:focus-visible, [role=slider]:focus-visible { outline: 2px solid #d7e1c1 !important; outline-offset: 2px; }
#welcome { --welcome-label-lift: 16px; height: var(--app-height); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; text-align: center; background: transparent; }
#welcome > img { width: 132px; height: 132px; flex-shrink: 0; transform: scale(1.2); transform-origin: center top; }
#welcome h1 { margin: 20px 0 0; font-size: clamp(34px, 6vw, 64px); letter-spacing: -2px; }
#welcome p { color: #bacb93; line-height: 1.7; font-size: 18px; }
#welcome .welcome-label { font-size: 11px; letter-spacing: 3px; margin: 28px 0 0; transform: translateY(calc(-1 * var(--welcome-label-lift))); }
/* Match the heading gap, accounting for the official paragraph's 6px bottom margin. */
#start { margin: 20px 0; padding: 16px 32px; border: 1px solid #a4af8c; border-radius: 12px; color: #191e0d; background: #d7e1c1; font-size: 17px; transform: translateY(calc(var(--welcome-label-lift) - 6px)); }
#web-toolbar { position: relative; z-index: 100001; display: flex; align-items: center; justify-content: flex-start; gap: 8px; height: var(--toolbar-height); padding: calc(6px + env(safe-area-inset-top)) 12px 6px; box-sizing: border-box; }
#web-toolbar button, #web-options button { border: 1px solid #647146; border-radius: 7px; background: #202716; color: #cad4b3; font-size: 13px; padding: 9px 15px; min-height: 40px; }
#web-toolbar button[aria-pressed=true] { background: #394320; color: #f4f5ec; border-color: #a4af8c; }
#web-toolbar [data-view]:disabled, #web-view-controls [data-view]:disabled { opacity: .45; cursor: default; }
#web-toolbar [data-view] { width: 96px; }
#web-view-controls { display: none; }
#web-toolbar #rp-exit, #web-toolbar #rp-station-picker { position: static; display: grid; place-items: center; width: 61.6px; height: 40px; padding: 6px; }
#web-toolbar #rp-station-picker { margin-right: 7px; }
#web-toolbar #rp-exit svg, #web-toolbar #rp-station-picker svg { display: block; width: 25px; height: 25px; fill: currentColor; }
#web-toolbar #rp-station-picker svg, #rp-player #rp-station-picker svg { fill: none; }
#web-options { position: fixed; z-index: 100001; bottom: max(8px, env(safe-area-inset-bottom)); right: 12px; display: flex; gap: 6px; }
#rp-player, #rp-player.rp-dimmed { background: transparent; transform-origin: top left; }
#rp-progress { cursor: pointer; overflow: visible; }
#rp-progress::before { content: ''; position: absolute; inset: -10px 0; }
#rp-fill { pointer-events: none; }
#rp-player#rp-player #rp-footer { display: none; }
#rp-player#rp-player.rp-choosing-station #rp-footer { position: fixed; z-index: 5; left: 20px; right: 20px; top: 12px; bottom: auto; width: auto; height: auto; display: flex; flex-wrap: wrap; padding: 12px; gap: 8px; background: #202716; border: 1px solid #647146; border-radius: 14px; box-shadow: 0 0 0 100vmax #000b; }
#rp-player.rp-choosing-station #rp-station-picker { z-index: 6; background: #202716; }
/* Stations is on the lower edge of the landscape layout: show its list above the button. */
:root.web-landscape #rp-player#rp-player.rp-choosing-station #rp-footer { position: absolute; top: auto; bottom: 76px; left: 40px; right: 40px; max-height: 410px; overflow-y: auto; flex-wrap: nowrap; }
:root.web-landscape #rp-player#rp-player.rp-choosing-station #rp-footer button:not([hidden]) { flex: 1 1 0; min-width: 0; max-width: none; font-size: 13px; }
#rp-footer button { flex: 1 1 110px; max-width: none; min-height: 44px; margin: 0; }
@media (min-width: 0px)  {
:root.web-portrait #web-toolbar { position: absolute; left: 0; right: 0; top: auto; bottom: calc(var(--message-height) + var(--app-bottom-gap) + var(--build-footer-height)); justify-content: start; gap: 5px; padding: 6px 10px; }
  :root.web-portrait #web-toolbar button { flex: 1 1 0; min-width: 0; padding: 8px 3px; font-size: 12px; height: 44px; }
  :root.web-portrait #web-toolbar #rp-exit, :root.web-portrait #web-toolbar #rp-station-picker { display: grid; place-items: center; flex: 0 0 53.2px; width: 53.2px; min-width: 53.2px; height: 44px; padding: 6px; }
  :root.web-portrait #web-toolbar #rp-station-picker { margin-right: 7px; }
  /* Portrait navigation stays in the upper toolbar with Exit and Stations. */
  :root.web-portrait #web-toolbar #web-view-controls { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 0; height: 44px; gap: 5px; margin: 0; }
  :root.web-portrait #web-toolbar #web-view-controls button { display: flex; align-items: center; justify-content: center; flex: 1 1 0; width: auto; min-width: 0; height: 44px; padding: 0 3px; margin: 0; border-radius: 7px; }
  :root.web-portrait #web-options { bottom: calc(38px + env(safe-area-inset-bottom)); }
  :root.web-portrait #web-options button { padding: 4px 14px; min-height: 32px; }
  :root.web-portrait #web-fullscreen { display: none !important; }
  :root.web-portrait #web-options { display: none; }
  :root.web-portrait #rp-player#rp-player { position: absolute; top: 0; left: 0; width: 100%; height: calc(var(--app-height) - var(--toolbar-height)); padding: 6px 16px calc(var(--message-height) + var(--app-bottom-gap) + var(--build-footer-height) + 4px); }
  :root.web-portrait #rp-scene { position: relative; inset: auto; width: 100%; height: 100%; container-type: size; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 24px minmax(0, calc(var(--home-cover-height) - 22px)) minmax(0, 1fr); gap: 10px; transform: none !important; }
  :root.web-portrait #rp-player#rp-player .rp-top { position: relative; inset: auto; grid-row: 1; height: 24px; min-width: 0; }
  :root.web-portrait #rp-player#rp-player .rp-brand { display: none; }
  :root.web-portrait #rp-player#rp-player #rp-station { left: 0; top: 0; max-width: 100%; width: auto; height: 22px; line-height: 22px; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  :root.web-portrait #rp-player#rp-player .rp-clock { display: none; }
  :root.web-portrait #rp-player#rp-player .rp-art { position: relative; inset: auto; grid-row: 2; align-self: center; justify-self: center; height: auto; width: min(100%, calc((100cqh - 44px) / 2)); max-width: 100%; aspect-ratio: 1; border-radius: 14px; }
  :root.web-portrait #rp-player#rp-player .rp-placeholder { top: 25%; font-size: 90px; }
  :root.web-portrait #rp-player#rp-player .rp-info { position: relative; inset: auto; grid-row: 3; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(3px, .7dvh, 7px); }
  :root.web-portrait #rp-player#rp-player .rp-info > * { position: static; inset: auto; width: 100%; margin: 0; flex-shrink: 0; }
  :root.web-portrait #rp-player#rp-player #rp-eyebrow, :root.web-portrait #rp-player#rp-player #rp-album-label { display: none; }
  :root.web-portrait #rp-player#rp-player #rp-artist { order: 0; height: auto; font-size: clamp(19px, 3.2dvh, 27px); line-height: 1.15; white-space: nowrap; }
  :root.web-portrait #rp-player#rp-player #rp-title { order: 1; height: auto; max-height: 2.3em; font-size: clamp(21px, 3.5dvh, 30px) !important; line-height: 1.15; -webkit-line-clamp: 2; }
  :root.web-portrait #rp-player#rp-player .rp-album-line { order: 2; height: 20px; line-height: 20px; font-size: 13px; }
  :root.web-portrait #rp-player#rp-player #rp-album { position: static; display: block; height: 20px; line-height: 20px; }
  :root.web-portrait #rp-player#rp-player #rp-progress { order: 3; position: relative; height: 6px; margin-top: 5px; }
  :root.web-portrait #rp-player#rp-player .rp-times { order: 4; position: relative; height: 20px; line-height: 20px; font-size: 12px; }
  :root.web-portrait #rp-player#rp-player .rp-times span, :root.web-portrait #rp-player#rp-player #rp-remaining { height: 20px; line-height: 20px; font-size: 12px; }
  :root.web-portrait #rp-player#rp-player #rp-elapsed, :root.web-portrait #rp-player#rp-player #rp-duration { width: 25%; }
  :root.web-portrait #rp-player#rp-player #rp-remaining { width: 50%; left: 25%; margin: 0; }
  /* Playback controls replace the old view-navigation slot below the timeline. */
  :root.web-portrait #rp-player#rp-player .rp-info > .rp-controls { order: 5; display: flex; align-items: center; justify-content: center; position: static; width: 100%; height: 44px; padding: 0; gap: 12px; margin: 0; }
  :root.web-portrait #rp-player#rp-player .rp-info > .rp-controls button { display: flex; justify-content: center; align-items: center; flex: 1 1 0; max-width: 100px; min-width: 0; width: auto; height: 44px; margin: 0; padding: 0 4px; border-radius: 7px; }
  :root.web-portrait #rp-player#rp-player .rp-info > .rp-controls svg { width: 24px; height: 24px; }
  :root.web-portrait #rp-player#rp-player .rp-quality-label { display: none; }
  :root.web-portrait #rp-player#rp-player #rp-quality-value { position: static; display: inline; height: auto; font-size: 12px; line-height: 24px; text-align: inherit; }
  :root.web-portrait #rp-player#rp-player #rp-next-label { order: 8; height: 13px; line-height: 13px; font-size: 9px; margin-top: 3px; }
  :root.web-portrait #rp-player#rp-player #rp-next { order: 9; height: 18px; line-height: 18px; font-size: 12px; }
  :root.web-portrait #rp-player#rp-player.rp-choosing-station #rp-footer { position: absolute; top: auto; bottom: 4px; left: 0; right: 0; max-height: calc(var(--app-height) - var(--toolbar-height) - 40px); overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :root.web-portrait #rp-player#rp-player.rp-choosing-station #rp-footer button:not([hidden]) { width: 100%; min-width: 0; max-width: none; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-scene { grid-template-columns: minmax(0, .32fr) minmax(0, .68fr); grid-template-rows: minmax(0, var(--compact-info-height)) minmax(0, 1fr); column-gap: 12px; row-gap: 12px; padding-bottom: 0; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-top { display: none; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-art { grid-row: 1; grid-column: 1; width: 100%; height: auto; align-self: start; margin-top: 4px; border-radius: 9px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-info { grid-row: 1; grid-column: 2; gap: 2px; justify-content: start; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-artist { font-size: clamp(14px, 2.4dvh, 20px); }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-title { font-size: clamp(16px, 2.7dvh, 23px) !important; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-album-line { height: 17px; line-height: 17px; font-size: 11px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-album { height: 17px; line-height: 17px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-info > .rp-controls { gap: 5px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-quality-value { line-height: 20px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-times, :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-times span { height: 18px; line-height: 18px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-progress { margin-top: 3px; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-next-label, :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-next { display: none; }
  :root.web-portrait #rp-player#rp-player #rp-lyrics { position: relative; inset: auto; grid-row: 2; grid-column: 1 / -1; width: 100%; height: 100%; min-height: 0; }
  :root.web-portrait #rp-player#rp-player #rp-lyrics-text { left: 0; right: 0; width: calc(100% - 28px); height: 100%; }
  :root.web-portrait #rp-player#rp-player #rp-lyrics.rp-lyrics-alternate #rp-lyrics-text { top: 0; height: 100%; }
  /* Match the gap to the copyright footer, preserving the message area below. */
  :root.web-portrait #rp-player#rp-player.rp-view-lyrics #rp-lyrics {
    --lyrics-edge-gap: calc(var(--message-height) + var(--app-bottom-gap) + 4px);
    top: calc(var(--lyrics-edge-gap) - var(--compact-content-gap));
    height: calc(100% - var(--lyrics-edge-gap) + var(--compact-content-gap));
  }
  :root.web-portrait #rp-player#rp-player .rp-lyrics-column { width: 100%; flex: 0 0 100%; }
  :root.web-portrait #rp-player#rp-player .rp-lyric-line { font-size: 21px; }
  :root.web-portrait #rp-player#rp-player #rp-lyrics-note { font-size: 18px; }
  :root.web-portrait #rp-player#rp-player.rp-view-vu #rp-meters { position: relative; inset: auto; grid-row: 2; grid-column: 1 / -1; width: 100%; height: 100%; min-height: 0; gap: 8px; }
  :root.web-portrait #rp-player#rp-player.rp-view-vu #rp-meter-note { position: absolute; left: 0; right: 0; top: auto; bottom: 12px; width: 100%; height: 14px; line-height: 14px; font-size: 9px; }
  :root.web-portrait #rp-player#rp-player.rp-dimmed .rp-info { opacity: .6; }
}
@media (prefers-reduced-motion: reduce) { #rp-player#rp-player * { transition: none !important; } }

#rp-player .rp-controls button, #rp-player #rp-footer button { border-radius: 7px; }

/* Small, independent build label below the player messages on every view. */
#build-footer { position: fixed; z-index: 200001; left: 0; right: 0; bottom: var(--safe-bottom); height: var(--build-footer-height); padding: 0 6px; box-sizing: border-box; color: #9aa88a; font-family: Arial, sans-serif; font-size: 7.92px; font-weight: normal; letter-spacing: 1.2px; text-transform: uppercase; line-height: var(--build-footer-height); text-align: center; white-space: nowrap; pointer-events: none; }

/* Messages occupy a permanent footer outside the song and lyrics layout. */
#web-feedback { position: fixed; z-index: 100001; left: 16px; right: 320px; bottom: calc(8px + var(--build-footer-height)); height: 22px; display: grid; pointer-events: none; color: #becaa3; }
#web-feedback > div { grid-area: 1 / 1; position: static; inset: auto; transform: none; display: block; width: 100%; height: 100%; margin: 0; text-align: left; font-size: 12px; line-height: 22px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#web-feedback #rp-lyrics-note, #web-feedback #rp-meter-note { display: none; }
#web-feedback[data-player-view="2"] #rp-lyrics-note, #web-feedback[data-player-view="3"] #rp-meter-note { display: block; }
#web-feedback #rp-status:not(:empty) ~ div { visibility: hidden; }
#web-feedback[data-player-view="2"]:has(#rp-lyrics-note:not(:empty)) #web-dev-feedback,
#web-feedback[data-player-view="3"]:has(#rp-meter-note:not(:empty)) #web-dev-feedback { visibility: hidden; }
#rp-player #rp-lyrics.rp-lyrics-alternate #rp-lyrics-text { top: 0; height: 100%; }
#rp-player #rp-lyrics.rp-lyrics-alternate #rp-lyrics-sync { top: 5px; }
:root.web-portrait #rp-player #rp-lyrics-translation-label { left: 0; right: auto; width: max-content; max-width: calc(50% - 14px); top: -26px; height: 22px; line-height: 22px; font-size: 11px; text-align: left; }
@media (min-width: 0px)  {
:root.web-portrait #rp-player#rp-player #rp-quality { display: none; }
  :root.web-portrait #web-feedback { left: 16px; right: 16px; bottom: calc(var(--app-bottom-gap) + var(--build-footer-height)); height: var(--message-height); }
  :root.web-portrait #web-feedback > div { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 10px; line-height: 11px; white-space: normal; overflow-wrap: anywhere; }
  :root.web-portrait #web-feedback[data-player-view="2"] #rp-lyrics-note, :root.web-portrait #web-feedback[data-player-view="3"] #rp-meter-note { display: -webkit-box; }
}

/* One combined stereo spectrum; canvas resolution follows the available width. */
#rp-player .rp-spectrum { width: 100%; min-width: 0; overflow: hidden; }
#rp-player .rp-spectrum .rp-led-panels, #rp-player .rp-spectrum .rp-led-panel { min-width: 0; width: 100%; }
@media (min-width: 0px)  {
:root.web-portrait #rp-player .rp-led-heading { top: 14px; left: 30px; right: 12px; font-size: 11px; letter-spacing: 1px; }
  :root.web-portrait #rp-player .rp-led-db { left: 8px; top: 38px; font-size: 9px; }
  :root.web-portrait #rp-player .rp-led-matrix { left: 30px; top: 56px; width: calc(100% - 40px); height: calc(100% - 98px); }
  :root.web-portrait #rp-player .rp-led-scale { left: 2px; width: 23px; top: 56px; bottom: 42px; font-size: 9px; }
  :root.web-portrait #rp-player .rp-led-labels { left: 30px; right: 10px; bottom: 22px; font-size: clamp(5px, 1.7vw, 7px); }
  :root.web-portrait #rp-player .rp-led-hz { right: 10px; bottom: 6px; font-size: 9px; }
}

/* Edge-to-edge spectrum over the player's own background. */
#rp-player .rp-spectrum .rp-led-panel { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
#rp-player .rp-spectrum .rp-led-db, #rp-player .rp-spectrum .rp-led-scale { display: none; }
#rp-player .rp-spectrum .rp-led-heading { left: 0; right: 0; }
#rp-player .rp-spectrum .rp-led-matrix { left: 0; width: 100%; }
#rp-player .rp-spectrum .rp-led-labels { left: 0; right: 0; }
#rp-player .rp-spectrum .rp-led-hz { right: 0; }

/* Native vertical scrolling keeps every lyric reachable by touch. */
#rp-player #rp-lyrics-text[data-scrollable] { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
#rp-player #rp-lyrics-text[data-scrollable] .rp-lyrics-columns { display: block; height: auto; min-height: 100%; }
#rp-player #rp-lyrics-text[data-scrollable] .rp-lyrics-column { width: 100%; max-width: 800px; margin: 0 auto; transform: none; }
#rp-player #rp-lyrics-text[data-scrollable] .rp-lyric-line { overflow-wrap: anywhere; white-space: pre-wrap; }
#rp-player #rp-lyrics-text.rp-lyrics-empty { display: grid; place-items: center; color: #becaa3; font-size: 20px; }
#rp-player #rp-lyrics-text.rp-lyrics-empty[aria-busy="true"] { font-size: 16px; }
#rp-player #rp-lyrics-pages { display: none; }
/* Landscape reads full pages, top-to-bottom in each of at most two columns. */
#rp-player #rp-lyrics-text[data-paged="true"] { overflow: hidden; touch-action: none; }
#rp-player #rp-lyrics-text[data-paged="true"] .rp-lyrics-columns { display: flex; height: 100%; min-height: 0; gap: 40px; }
#rp-player #rp-lyrics-text[data-paged="true"] .rp-lyrics-column { flex: 0 0 auto; width: min(800px, 100%); max-width: none; margin: 0; transform: none; }
#rp-player #rp-lyrics-text[data-paged="true"][data-columns="2"] .rp-lyrics-column { width: calc((100% - 40px) / 2); }
#rp-player #rp-lyrics-text[data-paged="true"] .rp-lyric-line { white-space: pre; }
#rp-player #rp-lyrics-text[data-paged="true"] ~ #rp-lyrics-pages { display: flex; }
#rp-player #rp-lyrics-pages:empty { display: none; }
#rp-player button.rp-page-dot { min-width: 8px; min-height: 8px; padding: 0; cursor: pointer; position: relative; }
#rp-player button.rp-page-dot::before { content: ''; position: absolute; inset: -6px; }
#rp-player button.rp-page-dot:focus-visible { outline: 2px solid #f4f5ec; outline-offset: 5px; }
#rp-player.rp-dimmed #rp-lyrics-pages { visibility: hidden; }
#rp-player.rp-dimmed #rp-lyrics-languages { visibility: hidden; }
.rp-view-menu { position: fixed; z-index: 100004; display: flex; flex-direction: column; gap: 4px; box-sizing: border-box; padding: 6px; border: 1px solid #647146; border-radius: 7px; background: #202716; box-shadow: 0 6px 20px #0008; font-size: calc(14px * var(--lyrics-menu-scale, 1)); }
.rp-view-menu button { display: block; width: 100%; min-height: calc(36px * var(--lyrics-menu-scale, 1)); padding: 6px 12px; border: 0; border-radius: 5px; background: transparent; color: #bacb93; font: inherit; text-align: left; cursor: pointer; }
.rp-view-menu button[aria-pressed="true"] { color: #f4f5ec; background: #394320; }
.rp-view-menu button:focus-visible { outline: 2px solid #a4af8c; outline-offset: -2px; }
#rp-lyrics-ai:disabled { opacity: .35; cursor: not-allowed; }
.rp-security-dialog { max-width:340px; padding:20px; border:1px solid #647146; border-radius:12px; background:#252d19; color:#d9e4bf; font:16px/1.5 Arial,sans-serif; }
.rp-security-dialog::backdrop { background:#0009; }
.rp-security-dialog button { padding:10px 18px; border:1px solid #647146; border-radius:8px; background:#354126; color:#eff3e5; }
.rp-lyrics-scroll { position: absolute; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 18px; height: 18px; color: #bacb93; opacity: .8; pointer-events: none; }
#rp-lyrics-scroll-up { bottom: calc(100% + (var(--lyrics-indicator-gap, 30px) - 18px) / 2 - 3px); }
#rp-lyrics-scroll-down { top: calc(100% + (var(--lyrics-indicator-gap, 30px) - 18px) / 2 - 3px); }
.rp-lyrics-scroll svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp-dimmed .rp-lyrics-scroll { visibility: hidden; }
#orientation-notice { position: fixed; z-index: 200000; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; box-sizing: border-box; text-align: center; background: #191e0df5; color: #d7e1c1; }
#orientation-notice svg { width: 84px; height: 84px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#orientation-notice p { margin: 0; font-size: 22px; }

/* Keep the upcoming song together and spread Home controls over its free height. */
@media (min-width: 0px)  {
:root.web-landscape #rp-player:not(.rp-view-compact):not(.rp-dimmed) #rp-next-label { top: 508.6px; }
  :root.web-landscape #rp-player:not(.rp-view-compact):not(.rp-dimmed) #rp-next { top: 523.6px; }
  :root.web-landscape #rp-player.rp-view-compact #rp-next-label { top: 604.6px; }
}
@media (min-width: 0px)  {
:root.web-portrait #rp-player#rp-player:not(.rp-view-compact) .rp-info { justify-content: flex-start; padding-top: clamp(6px, 1.5dvh, 14px); box-sizing: border-box; }
  :root.web-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-progress { margin-top: clamp(8px, 1.6dvh, 16px); }
  :root.web-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-next-label { margin-top: auto; }
  :root.web-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-next { margin-top: -4px; }
}

#welcome .welcome-about { max-width: 540px; font-size: clamp(15px, 4vw, 18px); }
#welcome .welcome-official { margin: 6px 0; max-width: 540px; font-size: 14px; }
#welcome a { color: #d7e1c1; text-decoration: none; }
#welcome a:hover { color: #fff; }
#start:disabled { opacity: .6; cursor: wait; }

/* A fixed four-line heading anchors the album, timeline and transport. */
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player .rp-song-heading {
  --artist-font: 24px; --title-font: 30px; --song-scale: 1; --heading-gap: 2px;
  position: absolute; left: 0; right: 0; top: 12px;
  height: calc(var(--artist-font) * 2.3 + var(--title-font) * 2.3 + var(--heading-gap));
  display: flex; flex-direction: column; gap: var(--heading-gap); overflow: hidden;
}
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player.rp-view-compact .rp-song-heading { --artist-font: 20px; --title-font: 24px; top: -12px; }
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player .rp-song-heading #rp-artist,
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player .rp-song-heading #rp-title {
  position: static; inset: auto; width: 100%; min-width: 0; flex-shrink: 0;
  margin: 0; padding: 0; max-height: none; line-height: 1.15; white-space: normal;
  overflow: visible; overflow-wrap: anywhere; text-overflow: clip; -webkit-line-clamp: unset;
}
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player .rp-song-heading #rp-artist { display: block; height: auto; font-size: calc(var(--artist-font) * var(--song-scale)) !important; }
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player .rp-song-heading #rp-title { display: flex; align-items: center; height: calc(var(--title-font) * 2.3); font-size: calc(var(--title-font) * var(--song-scale)) !important; }
:root:is(.web-portrait, .web-landscape) #rp-player .rp-song-heading span { display: block; width: 100%; flex: 0 0 auto; }
/* Match the phone's label clearance and contiguous artist/song rows. */
:root.web-landscape #rp-player#rp-player .rp-song-heading {
  top: 0; height: 139px; padding-top: 24px; --artist-font: 27px; --heading-gap: 0px; --share-top: 12px;
}
:root.web-landscape #rp-player#rp-player.rp-view-compact .rp-song-heading {
  top: -26px; height: 111px; padding-top: 18px; --artist-font: 21px; --share-top: 14px;
}
:root.web-landscape #rp-player#rp-player:not(.rp-view-compact) #rp-progress { top: 209px; }
:root.web-landscape #rp-player#rp-player:not(.rp-view-compact) .rp-times { top: 222.333px; }
/* The visible header ends at 227px and the footer starts at 655.6px.
   Match both gaps while retaining the lyrics block's 624px lower edge. */
:root.web-landscape #rp-player#rp-player.rp-view-lyrics #rp-lyrics { top: 258.6px; height: 365.4px; --lyrics-indicator-gap: 31.6px; }
:root.web-landscape #rp-player#rp-player.rp-view-lyrics #rp-lyrics-text { height: 100%; }
#rp-meters { cursor: pointer; touch-action: manipulation; }
#rp-meters:focus-visible { outline: 2px solid #d7e1c1; outline-offset: 2px; }
@media (min-width: 0px)  {
:root.web-portrait #rp-player#rp-player .rp-song-heading { --artist-font: clamp(17px, 3dvh, 25px); --title-font: clamp(19px, 3.3dvh, 28px); position: relative; inset: auto; order: 0; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-song-heading { --artist-font: clamp(13px, 2.4dvh, 20px); --title-font: clamp(15px, 2.7dvh, 23px); top: auto; }
  :root.web-portrait #rp-player#rp-player.rp-view-compact #rp-scene { grid-template-rows: auto minmax(0, 1fr); row-gap: var(--compact-content-gap); }
  :root.web-portrait #rp-player#rp-player.rp-view-compact .rp-info { height: auto; }
  :root.web-portrait #rp-player#rp-player.rp-vu-style-original #rp-meters { flex-direction: column; align-items: center; justify-content: center; }
  :root.web-portrait #rp-player#rp-player.rp-vu-style-original .rp-vu-instrument { width: 100%; height: calc(50% - 4px); flex: none; min-height: 0; }
}

/* The landscape scene, including its footer, scales as one unit on desktop and landscape tablets. */
:root.web-landscape #rp-player .rp-brand { display: none; }
:root.web-landscape #web-toolbar { position: absolute; left: 174px; top: 655.6px; width: 216px; height: 34.4px; padding: 0; gap: 8px; }
:root.web-landscape #web-toolbar [data-view] { flex: 1; width: 0; min-height: 34.4px; height: 34.4px; padding: 0; font-size: 14px; }
:root.web-landscape #rp-player#rp-player #rp-exit, :root.web-landscape #rp-player#rp-player #rp-station-picker { display: flex; top: 655.6px; width: 54px; height: 34.4px; border-radius: 7px; }
:root.web-landscape #rp-player#rp-player #rp-exit { left: 40px; }
:root.web-landscape #rp-player#rp-player #rp-station-picker { left: 104px; }
:root.web-landscape #rp-player#rp-player .rp-controls { left: -96px; top: 493.6px; width: 276px; gap: 8px; justify-content: space-between; }
:root.web-landscape #rp-player#rp-player .rp-controls button { flex: 1 1 0; width: 0; margin: 0; }
:root.web-landscape #rp-player#rp-player.rp-view-compact .rp-controls { left: 136px; top: 601.6px; }
:root.web-landscape #rp-player#rp-player #rp-next-label { left: 204px; top: 493.6px; width: 320px; right: auto; }
:root.web-landscape #rp-player#rp-player #rp-next { left: 204px; top: 511.6px; width: 320px; right: auto; }
:root.web-landscape #rp-player#rp-player.rp-view-compact #rp-next-label { left: 436px; top: 601.6px; }
:root.web-landscape #rp-player#rp-player.rp-view-compact #rp-next { left: 436px; top: 619.6px; }
:root.web-landscape #rp-player#rp-player #rp-quality { right: -56px; width: 180px; }
:root.web-landscape #rp-player#rp-player.rp-view-compact #rp-quality { right: 0; }
:root.web-landscape #rp-player#rp-player.rp-view-compact #rp-station { left: 0; top: 0; width: 320px; }
:root.web-landscape #rp-player#rp-player.rp-view-vu #rp-meters { left: 40px; width: 1200px; }
:root.web-landscape #web-options { top: max(4px, env(safe-area-inset-top)); bottom: auto; right: 8px; }
:root.web-landscape #web-options button { min-height: 24px; padding: 2px 8px; font-size: 11px; }
/* Fullscreen stays at the viewport edge but matches Share's displayed scale. */
:root.web-landscape #web-fullscreen { transform: scale(calc(var(--landscape-scale, 1) * .6)); transform-origin: top right; }
:root.web-landscape #rp-player:not(.rp-view-compact) .rp-clock { top: 34px; }
:root.web-landscape #rp-player.rp-view-lyrics .rp-clock { top: 0; height: 14px; line-height: 14px; font-size: 12px; }
:root.web-landscape #web-page-prev, :root.web-landscape #web-page-next { display: none; }
:root.web-landscape #web-feedback { left: calc(var(--landscape-left, 0px) + 40px * var(--landscape-scale, 1)); right: 16px; bottom: calc(max(4px, env(safe-area-inset-bottom)) + var(--build-footer-height)); font-size: 12px; transform: translateY(.25em); }
:root.web-portrait #rp-player#rp-player.rp-view-compact .rp-art { width: min(100%, 190px); }
:root.web-portrait #rp-player#rp-player .rp-song-heading #rp-title { display: flex; align-items: center; height: calc(var(--title-font) * 2.3); max-height: none; font-size: calc(var(--title-font) * var(--song-scale)) !important; white-space: normal; }
:root.web-portrait #rp-player .rp-spectrum .rp-led-matrix { left: 0; width: 100%; }
:root.web-portrait #rp-player .rp-spectrum .rp-led-labels, :root.web-portrait #rp-player .rp-spectrum .rp-led-heading { left: 0; right: 0; }
:root.web-portrait #rp-player .rp-spectrum .rp-led-hz { right: 0; }
:root.web-landscape #rp-player#rp-player.rp-view-compact #rp-station { left: -224px; top: 210px; width: 200px; height: 18px; line-height: 18px; font-size: 11px; }

/* Freeze the phone's 390x844 metrics before scaling, even in short outer windows.
   Viewport units and height breakpoints must not change the canonical contents. */
:root.web-scaled-portrait { --home-cover-height: 50%; }
:root.web-scaled-portrait #rp-player#rp-player #rp-scene { gap: 10px; }
:root.web-scaled-portrait #rp-player#rp-player .rp-info { gap: 5.9px; }
:root.web-scaled-portrait #rp-player#rp-player #rp-artist { font-size: 27px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-scene { row-gap: var(--compact-content-gap); }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact .rp-info { gap: 2px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-artist { font-size: 20px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-title { display: flex; height: auto; white-space: normal; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact .rp-album-line,
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-album { height: 17px; line-height: 17px; font-size: 11px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-progress { height: 6px; margin-top: 3px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact .rp-times,
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact .rp-times span { height: 18px; line-height: 18px; font-size: 12px; }
:root.web-scaled-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-next-label,
:root.web-scaled-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-next { display: block; }
:root.web-scaled-portrait #rp-player#rp-player .rp-song-heading { --artist-font: 25px; --title-font: 27.85px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact .rp-song-heading { --artist-font: 20px; --title-font: 22.8px; }
:root.web-scaled-portrait #rp-player .rp-led-labels { font-size: 6.63px; }
:root.web-scaled-portrait #rp-player#rp-player:not(.rp-view-compact) .rp-info { padding-top: 12.66px; }
:root.web-scaled-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-progress { margin-top: 13.5px; }
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-next-label,
:root.web-scaled-portrait #rp-player#rp-player.rp-view-compact #rp-next { display: none; }

/* The compact phone header shares its top edge with the cover. Keep the album,
   timeline and view navigation anchored in their existing flex slots. */
:root.web-portrait #rp-player#rp-player.rp-view-compact .rp-song-heading {
  --heading-gap: 0px;
  padding-top: 18px;
  box-sizing: border-box;
}
:root.web-portrait #rp-player#rp-player.rp-view-compact #rp-eyebrow {
  display: block;
  position: absolute;
  inset: auto;
  left: 0;
  top: 2px;
  width: 100%;
  height: 12px;
  line-height: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
}
:root.web-portrait #rp-player#rp-player.rp-view-compact #rp-album-label {
  display: block;
  position: relative;
  inset: auto;
  top: -14px;
  order: 1;
  height: 0;
  line-height: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-bottom: -2px;
}

/* Portrait Home uses the same metadata order as the compact views. The cover
   stays above the details; the labels are fitted into the existing heading slot. */
:root.web-portrait #rp-player#rp-player:not(.rp-view-compact) .rp-info {
  --home-info-gap: clamp(3px, .7dvh, 7px);
}
:root.web-portrait #rp-player#rp-player:not(.rp-view-compact) .rp-song-heading {
  --heading-gap: 0px;
  padding-top: 18px;
  box-sizing: border-box;
}
:root.web-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-eyebrow {
  display: block;
  position: absolute;
  inset: auto;
  top: 12.66px;
  left: 0;
  width: 100%;
  height: 12px;
  line-height: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
}
:root.web-portrait #rp-player#rp-player:not(.rp-view-compact) #rp-album-label {
  display: block;
  position: relative;
  inset: auto;
  top: -14px;
  order: 1;
  height: 0;
  line-height: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  /* Exactly cancel the extra flex gap: the album title does not move. */
  margin-bottom: calc(-1 * var(--home-info-gap));
}
:root.web-scaled-portrait #rp-player#rp-player:not(.rp-view-compact) .rp-info {
  --home-info-gap: 5.9px;
}

/* Reserve Share's column; compact views lower its button by one third of its height. */
:root:is(.web-portrait, .web-landscape) #rp-player#rp-player .rp-song-heading:has(#share-song:not([hidden])) {
  box-sizing: border-box;
  padding-right: 56px;
}
:root.web-portrait .rp-song-heading { --share-top: 18px; }


/* TV amplifier dial in the canonical landscape quality slot. */
#rp-volume { display:none; }
:root.web-landscape #rp-player#rp-player #rp-quality { display:none; }
:root.web-landscape #rp-player#rp-player #rp-volume {
  --volume-top:493.6px; --volume-right:-56px;
  display:block; position:absolute; top:calc(var(--volume-top) - 32.208px); right:calc(var(--volume-right) + 44.64px);
  width:90.72px; height:93.24px; padding:0; border:0; background:transparent; color:#bacb93;
  cursor:ns-resize; outline:none; touch-action:pan-y;
}
:root.web-landscape #rp-player#rp-player.rp-view-compact #rp-volume { --volume-top:601.6px; --volume-right:0px; }
#rp-volume .rp-volume-face, #rp-volume svg { display:block; width:100%; height:100%; overflow:visible; }
#rp-volume .rp-volume-rotor { transform-origin:80px 77px; filter:drop-shadow(0 0 1.3px currentColor); }
#rp-volume .rp-volume-digits { fill:#b8d783; opacity:.9; filter:drop-shadow(0 0 .45px #a9cf82); }
#rp-volume .rp-volume-quality { position:absolute; top:0; left:50%; width:150px; margin-left:-75px; color:#bacb93; text-align:center; font:9px/14px Arial,sans-serif; letter-spacing:1.5px; text-transform:uppercase; }
#rp-volume .rp-volume-quality:empty { display:none; }
#rp-volume:hover .rp-volume-ring, #rp-volume:focus-visible .rp-volume-ring { stroke:#cdddab; stroke-width:2.5px; }
:root.web-landscape #rp-player.rp-dimmed #rp-volume { opacity:.45; }
