/* Paper Songs. Colors follow the Limit Cycle Labs hub. */
:root {
  --bg: #07080c;
  --panel: rgba(12, 14, 22, 0.62);
  --panel-solid: #0d0f17;
  --raised: #151826;
  --paper-bg: #161923;
  --text: #e6e8ef;
  --muted: #9097ab;
  --faint: #5f667c;
  --accent: #7cf2d4;
  --accent-ink: #052a21;
  --accent-soft: rgba(124, 242, 212, 0.09);
  --warn: #ffb86b;
  --danger: #ff8a93;
  --border: rgba(160, 170, 210, 0.14);
  --border-strong: rgba(160, 170, 210, 0.28);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 0.45em; color: var(--text); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--accent); width: 1.15em; height: 1.15em; }

.eyebrow { margin: 0 0 0.4rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.lede { color: var(--muted); margin: 0.5rem 0 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.6em 1.15em; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--raised); color: var(--text); cursor: pointer; font-weight: 550; white-space: nowrap;
}
.button:hover { text-decoration: none; border-color: var(--muted); }
.button.play { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.button.play:hover { filter: brightness(1.08); }
.button.big { font-size: 1.15rem; padding: 0.85em 1.7em; }

.status-queued { color: var(--faint); }
.status-writing, .status-singing { color: var(--warn); }
.status-failed { color: var(--danger); }
.status-writing::after, .status-singing::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- Home ---------- */

.site { max-width: 920px; margin: 0 auto; padding: 20px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site nav a { color: var(--muted); font-size: 0.9rem; }
.home { max-width: 920px; margin: 0 auto; padding: 0 16px 64px; }
.hero { padding: 28px 0 8px; }
.hero h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 700; }
.hero-tracks { list-style: none; margin: 24px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hero-tracks a { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 10px 10px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.hero-tracks a:hover { text-decoration: none; border-color: var(--border-strong); }
.hero-tracks img, .cover-ph { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: linear-gradient(140deg, #13252b, #1d1633 70%); color: var(--faint); font-size: 2rem; font-weight: 700; }
.hero-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-sub { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.subscribe { margin: 36px 0 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 20px; align-items: center; }
.subscribe h2 { margin: 0 0 4px; font-size: 1.05rem; }
.subscribe p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.feed-url { display: flex; gap: 8px; min-width: 0; }
.feed-url input { flex: 1; min-width: 0; padding: 0.55em 0.8em; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--muted); font: 0.82rem var(--mono); }

.archive { margin-top: 40px; }
.archive h2 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.archive ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.archive a { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); }
.archive a:hover { text-decoration: none; background: rgba(255, 255, 255, 0.02); }
.arch-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.arch-titles { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.arch-titles span + span::before { content: ' · '; color: var(--faint); }
.arch-titles .missing { color: var(--faint); text-decoration: line-through; }
.arch-time { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.how { margin-top: 48px; color: var(--muted); font-size: 0.88rem; max-width: 62ch; }

/* Playlists on the home page */
.shelf { margin-top: 36px; }
.shelf h2 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.playlists { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.playlists a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.playlists a:hover { text-decoration: none; border-color: var(--border-strong); }
.pl-title { font-weight: 650; }
.pl-sub { font-size: 0.82rem; color: var(--muted); }
.all-songs { margin: 14px 0 0; font-weight: 550; }

/* Request a paper */
.site nav { display: flex; gap: 18px; }
.brand-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.request { display: grid; gap: 18px; max-width: 640px; margin-top: 8px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.request label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.request .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.request input:not([type="file"]) { width: 100%; padding: 0.6em 0.8em; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-weight: 400; }
.request input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.request input[type="file"] { font: inherit; font-weight: 400; color: var(--muted); }
.request label .muted { font-weight: 400; }
.request .hint { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.request button { justify-self: start; }
.request button:disabled { opacity: 0.6; cursor: progress; }
.form-error { max-width: 640px; margin: 8px 0 0; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255, 138, 147, 0.4); background: rgba(255, 138, 147, 0.08); color: var(--danger); }
@media (max-width: 560px) { .request .row { grid-template-columns: 1fr; } }
/* Commissioning a playlist: the form's extras, and the list of papers found. */
.request textarea { width: 100%; padding: 0.6em 0.8em; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-weight: 400; resize: vertical; }
.request textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.request .choice { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.request .choice legend { padding: 0 0 6px; font-weight: 600; font-size: 0.9rem; }
.request .choice label { display: flex; align-items: baseline; gap: 10px; font-weight: 400; color: var(--muted); }
.request .choice strong { color: var(--text); font-weight: 600; }
.request .choice input[type="radio"] { width: auto; flex: none; accent-color: var(--accent); }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cost-note { font-size: 0.8rem; color: var(--faint); }
.commission-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 28px; padding: 18px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); }
.commission-cta h2 { margin: 0 0 4px; font-size: 1.05rem; }
.commission-cta p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 0.9rem; }
.queue-note { margin: -4px 0 10px; font-size: 0.85rem; }
.hero .visibility { margin-top: 14px; }
/* Four links for creators: let them wrap rather than run off a phone's screen. */
.site nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
.commission-list { display: grid; gap: 16px; max-width: 760px; margin-top: 8px; }
.commission-list button:disabled { opacity: 0.5; cursor: not-allowed; }
.ci-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ci { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.ci input[type="checkbox"] { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.ci-mark { width: 16px; height: 16px; margin-top: 4px; flex: none; border-radius: 50%; border: 1.5px solid var(--faint); }
.ci[data-state="finding"] .ci-mark { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.ci[data-state="missing"] .ci-mark, .ci[data-state="failed"] .ci-mark { border-color: var(--danger); }
.ci[data-state="found"] .ci-mark { border-color: var(--accent); background: var(--accent-soft); }
.ci-main { min-width: 0; }
.ci-main p { margin: 0; }
.ci-title { font-weight: 600; }
.ci-meta, .ci-cite, .ci-where { font-size: 0.82rem; color: var(--muted); }
.ci-cite { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci[data-state="missing"] .ci-status, .ci[data-state="failed"] .ci-status { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
/* Who's listening (admins) */
.vt-scroll { overflow-x: auto; }
.visits-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.visits-table th, .visits-table td { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.visits-table th[scope="row"] { white-space: nowrap; }
.visits-table thead th { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.visits-table td { font-variant-numeric: tabular-nums; }
.vt-note { margin-top: 10px; max-width: 760px; }
.vt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.85rem; }
.vt-key { font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }
@media (prefers-reduced-motion: reduce) { .ci[data-state="finding"] .ci-mark { animation: none; } }

/* Every song */
.song-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--border); }
.song-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.sr-cover { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; font-size: 1rem; }
.sr-main { min-width: 0; }
.sr-title { display: block; color: var(--text); font-weight: 600; line-height: 1.35; }
a.sr-title:hover { color: var(--accent); text-decoration: none; }
.sr-meta, .sr-where, .sr-status { margin: 3px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.sr-where a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-strong); }
.sr-where a:hover { color: var(--accent); }
.sr-status { color: var(--warn); }
.sr-status[data-kind="failed"], .sr-status[data-kind="stopped"] { color: var(--danger); }
.song-row:not([data-status="done"]) .sr-title { color: var(--muted); }
.sr-time { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }


@media (max-width: 680px) {
  .hero-tracks { grid-template-columns: 1fr; gap: 8px; }
  .hero-tracks a { flex-direction: row; align-items: center; padding: 8px; }
  .hero-tracks img, .hero-tracks .cover-ph { width: 64px; font-size: 1.2rem; }
  .hero-tracks a > span:not(.cover-ph) { min-width: 0; }
  .hero-tracks a { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; }
  .hero-tracks a > img, .hero-tracks a > .cover-ph { grid-row: span 2; }
  .hero-title { -webkit-line-clamp: 2; font-size: 0.95rem; }
  .subscribe { grid-template-columns: 1fr; }
  .archive a { grid-template-columns: 4em minmax(0, 1fr) auto; gap: 10px; }
}

/* ---------- Edition: one screen, player on the left, paper on the right ---------- */

.page-edition { height: 100dvh; overflow: hidden; }
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  grid-template-areas: "bar paper" "now paper" "songs paper" "views paper" "panel paper";
}
.app::before { content: ''; grid-column: 1; grid-row: 1 / -1; background: var(--panel-solid); border-right: 1px solid var(--border); }
.bar { grid-area: bar; }
.now { grid-area: now; }
.songs { grid-area: songs; }
.views { grid-area: views; }
.lyrics, .about { grid-area: panel; overflow: auto; overscroll-behavior: contain; }
.paper { grid-area: paper; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0 20px; }
.days { display: flex; align-items: center; gap: 2px; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.day-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.days a, .days .disabled { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--text); font-size: 16px; }
.days a:hover { background: rgba(255, 255, 255, 0.06); }
.days .disabled { opacity: 0.2; }

.now { padding: 18px 20px 6px; }
.now-head { display: flex; gap: 14px; align-items: center; }
.now .cover { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; flex: none; background: linear-gradient(140deg, #13252b, #1d1633 70%); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.now-meta { min-width: 0; }
.now-kicker { margin: 0 0 3px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.now-title { margin: 0; font-size: 1.04rem; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.now-byline { margin: 4px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.now-style { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }
.now-style:empty { display: none; }
.chip { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }

.seek { display: grid; grid-template-columns: 3em minmax(0, 1fr) 3em; align-items: center; gap: 8px; margin-top: 14px; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-dur { text-align: right; }
.seek input { width: 100%; margin: 0; accent-color: var(--accent); height: 18px; cursor: pointer; }
.transport { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--text); cursor: pointer; font-size: 22px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: none; }
.icon-btn.back, .icon-btn.fwd { color: var(--muted); font-size: 24px; }
.play-btn { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 26px; cursor: pointer; box-shadow: 0 6px 24px rgba(124, 242, 212, 0.18); }
.play-btn:hover { filter: brightness(1.08); }
.play-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.play-btn .i-pause, .app.playing .play-btn .i-play { display: none; }
.app.playing .play-btn .i-pause { display: block; }
.now-note { margin: 6px 0 0; font-size: 0.82rem; color: var(--warn); text-align: center; }
.now-note:empty { display: none; }
.now-note a { color: inherit; text-decoration: underline; }

.songs { padding: 10px 10px 8px; }
.tracks { list-style: none; margin: 0; padding: 0; }
.track > button { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.track > button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.04); }
.track > button:disabled { cursor: default; }
.track[aria-current="true"] > button { background: var(--accent-soft); }
.track[aria-current="true"] .track-title { color: var(--accent); }
.track-num { color: var(--faint); font-size: 0.85rem; text-align: center; font-variant-numeric: tabular-nums; }
.track-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9rem; font-weight: 560; line-height: 1.3; }
.track-sub { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-time { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.track[data-status="failed"] .track-title { color: var(--faint); }

.eq { display: inline-flex; align-items: flex-end; justify-content: center; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: var(--accent); transform-origin: bottom; animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.app:not(.playing) .eq i { animation-play-state: paused; }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

.views { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.views button { padding: 10px 10px 9px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); cursor: pointer; font-size: 0.85rem; font-weight: 550; }
.views button:hover { color: var(--text); }

.lyrics { position: relative; padding: 6px 20px 48px; }
.lyrics .lyric-section { margin: 20px 0 4px; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); opacity: 0.85; }
.lyrics p { margin: 0; line-height: 1.7; }
.lyrics .gap { height: 0.8em; }
/* Timed lyrics: every line plays from there when clicked; the one being sung is marked. */
.lyrics .lyric { display: block; width: calc(100% + 16px); margin: 0 -8px; padding: 2px 8px; border: 0; border-radius: 8px; background: none; text-align: left; line-height: 1.6; color: #b9bdca; cursor: pointer; transition: color 0.25s, background-color 0.25s, box-shadow 0.25s; }
.lyrics .lyric:hover { background: rgba(255, 255, 255, 0.04); }
.lyrics .lyric.now { color: var(--text); background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.panel-empty { color: var(--faint); font-size: 0.9rem; margin-top: 20px; }
.about { padding: 18px 20px 48px; font-size: 0.9rem; }
.about h2 { margin: 0 0 6px; font-size: 1rem; line-height: 1.35; }
.about .authors { margin: 0 0 14px; color: var(--muted); font-size: 0.82rem; }
.about .abstract { margin: 0 0 16px; color: #cfd3df; line-height: 1.65; }
.about dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 16px; font-size: 0.82rem; }
.about dt { color: var(--muted); }
.about dd { margin: 0; }
.about .links { display: flex; flex-wrap: wrap; gap: 8px; }
.about .links a { font-size: 0.82rem; }

.paper { display: flex; flex-direction: column; min-height: 0; background: var(--paper-bg); }
.paper-bar { display: flex; align-items: center; gap: 2px; padding: 5px 10px 5px 18px; border-bottom: 1px solid var(--border); background: var(--panel-solid); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.paper-bar .icon-btn { width: 34px; height: 34px; font-size: 18px; color: var(--muted); }
.paper-bar .icon-btn:hover { color: var(--text); }
.spacer { flex: 1; }
.paper-bar .pages { white-space: nowrap; }
.cue-label { min-width: 0; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: normal; }
.bar-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-right: 4px; padding: 0 11px 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; background: none; color: var(--muted); cursor: pointer; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.bar-btn svg { font-size: 15px; }
.bar-btn:hover { color: var(--text); border-color: var(--muted); }
.bar-btn[aria-pressed="true"] { color: var(--accent); border-color: rgba(124, 242, 212, 0.4); background: var(--accent-soft); }
.paper-bar .ticker-toggle[aria-pressed="true"] { color: var(--accent); }
.pdf-wrap { position: relative; flex: 1; min-height: 0; }
/* Its own stacking context, so pdf.js's layers (link boxes at z-index 5 and up) stay under the ticker. */
.pdf-container { position: absolute; inset: 0; z-index: 0; overflow: auto; overscroll-behavior: contain; }
.pdf-container:focus { outline: none; }
.pdfViewer { padding: 14px 0 40px; }
.pdfViewer.removePageBorders .page { margin: 0 auto 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); border-radius: 2px; }
.paper.has-ticker .pdfViewer { padding-bottom: 100px; }

/* What the song points at: lines marked like a highlighter, figures and tables framed. */
.cue-mark { position: absolute; z-index: 5; pointer-events: none; border-radius: 3px; background: rgba(124, 242, 212, 0.42); mix-blend-mode: multiply; animation: mark-in 0.45s ease-out; }
.cue-mark.figure, .cue-mark.table { background: rgba(124, 242, 212, 0.1); outline: 3px solid rgba(18, 168, 136, 0.85); outline-offset: 3px; mix-blend-mode: normal; }
@keyframes mark-in { from { opacity: 0; } }

/* Links: the words a lyric names light up in the paper as they're sung, a highlighter swept
   across running text or a ring around a figure's label or a table's cell. */
.link-mark { position: absolute; z-index: 6; pointer-events: none; border-radius: 3px; opacity: 0; transition: opacity 0.3s, box-shadow 0.3s; }
.link-mark.on { opacity: 1; }
.link-mark.sweep i { display: block; width: 0; height: 100%; border-radius: 3px; background: rgba(255, 196, 0, 0.55); mix-blend-mode: multiply; transition: width 0.35s ease-out; }
.link-mark.sweep.on i { width: 100%; }
.link-mark.sweep.live { box-shadow: 0 0 0 2px rgba(255, 176, 0, 0.8), 0 0 18px rgba(255, 176, 0, 0.5); }
.link-mark.ring { border: 3px solid #12b892; border-radius: 8px; box-shadow: 0 0 0 4px rgba(124, 242, 212, 0.35), 0 0 22px rgba(18, 184, 146, 0.55); }
.link-mark.ring.on { animation: ring-in 2.8s ease-out forwards; }
.link-mark.pulse { border-radius: 8px; outline: 4px solid rgba(18, 168, 136, 0.95); outline-offset: 4px; box-shadow: 0 0 40px rgba(124, 242, 212, 0.45); }
.link-mark.pulse.on { animation: pulse-flash 1s ease-in-out forwards; }
@keyframes pulse-flash { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ring-in { 0% { opacity: 0; transform: scale(1.35); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
/* A lyric word that lights something up in the paper. */
.linked { text-decoration: underline 2px rgba(255, 196, 0, 0.5); text-underline-offset: 4px; text-decoration-skip-ink: none; }
.lyric.now .linked, .ticker .w.linked.sung, .ticker .w.linked.now { text-decoration-color: rgba(255, 196, 0, 0.95); }

/* An equation the song explains, typeset over the paper, its terms lighting up as they're sung. */
.eq-card { position: absolute; left: 16px; right: 16px; bottom: 74px; z-index: 4; width: fit-content; max-width: calc(100% - 32px); margin: 0 auto; padding: 14px 24px 16px; border-radius: 14px; background: rgba(10, 12, 19, 0.94); border: 1px solid var(--border-strong); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); text-align: center; animation: mark-in 0.35s ease-out; }
.paper:not(.has-ticker) .eq-card { bottom: 18px; }
.eq-label { margin: 0 0 6px; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.eq-tex { font-size: 1.45rem; color: rgba(230, 232, 239, 0.88); overflow-x: auto; overflow-y: hidden; }
.eq-tex .katex-display { margin: 0; }
.eq-tex [class*="term-"] { border-radius: 4px; padding: 0 1px; transition: color 0.25s, background-color 0.25s; }
.eq-tex .lit { color: var(--accent); }
.eq-tex .live { color: #04140f; background: var(--accent); box-shadow: 0 0 22px rgba(124, 242, 212, 0.5); }

/* Watch: the song's video, drawn live in a frame scaled to the window. */
.watch-view { position: fixed; inset: 0; z-index: 30; background: #000; overflow: hidden; }
.watch-frame { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; background: #07080c; pointer-events: none; }
.watch-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); pointer-events: none; }
.watch-status:empty { display: none; }
.watch-controls { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(760px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(10, 12, 19, 0.82); border: 1px solid var(--border-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: opacity 0.4s; }
.watch-controls .play-btn { width: 44px; height: 44px; font-size: 20px; flex: none; }
.watch-controls .icon-btn { width: 36px; height: 36px; font-size: 19px; flex: none; }
.w-seek { flex: 1; min-width: 60px; accent-color: var(--accent); cursor: pointer; }
.watch-view.idle { cursor: none; }
.watch-view.idle .watch-controls { opacity: 0; pointer-events: none; }
.bar-btn.watch { color: var(--text); }

/* The lyrics ticker: one long line sliding right to left over the bottom of the paper. */
.ticker { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 58px; pointer-events: none; background: rgba(8, 10, 16, 0.86); border-top: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ticker-window { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
/* Vertically centered by top alone: the script owns transform. */
.ticker-line { position: absolute; left: 0; top: calc(50% - 0.5em); white-space: nowrap; font-size: 1.4rem; line-height: 1; font-weight: 650; letter-spacing: -0.01em; will-change: transform; }
.ticker .w { display: inline-block; margin-right: 0.28em; color: var(--text); transition: color 0.2s; }
.ticker .w.sung { color: rgba(230, 232, 239, 0.36); }
.ticker .w.now { color: var(--accent); }
.ticker .sep { display: inline-block; margin: 0 0.55em 0 0.25em; color: var(--faint); font-weight: 400; }
.ticker .sec { display: inline-block; margin-right: 0.7em; padding: 3px 8px; border: 1px solid rgba(124, 242, 212, 0.35); border-radius: 999px; font-size: 0.56rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); vertical-align: 0.35em; }

.pdf-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--muted); pointer-events: none; }
.pdf-status:empty { display: none; }

.start { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 10, 0.7); backdrop-filter: blur(6px); }
.start-card { max-width: 420px; width: 100%; padding: 28px 24px; text-align: center; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); }
.start-sub { margin: 14px 0 0; font-size: 0.88rem; }

/* ---------- Songs still being made, and the page before any song is ready ---------- */

.making { margin: 8px 4px 4px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.making h2 { margin: 0 0 10px; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.making ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.making li { display: grid; gap: 3px; }
.making-title { font-size: 0.88rem; font-weight: 560; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.making-status { font-size: 0.78rem; line-height: 1.45; color: var(--muted); }
.making time { font-variant-numeric: tabular-nums; }
.making li[data-kind="active"] .making-status, .making li[data-kind="retrying"] .making-status { color: var(--warn); }
.making li[data-kind="active"] .making-status::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
.making li[data-kind="failed"] .making-status, .making li[data-kind="stopped"] .making-status { color: var(--danger); }
.hero .making { margin: 22px 0 0; max-width: 640px; }

.now-empty { display: none; padding: 4px 0 8px; }
.now-empty .eyebrow { color: var(--warn); }
.now-empty-text { margin: 0; line-height: 1.5; }
.app.empty .now-empty { display: block; }
.app.empty .now-head, .app.empty .now-style, .app.empty .seek, .app.empty .transport { display: none; }
.app.empty .views { display: none; }
.app.empty .pdf-container, .app.empty .paper-bar > * { visibility: hidden; }
.paper-empty { display: none; position: absolute; inset: 0; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--muted); }
.app.empty .paper-empty { display: grid; }

/* Desktop: the side panel shows lyrics or about; the paper and the song list are always visible.
   A long playlist scrolls inside its own box, so the player and lyrics stay on screen. */
@media (min-width: 861px) {
  .songs { max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
  .views [data-show="paper"], .views [data-show="songs"] { display: none; }
  .app[data-panel="lyrics"] .about, .app[data-panel="about"] .lyrics { display: none; }
  .app[data-panel="lyrics"] [data-show="lyrics"], .app[data-panel="about"] [data-show="about"] { color: var(--text); border-bottom-color: var(--accent); }
}

@media (min-width: 861px) and (max-height: 760px) {
  .songs { max-height: 24vh; }
}

/* Phone and narrow windows: a compact player on top, then one view at a time. */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-areas: "bar" "now" "views" "main"; }
  .app::before { display: none; }
  .bar { padding: 10px 12px 0 16px; background: var(--panel-solid); }
  .now { padding: 10px 16px 4px; background: var(--panel-solid); }
  .now .cover { width: 52px; height: 52px; border-radius: 8px; }
  .now-title { font-size: 0.95rem; -webkit-line-clamp: 2; }
  .now-byline, .now-style { display: none; }
  .seek { margin-top: 8px; }
  .transport { margin-top: 0; gap: 6px; }
  .play-btn { width: 50px; height: 50px; font-size: 22px; }
  .views { background: var(--panel-solid); padding: 0 8px; }
  .views button { flex: 1; }
  .songs, .lyrics, .about, .paper { grid-area: main; display: none; overflow: auto; }
  .app[data-view="paper"] .paper { display: flex; overflow: hidden; }
  .app[data-view="songs"] .songs, .app[data-view="lyrics"] .lyrics, .app[data-view="about"] .about { display: block; }
  .app[data-view="paper"] [data-show="paper"], .app[data-view="songs"] [data-show="songs"],
  .app[data-view="lyrics"] [data-show="lyrics"], .app[data-view="about"] [data-show="about"] { color: var(--text); border-bottom-color: var(--accent); }
  .paper-bar { padding-left: 14px; }
  .ticker { height: 50px; }
  .ticker-line { font-size: 1.12rem; }
}
@media (max-width: 560px) {
  .follow-text { display: none; }
  .bar-btn { padding: 0 8px; }
  .paper-bar .zoom-out, .paper-bar .zoom-in { display: none; }
}

/* Signed-in creators: a new take of the song playing, and more papers for their own playlist. */
.now-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.now-actions[hidden], .now-actions [hidden] { display: none; }
.retake-dialog { max-width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); background: var(--panel-solid); color: var(--text); }
.retake-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.retake-dialog .request { margin: 0; }
.retake-dialog h2 { margin: 0; font-size: 1.15rem; }
.retake-dialog p { margin: 0; }
.add-more { margin-top: 36px; }
.add-more h2 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.ci-earlier { color: var(--muted); margin: 0 0 10px; }

/* A signed-in creator's private playlists, under the public ones on the home page. */
.private-playlists { margin-top: 24px; }
.private-playlists[hidden] { display: none; }
.private-playlists .only-you { margin-left: 8px; font-weight: 400; letter-spacing: normal; text-transform: none; font-size: 0.8rem; }
.private-playlists .playlists a { border-style: dashed; }
