/* ── Uke Chords ─────────────────────────────────────────────── */
/* Theming: every colour is a light-dark() pair, so the palette follows the OS
   preference automatically. Setting data-theme="light"/"dark" on <html> pins
   it instead — see the color-scheme rules below.

   Light: warm stone greys with a near-black accent.
   Dark:  VS Code "Dark+" greys (neutral, not blue) with a warm off-white accent. */
:root {
  color-scheme: light dark;

  --bg: light-dark(#f3f0ea, #1e1e1e);
  --bg-2: light-dark(#faf8f4, #252526);
  --panel: light-dark(#faf8f4, #252526);
  --panel-2: light-dark(#ece8e0, #2d2d2d);
  --line: light-dark(#d9d3c8, #3c3c3c);
  --line-soft: light-dark(#e5e0d7, #333333);
  --ink: light-dark(#1f1c18, #d4d4d4);
  --ink-2: light-dark(#5a544b, #a6a6a6);
  --ink-3: light-dark(#857d72, #7f7f7f);
  --accent: light-dark(#222222, #e6e2da);
  --accent-ink: light-dark(#f5f2ec, #1e1e1e);
  --accent-soft: light-dark(#e3ded5, #3a3a3a);
  --accent-hi: light-dark(#000000, #ffffff);
  --warn: light-dark(#8a5a1c, #d7ba7d);
  --bad: light-dark(#a33f34, #d16969);
  --good: light-dark(#3f6b3a, #8bb174);
  --good-ink: light-dark(#ffffff, #1e1e1e);
  --bad-ink: light-dark(#ffffff, #1e1e1e);
  /* fretboard gradient stops + inlay dots (referenced from diagram.js) */
  --wood-top: light-dark(#d9c4a3, #3a2f25);
  --wood-mid: light-dark(#c9ad84, #2f261e);
  --wood-bot: light-dark(#b3956c, #271f18);
  --inlay: light-dark(#8f7452, #6b5e4f);
  --string: light-dark(#6f6a62, #c9c5bd);
  --hover: light-dark(#ebe7df, #2a2d2e);
  --hover-2: light-dark(#e3ded5, #37373d);
  --scrim: light-dark(rgba(40, 35, 28, .4), rgba(0, 0, 0, .6));
  --topbar: light-dark(#f3f0ea, #1e1e1e);
  --fret: light-dark(#9a8c78, #4a4a4a);
  --nutbar: light-dark(#6f6a62, #c9c5bd);
  --cell-hover: light-dark(rgba(34, 34, 34, .1), rgba(230, 226, 218, .12));
  --cell-on: light-dark(rgba(34, 34, 34, .07), rgba(230, 226, 218, .08));
  --accent-ring: light-dark(rgba(34, 34, 34, .18), rgba(230, 226, 218, .22));
  --shadow: 0 16px 40px light-dark(rgba(40, 35, 28, .18), rgba(0, 0, 0, .5));
  --radius: 8px;
  --radius-sm: 6px;
  --nav-h: 58px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* wins over any display: flex/grid on the element */
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* icon sprite: [hidden] doesn't apply to SVG-namespace elements, and display:none
   would break <use> references in some browsers, so collapse it instead */
svg[hidden] { position: absolute; width: 0; height: 0; overflow: hidden; }
/* inline icons (Material) */
.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -0.3em; }

/* ── top bar ───────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.bm-bg { fill: var(--accent); }
.bm-str { stroke: var(--accent-ink); }
.bm-hole { fill: var(--accent); stroke: var(--accent-ink); }
.topbar h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.sub { margin: 1px 0 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.tabs { display: flex; gap: 2px; margin-left: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  appearance: none; border: 0; background: transparent; color: var(--ink-2);
  font-size: 14px; padding: 8px 12px; border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
}
.tab .ic { display: none; }
.tab:hover { color: var(--ink); background: var(--hover); }
.tab.is-active { background: var(--accent); color: var(--accent-ink); }

.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--line); color: var(--ink-2);
  transition: border-color .12s, color .12s, background .12s;
}
.icon-btn:hover { color: var(--ink); background: var(--hover); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn.is-off { color: var(--ink-3); border-style: dashed; }

/* ── layout ────────────────────────────── */
main { padding: 24px; max-width: 1360px; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 20px;
}
.panel + .panel { margin-top: 18px; }
.panel-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.panel-title.mt { margin-top: 24px; }
.mt { margin-top: 18px; }
.muted { color: var(--ink-3); font-size: 13.5px; margin: 0 0 12px; }
.spacer { flex: 1; }

/* ── toolbar / chips ───────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 14px; }
.search-wrap {
  flex: 1 1 260px; min-width: 200px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 12px; color: var(--ink-3);
}
.search-wrap:focus-within { border-color: var(--accent); color: var(--ink-2); }
.search {
  flex: 1; min-width: 0; font-size: 16px; background: transparent; border: 0; color: var(--ink);
  padding: 10px 0; outline: none;
}
.search::-webkit-search-cancel-button { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 13px; line-height: 1;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2);
  padding: 8px 11px; border-radius: var(--radius-sm); transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip:disabled:hover { border-color: var(--line); color: var(--ink-2); }
.count { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 20px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-2); transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); background: var(--accent-ink); }

/* ── chord grid ────────────────────────── */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card {
  position: relative; cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 12px 12px 10px; text-align: center;
  transition: border-color .12s, background .12s;
}
.card:hover { border-color: var(--ink-3); }
.card:active { background: var(--hover); }
.card-name { font-size: 19px; font-weight: 600; }
.card-name sup { font-size: 11px; font-weight: 500; color: var(--ink-2); }
.card-diagram { display: flex; justify-content: center; margin: 6px 0 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.card-foot .lv { padding: 2px 6px; border-radius: 4px; background: var(--panel-2); }
.lv-beginner { color: var(--good); }
.lv-intermediate { color: var(--warn); }
.lv-advanced { color: var(--bad); }
.card .fav {
  position: absolute; top: 6px; right: 6px; line-height: 0;
  background: none; border: 0; color: var(--ink-3); padding: 6px; border-radius: var(--radius-sm);
}
.card .fav .ic { width: 18px; height: 18px; }
.card .fav:hover { color: var(--ink); background: var(--hover); }
.card .fav.on { color: var(--warn); }

/* ── chord diagram (svg) ──────────────── */
svg.diagram { display: block; margin: 0 auto; overflow: visible; }
svg.diagram .fret-line { stroke: var(--line); stroke-width: 1; }
svg.diagram .nut { stroke: var(--ink); stroke-width: 2.5; }
svg.diagram .str-line { stroke: var(--line); stroke-width: 1; }
svg.diagram .dot { fill: var(--accent); }
svg.diagram .dot-mute { fill: none; stroke: var(--ink-3); stroke-width: 1.6; }
svg.diagram .ring { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
svg.diagram .finger-num { fill: var(--accent-ink); font-size: 9px; font-weight: 700; text-anchor: middle; font-family: var(--sans); }
svg.diagram .lbl { fill: var(--ink-3); font-size: 9.5px; text-anchor: middle; font-family: var(--mono); }
svg.diagram .barre { stroke: var(--accent); stroke-width: 11; stroke-linecap: round; }
svg.diagram .cap { fill: var(--ink-2); font-size: 9px; text-anchor: end; font-family: var(--sans); font-weight: 600; }

/* ── strum machine ─────────────────────── */
.strum-layout, .quiz-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 18px; align-items: start; }
.strum-layout .panel + .panel, .quiz-layout .panel + .panel { margin-top: 0; }
@media (max-width: 1000px) { .strum-layout, .quiz-layout { grid-template-columns: 1fr; } }
/* find-the-note draws a full 12-fret neck: give the stage most of the row */
@media (min-width: 1001px) { .quiz-layout.notes { grid-template-columns: minmax(0, .75fr) minmax(0, 1.6fr); } }

.preset-row { display: flex; gap: 10px; margin-bottom: 14px; }
.select {
  font-size: 14px; flex: 1; min-width: 0; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 10px; border-radius: var(--radius-sm); outline: none;
}
.select:focus { border-color: var(--accent); }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.slot {
  position: relative; cursor: pointer; text-align: center;
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 8px 4px 6px; transition: border-color .12s, background .12s;
}
.slot.filled { border-style: solid; }
.slot:hover { border-color: var(--ink-3); }
.slot.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.slot-num { position: absolute; top: 5px; left: 7px; font-size: 10px; color: var(--ink-3); font-family: var(--mono); }
.slot-name { font-size: 17px; font-weight: 600; margin: 6px 0 2px; }
.slot-name.empty { color: var(--ink-3); font-weight: 400; font-size: 20px; }
.slot-diagram { display: flex; justify-content: center; min-height: 40px; }
.slot-degree { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); }
.slot-help { font-size: 12px; color: var(--ink-3); margin-top: 9px; }
.linklike { background: none; border: 0; color: var(--ink-2); font-size: inherit; padding: 0; text-decoration: underline; }

.pattern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 8px; }
.pattern {
  text-align: left;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: var(--radius-sm); padding: 9px 11px; transition: border-color .12s, color .12s;
}
.pattern:hover { border-color: var(--ink-3); color: var(--ink); }
.pattern.is-active { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.pattern b { display: block; font-size: 13.5px; margin-bottom: 3px; font-weight: 600; }
.pattern span { font-size: 11px; font-family: var(--mono); color: var(--ink-3); }

.field { margin-top: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.field output { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.field.row { display: flex; flex-wrap: wrap; gap: 14px 20px; }
input[type=range] { appearance: none; width: 100%; height: 3px; border-radius: 3px; background: var(--line); outline: none; margin: 8px 0; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--accent); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--panel); }

.transport { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; color: var(--ink); line-height: 1;
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 10px 14px; min-height: 40px; border-radius: var(--radius-sm);
  transition: border-color .12s, background .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); background: var(--hover); }
.btn:active { background: var(--hover-2); }
.btn-play { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; min-width: 108px; }
.btn-play:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-play.is-playing { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
/* a reset, not a play control: red text and border, fills red on hover */
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.btn-danger:active { background: var(--bad); color: var(--bad-ink); filter: brightness(1.1); }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.fav-row { display: flex; flex-direction: column; gap: 8px; }
.vol { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.vol input { width: 84px; }

.now-chord { text-align: center; padding: 6px 0 2px; }
.now-chord .nm { font-size: 46px; font-weight: 600; letter-spacing: -.5px; line-height: 1; }
.now-chord .nm.empty { color: var(--ink-3); font-size: 18px; font-weight: 400; letter-spacing: 0; }
.now-chord .dg { display: flex; justify-content: center; margin-top: 10px; }
.now-chord .meta { font-size: 12px; color: var(--ink-3); margin-top: 8px; font-family: var(--mono); }

.beat-strip { display: flex; gap: 5px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.beat {
  width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 11px; font-family: var(--mono); color: var(--ink-3);
  transition: background .08s, color .08s;
}
.beat.has { border-color: var(--ink-2); color: var(--ink); }
.beat.hit { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.beat.down { font-weight: 700; }

.upnext { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.upnext .nx { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 10px; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.upnext .nx.is-next { border-color: var(--accent); color: var(--ink); }

.tips { display: flex; flex-direction: column; gap: 8px; }
.tip { font-size: 13.5px; color: var(--ink-2); border-left: 2px solid var(--accent); padding: 4px 12px; line-height: 1.5; }
.tip b { color: var(--ink); font-weight: 600; }

/* ── fretboard ─────────────────────────── */
.board-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.board-readout { text-align: right; min-width: 180px; }
.readout-name { font-size: 30px; font-weight: 600; letter-spacing: -.5px; }
.readout-name .also { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 6px; }
.readout-notes { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.fretboard { padding-bottom: 6px; }
.fretboard svg.fretmap, .mini-board svg.fretmap { display: block; width: 100%; height: auto; }
.mini-board svg.fretmap { max-width: 520px; margin: 0 auto; }
.mini-board svg.fretmap.vertical { max-width: 340px; }
.board-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

svg.fretmap .fret { stroke: var(--fret); stroke-width: 1.5; }
svg.fretmap .nutbar { fill: var(--nutbar); }
/* The board's fill is set in diagram.js as fill="url(#woodgrad-n)" — each SVG
   owns its gradient — but the stops and inlays are painted from CSS so they
   follow the theme. */
svg.fretmap .wood-1 { stop-color: var(--wood-top); }
svg.fretmap .wood-2 { stop-color: var(--wood-mid); }
svg.fretmap .wood-3 { stop-color: var(--wood-bot); }
svg.fretmap .inlay { fill: var(--inlay); opacity: .8; }
svg.fretmap .str { stroke: var(--string); opacity: .78; }
/* physical string gauges: C (wound) thickest, G & E equal, A (plain) thinnest */
svg.fretmap .str-A { stroke-width: 1; }
svg.fretmap .str-G,
svg.fretmap .str-E { stroke-width: 1.5; }
svg.fretmap .str-C { stroke-width: 2.4; }
svg.fretmap .cell { fill: transparent; cursor: pointer; }
@media (hover: hover) { svg.fretmap .cell:hover { fill: var(--cell-hover); } }
svg.fretmap .cell.on { fill: var(--cell-on); }
svg.fretmap .node { fill: var(--accent); stroke: var(--accent-ink); stroke-width: 1.5; pointer-events: none; }
svg.fretmap .ring-open { fill: none; stroke: var(--ink-2); stroke-width: 1.6; pointer-events: none; }
/* find-the-note: the tap, and the right spots when it missed */
svg.fretmap .node.right { fill: var(--good); stroke: var(--good-ink); }
svg.fretmap .node.wrong { fill: var(--bad); stroke: var(--bad-ink); }
svg.fretmap .mute { stroke: var(--bad); stroke-width: 2; stroke-linecap: round; fill: none; pointer-events: none; }
/* mute toggles: dim at rest, bright on hover, red while muted */
svg.fretmap .mute-toggle { cursor: pointer; }
svg.fretmap .mute-hit { fill: transparent; }
svg.fretmap .mute-x { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; fill: none; opacity: .13; pointer-events: none; transition: opacity .12s; }
@media (hover: hover) {
  svg.fretmap .mute-toggle:hover .mute-x { opacity: .85; }
  svg.fretmap .mute-toggle:hover .mute-hit { fill: var(--cell-hover); }
}
svg.fretmap .mute-toggle.on .mute-x { stroke: var(--bad); stroke-width: 2.2; opacity: 1; }
svg.fretmap .fnote { fill: var(--accent-ink); font-size: 10px; font-weight: 700; text-anchor: middle; font-family: var(--sans); pointer-events: none; }
svg.fretmap .fretnum { fill: var(--ink-3); font-size: 10px; text-anchor: middle; font-family: var(--mono); }
svg.fretmap .sname { fill: var(--ink-2); font-size: 11px; font-weight: 600; text-anchor: middle; font-family: var(--mono); pointer-events: none; }
svg.fretmap .sname.is-muted { opacity: .38; }
/* "All notes" overlay: a faint disc under each label lifts it off the string;
   still clearly background next to a pressed dot, and accidentals dimmer */
svg.fretmap .ghost-disc { fill: var(--panel); opacity: .72; pointer-events: none; }
svg.fretmap .ghost-disc.acc { opacity: .45; }
svg.fretmap .ghost-note { fill: var(--ink); opacity: .72; font-size: 10px; font-weight: 600; text-anchor: middle; font-family: var(--mono); pointer-events: none; }
svg.fretmap .ghost-note.acc { opacity: .5; font-size: 9px; font-weight: 500; }
svg.fretmap.vertical .fnote { font-size: 12px; }
svg.fretmap.vertical .ghost-note { font-size: 12px; }
svg.fretmap.vertical .ghost-note.acc { font-size: 11px; }
svg.fretmap.vertical .fretnum, svg.fretmap.vertical .sname { font-size: 12px; }

.instrument-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.instrument-row .muted { margin: 0; }
.shape-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px,1fr)); gap: 10px; }
.shape-cell { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; text-align: center; cursor: pointer; transition: border-color .12s; }
.shape-cell:hover { border-color: var(--ink-3); }
.shape-cell .sc-t { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; font-family: var(--mono); }
.shape-cell .sc-n { font-size: 13.5px; font-weight: 600; margin-top: 4px; }
.shape-cell-diagram { display: flex; justify-content: center; }
.shape-map .muted { grid-column: 1 / -1; margin: 4px 0 0; }

/* ── modal ─────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: var(--scrim); padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: min(900px, 100%); max-height: 88dvh; overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 24px;
}
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--panel); }
.modal-grid { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 28px; }
.modal-right { padding-top: 46px; }   /* clears the close button */
@media (max-width: 780px) { .modal-grid { grid-template-columns: 1fr; } .modal-right { padding-top: 0; } }
.detail-head h2 { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -.5px; line-height: 1.05; padding-right: 44px; }
.detail-head sup { font-size: 17px; color: var(--ink-2); font-weight: 500; }
.detail-meta { font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.voicing-tabs { margin: 16px 0 10px; }
.big-diagram { display: flex; justify-content: center; padding: 8px 0 4px; }
.detail-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 10px; margin-top: 18px; }
.fact { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 9px 11px; }
.fact .k { font-size: 11px; color: var(--ink-3); }
.fact .v { font-size: 14px; font-weight: 600; margin-top: 3px; font-family: var(--mono); }

.capo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 16px; }
.capo-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.capo-info { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.capo-info b { color: var(--ink); font-weight: 600; }
.capo-info:empty { display: none; }
.chord-strip .cs .shape { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.song-now .shape { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.string-row { display: flex; gap: 8px; }
.sbtn {
  flex: 1; text-align: center;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: var(--radius-sm); padding: 8px 2px; min-height: 44px; transition: border-color .12s, color .12s;
}
.sbtn:hover { border-color: var(--ink-3); color: var(--ink); }
.sbtn b { display: block; font-size: 14px; color: inherit; }
.sbtn span { font-size: 10px; font-family: var(--mono); opacity: .7; }
.sbtn.muted { opacity: .45; text-decoration: line-through; }

.song-list { display: flex; flex-direction: column; gap: 6px; }
.song { font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); padding: 7px 2px; display: flex; justify-content: space-between; gap: 10px; }
.song .ar { color: var(--ink-3); font-size: 12px; }
.song-link { width: 100%; background: none; border-radius: 0; cursor: pointer; text-align: left; }
.song-link:hover { color: var(--ink); }

/* ── quiz ──────────────────────────────── */
.quiz-stats { display: flex; gap: 10px; margin-top: 22px; }
.quiz-stats > div { flex: 1; text-align: center; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px 6px; }
.quiz-stats b { display: block; font-size: 22px; font-family: var(--mono); color: var(--ink); font-weight: 600; }
.quiz-stats span { font-size: 11px; color: var(--ink-3); }
.quiz-q { text-align: center; padding: 6px 0 18px; }
.quiz-q .q { font-size: 15px; color: var(--ink-2); margin-bottom: 14px; }
.quiz-q .q b { color: var(--ink); font-weight: 600; }
.quiz-q .big-name { font-size: 44px; font-weight: 600; line-height: 1.05; letter-spacing: -.5px; margin: 4px 0 10px; }
.quiz-q .big-name sup { font-size: 18px; font-weight: 500; color: var(--ink-2); }
.quiz-answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.qa {
  font-size: 17px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  padding: 14px 8px; min-height: 52px; border-radius: var(--radius-sm); transition: border-color .12s, background .12s;
}
.qa:hover { border-color: var(--ink-3); }
.qa.right { background: var(--good); border-color: var(--good); color: var(--good-ink); }
.qa.wrong { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.qa:disabled { cursor: default; opacity: .85; }
.quiz-feedback { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 14px; min-height: 22px; font-weight: 600; }
.quiz-feedback.ok { color: var(--good); }
.quiz-feedback.no { color: var(--bad); }
.quiz-feedback b { color: var(--ink); }
.quiz-diagram { display: flex; justify-content: center; margin: 6px 0 18px; }
.mini-board { margin: 0 auto 6px; }
.mini-board .transport { justify-content: center; margin-top: 14px; }
.note-board { margin: 6px auto 0; }
.note-board svg.fretmap { display: block; width: 100%; height: auto; max-width: 900px; margin: 0 auto; }
.note-board svg.fretmap.vertical { max-width: 360px; }
.note-board + .muted { margin: 10px 0 0; }
.note-progress { margin: 10px 0 12px; font-size: 12.5px; }
.note-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.note-foot .linklike { font-size: 13px; }
.drill-pair { display: flex; gap: 18px; justify-content: center; margin: 4px 0 20px; flex-wrap: wrap; }
.drill-pair > div { text-align: center; }
.drill-pair .nm { font-size: 22px; font-weight: 600; }
.drill-pair .dg { display: flex; justify-content: center; margin: 6px 0 4px; }
.quiz-stage .transport { justify-content: center; }

/* ── songs ─────────────────────────────── */
.song-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.song-card {
  text-align: left; cursor: pointer; background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 14px 14px 12px; transition: border-color .12s;
}
.song-card:hover { border-color: var(--ink-3); }
.song-card .t { font-size: 16px; font-weight: 600; }
.song-card .a { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.song-card .k { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.song-card .k span { font-size: 11px; font-family: var(--mono); color: var(--ink-2); background: var(--panel-2); border-radius: 4px; padding: 2px 6px; }
.song-card .own { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }
.song-note { margin-top: 18px; }
.setlist-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.setlist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.setlist-head[hidden] { display: none; }
.setlist-head .muted { margin: 0; }
.song-card .sl-tools { display: flex; gap: 4px; margin-top: 10px; }
.song-card .sl-tools button { font-size: 12px; padding: 4px 8px; min-height: 28px; }
.song-card .sl-pos { font-family: var(--mono); font-size: 11px; color: var(--ink-3); float: right; }
.setlist-nav { display: inline-flex; align-items: center; gap: 4px; }
.setlist-nav[hidden] { display: none; }
#addToSetlist { max-width: 150px; }
#addToSetlist[hidden] { display: none; }
label.btn { cursor: pointer; }
.song-note code { font-family: var(--mono); font-size: 12px; background: var(--panel-2); padding: 1px 4px; border-radius: 3px; }

.song-editor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.song-editor-tools { display: flex; gap: 14px; }
.chordpro-help { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 12px; white-space: pre-wrap; }
.song-text {
  display: block; width: 100%; min-height: 50vh; resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.5;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); padding: 12px; outline: none;
}
.song-text:focus { border-color: var(--accent); }

.song-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.song-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.song-title-wrap { flex: 1; min-width: 0; }
.song-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; }
.song-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.song-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.chips.seg { gap: 0; }
.chips.seg .chip { border-radius: 0; margin-left: -1px; }
.chips.seg .chip:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.chips.seg .chip:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.chips.seg .chip.is-active { position: relative; z-index: 1; }
.ctl-group { display: inline-flex; align-items: center; gap: 4px; }
.ctl-val { min-width: 58px; text-align: center; font-size: 13px; font-family: var(--mono); color: var(--ink-2); }
.icon-btn.sm { width: 32px; height: 32px; font-size: 12px; font-weight: 600; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.select.sm { flex: none; padding: 7px 8px; font-size: 13px; }

.chord-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 10px; scrollbar-width: thin; }
.chord-strip[hidden] { display: none; }
.chord-strip .cs {
  flex: none; text-align: center; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 6px 8px 4px; min-width: 76px; cursor: pointer; transition: border-color .12s, background .12s;
}
.chord-strip .cs:hover { border-color: var(--ink-3); }
.chord-strip .cs.is-now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chord-strip .cs .n { font-size: 14px; font-weight: 600; }
.chord-strip .cs .n sup { font-size: 9px; }
.chord-strip .cs.missing { opacity: .6; }
.chord-strip .cs.missing .n::after { content: " ?"; color: var(--ink-3); font-weight: 400; }

.changes-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.changes-label { font-size: 13px; color: var(--ink-3); }
.changes-row .chip { font-family: var(--mono); }
.changes-row .chip sup { font-size: 9px; }
.drill-from { font-size: 12.5px; color: var(--ink-3); margin-top: -8px; margin-bottom: 12px; text-align: center; }
/* the sheet itself */
.song-sheet { --sheet-size: 16px; font-size: var(--sheet-size); line-height: 1.5; padding: 20px 22px; }
.song-sheet .sec { margin: 0 0 22px; }
.song-sheet .sec:last-child { margin-bottom: 0; }
.song-sheet .sec-label { font-size: .78em; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.song-sheet .sec-label.clickable { cursor: pointer; }
.song-sheet .sec-label.clickable:hover { color: var(--ink); text-decoration: underline; }
.song-sheet .sec.is-loop { outline: 1px dashed var(--ink-3); outline-offset: 8px; border-radius: 2px; }
.song-sheet .sec.is-loop .sec-label { color: var(--ink); }
.song-sheet .chorus { border-left: 2px solid var(--line); padding-left: 14px; }
.song-sheet .line { margin: 0 0 .25em; white-space: normal; }
.song-sheet .comment { font-style: italic; color: var(--ink-3); font-size: .9em; }
/* sheet mode: chord above the syllable */
.mode-sheet .line { display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: .5em; }
.mode-sheet .seg { display: inline-flex; flex-direction: column; align-items: flex-start; white-space: pre; max-width: 100%; }
.mode-sheet .seg .ch { font-family: var(--mono); font-weight: 700; font-size: .85em; line-height: 1.3; color: var(--ink); min-height: 1.3em; padding-right: .6em; cursor: pointer; border-radius: 4px; }
.mode-sheet .seg .ch:empty { visibility: hidden; }
.mode-sheet .seg .ly { white-space: pre; }
.song-sheet .ly.sp { margin-right: .3em; }
.mode-sheet .line.chords-only .seg .ly { display: none; }
/* inline mode: chord pill in the text */
.mode-inline .seg { white-space: pre-wrap; }
.mode-inline .seg .ch { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .72em; line-height: 1.5; vertical-align: .18em; color: var(--accent-ink); background: var(--accent); border-radius: 4px; padding: 0 .4em; margin: 0 .1em; cursor: pointer; }
.mode-inline .seg .ch:empty { display: none; }
.song-sheet .barline .ch { color: var(--ink-3); font-weight: 400; cursor: default; }
.mode-inline .barline .ch { background: none; color: var(--ink-3); font-size: 1em; padding: 0; vertical-align: 0; }
/* play-along highlights */
.song-sheet .ly.is-word { background: var(--accent); color: var(--accent-ink); border-radius: 3px; box-shadow: 0 0 0 2px var(--accent); }
.song-sheet .ch.is-now { background: var(--accent); color: var(--accent-ink); outline: 3px solid var(--accent); }
.song-sheet .ch.is-done { color: var(--ink-3); }
.mode-inline .ch.is-done { background: var(--panel-2); color: var(--ink-3); }
.song-sheet .line.is-now { background: var(--hover); box-shadow: 0 0 0 6px var(--hover); border-radius: 2px; }
.mode-sheet .ch:hover, .mode-inline .ch:hover { filter: brightness(.9); }

/* play-along "now / next" card */
.song-now { display: grid; grid-template-columns: auto auto auto; justify-content: center; align-items: center; gap: 18px 48px; margin-bottom: 12px; padding: 14px 18px; position: sticky; top: 64px; z-index: 5; }
.song-now[hidden] { display: none; }
.song-now .lbl { font-size: 11px; color: var(--ink-3); }
.song-now .nm { font-size: 34px; font-weight: 600; line-height: 1.05; }
.song-now .nm sup { font-size: 14px; }
.song-now .dg { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.now-cur, .now-next { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 90px; }
.now-next { opacity: .7; }
.now-next .nm { font-size: 24px; }
.now-beats { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* transport: the everyday controls in one bar, the rest behind a Settings popover */
.song-transport { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 14px; }
.st-scroll, .st-play { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; flex: 1; }
.st-scroll[hidden], .st-play[hidden] { display: none; }
.song-transport .vol input { width: 110px; }
.song-transport .vol output { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.st-tempo { flex: 1 1 170px; max-width: 320px; }
.song-transport .st-tempo input { flex: 1; width: auto; min-width: 90px; }
.st-status:empty { display: none; }
.st-more { margin-left: auto; }
.st-more.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mic-live { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.mic-live[hidden] { display: none; }
.mic-live .ic { width: 16px; height: 16px; }
.mic-meter { display: inline-block; width: 54px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mic-meter > span { display: block; height: 100%; width: 0; background: var(--good); transition: width .05s linear; }
.mic-meter.is-hot > span { background: var(--warn); }
#scrollBtn.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* the Settings popover: under its button on desktop (positioned in JS), a bottom sheet on phones */
.xport-menu {
  position: fixed; inset: auto; margin: 0; width: min(380px, calc(100vw - 16px));
  padding: 12px 16px 12px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto;
}
.xport-menu::backdrop { background: transparent; }
.xm-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.xm-group { padding: 12px 0 4px; border-top: 1px solid var(--line-soft); }
.xm-head + .xm-group { border-top: 0; }
.xm-group[hidden] { display: none; }
.xm-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.xm-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.xm-row[hidden] { display: none; }
.xm-row > span:first-child { flex: 0 0 82px; }
.xm-row .select { flex: 1; }
.xm-row input[type=range] { flex: 1; width: auto; }
.xm-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 8px; }

/* ── game ──────────────────────────────── */
.panel.game { --pad: 12px; padding: var(--pad); scroll-margin-top: 64px; }
.game[hidden] { display: none; }
/* in game mode the transport is the stage's own toolbar: on top, and it stays put while the stage scrolls */
.game > .song-transport {
  position: sticky; top: 64px; z-index: 3;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 10px; padding: 10px var(--pad);
  background: var(--panel); border-bottom: 1px solid var(--line-soft); border-radius: var(--radius) var(--radius) 0 0;
}
.game-hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.game-lyric { font-size: 15px; color: var(--ink-2); min-height: 1.4em; flex: 1; }
.game-lyric b { color: var(--ink); font-weight: 600; }
.game-stats { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.game-stats b { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.game-stats span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.game-canvas { display: block; width: 100%; height: min(62vh, 560px); border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line-soft); touch-action: none; cursor: pointer; user-select: none; }
.game-lanes { display: grid; gap: 6px; margin-top: 8px; }
.game-lanes .lane { text-align: center; padding: 6px 2px 2px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); transition: border-color .08s, background .08s; }
.game-lanes .lane .n { font-size: 15px; font-weight: 600; }
.game-lanes .lane .n sup { font-size: 10px; }
.game-lanes .lane .shape { font-size: 10.5px; color: var(--ink-3); }
.game-lanes .lane.is-now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.game-lanes .lane.flash { background: var(--accent-soft); }
.game-result { text-align: center; padding: 18px 0 8px; }
.game-result[hidden] { display: none; }
.gr-acc { font-size: 56px; font-weight: 600; font-family: var(--mono); line-height: 1; }
.gr-sub { color: var(--ink-3); margin: 8px 0 16px; }

/* ── toast ─────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px); white-space: nowrap;
}
.toast b { font-weight: 600; }
.toast[hidden] { display: none; }

/* ── phones ────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { gap: 12px; padding: 10px 16px; }
  .sub { display: none; }
  .topbar-actions { margin-left: auto; }

  /* tabs become a bottom navigation bar */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    margin: 0; gap: 0; padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--topbar); border-top: 1px solid var(--line-soft);
  }
  .tab { flex: 1; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; border-radius: var(--radius-sm); }
  .tab .ic { display: block; width: 22px; height: 22px; }
  .tab.is-active { background: transparent; color: var(--ink); }
  .tab.is-active .ic { color: var(--accent); }

  main { padding: 16px 16px calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
  .panel { padding: 16px; }
  .slots { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; }
  .quiz-answers { gap: 8px; }
  .pattern-grid { grid-template-columns: 1fr 1fr; }
  /* filter chips scroll sideways in one row instead of stacking */
  .toolbar { gap: 10px; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .toolbar .chip { white-space: nowrap; }

  /* current chord first while strumming; question first in the quiz */
  .strum-layout .panel-right, .quiz-layout .quiz-stage { order: -1; }
  .transport { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--panel); padding: 10px 0 2px; margin-bottom: -6px; border-top: 1px solid var(--line-soft); }
  .quiz-stage .transport, .mini-board .transport { position: static; border-top: 0; padding: 0; margin-bottom: 0; }
  .song-sheet { padding: 14px 14px; }
  .song-tools { width: 100%; margin-left: 0; }
  .song-tools #addToSetlist { flex: 1; max-width: none; }
  .song-now { top: 56px; gap: 10px; padding: 10px 12px; grid-template-columns: auto 1fr auto; }
  .song-now .nm { font-size: 26px; }
  .song-now .dg svg { width: 54px; height: auto; }
  .now-cur, .now-next { min-width: 60px; }
  .song-transport { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0 4px; border-top: 1px solid var(--line-soft); z-index: 4; }
  .song-transport .vol { flex: 1 1 140px; }
  .song-transport .vol input { flex: 1; width: auto; }
  .st-tempo { max-width: none; }
  .st-loop { flex: 1 1 150px; }
  .st-loop .select { flex: 1; }
  .st-more { width: 40px; padding: 0; }
  .st-more span { display: none; }   /* icon only */
  .game-canvas { height: min(50vh, 480px); }
  .game > .song-transport { top: 56px; bottom: auto; border-top: 0; padding: 8px var(--pad); }
  .panel.game { scroll-margin-top: 56px; }
  .game-lanes .lane svg { display: none; }
  /* the settings popover becomes a bottom sheet */
  .xport-menu { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-height: 80dvh; overflow: auto; border-radius: 14px 14px 0 0; border-bottom: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .xport-menu::backdrop { background: rgba(0, 0, 0, .35); }
  .vol { flex: 1; }
  .vol input { flex: 1; width: auto; }

  .board-head { gap: 8px; }
  .board-readout { text-align: left; min-width: 0; }
  .readout-name { font-size: 26px; }

  /* the chord modal becomes a bottom sheet */
  .modal { padding: 0; place-items: end center; }
  .modal-card { width: 100%; max-height: 94dvh; border-radius: 14px 14px 0 0; border-bottom: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .detail-head h2 { font-size: 34px; }
  .toast { bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }
}

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