/* IPBA — worship app. Mobile-first, dark by default. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #161616;
  --bg-card: #161616;
  --bg-card-hover: #1e1e1e;
  --bg-soft: #222222;
  --text: #ffffff;
  --text-muted: #b8b8b8;
  --text-faint: #8c8c8c;
  --border: #2a2a2a;
  --border-soft: #222222;
  --accent: #ff8a1a;
  --accent-fill: #331c00;
  --accent-soft: rgba(255, 138, 26, 0.16);
  --chord: #ff8a1a;
  --danger: #e25555;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --nav-h: 64px;
  --side-w: 232px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "IBM Plex Mono", ui-monospace, "Courier New", monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f4ee;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3efe7;
  --bg-soft: #efeae1;
  --text: #1a1612;
  --text-muted: #5c564c;
  --text-faint: #8a8478;
  --border: #e6e0d4;
  --border-soft: #ece7dc;
  --accent: #e07010;
  --accent-fill: #fff0e0;
  --accent-soft: rgba(224, 112, 16, 0.12);
  --chord: #c85a00;
  --danger: #c03030;
  --shadow: 0 8px 28px rgba(80, 60, 20, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
img { display: block; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#app { height: 100%; }

.boot {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ——— Shell ——— */
.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.main {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.main.main-song {
  padding-top: 8px;
}
.main.main-flush {
  padding-left: 0;
  padding-right: 0;
}

/* ——— Bottom nav (mobile) ——— */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.tabbar a, .tabbar button.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  min-width: 0;
  text-decoration: none;
  padding-top: 6px;
}
.tabbar a.active, .tabbar button.tab.active {
  color: var(--accent);
  font-weight: 600;
}
.tabbar svg { width: 22px; height: 22px; }

/* ——— Side nav (tablet+) ——— */
.sidenav { display: none; }

/* ——— Typography & page chrome ——— */
.page-title {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-head .page-title { margin-right: auto; }

/* ——— Search ——— */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 48px;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search svg { color: var(--text-faint); flex-shrink: 0; }
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  min-width: 0;
  height: 100%;
  font-size: 16px;
}
.search input::placeholder { color: var(--text-faint); }
.search .clear {
  color: var(--text-faint);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
}

/* ——— Cards & list rows ——— */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.song-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.song-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 12px 14px;
  min-height: 52px;
  text-align: left;
  width: 100%;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.song-row:hover, .song-row:active { background: var(--bg-card-hover); }
.song-row .dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  min-width: 12px;
}
.song-row .meta {
  flex: 1;
  min-width: 0;
}
.song-row .name {
  font-size: 0.98rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-row .key {
  color: var(--text-faint);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  font-family: var(--mono);
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
[data-theme="light"] .dot { box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.letter-h {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 4px 4px;
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 2;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.btn-accent {
  background: var(--accent-fill);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
}
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn .badge {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  flex-shrink: 0;
}
.icon-btn.accent {
  background: var(--accent-fill);
  border-color: var(--accent);
  color: var(--accent);
}
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.fab {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-fill);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ——— Legend ——— */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin: 14px 0 4px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
}
.legend-item.active {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}
.legend-item .dot { width: 9px; height: 9px; }
.legend-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin: 2px 2px 8px;
}

/* ——— Category editor (row button) ——— */
.cat-edit {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.cat-edit:hover { background: var(--bg-soft); color: var(--text); }

/* ——— Song view toolbar ——— */
.song-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 8;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 0 10px;
  margin-top: -4px;
}
.song-toolbar-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.segmented {
  display: flex;
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  min-width: 0;
}
.segmented button {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--text-muted);
  min-width: 0;
  padding: 0 8px;
}
.segmented button.on {
  background: var(--accent-fill);
  color: var(--accent);
  font-weight: 650;
  box-shadow: 0 0 0 1px var(--accent);
}
.transpose-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.transpose-row .center {
  flex: 1;
  text-align: center;
  font-weight: 650;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.transpose-row .hint {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-top: 1px;
}
.pref-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-left: auto;
}
.pref-toggle button {
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--bg-elevated);
}
.pref-toggle button.on {
  background: var(--accent-fill);
  color: var(--accent);
}
.setlist-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setlist-nav .pos {
  flex: 1;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.toolbar-actions { display: flex; gap: 8px; }
.toolbar-actions .btn { flex: 1; }

/* ——— Chart ——— */
.chart {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.28;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0, "kern" 0;
  letter-spacing: 0;
  padding-bottom: 32px;
}
.chart-head {
  margin-bottom: 1.15em;
  font-family: var(--mono);
}
.chart-title-row {
  font-size: 1.05em;
  margin-bottom: 0.2em;
}
.chart-title-row strong {
  font-weight: 700;
  font-size: 1.08em;
}
.chart-key-row { margin-bottom: 0; }
.chart-intro-row {
  margin-top: 1em;
  margin-bottom: 1em;
}
.chart-intro-row .ch,
.intro-chords {
  color: var(--chord);
  font-weight: 650;
  white-space: pre-wrap;
}
.chart-body { min-width: 0; }
.chart-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 0 0 0.22em;
  /* wrapping unit is a syllable/word column */
}
.chart-seg {
  display: inline-flex;
  flex-direction: column;
  white-space: pre;
  font-family: var(--mono);
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0, "kern" 0;
}
.chart-seg .ch {
  color: var(--chord);
  font-weight: 650;
  line-height: 1.25;
}
.chart-seg .ly {
  color: var(--text);
  line-height: 1.3;
}
.chart-lyric {
  font-family: var(--mono);
  white-space: pre-wrap;
  margin: 0 0 0.18em;
  font-variant-ligatures: none;
}
.chart-directive {
  font-family: var(--mono);
  color: var(--text-muted);
  font-style: italic;
  white-space: pre-wrap;
  margin: 0.45em 0;
  font-size: 0.92em;
}
.chart-blank { height: 0.75em; }
.chart-note {
  margin-top: 20px;
  color: var(--text-faint);
  font-size: 0.8rem;
  font-family: var(--font);
  font-style: italic;
}

/* ——— Setlists ——— */
.setlist-card {
  display: block;
  text-align: left;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.setlist-card .t { font-size: 1.05rem; font-weight: 620; }
.setlist-card .d { color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }
.setlist-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 16px;
}
.empty p { margin-top: 6px; font-size: 0.92rem; }

.form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input, .field select, .time-parts {
  width: 100%;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  outline: none;
  font-size: 16px;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.time-parts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}
.time-parts select {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 8px;
}
.time-parts .sep { color: var(--text-faint); font-weight: 650; }

.setlist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px 8px 4px;
  touch-action: none;
  user-select: none;
  position: relative;
  background-clip: padding-box;
}
.setlist-item.dragging {
  opacity: 0.92;
  box-shadow: var(--shadow);
  z-index: 5;
}
.setlist-item .drag-handle {
  width: 44px; height: 48px;
  display: grid; place-items: center;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}
.setlist-item .drag-handle:active { cursor: grabbing; }
.setlist-item .meta { flex: 1; min-width: 0; }
.setlist-item .name {
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setlist-item .sk {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.setlist-item .rm {
  color: var(--text-faint);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
}
.setlist-item .rm:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ——— Metronome ——— */
.metro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.dial-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  margin: 8px 0 18px;
}
.dial {
  width: 220px;
  height: 220px;
  position: relative;
  touch-action: none;
  user-select: none;
  flex-shrink: 0;
}
.dial svg { width: 100%; height: 100%; display: block; }
.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dial-center .bpm {
  font-size: 3.2rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dial-center .bpm-lbl {
  color: var(--text-faint);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-top: 4px;
}
.beats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 28px;
  margin: 4px 0 22px;
}
.beat-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.06s, border-color 0.06s, transform 0.06s;
}
.beat-dot.on {
  background: var(--text-muted);
  border-color: var(--text-muted);
  transform: scale(1.12);
}
.beat-dot.on.accent {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.metro-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.metro-actions .btn { flex: 1; }
.metro-actions .btn-play {
  background: var(--accent-fill);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.metro-actions .btn-play.playing {
  background: var(--accent);
  color: #111;
}
.sig-current {
  margin-top: 18px;
  width: 100%;
}
.sig-groups { width: 100%; margin-top: 14px; }
.sig-group { margin-bottom: 14px; }
.sig-group h3 {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.sig-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-pills button {
  min-width: 58px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.sig-pills button.on {
  background: var(--accent-fill);
  border-color: var(--accent);
  color: var(--accent);
}
.metro-slider {
  width: 100%;
  margin: 4px 0 8px;
  accent-color: var(--accent);
  height: 24px;
}

/* ——— Sobre ——— */
.about-hero {
  padding: 12px 0 20px;
}
.about-hero .brand {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.about-hero .brand span { color: var(--accent); }
.about-list { display: flex; flex-direction: column; gap: 10px; }
.about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  width: 100%;
  color: var(--text);
}
.about-row .k { font-weight: 550; }
.about-row .v { color: var(--text-muted); font-size: 0.88rem; }
.about-fine {
  margin-top: 22px;
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.5;
}
.toggle {
  display: flex;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid var(--border);
}
.toggle button {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.toggle button.on {
  background: var(--accent-fill);
  color: var(--accent);
}

/* ——— Sheets & dialogs ——— */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(16px);
  transition: transform 0.22s;
  box-shadow: var(--shadow);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 6px auto 14px;
}
.sheet h2 { font-size: 1.15rem; font-weight: 650; margin-bottom: 4px; }
.sheet .hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 14px; }
.cat-grid { display: flex; flex-direction: column; gap: 4px; }
.cat-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.cat-opt:disabled { opacity: 0.38; }
.cat-opt .box {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  display: grid; place-items: center;
  background: var(--bg);
  flex-shrink: 0;
}
.cat-opt.on .box {
  background: var(--accent-fill);
}
.cat-opt .box svg { width: 14px; height: 14px; color: var(--accent); }
.picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }

/* ——— Início extras ——— */
.add-wrap { margin-top: 22px; }
.add-wrap .btn { width: 100%; height: 48px; }

/* ——— Responsive ——— */
@media (min-width: 768px) {
  .tabbar { display: none; }
  .sidenav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--side-w);
    border-right: 1px solid var(--border);
    background: var(--bg);
    padding: 22px 14px 18px;
    z-index: 30;
  }
  .sidenav .brand {
    font-size: 1.45rem;
    font-weight: 730;
    letter-spacing: -0.03em;
    padding: 4px 12px 22px;
  }
  .sidenav .brand span { color: var(--accent); }
  .sidenav nav { display: flex; flex-direction: column; gap: 4px; }
  .sidenav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 550;
    font-size: 0.95rem;
  }
  .sidenav a.active {
    background: var(--accent-fill);
    color: var(--accent);
    font-weight: 650;
  }
  .sidenav a svg { width: 20px; height: 20px; }
  .shell { padding-left: var(--side-w); }
  .main {
    padding: 28px 32px 48px;
    max-width: 980px;
  }
  .main.main-song { max-width: 1100px; }
  .sheet {
    border-radius: 20px;
    margin-bottom: 40px;
    max-width: 480px;
  }
  .sheet-backdrop { align-items: center; }
}
@media (min-width: 1024px) {
  .split {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 28px;
    align-items: start;
  }
  .split .list-pane {
    position: sticky;
    top: 0;
    max-height: calc(100vh - 56px);
    overflow: auto;
  }
  .chart { font-size: 15.5px; }
  .metro { padding-top: 24px; }
}

/* Print (in-app fallback) */
@media print {
  .tabbar, .sidenav, .song-toolbar, .sheet-backdrop { display: none !important; }
  .shell { padding: 0 !important; }
  .main { padding: 0 !important; overflow: visible; }
  body { overflow: visible; background: #fff; color: #111; }
  .chart-seg .ch, .intro-chords { color: #c85a00; }
  .chart-seg .ly { color: #111; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
