.version-select {
  max-width: 280px;
  border: 1px solid rgb(240 231 216 / .18);
  border-radius: 999px;
  background: #211924;
  padding: 8px 34px 8px 14px;
  color: #f0e7d8;
  font-size: 14px;
  outline: none;
}
.version-select:focus { border-color: #d8a94e; }
.pdf-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  border: 1px solid rgb(216 169 78 / .45);
  border-radius: 999px;
  padding: 7px 13px;
  color: #d8a94e;
  font-size: 13px;
}
.pdf-button:hover { border-color: #d8a94e; background: rgb(216 169 78 / .09); color: #f0e7d8; }
.search-result-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 4px; }
.search-result-row:hover { padding-left: 8px; color: #d8a94e; }
.search-result-row strong, .search-result-row small { display: block; }
.search-result-row small { margin-top: 2px; color: #8f8275; font-size: 13px; }

/* ---- Lyrics reader -------------------------------------------------------
   Below 1024px the page scrolls as one column: a slim bar sticks to the top
   and the track list is a bottom sheet. From 1024px it is a fixed-height
   workspace with the track list as a sidebar and the lyrics scrolling beside
   it. */

.back-link { display: inline-flex; align-items: center; min-height: 32px; font-size: 13px; color: #8f8275; }
.back-link:hover { color: #d8a94e; }

.reader { display: flex; flex-direction: column; min-height: calc(100svh - var(--header-h, 0px)); }
.reader-body { flex: 1; width: 100%; }
.reader-main { min-width: 0; }
.reader-lyrics { min-width: 0; scroll-margin-top: 48px; }
.reader-lyrics.htmx-request { opacity: .45; transition: opacity .15s ease; }

.reader-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 2px 8px;
  border-bottom: 1px solid rgb(240 231 216 / .1);
  background: rgba(18, 13, 22, .94); backdrop-filter: blur(14px);
}
.reader-bar-button {
  display: inline-flex; flex: none; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 10px; border-radius: 999px;
  font-size: 13.5px; color: #b0a08f; white-space: nowrap;
}
.reader-bar-button:hover { color: #d8a94e; }
.reader-bar-button svg { width: 18px; height: 18px; flex: none; }
.reader-bar-tracks { color: #f0e7d8; }
.reader-bar-tracks small { font-size: 12px; color: #8f8275; font-variant-numeric: tabular-nums; }
.reader-bar-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14.5px; color: #d8cebe; opacity: 0; transition: opacity .2s ease;
}
.reader-bar[data-titled] .reader-bar-title { opacity: 1; }
.reader-bar-tools { display: flex; flex: none; align-items: center; margin-left: auto; }
[data-translation-toggle][aria-pressed="true"] { color: #d8a94e; }
[data-translation-toggle][aria-pressed="false"] { text-decoration: line-through; text-decoration-color: rgb(240 231 216 / .4); }
.reader-bar-size { gap: 3px; }
.reader-bar-size span { margin-right: 3px; font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 600; line-height: 1; color: #f0e7d8; }
.reader-bar-size i { width: 4px; height: 4px; border-radius: 999px; background: rgb(240 231 216 / .22); }
.reader-bar-size i:first-of-type,
:root[data-lyric-size="2"] .reader-bar-size i:nth-of-type(2),
:root[data-lyric-size="3"] .reader-bar-size i { background: #d8a94e; }

.track-sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 8px 10px 20px; border-bottom: 1px solid rgb(240 231 216 / .1);
}
.track-sheet-head p { min-width: 0; }
.track-sheet-head b { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; line-height: 1.2; color: #f0e7d8; }
.track-sheet-head span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: #8f8275; }
.track-sheet-close { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border-radius: 999px; color: #b0a08f; }
.track-sheet-close:hover { color: #d8a94e; }
.track-sheet-close svg { width: 20px; height: 20px; }

.track-list { padding: 8px 8px 24px; }
.track-group { padding: 20px 12px 8px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #d8a94e; }
.track-group:first-child { padding-top: 8px; }
.track-button { display: flex; align-items: baseline; gap: 6px; min-height: 44px; border-radius: 5px; padding: 10px 12px; font-size: 15px; line-height: 1.45; }
.track-button:hover { background: rgb(165 32 58 / .4); }
.track-button[aria-current="true"] { background: #a5203a; color: #f0e7d8; }
.track-number { width: 28px; flex: none; font-family: 'Cormorant Garamond', serif; opacity: .5; }
.track-name { min-width: 0; }

.lyrics-head { padding: 22px 16px 16px; border-bottom: 1px solid rgb(240 231 216 / .08); }
.lyrics-kicker { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #d8a94e; }
.lyrics-title { margin-top: 6px; font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 600; line-height: 1.15; color: #f0e7d8; }
.lyrics-original-title { margin-top: 5px; font-size: 14.5px; font-style: italic; color: #a99a86; }

.lyric-line { scroll-margin-top: 64px; }
.lyric-original { font-size: calc(18px * var(--lyric-scale, 1)); }
.lyric-translation { font-size: calc(16px * var(--lyric-scale, 1)); }
:root[data-lyric-size="2"] { --lyric-scale: 1.17; }
:root[data-lyric-size="3"] { --lyric-scale: 1.34; }
:root[data-hide-translation] [data-lyric-translation] { display: none; }

/* The line someone picked, or arrived at from a search result. */
.lyric-cells.is-active::before,
.lyric-line:target .lyric-cells::before {
  content: ""; position: absolute; inset: 0 -10px; border-radius: 6px;
  background: rgb(216 169 78 / .08); pointer-events: none;
}

.line-report-trigger {
  display: none; align-items: center; margin-top: 10px; min-height: 34px;
  border: 1px solid rgb(240 231 216 / .2); border-radius: 999px; padding: 4px 14px;
  font-size: 12.5px; color: #b0a08f;
}
.line-report-trigger:hover { border-color: #d8a94e; color: #f0e7d8; }
.lyric-cells.is-active .line-report-trigger,
.line-report-trigger[aria-expanded="true"] { display: inline-flex; }

.issue-panel { position: relative; margin-top: 12px; border: 1px solid rgb(240 231 216 / .1); border-radius: 8px; background: #1b151f; padding: 12px; }
.issue-message {
  width: 100%; resize: vertical; border: 1px solid rgb(240 231 216 / .15); border-radius: 6px;
  background: #120d16; padding: 8px 12px; font-size: 16px; color: #f0e7d8; outline: none;
}
.issue-message:focus { border-color: #d8a94e; }

.lyrics-foot { padding: 18px 16px 30px; }
.lyrics-report-hint { font-size: 12.5px; color: #8f8275; }
.track-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.track-pager-link {
  display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 64px;
  border: 1px solid rgb(240 231 216 / .12); border-radius: 10px; padding: 10px 14px;
}
.track-pager-link small { font-size: 11.5px; letter-spacing: .08em; color: #8f8275; }
.track-pager-link b {
  display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 15px; font-weight: 500; line-height: 1.35; color: #e6dccc;
}
.track-pager-link.is-next { grid-column: 2; align-items: flex-end; text-align: right; }
.track-pager-link:hover { border-color: rgb(216 169 78 / .45); }
.track-pager-link:hover b { color: #d8a94e; }

@media (min-width: 640px) {
  .lyrics-head, .lyrics-foot { padding-left: 24px; padding-right: 24px; }
  .lyric-original { font-size: calc(19px * var(--lyric-scale, 1)); }
}

@media (max-width: 1023px) {
  .version-select { font-size: 16px; }
  .track-sheet {
    position: fixed; inset: auto 0 0; z-index: 70; display: flex; flex-direction: column;
    max-height: 78svh; border-top: 1px solid rgb(240 231 216 / .14); border-radius: 16px 16px 0 0;
    background: #1b151f; box-shadow: 0 -24px 60px rgb(0 0 0 / .55);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%); visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .75, .2, 1), visibility 0s .28s;
  }
  .track-sheet[data-open] { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .75, .2, 1); }
  .track-list { overflow-y: auto; overscroll-behavior: contain; }
  .track-sheet-backdrop {
    position: fixed; inset: 0; z-index: 65; background: rgb(8 5 10 / .62);
    opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility 0s .28s;
  }
  .track-sheet[data-open] + .track-sheet-backdrop { opacity: 1; visibility: visible; transition: opacity .28s ease; }
  :root.sheet-open { overflow: hidden; }
}

@media (min-width: 1024px) {
  .reader { height: calc(100svh - var(--header-h, 0px)); overflow: hidden; }
  .reader-body {
    display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0;
    max-width: 1520px; margin-inline: auto; padding-inline: 40px;
  }
  .track-sheet { min-height: 0; overflow-y: auto; border-right: 1px solid rgb(240 231 216 / .1); padding: 12px 0 0; }
  .track-sheet-head, .track-sheet-backdrop, .reader-bar-tracks { display: none; }
  .track-list { padding: 0 8px 32px 0; }
  .reader-main { display: flex; flex-direction: column; min-height: 0; }
  .reader-bar { position: static; min-height: 44px; padding: 0 32px; border-bottom: 0; background: none; backdrop-filter: none; }
  .reader-bar-button { min-height: 36px; }
  .reader-lyrics { flex: 1; min-height: 0; overflow-y: auto; padding: 0 32px 20px; scroll-margin-top: 0; }
  .lyrics-head { padding: 22px 20px 18px; }
  .lyrics-title { font-size: 34px; }
  .lyrics-foot { padding: 18px 20px 26px; }
  .lyric-line { scroll-margin-top: 16px; }
}

/* A pointer that can hover gets the trigger beside the line instead of under it. */
@media (hover: hover) and (min-width: 1024px) {
  .line-report-trigger {
    position: absolute; top: 16px; right: 0; display: inline-flex; margin-top: 0; min-height: 0;
    padding: 2px 10px; font-size: 12px; opacity: 0;
  }
  .lyric-line:hover .line-report-trigger,
  .line-report-trigger:focus-visible,
  .lyric-cells.is-active .line-report-trigger,
  .line-report-trigger[aria-expanded="true"] { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .track-sheet, .track-sheet-backdrop, .reader-bar-title { transition: none; }
}
