:root {
  color-scheme: light dark;
  --surface: #fff;
  --text: #242424;
  --muted: #626262;
  --line: #ddd;
  --link: #145baa;
  --soft: #f5f7f9;
  --song-red: #b24747;
  --song-font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #191b1e;
    --text: #eee;
    --muted: #b8bec5;
    --line: #45494f;
    --link: #8bbfff;
    --soft: #25282d;
    --song-red: #ee9898;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--text); font: 16px/1.5 system-ui, sans-serif; }
a { color: var(--link); text-underline-offset: .15em; }
button, input { font: inherit; }
button { min-height: 44px; padding: .5rem .8rem; color: var(--text); background: var(--soft); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.archive { max-width: 960px; margin: 0 auto; padding: 20px 16px; }
.site-header { margin-bottom: 12px; }
h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.3; overflow-wrap: anywhere; }
.all-songs { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; }
.song-search { max-width: 32rem; margin-bottom: 20px; }
.search-controls { position: relative; }
.search-controls input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 48px 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text); }
.search-controls input::-webkit-search-cancel-button { display: none; }
#clear-search { position: absolute; top: 0; right: 0; width: 44px; height: 100%; padding: 0; border: 0; background: transparent; font-size: 1.5rem; }
.song-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 32px; }
.song-list a { display: block; min-height: 44px; padding: 10px 0; overflow-wrap: anywhere; }
.song-note { color: var(--muted); font-size: .9em; }
.site-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.song-title-row { display: flex; align-items: flex-start; gap: 12px; }
.song-title-row h1 { flex: 1; min-width: 0; font-family: "Courier New", monospace; font-size: clamp(1.2rem, 3vw, 1.65rem); color: var(--song-red); }
.song-title-row:has(.font-controls:not([hidden])) h1 { padding-top: calc((44px - 1.3em) / 2); }
.font-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 0; margin-right: -8px; }
.font-symbol, .font-controls button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 44px; padding: 0; color: var(--muted); }
.font-controls button { border: 0; background: transparent; }
.font-controls svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.font-controls button:hover { background: var(--soft); }
.song-content { font-family: "Courier New", monospace; font-size: var(--song-font-size); line-height: 1.5; }
.song-content [style*="color:red"], .song-content [style*="color: red"] { color: var(--song-red) !important; }
.archive-context { display: flex; align-items: flex-start; gap: 8px; font: 13px/1.5 system-ui, sans-serif; color: var(--muted); margin-bottom: 16px; overflow-wrap: anywhere; }
.archive-trail { flex: 1; min-width: 0; }
.archive-context span { font-size: inherit !important; text-transform: none !important; }
.archive-context .all-songs { display: inline; padding: 10px 0; margin: 0; }
.search-link { position: relative; display: inline-flex; flex: 0 0 28px; align-items: center; justify-content: center; height: 1.5em; margin-right: -6px; color: var(--muted); }
.search-link::before { content: ""; position: absolute; inset: -6px 0; }
.song-line { min-height: 1.5em; }
.song-prose { white-space: normal; overflow-wrap: anywhere; }
.song-passage { max-width: 100%; overflow-x: auto; white-space: nowrap; }
.diagram-block { padding-bottom: 8px; margin-top: 16px; margin-bottom: 12px; }
.song-content img { max-width: 100%; height: auto; }
.song-passage td { white-space: nowrap; }
.song-content table { border-spacing: 0; border-collapse: collapse; }
.chord-diagrams, .chord-diagrams tbody, .chord-diagrams tr { display: block; width: auto !important; }
.chord-diagrams tbody { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.chord-diagrams tr { display: contents; }
.chord-diagrams td { display: block; padding: 0 !important; width: auto !important; flex: 0 0 auto; }
@media (min-width: 720px) {
  .archive { padding: 32px 24px; }
  .song-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .archive { max-width: none; padding: 0; }
  .font-controls, .all-songs { display: none !important; }
  .song-passage { overflow: visible; }
}
