/* Layout: a streaming-app shell. Deep-teal sidebar + now-playing bar frame a parchment library;
   each history era is an "album" with its own brand-color cover. */
:root {
  --deep-teal: #164E63;
  --teal-2: #1D5E76;        /* hover tint of deep teal */
  --teal-3: #0F3F51;        /* darker chrome edge */
  --sky-blue: #48A3B6;
  --ochre: #E2A72E;
  --parchment: #FAF3E3;
  --coral: #D96C51;
  --sage: #91B59C;
  --ink: #183238;
  --white: #FFFFFF;
  --mark: #1B95AE;

  --paper: #FDF9EF;
  --line: #E8DEC6;
  --muted: #5A6E73;
  --on-teal: #D3E1E4;
  --on-teal-dim: #9DB8BF;

  --font-word: "Source Serif 4", Georgia, serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", sans-serif;

  --side: 272px;
  --lyrics: 360px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }
svg.i { width: 20px; height: 20px; flex: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Shell ---------- */
.app { height: 100%; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.app.with-lyrics { grid-template-columns: var(--side) minmax(0, 1fr) var(--lyrics); }

/* ---------- Sidebar ---------- */
.side { background: var(--deep-teal); color: var(--on-teal); display: flex; flex-direction: column; gap: 22px; padding: 24px 14px 18px max(14px, env(safe-area-inset-left, 0px)); overflow-y: auto; min-height: 0; }
.wordmark { font-family: var(--font-word); font-weight: 680; font-variation-settings: "opsz" 60; color: var(--parchment); letter-spacing: -.012em; line-height: 1; white-space: nowrap; display: inline-flex; align-items: baseline; font-size: 34px; padding: 0 10px; }
.wordmark .o { width: .54em; height: .54em; color: var(--sky-blue); transform: translateY(.05em); margin: 0 .01em 0 .004em; flex: none; }
.side nav { display: grid; gap: 2px; }
.nav-btn { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 15.5px; color: var(--on-teal); text-align: left; width: 100%; }
.nav-btn:hover { background: var(--teal-2); color: var(--white); }
.nav-btn[aria-current="page"] { background: var(--teal-3); color: var(--white); }
.nav-btn[aria-current="page"] svg { color: var(--ochre); }
.side h4 { margin: 0; padding: 0 12px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--on-teal-dim); font-weight: 600; }
.side-list { display: grid; gap: 2px; }
.side-item { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 10px; text-align: left; width: 100%; }
.side-item:hover { background: var(--teal-2); }
.side-item[aria-current="page"] { background: var(--teal-3); }
.side-item b { display: block; font-weight: 600; color: var(--white); font-size: 15px; line-height: 1.25; }
.side-item small { color: var(--on-teal-dim); font-size: 13px; }
.side-item .saved-ico { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--sky-blue), var(--deep-teal) 90%); box-shadow: inset 0 0 0 1px rgba(250,243,227,.18); color: var(--white); }
.campus { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid rgba(250, 243, 227, .14); font-size: 13px; color: var(--on-teal-dim); display: grid; gap: 2px; }
.campus b { color: var(--parchment); font-weight: 600; font-size: 14px; }
.campus-links { display: flex; gap: 14px; margin-top: 8px; }
.campus-links a { color: var(--on-teal); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(250,243,227,.3); text-underline-offset: 4px; }
.campus-links a:hover { color: var(--white); }
.wordmark { text-decoration: none; }
.avatar { cursor: pointer; border: 0; font: inherit; font-weight: 700; font-size: 14px; }
/* Account view */
.acct { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.acct-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.acct-card h2 { font-size: 24px; color: var(--deep-teal); }
.acct-card dl { margin: 0; display: grid; }
.acct-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.acct-card dt { color: var(--muted); }
.acct-card dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.staff { list-style: none; margin: 0; padding: 0; display: grid; }
.staff li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.staff .ini { width: 36px; height: 36px; border-radius: 50%; background: var(--parchment); color: var(--deep-teal); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.staff small { display: block; color: var(--muted); font-size: 13px; }
.staff .role { font-size: 12.5px; font-weight: 700; color: var(--deep-teal); background: var(--parchment); padding: 4px 10px; border-radius: 999px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-btn { height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; text-decoration: none; }
.pill-btn.gold { background: var(--ochre); color: var(--white); }
.pill-btn.line { border: 1.5px solid var(--line); color: var(--deep-teal); background: var(--white); }
.acct-note { font-size: 13.5px; color: var(--muted); }
@media (max-width: 1000px) { .acct { grid-template-columns: 1fr; } }

/* ---------- Covers (era "albums") ---------- */
.cover { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 10px; background: var(--c-bg); color: var(--c-ink); display: block; box-shadow: 0 1px 0 rgba(0,0,0,.04); max-width: 100%; }
.cover .ring { position: absolute; width: 74%; height: 74%; right: -17%; top: -17%; color: var(--c-ring); opacity: .9; }
.cover .num { position: absolute; left: 9%; top: 9%; font-family: var(--font-display); font-size: 1em; letter-spacing: .08em; opacity: .85; }
.cover .ct { position: absolute; left: 9%; right: 9%; bottom: 9%; font-family: var(--font-display); font-weight: 600; font-size: 1.45em; line-height: 1.02; }
.cover .brand { position: absolute; left: 9%; bottom: calc(9% + 2.3em); font-family: var(--font-word); font-weight: 680; font-size: .72em; letter-spacing: .01em; opacity: .7; }
.cover.sm { border-radius: 6px; }
.cover.sm .num, .cover.sm .ct, .cover.sm .brand { display: none; }
.cover.sm .ring { width: 120%; height: 120%; right: -38%; top: auto; bottom: -38%; }
.c-ancient { --c-bg: var(--ochre); --c-ink: var(--ink); --c-ring: var(--deep-teal); }
.c-medieval { --c-bg: var(--deep-teal); --c-ink: var(--parchment); --c-ring: var(--sky-blue); }
.c-early { --c-bg: var(--coral); --c-ink: var(--white); --c-ring: var(--parchment); }
.c-modern { --c-bg: var(--sage); --c-ink: var(--ink); --c-ring: var(--deep-teal); }
.c-timeline { --c-bg: var(--sky-blue); --c-ink: var(--ink); --c-ring: var(--parchment); }

/* ---------- Main ---------- */
.main { min-width: 0; min-height: 0; overflow-y: auto; position: relative; background: var(--paper); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px max(28px, env(safe-area-inset-left, 0px)); background: rgba(253, 249, 239, .9); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.search { flex: 1; max-width: 460px; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 46px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); padding: 0 18px 0 44px; color: var(--ink); font-size: 15.5px; }
.search input:focus { outline: none; border-color: var(--sky-blue); box-shadow: 0 0 0 4px rgba(72, 163, 182, .18); }
.topbar .spacer { flex: 1; }
.chip-btn { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--parchment); color: var(--deep-teal); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--deep-teal); color: var(--parchment); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.view { padding: 8px max(16px, env(safe-area-inset-right, 0px)) 48px max(28px, env(safe-area-inset-left, 0px)); display: grid; gap: 40px; }

.greet { display: grid; gap: 6px; padding-top: 12px; }
.greet h1 { font-size: clamp(32px, 3.4vw, 44px); color: var(--deep-teal); }
.greet p { color: var(--muted); font-size: 17px; }

.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.row-head h2 { font-size: 26px; color: var(--deep-teal); }
.row-head .link { font-weight: 600; font-size: 14px; color: var(--muted); }
.row-head .link:hover { color: var(--deep-teal); text-decoration: underline; }

/* Quick tiles (Spotify's top grid) */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding-right: 12px; text-align: left; transition: background-color .15s, box-shadow .15s; min-width: 0; }
.tile:hover { box-shadow: 0 14px 28px -18px rgba(22, 78, 99, .45); }
.tile .cover { width: 72px; border-radius: 0; }
.tile .t { min-width: 0; }
.tile b { display: block; font-weight: 600; font-size: 15.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { color: var(--muted); font-size: 13px; }
.fab { width: 44px; height: 44px; border-radius: 50%; background: var(--ochre); color: var(--white); display: grid; place-items: center; box-shadow: 0 8px 18px -8px rgba(160, 110, 10, .7); transition: transform .15s, opacity .15s; flex: none; }
.fab:hover { transform: scale(1.06); background: #D69A20; }
.fab svg { width: 20px; height: 20px; }
.tile .fab { opacity: 0; transform: translateY(4px); }
.tile:hover .fab, .tile:focus-within .fab, .tile.is-current .fab { opacity: 1; transform: none; }

/* Album cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.card { display: grid; gap: 12px; padding: 12px; border-radius: 14px; text-align: left; align-content: start; transition: background-color .15s; position: relative; min-width: 0; }
.card:hover { background: var(--parchment); }
.card .cover { font-size: clamp(14px, 1.3vw, 18px); box-shadow: 0 16px 30px -20px rgba(22, 78, 99, .55); }
.card .fab { position: absolute; right: 22px; top: calc(12px + (100% - 24px) * 0 + 0px); opacity: 0; transform: translateY(8px); }
.card .cover-wrap { position: relative; }
.card .cover-wrap .fab { top: auto; bottom: 10px; right: 10px; }
.card:hover .fab, .card:focus-within .fab { opacity: 1; transform: none; }
.card b { font-weight: 600; font-size: 16px; color: var(--ink); }
.card small { color: var(--muted); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Era (playlist) view ---------- */
.era-hero { display: grid; grid-template-columns: 232px 1fr; gap: 32px; align-items: end; padding: 28px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(28px, env(safe-area-inset-left, 0px))); padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: linear-gradient(180deg, var(--c-tint) 0%, var(--paper) 100%); }
.era-hero .cover { font-size: 22px; box-shadow: 0 30px 50px -26px rgba(22, 78, 99, .6); }
.era-hero .meta { display: grid; gap: 10px; min-width: 0; }
.era-hero .kind { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--deep-teal); }
.era-hero h1 { font-size: clamp(40px, 5.4vw, 76px); line-height: 1; color: var(--deep-teal); }
.era-hero p { color: var(--ink); font-size: 17px; }
.era-hero .facts { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.era-hero .facts b { color: var(--deep-teal); }
.t-ancient { --c-tint: #F6DFA8; }
.t-medieval { --c-tint: #BFD6DD; }
.t-early { --c-tint: #F2C6B8; }
.t-modern { --c-tint: #D3E4D7; }
.t-timeline { --c-tint: #CFE6EC; }

.actions { display: flex; align-items: center; gap: 18px; }
.actions .fab { width: 60px; height: 60px; opacity: 1; transform: none; }
.actions .fab svg { width: 26px; height: 26px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--deep-teal); background: var(--parchment); }
.icon-btn.on { color: var(--coral); }
.icon-btn svg { width: 24px; height: 24px; }

/* Track table */
.tracks { display: grid; }
.tr .wk { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) 200px 130px 40px 56px; gap: 14px; align-items: center; padding: 8px 12px; border-radius: 10px; min-width: 0; }
.tr.head { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); border-radius: 0; padding-bottom: 10px; margin-bottom: 8px; }
.tr.song { cursor: pointer; }
.tr.song:hover { background: var(--parchment); }
.tr.song.is-current .ttl { color: var(--deep-teal); }
.tr.song.is-current { background: rgba(72, 163, 182, .1); }
.tr .idx { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; position: relative; height: 24px; display: grid; place-items: center; }
.tr .idx .pi { display: none; color: var(--deep-teal); }
.tr.song:hover .idx .n { display: none; }
.tr.song:hover .idx .pi { display: block; }
.tr .who { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; }
.tr .who .cover { width: 44px; }
.tr .ttl { display: block; font-weight: 600; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .sub { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .wk, .tr .gr { color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tr .wk b { color: var(--deep-teal); font-weight: 600; }
.tr .len { color: var(--muted); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.heart { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); opacity: 0; border-radius: 50%; }
.heart svg { width: 18px; height: 18px; }
.tr.song:hover .heart, .heart.on, .heart:focus-visible { opacity: 1; }
.heart.on { color: var(--coral); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--sky-blue); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; } .eq i:nth-child(3) { animation-delay: -.7s; }
.eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

.note { font-size: 13.5px; color: var(--muted); padding: 16px 12px 0; }

/* Search view */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { height: 36px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); font-weight: 600; font-size: 14px; color: var(--deep-teal); }
.filter[aria-pressed="true"] { background: var(--deep-teal); border-color: var(--deep-teal); color: var(--parchment); }
.browse { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.browse-card { position: relative; overflow: hidden; height: 132px; border-radius: 14px; background: var(--c-bg); color: var(--c-ink); padding: 18px; text-align: left; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.05; }
.browse-card svg { position: absolute; right: -24px; bottom: -30px; width: 120px; height: 120px; color: var(--c-ring); transform: rotate(18deg); }
.empty { padding: 40px 12px; color: var(--muted); font-size: 16px; }

/* ---------- Lyrics panel ---------- */
.lyrics { background: var(--parchment); border-left: 1px solid var(--line); min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.lyrics[hidden] { display: none !important; }
.lyr-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 12px 24px; background: var(--parchment); z-index: 1; }
.lyr-head h3 { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--deep-teal); }
.lyr-song { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 4px 24px 18px; }
.lyr-song .cover { width: 64px; }
.lyr-song b { display: block; font-family: var(--font-display); font-size: 21px; font-weight: 500; color: var(--deep-teal); line-height: 1.15; }
.lyr-song small { color: var(--muted); font-size: 14px; }
.lyr-lines { padding: 6px 24px 24px; display: grid; gap: 14px; }
.lyr-lines p { font-family: var(--font-display); font-size: 25px; line-height: 1.3; color: rgba(22, 78, 99, .32); transition: color .3s; }
.lyr-lines p.past { color: rgba(22, 78, 99, .55); }
.lyr-lines p.now { color: var(--deep-teal); }
.teacher-note { margin: auto 18px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 6px; font-size: 14.5px; color: var(--ink); }
.teacher-note b { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }

/* ---------- Player bar ---------- */
.player { grid-column: 1 / -1; background: var(--teal-3); color: var(--on-teal); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); border-top: 1px solid rgba(250, 243, 227, .08); }
.np { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-width: 0; }
.np .cover { width: 58px; }
.np b { display: block; color: var(--white); font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np small { display: block; color: var(--on-teal-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np .heart { opacity: 1; color: var(--on-teal-dim); }
.np .heart.on { color: var(--coral); }
.ctrl { display: grid; gap: 6px; justify-items: center; }
.ctrl-btns { display: flex; align-items: center; gap: 22px; }
.ctrl-btns .sm-btn { color: var(--on-teal); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.ctrl-btns .sm-btn:hover { color: var(--white); }
.ctrl-btns .sm-btn.on { color: var(--ochre); }
.play-main { width: 44px; height: 44px; border-radius: 50%; background: var(--parchment); color: var(--deep-teal); display: grid; place-items: center; transition: transform .15s; }
.play-main:hover { transform: scale(1.06); }
.play-main svg { width: 20px; height: 20px; }
.scrub { width: 100%; max-width: 620px; display: grid; grid-template-columns: 42px 1fr 42px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--on-teal-dim); font-variant-numeric: tabular-nums; }
.scrub span:last-child { text-align: left; }
.scrub span:first-child { text-align: right; }
.bar { height: 6px; border-radius: 6px; background: rgba(250, 243, 227, .18); position: relative; cursor: pointer; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--parchment); }
.bar:hover i { background: var(--ochre); }
.extras { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.extras .sm-btn { color: var(--on-teal); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.extras .sm-btn:hover { color: var(--white); background: var(--teal-2); }
.extras .sm-btn.on { color: var(--ochre); }
.mini-bar { display: none; }

/* Mobile tabs */
.tabs { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app.with-lyrics { grid-template-columns: var(--side) minmax(0, 1fr); } .app.with-lyrics .lyrics { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--lyrics), 100%); z-index: 30; box-shadow: -20px 0 50px -20px rgba(22, 78, 99, .5); padding-bottom: 96px; } }
@media (max-width: 1000px) { .tr { grid-template-columns: 36px minmax(0, 1fr) 150px 40px 50px; } .tr .gr { display: none; } .vol { display: none; } }
@media (max-width: 820px) {
  :root { --side: 0px; }
  body { font-size: 15px; }
  .app, .app.with-lyrics { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }
  .side { display: none; }
  .topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .view { padding-left: max(16px, env(safe-area-inset-left, 0px)); gap: 32px; }
  .topbar .chip-btn, .topbar .spacer { display: none; }
  .search { max-width: none; }
  .quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .tile { grid-template-columns: 56px 1fr; padding-right: 8px; }
  .tile .cover { width: 56px; }
  .tile .fab { display: none; }
  .tile b { font-size: 14px; }
  .tile small { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 6px; }
  .era-hero { grid-template-columns: 1fr; gap: 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); }
  .era-hero .cover { width: min(220px, 60vw); justify-self: center; }
  .tr { grid-template-columns: minmax(0, 1fr) 40px 44px; padding: 8px 4px; }
  .tr .idx, .tr .wk { display: none; }
  .tr.head { display: none; }
  .heart { opacity: 1; }
  .player { grid-column: 1; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px; margin: 0 8px; border-radius: 12px; background: var(--deep-teal); position: relative; overflow: hidden; }
  .np { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .np .cover { width: 44px; }
  .np .heart { display: none; }
  .ctrl { display: contents; }
  .ctrl-btns .sm-btn, .scrub, .extras .sm-btn:not(.lyr-toggle), .extras .vol { display: none; }
  .ctrl-btns { order: 3; gap: 4px; }
  .extras { order: 2; }
  .player { grid-template-columns: minmax(0, 1fr) auto auto; }
  .play-main { width: 40px; height: 40px; }
  .mini-bar { display: block; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: rgba(250, 243, 227, .2); }
  .mini-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--parchment); }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabs button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
  .tabs button[aria-current="page"] { color: var(--deep-teal); }
  .tabs button[aria-current="page"] svg { color: var(--ochre); }
  .app.with-lyrics .lyrics { position: fixed; inset: 0; width: auto; z-index: 40; padding-bottom: 24px; }
}
.mobile-brand { display: none !important; }
/* Guest preview mode */
.guest-bar { position: sticky; top: 74px; z-index: 4; margin: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--deep-teal); color: var(--parchment); box-shadow: 0 16px 30px -20px rgba(15, 63, 81, .7); }
.guest-bar[hidden] { display: none !important; }
.guest-bar svg { width: 26px; height: 26px; color: var(--ochre); flex: none; }
.guest-bar p { flex: 1; min-width: 220px; font-size: 14.5px; color: #D3E1E4; }
.guest-bar p b { color: var(--parchment); }
.guest-bar .gb-actions { display: flex; gap: 8px; }
.guest-bar a { height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; text-decoration: none; }
.guest-bar .gb-sub { background: var(--ochre); color: var(--ink); }
.guest-bar .gb-in { border: 1.5px solid rgba(250, 243, 227, .4); color: var(--parchment); }
.signin-pill { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--deep-teal); color: var(--parchment); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.signin-pill[hidden] { display: none !important; }
.lock-note { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--parchment); font-family: var(--font-body) !important; font-size: 14.5px !important; color: var(--ink) !important; }
.lock-note svg { width: 18px; height: 18px; color: var(--deep-teal); flex: none; }
.lock-note a { color: var(--deep-teal); font-weight: 700; }
.stage .lock-note { background: rgba(250, 243, 227, .1); color: var(--parchment) !important; }
.stage .lock-note a, .stage .lock-note svg { color: var(--ochre); }
.preview-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--parchment); color: var(--deep-teal); vertical-align: 2px; }
.np .preview-tag { background: rgba(250, 243, 227, .14); color: var(--parchment); }
@media (max-width: 820px) { .guest-bar { top: 66px; margin-left: max(16px, env(safe-area-inset-left, 0px)); } .guest-bar p { min-width: 0; } }

/* ===== Added: navigation back to the site, transport controls, song view, classroom display ===== */
.site-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--white); border: 1.5px solid var(--line); color: var(--deep-teal); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; flex: none; }
.site-link:hover { border-color: var(--deep-teal); }
.site-link svg { width: 18px; height: 18px; }
.ctrl-btns { gap: 14px; }
.ctrl-btns .sm-btn.skip svg { width: 24px; height: 24px; }
.bar { height: 6px; cursor: pointer; touch-action: none; }
.bar::after { content: ""; position: absolute; top: 50%; left: var(--p, 0%); width: 14px; height: 14px; border-radius: 50%; background: var(--parchment); transform: translate(-50%, -50%) scale(0); transition: transform .15s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.bar:hover::after, .bar:focus-visible::after, .bar.dragging::after { transform: translate(-50%, -50%) scale(1); }
.bar:focus-visible { outline-offset: 6px; }
.bar.dragging i, .bar:hover i { background: var(--ochre); }
.vol { -webkit-appearance: none; appearance: none; width: 110px; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--on-teal) var(--v, 80%), rgba(250, 243, 227, .18) var(--v, 80%)); cursor: pointer; }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--parchment); border: 0; }
.vol::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--parchment); border: 0; }
.np-title { display: block; color: var(--white); font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; max-width: 100%; }
.np-title:hover { text-decoration: underline; }
button.ttl { text-align: left; max-width: 100%; }
button.ttl:hover { text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: 3px; }
.actions .heart { opacity: 1; width: 44px; height: 44px; }
.actions .heart svg { width: 24px; height: 24px; }
.actions .pill-btn { gap: 8px; }
.song-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.lyr-first { font-family: var(--font-display); font-size: 24px; line-height: 1.35; color: var(--deep-teal); }
.tips { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--ink); }
.tips li::marker { color: var(--ochre); font-weight: 700; }
@media (max-width: 1000px) { .song-grid { grid-template-columns: 1fr; } }
.kbd-hint { font-size: 13px; color: var(--muted); }
.kbd-hint kbd { font: inherit; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--deep-teal); }
.fab { color: var(--ink); }
.pill-btn.gold { color: var(--ink); }

/* Cover art and lyrics */
.cover.art { background: var(--parchment); }
.cover.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lyr-lines h4, .lyr-full h4, .stage-lyrics h4 { margin: 10px 0 0; font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--coral); }
.lyr-lines h4:first-child, .lyr-full h4:first-child { margin-top: 0; }
.lyr-lines .gap, .lyr-full .gap { display: block; height: 4px; }
.lyr-lines.full { gap: 6px; }
.lyr-lines.full p { font-size: 20px; line-height: 1.4; color: var(--deep-teal); }
.lyr-full { display: grid; gap: 4px; }
.lyr-full p { font-family: var(--font-display); font-size: 19px; line-height: 1.45; color: var(--deep-teal); }
.lyr-card { grid-row: span 2; }
.stage-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(48px) saturate(1.15); opacity: .3; pointer-events: none; }
.stage-art:empty { display: none; }
.stage-art img { width: clamp(84px, 11vw, 140px); aspect-ratio: 1; border-radius: 18px; object-fit: cover; display: block; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6); }
.stage-lyrics.full { max-height: 40vh; overflow-y: auto; columns: 2 300px; column-gap: 56px; text-align: left; width: min(980px, 100%); padding: 6px 12px; scrollbar-width: thin; }
.stage-lyrics.full p { font-size: clamp(20px, 2.1vw, 30px); line-height: 1.35; break-inside: avoid; }
.stage-lyrics.full h4 { color: #F2B9A8; break-after: avoid; margin-top: 14px; }
.stage-lyrics.full .gap { display: block; height: 8px; }
.stage:has(.stage-lyrics.full) h2 { font-size: clamp(34px, 4.6vw, 72px); }

/* Classroom display: full-screen sing-along */
.stage { position: fixed; inset: 0; z-index: 80; background: radial-gradient(120% 90% at 85% 10%, #22657D 0%, var(--deep-teal) 45%, var(--teal-3) 100%); color: var(--parchment); display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); overflow: hidden; }
.stage[hidden] { display: none !important; }
.stage-ring { position: absolute; width: min(70vw, 760px); height: min(70vw, 760px); right: -14vw; bottom: -18vw; color: var(--sky-blue); opacity: .16; pointer-events: none; }
.stage-top { position: absolute; top: max(18px, env(safe-area-inset-top, 0px)); left: max(20px, env(safe-area-inset-left, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stage-top .wordmark { font-size: 30px; padding: 0; }
.stage-close { width: 48px; height: 48px; border-radius: 50%; background: rgba(250, 243, 227, .12); color: var(--parchment); display: grid; place-items: center; }
.stage-close:hover { background: rgba(250, 243, 227, .22); }
.stage-inner { position: relative; z-index: 1; width: min(1100px, 100%); display: grid; gap: clamp(18px, 3vh, 34px); text-align: center; justify-items: center; }
.stage-era { font-size: clamp(13px, 1.2vw, 16px); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #A9D5DF; }
.stage h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(40px, 6.4vw, 104px); line-height: 1.02; color: var(--parchment); }
.stage-lyrics { display: grid; gap: 10px; }
.stage-lyrics p { font-family: var(--font-display); font-size: clamp(24px, 3.2vw, 50px); line-height: 1.25; color: var(--parchment); }
.stage-lyrics .soon { font-family: var(--font-body); font-size: clamp(16px, 1.5vw, 20px); color: #A9D5DF; }
.stage-ctrl { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 26px); }
.stage-ctrl button { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--parchment); }
.stage-ctrl button:hover { background: rgba(250, 243, 227, .12); }
.stage-ctrl button svg { width: 30px; height: 30px; }
.stage-ctrl .stage-play { width: clamp(76px, 8vw, 96px); height: clamp(76px, 8vw, 96px); background: var(--ochre); color: var(--ink); }
.stage-ctrl .stage-play:hover { background: #EBB54A; }
.stage-ctrl .stage-play svg { width: 38px; height: 38px; }
.stage-scrub { width: min(720px, 100%); display: grid; grid-template-columns: 52px 1fr 52px; gap: 14px; align-items: center; font-variant-numeric: tabular-nums; color: #A9D5DF; font-size: 15px; }
.stage-scrub .bar { height: 8px; }
@media (max-width: 820px) { .np { cursor: pointer; } .stage-ctrl button { width: 48px; height: 48px; } }
@media (max-width: 820px) { .topbar .site-link span { display: none; } .topbar .site-link { padding: 0 10px; } }
