/* Uskrsnuo je – pjesmarica */
@import url(fonts.css);

:root {
  --bg: #f4eee2;
  --bg-2: #ece4d4;
  --paper: #fffcf6;
  --ink: #2a211b;
  --ink-2: #5d5147;
  --muted: #8f8274;
  --line: #e2d7c4;
  --line-2: #d3c5ad;
  --accent: #a3201c;
  --accent-deep: #7e1512;
  --accent-ink: #fffaf2;
  --accent-soft: #f5e0d9;
  --gold: #b08a3e;
  --gold-soft: #e9dcc0;
  --chord: #b3221b;
  --mark: #f8e08a;
  --shadow-sm: 0 1px 2px rgba(70, 45, 20, .06);
  --shadow: 0 1px 2px rgba(70, 45, 20, .05), 0 8px 24px -8px rgba(70, 45, 20, .14);
  --shadow-lg: 0 2px 4px rgba(70, 45, 20, .05), 0 18px 40px -12px rgba(70, 45, 20, .22);
  --radius: 14px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --st-yellow: #ecc85a;
  --st-grey: #b9b2a6;
  --st-white: #ffffff;
  --st-green: #a3d488;
  --st-blue: #98c6e3;
  --st-border: rgba(60, 40, 20, .5);

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 312px;
  --topbar: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110e; --bg-2: #1c1713; --paper: #211b16; --ink: #f0e8dc; --ink-2: #cbbfae; --muted: #988b7b;
    --line: #362d25; --line-2: #4a3e33; --accent: #e8695a; --accent-deep: #f08a7c; --accent-ink: #1a0e0b; --accent-soft: #3d201b;
    --gold: #d2ae63; --gold-soft: #3a3022; --chord: #ff8b7b; --mark: #6a5418;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 18px 40px -12px rgba(0,0,0,.6);
    --st-yellow: #c4a03a; --st-grey: #8a8378; --st-white: #e6e0d6; --st-green: #74a85c; --st-blue: #6b9fc0; --st-border: rgba(255,255,255,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15110e; --bg-2: #1c1713; --paper: #211b16; --ink: #f0e8dc; --ink-2: #cbbfae; --muted: #988b7b;
  --line: #362d25; --line-2: #4a3e33; --accent: #e8695a; --accent-deep: #f08a7c; --accent-ink: #1a0e0b; --accent-soft: #3d201b;
  --gold: #d2ae63; --gold-soft: #3a3022; --chord: #ff8b7b; --mark: #6a5418;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 18px 40px -12px rgba(0,0,0,.6);
  --st-yellow: #c4a03a; --st-grey: #8a8378; --st-white: #e6e0d6; --st-green: #74a85c; --st-blue: #6b9fc0; --st-border: rgba(255,255,255,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0; color: var(--ink); font: 17px/1.55 var(--sans); min-height: 100vh; overflow-x: hidden;
  background:
    var(--noise),
    radial-gradient(1200px 600px at 70% -10%, color-mix(in srgb, var(--gold-soft) 55%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.15; font-family: var(--serif); font-weight: 700; }
.i { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--paper); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Dark mode: the logo is dark ink on transparent */
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .side-logo, :root[data-theme="dark"] .hero-logo { filter: invert(.9) sepia(.3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo, :root:not([data-theme="light"]) .side-logo, :root:not([data-theme="light"]) .hero-logo { filter: invert(.9) sepia(.3); }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--gold) 25%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); flex: none; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-text { font: 700 24px/1 var(--serif); letter-spacing: .02em; }
.top-search { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.top-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--muted); pointer-events: none; }
.top-search-ico svg { width: 17px; height: 17px; }
.top-search input, .hero-search input, .dialog input {
  width: 100%; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper) 70%, var(--bg)); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.top-search input:focus, .hero-search input:focus, .dialog input:focus {
  border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.top-search input { height: 36px; padding: 0 14px 0 36px; font-size: 14.5px; }
.main-menu {
  position: absolute; top: calc(var(--topbar) - 6px); left: 12px; z-index: 50; min-width: 220px; padding: 6px;
  display: grid; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.main-menu[hidden] { display: none; }
.main-menu a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: 15px;
}
.main-menu a .i, .main-menu a svg { color: var(--gold); }
.main-menu a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.main-menu a.active { color: var(--accent); background: var(--accent-soft); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border: 0; background: transparent; border-radius: 10px; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn .nota { font-weight: 700; font-size: 15px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar {
  position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto;
  padding: 20px 20px 20px; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 65%, transparent);
  scrollbar-width: none;
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { display: none; }
.main { padding: 28px clamp(16px, 4vw, 56px) 96px; max-width: 1040px; width: 100%; margin: 0 auto; outline: none; }
.scrim { display: none; }
.bottombar { display: none; }

.side-block { margin-bottom: 22px; }
.side-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font: 700 15px/1 var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.side-title::before, .side-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.side-title::after { background: linear-gradient(90deg, var(--gold), transparent); }
.index-nav { display: grid; gap: 6px; }
.index-nav a, .side-links a, .quick a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); font-weight: 600; font-size: 15.5px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.index-nav a .ico { color: var(--gold); display: inline-flex; }
.index-nav a:hover, .quick a:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.index-nav a.active, .quick a.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.index-nav a.active .ico { color: var(--accent); }
.stage-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.stage-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 0 7px; border-radius: 12px; text-decoration: none;
  border: 1px solid var(--line); background: var(--paper); font-size: 10.5px; line-height: 1.1; color: var(--ink-2); letter-spacing: -.01em;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stage-btn:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.stage-btn.active { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; color: var(--ink); font-weight: 700; }
.stage-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--st-border); background: var(--sw);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.08); display: inline-flex; align-items: center; justify-content: center;
}
.stage-swatch .si { width: 15px; height: 15px; opacity: .85; }
.stage-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-tile {
  display: inline-flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 10px;
  background: var(--sw); border: 2px solid color-mix(in srgb, var(--ink) 55%, transparent);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08), var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.stage-tile.stage-white { background: #f4ecdc; }
.stage-tile .si { width: 54%; height: 54%; color: #2a1d12; opacity: .9; }
.stage-tile:hover { transform: translateY(-2px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08), var(--shadow); }
.stage-tile.active, .stage-tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.stage-tile.big { width: 64px; flex: none; cursor: default; }
.stage-tile.big:hover { transform: none; }
.stage-tile.sm { width: 38px; border-width: 1.5px; }
.stage-title { display: flex; align-items: center; gap: 16px; }
.stage-switch { display: flex; gap: 6px; }
.si { width: 15px; height: 15px; color: #3b2a1c; opacity: .8; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.quick a { flex-direction: column; gap: 4px; padding: 10px 4px 8px; font-size: 13.5px; text-align: center; }
.quick a .i { color: var(--accent); }
.side-links { display: none; gap: 2px; }
.side-links a { background: transparent; border-color: transparent; box-shadow: none; padding: 8px 12px; font-weight: 500; color: var(--ink-2); }
.side-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.side-links a.active { color: var(--accent); }
.side-logo-link { display: block; width: 96px; margin: auto auto 0; padding-top: 8px; }
.side-logo { display: block; width: 96px; opacity: .5; transition: opacity .15s; }
.side-logo-link:hover .side-logo { opacity: .85; }
@media (max-height: 700px) and (min-width: 900px) { .side-logo-link { display: none; } }

.stage-yellow { --sw: var(--st-yellow); }
.stage-grey { --sw: var(--st-grey); }
.stage-white { --sw: var(--st-white); }
.stage-green { --sw: var(--st-green); }
.stage-blue { --sw: var(--st-blue); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--sw); border: 1px solid var(--st-border); vertical-align: 0; margin-right: 8px; }
.dot:has(svg) { width: 1.5em; height: 1.5em; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.dot .si { width: 58%; height: 58%; }

/* ---------- Common page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.page-head h1 { margin: 0; font-size: clamp(32px, 4.4vw, 44px); color: var(--accent); letter-spacing: .01em; }
.lead { margin: 6px 0 0; color: var(--ink-2); max-width: 62ch; }
.head-actions, .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title {
  display: flex; justify-content: space-between; align-items: baseline; margin: 40px 0 12px;
  font: 700 24px/1.1 var(--serif); color: var(--ink); letter-spacing: .01em;
}
.section-title .more { font: 600 14px var(--sans); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm); transition: filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.05); box-shadow: var(--shadow); }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-2); }
.btn.danger { color: #fff; background: #a3241a; border-color: #a3241a; }
.btn.ghost.danger { color: var(--accent); background: var(--paper); border-color: var(--line); }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0 4px; text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-style: italic; }
.loading { padding: 120px 0; text-align: center; color: var(--muted); font: italic 22px var(--serif); }
.filter-banner { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 16px; font-size: 15px; }

.song-list {
  display: grid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.song-list:has(> .empty) { box-shadow: none; }
.song-row, .list-item {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.song-list > :last-child { border-bottom: 0; }
.song-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; text-decoration: none; color: var(--ink); min-height: 54px;
  transition: background .12s;
}
.song-row:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.song-row:hover .row-title { color: var(--accent-deep); }
.page-badge {
  flex: none; min-width: 46px; height: 30px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 999px; background: color-mix(in srgb, var(--sw) 55%, var(--paper)); border: 1px solid color-mix(in srgb, var(--sw) 70%, var(--st-border));
  font: 700 13px/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums;
}
.stage-white .page-badge, .page-badge.stage-white { background: var(--paper); border-color: var(--st-border); }
.page-badge.big { min-width: 62px; height: 40px; font-size: 16px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 600; text-transform: uppercase; letter-spacing: .02em; font-size: 15px; transition: color .12s; }
.alt-title { font-style: italic; font-weight: 500; color: var(--ink-2); text-transform: none; font-family: var(--serif); font-size: 18px; letter-spacing: 0; }
.row-sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row-sub .ref { color: var(--gold); font-weight: 700; margin-right: 6px; }
.row-fav { color: var(--accent); display: inline-flex; }
.author { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--bg); }
.snippet { white-space: nowrap; font-style: italic; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; font-style: normal; }

.letter-jump, .toc {
  position: sticky; top: var(--topbar); z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; padding: 10px 0;
  margin-bottom: 8px;
  /* the page's own background, fixed to the viewport, so the sticky bar blends in */
  background:
    var(--noise),
    radial-gradient(1200px 600px at 70% -10%, color-mix(in srgb, var(--gold-soft) 55%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.letter-jump a {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  text-decoration: none; font: 700 19px/1 var(--serif); color: var(--ink-2);
}
.letter-jump a:hover { background: var(--paper); color: var(--accent); box-shadow: var(--shadow-sm); }
.toc { position: static; gap: 6px; background: none; }
.toc a { white-space: nowrap; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.letter { display: flex; align-items: center; gap: 14px; font-size: 36px; color: var(--accent); margin: 30px 0 10px 4px; }
.letter::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); opacity: .6; }
.stage-head { font-size: 24px; color: var(--ink); }
.index-group { margin-top: 24px; }
.group-title { font-size: 30px; color: var(--accent); margin: 36px 0 4px; }
.index-section h3 { font: 700 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin: 22px 0 10px 4px; }

/* ---------- Ornament ---------- */
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); margin: 14px auto; max-width: 340px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament::after { background: linear-gradient(90deg, var(--gold), transparent); }
.ornament span { font-size: 18px; line-height: 1; }

/* ---------- Home ---------- */
.hero { text-align: center; padding: clamp(16px, 5vw, 44px) 0 8px; }
.medallion {
  width: clamp(104px, 15vw, 150px); aspect-ratio: 1; margin: 0 auto 18px; border-radius: 50%; padding: 12px;
  background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 0 0 7px color-mix(in srgb, var(--paper) 60%, transparent), 0 0 0 8px color-mix(in srgb, var(--gold) 50%, transparent), var(--shadow-lg);
  display: grid; place-items: center;
}
.hero-logo { width: 100%; height: 100%; object-fit: contain; }
.hero-kicker { margin: 0 0 6px; font: 700 13px/1.3 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.hero-title {
  margin: 0; font: 700 clamp(52px, 10vw, 104px)/.95 var(--serif); color: var(--accent); letter-spacing: .01em;
  text-shadow: 0 1px 0 color-mix(in srgb, var(--paper) 70%, transparent);
}
.hero-quote { margin: 0 auto; max-width: 46ch; font: italic 500 clamp(18px, 2.3vw, 22px)/1.4 var(--serif); color: var(--ink-2); }
.hero-quote cite { display: block; font: 600 13px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; font-style: normal; }
.hero-meta { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.hero-search { position: relative; margin: 28px auto 36px; max-width: 640px; }
.hero-search .i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hero-search input { padding: 16px 20px 16px 52px; font-size: 18px; background: var(--paper); box-shadow: var(--shadow-lg); border-color: var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 20px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold)); opacity: 0; transition: opacity .18s; }
.card .i { color: var(--accent); width: 28px; height: 28px; margin-bottom: 4px; }
.card b { font: 700 25px/1.1 var(--serif); }
.card span { color: var(--ink-2); font-size: 15px; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.stage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 10px; }
.stage-card {
  text-decoration: none;
  position: relative; text-align: left; padding: 16px 16px 14px 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--sw) 45%, var(--paper)), var(--paper) 75%); color: var(--ink);
  display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.stage-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--sw); border-right: 1px solid var(--st-border); }
.stage-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stage-card-name { font: 700 21px/1.1 var(--serif); }
.stage-card-ico { position: absolute; right: 12px; bottom: 10px; color: var(--ink); opacity: .14; line-height: 0; }
.stage-card-ico .si { width: 34px; height: 34px; color: inherit; opacity: 1; }
.stage-card { padding-bottom: 44px; }
.stage-card-meta { font-size: 13.5px; color: var(--ink-2); }

/* ---------- Lists ---------- */
.lists { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); }
.list-row .row-title { font: 700 21px/1.1 var(--serif); text-transform: none; letter-spacing: 0; }
.list-row > .i:first-child { color: var(--gold); }
.list-row:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.list-item { display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.list-item .song-row { flex: 1; min-width: 0; border: 0; }
.list-no { width: 32px; text-align: right; color: var(--gold); font: 700 18px var(--serif); flex: none; }
.row-ctrl { display: flex; flex: none; }

/* ---------- Song ---------- */
.song { --song-scale: 1; }
.song-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -12px 0 6px; color: var(--muted); font-size: 14px; }
.song-nav-label { text-align: center; }
.song-head { display: flex; align-items: flex-start; gap: 18px; }
.song-head > div { flex: 1; min-width: 0; }
.song-head .page-badge { margin-top: 6px; }
.song-title { margin: 0; font-size: clamp(32px, 4.6vw, 46px); color: var(--accent); letter-spacing: .01em; }
.song-subtitle { margin: 4px 0 0; font: italic 500 20px/1.3 var(--serif); color: var(--ink-2); }
.song-meta { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; }
.song-meta .ref { font-weight: 700; color: var(--gold); }
.song-meta .sep { margin: 0 8px; color: var(--line-2); }
.song-alt { margin: 4px 0 0; font: italic 500 17px var(--serif); color: var(--muted); }
.fav { color: var(--muted); }
.fav.on { color: var(--accent); background: transparent; }

.song-tools {
  position: sticky; top: var(--topbar); z-index: 10; margin: 18px 0 12px; padding: 6px 8px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.3) blur(10px);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.tool-group { display: flex; align-items: center; gap: 2px; }
.tool-group + .tool-group { padding-left: 10px; border-left: 1px solid var(--line); }
.transpose { background: var(--bg); border-radius: 12px; padding: 2px; }
.tool-group.transpose + .tool-group { border-left: 0; }
.key-select { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.key-select span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.key-select select {
  border: 1px solid var(--line); background: var(--paper); border-radius: 9px; padding: 6px 4px 6px 8px; font-weight: 700; color: var(--chord); width: auto;
}
.shift { font-size: 12px; color: var(--muted); min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.shift.moved { color: var(--chord); font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--ink-2); }
.chip.on { border-color: var(--chord); color: var(--chord); background: var(--accent-soft); }

.diagrams { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.chord-card { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.chord-card:hover { border-color: var(--chord); transform: translateY(-1px); }
.chord-card.sm { width: 80px; padding: 4px 2px 2px; }
.chord-count { font-size: 12px; color: var(--muted); }
.diagram { width: 100%; max-width: 88px; display: block; }
.d-name { font: 700 12px var(--sans); fill: var(--chord); }
.d-fret { stroke: var(--line-2); stroke-width: 1; }
.d-nut { stroke: var(--ink); stroke-width: 3; }
.d-string { stroke: var(--ink-2); stroke-width: 1; }
.d-dot { fill: var(--ink); }
.d-open { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.d-mark { font: 10px var(--sans); fill: var(--muted); }
.d-base { font: 10px var(--sans); fill: var(--ink-2); }
.no-diagram { display: flex; align-items: center; justify-content: center; min-height: 80px; font-weight: 700; color: var(--chord); }

.song-body {
  position: relative; font-family: var(--sans); font-size: calc(18px * var(--song-scale)); line-height: 1.38;
  background: var(--noise), var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 3.5vw, 40px) clamp(14px, 3.5vw, 44px); box-shadow: var(--shadow-lg);
}
.song-body::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 7px; border-radius: 0 5px 5px 0; background: var(--sw, var(--gold)); border: 1px solid var(--st-border); border-left: 0; }
.line { display: flex; align-items: flex-end; gap: .5em; margin: 0; break-inside: avoid; }
.line.chorded { margin-top: .2em; }
.role {
  flex: none; width: 4.1em; /* = 3.2em of the line, at .78 size */ text-align: right; font-weight: 700; font-size: .78em; color: var(--muted); padding-bottom: .14em; white-space: nowrap;
}
.role-K { color: #8a6418; }
.role-Z { color: var(--accent); }
.role-KZ { color: #4e6e2c; }
.role-P { color: #355d8a; }
.role-D { color: #8a4f8a; }
:root[data-theme="dark"] .role-K { color: #d9b45b; }
:root[data-theme="dark"] .role-KZ { color: #a3cc78; }
:root[data-theme="dark"] .role-P { color: #8fb5e0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .role-K { color: #d9b45b; }
  :root:not([data-theme="light"]) .role-KZ { color: #a3cc78; }
  :root:not([data-theme="light"]) .role-P { color: #8fb5e0; }
}
.line:not(.has-role) { padding-left: calc(3.2em + .5em); }
.lyrics { flex: 1; min-width: 0; }
.lyrics.plain { white-space: pre-wrap; }
.word { white-space: nowrap; }
.tok { display: inline-flex; flex-direction: column; vertical-align: bottom; white-space: pre; }
.ch {
  font: 700 .84em/1.25 var(--sans); color: var(--chord); min-height: 1.25em; padding: 0 .35em 0 0; margin: 0;
  border: 0; background: none; text-align: left; white-space: nowrap; align-self: flex-start; letter-spacing: .01em;
}
button.ch { cursor: pointer; border-radius: 4px; }
button.ch:hover { background: var(--accent-soft); }
span.ch { padding: 0; }
.tok.bare .ch { padding-right: .5em; }
.tok.cont .ly { display: flex; }
.tok.cont .ly::after { content: ""; flex: 1 1 0; border-bottom: 1px dotted var(--muted); margin-bottom: .3em; min-width: 0; }
.no-chords .line, .no-chords .line.chorded { margin-top: 0; }
.stanza + .stanza { margin-top: 1em; }
.stanza { break-inside: avoid; }
.song-body.two-col { columns: 2; column-gap: 2.5em; column-rule: 1px solid var(--line); }
.song-body.two-col .stanza { display: flow-root; }
.note { color: var(--chord); font-style: italic; font-size: .84em; margin: .7em 0 .2em calc(3.7em); }
.line-sub { font: italic 500 1.1em var(--serif); color: var(--ink-2); margin: .3em 0 .3em calc(3.4em); }
.capo-line { display: inline-flex; align-items: center; gap: 6px; font-size: .78em; font-weight: 600; color: var(--chord); border: 1px solid color-mix(in srgb, var(--chord) 50%, transparent); background: var(--accent-soft); border-radius: 999px; padding: 2px 12px; margin: .2em 0 .7em calc(3.7em); }
.capo-line .i { width: 16px; height: 16px; }

/* Presentation (full screen) */
.presenting .song, .song:fullscreen { background: var(--bg); overflow-y: auto; padding: 3vh 4vw; }
.song:fullscreen .song-tools, .song:fullscreen .song-nav, .song:fullscreen .diagrams, .song:fullscreen .fav, .song:fullscreen .song-alt { display: none; }
.song:fullscreen .song-body { font-size: calc(28px * var(--song-scale)); border: 0; box-shadow: none; background: transparent; }

/* ---------- Popover, toast, dialog ---------- */
.popover {
  position: fixed; z-index: 60; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; box-shadow: var(--shadow-lg);
  width: 132px; text-align: center;
}
.popover .diagram { max-width: 110px; margin: 0 auto; }
.pop-note { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70;
  background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px; font-size: 15px; transition: .2s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dialog { border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(440px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(30, 20, 12, .45); backdrop-filter: blur(2px); }
.dialog h2 { margin: 0 0 14px; font-size: 26px; color: var(--accent); }
.dialog input { border-radius: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.list-picks { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.list-pick { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); text-align: left; }
.list-pick:hover { border-color: var(--accent); }
.list-pick small { margin-left: auto; color: var(--muted); }

/* ---------- Settings & about ---------- */
.settings { display: grid; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 20px; box-shadow: var(--shadow); }
.set-row, .switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.settings > :last-child { border-bottom: 0; }
.set-row small, .switch small { display: block; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: transparent; padding: 7px 15px; font-size: 14.5px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.switch { justify-content: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: .2s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.prose { max-width: 68ch; }
.intro { max-width: 72ch; }
.intro p { margin: 0 0 14px; line-height: 1.65; }
.intro-sec { scroll-margin-top: calc(var(--topbar) + 16px); }
.intro .epigraph { max-width: 34ch; margin-left: auto; font-size: 20px; }
.intro blockquote.papal { font: 400 17px/1.7 var(--sans); padding: 18px 24px; }
.intro blockquote.papal p { margin: 0 0 12px; }
.intro blockquote.papal p:last-child { margin: 0; }
.intro .source { margin-top: -12px; font-size: 13.5px; color: var(--muted); font-style: italic; }
.stage-list { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 8px; }
.stage-list li { display: flex; align-items: center; gap: 12px; }
.stage-btn-inline { display: inline-flex; text-decoration: none; }
.intro details summary { cursor: pointer; list-style: none; }
.intro details summary::-webkit-details-marker { display: none; }
.intro details summary h2 { display: inline; }
.intro details summary h2::after { content: " ›"; color: var(--gold); }
.intro details[open] summary h2::after { content: " ⌄"; }
.errata { padding-left: 18px; font-size: 15px; color: var(--ink-2); }
.errata li { margin: 4px 0; }
.imprint { margin-top: 28px; font-size: 13.5px; color: var(--muted); text-align: center; }
.prose h2 { font-size: 28px; color: var(--accent); margin: 34px 0 8px; }
blockquote { margin: 0 0 24px; padding: 20px 26px; border-left: 3px solid var(--gold); background: var(--paper); border-radius: 0 14px 14px 0; font: italic 500 22px/1.45 var(--serif); box-shadow: var(--shadow-sm); }
blockquote cite { display: block; margin-top: 10px; font: 600 13px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-style: normal; }
.stage-legend { list-style: none; padding: 0; }
.stage-legend li { margin: 6px 0; }
.authors { columns: 2; }
table.notation { border-collapse: collapse; margin: 12px 0; background: var(--paper); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
table.notation th, table.notation td { border: 1px solid var(--line); padding: 6px 14px; text-align: center; }
table.notation th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.notation td:nth-child(-n+2) { font-weight: 700; color: var(--chord); }

/* ---------- Account ---------- */
.user-btn { margin-left: 4px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; font: 700 14px/1 var(--sans); letter-spacing: .02em;
}
.avatar.big { width: 84px; height: 84px; font: 700 34px/1 var(--serif); box-shadow: var(--shadow); flex: none; }
.auth { display: flex; justify-content: center; padding: 8px 0 40px; }
.auth-card {
  width: min(460px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 30px clamp(18px, 4vw, 36px) 24px; text-align: center;
}
.auth-logo { width: 64px; height: 64px; opacity: .8; }
.auth-card h1 { margin: 8px 0 4px; font-size: 32px; color: var(--accent); }
.auth-card .lead { margin: 0 auto 18px; font-size: 15px; }
.auth-tabs { margin-bottom: 18px; }
.auth-tabs a { padding: 7px 18px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.auth-tabs a.on { background: var(--paper); color: var(--accent); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 14px; text-align: left; }
.auth-form label, .dlg-label { display: grid; gap: 6px; font-weight: 600; font-size: 14.5px; }
.dlg-label { margin-top: 12px; }
.auth-form label small, .dlg-label small { font-weight: 400; color: var(--muted); }
.auth-form input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); outline: none; font-size: 16px;
}
.auth-form input:focus { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.auth-submit { justify-content: center; padding: 12px; font-size: 16px; margin-top: 4px; }
.auth-error { margin: 0; color: var(--accent); font-weight: 600; font-size: 14.5px; }
.auth-note { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.auth-note.warn { color: var(--accent); margin: 0 0 14px; }
.profile-head { display: flex; align-items: center; gap: 22px; margin: 8px 0 24px; flex-wrap: wrap; }
.profile-id h1 { margin: 0; font-size: clamp(30px, 4vw, 40px); color: var(--accent); }
.profile-id p { margin: 4px 0 0; }
.sync-status { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.sync-status .i { width: 18px; height: 18px; color: var(--gold); }
.sync-status.synced .i { color: #4e8a3a; }
.sync-status.error .i, .sync-status.offline .i { color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat {
  display: grid; justify-items: start; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .i { color: var(--accent); }
.stat b { font: 700 28px/1.15 var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.stat span { font-size: 14px; color: var(--ink-2); }

/* ---------- Mobile ---------- */
@media (max-width: 899px) {
  :root { --topbar: 56px; }
  body { font-size: 16px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .side-links { display: grid; }
  .main-menu:not([hidden]) { display: none; }
  .brand-text { display: none; }
  .top-search { margin-left: 0; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 40; top: 0; left: 0; height: 100%; width: min(320px, 86vw); transform: translateX(-102%);
    transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); background: var(--bg);
  }
  .menu-open .sidebar { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20, 14, 10, .4); }
  .main { padding: 16px 14px 100px; }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottombar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 600; text-decoration: none; color: var(--muted); }
  .bottombar a.active { color: var(--accent); }
  .toc a { padding: 5px 11px; font-size: 13px; }
  .hero-search { margin: 22px 0 28px; }
  .hero-search input { font-size: 16px; padding: 14px 16px 14px 46px; }
  .hero-search .i { left: 16px; }
  .song-row { padding: 9px 10px; gap: 10px; }
  .page-badge { min-width: 40px; }
  .song-head { gap: 12px; }
  .song-tools { gap: 4px 6px; margin: 12px -14px 10px; padding: 6px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 0; border-left: 0; border-right: 0; }
  .song-tools::-webkit-scrollbar { display: none; }
  .song-tools .icon-btn { width: 36px; height: 36px; }
  .tool-group + .tool-group { padding-left: 6px; }
  .key-select span { display: none; }
  .song-body { padding: 16px 12px 18px 8px; border-radius: 12px; margin: 0 -4px; }
  .role { width: 3.33em; }
  .line:not(.has-role) { padding-left: calc(2.6em + .5em); }
  .note, .line-sub, .capo-line { margin-left: 3.1em; }
  .author { display: none; }
  .row-ctrl .icon-btn.sm { width: 30px; }
  .authors { columns: 1; }
  .toast { bottom: 92px; }
  .letter { font-size: 30px; }
  .song-title { font-size: 28px; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .sidebar, .bottombar, .song-tools, .song-nav, .fav, .diagrams, .toast { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .song-body { border: 0; box-shadow: none; padding: 0; background: none; }
  .song-body::before { display: none; }
  .ch { color: #b3241b; }
}
