:root {
  --paper: #f4f4f2;
  --paper-deep: #e9e9e5;
  --ink: #25211b;
  --muted: #66625b;
  --faint: #8a857c;
  --line: rgba(37, 33, 27, 0.12);
  --accent: #2f5d66;
  --accent-deep: #1f4148;
  --green: #476b4d;
  --gold: #b98a35;
  --card: #ffffff;
  --page: #f4f4f2;
  --shadow: 0 18px 48px rgba(37, 33, 27, 0.08);
  --sheet-size: 18px;
  --char-w: 1.08em;
  color-scheme: light;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(47, 93, 102, 0.08), transparent 28rem),
    radial-gradient(circle at 88% 24%, rgba(71, 107, 77, 0.07), transparent 26rem),
    repeating-linear-gradient(90deg, rgba(74, 58, 39, 0.012) 0 1px, transparent 1px 5px),
    var(--paper);
}
a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .38; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-header.is-compact { padding-bottom: 10px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50% 46% 50% 44%;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.22);
}
.brand strong { display: block; font-size: 19px; letter-spacing: 0.18em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: 0.24em; }
.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.24);
}
.offline-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(71, 98, 74, 0.1); }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--accent); }
.invite-entry {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.24);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
}
.invite-entry:hover { border-color: var(--accent); color: var(--accent); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: clamp(56px, 9vw, 112px) 0 68px; max-width: 960px; }
.eyebrow, .section-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-weight: 500;
  font-size: clamp(48px, 8vw, 94px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-copy {
  max-width: 600px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}
.stats { display: flex; flex-wrap: wrap; gap: 12px 34px; margin-top: 42px; }
.stats span { display: grid; gap: 3px; min-width: 72px; }
.stats strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 29px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stats small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }

.library { padding: 16px 0 88px; }
.library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.library-head h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 37px; font-weight: 500; }
.section-kicker { margin-bottom: 6px; }
.search-box {
  width: min(430px, 100%);
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--ink);
  padding: 10px 2px;
  background: transparent;
}
.search-box svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-box input::placeholder { color: var(--faint); }
.search-box kbd { padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--faint); font-size: 10px; background: rgba(255,255,255,.3); }

.filters { display: flex; flex-wrap: wrap; gap: 9px; margin: 28px 0 16px; }
.filter-chip {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font-size: 12px;
  transition: 160ms ease;
}
.filter-chip span { margin-left: 5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.filter-chip:hover { border-color: rgba(168, 78, 44, 0.45); transform: translateY(-1px); }
.filter-chip.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.filter-chip.is-active span { color: rgba(255,255,255,.58); }
.filter-favorites { margin-left: auto; }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.result-line p { margin: 0; }
.sort-box { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sort-box select { border: 0; background: transparent; color: var(--ink); font-size: 12px; outline: none; cursor: pointer; }

.song-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.song-card {
  min-height: 180px;
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px 18px 4px 4px;
  background: rgba(255, 255, 255, 0.3);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.song-card-main {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 19px;
  border-radius: inherit;
  text-decoration: none;
}
.song-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 78, 44, 0.42);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 40px rgba(64, 45, 26, 0.08);
}
.song-card:focus-within { border-color: rgba(168, 78, 44, 0.6); box-shadow: 0 0 0 3px rgba(168, 78, 44, 0.1); }
.song-card[data-kind="lyrics-only"] { border-top-color: rgba(168, 78, 44, .45); }
.song-card[data-kind="tab-only"] { border-top-color: rgba(71, 98, 74, .45); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-number { color: var(--faint); font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; font-size: 10px; letter-spacing: .08em; }
.card-versions { padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; letter-spacing: .06em; }
.song-card h3 { margin: 28px 0 4px; padding-right: 38px; font-family: "Songti SC", "STSong", serif; font-size: 23px; font-weight: 500; line-height: 1.25; }
.card-artist { margin: 0; color: var(--muted); font-size: 12px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: auto; padding-top: 22px; color: var(--faint); font-size: 9px; letter-spacing: .04em; }
.song-favorite {
  position: absolute;
  top: 48px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--faint);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: 160ms ease;
}
.song-favorite:hover { border-color: var(--line); color: var(--accent); background: rgba(255,255,255,.48); }
.song-favorite.is-active { color: var(--accent); }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); }
.empty-state > span { font-size: 42px; color: var(--faint); }
.empty-state h3 { margin: 12px 0 8px; font-family: "Songti SC", serif; font-size: 26px; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: 13px; }
.empty-state button { margin-top: 14px; padding: 10px 17px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.load-error { padding: 30px; border: 1px solid rgba(168,78,44,.32); color: var(--accent-deep); }
.load-error code { padding: 2px 5px; background: rgba(255,255,255,.45); }

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .04em;
}
.site-footer p { margin: 0; }

.song-root { padding-bottom: 70px; }
.referral-band { padding: 0 0 54px; scroll-margin-top: 20px; }
.referral-band[hidden] { display: none; }
.referral-band-song { padding: 20px 0 82px; }
.referral-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  background:
    linear-gradient(118deg, rgba(255,255,255,.48), rgba(255,255,255,.16) 56%, rgba(168,78,44,.055)),
    rgba(243,237,225,.62);
  box-shadow: 0 16px 44px rgba(62,48,29,.055);
}
.referral-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--accent), rgba(168,78,44,.12));
}
.referral-kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.referral-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(168,78,44,.09); }
.referral-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin: 13px 0 20px; }
.referral-heading h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(25px, 3.4vw, 35px); font-weight: 500; letter-spacing: -.025em; }
.referral-heading p { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.referral-badge { flex: 0 0 auto; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
.referral-badge.is-trial { border-color: rgba(71,98,74,.35); color: var(--green); background: rgba(71,98,74,.06); }
.referral-badge.is-unlocked { border-color: rgba(168,78,44,.38); color: var(--accent); background: rgba(168,78,44,.07); }
.referral-progress { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 18px; margin-bottom: 20px; color: var(--muted); font-size: 11px; }
.referral-steps { display: flex; gap: 6px; }
.referral-steps i { width: 34px; height: 4px; border-radius: 999px; background: rgba(55,47,37,.13); transition: 180ms ease; }
.referral-steps i.is-filled { background: var(--accent); }
.referral-progress [data-ref-daily] { margin-left: auto; color: var(--faint); }
.referral-label { display: block; margin-bottom: 7px; color: var(--faint); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.referral-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.referral-link {
  min-width: 0;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255,255,255,.55);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}
.referral-copy {
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.referral-copy:hover, .referral-copy.is-copied { border-color: var(--accent); color: var(--accent); background: rgba(168,78,44,.05); }
.referral-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; color: var(--faint); font-size: 10px; line-height: 1.65; }
.referral-refresh { flex: 0 0 auto; padding: 5px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.referral-refresh:hover { border-color: var(--accent); color: var(--accent); }
.referral-trial { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--green); font-size: 11px; }
.free50-hero { margin: 16px 0 0; color: var(--green); font-size: 12px; letter-spacing: .03em; }
.free50-card::before { background: linear-gradient(var(--green), rgba(71,98,74,.12)); }
.referral-badge.is-free { border-color: rgba(71,98,74,.35); color: var(--green); background: rgba(71,98,74,.06); }
.free50-progress { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid var(--line); background: rgba(255,255,255,.28); }
.free50-progress strong { color: var(--ink); font-family: "Songti SC", "STSong", serif; font-size: clamp(24px, 3vw, 34px); font-weight: 500; letter-spacing: -.02em; }
.free50-progress span { color: var(--muted); font-size: 11px; }
.free50-meter { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(55,47,37,.12); }
.free50-meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--accent)); transition: width 220ms ease; }
.free50-note { margin: 14px 0 0; color: var(--faint); font-size: 10px; line-height: 1.75; }
.quota-gate {
  width: min(100%, 790px);
  margin: clamp(42px, 8vw, 88px) auto;
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.54), rgba(255,255,255,.2));
  box-shadow: var(--shadow);
}
.quota-gate::before { content: "10"; float: right; margin: -.18em 0 0 .3em; color: rgba(168,78,44,.12); font-family: "Songti SC", serif; font-size: clamp(96px, 20vw, 180px); line-height: .8; }
.quota-gate h1 { max-width: 610px; margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(36px, 6vw, 60px); font-weight: 500; line-height: 1.07; letter-spacing: -.04em; }
.quota-gate-lead { max-width: 650px; margin: 23px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.quota-gate-copy { max-width: 620px; }
.quota-gate-meta { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 0; }
.quota-gate-meta span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.quota-gate-note { margin: 20px 0 0; color: var(--faint); font-size: 10px; line-height: 1.75; }
.quota-gate-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.quota-gate-actions a { padding: 9px 14px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; text-decoration: none; }
.quota-gate-actions a:hover { border-color: var(--accent); color: var(--accent); }
.song-hero { padding: clamp(50px, 8vw, 95px) 0 38px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 38px; align-items: end; }
.song-heading h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(44px, 7vw, 78px); font-weight: 500; line-height: 1.02; letter-spacing: -.04em; }
.song-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.song-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.song-actions button { min-height: 40px; padding: 0 15px; border: 1px solid var(--line); background: rgba(255,255,255,.3); cursor: pointer; }
.song-actions button:hover { border-color: var(--accent); color: var(--accent); }
.song-actions .favorite-toggle { min-width: 94px; }
.song-actions .favorite-toggle.is-active { border-color: rgba(168,78,44,.45); color: var(--accent); background: rgba(168,78,44,.07); }
.song-actions p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: right; }
.song-meta { display: grid; grid-template-columns: repeat(5, minmax(62px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.song-meta span { min-width: 76px; padding: 13px 14px; background: var(--paper); }
.song-meta small { display: block; color: var(--faint); font-size: 9px; letter-spacing: .1em; }
.song-meta strong { display: block; margin-top: 5px; font-family: "Songti SC", serif; font-size: 17px; font-weight: 500; white-space: nowrap; }
.strum-card { margin: 0 0 14px; padding: 17px 20px; border: 1px solid var(--line); background: rgba(255,255,255,.28); display: grid; grid-template-columns: 150px 1fr; gap: 20px; }
.strum-title { display: flex; flex-direction: column; gap: 5px; }
.strum-title span { font-family: "Songti SC", serif; font-size: 18px; }
.strum-title small { color: var(--faint); font-size: 8px; letter-spacing: .16em; }
.strum-empty { margin: 0; align-self: center; color: var(--muted); font-size: 12px; }
.strum-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 7px; align-self: center; }
.strum-list li { padding: 5px 9px; border-radius: 4px; background: var(--paper-deep); color: var(--accent-deep); font-size: 11px; }
.strum-list pre { margin: 0; font: inherit; white-space: pre-wrap; }
.controls { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-bottom-color: rgba(55,47,37,.22); background: rgba(243,237,225,.9); backdrop-filter: blur(14px); }
.control-group { display: flex; align-items: center; gap: 6px; }
.control-label { margin-right: 5px; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.control-group button { min-width: 30px; height: 30px; padding: 0 9px; border: 1px solid var(--line); background: rgba(255,255,255,.38); cursor: pointer; }
.control-group button:hover { border-color: var(--accent); color: var(--accent); }
.control-group output { min-width: 42px; text-align: center; color: var(--muted); font-size: 11px; }
.control-group .control-reset { margin-left: 4px; font-size: 10px; }
.key-select-wrap { position: relative; }
.key-select-wrap select {
  min-width: 92px;
  height: 30px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255,255,255,.38);
  color: var(--ink);
  font: 11px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  cursor: pointer;
  appearance: none;
}
.key-select-wrap::after { content: "⌄"; position: absolute; right: 9px; top: 5px; color: var(--muted); font-size: 12px; pointer-events: none; }
.key-select-wrap select:hover, .key-select-wrap select:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.column-select-wrap { position: relative; }
.column-select-wrap select {
  min-width: 84px;
  height: 30px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255,255,255,.38);
  color: var(--ink);
  font: 11px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  cursor: pointer;
  appearance: none;
}
.column-select-wrap::after { content: "⌄"; position: absolute; right: 9px; top: 5px; color: var(--muted); font-size: 12px; pointer-events: none; }
.column-select-wrap select:hover, .column-select-wrap select:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.sheet-panel { margin-top: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.35); box-shadow: var(--shadow); }
.sheet-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--faint) transparent; }
.sheet-body { min-width: 0; padding: 34px clamp(24px, 6vw, 72px) 58px; }
.sheet-columns { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.sheet-columns[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-columns[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sheet-column { min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--faint) transparent; padding: 0 clamp(18px, 2.4vw, 34px) 4px; }
.sheet-column:first-child { padding-left: 0; }
.sheet-column:last-child { padding-right: 0; }
.sheet-column + .sheet-column { border-left: 1px solid var(--line); }
.sheet-block { break-inside: avoid; margin: 0 0 14px; }
.sheet-block[data-block="heading"] { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.sheet-block[data-block="heading"]:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.notation-card { margin-top: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.32); box-shadow: var(--shadow); }
.notation-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.notation-title span { font-family: "Songti SC", "STSong", serif; font-size: 19px; letter-spacing: .04em; }
.notation-title small { color: var(--faint); font-size: 8px; letter-spacing: .16em; }
.notation-scroll { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; padding: 18px 20px 24px; scrollbar-color: var(--faint) transparent; }
.notation-scroll svg { display: block; max-width: none; height: auto; }
.notation-loading, .notation-error { margin: 0; color: var(--muted); font-size: 12px; }
.notation-error { color: var(--accent); }
.section-heading { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; border: 0; }
.section-index { color: var(--faint); font: 9px "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; }
.section-heading h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 20px; font-weight: 600; letter-spacing: .04em; }
.sheet-line {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(var(--char-w), max-content));
  grid-auto-rows: min-content;
  align-items: end;
  min-width: calc(var(--cols) * var(--char-w));
  width: max-content;
  font-size: var(--sheet-size);
  line-height: 1.65;
}
.chord-row { display: contents; }
.chord-token {
  position: static;
  grid-column: calc(var(--at) + 1);
  grid-row: calc(var(--row, 0) + 1);
  justify-self: start;
  align-self: end;
  min-width: var(--char-w);
  padding: 0 .3em .08em 0;
  color: var(--accent);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: .74em;
  font-weight: 700;
  white-space: nowrap;
}
.chord-flow .chord-token { grid-column: auto; grid-row: auto; }
.chord-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .7rem;
  padding: .35rem 0 .9rem;
  font-size: var(--sheet-size);
}
.chord-flow .chord-token {
  position: static;
  display: inline-flex;
  align-items: center;
  min-height: 2.15em;
  padding: .18em .62em;
  border: 1px solid rgba(168,78,44,.2);
  border-radius: 999px;
  background: rgba(255,252,246,.7);
  font-size: .78em;
  letter-spacing: .02em;
}
.lyric-row { display: contents; white-space: nowrap; }
.lyric-row.is-instrumental { color: var(--faint); font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; font-size: .8em; }
.lyric-char { display: block; grid-row: calc(var(--chord-rows, 1) + 1); grid-column: var(--col); min-width: var(--char-w); width: auto; text-align: center; white-space: pre; }
.lyrics-only-sheet { max-width: 760px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 64px) 62px; }
.lyrics-only-sheet p { margin: 0 0 .7em; font-family: "Songti SC", "STSong", serif; font-size: 21px; line-height: 1.85; }
.placeholder-banner { display: flex; align-items: center; gap: 13px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(168,78,44,.055); }
.placeholder-banner strong { flex: 0 0 auto; color: var(--accent); font-family: "Songti SC", serif; font-size: 19px; font-weight: 500; }
.placeholder-banner span { color: var(--muted); font-size: 11px; }
.empty-illustration { min-height: 300px; display: grid; place-items: center; color: rgba(168,78,44,.2); font-family: "Songti SC", serif; font-size: 92px; }
.is-placeholder .muted { color: var(--muted); font-size: 14px; }
.loading-card, .load-failure { min-height: 52vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.loading-card p { color: var(--muted); font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.load-failure h1 { margin: 10px 0; font-family: "Songti SC", serif; font-size: 38px; font-weight: 500; }
.load-failure p { color: var(--muted); }
.load-failure a { margin-top: 18px; padding: 10px 18px; border: 1px solid var(--ink); text-decoration: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.account-slot { display: flex; align-items: center; min-height: 34px; }
.account-slot[hidden] { display: none; }
.account-login { display: flex; align-items: center; gap: 6px; }
.account-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.account-btn:hover { border-color: var(--accent); color: var(--accent); }
.account-btn.is-wechat:hover { border-color: #2a9d63; color: #217a4d; }
.account-btn.is-qq:hover { border-color: #2b7cd3; color: #1d5fa5; }
.account-btn.is-email:hover { border-color: var(--accent); color: var(--accent); }
.account-email { position: relative; }
.account-email summary { list-style: none; display: inline-flex; align-items: center; }
.account-email summary::-webkit-details-marker { display: none; }
.account-email[open] summary { border-color: var(--accent); color: var(--accent); }
.account-email-form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(370px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.account-email-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.account-email-row + .account-email-row { margin-top: 7px; }
.account-email-row[hidden] { display: none; }
.account-email-input {
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.account-email-input:focus { outline: 2px solid rgba(168, 78, 44, 0.2); outline-offset: 1px; border-color: var(--accent); }
.account-email-code { letter-spacing: 0.18em; font-family: "SFMono-Regular", Consolas, monospace; }
.account-email-action {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.account-email-action:hover { border-color: var(--accent); color: var(--accent); }
.account-email-action.is-primary { border-color: var(--ink); color: var(--ink); }
.account-email-action:disabled { cursor: wait; }
.account-email-status { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.account-email-status.is-error { color: var(--accent); }
.account-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 5px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 12px;
}
.account-avatar {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(168, 78, 44, 0.12);
  color: var(--accent);
  font-size: 11px;
}
.account-name { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-provider { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.account-logout {
  min-height: 26px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.account-logout:hover { color: var(--accent); background: rgba(168, 78, 44, 0.07); }
.account-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 50;
  width: min(92vw, 480px);
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.65;
  box-shadow: var(--shadow);
}
.account-toast[hidden] { display: none; }

.admin-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 90px; }
.admin-head { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.admin-head h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(32px, 6vw, 54px); font-weight: 500; }
.admin-head p { max-width: 680px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.admin-login { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 26px 0 14px; }
.admin-login label { display: grid; gap: 6px; flex: 1 1 260px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.admin-login input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink);
}
.admin-login button, .admin-actions button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
}
.admin-login button:hover, .admin-actions button:hover { border-color: var(--accent); color: var(--accent); }
.admin-note { margin: 0 0 26px; color: var(--faint); font-size: 11px; line-height: 1.7; }
.admin-summary { margin: 20px 0 12px; color: var(--muted); font-size: 13px; }
.admin-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.admin-table td.num { font-variant-numeric: tabular-nums; }
.admin-empty { padding: 30px 0; color: var(--muted); font-size: 13px; }
.admin-actions { display: flex; gap: 8px; margin-top: 18px; }

@media (min-width: 1000px) {
  .page-song .site-header,
  .page-song main { width: min(1600px, calc(100% - 48px)); }
  .page-song .sheet-body { padding-left: clamp(30px, 3vw, 48px); padding-right: clamp(30px, 3vw, 48px); }
}
@media (max-width: 1000px) {
  .song-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .song-hero { grid-template-columns: 1fr; align-items: start; }
  .song-meta { width: 100%; }
}
@media (max-width: 720px) {
  .site-header, main, .site-footer { width: min(100% - 28px, 1180px); }
  .site-header { padding-top: 18px; }
  .header-actions { gap: 7px; }
  .header-actions .offline-pill { display: none; }
  .account-name { max-width: 82px; }
  .filter-chip { min-height: 44px; }
  .filter-favorites { margin-left: 0; }
  .hero { padding: 50px 0 48px; }
  .hero h1 { font-size: clamp(43px, 14vw, 64px); }
  .hero-copy { font-size: 14px; line-height: 1.8; }
  .stats { gap: 18px 26px; margin-top: 30px; }
  .library-head { flex-direction: column; align-items: stretch; gap: 18px; }
  .library-head h2 { font-size: 31px; }
  .search-box { width: 100%; }
  .song-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .song-card { min-height: 166px; padding: 0; border-radius: 3px 14px 3px 3px; }
  .song-card-main { padding: 15px; }
  .song-card h3 { margin-top: 24px; font-size: 20px; }
  .card-meta { gap: 5px 9px; }
  .site-footer { flex-direction: column; gap: 8px; }
  .song-hero { padding: 38px 0 28px; gap: 26px; }
  .song-heading h1 { font-size: clamp(39px, 12vw, 58px); }
  .song-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .song-meta span { min-width: 0; padding: 11px 12px; }
  .strum-card { grid-template-columns: 1fr; gap: 10px; padding: 15px; }
  .controls { top: 0; padding: 10px; justify-content: center; }
  .controls { gap: 8px; }
  .control-group button { min-width: 44px; height: 44px; }
  .key-select-wrap select { min-width: 108px; height: 44px; }
  .control-group .control-reset { min-width: 48px; }
  .song-actions { align-items: flex-start; flex-direction: column; gap: 9px; }
  .song-actions button { min-height: 44px; }
  .song-actions p { text-align: left; }
  .referral-heading { flex-direction: column; gap: 12px; }
  .referral-progress [data-ref-daily] { margin-left: 0; }
  .referral-foot { align-items: flex-start; flex-direction: column; gap: 4px; }
  .referral-copy-row { grid-template-columns: 1fr; }
  .referral-copy { min-height: 44px; }
  .quota-gate { margin: 34px auto 62px; }
  .quota-gate-copy { grid-template-columns: 1fr; }
  .control-group output { min-width: 34px; }
  .sheet-body { padding: 26px 20px 46px; }
  .notation-title { padding: 12px 15px; }
  .notation-scroll { padding: 14px 12px 18px; }
  .section-heading h2 { font-size: 18px; }
  .placeholder-banner { align-items: flex-start; flex-direction: column; gap: 5px; padding: 14px 16px; }
  .lyrics-only-sheet { padding: 27px 20px 44px; }
  .lyrics-only-sheet p { font-size: 18px; }
}
@media (max-width: 430px) {
  .song-grid { grid-template-columns: 1fr; }
  .song-card { min-height: 150px; }
  .stats span { min-width: 58px; }
  .stats strong { font-size: 24px; }
  .filter-chip { padding: 8px 10px; }
}
body.has-reader-dock { padding-bottom: 92px; }
.reader-dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(243, 237, 225, .94);
  box-shadow: 0 16px 48px rgba(62, 48, 29, .18);
  backdrop-filter: blur(16px);
}
.reader-dock[hidden] { display: none; }
.reader-progress { position: absolute; left: 22px; right: 22px; top: 6px; height: 2px; overflow: hidden; border-radius: 999px; background: rgba(55,47,37,.12); }
.reader-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--accent)); }
.reader-play {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
}
.reader-play:hover { background: var(--accent); border-color: var(--accent); }
.reader-play.is-playing { background: var(--accent); border-color: var(--accent); }
.reader-play-icon { font-size: 9px; line-height: 1; }
.reader-speed { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: 8px; }
.reader-speed-label { flex: 0 0 auto; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.reader-speed input[type="range"] { width: 100%; min-width: 60px; accent-color: var(--accent); cursor: pointer; }
.reader-speed output { flex: 0 0 auto; min-width: 24px; color: var(--ink); font: 11px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; text-align: right; }
.reader-speed small { flex: 0 0 auto; color: var(--faint); font-size: 9px; white-space: nowrap; }
.reader-top {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.38);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.reader-top:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 600px) {
  body.has-reader-dock { padding-bottom: 96px; }
  .reader-dock { width: calc(100vw - 24px); gap: 7px; padding: 14px 10px 9px; border-radius: 18px; }
  .reader-play { min-height: 44px; padding: 0 12px; font-size: 12px; }
  .reader-speed-label, .reader-speed small { display: none; }
  .reader-speed { gap: 6px; }
  .reader-speed input[type="range"] { min-width: 44px; }
  .reader-top { min-height: 44px; min-width: 44px; padding: 0 8px; }
}
@media print {
  .reader-dock { display: none !important; }
  body.has-reader-dock { padding-bottom: 0; }
}
@media print {
  @page { margin: 14mm; }
  :root { --paper: #fff; --paper-deep: #f4f4f4; --ink: #000; --muted: #333; --faint: #555; --line: #bbb; --accent: #000; }
  body { background: #fff; }
  .site-header, .site-footer, .song-actions, .controls, .spinner, .referral-band, .invite-entry { display: none !important; }
  main, .site-header, .site-footer { width: auto; }
  .song-root { padding: 0; }
  .song-hero { display: block; padding: 0 0 10mm; }
  .song-heading h1 { font-size: 30pt; letter-spacing: 0; }
  .song-meta { width: 100%; margin-top: 6mm; border-color: #bbb; }
  .song-meta span { background: #fff; }
  .strum-card, .sheet-panel, .notation-card { border-color: #bbb; background: #fff; box-shadow: none; }
  .strum-card { margin-bottom: 4mm; padding: 3mm 4mm; }
  .sheet-scroll, .notation-scroll { overflow: visible; }
  .sheet-body { min-width: 0; padding: 6mm 0 0; }
  .sheet-columns { display: block; grid-template-columns: none; }
  .sheet-column { overflow: visible; padding: 0; border: 0; }
  .sheet-block { break-inside: avoid; page-break-inside: avoid; margin-bottom: 4mm; }
  .sheet-block[data-block="heading"] { margin-top: 6mm; padding-top: 3mm; }
  .sheet-block[data-block="heading"]:first-child { margin-top: 0; padding-top: 0; }
  .sheet-line { break-inside: avoid; page-break-inside: avoid; }
  .section-heading { break-after: avoid; page-break-after: avoid; }
  .chord-token { color: #000; }
  .lyrics-only-sheet { max-width: none; padding: 6mm 4mm; }
  .lyrics-only-sheet p { font-size: 12pt; }
  .placeholder-banner { background: #fff; }
  .empty-illustration { display: none; }
  .notation-scroll svg { max-width: 100%; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Chord fingering strip (yopu-like horizontal diagrams) */
.chord-strip {
  margin: 0 0 1.1rem;
  padding: .85rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,252,246,.72);
  box-shadow: var(--shadow);
}
.chord-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}
.chord-strip-head span {
  font-weight: 700;
  letter-spacing: .04em;
}
.chord-strip-head small {
  color: var(--muted);
  font-size: .78rem;
}
.chord-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  overflow: visible;
  padding-bottom: .1rem;
}
.chord-diag {
  flex: 0 0 auto;
  width: 64px;
  text-align: center;
  color: var(--ink);
}
.chord-diag-name {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .15rem;
  white-space: nowrap;
}
.chord-diag svg { display: block; margin: 0 auto; }
.chord-diag .fret-dot { fill: currentColor; }
.chord-diag .nut-x { font-size: 9px; fill: currentColor; }
.chord-diag .base-fret { font-size: 9px; fill: currentColor; }
.chord-diag.is-simple {
  opacity: .78;
}
.chord-diag-simple-mark {
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--faint);
}
@media print {
  .chord-strip-row, .chord-flow { overflow: visible; }
}

/* ── Home: recommendation feed ───────────────────────────────────────── */
[hidden] { display: none !important; }
.home-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(310px, .82fr);
  align-items: end;
  gap: clamp(30px, 5vw, 72px);
  padding: clamp(18px, 3vw, 32px) 0 clamp(28px, 4vw, 42px);
}
.hero-copy-block { min-width: 0; }
.hero-copy-block h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(46px, 5.3vw, 74px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.045em;
}
.hero-copy-block h1 em { color: var(--accent); font-style: normal; }
.hero-copy-block .hero-copy {
  max-width: 570px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}
.hero-copy-block .free50-hero { margin-top: 12px; }
.hero-copy-block .stats {
  gap: 12px 32px;
  margin-top: 26px;
}
.hero-copy-block .stats strong { font-size: 27px; }
.hero-copy-block .stats small { font-size: 10px; }

.hero-search-block { min-width: 0; padding-bottom: 2px; }
.hero-search {
  padding: 17px 0 18px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.hero-search-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font: 700 9px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .18em;
}
.hero-search-field {
  min-width: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 7px 6px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .46);
  box-shadow: 0 10px 30px rgba(62, 48, 29, .04);
}
.hero-search-field svg { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.hero-search-field input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.hero-search-field input::placeholder { color: var(--faint); }
.hero-search-field kbd {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, .35);
  color: var(--faint);
  font-size: 10px;
}
.hero-search-field button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
}
.hero-search-field button:hover { border-color: var(--accent); background: var(--accent); }
.quick-searches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 10px;
}
.quick-searches span { margin-right: 2px; letter-spacing: .08em; }
.quick-searches button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.quick-searches button:hover { border-color: var(--accent); color: var(--accent); }

.home-explore { padding: 0 0 88px; border-top: 1px solid var(--line); }
.home-explore.is-searching .explore-head { display: none; }
.explore-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.home-tabs { display: flex; gap: 28px; }
.home-tab {
  position: relative;
  min-height: 52px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 500;
  letter-spacing: -.02em;
  cursor: pointer;
}
.home-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  transition: width 180ms ease;
}
.home-tab:hover { color: var(--ink); }
.home-tab.is-active { color: var(--ink); }
.home-tab.is-active::after { width: 22px; }
.browse-all {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.browse-all span { color: var(--ink); font-variant-numeric: tabular-nums; }
.browse-all b { margin-left: 4px; color: var(--accent); font-weight: 500; }
.browse-all:hover { border-color: var(--accent); color: var(--accent); }

.home-section { padding: 30px 0 46px; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(28px, 3.1vw, 38px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.section-head .section-kicker { margin-bottom: 7px; }
.section-lede {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.section-note {
  flex: 0 0 auto;
  padding-bottom: 4px;
  color: var(--faint);
  font: 10px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .08em;
}
.section-link {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.section-link b { margin-left: 4px; color: var(--accent); font-weight: 500; }
.section-link:hover { color: var(--accent); border-color: var(--accent); }

.hot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.hot-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(37, 33, 27, .9);
  border-radius: 3px 18px 3px 3px;
  background:
    radial-gradient(circle at 100% 0, rgba(168, 78, 44, .24), transparent 55%),
    #25211b;
  color: var(--paper);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.hot-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -34px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(243, 237, 225, .07);
  border-radius: 50%;
  pointer-events: none;
}
.hot-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 78, 44, .55);
  box-shadow: 0 20px 44px rgba(62, 48, 29, .16);
}
.hot-card-link {
  position: relative;
  z-index: 1;
  min-height: 252px;
  display: flex;
  flex-direction: column;
  padding: 17px 17px 15px;
  color: inherit;
  text-decoration: none;
}
.hot-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hot-rank {
  color: #d98a63;
  font: 700 10px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .12em;
}
.hot-badge {
  padding: 3px 7px;
  border: 1px solid rgba(243, 237, 225, .18);
  border-radius: 999px;
  color: rgba(243, 237, 225, .68);
  font-size: 8px;
  letter-spacing: .13em;
}
.hot-card h3 {
  margin: 23px 0 4px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.hot-artist {
  margin: 0;
  color: rgba(243, 237, 225, .62);
  font-size: 11px;
  letter-spacing: .03em;
}
.hot-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 22px; }
.hot-tags span {
  padding: 4px 7px;
  border: 1px solid rgba(243, 237, 225, .13);
  border-radius: 999px;
  color: rgba(243, 237, 225, .78);
  font-size: 8px;
  letter-spacing: .03em;
}
.hot-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-right: 36px;
}
.hot-heat { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.hot-meter {
  display: block;
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d98a63 0 var(--heat), rgba(243, 237, 225, .16) var(--heat) 100%);
}
.hot-heat strong { color: #f0d4c4; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hot-heat small { color: rgba(243, 237, 225, .42); font-size: 8px; }
.hot-charts { color: rgba(243, 237, 225, .48); font-size: 8px; white-space: nowrap; }
.hot-favorite {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(243, 237, 225, .42);
  font-size: 17px;
  cursor: pointer;
}
.hot-favorite:hover { border-color: rgba(243, 237, 225, .2); color: #e7a17d; }
.hot-favorite.is-active { color: #e7a17d; }

.artist-grid,
.artist-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.artist-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 68px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 3px 14px 3px 3px;
  background: rgba(255, 255, 255, .27);
  text-decoration: none;
  transition: 160ms ease;
}
.artist-card:hover {
  border-color: rgba(168, 78, 44, .42);
  background: rgba(255, 255, 255, .55);
  transform: translateY(-2px);
}
.artist-card.is-hot { background: linear-gradient(110deg, rgba(168, 78, 44, .075), rgba(255, 255, 255, .22)); }
.artist-initial {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(168, 78, 44, .24);
  border-radius: 50%;
  background: rgba(168, 78, 44, .07);
  color: var(--accent-deep);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
}
.artist-copy { min-width: 0; display: grid; gap: 3px; }
.artist-copy strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.artist-copy small { color: var(--faint); font-size: 9px; letter-spacing: .02em; white-space: nowrap; }
.artist-arrow { margin-left: auto; color: var(--faint); font-size: 12px; transition: 160ms ease; }
.artist-card:hover .artist-arrow { color: var(--accent); transform: translate(1px, -1px); }
.featured-artists { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.artist-directory { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.artist-directory .artist-card { min-height: 58px; padding: 9px 10px; gap: 8px; }
.artist-directory .artist-initial { width: 30px; height: 30px; font-size: 14px; }
.artist-directory .artist-copy strong { font-size: 12px; }
.artist-directory .artist-copy small { font-size: 8px; }

.category-section { padding-top: 36px; }
.category-section:first-child { padding-top: 32px; }

.load-more {
  display: block;
  min-height: 44px;
  margin: 20px auto 0;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .3);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.load-more:hover { border-color: var(--accent); color: var(--accent); }

.search-panel { padding: 30px 0 0; }
.search-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.search-panel-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(30px, 3.4vw, 43px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.search-summary { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.search-panel-actions { display: flex; align-items: center; gap: 10px; }
.search-panel-actions .filters { margin: 0; }
.search-panel-actions .filter-favorites { margin-left: 0; }
.filter-chip { min-height: 36px; }
.clear-search {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.clear-search:hover { border-color: var(--accent); color: var(--accent); }
.song-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.song-card {
  min-width: 0;
  min-height: 154px;
  display: flex;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 3px 15px 3px 3px;
  background: rgba(255, 255, 255, .3);
  transition: 160ms ease;
}
.song-card:hover { border-color: rgba(168, 78, 44, .4); background: rgba(255, 255, 255, .58); transform: translateY(-2px); }
.song-card-main {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 15px 13px;
  border-radius: inherit;
  text-decoration: none;
}
.song-card .card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.song-card .card-artist {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-card .card-versions {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .02em;
}
.song-card h3 {
  margin: 15px 0 0;
  padding: 0 30px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.song-card .card-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 7px; padding: 0; color: var(--faint); font-size: 8px; }
.song-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
  color: var(--faint);
  font-size: 8px;
}
.song-card .song-favorite {
  top: auto;
  right: 5px;
  bottom: 5px;
  width: 34px;
  height: 34px;
  font-size: 16px;
}
.empty-state { margin-top: 10px; padding: 64px 20px; }

@media (max-width: 1080px) {
  .hot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .song-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .artist-directory { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home-hero { grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr); gap: 28px; }
  .featured-artists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .home-main { width: min(100% - 28px, 1180px); }
  body.page-home { padding-bottom: 88px; }
  .home-hero { grid-template-columns: 1fr; gap: 0; padding: 18px 0 12px; }
  .hero-copy-block h1 { font-size: clamp(37px, 11.7vw, 50px); line-height: 1.06; letter-spacing: -.05em; }
  .hero-copy-block .eyebrow { margin-bottom: 12px; font-size: 10px; }
  .hero-copy-block .hero-copy { margin-top: 14px; font-size: 12px; line-height: 1.7; }
  .hero-copy-block .free50-hero { margin-top: 8px; font-size: 10px; }
  .hero-copy-block .stats { gap: 12px 22px; margin-top: 16px; }
  .hero-copy-block .stats strong { font-size: 23px; }
  .hero-copy-block .stats small { font-size: 9px; }
  .hero-search-block { display: contents; }
  .hero-search {
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 70;
    width: min(calc(100vw - 24px), 560px);
    transform: translateX(-50%);
    padding: 7px;
    border: 1px solid rgba(55, 47, 37, .18);
    border-radius: 19px;
    background: rgba(243, 237, 225, .96);
    box-shadow: 0 14px 44px rgba(62, 48, 29, .2);
    backdrop-filter: blur(14px);
  }
  .hero-search-kicker { display: none; }
  .hero-search-field {
    min-height: 50px;
    gap: 8px;
    padding: 0 2px 0 11px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    box-shadow: none;
  }
  .hero-search-field svg { width: 18px; height: 18px; }
  .hero-search-field input { height: 46px; font-size: 16px; }
  .hero-search-field kbd { display: none; }
  .hero-search-field button { min-height: 42px; padding: 0 15px; border-radius: 9px; font-size: 11px; }
  .quick-searches { display: none; }
  .explore-head { min-height: 62px; padding: 4px 0 8px; }
  .home-tabs { gap: 24px; }
  .home-tab { min-height: 46px; font-size: 26px; }
  .browse-all { min-height: 34px; padding: 0 10px; font-size: 10px; }
  .home-section { padding: 22px 0 34px; }
  .section-head { align-items: flex-start; gap: 12px; margin-bottom: 15px; }
  .section-head h2 { font-size: 28px; }
  .section-lede { font-size: 10px; line-height: 1.55; }
  .section-note { padding-top: 4px; font-size: 8px; }
  .section-link { min-height: 32px; padding: 0; font-size: 10px; }
  .hot-grid { grid-template-columns: 1fr; gap: 8px; }
  .hot-card-link { min-height: 176px; padding: 15px 16px 13px; }
  .hot-card h3 { margin-top: 17px; font-size: 24px; }
  .hot-tags { padding-top: 16px; }
  .hot-card-foot { margin-top: 10px; }
  .artist-grid, .artist-directory, .featured-artists { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .artist-card { min-height: 58px; padding: 9px 10px; gap: 8px; border-radius: 3px 11px 3px 3px; }
  .artist-initial { width: 32px; height: 32px; font-size: 15px; }
  .artist-copy strong { font-size: 13px; }
  .artist-copy small { font-size: 8px; }
  .artist-directory .artist-card { min-height: 54px; }
  .search-panel { padding-top: 22px; }
  .search-panel-head { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 18px; }
  .search-panel-head h2 { font-size: 31px; }
  .search-panel-actions { width: 100%; align-items: center; justify-content: space-between; gap: 8px; }
  .search-panel-actions .filters { flex-wrap: nowrap; }
  .filter-chip { min-height: 38px; }
  .clear-search { min-height: 38px; }
  .song-grid { grid-template-columns: 1fr; gap: 7px; }
  .song-card { min-height: 126px; }
  .song-card-main { padding: 12px 14px; }
  .song-card h3 { margin-top: 11px; font-size: 20px; }
  .song-card .card-foot { padding-top: 10px; }
  .empty-state { padding: 48px 16px; }
  .load-more { margin-top: 15px; }
}
@media (max-width: 380px) {
  .browse-all { font-size: 9px; }
  .home-tabs { gap: 18px; }
  .home-tab { font-size: 24px; }
  .hero-copy-block h1 { font-size: 35px; }
}

@media print {
  .hero-search-block, .quick-searches, .browse-all, .home-tabs, .search-panel-actions, .load-more, .hot-favorite, .song-favorite { display: none !important; }
  .home-hero { display: block; padding: 0 0 20px; }
  .home-panel[hidden], .search-panel[hidden] { display: none !important; }
  .hot-card { break-inside: avoid; }
}

@media (min-width: 721px) {
  .page-home .site-header { padding: 20px 0; }
  .home-hero { padding: 12px 0 28px; }
  .hero-copy-block h1 { font-size: clamp(46px, 4.8vw, 66px); }
  .hero-copy-block .hero-copy { margin-top: 16px; }
  .hero-copy-block .free50-hero { margin-top: 9px; }
  .hero-copy-block .stats { margin-top: 18px; }
  .explore-head { min-height: 66px; }
  .home-section { padding: 22px 0 40px; }
  .section-head { margin-bottom: 16px; }
  .hot-card-link { min-height: 232px; }
  .hot-card h3 { margin-top: 18px; }
  .hot-tags { padding-top: 16px; }
}

/* ── ROUND 4: PUXING desktop shell, discovery, reader, search ─────────── */
:root {
  --brand: #315f68;
  --brand-deep: #21464d;
  --brand-soft: #e9f0f1;
  --surface: #ffffff;
  --surface-soft: #f7f7f5;
  --surface-muted: #f0f0ed;
  --radius-lg: 20px;
  --radius-md: 12px;
  --sidebar-w: 248px;
  --category-w: 156px;
  --feed-w: 820px;
  --reader-rail-w: 72px;
  --reader-inspector-w: 248px;
}

body.page-home { overflow: hidden; background: #eeeeeb; }
body.page-help,
body.page-chords { background: #eeeeeb; }
.home-mobile-topbar,
.mobile-topbar { display: none; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--category-w) minmax(0, var(--feed-w)) minmax(24px, 1fr);
  min-height: 100vh;
  background: #eeeeeb;
}
.page-help .app-shell,
.page-chords .app-shell {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 22px 18px 18px;
  border-right: 1px solid rgba(37, 33, 27, .075);
  background: rgba(250, 250, 248, .94);
  overflow-y: auto;
  scrollbar-width: thin;
}
.app-sidebar .brand {
  gap: 10px;
  min-width: 0;
  color: var(--ink);
}
.app-sidebar .brand-mark,
.reader-rail-brand .brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}
.app-sidebar .brand strong { font-size: 19px; letter-spacing: .13em; }
.app-sidebar .brand small { margin-top: 1px; font-size: 8px; letter-spacing: .22em; }
.sidebar-tagline {
  margin: 7px 0 0 48px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .045em;
}
.sidebar-search {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.sidebar-search:hover { background: var(--surface-soft); color: var(--ink); }
.sidebar-search svg,
.instrument-row svg,
.side-nav-item svg,
.reader-rail-link svg,
.mobile-search-trigger svg,
.search-form svg,
.mobile-search-bar svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-search span { font-size: 13px; }
.sidebar-search kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--faint);
  background: rgba(255,255,255,.55);
  font: 10px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
.instrument-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.side-nav { display: grid; gap: 4px; margin-top: 12px; }
.side-nav-item {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #514c45;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.side-nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.side-nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 650;
}
.side-nav-item small {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(49, 95, 104, .1);
  color: var(--brand-deep);
  font-size: 9px;
  text-align: center;
}
.sidebar-bottom {
  display: grid;
  gap: 11px;
  margin-top: auto;
  padding-top: 26px;
}
.sidebar-account { display: block; }
.sidebar-account .account-slot { flex-wrap: wrap; }
.sidebar-account .account-login { flex-wrap: wrap; }
.sidebar-account .account-btn { font-size: 10px; }
.invite-entry {
  justify-content: center;
  min-height: 38px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
}
.sidebar-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin: 0;
  font-size: 9px;
}
.sidebar-legal a { color: var(--faint); text-decoration: none; }
.sidebar-legal a:hover { color: var(--brand); }
.sidebar-note { margin: 0; color: #aaa49b; font-size: 9px; line-height: 1.5; }

.category-rail {
  position: sticky;
  top: 0;
  z-index: 15;
  width: var(--category-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 28px 16px 20px;
  border-right: 1px solid rgba(37, 33, 27, .055);
  background: #f4f4f1;
}
.rail-title {
  margin: 0 0 12px;
  padding: 0 12px;
  color: #a09a91;
  font: 700 9px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.rail-item {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #625d56;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.rail-item:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.rail-item.is-active {
  background: var(--surface);
  color: var(--brand-deep);
  font-weight: 650;
  box-shadow: 0 4px 15px rgba(40,35,28,.045);
}
.rail-mobile-only { display: none; }

.home-feed {
  width: 100%;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: #eeeeeb;
}
.feed-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 34px 64px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(37,33,27,.18) transparent;
}
.feed-scroll > * { width: min(100%, 780px); }
.feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 0 2px;
}
.feed-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font: 700 9px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .2em;
}
.feed-head h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(30px, 3vw, 39px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.feed-sub {
  max-width: 510px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.feed-head-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
  padding-bottom: 2px;
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}
.feed-head-meta strong {
  color: var(--ink);
  font: 600 11px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
.free50-hero {
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid rgba(49,95,104,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.46);
  color: var(--brand-deep);
  font-size: 10px;
}
.referral-band { margin: 0 0 14px; }
.feed-view { padding-bottom: 14px; }
.feed-view[data-view-panel="artists"] > .feed-section-head,
.feed-view[data-view-panel="hot"] > .feed-section-head { display: none; }
.feed-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 2px 14px;
}
.feed-section-head h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.feed-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.feed-count { color: var(--faint); font: 10px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; }

.song-group {
  width: 100%;
  margin: 0 0 12px;
  padding: 20px 22px 18px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34,30,24,.025), 0 8px 24px rgba(34,30,24,.035);
}
.song-group:hover { box-shadow: 0 1px 2px rgba(34,30,24,.035), 0 12px 30px rgba(34,30,24,.06); }
.song-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.song-group-title { min-width: 0; }
.song-group-title-link { text-decoration: none; }
.song-group-title-link h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.song-group-title-link:hover h2 { color: var(--brand-deep); }
.song-group-artist { margin: 4px 0 0; color: var(--faint); font-size: 10px; }
.artist-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.artist-link:hover { color: var(--brand); }
.song-group-side { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.song-group-count {
  color: #a5a097;
  font-size: 9px;
  text-decoration: none;
  white-space: nowrap;
}
.song-group-count:hover { color: var(--brand); }
.song-group-favorite {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #b4aea5;
  font-size: 16px;
  cursor: pointer;
}
.song-group-favorite:hover { background: var(--surface-soft); color: var(--brand); }
.song-group-favorite.is-active { color: var(--brand); }
.hot-rank {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font: 700 9px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
.version-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 1px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.version-mini {
  flex: 1 1 136px;
  min-width: 132px;
  max-width: 188px;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}
.version-mini:hover { background: var(--brand-soft); }
.version-mini strong { font-size: 11px; font-weight: 650; }
.version-mini span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-group-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 9px;
}
.song-heat strong { color: var(--muted); font-weight: 650; }
.feed-artist-card {
  width: 100%;
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 18px 22px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 2px rgba(34,30,24,.025), 0 8px 24px rgba(34,30,24,.035);
  cursor: pointer;
}
.feed-artist-card:hover { background: #fcfcfb; }
.feed-artist-initial {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
}
.feed-artist-copy { display: grid; gap: 4px; min-width: 0; }
.feed-artist-copy strong { font-size: 18px; font-weight: 680; }
.feed-artist-copy small { color: var(--faint); font-size: 10px; }
.feed-artist-arrow { margin-left: auto; color: #b5afa5; font-size: 15px; }

.artist-grid.artist-grid-desktop {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.artist-grid-desktop .feed-artist-card {
  min-height: 104px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 0;
  padding: 17px;
}
.artist-grid-desktop .feed-artist-initial { width: 32px; height: 32px; flex-basis: 32px; font-size: 15px; }
.artist-grid-desktop .feed-artist-copy { flex: 1 1 calc(100% - 52px); }
.artist-grid-desktop .feed-artist-copy strong { font-size: 16px; }
.artist-grid-desktop .feed-artist-arrow { display: none; }
.load-more {
  min-height: 40px;
  margin: 4px auto 22px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.load-more:hover { border-color: var(--brand); color: var(--brand); }
.empty-state {
  padding: 70px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}
.empty-state > span { color: var(--brand); font-size: 34px; }
.empty-state h3 { margin: 10px 0 5px; color: var(--ink); font-size: 20px; }
.empty-state p { margin: 0 0 18px; font-size: 12px; }
.empty-state button { padding: 9px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.feed-footer,
.static-footer {
  margin-top: 20px;
  padding: 20px 3px 0;
  border-top: 1px solid rgba(37,33,27,.075);
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}
.feed-footer p { margin: 0 0 3px; }
.feed-footer a { color: inherit; }

.mobile-search-bar { display: none; }
.mobile-topbar {
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(250,250,248,.96);
}
.mobile-search-trigger {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

/* Search: floating next to the desktop sidebar, full sheet only on phones. */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 28, 24, .08);
}
.search-overlay[hidden] { display: none !important; }
.search-panel {
  position: absolute;
  left: calc(var(--sidebar-w) + 18px);
  top: 62px;
  width: min(520px, calc(100vw - var(--sidebar-w) - 48px));
  max-height: min(680px, calc(100vh - 86px));
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid rgba(37,33,27,.08);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(30, 27, 22, .16);
}
.search-panel-top { display: flex; align-items: center; gap: 9px; }
.search-form {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 6px 0 13px;
  border: 1px solid rgba(49,95,104,.22);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--brand);
}
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(49,95,104,.09); }
.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}
.search-form input::placeholder { color: #a9a39a; }
.search-clear {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}
.search-clear:hover { background: rgba(37,33,27,.06); color: var(--ink); }
.search-submit,
.search-close {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.search-submit { border-color: var(--brand); background: var(--brand); color: #fff; }
.search-close { color: var(--faint); }
.search-submit:hover { background: var(--brand-deep); }
.search-close:hover { border-color: var(--brand); color: var(--brand); }
.search-suggestions { overflow-y: auto; padding: 14px 1px 3px; }
.search-group-label {
  margin: 14px 7px 5px;
  color: #a29c93;
  font: 700 9px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .1em;
}
.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.search-result:hover { background: var(--surface-soft); }
.search-result-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}
.search-result-copy { display: grid; gap: 2px; min-width: 0; }
.search-result-copy strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy small { color: var(--faint); font-size: 10px; }
.search-empty { margin: 28px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.search-hint { display: flex; gap: 14px; margin: 12px 5px 0; color: #aaa49b; font-size: 9px; }

/* Static pages (help, chord lookup). */
.static-main { width: 100%; height: 100vh; min-width: 0; margin: 0; overflow: hidden; background: #eeeeeb; }
.static-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 34px clamp(24px, 4vw, 56px) 70px;
}
.static-scroll > * { width: min(100%, 1040px); margin-left: auto; margin-right: auto; }
.page-head { padding: 4px 0 25px; }
.page-head h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
}
.page-head > p:last-child { max-width: 680px; margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.doc-card {
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34,30,24,.025), 0 10px 30px rgba(34,30,24,.04);
}
.doc-card section + section { margin-top: 28px; padding-top: 26px; border-top: 1px solid rgba(37,33,27,.08); }
.doc-card h2 { margin: 0 0 9px; font-size: 18px; font-weight: 680; }
.doc-card p { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.doc-card kbd { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-soft); font-size: 10px; }

.chords-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.chord-browser-card,
.chord-detail-card {
  min-width: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34,30,24,.025), 0 10px 30px rgba(34,30,24,.04);
}
.chord-browser-card { padding: 18px; }
.chord-detail-card { position: sticky; top: 20px; min-height: 260px; padding: 22px; }
.chord-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 16px; }
.chord-filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.chord-filters select {
  min-height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11px;
}
.chord-total { margin-left: auto; color: var(--faint); font: 10px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; }
.chord-lookup-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.chord-lookup-item {
  min-width: 0;
  padding: 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}
.chord-lookup-item:hover { border-color: rgba(49,95,104,.25); background: #fff; }
.chord-lookup-item[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.chord-lookup-item .chord-diag { width: 100%; }
.chord-detail-empty { min-height: 215px; display: grid; place-content: center; justify-items: center; color: var(--faint); text-align: center; }
.chord-detail-empty > span { color: var(--brand); font-size: 30px; }
.chord-detail-empty p { font-size: 11px; line-height: 1.8; }
.chord-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.chord-detail-head h2 { margin: 0; font-size: 26px; }
.chord-detail-head > span { color: var(--faint); font-size: 9px; }
.chord-detail-diagram { display: grid; place-items: center; padding: 20px 0 14px; }
.chord-detail-diagram .chord-diag { width: 120px; }
.chord-detail-diagram .chord-diag-name { display: none; }
.chord-detail-diagram svg { width: 112px; height: auto; }
.chord-detail-meta { display: grid; gap: 7px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.chord-detail-meta div { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.chord-detail-meta dt { color: var(--faint); }
.chord-detail-meta dd { margin: 0; color: var(--ink); }
.chord-detail-note { margin: 16px 0 0; color: var(--faint); font-size: 9px; line-height: 1.7; }
.chord-lookup-empty { padding: 32px 10px; color: var(--muted); font-size: 12px; text-align: center; }

/* Reader shell */
body.page-song { overflow: hidden; background: #e9e9e6; }
.reader-shell {
  display: grid;
  grid-template-columns: var(--reader-rail-w) minmax(0, 1fr) var(--reader-inspector-w);
  height: 100vh;
  overflow: hidden;
  background: #e9e9e6;
}
.reader-rail {
  position: relative;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0 14px;
  border-right: 1px solid rgba(37,33,27,.06);
  background: #f8f8f6;
}
.reader-rail-brand { display: grid; place-items: center; margin-bottom: 16px; text-decoration: none; }
.reader-rail-brand .brand-mark { width: 38px; height: 38px; font-size: 20px; }
.reader-rail-nav { display: grid; gap: 6px; width: 100%; }
.reader-rail-link {
  width: 100%;
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 6px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #777169;
  font-size: 9px;
  text-decoration: none;
  cursor: pointer;
}
.reader-rail-link:hover { background: var(--brand-soft); color: var(--brand-deep); }
.reader-rail-link svg { width: 19px; height: 19px; }
.reader-rail-bottom { margin-top: auto; width: 100%; padding: 0 5px; }
.reader-rail-bottom .account-login { justify-content: center; flex-wrap: wrap; }
.reader-rail-bottom .account-btn { width: 42px; min-width: 42px; padding: 0; overflow: hidden; font-size: 0; }
.reader-rail-bottom .account-btn::first-letter { font-size: 12px; }
.reader-rail-bottom .account-chip { justify-content: center; }
.reader-rail-bottom .account-name,
.reader-rail-bottom .account-provider,
.reader-rail-bottom .account-logout { display: none; }

.reader-stage {
  position: relative;
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #ecece9;
}
.reader-mobile-topbar { grid-row: 1; }
.reader-main {
  grid-row: 2;
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 40px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(37,33,27,.18) transparent;
}
#song-root {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 26px 26px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34,30,24,.025), 0 12px 34px rgba(34,30,24,.055);
}
.reader-mobile-topbar { display: none; }
.song-hero { display: block; padding: 0 0 18px; }
.song-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.song-heading { min-width: 0; }
.song-heading h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(38px, 4.4vw, 54px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.045em;
}
.song-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.song-credit { color: var(--faint); }
.song-head-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; padding-top: 3px; }
.transpose-open {
  min-width: 92px;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.transpose-open small { grid-column: 1 / -1; color: var(--faint); font-size: 8px; letter-spacing: .08em; }
.transpose-open strong { font-size: 15px; line-height: 1.1; }
.transpose-open span { color: var(--brand); font-size: 9px; }
.transpose-open:hover { border-color: var(--brand); background: var(--brand-soft); }
.favorite-toggle {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.favorite-toggle:hover { border-color: var(--brand); color: var(--brand); }
.favorite-toggle.is-active { border-color: rgba(49,95,104,.3); background: var(--brand-soft); color: var(--brand-deep); }
.song-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0 0;
  padding: 12px 0;
  border-top: 1px solid rgba(37,33,27,.075);
  color: var(--muted);
}
.song-meta-row > span { display: inline-flex; align-items: baseline; gap: 5px; font-size: 10px; }
.song-meta-row small { color: var(--faint); font-size: 8px; letter-spacing: .08em; }
.song-meta-row strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.song-source { display: inline-block; margin-top: 8px; color: var(--faint); font-size: 9px; text-decoration: none; }
.song-source:hover { color: var(--brand); }

.chord-strip {
  margin: 0 0 9px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(37,33,27,.07);
  border-radius: 12px;
  background: #fafaf8;
  box-shadow: none;
}
.chord-strip-head { margin-bottom: 8px; }
.chord-strip-head span { font-size: 11px; font-weight: 650; }
.chord-strip-head small { font-size: 9px; }
.chord-strip-row { display: flex; flex-wrap: wrap; gap: 10px 13px; overflow: visible; padding: 0; }
.chord-strip-row .chord-diag { width: 58px; }
.chord-diag-name { font-size: 9px; }
.sheet-panel {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.sheet-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.sheet-body { padding: 12px 1px 18px; }
.sheet-columns[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-column { padding: 0 19px 4px; }
.sheet-column:first-child { padding-left: 0; }
.sheet-column:last-child { padding-right: 0; }
.sheet-column + .sheet-column { border-left: 1px solid rgba(37,33,27,.09); }
.sheet-block { margin-bottom: 11px; }
.sheet-block[data-block="heading"] { margin-top: 21px; padding-top: 0; border-top: 0; }
.sheet-block[data-block="heading"]:first-child { margin-top: 0; }
.section-heading {
  min-height: 31px;
  padding: 6px 11px;
  border-radius: 6px;
  background: #f2f2ef;
}
.section-heading h2 { font-family: inherit; font-size: 11px; font-weight: 650; letter-spacing: .04em; }
.sheet-line { color: #24211d; }
.chord-token { color: var(--brand); font-size: .76em; }
.chord-shape-mini { display: none; }
.sheet-panel.is-chord-diagrams .chord-token {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font-size: .68em;
  padding-bottom: 2px;
}
.sheet-panel.is-chord-diagrams .chord-flow .chord-token {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.sheet-panel.is-chord-diagrams .chord-flow { align-items: flex-start; }
.sheet-panel.is-chord-diagrams .chord-flow .chord-name { color: var(--brand); }
.sheet-panel.is-chord-diagrams .chord-name { font-size: .92em; line-height: 1.1; }
.sheet-panel.is-chord-diagrams .chord-shape-mini { display: block; width: 38px; height: 47px; }
.sheet-panel.is-chord-diagrams .chord-shape-mini .chord-diag { width: 38px; color: var(--brand-deep); }
.sheet-panel.is-chord-diagrams .chord-shape-mini .chord-diag-name { display: none; }
.sheet-panel.is-chord-diagrams .chord-shape-mini svg { width: 38px; height: 48px; }
.chord-flow { gap: 7px; padding: 4px 0 7px; }
.chord-flow .chord-token { border-color: rgba(49,95,104,.17); background: var(--brand-soft); color: var(--brand-deep); }
.chord-flow.is-tab-flow { gap: .35rem .8rem; padding: 0 0 .3rem; }
.sheet-line.is-tab { display: block; width: 100%; min-width: 0; }
.chord-flow.is-tab-flow .chord-token {
  min-height: 0;
  padding: 0 .18em 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand);
}
.tab-line {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: calc(var(--sheet-size) * .92);
  line-height: 1.8;
  letter-spacing: .02em;
  white-space: pre;
}
.lyric-row { color: #24211d; }
.notation-card {
  margin: 12px 0 0;
  border: 1px solid rgba(37,33,27,.07);
  background: #fff;
  box-shadow: none;
}
.notation-title { padding: 11px 14px; }
.notation-title span { font-size: 12px; }
.site-footer.reader-footer { width: min(100%, 900px); margin: 14px auto 0; color: var(--faint); font-size: 9px; }
.site-footer.reader-footer p { margin: 0 0 2px; }

.reader-inspector {
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 14px 30px;
  border-left: 1px solid rgba(37,33,27,.06);
  background: #f5f5f2;
  scrollbar-width: thin;
}
.inspector-card {
  margin: 0 0 12px;
  padding: 15px;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34,30,24,.025), 0 7px 20px rgba(34,30,24,.035);
}
.inspector-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.inspector-row + .inspector-row { margin-top: 9px; }
.inspector-label { color: var(--muted); font-size: 10px; }
.inspector-row-stack { display: grid; justify-content: stretch; }
.inspector-zoom { display: flex; align-items: center; gap: 4px; }
.inspector-zoom button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.inspector-zoom button:hover { border-color: var(--brand); color: var(--brand); }
.inspector-zoom output { min-width: 28px; color: var(--muted); font: 10px "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; text-align: center; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; padding: 3px; border-radius: 8px; background: var(--surface-soft); }
.segmented button {
  min-height: 29px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30,27,22,.08); }
.switch {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #dad9d5;
  cursor: pointer;
}
.switch i { position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.14); transition: transform 160ms ease; }
.switch.is-on { background: var(--brand); }
.switch.is-on i { transform: translateX(17px); }
.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.inspector-actions button {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.inspector-actions button:hover { border-color: var(--brand); color: var(--brand); }
.inspector-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.inspector-card-head h2 { margin: 0; font-size: 12px; font-weight: 680; }
.inspector-card-head span { color: var(--faint); font-size: 8px; }
.related-list { display: grid; gap: 4px; }
.related-song { display: grid; gap: 2px; padding: 8px 7px; border-radius: 7px; text-decoration: none; }
.related-song:hover { background: var(--surface-soft); }
.related-song.is-current { background: var(--brand-soft); }
.related-song strong { overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.related-song span { overflow: hidden; color: var(--faint); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.inspector-invite-card { padding: 11px; }
.inspector-invite,
.mobile-free-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
}
.inspector-invite:hover,
.mobile-free-entry:hover { background: #dfeaeb; }
.mobile-free-entry { display: none; margin-top: 12px; }

/* Reader bottom dock: attached to the sheet column. */
body.has-reader-dock { padding-bottom: 0; }
body.has-reader-dock .reader-main { padding-bottom: 40px; }
.reader-dock {
  grid-row: 3;
  position: static;
  z-index: 45;
  width: min(900px, calc(100% - 44px));
  max-width: 900px;
  margin: 0 auto 15px;
  display: block;
  transform: none;
  padding: 13px 14px 9px;
  border: 1px solid rgba(37,33,27,.08);
  border-radius: 15px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 38px rgba(31,28,23,.15);
  backdrop-filter: blur(14px);
}
.reader-dock[hidden] { display: none !important; }
.reader-progress { left: 16px; right: 16px; top: 5px; height: 2px; background: rgba(55,47,37,.09); }
.reader-progress i { background: var(--brand); }
.reader-sections {
  display: flex;
  gap: 1px;
  margin: 0 0 9px;
  overflow-x: auto;
  border-radius: 7px;
  background: #f1f1ee;
  scrollbar-width: none;
}
.reader-sections::-webkit-scrollbar { display: none; }
.reader-sections[hidden] { display: none !important; }
.reader-section-chip {
  flex: 1 0 auto;
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.reader-section-chip:hover { background: #fff; color: var(--brand-deep); }
.reader-controls-row { display: flex; align-items: center; gap: 9px; }
.reader-play {
  width: 46px;
  height: 46px;
  min-height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 5px 14px rgba(49,95,104,.24);
}
.reader-play:hover,
.reader-play.is-playing { border: 0; background: var(--brand-deep); }
.reader-play-icon { font-size: 11px; }
.reader-play-label { display: none; }
.reader-speed { display: flex; flex: 1 1 auto; min-width: 80px; align-items: center; gap: 7px; padding: 0 2px 0 5px; }
.reader-dock:not(.is-playing) .reader-speed { display: none; }
.reader-speed-label { font-size: 9px; }
.reader-speed input[type="range"] { min-width: 70px; accent-color: var(--brand); }
.reader-speed output { font-size: 9px; }
.reader-secondary {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.reader-secondary:hover { border-color: var(--brand); color: var(--brand); }
#reader-settings-open { display: none; }

/* Transpose and mobile settings dialogs. */
.modal-backdrop,
.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28,26,22,.24);
}
.modal-backdrop[hidden],
.mobile-sheet[hidden] { display: none !important; }
.modal-card,
.mobile-sheet-panel {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow-y: auto;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(25,23,20,.24);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 2px 0 0; font-size: 21px; }
.modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--brand); color: var(--brand); }
.modal-note { margin: 12px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.key-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.key-choice {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.key-choice:hover { border-color: var(--brand); color: var(--brand); }
.key-choice[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.modal-reset {
  min-height: 38px;
  margin-top: 15px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.mobile-sheet { display: none; align-items: end; padding: 0; }
.mobile-sheet-panel { width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; }
.mobile-sheet-panel .inspector-row { margin-top: 13px; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 228px 146px minmax(0, 1fr) 0; }
  .app-sidebar { width: 228px; }
  .category-rail { width: 146px; }
  .search-panel { left: 246px; width: min(500px, calc(100vw - 270px)); }
  .feed-scroll { padding-left: 24px; padding-right: 24px; }
  .reader-shell { grid-template-columns: 66px minmax(0, 1fr) 224px; }
  .reader-main { padding-left: 18px; padding-right: 18px; }
  .chord-lookup-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body.page-home { overflow: auto; padding-bottom: 82px; }
  .home-mobile-topbar { display: flex; position: sticky; top: 0; z-index: 90; border-bottom: 1px solid rgba(37,33,27,.06); }
  .app-shell,
  .page-help .app-shell,
  .page-chords .app-shell { display: flex; flex-direction: column; min-height: 0; }
  .app-sidebar { display: none; }
  .category-rail {
    position: sticky;
    top: 62px;
    z-index: 80;
    width: 100%;
    height: auto;
    flex-direction: row;
    gap: 7px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(37,33,27,.06);
    background: rgba(244,244,241,.96);
    overflow-x: auto;
    scrollbar-width: none;
    backdrop-filter: blur(12px);
  }
  .category-rail::-webkit-scrollbar { display: none; }
  .rail-title { display: none; }
  .rail-item {
    width: auto;
    min-width: 66px;
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.62);
    text-align: center;
  }
  .rail-item.is-active { background: #fff; box-shadow: 0 2px 10px rgba(34,30,24,.06); }
  .rail-mobile-only { display: block; }
  .home-feed { height: auto; overflow: visible; }
  .feed-scroll { height: auto; overflow: visible; padding: 16px 13px 18px; }
  .feed-scroll > * { width: 100%; }
  .feed-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .feed-head h1 { font-size: 30px; }
  .feed-sub { max-width: none; }
  .feed-head-meta { justify-content: flex-start; }
  .free50-hero { margin-bottom: 11px; }
  .song-group { padding: 16px 15px 15px; border-radius: 16px; margin-bottom: 9px; }
  .song-group-title-link h2 { font-size: 18px; }
  .song-group-side { gap: 3px; }
  .version-row { gap: 7px; }
  .version-mini { flex: 0 0 142px; min-width: 142px; max-width: 142px; min-height: 62px; padding: 10px 11px; }
  .artist-grid.artist-grid-desktop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .artist-grid-desktop .feed-artist-card { min-height: 95px; padding: 14px; }
  .feed-artist-card { min-height: 84px; padding: 15px; border-radius: 16px; }
  .feed-artist-copy strong { font-size: 16px; }
  .empty-state { padding: 52px 18px; }
  .mobile-search-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 100;
    display: block;
  }
  .mobile-search-bar > button {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid rgba(37,33,27,.12);
    border-radius: 15px;
    background: rgba(255,255,255,.96);
    color: #8f8980;
    box-shadow: 0 10px 28px rgba(34,30,24,.12);
    font-size: 13px;
  }
  .mobile-search-bar kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 9px; }

  .search-overlay { background: #f4f4f1; }
  .search-panel {
    position: static;
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 16px 14px 24px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .search-panel-top { align-items: stretch; flex-wrap: nowrap; }
  .search-form { min-height: 50px; }
  .search-submit { min-height: 44px; }
  .search-close { min-height: 44px; }
  .search-suggestions { flex: 1 1 auto; }

  .mobile-topbar { display: flex; position: relative; z-index: 70; }
  .static-main { height: auto; overflow: visible; }
  .static-scroll { height: auto; overflow: visible; padding: 20px 14px 34px; }
  .page-head { padding-top: 8px; }
  .page-head h1 { font-size: 38px; }
  .doc-card { padding: 22px 18px; border-radius: 16px; }
  .doc-card section + section { margin-top: 22px; padding-top: 21px; }
  .chords-workspace { grid-template-columns: 1fr; }
  .chord-detail-card { position: static; }
  .chord-lookup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .reader-shell { display: block; height: auto; }
  .reader-rail,
  .reader-inspector { display: none; }
  .reader-stage { height: 100dvh; }
  .reader-mobile-topbar {
    display: flex;
    flex: 0 0 auto;
    min-height: 58px;
    position: relative;
    z-index: 60;
    border-bottom: 1px solid rgba(37,33,27,.06);
  }
  .reader-main { padding: 11px 10px 28px; }
  #song-root { width: 100%; padding: 18px 14px 16px; border-radius: 14px; }
  .song-title-row { gap: 10px; }
  .song-heading h1 { font-size: clamp(29px, 9vw, 38px); }
  .song-head-actions { gap: 4px; }
  .transpose-open { min-width: 69px; min-height: 50px; padding: 4px 7px; }
  .transpose-open strong { font-size: 13px; }
  .transpose-open span { display: none; }
  .favorite-toggle { min-height: 50px; padding: 0 8px; }
  #favorite-label { display: none; }
  .song-meta-row { gap: 9px 13px; margin-top: 11px; padding: 10px 0; }
  .chord-strip { padding: 10px 10px 11px; }
  .chord-strip-row { gap: 7px 9px; }
  .chord-strip-row .chord-diag { width: 50px; }
  .chord-strip-row .chord-diag svg { width: 48px; height: auto; }
  .sheet-body { padding: 9px 0 12px; }
  .sheet-column { padding: 0 13px 3px; }
  .sheet-columns[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-dock {
    position: static;
    width: calc(100% - 20px);
    max-width: none;
    margin: 0 10px max(8px, env(safe-area-inset-bottom));
    padding: 11px 9px 7px;
    border-radius: 14px;
  }
  .reader-sections { margin-bottom: 7px; }
  .reader-section-chip { min-height: 27px; padding: 0 10px; }
  .reader-controls-row { gap: 7px; }
  .reader-play { width: 43px; height: 43px; min-height: 43px; flex-basis: 43px; }
  .reader-speed { min-width: 50px; padding-left: 1px; }
  .reader-speed input[type="range"] { min-width: 46px; }
  .reader-secondary { min-height: 36px; padding: 0 8px; }
  #reader-top { display: none; }
  #reader-settings-open { display: inline-block; }
  .mobile-sheet { display: grid; }
  .mobile-free-entry { display: flex; }
  .site-footer.reader-footer { width: 100%; }
  .key-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .feed-head-meta { gap: 5px 9px; }
  .artist-grid.artist-grid-desktop { grid-template-columns: 1fr 1fr; }
  .artist-grid-desktop .feed-artist-copy strong { font-size: 14px; }
  .artist-grid-desktop .feed-artist-copy small { font-size: 9px; }
  .chord-lookup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-hint { display: none; }
  .song-meta-row { gap: 8px 10px; }
  .sheet-panel.is-chord-diagrams .chord-shape-mini { width: 34px; height: 43px; }
  .sheet-panel.is-chord-diagrams .chord-shape-mini svg { width: 34px; height: 43px; }
}

@media print {
  body.page-song { overflow: visible; background: #fff; }
  .app-sidebar,
  .category-rail,
  .reader-rail,
  .reader-inspector,
  .reader-mobile-topbar,
  .reader-dock,
  .reader-footer,
  .feed-footer,
  .site-footer,
  .transpose-open,
  .favorite-toggle { display: none !important; }
  .reader-shell,
  .reader-stage,
  .reader-main { display: block; height: auto; overflow: visible; padding: 0; background: #fff; }
  #song-root { width: 100%; padding: 0; border-radius: 0; box-shadow: none; }
  .sheet-columns[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chord-strip,
  .notation-card,
  .sheet-panel { break-inside: auto; box-shadow: none; }
}
