/* Frosted-glass web treatment. Song text stays on a calm, high-contrast surface. */
html { scroll-behavior: smooth; }
body { min-height: 100dvh; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Library: one featured song, followed by a compact two-column collection. */
.library-page {
  --lg-ink: #193a37;
  --lg-muted: #52716b;
  --lg-accent: #075f55;
  --lg-glass: rgba(255,255,255,.69);
  --lg-glass-strong: rgba(255,255,255,.82);
  --lg-line: rgba(255,255,255,.72);
  --lg-shadow: 0 18px 50px rgba(21,69,60,.09);
  background:
    radial-gradient(ellipse 760px 450px at 4% 4%, rgba(153,207,189,.55), transparent 70%),
    radial-gradient(ellipse 620px 490px at 98% 24%, rgba(194,218,224,.66), transparent 72%),
    linear-gradient(155deg,#eaf3ee 0%,#f5f4ea 54%,#e7f0ed 100%);
  color: var(--lg-ink);
}
.library-page .top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(243,250,246,.7);
  border-bottom: 1px solid var(--lg-line);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.library-page .brand { letter-spacing: -.035em; font-size: 22px; }
.library-page .mark { border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.38); }
.library-page .navlinks a { padding: 10px 0; }
.library-page .hero {
  margin-top: 32px; padding: clamp(30px,5vw,60px);
  border: 1px solid var(--lg-line); border-radius: 32px;
  background: linear-gradient(125deg,rgba(255,255,255,.78),rgba(255,255,255,.35));
  box-shadow: var(--lg-shadow), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.library-page .eyebrow { letter-spacing: .13em; color: var(--lg-accent); }
.library-page .hero h1 { max-width: 12ch; color: #143c38; font-size: clamp(43px,5.5vw,70px); }
.library-page .hero p { color: var(--lg-muted); font-size: 16px; max-width: 56ch; }
.library-page .hero-art {
  height: 270px; border: 1px solid rgba(255,255,255,.38); border-radius: 28px;
  background: radial-gradient(circle at 75% 20%,#e6c979 0 15%,transparent 15.5%),linear-gradient(135deg,#0e4b45,#3d8179 55%,#90b6a9);
  box-shadow: 0 20px 44px rgba(12,69,60,.2), inset 0 1px 0 rgba(255,255,255,.35);
}
.library-page .section { padding-top: 54px; }
.library-page .section-head { align-items: center; margin-bottom: 20px; }
.library-page .section h2 { font-size: 30px; letter-spacing: -.04em; }
.library-page .count { color: var(--lg-muted); }
.library-page .filters {
  margin-bottom: 25px; padding: 12px; border: 1px solid var(--lg-line); border-radius: 21px;
  background: var(--lg-glass); box-shadow: 0 9px 26px rgba(18,65,56,.06), inset 0 1px 0 rgba(255,255,255,.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.library-page .filters input,.library-page .filters select {
  background: rgba(255,255,255,.7); border-color: rgba(74,120,106,.16);
  color: var(--lg-ink); border-radius: 12px;
}
.library-page .song-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.library-page .song-card {
  min-width: 0; grid-template-columns: 126px minmax(0,1fr); grid-template-rows: 1fr auto;
  gap: 12px 19px; padding: 18px; border: 1px solid var(--lg-line); border-radius: 25px;
  background: var(--lg-glass); box-shadow: var(--lg-shadow), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.library-page .song-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.98); box-shadow: 0 24px 58px rgba(21,69,60,.15), inset 0 1px 0 #fff; }
.library-page .cover { height: 143px; border-radius: 17px; }
.library-page .cover::before { top: 40px; left: 45px; }
.library-page .cover strong { font-size: 23px; bottom: 15px; }
.library-page .cover span { left: 15px; top: 15px; font-size: 10px; }
.library-page .song-card h3 { font-size: 25px; letter-spacing: -.04em; margin-bottom: 5px; }
.library-page .artist { font-size: 14px; margin-bottom: 11px; color: var(--lg-muted); }
.library-page .pills { gap: 5px; margin-bottom: 11px; }
.library-page .pill { font-size: 11px; padding: 5px 8px; background: rgba(226,242,233,.8); }
.library-page .desc { font-size: 13px; color: var(--lg-muted); }
.library-page .start { grid-column: 2; justify-self: start; padding: 10px 14px; border-radius: 11px; background: var(--lg-accent); font-size: 12px; }
.library-page .song-card:first-child { grid-column: 1/-1; grid-template-columns: 190px minmax(0,1fr) auto; grid-template-rows: auto; gap: 23px; align-items: center; padding: 20px; }
.library-page .song-card:first-child .cover { height: 190px; }
.library-page .song-card:first-child .cover strong { font-size: 31px; }
.library-page .song-card:first-child h3 { font-size: 32px; }
.library-page .song-card:first-child .start { grid-column: 3; }
.library-page .note { color: var(--lg-muted); }
.library-page .credits-footer { background: rgba(229,241,234,.73); border-color: var(--lg-line); }

/* Learning pages: glass around controls; translucent paper behind the lyrics. */
.learning-page {
  --glass-paper: rgba(255,255,255,.77);
  --glass-control: rgba(255,255,255,.72);
  --glass-rim: rgba(255,255,255,.68);
  --glass-shadow: 0 18px 55px rgba(18,61,52,.09);
  background:
    radial-gradient(ellipse 740px 430px at 3% 2%, color-mix(in srgb,var(--soft) 80%,transparent), transparent 72%),
    radial-gradient(ellipse 720px 520px at 96% 23%, color-mix(in srgb,var(--soft) 85%,transparent), transparent 72%),
    var(--page);
}
.learning-page[data-theme="night"] { --glass-paper:rgba(33,51,58,.88);--glass-control:rgba(37,58,65,.84);--glass-rim:rgba(151,207,198,.21);--glass-shadow:0 20px 55px rgba(0,0,0,.2); }
.learning-page .top {
  position: sticky; top: 0; z-index: 6; background: var(--glass-control);
  border-bottom: 1px solid var(--glass-rim);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25);
}
.learning-page .brand { letter-spacing: -.035em; }
.learning-page .hero {
  margin: 28px 0 22px; padding: 24px; border: 1px solid var(--glass-rim); border-radius: 28px;
  background: linear-gradient(125deg,var(--glass-paper),var(--glass-control));
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.53);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.learning-page .hero h1 { font-size: clamp(35px,5vw,60px); }
.learning-page .cover { background: radial-gradient(circle at 83% 15%,rgba(255,255,255,.28),transparent 30%),linear-gradient(145deg,var(--cover-start),var(--cover-end)); }
.learning-page .intro { max-width: 70ch; font-size: 15px; }
.learning-page .toolbar {
  top: 82px; border: 1px solid var(--glass-rim); border-radius: 18px;
  background: var(--glass-control); box-shadow: 0 14px 35px rgba(13,51,44,.11),inset 0 1px 0 rgba(255,255,255,.56);
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
}
.learning-page .source-tabs { background: var(--soft); }
.learning-page .toggle,.learning-page .stop,.learning-page .upload,.learning-page .theme-switch button[aria-pressed=true] { border-radius: 10px; }
.learning-page .full-lyrics {
  max-width: 900px; margin-top: 26px; padding: 43px 48px; border: 1px solid var(--glass-rim); border-radius: 27px;
  background: var(--glass-paper); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.learning-page .full-title { letter-spacing: .11em; font-weight: 750; margin-bottom: 28px; }
.learning-page .full-item { border-radius: 12px; padding: 4px 7px; transition: background .18s ease; }
.learning-page .full-item:hover { background: color-mix(in srgb,var(--soft) 45%,transparent); }
.learning-page .full-item.stanza-break { margin-top: 26px; padding-top: 23px; }
.learning-page .full-row { padding: 6px 0; }
.learning-page .full-lyrics .han,.learning-page .full-lyrics .word-han { font-weight: 520; }
.learning-page .full-listen { border-radius: 50%; background: var(--soft); }
.learning-page .daily-button { border-radius: 999px; }
.learning-page .daily-panel { border: 1px solid var(--glass-rim); }
.learning-page dialog { border: 1px solid var(--glass-rim); background: var(--glass-paper); backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px); }
.learning-page .credits-footer { background: var(--glass-control); border-color: var(--glass-rim); color: var(--muted); }
.learning-page .credits-footer strong,.learning-page .credits-heading { color: var(--ink); }
.learning-page .credits-footer a { color: var(--accent); }

@media (max-width: 900px) {
  .library-page .song-list { grid-template-columns: 1fr; }
  .library-page .song-card:first-child { grid-template-columns: 160px minmax(0,1fr) auto; }
  .library-page .song-card:first-child .cover { height: 160px; }
}
@media (max-width: 660px) {
  .library-page .top,.learning-page .top { position: static; }
  .library-page .hero { margin-top: 14px; padding: 26px 21px; border-radius: 23px; }
  .library-page .hero h1 { font-size: clamp(38px,10vw,54px); }
  .library-page .hero p { font-size: 14px; }
  .library-page .section { padding-top: 39px; }
  .library-page .section-head { display: block; }
  .library-page .section h2 { margin-bottom: 3px; }
  .library-page .filters { padding: 9px; gap: 8px; border-radius: 17px; }
  .library-page .song-card,.library-page .song-card:first-child { grid-column: auto; grid-template-columns: 95px minmax(0,1fr); grid-template-rows: auto auto; gap: 10px 14px; padding: 13px; border-radius: 20px; }
  .library-page .cover,.library-page .song-card:first-child .cover { height: 104px; }
  .library-page .cover strong,.library-page .song-card:first-child .cover strong { font-size: 17px; }
  .library-page .cover span { font-size: 8px; }
  .library-page .song-card h3,.library-page .song-card:first-child h3 { font-size: 21px; }
  .library-page .artist { font-size: 12px; }
  .library-page .pills { margin-bottom: 7px; }
  .library-page .desc { font-size: 12px; }
  .library-page .start,.library-page .song-card:first-child .start { grid-column: 1/-1; justify-self: stretch; justify-content: center; min-height: 42px; }
  .learning-page .hero { margin: 14px 0 17px; padding: 16px; border-radius: 20px; }
  .learning-page .hero h1 { font-size: clamp(31px,9vw,39px); }
  .learning-page .toolbar { position: static; border-radius: 17px; margin: 0 0 15px; }
  .learning-page .full-lyrics { margin: 20px -17px 32px; padding: 23px 16px; border-radius: 0; border-left: 0; border-right: 0; }
  .learning-page .full-item { padding: 4px 0; }
  .learning-page .full-item:hover { background: transparent; }
  .learning-page .full-row { display: block; }
}
@media (prefers-color-scheme: dark) {
  .library-page {
    --lg-ink:#e5f4ed;--lg-muted:#b0c9bf;--lg-accent:#88ddc2;
    --lg-glass:rgba(25,49,47,.78);--lg-glass-strong:rgba(29,53,51,.89);
    --lg-line:rgba(176,221,204,.18);--lg-shadow:0 18px 50px rgba(0,0,0,.2);
    background:radial-gradient(ellipse 740px 440px at 4% 0%,rgba(41,91,81,.48),transparent 70%),linear-gradient(155deg,#162b2c,#213b3a);
  }
  .library-page .top { background:rgba(24,48,45,.8); }
  .library-page .hero { background:linear-gradient(125deg,rgba(39,68,63,.82),rgba(30,58,56,.66)); }
  .library-page .hero h1,.library-page .song-card h3 { color:var(--lg-ink); }
  .library-page .filters input,.library-page .filters select { background:rgba(26,51,48,.82); color:var(--lg-ink); border-color:var(--lg-line); }
  .library-page .song-card,.library-page .filters { box-shadow:var(--lg-shadow),inset 0 1px 0 rgba(255,255,255,.14); }
  .library-page .pill { background:rgba(64,105,84,.72); color:#d5f1dd; }
  .library-page .pill.gold { background:rgba(128,98,43,.6);color:#ffe6a1; }
  .library-page .start { color:#173b34; background:#9de1c6; }
  .library-page .credits-footer { background:rgba(22,43,39,.89);color:var(--lg-muted); }
  .library-page .credits-heading,.library-page .credits-footer strong { color:var(--lg-ink); }
  .library-page .credits-footer a { color:var(--lg-accent); }
}
@supports not (backdrop-filter: blur(1px)) {
  .library-page .top,.library-page .hero,.library-page .filters,.library-page .song-card { background:var(--lg-glass-strong); }
  .learning-page .top,.learning-page .toolbar,.learning-page .hero,.learning-page .full-lyrics,.learning-page dialog { background:var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .library-page .top,.library-page .hero,.library-page .filters,.library-page .song-card { background:var(--lg-glass-strong);backdrop-filter:none;-webkit-backdrop-filter:none; }
  .learning-page .top,.learning-page .toolbar,.learning-page .hero,.learning-page .full-lyrics,.learning-page dialog { background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  .library-page .song-card,.learning-page .full-item { transition:none; }
  .library-page .song-card:hover { transform:none; }
}

.learning-page .full-lyrics [data-reading-index].is-reading {
  color:#ad6455;
}
.learning-page .full-lyrics .han,
.learning-page .full-lyrics .word-han span,
.learning-page .full-lyrics .jp {
  transition:color .18s ease;
}
@media (prefers-reduced-motion: reduce) {
  .learning-page .full-lyrics .han,
  .learning-page .full-lyrics .word-han span,
  .learning-page .full-lyrics .jp { transition:none; }
}

/* Let the song and lyrics sit directly on the page rather than in cards. */
.learning-page .hero {
  margin: 14px 0 0;
  padding: 20px 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.learning-page .full-lyrics {
  max-width: 900px;
  margin: 0 auto 28px;
  padding: 12px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.learning-page .full-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.learning-page .intro { margin-top: 20px; }
.learning-page .toolbar { position: static; margin-top: 18px; }
@media (max-width:660px) {
  .learning-page .hero { margin: 0; padding: 20px 0 12px; border-radius: 0; }
  .learning-page .full-lyrics { margin: 0 0 24px; padding: 8px 0 0; border: 0; border-radius: 0; }
}

/* Keep the catalogue compact and put the first learning action in view. */
.library-page .hero { margin-top: 18px; padding: clamp(24px,4vw,42px); }
.library-page .hero-art { height: 205px; }
.library-page .hero h1 { font-weight: 600; }
.library-page .hero-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  padding: 11px 16px; border-radius: 11px; background: var(--lg-accent);
  color: #fff; font-size: 14px; font-weight: 650;
}
.library-page .hero-cta:hover,.library-page .hero-cta:focus-visible { background: #124b42; }
.library-page .section { padding-top: 30px; }
.library-page .song-card h3 { font-weight: 600; }
.library-page .pills { margin-bottom: 0; }

/* Keep the song heading and lyrics restrained. */
.learning-page .back { font-weight: 600; }
.learning-page .brand { font-weight: 600; }
.learning-page .hero h1 { font-weight: 600; }
.learning-page .tag { font-weight: 600; }
.learning-page { --jyutping-link: #3184ed; }
.learning-page[data-theme="ocean"] { --jyutping-link: #3184ed; }
.learning-page[data-theme="clay"] { --jyutping-link: #3184ed; }
.learning-page[data-theme="night"] { --jyutping-link: #9bccff; }
.learning-page .full-lyrics .jp,.learning-page .full-lyrics .word-group .jp {
  color: var(--jyutping-link);
  font-weight: 600;
}
.learning-page .full-lyrics .han,.learning-page .full-lyrics .word-han { font-weight: 400; }
.learning-page .daily-button,.learning-page .toggle,.learning-page .stop,.learning-page .upload { font-weight: 600; }
.learning-page .full-characters,.learning-page .full-row { min-width: 0; }

/* Song controls share the heading row without bringing back a card. */
.learning-page .hero {
  grid-template-columns: 112px minmax(180px,.7fr) minmax(0,1.65fr);
  gap: 20px;
  align-items: center;
}
.learning-page .hero .cover { height: 112px; }
.learning-page .hero h1 { font-size: clamp(28px,3.2vw,40px); margin: 4px 0; }
.learning-page .hero .meta { font-size: 13px; margin-bottom: 8px; }
.learning-page .hero .toolbar {
  min-width: 0; margin: 0; padding: 0; position: static;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  gap: 6px;
}
.learning-page .hero .toolbar strong { display: none; }
.learning-page .hero .theme-switch { width: auto; gap: 2px; }
.learning-page .hero .theme-switch button { padding: 6px; font-size: 11px; }
.learning-page .hero .source-tabs button { padding: 7px 9px; font-size: 12px; }
.learning-page .hero .toggle,.learning-page .hero .stop,.learning-page .hero .upload { padding: 7px 9px; font-size: 12px; }

@media (max-width:900px) {
  .learning-page .hero { grid-template-columns: 90px minmax(0,1fr); }
  .learning-page .hero .cover { height: 90px; }
  .learning-page .hero .toolbar { grid-column: 1 / -1; }
}

@media (max-width:660px) {
  .library-page .hero { margin-top: 10px; padding: 22px 18px; }
  .library-page .hero h1 { font-size: clamp(34px,9vw,46px); }
  .library-page .hero-art { height: 155px; }
  .library-page .hero-cta { margin-top: 16px; font-size: 13px; }
  .library-page .section { padding-top: 24px; }
  .learning-page .nav { gap: 8px; }
  .learning-page .brand { font-size: 16px; white-space: nowrap; }
  .learning-page .back { font-size: 12px; white-space: nowrap; }
  .learning-page .back { margin-left: 4px; }
  .learning-page .hero { grid-template-columns: 70px minmax(0,1fr); gap: 12px; }
  .learning-page .cover { height: 74px; }
  .learning-page .hero h1 { font-size: clamp(27px,8vw,34px); }
  .learning-page .eyebrow { font-size: 10px; }
  .learning-page .meta { font-size: 12px; overflow-wrap: anywhere; }
  .learning-page .tag { font-size: 10px; padding: 4px 7px; }
  .learning-page .full-lyrics .han,.learning-page .full-lyrics .word-han { font-size: 20px; min-height: 38px; }
  .learning-page .full-lyrics .char { min-width: 31px; }
  .learning-page .full-lyrics .word-group { min-width: 0; max-width: 100%; }
  .learning-page .full-lyrics .word-han { white-space: nowrap; }
  .learning-page .full-lyrics .jp,.learning-page .full-lyrics .word-group .jp {
    font-size: 8px; min-height: 24px; white-space: nowrap;
  }
  .learning-page .full-actions { justify-content: flex-start; margin-top: 2px; }
  .learning-page .hero { grid-template-columns: 70px minmax(0,1fr); gap: 10px 12px; }
  .learning-page .hero .cover { height: 74px; }
  .learning-page .hero h1 { font-size: clamp(25px,7vw,31px); }
  .learning-page .hero .toolbar { gap: 6px; }
  .learning-page .hero .source-tabs { width: auto; }
  .learning-page .hero .source-tabs button { min-height: 36px; }
  .learning-page .hero .theme-switch { width: auto; }
  .learning-page .hero .theme-switch button { min-height: 36px; }
  .learning-page .hero .toggle,.learning-page .hero .stop,.learning-page .hero .upload { min-height: 36px; }
}

/* A compact music library: artwork identifies the song, and the entire row opens it. */
.library-page .hero {
  display: block; margin-top: 24px; padding: 28px 0 20px;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.library-page .hero h1 {
  max-width: none; margin: 9px 0 8px; font-size: clamp(28px,3.2vw,40px);
  line-height: 1.2; letter-spacing: -.035em; font-weight: 600;
}
.library-page .hero p { max-width: 60ch; font-size: 14px; }
.library-page .section { padding-top: 16px; }
.library-page .song-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.library-page .song-card,
.library-page .song-card:first-child {
  display: grid; grid-column: auto; grid-template-columns: 104px minmax(0,1fr);
  grid-template-rows: auto; gap: 16px; align-items: center;
  min-height: 136px; padding: 16px; border: 1px solid rgba(255,255,255,.3); border-radius: 20px;
  color: #fff; cursor: pointer; overflow: hidden; position: relative; isolation: isolate;
  background: linear-gradient(135deg,rgba(255,255,255,.21),rgba(255,255,255,.02) 50%),
    linear-gradient(120deg,var(--card-start),var(--card-end));
  box-shadow: 0 14px 32px rgba(22,49,49,.14), inset 0 1px 0 rgba(255,255,255,.32);
  backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.library-page .song-card:nth-child(1) { --card-start:#263a55; --card-end:#315f80; }
.library-page .song-card:nth-child(2) { --card-start:#694b57; --card-end:#a0786c; }
.library-page .song-card:nth-child(3) { --card-start:#513d30; --card-end:#b15f16; }
.library-page .song-card:nth-child(4) { --card-start:#40474c; --card-end:#777f82; }
.library-page .song-card:nth-child(5) { --card-start:#352d2b; --card-end:#755342; }
.library-page .song-card:hover,
.library-page .song-card:focus-visible {
  transform: translateY(-2px); border-color: rgba(255,255,255,.72);
  box-shadow: 0 20px 38px rgba(22,49,49,.2), inset 0 1px 0 rgba(255,255,255,.42);
}
.library-page .song-card .cover,
.library-page .song-card:first-child .cover {
  width: 104px; height: 104px; border-radius: 12px;
  box-shadow: 0 9px 23px rgba(0,0,0,.2);
}
.library-page .song-card h3,
.library-page .song-card:first-child h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; color: #fff; }
.library-page .artist { margin: 0; font-size: 13px; color: rgba(255,255,255,.82); }
.library-page .pills { margin-top: 7px; }
.library-page .pill { background: rgba(255,255,255,.2); color: #fff; }
@media (max-width:760px) {
  .library-page .song-list { grid-template-columns: 1fr; }
}
@media (max-width:660px) {
  .library-page .hero { margin-top: 12px; padding: 19px 0 12px; }
  .library-page .hero h1 { font-size: clamp(27px,7vw,33px); }
  .library-page .hero p { font-size: 13px; }
  .library-page .section { padding-top: 14px; }
  .library-page .song-card,
  .library-page .song-card:first-child {
    grid-template-columns: 64px minmax(0,1fr); gap: 12px;
    min-height: 84px; padding: 9px 11px;
  }
  .library-page .song-card .cover,
  .library-page .song-card:first-child .cover { width: 64px; height: 64px; }
  .library-page .song-card h3,
  .library-page .song-card:first-child h3 { font-size: 18px; }
}

/* Neutral site chrome leaves the album artwork and its card colors in focus. */
.library-page {
  --lg-ink: #252932; --lg-muted: #626875; --lg-accent: #363c49;
  --lg-glass: rgba(255,255,255,.84); --lg-glass-strong: #fff;
  --lg-line: rgba(35,43,55,.1); --lg-shadow: 0 12px 32px rgba(29,36,48,.06);
  background: #f7f8fa;
}
.library-page .top { background: rgba(255,255,255,.88); box-shadow: none; }
.library-page .mark { background: #303540; color: #fff; }
.library-page .navlinks a[aria-current=page],.library-page .eyebrow { color: #565d6b; }
.library-page .hero h1 { color: var(--lg-ink); }
.library-page .filters { background: #fff; box-shadow: var(--lg-shadow); }
.library-page .filters input,.library-page .filters select {
  background: #fff; border-color: #d8dce3; color: var(--lg-ink);
}
.library-page .filters input:focus,.library-page .filters select:focus { outline-color: #8b94a3; }
.library-page .song-card,.library-page .song-card:first-child {
  color: #fff;
  background: linear-gradient(135deg,rgba(255,255,255,.21),rgba(255,255,255,.02) 50%),
    linear-gradient(120deg,var(--card-start),var(--card-end));
}
.library-page .song-card h3,.library-page .song-card:first-child h3 { color: #fff; }
.library-page .song-card .pill { background: rgba(255,255,255,.19); color: #fff; }
.library-page .credits-footer { background: #fff; border-color: #e1e4e8; color: #626875; }
.library-page .credits-heading,.library-page .credits-footer strong { color: #303540; }
.library-page .credits-footer a { color: #435574; }
.learning-page[data-theme="forest"] {
  --page:#f7f8fa; --surface:#fff; --ink:#252932; --muted:#626875;
  --accent:#435574; --on-accent:#fff; --soft:#eef1f5;
  --border:#dce1e8; --panel:#f3f5f8; --jyutping-link:#3184ed;
  --cover-start:#343c4b; --cover-end:#8993a1;
  background: linear-gradient(145deg,var(--album-light-a),#fff 52%,var(--album-light-b)) fixed;
}
.learning-page[data-album="hei-fun-nei"] { --album-light-a:#dbe5f2; --album-light-b:#e4edf6; }
.learning-page[data-album="cin-cin-kyut-go"] { --album-light-a:#f1e1e4; --album-light-b:#f5eddf; }
.learning-page[data-album="gau-zung"] { --album-light-a:#ffebd3; --album-light-b:#f5e1d1; }
.learning-page[data-album="gu-co"] { --album-light-a:#e6e8eb; --album-light-b:#f1f2f4; }
.learning-page[data-album="fu-si-saan-haa"] { --album-light-a:#eee1d9; --album-light-b:#e7e0dc; }

/* Use the same column width for standalone characters and dictionary words. */
.learning-page .full-characters { --lyric-cell:36px; column-gap:1px; }
.learning-page .full-lyrics .char { width:var(--lyric-cell); min-width:var(--lyric-cell); padding-inline:0; }
.learning-page .full-lyrics .word-group {
  width:max-content;
  min-width:0;
  padding-inline:0;
}
.learning-page .full-lyrics .word-jps,
.learning-page .full-lyrics .word-han {
  display:grid;
  grid-template-columns:repeat(var(--word-length), var(--lyric-cell));
  column-gap:1px;
  width:max-content;
}
.learning-page .full-lyrics .word-jps .jp,
.learning-page .full-lyrics .word-han span { width:var(--lyric-cell); min-width:0; text-align:center; }
.learning-page .full-lyrics .word-jps .jp { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.learning-page .full-lyrics .word-han { padding-inline:0; border-color:transparent; }
@media (max-width:660px) {
  .learning-page .full-characters { --lyric-cell:39px; }
}

/* Shared site logo in library and song headers. */
.library-page .brand-logo,.learning-page .brand-logo { display:block; width:auto; height:46px; max-width:min(360px,65vw); object-fit:contain; mix-blend-mode:multiply; }
@media (max-width:660px) { .library-page .brand-logo,.learning-page .brand-logo { height:36px; max-width:60vw; } }
