:root {
  --bg: #f6f1e8;
  --bg-elev: #fffdf8;
  --bg-soft: #efe7d8;
  --text: #1c150c;
  --muted: #6a5c48;
  --line: #e2d6c2;
  --accent: #8a5a12;
  --accent-strong: #6e450b;
  --gold: #c4922a;
  --lyrics-dot: #1d4ed8;
  --danger: #8a2f1a;
  --shadow: 0 8px 28px rgba(60, 40, 10, .08);
  --radius: 14px;
  --topbar: 64px;
  --font: "Outfit", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12100c;
  --bg-elev: #1c1913;
  --bg-soft: #262119;
  --text: #f3ead9;
  --muted: #b3a48c;
  --line: #3a3328;
  --accent: #e8b84a;
  --accent-strong: #f0c96a;
  --gold: #e8b84a;
  --lyrics-dot: #60a5fa;
  --danger: #e08a72;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gold); }
button, input { font: inherit; color: inherit; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--accent);
  color: #1c150c; padding: .5rem .8rem; border-radius: 8px; z-index: 20;
}
.skip-link:focus { top: .6rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex; align-items: center; gap: .55rem;
  color: var(--text); text-decoration: none; font-weight: 700;
  letter-spacing: -.03em; font-size: 1.25rem;
}
.logo-mark { color: var(--gold); display: flex; }
.logo { flex: 0 0 auto; }
.search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 640px;
  width: auto;
  margin-inline: auto;
}
.search {
  display: flex; align-items: stretch;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.search-history {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + .4rem);
  z-index: 20;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: .3rem;
  max-height: min(20rem, calc(100vh - var(--topbar) - .8rem));
  overflow: auto;
}
.search-history[hidden] { display: none; }
.search-history-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 28px;
  align-items: center;
  gap: .35rem;
  padding: .4rem .45rem .4rem .6rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: .92rem;
}
.search-history-item:hover,
.search-history-item.is-active { background: var(--bg-soft); }
.search-history-clock {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.search-history-term {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-history-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
}
.search-history-remove:hover,
.search-history-remove:focus-visible {
  color: var(--text);
  background: var(--bg);
  outline: none;
}
.search-history-clear {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: .82rem;
  font-weight: 600;
  padding: .4rem .65rem .3rem;
  text-align: right;
  cursor: pointer;
}
.search-history-clear:hover { color: var(--gold); }
.theme-toggle { flex: 0 0 auto; }
.search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  padding: .55rem 1rem .55rem 1.1rem;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search-btn, .theme-toggle {
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  width: 44px; height: 40px;
}
.search-btn { border-left: 1px solid var(--line); }
.search-btn:hover, .theme-toggle:hover { color: var(--text); background: var(--bg-soft); }
.theme-toggle { border: 1px solid var(--line); border-radius: 999px; width: 42px; height: 42px; background: var(--bg-elev); }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark, :root:not([data-theme]) .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light, :root:not([data-theme]) .theme-icon-light { display: inline-flex; }
[data-theme="dark"] .theme-icon-dark { display: inline-flex; }

/* Home */
.home { max-width: 2800px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.watch { max-width: 1400px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.home-intro h1 {
  font-size: clamp(1.5rem, 2.4vw, 2.05rem);
  letter-spacing: -.03em; margin: 0 0 .4rem; font-weight: 700;
}
.home-intro { margin: 0 0 1.2rem; }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }
.count { margin: .35rem 0 0; color: var(--muted); font-size: .92rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(240px, calc((100% - 3 * var(--gx, 1rem)) / 4)), 1fr));
  gap: 1.15rem 1rem;
}
.card {
  color: inherit; text-decoration: none;
  display: flex; flex-direction: column; gap: .55rem;
  border-radius: 12px;
}
.card:hover .thumb img { transform: scale(1.03); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.thumb {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.duration {
  position: absolute; right: .4rem; bottom: .4rem;
  background: rgba(0,0,0,.82); color: #fff;
  font-size: .72rem; font-weight: 600;
  padding: .12rem .35rem; border-radius: 4px;
}
.badge {
  position: absolute; left: .4rem; top: .4rem;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  color: var(--accent-strong);
  font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15rem .4rem; border-radius: 999px;
  border: 1px solid var(--line);
}
.card-title {
  margin: 0; font-size: 1rem; font-weight: 600;
  letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin: 0; color: var(--muted); font-size: .86rem; }
/* Home grid: text scales with card width (baseline = ~332px card at the old 1400px layout). */
.grid { --gx: clamp(1rem, 1.1vw, 2rem); gap: clamp(1.15rem, 1.25vw, 2.3rem) var(--gx); }
.grid .card { container-type: inline-size; gap: clamp(.55rem, 2.2cqi, 1.1rem); }
.grid .card-title { font-size: clamp(1rem, 4.8cqi, 2rem); }
.grid .card-meta { font-size: clamp(.86rem, 4.15cqi, 1.72rem);  margin-top: calc(.1em - clamp(.55rem, 2.2cqi, 1.1rem)); line-height: 1.35; }
.grid .duration { font-size: clamp(.72rem, 3.5cqi, 1.44rem); }
.grid .badge { font-size: clamp(.68rem, 3.3cqi, 1.36rem); }
.home-intro h1 { font-size: clamp(1.5rem, 2.4vw, 4.1rem); }
.home .lede { font-size: clamp(1rem, 1.1vw, 1.9rem); }
.home-intro { margin-bottom: clamp(1.2rem, 1.2vw, 2.2rem); }
.empty { padding: 3rem 0; color: var(--muted); text-align: center; }

/* Watch layout */
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "player lyrics"
    "meta   lyrics"
    "upnext lyrics";
  gap: 1rem 1.2rem;
  align-items: start;
}
/* Desktop watch: equal, tighter side margins (aligned with the top bar),
   video at 95% of its previous width, and all recovered space given to lyrics.
   Font size on .lyrics-scroll is unchanged. Phones and small tablets (max-width: 1023px) are untouched. */
@media (min-width: 1024px) {
  .watch {
    max-width: none;
    width: 100%;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  /* Previous video width was (layout - 340px - 1.2rem gap), with 1.2rem page padding
     and a 1400px cap. Keep that historical size, then take 95% of it. */
  .watch-layout {
    grid-template-columns: minmax(0, calc(0.95 * (100% - 340px - 1.4rem))) minmax(0, 1fr);
  }
}
@media (min-width: 1400px) {
  /* Historical video width capped at 1400px - 2.4rem padding - 1.2rem gap - 340px. */
  .watch-layout {
    grid-template-columns: calc(0.95 * (1400px - 3.6rem - 340px)) minmax(0, 1fr);
  }
}
@media (min-width: 1024px) {
  .watch-layout.has-video-size {
    /* Video column is the chosen share of the layout (minus the column gap).
       Lyrics never shrink below 8rem, so 95% stays readable. */
    grid-template-columns: minmax(0, calc(var(--video-frac, .6) * (100% - 1.2rem))) minmax(8rem, 1fr);
  }
  .watch-layout.is-resizing,
  .watch-layout.is-measuring { /* columns and typography are interpolated in JS */ }
}
.size-control {
  float: right; display: flex; align-items: center; gap: .6rem;
  margin: .3rem 0 .4rem 1rem; font-size: .8rem; font-weight: 600; color: var(--muted);
}
/* Three-stop video size slider (desktop and large tablets only). */
.size-slider { position: relative; width: 152px; display: flex; align-items: center; }
.size-control input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0;
  background: transparent; cursor: pointer;
}
.size-control input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: transparent; }
.size-slider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; transform: translateY(-50%);
  background: radial-gradient(circle, var(--muted) 1.8px, transparent 2.3px) 0 center / 4px 4px no-repeat,
              radial-gradient(circle, var(--muted) 1.8px, transparent 2.3px) 50% center / 4px 4px no-repeat,
              radial-gradient(circle, var(--muted) 1.8px, transparent 2.3px) 100% center / 4px 4px no-repeat,
              linear-gradient(var(--line), var(--line)) center / 100% 4px no-repeat;
  border-radius: 999px; padding: 0 6px; background-origin: content-box; background-clip: content-box;
  pointer-events: none; z-index: 1;
}
.size-control input[type="range"] { position: relative; z-index: 2; }
.size-control input[type="range"]::-moz-range-track { height: 4px; background: transparent; }
.size-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .15s ease;
}
.size-control input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.size-control input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
@media (max-width: 1023px) {
  .size-control > label:not(.autoplay-switch),
  .size-control .size-slider { display: none; }
}
.player-wrap { grid-area: player; }
.song-meta {
  grid-area: meta;
  padding-inline: clamp(0.35rem, 3.2vw, 2.75rem);
}
.up-next { grid-area: upnext; }
.player {
  position: relative; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Mini player: the existing .player (and its iframe) is restyled to
   position:fixed. .player-wrap keeps the original height so the page
   does not jump, and the iframe node is never recreated. */
.player.is-mini {
  position: fixed;
  z-index: 40;
  top: var(--mini-player-top, calc(var(--topbar-offset, var(--topbar)) + 0.5rem));
  right: var(--mini-player-right, 0.5rem);
  width: var(--mini-player-width, clamp(216px, 30vw, 384px));
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
@media (min-width: 600px) and (max-width: 1023px) {
  .player.is-mini {
    width: var(--mini-player-width, min(60vw, calc(100vw - 16px)));
  }
}
@media (min-width: 1024px) {
  .player.is-mini {
    width: var(--mini-player-width, 20vw);
  }
}
.mini-player-close {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 14, 10, 0.8);
  color: #fff;
  cursor: pointer;
  place-items: center;
  line-height: 0;
}
.player.is-mini .mini-player-close { display: grid; }

.mini-gesture-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.player.is-mini .mini-gesture-overlay { display: block; }

.mini-scrub {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  pointer-events: none;
}
.mini-scrub-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
  transition:
    height 200ms cubic-bezier(0.34, 1.45, 0.64, 1),
    background 200ms ease,
    box-shadow 200ms ease;
}
.mini-scrub-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.78);
}
.mini-gesture-overlay.is-seeking .mini-scrub-track {
  height: 11px;
  background: rgba(20, 16, 12, 0.4);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 4px 16px rgba(0, 0, 0, 0.28);
}
.mini-gesture-overlay.is-seeking .mini-scrub-fill {
  background: rgba(255, 255, 255, 0.92);
}
.mini-scrub-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  margin-bottom: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 200ms cubic-bezier(0.34, 1.45, 0.64, 1),
    transform 200ms cubic-bezier(0.34, 1.45, 0.64, 1);
  font-family: var(--font);
}
.mini-gesture-overlay.is-seeking .mini-scrub-times {
  opacity: 1;
  transform: translateY(0);
}
.mini-scrub-pill {
  background: rgba(16, 14, 10, 0.72);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: .12rem .42rem;
  border-radius: 999px;
  letter-spacing: .01em;
  line-height: 1.3;
}
.mini-scrub-delta {
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  letter-spacing: .01em;
  min-width: 0;
}
.mini-scrub-delta[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .mini-scrub-track,
  .mini-scrub-times {
    transition-duration: 0.01ms;
  }
}

.mini-player-close:hover,
.mini-player-close:focus-visible {
  background: rgba(16, 14, 10, 0.95);
  outline: 2px solid #fff;
  outline-offset: 1px;
}


.card-title.has-lyrics,
.watch-title.has-lyrics {
  display: flex;
  align-items: flex-start;
  gap: .4em;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.card-title.has-lyrics .title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}
.watch-title {
  margin: 0 0 .25rem;
  font-size: round(nearest, calc(clamp(1.25rem, 2vw, 1.7rem) - 4px), 1px);
  line-height: round(nearest, calc(1.25em), 1px);
  letter-spacing: -.03em;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  overflow: visible;
  -webkit-line-clamp: unset;
  text-overflow: clip;
}
.watch-title.has-lyrics .title-text {
  min-width: 0;
  flex: 1;
  white-space: normal;
  overflow: visible;
  text-align: left;
  -webkit-line-clamp: unset;
  text-overflow: clip;
}
.lyrics-dot {
  flex: none;
  width: .42em;
  height: .42em;
  margin-top: calc((1.25em - .42em) / 2);
  border-radius: 50%;
  background: var(--lyrics-dot);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--lyrics-dot) 35%, transparent);
}
.song-meta .byline { margin: 0 0 .7rem; color: var(--muted); }
.song-meta .note { margin: .4rem 0 0; color: var(--muted); max-width: 70ch; }

.song-story {
  margin: 1.15rem auto 0;
  max-width: 70ch;
  font-family: var(--serif);
  font-size: round(nearest, calc(1.08rem + 2pt), 1px);
  line-height: round(nearest, calc(1em * var(--story-lh, 1.7)), 1px);
  color: var(--text);
}
.song-story .story-headline {
  font-family: var(--serif);
  font-size: calc(1.32rem + 2pt);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 .7rem;
  color: var(--text);
}
.song-story p { margin: 0 0 round(nearest, 0.9rem, 1px); }
.song-story .story-intro { color: var(--text); }
.song-story .story-conclusion { margin-bottom: 0; }
.song-story .story-subhead,
.song-story .story-sources h3 {
  font-family: var(--serif);
  font-size: calc(1.12rem + 2pt);
  font-weight: 600;
  line-height: 1.35;
  margin: 1.15rem 0 .4rem;
  color: var(--text);
}
.song-story .story-sources {
  margin-top: 1.15rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  font-size: .95rem;
  color: var(--muted);
}
.song-story .story-sources h3 { margin-top: 0; }
.song-story .story-sources ul {
  margin: 0;
  padding: 0 0 0 1.15rem;
}
.song-story .story-sources li { margin: .2rem 0; }
.song-story.is-collapsed .story-rest { display: none; }
.song-story.is-collapsed .story-preview {
  max-height: var(--preview-h, 12rem);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.story-toggle {
  display: inline-block;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin: .15rem 0 0;
  letter-spacing: .01em;
}
.story-toggle:hover { color: var(--gold); }
.song-story.is-collapsed .story-toggle-less { display: none; }
.song-story:not(.is-collapsed) .story-toggle-more { display: none; }
@media (max-width: 420px) {
  .song-story { font-size: round(nearest, calc(1.04rem + 2pt), 1px); }
  .song-story .story-headline { font-size: round(nearest, calc(1.2rem + 2pt), 1px); }
}

.meta-row { display: flex; flex-wrap: wrap; gap: .45rem .8rem; font-size: .9rem; color: var(--muted); }

.lyrics-panel, .up-next-list {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.side-col {
  grid-area: lyrics;
  position: static;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.side-col > .lyrics-panel:not(.alt-versions) {
  position: static;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.side-col .lyrics-scroll {
  flex: 1 1 auto;
  min-height: 0;
}
.side-col > .alt-versions {
  flex: 0 0 auto;
  overflow: visible;
  min-height: auto;
  position: static;
}
.lyrics-panel {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel-head {
  padding: .425rem 1.1rem .35rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
}
.panel-head h2 { margin: 0; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.alt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  padding: .85rem 1.1rem 1.15rem;
}
.alt-item {
  color: inherit; text-decoration: none;
  min-width: 0;
  display: flex; flex-direction: column; gap: .35rem;
}
.alt-item .thumb { border-radius: 8px; box-shadow: none; }
.alt-item .card-title { font-size: .88rem; }
.alt-item .card-meta { font-size: .78rem; }
.alt-versions.is-collapsed .alt-item:nth-child(n + 3) { display: none; }
.alt-more {
  border: 0; background: transparent;
  color: var(--accent-strong);
  font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; padding: 0;
  letter-spacing: .02em;
}
.alt-more:hover { color: var(--gold); }

.lyrics-scroll {
  overflow: auto;
  padding: 1.15rem round(nearest, clamp(1.3rem, 7%, 2.8rem), 1px) 1.6rem;
  font-family: var(--serif);
  font-size: calc(1.14rem + 2.67px);
  line-height: var(--lyric-lh-px, var(--lyric-lh, 1.7));
}
.lyrics-scroll .verse {
  max-width: 46ch;
  margin: 0 auto 1.2rem;
}
.lyrics-scroll .lyrics-placeholder {
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}
.verse { margin: 0 0 1.2rem; }
.verse-label {
  font-family: var(--font);
  /* Always the 75% design ratio: .72rem label / .95rem lyric (0.72/0.95).
     Letter-spacing stays .12em so it tracks the label font. No rem floor. */
  font-size: var(--lyric-label-fs, round(nearest, calc(var(--lyric-fs, 1em) * 0.72 / 0.95), 1px));
  font-weight: 600;
  letter-spacing: var(--lyric-label-ls, .12em); text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 var(--lyric-label-mb, round(nearest, calc(var(--lyric-fs, 1em) * 0.25 / 0.95), 1px));
}
.verse p { margin: 0; }
.lyrics-scroll.is-fitted .verse,
.lyrics-scroll.is-fitted .lyrics-placeholder {
  max-width: none;
}
.lyrics-scroll.is-fitted .verse {
  margin-bottom: var(--verse-mb, max(round(nearest, 1.2rem, 1px), round(nearest, calc(var(--lyric-fs, 1em) * 1.2 / 0.95 * var(--lyric-lh, 1.7) / 1.7), 1px)));
}
.lyrics-scroll.is-fitted .lyric-line {
  display: inline-block;
  white-space: nowrap;
}
.lyrics-scroll.is-fitted.is-wrapping .lyric-line {
  display: inline;
  white-space: normal;
}
.lyrics-placeholder {
  font-family: var(--font);
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 1.1rem 1rem;
}
.lyrics-placeholder strong { display: block; color: var(--text); margin-bottom: .35rem; font-family: var(--font); }

.mobile-tabs { display: none; }
.up-next-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.1rem 0 .7rem; }
.up-next .up-next-head h2 { margin: 0; }
.autoplay-switch {
  position: relative; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font-size: .85rem; font-weight: 600; color: var(--muted); user-select: none;
}
.autoplay-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.autoplay-track {
  position: relative; width: 36px; height: 20px; border-radius: 999px;
  background: var(--line); transition: background .2s ease;
}
.autoplay-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease;
}
.autoplay-switch input:checked + .autoplay-track { background: var(--accent); }
.autoplay-switch input:checked + .autoplay-track .autoplay-knob { transform: translateX(16px); }
.autoplay-switch input:focus-visible + .autoplay-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.up-next h2 {
  margin: 1.1rem 0 .7rem; font-size: .95rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.up-item {
  display: grid; grid-template-columns: 154px minmax(0, 1fr);
  gap: .7rem; color: inherit; text-decoration: none;
  padding: .45rem; border-radius: 10px;
}
.up-item:hover { background: var(--bg-soft); }
.up-item .thumb { border-radius: 8px; box-shadow: none; }
.up-item .card-title { font-size: .92rem; }
.watch-loading, .watch-error { padding: 3rem 0; color: var(--muted); }

.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.2rem 1.2rem 2rem;
  color: var(--muted); font-size: .88rem; text-align: center;
}
.site-foot p { margin: 0 auto; max-width: 75ch; }
.site-foot p + p { margin-top: .45rem; }

.buy-song {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .45rem;
  margin: -.25rem 0 .9rem;
}
.buy-song-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: .15rem;
}
.buy-song-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: .26rem .7rem;
  font-size: .8rem;
  font-weight: 600;
}
.buy-song-link:hover,
.buy-song-link:focus-visible {
  background: var(--bg-soft);
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (max-width: 1023px) {
  .watch-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "player"
      "meta"
      "tabs"
      "panel";
  }
  .side-col { position: static; max-height: none; overflow: visible; }
  .lyrics-panel { position: static; max-height: none; }
  .mobile-tabs {
    display: flex; grid-area: tabs; gap: .4rem;
    background: var(--bg-soft); padding: .3rem; border-radius: 999px; width: max-content;
  }
  .mobile-tabs button {
    border: 0; background: transparent; color: var(--muted);
    padding: .4rem .95rem; border-radius: 999px; cursor: pointer; font-weight: 600;
  }
  .mobile-tabs button[aria-selected="true"] {
    background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow);
  }
  .tab-panel[hidden] { display: none; }
  .watch-layout .side-col, .watch-layout .up-next { grid-area: panel; }
}

@media (max-width: 720px) {
  .topbar { gap: .7rem; padding: 0 .8rem; }
  .home, .watch { padding: 1rem .8rem 2.5rem; }
  .up-item { grid-template-columns: 128px minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .topbar { gap: .45rem; padding: 0 .55rem; }
  .logo-text { display: none; }
  .search input { padding: .45rem .55rem .45rem .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card .thumb img { transition: none; }
}

.now-playing {
  margin: 0 0 .6rem; padding: .45rem .7rem; border-radius: 10px;
  background: var(--bg-soft); color: var(--muted); font-size: .9rem;
}
.now-playing a { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.now-playing a:hover { text-decoration: underline; }
.now-playing span { margin-left: .35rem; }
.up-item.is-playing { background: var(--bg-soft); box-shadow: inset 3px 0 0 var(--accent); }



/* Personal playlists */
.create-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  height: 42px;
  padding: 0 .9rem 0 .7rem;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
}
.create-btn:hover,
.create-btn:focus-visible {
  background: var(--bg-soft);
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.create-plus {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-strong);
}
.your-playlists { margin: 0 0 2rem; }
.playlists-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  flex-wrap: wrap;
  margin: 0 0 .6rem;
}
.playlists-head h2 {
  margin: 0;
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.playlist-backup-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.playlist-backup-actions .btn-quiet {
  padding: .28rem .75rem;
  font-size: .82rem;
}
.playlists-reminder {
  margin: 0 0 .9rem;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}
.playlists-reminder.is-stale {
  padding: .55rem .75rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
}
.playlists-restore-empty {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.your-playlists.is-empty { margin-bottom: 1.15rem; }
.text-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.text-link:hover { color: var(--gold); }
.playlist-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 340px));
  gap: 1rem;
}
@media (max-width: 720px) {
  .playlist-row { grid-template-columns: 1fr; }
}
.playlist-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: .8rem;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem;
  box-shadow: var(--shadow);
}
.playlist-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.playlist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.playlist-name {
  margin: 0 0 .15rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-count { margin: 0 0 .5rem; color: var(--muted); font-size: .86rem; }
.playlist-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.playlist-play,
.playlist-edit,
.playlist-delete {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: .22rem .7rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}
.playlist-play {
  background: var(--accent-strong);
  color: #fff;
  border-color: transparent;
}
[data-theme="dark"] .playlist-play { color: #12100c; }
.playlist-play.is-disabled {
  pointer-events: none;
  opacity: .45;
  cursor: default;
}
.playlist-edit:hover, .playlist-delete:hover { background: var(--bg-soft); }
.playlist-delete:hover { color: var(--danger); border-color: var(--danger); }

.add-to-playlist {
  position: relative;
  display: inline-block;
  margin: 0 0 .85rem;
}
.add-to-playlist-btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.add-to-playlist-btn:hover,
.add-to-playlist-btn[aria-expanded="true"] { background: var(--bg-soft); }
.add-to-playlist-menu {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  z-index: 30;
  min-width: 16rem;
  max-width: min(20rem, 80vw);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .35rem;
}
.add-to-playlist-menu[hidden] { display: none; }
.add-to-playlist-menu button,
.add-to-playlist-empty {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: .5rem .7rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.add-to-playlist-menu button:hover,
.add-to-playlist-menu button:focus-visible { background: var(--bg-soft); }
.add-to-playlist-menu button.is-in { color: var(--accent-strong); }
.add-to-playlist-menu .add-new-playlist {
  margin-top: .2rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  color: var(--accent-strong);
}
.add-to-playlist-empty { color: var(--muted); cursor: default; }

/* Phones: the headline wrapper is transparent so Autoplay, title and
   byline keep their existing order and padding. */
.watch-headline { display: contents; }

/* Desktop: title, Autoplay and the video-size slider share one line,
   flush with the video's left and right edges. The byline, playlist and
   buy row stay below, still aligned to the video's left edge. */
@media (min-width: 1024px) {
  .watch-headline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: var(--headline-gap, 0.85rem);
    row-gap: .15rem;
    width: calc(100% + (2 * clamp(0.35rem, 3.2vw, 2.75rem)));
    margin: 0 calc(-1 * clamp(0.35rem, 3.2vw, 2.75rem)) .25rem calc(-1 * clamp(0.35rem, 3.2vw, 2.75rem));
    box-sizing: border-box;
    --headline-fs: round(nearest, calc(clamp(1.25rem, 2vw, 1.7rem) - 4px), 1px);
    --headline-scale: 1;
    --headline-gap: max(8px, round(nearest, calc(0.85rem * var(--headline-scale)), 1px));
    --headline-thumb: max(8px, round(nearest, calc(16px * var(--headline-scale)), 1px));
    --headline-track-h: max(2px, round(nearest, calc(4px * var(--headline-scale)), 1px));
    --headline-thumb-mt: calc((var(--headline-track-h) - var(--headline-thumb)) / 2);
    --headline-knob: max(8px, round(nearest, calc(16px * var(--headline-scale)), 1px));
    --headline-track-w: max(18px, round(nearest, calc(36px * var(--headline-scale)), 1px));
    --headline-track-ht: max(10px, round(nearest, calc(20px * var(--headline-scale)), 1px));
    --headline-knob-x: max(8px, round(nearest, calc(16px * var(--headline-scale)), 1px));
  }
  .watch-headline .watch-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    width: auto;
    margin: 0;
    font-size: var(--headline-fs);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }
  .watch-headline .watch-title.has-lyrics,
  .watch-headline .watch-title.has-lyrics .title-text {
    white-space: nowrap;
    overflow: hidden;
  }
  .watch-headline .size-control {
    grid-column: 2;
    grid-row: 1;
    float: none;
    width: auto;
    margin: 0;
    justify-content: flex-end;
    font-size: max(8px, round(nearest, calc(0.8rem * var(--headline-scale)), 1px));
    gap: max(4px, round(nearest, calc(0.6rem * var(--headline-scale)), 1px));
  }
  .watch-headline .size-slider {
    width: max(64px, round(nearest, calc(152px * var(--headline-scale)), 1px));
  }
  .watch-headline .size-control input[type="range"]::-webkit-slider-runnable-track,
  .watch-headline .size-control input[type="range"]::-moz-range-track {
    height: var(--headline-track-h);
  }
  .watch-headline .size-slider::before {
    height: calc(var(--headline-track-h) + 4px);
  }
  .watch-headline .size-control input[type="range"]::-webkit-slider-thumb {
    width: var(--headline-thumb);
    height: var(--headline-thumb);
    margin-top: var(--headline-thumb-mt);
  }
  .watch-headline .size-control input[type="range"]::-moz-range-thumb {
    width: var(--headline-thumb);
    height: var(--headline-thumb);
  }
  .watch-headline .autoplay-switch {
    font-size: max(8px, round(nearest, calc(0.85rem * var(--headline-scale)), 1px));
    gap: max(3px, round(nearest, calc(0.5rem * var(--headline-scale)), 1px));
  }
  .watch-headline .autoplay-track {
    width: var(--headline-track-w);
    height: var(--headline-track-ht);
  }
  .watch-headline .autoplay-knob {
    top: max(1px, round(nearest, calc(2px * var(--headline-scale)), 1px));
    left: max(1px, round(nearest, calc(2px * var(--headline-scale)), 1px));
    width: var(--headline-knob);
    height: var(--headline-knob);
  }
  .watch-headline .autoplay-switch input:checked + .autoplay-track .autoplay-knob {
    transform: translateX(var(--headline-knob-x));
  }
  .watch-headline .now-playing {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 0 .15rem;
    width: 100%;
  }
  .song-meta > .byline,
  .song-meta > .add-to-playlist,
  .song-meta > .buy-song {
    margin-left: calc(-1 * clamp(0.35rem, 3.2vw, 2.75rem));
  }
}
.up-next-sub {
  margin: -.4rem 0 .7rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}
.up-next-sub[hidden] { display: none; }

.playlist-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 14, 10, .48);
  display: grid;
  place-items: center;
  padding: 1rem;
}
[data-theme="dark"] .playlist-modal-overlay { background: rgba(0, 0, 0, .62); }
.playlist-modal {
  width: min(720px, 100%);
  max-height: min(42rem, calc(100vh - 2rem));
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.playlist-modal-head,
.playlist-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.playlist-modal-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  flex-wrap: wrap;
}
.playlist-modal-foot-main {
  display: flex;
  gap: .5rem;
  margin-left: auto;
}
.playlist-modal-small { width: min(28rem, 100%); }
.playlist-modal-small .playlist-modal-body { min-height: 0; }
.playlist-modal-small .playlist-modal-body p { margin: 0 0 .7rem; }
.playlist-modal-small .playlist-modal-body p:last-child { margin-bottom: 0; }
.playlist-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.playlist-modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.playlist-modal-close:hover { background: var(--bg-soft); color: var(--text); }
.playlist-modal-body {
  padding: 1rem 1.1rem 1.15rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-height: 0;
}
.playlist-field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .3rem;
}
.playlist-field input[type="text"],
.playlist-field input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: .55rem .8rem;
  outline: none;
}
.playlist-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.playlist-editor-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1rem;
  min-height: 16rem;
}
.playlist-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}
.playlist-col h3 {
  margin: 0;
  padding: .55rem .75rem;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.playlist-col-list {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 10rem;
  max-height: 18rem;
  padding: .3rem;
}
.playlist-empty-hint {
  margin: 0;
  padding: 1.1rem .8rem;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}
.picker-item,
.picked-item {
  display: grid;
  gap: .45rem;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: .4rem .5rem;
  border-radius: 8px;
}
.picker-item { grid-template-columns: 18px minmax(0, 1fr); cursor: pointer; }
.picked-item { grid-template-columns: minmax(0, 1fr) auto; }
.picker-item:hover, .picked-item:hover { background: var(--bg-soft); }
.picker-item.is-added { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.picker-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--muted);
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--bg-elev);
}
.picker-item.is-added .picker-check {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.picker-item .song-title,
.picked-item .song-title {
  display: block;
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.picker-item .song-writer,
.picked-item .song-writer {
  display: block;
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
}
.picked-tools { display: flex; gap: .15rem; }
.picked-tools button {
  border: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
}
.picked-tools button:hover { color: var(--text); background: var(--bg-soft); }
.picked-tools button:disabled { opacity: .35; cursor: default; }
.picked-tools .picked-remove:hover { color: var(--danger); }
.playlist-error { margin: 0; color: var(--danger); font-size: .88rem; font-weight: 600; }
.playlist-error[hidden] { display: none; }
.btn-quiet, .btn-solid {
  border-radius: 999px;
  padding: .45rem 1rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}
.btn-quiet {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.btn-quiet:hover { background: var(--bg-soft); }
.btn-solid {
  border: 0;
  background: var(--accent-strong);
  color: #fff;
}
[data-theme="dark"] .btn-solid { color: #12100c; }
.btn-solid:hover { filter: brightness(1.06); }
.playlist-toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: .55rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  max-width: calc(100vw - 2rem);
}
@media (max-width: 720px) {
  .create-btn { width: 42px; padding: 0; }
  .create-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .playlist-editor-cols { grid-template-columns: 1fr; }
  .playlist-col-list { max-height: 12rem; }
  .playlist-card { grid-template-columns: 96px minmax(0, 1fr); }
  .playlist-modal-foot { align-items: stretch; }
}
@media (max-width: 420px) {
  .create-btn, .theme-toggle { width: 38px; height: 38px; }
  .playlist-modal-overlay { padding: .4rem; align-items: stretch; }
  .playlist-modal {
    max-height: calc(100vh - .8rem);
    border-radius: 12px;
  }
}

/* Desktop: lyrics text scales with the lyrics box width.
   Horizontal padding stays at roughly the old middle-slider amount (~30px). */
@media (min-width: 1024px) {
  .side-col > .lyrics-panel:not(.alt-versions) { container-type: inline-size; }
  .side-col > .lyrics-panel:not(.alt-versions) .lyrics-scroll {
    padding-left: var(--lyric-pad-l, round(nearest, 1.9rem, 1px));
    padding-right: var(--lyric-pad-r, round(nearest, 1.9rem, 1px));
    font-size: clamp(1.05rem, 4.85cqi, 2.3rem);
  }
  /* 60% and 40%: doubled left indent (1.9rem → 3.8rem). 75% stays at 1.9rem. */
  .watch-layout[data-video-step="0"] .side-col > .lyrics-panel:not(.alt-versions) .lyrics-scroll,
  .watch-layout[data-video-step="1"] .side-col > .lyrics-panel:not(.alt-versions) .lyrics-scroll {
    padding-left: var(--lyric-pad-l, round(nearest, 3.8rem, 1px));
  }
  /* 75%: a small indent from the title. 60%: halfway between that indent and centred.
     40%: same halfway indent, then pulled so the story's viewport-left is 75% of that
     distance (25% closer to the left edge). */
  .watch-layout[data-video-step="2"] .song-story {
    margin-left: var(--story-ml, round(nearest, clamp(0rem, 2vw, 2.5rem), 1px));
    margin-right: auto;
  }
  .watch-layout[data-video-step="1"] .song-story {
    margin-left: var(--story-ml, round(nearest, calc(max(0px, (100% - min(70ch, 100%)) / 4) + clamp(0rem, 2vw, 2.5rem) / 2), 1px));
    margin-right: auto;
  }
  .watch-layout[data-video-step="0"] .song-story {
    /* Floor at 0: the 25%-closer pull could go slightly negative at 1440. */
    margin-left: var(--story-ml, max(0px, round(nearest, calc(
      0.75 * (max(0px, (100% - min(70ch, 100%)) / 4) + clamp(0rem, 2vw, 2.5rem) / 2)
      - 0.25 * (1.1rem + clamp(0.35rem, 3.2vw, 2.75rem))
    ), 1px)));
    margin-right: auto;
  }
  /* Backstory type: 40% base is the previous size + 2pt. Larger stops scale by
     50% of the video-width increase (60% = 1.5× video → 1.25× type;
     75% = 1.875× video → 1.4375× type). Phones are unchanged. */
  .watch-layout { --story-fs-scale: 1; }
  .watch-layout[data-video-step="1"] { --story-fs-scale: 1.25; }
  .watch-layout[data-video-step="2"] { --story-fs-scale: 1.4375; }
  /* Same line-height curve as lyrics: 1.7 through 18px, 1.25 at 33px, 1.2 at 50px.
     60% and 75% cannot go looser than the previous 1.511 / 1.37. */
  .watch-layout {
    --story-fs: round(nearest, calc((1.08rem + 4pt) * var(--story-fs-scale)), 1px);
    --story-lh-curve: clamp(1.2, calc(1.7 + (var(--story-fs) - 18px) * (1.25 - 1.7) / 15px), 1.7);
    --story-lh: var(--story-lh-curve);
  }
  .watch-layout[data-video-step="0"] { --story-lh: 1.4; }
  .watch-layout[data-video-step="1"] { --story-lh: min(1.5114, var(--story-lh-curve)); }
  .watch-layout[data-video-step="2"] { --story-lh: min(1.37, var(--story-lh-curve)); }
  .watch-layout.has-video-size .song-story {
    font-size: var(--story-fs-px, round(nearest, calc((1.08rem + 4pt) * var(--story-fs-scale)), 1px));
    line-height: var(--story-lh-px, round(nearest, calc(1em * var(--story-lh)), 1px));
  }
  .watch-layout.has-video-size .song-story p {
    margin-bottom: var(--story-para-mb, round(nearest, calc(0.9rem * var(--story-lh) / 1.7), 1px));
  }
  .watch-layout.has-video-size .song-story .story-conclusion {
    margin-bottom: 0;
  }
  .watch-layout.has-video-size .song-story .story-headline {
    font-size: var(--story-headline-fs, round(nearest, calc((1.32rem + 4pt) * var(--story-fs-scale)), 1px));
  }
  .watch-layout.has-video-size .song-story .story-subhead,
  .watch-layout.has-video-size .song-story .story-sources h3 {
    font-size: round(nearest, calc((1.12rem + 4pt) * var(--story-fs-scale)), 1px);
  }
}

.playlist-info {
  display: flex; gap: .6rem; align-items: flex-start;
  margin: .2rem 0 .9rem; padding: .7rem .85rem;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 10px;
  color: var(--muted); font-size: .86rem; line-height: 1.45;
}
.playlist-info svg { flex: 0 0 auto; color: var(--gold); margin-top: .1rem; }
.playlist-info p { margin: 0; }
.playlist-info p + p { margin-top: .45rem; }

/* Comments (right column, below lyrics) */
.comments-panel {
  flex: 0 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.comments-head {
  padding: .425rem 1.1rem .35rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
}
.comments-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.comments-head-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.comments-sort {
  display: flex;
  gap: .15rem;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: .12rem;
}
.comments-sort button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  padding: .22rem .65rem;
  border-radius: 999px;
  cursor: pointer;
}
.comments-sort button[aria-pressed="true"] {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow);
}
.comments-account { position: relative; }
.comments-account-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: .22rem .7rem .22rem .25rem;
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 12rem;
}
.comments-account-btn:hover { background: var(--bg-soft); }
.comments-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 30;
  min-width: 13rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .35rem;
}
.comments-account-menu[hidden] { display: none; }
.comments-account-menu button,
.comments-account-menu .comments-account-label {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: .5rem .7rem;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
}
.comments-account-menu .comments-account-label {
  color: var(--muted);
  font-weight: 600;
  cursor: default;
  padding-bottom: .2rem;
}
.comments-account-menu button:hover { background: var(--bg-soft); }
.comments-body { padding: .9rem 1.1rem 1.15rem; }
.comments-auth-prompt,
.comments-composer {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  margin: 0 0 1rem;
}
.comments-auth-prompt p { margin: 0 0 .5rem; font-size: 14px; line-height: 20px; color: var(--text); }
.comments-auth-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.comment-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  letter-spacing: 0;
  user-select: none;
}
.comment-form-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .45rem; }
.comment-form-fields input,
.comment-form-fields textarea,
.comments-dialog input,
.comments-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: .5rem .7rem;
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
}
.comment-form-fields textarea { min-height: 44px; resize: vertical; }
.comment-form-fields input:focus,
.comment-form-fields textarea:focus,
.comments-dialog input:focus,
.comments-dialog textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.comment-form-actions,
.comments-dialog-actions { display: flex; justify-content: flex-end; gap: .4rem; flex-wrap: wrap; }
.comments-error { margin: .2rem 0 0; color: var(--danger); font-size: 13px; line-height: 18px; }
.comments-note { margin: .2rem 0 0; color: var(--muted); font-size: 13px; line-height: 18px; }
.comments-list { display: flex; flex-direction: column; gap: .95rem; }
.comments-empty { margin: .3rem 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.comment-item { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .45rem;
  align-items: baseline;
  margin: 0 0 .15rem;
}
.comment-author { font-size: 14px; line-height: 20px; font-weight: 700; }
.comment-time { font-size: 12px; line-height: 16px; color: var(--muted); }
.comment-body {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-actions { display: flex; flex-wrap: wrap; gap: .15rem; margin: .2rem 0 0; }
.comment-actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  padding: .2rem .45rem;
  border-radius: 999px;
  cursor: pointer;
}
.comment-actions button:hover { background: var(--bg-soft); color: var(--text); }
.comment-like.is-liked { color: var(--accent-strong); }
.comment-replies-toggle { margin-left: -.15rem; }
.comment-replies { margin: .65rem 0 0; display: flex; flex-direction: column; gap: .75rem; }
.comment-replies[hidden],
.comment-reply-form[hidden] { display: none; }
.comment-reply-form { margin: .55rem 0 0; }

.comments-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, #000 35%, transparent);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.comments-dialog-overlay[hidden] { display: none; }
.comments-dialog {
  width: min(28rem, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: min(90vh, 40rem);
  display: flex;
  flex-direction: column;
}
.comments-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.comments-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.comments-dialog-body { padding: 1rem 1.1rem 1.15rem; overflow: auto; }
.comments-dialog-body p { margin: 0 0 .7rem; font-size: 14px; line-height: 20px; }
.comments-dialog-body label {
  display: block;
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .3rem;
}
.comments-dialog .field { margin: 0 0 .7rem; }
.comments-key-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: .04em;
  word-break: break-all;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  margin: 0 0 .7rem;
}
.comments-key-warning {
  margin: 0 0 .8rem;
  padding: .6rem .7rem;
  background: color-mix(in srgb, var(--gold) 16%, var(--bg-soft));
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  font-size: 13px;
  line-height: 18px;
}
.comments-qr {
  display: grid;
  place-items: center;
  margin: 0 0 .8rem;
  padding: .6rem;
  background: #fff;
  border-radius: 12px;
}
.comments-qr svg { width: 180px; height: 180px; display: block; }

.comments-account-menu [hidden] { display: none !important; }

/* Print lyrics: title, byline, section labels and lyrics only. */
.print-lyrics-footer { display: none; }

.print-lyrics {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .2rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  flex: 0 0 auto;
}
.print-lyrics:hover { background: var(--bg-soft); }
.print-lyrics svg { display: block; flex: none; }

@media (max-width: 1023px) {
  .print-lyrics { font-size: .78rem; padding: .18rem .65rem; }
}

@media print {
  @page { margin: 16mm 15mm 20mm; }

  html, body, main, .watch, .watch-layout, .side-col, .lyrics-panel, #panel-lyrics {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  html, body {
    background: #fff !important;
    color: #000 !important;
  }

  body * { box-shadow: none !important; }

  .skip-link,
  .topbar,
  .site-foot,
  .player-wrap,
  .player,
  .size-control,
  .now-playing,
  .add-to-playlist,
  .buy-song,
  .song-story,
  .mobile-tabs,
  .panel-head,
  .print-lyrics,
  .comments-panel,
  .alt-versions,
  .up-next,
  .playlist-modal-overlay,
  .playlist-toast,
  .lyrics-dot,
  .mini-player-close,
  .mini-gesture-overlay {
    display: none !important;
  }

  .watch,
  .watch-layout,
  .song-meta,
  .watch-headline,
  .side-col,
  .lyrics-panel:not(.alt-versions),
  .lyrics-scroll,
  #panel-lyrics,
  #panel-lyrics[hidden],
  .tab-panel#panel-lyrics {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    float: none !important;
    inset: auto !important;
    grid-template-columns: none !important;
  }

  .watch-headline .watch-title,
  .watch-title,
  .watch-title.has-lyrics,
  .watch-title.has-lyrics .title-text {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 0 .15em !important;
    padding: 0 !important;
    font-family: var(--font), system-ui, sans-serif !important;
    font-size: 16pt !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
    color: #000 !important;
  }
  .watch-title.has-lyrics { display: block !important; }

  .byline {
    display: block !important;
    margin: 0 0 1.1em !important;
    font-family: var(--font), system-ui, sans-serif !important;
    font-size: 10pt !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: #222 !important;
  }

  .lyrics-scroll,
  .lyrics-scroll.is-fitted {
    font-family: var(--serif), Georgia, "Times New Roman", serif !important;
    font-size: 13pt !important;
    line-height: 1.45 !important;
    color: #000 !important;
    padding: 0 !important;
    --lyric-fs: 13pt;
    --lyric-lh: 1.45;
    --lyric-lh-px: 1.45em;
    --lyric-label-fs: calc(13pt * 0.72 / 0.95);
    --lyric-label-mb: calc(13pt * 0.25 / 0.95);
    --verse-mb: 0.95em;
  }

  .lyrics-scroll .verse,
  .lyrics-scroll.is-fitted .verse,
  .verse {
    max-width: none !important;
    margin: 0 0 0.95em !important;
    page-break-inside: avoid;
    break-inside: avoid;
    color: #000 !important;
  }

  .verse-label {
    font-family: var(--font), system-ui, sans-serif !important;
    font-size: calc(13pt * 0.72 / 0.95) !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em !important;
    line-height: 1.3 !important;
    color: #000 !important;
    margin: 0 0 calc(13pt * 0.25 / 0.95) !important;
  }

  .lyrics-scroll .lyric-line,
  .lyrics-scroll.is-fitted .lyric-line,
  .lyrics-scroll.is-fitted.is-wrapping .lyric-line {
    display: inline !important;
    white-space: normal !important;
  }

  /* Repeat a compact URL footer at the bottom of every printed page. */
  .print-lyrics-footer {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    padding: 6pt 0 0 !important;
    border-top: 0.4pt solid #000;
    background: #fff;
    break-inside: auto;
    page-break-inside: auto;
  }
  .print-lyrics-footer p {
    margin: 0;
    font-family: var(--font), system-ui, sans-serif !important;
    font-size: 8.5pt !important;
    color: #000 !important;
    line-height: 1.35;
  }

  /* Alternative versions also use .lyrics-panel; keep them out of print. */
  .lyrics-panel.alt-versions,
  .alt-versions,
  .up-next,
  #panel-upnext,
  .comments-panel {
    display: none !important;
  }

  .side-col,
  .side-col > .lyrics-panel:not(.alt-versions),
  .lyrics-panel:not(.alt-versions),
  .side-col .lyrics-scroll,
  .lyrics-scroll,
  .lyrics-scroll.is-fitted {
    display: block !important;
    flex: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
}
