:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #121212;
  --panel: #171717;
  --line: #292929;
  --ink: #f4f4f4;
  --muted: #909090;
  --accent: #ff783d;
  --header-h: 76px;
  --search-h: 66px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 14px; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { background: none; color: inherit; border: 0; cursor: pointer; }
button:disabled { opacity: .3; cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: #72381e; color: #fff; }
.topbar { max-width: 1200px; height: var(--header-h); padding: 16px 24px 12px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand::before { content: ''; width: 7px; height: 30px; border-radius: 2px; background: var(--accent); }
.brand > span { font-family: Impact, 'Arial Narrow', sans-serif; font-size: 29px; font-weight: 400; line-height: 1.05; letter-spacing: .5px; }
.brand-sub { display: block; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 8px; letter-spacing: 2px; color: #858585; margin-top: 7px; }
.header-info { text-align: right; }
.city-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 500; letter-spacing: .7px; color: #d9d9d9; }
.city-badge::before { content: ''; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.header-info small { display: block; font: 9px/1.4 monospace; color: #797979; margin-top: 6px; letter-spacing: .6px; }
.global-search { height: var(--search-h); max-width: 1200px; padding: 5px 24px 15px; margin: auto; }
.search-wrap { height: 46px; display: flex; gap: 10px; align-items: center; background: #191919; border: 1px solid #2c2c2c; border-radius: 9px; padding: 0 13px; color: #8a8a8a; transition: border-color .15s; }
.search-wrap:focus-within { border-color: #8c4a2b; }
.search-wrap > svg { width: 18px; height: 18px; }
.search-wrap input { width: 100%; min-width: 0; flex: 1; height: 100%; background: transparent; color: #f3f3f3; border: 0; outline: none; font-size: 15px; }
.search-wrap input:focus-visible { outline: none; }
.search-wrap input::placeholder { color: #747474; }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-wrap kbd { font: 11px monospace; border: 1px solid #383838; padding: 1px 6px; border-radius: 4px; color: #737373; }
.icon-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px; border-radius: 6px; color: #999; }
.icon-button:hover { background: #252525; color: #fff; }
.icon-button svg { width: 16px; height: 16px; }
main { max-width: 1200px; height: calc(100dvh - var(--header-h) - var(--search-h)); padding: 0 24px 18px; margin: auto; min-height: 0; }
.workspace { height: 100%; display: grid; grid-template-columns: 265px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.catalog { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; padding: 0 10px; background: #101010; }
.finder { padding: 11px 0 10px; flex-shrink: 0; }
.catalog-tabs { display: flex; padding: 3px; gap: 3px; background: #1d1d1d; border: 1px solid #272727; border-radius: 8px; }
.catalog-tabs button { flex: 1; min-height: 36px; padding: 7px 4px; font-size: 11px; color: #929292; display: flex; gap: 7px; align-items: center; justify-content: center; border-radius: 5px; transition: background .15s, color .15s; }
.catalog-tabs button[aria-selected=true] { background: #383838; color: #fff; }
.catalog-tabs button span { font: 9px monospace; color: #8d8d8d; }
.catalog-tabs button[aria-selected=true] span { color: var(--accent); }
.song-list { flex: 1; min-height: 0; padding: 0 0 8px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3f3f3f transparent; }
.song-row { position: relative; display: flex; align-items: stretch; border: 1px solid transparent; border-radius: 8px; margin: 2px 0; }
.song-row:hover { background: #1b1b1b; }
.song-row.selected { background: #2a1b13; border-color: #5a3320; }
.song-select { width: 100%; min-height: 60px; display: flex; gap: 12px; align-items: center; padding: 12px 10px; text-align: left; min-width: 0; }
.track-number { width: 19px; flex-shrink: 0; font: 10px monospace; color: #656565; }
.song-info { min-width: 0; }
.song-info strong { display: block; color: #bcbcbc; font-size: 13px; font-weight: 450; line-height: 1.5; overflow-wrap: anywhere; }
.selected .song-info strong { color: #ffad86; font-weight: 500; }
.selected .track-number { color: var(--accent); }
.reader { height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); overflow: hidden; }
.reader-title { padding: 27px 32px 24px; flex-shrink: 0; }
.reader-options { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.lyric-size-controls { display: inline-flex; gap: 4px; flex-shrink: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.lyric-size-controls button { touch-action: manipulation; display: grid; place-items: center; width: 40px; height: 42px; padding: 0; border: 1px solid #373737; border-radius: 6px; color: #dedede; font-size: 13px; font-weight: 600; }
.lyric-size-controls button:hover:not([aria-disabled="true"]) { border-color: var(--accent); color: var(--accent); }
.lyric-size-controls button[aria-disabled="true"] { opacity: .3; cursor: default; }
.reader-track { font: 9px monospace; color: #777; letter-spacing: 1.6px; }
.reader-title h2 { font-size: 36px; font-weight: 650; line-height: 1.15; letter-spacing: -1.1px; overflow-wrap: anywhere; margin: 12px 0 0; color: #f4f4f4; }
.demo-banner { margin: 0 32px; padding: 11px 0; border-top: 1px solid #282828; border-bottom: 1px solid #282828; font-size: 10px; line-height: 1.8; color: #8d8d8d; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.demo-banner button { color: var(--accent); padding: 4px 0; min-height: 30px; font-size: 10px; }
.demo-banner a { display: block; color: var(--accent); font-size: 11px; padding: 4px 0; }
.secondary-import { display: block; margin-top: 11px; font-size: 10px; color: #888; }
.lyric-empty .source-version { font-size: 10px; margin-top: -10px; color: #aaa; }
.lyric-scroll { height: auto; min-height: 0; flex: 1; padding: 0 32px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3f3f3f transparent; }
.lyric-content { padding: 20px 0 65px; }
.lyric-section { color: #666; font: 9px/1.8 monospace; letter-spacing: 1px; margin: 14px 0 15px; }
.lyric-line { display: block; width: 100%; padding: 8px 0; text-align: left; font-size: calc(30px * var(--lyric-scale, 1)); line-height: 1.65; font-weight: 450; color: #b4b4b4; white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: -.3px; transition: color .15s; }
.lyric-line:hover { color: #eee; }
.lyric-line.current { color: #f3f3f3; }
.lyric-line.chorus.current { color: #ffb68f; }
.lyric-gap { height: 20px; }
.reader-navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #292929; padding: 14px 24px max(14px, env(safe-area-inset-bottom)); flex-shrink: 0; }
.reader-navigation button { min-height: 42px; padding: 10px 14px; border: 1px solid #343434; border-radius: 7px; color: #d8d8d8; font-size: 11px; display: flex; align-items: center; gap: 8px; transition: border-color .15s, background .15s; }
.reader-navigation button:hover:not(:disabled) { border-color: #995231; background: #251a14; color: #ffb68f; }
.reader-navigation > span { color: #6f6f6f; font: 10px monospace; white-space: nowrap; }
.lyric-empty { padding: 10px 0; text-align: left; }
.lyric-empty > svg { display: none; }
.lyric-empty h3 { font-size: 20px; font-weight: 500; line-height: 1.5; margin: 15px 0 10px; color: #d5d5d5; }
.lyric-empty p { font-size: 12px; line-height: 1.9; color: #777; margin: 0 0 20px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 12px 16px; border-radius: 7px; background: var(--accent); color: #141414; font-size: 12px; font-weight: 600; }
.primary:hover { background: #ff945f; }
.primary svg { width: 15px; height: 15px; }
.empty-list { padding: 30px 10px; color: #777; font-size: 11px; line-height: 1.8; }
.empty-list strong { display: block; font-size: 13px; font-weight: 500; color: #b0b0b0; }
.empty-list p { margin-top: 8px; }
.top-nav, .offline-pill, .phone-intro, .hero, .event-strip, .section-heading, .filter-bar, .list-header, .song-info small, .song-extra, .song-favorite, .reader-top, .reader-meta, .reader-hint, .reader-controls, .offline-section, footer, .now-bar { display: none; }
dialog { width: min(530px, calc(100% - 28px)); max-height: 90dvh; padding: 26px; background: #171717; color: #ededed; border: 1px solid #3a3a3a; border-radius: 12px; box-shadow: 0 25px 100px #0009; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
dialog:not([open]) { display: none; }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 17px; }
.modal-heading h2 { font-size: 24px; font-weight: 500; margin: 7px 0 0; }
.eyebrow { color: #777; font-size: 8px; letter-spacing: 1.5px; }
.modal-copy { color: #969696; font-size: 12px; line-height: 1.9; margin-bottom: 20px; }
.field-label { display: block; color: #d2d2d2; font-size: 12px; margin: 17px 0 8px; }
.field-label span { display: block; color: #797979; font-size: 10px; margin-top: 4px; }
textarea, select, .standalone-search { width: 100%; background: #0d0d0d; color: #eee; border: 1px solid #3c3c3c; border-radius: 6px; padding: 11px; font-size: 14px; }
textarea { resize: vertical; line-height: 1.8; }
select { min-height: 44px; }
.import-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.file-button { display: inline-flex; align-items: center; gap: 7px; color: #aaa; min-height: 44px; cursor: pointer; font-size: 12px; }
.file-button svg { width: 16px; height: 16px; }
.error { min-height: 16px; color: #ff9a6b; font-size: 11px; }
.import-help { border-top: 1px solid #333; padding-top: 15px; margin-top: 14px; color: #8a8a8a; font-size: 11px; line-height: 1.8; }
.import-help summary { cursor: pointer; }
.outline-button { padding: 10px 13px; border: 1px solid #414141; border-radius: 6px; font-size: 11px; color: #d3d3d3; }
.subtle-button, .text-button { color: #b3b3b3; font-size: 11px; padding: 8px 0; }
.queue-row { width: 100%; padding: 14px 3px; display: flex; gap: 13px; text-align: left; border-bottom: 1px solid #2f2f2f; font-size: 13px; }
.queue-row > span:first-child { color: #777; font: 10px monospace; }
.queue-row > span:nth-child(2) { flex: 1; }
.queue-row small { color: #888; font-size: 9px; }
.queue-row.selected { color: var(--accent); }
.standalone-search { margin-bottom: 15px; }
.range-label, .toggle-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px; margin: 20px 0; font-size: 12px; }
.range-label input { width: 100%; accent-color: var(--accent); }
.range-label output { color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.source-links { display: grid; gap: 12px; margin: 24px 0; color: var(--accent); }
#aboutDialog > p { color: #aaa; font-size: 12px; line-height: 1.9; }
.toast { position: fixed; z-index: 200; bottom: 25px; left: 50%; transform: translate(-50%, 7px); padding: 12px 17px; max-width: calc(100% - 30px); background: #eee; color: #222; box-shadow: 0 8px 35px #0005; border-radius: 7px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 600px) {
  :root { --header-h: 66px; --search-h: 61px; }
  .topbar { padding: 13px 16px 8px; gap: 12px; }
  .brand { gap: 9px; }
  .brand::before { width: 5px; height: 25px; }
  .brand > span { font-size: 23px; }
  .brand-sub { font-size: 6px; letter-spacing: 1.3px; margin-top: 5px; }
  .city-badge { font-size: 9px; gap: 5px; }
  .header-info small { font-size: 8px; margin-top: 5px; letter-spacing: 0; }
  .global-search { padding: 4px 14px 13px; }
  .search-wrap { height: 44px; padding: 0 12px; border-radius: 8px; }
  .search-wrap input { font-size: 16px; }
  .search-wrap kbd { display: none; }
  main { padding: 0; }
  .workspace { grid-template-columns: 126px minmax(0, 1fr); border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .catalog { padding: 0 7px; }
  .finder { padding: 9px 0 8px; }
  .catalog-tabs { padding: 2px; gap: 1px; border-radius: 7px; }
  .catalog-tabs button { min-height: 36px; font-size: 10px; gap: 4px; padding: 6px 1px; }
  .catalog-tabs button span { font-size: 8px; }
  .song-select { display: block; min-height: 65px; padding: 9px 8px 10px; }
  .track-number { display: block; width: auto; font-size: 8px; margin-bottom: 4px; }
  .song-info strong { font-size: 12px; line-height: 1.4; }
  .song-row { margin: 2px 0; border-radius: 7px; }
  .reader-title { padding: 22px 18px 19px; }
  .reader-track { font-size: 7px; letter-spacing: 1.2px; }
  .reader-title h2 { font-size: 28px; letter-spacing: -.7px; margin-top: 10px; line-height: 1.15; }
  .demo-banner { margin: 0 18px; padding: 9px 0; font-size: 9px; gap: 1px; display: block; }
  .demo-banner button { display: block; font-size: 9px; min-height: 28px; padding: 3px 0 0; }
  .lyric-scroll { padding: 0 18px; }
  .lyric-content { padding-top: 15px; }
  .lyric-section { font-size: 7px; letter-spacing: .7px; line-height: 1.9; margin-top: 13px; }
  .lyric-line { font-size: calc(24px * var(--lyric-scale, 1)); line-height: 1.65; padding: 8px 0; letter-spacing: -.4px; }
  .reader-navigation { padding: 12px 10px max(12px, env(safe-area-inset-bottom)); gap: 5px; }
  .reader-navigation button { font-size: 10px; min-height: 42px; padding: 10px 8px; gap: 5px; }
  .reader-navigation > span { font-size: 8px; }
  .lyric-empty h3 { font-size: 16px; }
  .lyric-empty p { font-size: 11px; }
  .lyric-empty .primary { font-size: 10px; padding: 11px 13px; }
  .lyric-empty .primary svg { display: none; }
  .empty-list { padding: 20px 6px; font-size: 10px; }
  .empty-list strong { font-size: 12px; }
  .modal { padding: 22px 18px; }
  select, textarea, .standalone-search { font-size: 16px; }
}
@media (max-width: 360px) {
  .topbar { padding-left: 13px; padding-right: 13px; }
  .brand > span { font-size: 21px; }
  .header-info small { font-size: 7px; }
  .city-badge { font-size: 8px; }
  .global-search { padding-left: 11px; padding-right: 11px; }
  .workspace { grid-template-columns: 108px minmax(0, 1fr); }
  .catalog { padding: 0 5px; }
  .catalog-tabs button { font-size: 9px; gap: 3px; }
  .song-select { padding-left: 7px; padding-right: 5px; }
  .song-info strong { font-size: 11px; }
  .reader-title { padding-left: 14px; padding-right: 14px; }
  .reader-title h2 { font-size: 25px; }
  .demo-banner { margin-left: 14px; margin-right: 14px; }
  .lyric-scroll { padding-left: 14px; padding-right: 14px; }
  .lyric-line { font-size: calc(22px * var(--lyric-scale, 1)); }
  .reader-navigation { padding-left: 7px; padding-right: 7px; gap: 3px; }
  .reader-navigation button { padding-left: 6px; padding-right: 6px; font-size: 9px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Show the matching words beneath the song title, including on phones. */
.song-info .lyric-match { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; color: #a9a9a9; margin-top: 5px; }
.selected .song-info .lyric-match { color: #d8b5a3; }

/* Support stays behind one small control so the song list and lyrics keep their space. */
.global-search { display: flex; align-items: stretch; gap: 8px; }
.search-wrap { flex: 1; min-width: 0; }
.support-trigger { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 46px; border: 1px solid #553622; border-radius: 9px; background: #21170f; font-size: 21px; touch-action: manipulation; }
.support-trigger:hover { border-color: var(--accent); background: #302016; }
.support-modal { width: min(390px, calc(100% - 28px)); padding: 24px; }
.support-modal .modal-heading { margin-bottom: 12px; }
.support-modal h2 { font-size: 25px; font-weight: 650; line-height: 1.2; letter-spacing: -.5px; }
.support-modal .eyebrow { font-size: 8px; letter-spacing: 1px; color: #c9906f; }
.support-copy { color: #aaa; font-size: 13px; line-height: 1.7; margin: 0 0 20px; }
.support-qr { display: grid; justify-items: center; gap: 12px; }
.support-qr img { display: block; width: min(100%, 240px); height: auto; background: white; border: 8px solid white; border-radius: 8px; }
.support-qr span { color: #c6c6c6; font-size: 11px; text-align: center; }
.support-save { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; margin-top: 22px; background: #ff783d; color: #16100b; border-radius: 7px; font-size: 12px; font-weight: 650; touch-action: manipulation; }
.support-save svg { width: 16px; height: 16px; }
.support-instructions { color: #999; font-size: 11px; line-height: 1.8; text-align: center; margin: 14px 0; }
.support-thanks { font-size: 11px; line-height: 1.7; text-align: center; color: #777; margin: 18px 0 0; }
@media (max-width: 600px) { .support-trigger { height: 44px; } }

.support-tagline { color: #ccc; font-size: 13px; line-height: 1.6; margin: 0 0 14px; }
.support-modal .support-copy { font-size: 12px; line-height: 1.75; margin-bottom: 10px; }
.support-next { color: #888; font-size: 11px; line-height: 1.75; margin: 0 0 18px; }
.support-next strong { color: #ffc09b; font-weight: 550; }
.support-next span { padding: 0 4px; color: #666; }

.share-trigger { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 46px; padding: 0; border: 1px solid #333; border-radius: 9px; background: #191919; color: #c4c4c4; touch-action: manipulation; }
.share-trigger:hover { border-color: #777; color: #fff; }
.share-trigger svg { width: 19px; height: 19px; }
.share-link-label { display: block; margin: 20px 0 7px; font-size: 10px; color: #999; }
.share-url { display: block; width: 100%; min-height: 44px; padding: 10px; background: #0d0d0d; border: 1px solid #373737; border-radius: 6px; color: #ccc; font-size: 16px; }
.share-copy-button { width: 100%; margin-top: 12px; }
.share-save { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; margin-top: 8px; font-size: 12px; color: #aaa; touch-action: manipulation; }
.share-save:hover { color: #fff; }
.share-save svg { width: 15px; height: 15px; }
@media (max-width: 600px) { .share-trigger { height: 44px; } }

/* Keep support easy to spot without narrowing the song search. */
.header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header-actions .header-info { order: -1; }
.support-trigger { display: inline-flex; justify-content: center; align-items: center; gap: 7px; flex: none; width: auto; min-height: 44px; height: 44px; padding: 0 15px; border: 1px solid #ff9c70; background: #ff783d; color: #211109; border-radius: 9px; box-shadow: 0 4px 16px #ff783d18; }
.support-trigger .support-emoji { font-size: 19px; line-height: 1; }
.support-trigger .support-label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.support-trigger:hover { border-color: #ffb18a; background: #ff925f; color: #211109; }
.support-trigger:active { transform: translateY(1px); }
@media (max-width: 600px) {
  :root { --header-h: 82px; }
  .topbar { padding-top: 9px; padding-bottom: 9px; gap: 10px; }
  .header-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .header-actions .header-info { order: 0; display: flex; align-items: center; gap: 6px; }
  .header-actions .city-badge { font-size: 7px; letter-spacing: 0; gap: 4px; }
  .header-actions .header-info small { margin: 0; font-size: 7px; letter-spacing: 0; }
  .support-trigger { padding: 0 11px; }
  .support-trigger .support-label { font-size: 12px; }
  .support-trigger .support-emoji { font-size: 18px; }
}

