@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #faf6ef;
  --bg-2: #f3ede3;
  --surface: #ffffff;
  --surface-2: #f6f1e9;
  --surface-3: #ece5d9;
  --glass: rgba(255, 252, 247, .78);
  --text: #1c1b22;
  --text-2: #4a4852;
  --muted: #7d7a84;
  --line: rgba(60, 40, 20, .1);
  --line-2: rgba(60, 40, 20, .16);
  --accent: #e8590c;
  --accent-ink: #b8430a;
  --accent-soft: rgba(232, 89, 12, .1);
  --chord: #c2410c;
  --star: #d97706;
  --danger: #c02626;
  --grad: linear-gradient(135deg, #f59e0b 0%, #f97316 45%, #e11d48 100%);
  --glow-a: rgba(249, 115, 22, .16);
  --glow-b: rgba(219, 39, 119, .1);
  --shadow-1: 0 1px 2px rgba(40, 25, 10, .06), 0 2px 8px rgba(40, 25, 10, .05);
  --shadow-2: 0 10px 30px rgba(40, 25, 10, .12), 0 2px 6px rgba(40, 25, 10, .06);
  --shadow-3: 0 24px 60px rgba(30, 15, 5, .22);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 16px;
  --r-lg: 22px;
  --sheet-size: 16px;
  --top-inset: max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px));
  --bottom-inset: max(env(safe-area-inset-bottom), var(--safe-area-inset-bottom, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13; --bg-2: #14151b; --surface: #17181f; --surface-2: #1e2028; --surface-3: #282a34;
    --glass: rgba(20, 21, 27, .74); --text: #f2efe9; --text-2: #c9c5cf; --muted: #8e8b97;
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .12);
    --accent: #fb923c; --accent-ink: #fdba74; --accent-soft: rgba(251, 146, 60, .13);
    --chord: #fdba74; --star: #fbbf24; --danger: #f87171;
    --glow-a: rgba(249, 115, 22, .2); --glow-b: rgba(190, 24, 93, .16);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13; --bg-2: #14151b; --surface: #17181f; --surface-2: #1e2028; --surface-3: #282a34;
  --glass: rgba(20, 21, 27, .74); --text: #f2efe9; --text-2: #c9c5cf; --muted: #8e8b97;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .12);
  --accent: #fb923c; --accent-ink: #fdba74; --accent-soft: rgba(251, 146, 60, .13);
  --chord: #fdba74; --star: #fbbf24; --danger: #f87171;
  --glow-a: rgba(249, 115, 22, .2); --glow-b: rgba(190, 24, 93, .16);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bottom-inset);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg { flex: none; }

.glow {
  position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 70% at 10% 0%, var(--glow-a), transparent 70%),
    radial-gradient(50% 60% at 95% 5%, var(--glow-b), transparent 70%);
}

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--top-inset) + 8px) 12px 8px;
  background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: var(--grad); box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
}
.brand-name { font-family: var(--display); font-weight: 650; font-size: 21px; letter-spacing: -.01em; }
.icon-btn {
  flex: none; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text); display: grid; place-items: center; padding: 0; text-decoration: none;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { background: var(--surface-3); transform: scale(.96); }

main { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 8px 16px 140px; }

/* ---------- drawer (side menu) ---------- */
.drawer {
  position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
  background: var(--bg-2); border-right: 1px solid var(--line); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; padding-top: var(--top-inset);
  transform: translateX(-104%); transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 10px calc(24px + var(--bottom-inset)); overscroll-behavior: contain; }
.drawer-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  padding: 18px 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px;
  text-decoration: none; font-weight: 550; color: var(--text-2); transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.nav-item[aria-current="page"] .ico { background: var(--grad); color: #fff; }
.nav-item .dot { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-2); }
.nav-item .dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.nav-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count {
  font-size: 12px; font-weight: 700; min-width: 24px; text-align: center; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(8, 6, 4, .45);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }

/* ---------- shared bits ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 12px; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.section-head a { font-size: 14px; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.empty {
  text-align: center; color: var(--muted); padding: 26px 20px; border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg); font-size: 15px;
}
.empty b { display: block; color: var(--text-2); font-size: 16px; margin-bottom: 4px; }
.err {
  color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent);
  border-radius: var(--r); padding: 14px 16px; margin-top: 16px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-1); transition: transform .12s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(249, 115, 22, .3); }
.more { display: flex; margin: 18px auto 0; }

/* generated cover art */
.cover {
  position: relative; flex: none; width: 52px; height: 52px; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center; color: rgba(255, 255, 255, .96); box-shadow: var(--shadow-1);
  font-family: var(--display); font-weight: 700; font-size: 24px; text-shadow: 0 1px 8px rgba(0, 0, 0, .2);
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 75% 115%, rgba(0, 0, 0, .3) 0 28%, transparent 29%),
              repeating-radial-gradient(circle at 75% 115%, rgba(255, 255, 255, .09) 0 1.5px, transparent 1.5px 5px);
}
.cover span { position: relative; }
.cover.lg { width: 84px; height: 84px; border-radius: 20px; font-size: 40px; box-shadow: var(--shadow-2); }

/* ---------- home ---------- */
.hero { padding: 26px 2px 6px; }
.hero h1 {
  margin: 4px 0 6px; font-family: var(--display); font-weight: 600; font-size: clamp(32px, 8.5vw, 46px);
  line-height: 1.04; letter-spacing: -.025em;
}
.hero h1 em { font-style: italic; font-weight: 500; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.hero p { margin: 0; color: var(--text-2); font-size: 16px; }

.searchbox { position: relative; margin-top: 22px; }
.searchbox svg { position: absolute; left: 19px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input {
  width: 100%; height: 56px; padding: 0 18px 0 52px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 17px; outline: none; box-shadow: var(--shadow-2);
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-2); }
.searchbox.compact { margin-top: 14px; }
.searchbox.compact input { height: 50px; font-size: 16px; box-shadow: var(--shadow-1); }

.quick { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: block; text-decoration: none; padding: 10px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .15s, box-shadow .15s;
  animation: rise .35s both;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tile:active { transform: scale(.98); }
.tile .cover { width: 100%; height: auto; aspect-ratio: 1.25; border-radius: 14px; font-size: 50px; }
.tile .t { font-weight: 650; margin-top: 10px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .a { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; text-decoration: none;
  border-top: 1px solid var(--line); transition: background .15s;
}
.row:first-child { border-top: 0; }
.row:hover, .row:active { background: var(--surface-2); }
.row .cover { width: 46px; height: 46px; border-radius: 12px; font-size: 21px; }
.row .txt { flex: 1; min-width: 0; }
.row .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .a { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .side { color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; line-height: 1.35; }
.row .side b { color: var(--text-2); font-weight: 650; }
.chev { color: var(--muted); opacity: .6; }

/* ---------- results ---------- */
.page-head { padding: 20px 2px 4px; }
.page-head h1 { margin: 2px 0 4px; font-family: var(--display); font-size: clamp(28px, 7vw, 38px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.page-head p { margin: 0; color: var(--text-2); }
.banner {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 24px 20px 22px; margin-top: 16px; color: #fff;
  box-shadow: var(--shadow-2);
}
.banner::after {
  content: ""; position: absolute; right: -50px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255, 255, 255, .13) 0 2px, transparent 2px 9px);
}
.banner .eyebrow { color: rgba(255, 255, 255, .82); position: relative; z-index: 1; }
.banner h1 { position: relative; z-index: 1; margin: 4px 0 4px; font-family: var(--display); font-size: 38px; font-weight: 650; letter-spacing: -.02em; line-height: 1.05; }
.banner p { margin: 0; color: rgba(255, 255, 255, .88); position: relative; z-index: 1; }

.song-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  margin-bottom: 14px; overflow: hidden; animation: rise .35s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.song-card .head { display: flex; align-items: center; gap: 14px; padding: 14px 14px 12px; }
.song-card .head .txt { min-width: 0; }
.song-card .head .t { font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.song-card .head .a { color: var(--muted); font-size: 14px; }
.ver {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none;
  border-top: 1px solid var(--line); transition: background .15s;
}
.ver:hover, .ver:active { background: var(--surface-2); }
.vtag {
  flex: none; min-width: 54px; text-align: center; font-size: 12.5px; font-weight: 700; padding: 4px 9px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
}
.ver.top .vtag { background: var(--grad); color: #fff; }
.meta { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 14px; color: var(--muted); min-width: 0; }
.meta .stars { color: var(--star); font-weight: 650; }
.meta .votes b { color: var(--text); font-weight: 650; }
.badge {
  font-size: 11px; font-weight: 750; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px;
  color: var(--accent-ink); background: var(--accent-soft); white-space: nowrap;
}

.skel { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); padding: 14px; margin-bottom: 14px; overflow: hidden; }
.skel i { display: block; height: 12px; border-radius: 6px; margin: 9px 0; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel i.c { width: 52px; height: 52px; border-radius: 14px; float: left; margin: 0 14px 6px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- song view ---------- */
.song-hero { display: flex; gap: 16px; align-items: center; padding: 20px 2px 2px; }
.song-hero .txt { flex: 1; min-width: 0; }
.song-title { margin: 0; font-family: var(--display); font-size: clamp(26px, 6.8vw, 38px); font-weight: 650; line-height: 1.06; letter-spacing: -.02em; }
.song-artist { color: var(--text-2); font-size: 16px; margin-top: 5px; }
.star-btn {
  flex: none; align-self: flex-start; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface);
  display: grid; place-items: center; color: var(--muted); box-shadow: var(--shadow-1); transition: transform .12s;
}
.star-btn[aria-pressed="true"] { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 6px 16px rgba(249, 115, 22, .35); }
.star-btn:active { transform: scale(.9); }

.version-btn {
  margin-top: 18px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-align: left;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-1);
}
.version-btn .txt { flex: 1; min-width: 0; }
.version-btn .t { font-weight: 650; }
.version-btn .s { font-size: 13.5px; color: var(--muted); }
.version-btn .count { font-size: 12.5px; font-weight: 650; color: var(--accent-ink); white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13.5px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 650; }
button.chip { border-color: var(--line-2); background: var(--surface); }
button.chip.set { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }
button.chip.set b { color: var(--accent-ink); }

.shapes { margin-top: 18px; }
.shapes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.shapes-head button { border: 0; background: none; color: var(--accent-ink); font-weight: 600; font-size: 14px; padding: 6px 2px; }
.diagrams { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 9px; }
.diagram {
  text-align: center; font-weight: 750; color: var(--chord); font-size: 13.5px; padding: 8px 2px 3px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.diagram svg { display: block; margin: 0 auto; }

.sheet-card {
  margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 6px 18px 22px; box-shadow: var(--shadow-1);
}
.sheet { font-size: var(--sheet-size); line-height: 1.4; }
.sheet .line { white-space: pre-wrap; font-family: var(--mono); font-size: .9em; min-height: 1.4em; color: var(--text-2); }
.sheet .chordline { white-space: pre-wrap; font-family: var(--mono); font-weight: 700; color: var(--chord); font-size: .82em; line-height: 1.7; }
.sheet .tabline { white-space: pre; font-family: var(--mono); overflow-x: auto; font-size: .8em; color: var(--text-2); }
.sheet .label {
  display: flex; align-items: center; gap: 10px; margin: 1.5em 0 .5em;
  font-family: var(--sans); font-weight: 750; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink);
}
.sheet .label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.sheet .pair { margin: .2em 0 .45em; }
.sheet .seg { display: inline-flex; flex-direction: column; vertical-align: bottom; }
.sheet .seg .c { font-weight: 750; color: var(--chord); font-family: var(--sans); font-size: .8em; line-height: 1.5; white-space: pre; min-height: 1.5em; padding-right: .45em; }
.sheet .seg .l { white-space: pre; }
.sheet .unit { display: inline-flex; white-space: nowrap; vertical-align: bottom; }
.ch { cursor: pointer; border-radius: 5px; transition: background .12s; }
.ch:hover { background: var(--accent-soft); }

/* floating control bar */
.controls {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--bottom-inset)); width: min(560px, calc(100% - 20px));
  display: flex; align-items: center; gap: 6px; padding: 7px;
  background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow-3);
}
.stepper { flex: 1; display: flex; align-items: center; background: var(--surface-2); border-radius: 16px; min-width: 0; }
.stepper button { width: 38px; height: 48px; border: 0; background: none; border-radius: 14px; font-size: 21px; font-weight: 500; color: var(--text-2); flex: none; }
.stepper button:active { background: var(--surface-3); }
.stepper .val { flex: 1; text-align: center; line-height: 1.1; min-width: 0; width: auto; height: auto; font-size: inherit; }
.stepper .val small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stepper .val b { font-size: 17px; font-weight: 750; }
.ctl-btn {
  flex: none; width: 50px; height: 50px; border-radius: 16px; border: 0; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); transition: transform .12s;
}
.ctl-btn.play { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(249, 115, 22, .35); }
.ctl-btn:active { transform: scale(.92); }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(8, 6, 4, .45); animation: fade .2s; }
.sheet-panel {
  position: relative; width: min(560px, 100%); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-3);
  padding-bottom: var(--bottom-inset); animation: slideup .28s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .sheet-panel { border-radius: 26px; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 4px 20px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; }
.sheet-body { overflow-y: auto; padding: 4px 12px 20px; overscroll-behavior: contain; }

.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 14px; border: 0;
  background: none; text-align: left; text-decoration: none; transition: background .15s;
}
.opt:hover { background: var(--surface-2); }
.opt[aria-current="true"], .opt[aria-checked="true"] { background: var(--accent-soft); }
.opt .txt { flex: 1; min-width: 0; }
.opt .t { font-weight: 650; }
.opt .s { font-size: 13.5px; color: var(--muted); }
.opt .check { color: var(--accent); opacity: 0; }
.opt[aria-current="true"] .check, .opt[aria-checked="true"] .check { opacity: 1; }
.opt .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin: 0 6px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }

.setting { display: flex; align-items: center; gap: 12px; padding: 14px 8px; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting .txt { flex: 1; min-width: 0; }
.setting .t { font-weight: 650; }
.setting .s { font-size: 13.5px; color: var(--muted); }
.mini-stepper { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 3px; flex: none; }
.mini-stepper button { width: 38px; height: 36px; border: 0; border-radius: 10px; background: none; font-weight: 700; font-size: 17px; }
.mini-stepper button:active { background: var(--surface-3); }
.mini-stepper span { min-width: 30px; text-align: center; font-weight: 750; }
.switch {
  flex: none; position: relative; width: 50px; height: 30px; border-radius: 999px; border: 0; background: var(--surface-3);
  transition: background .2s; padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.setting .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }

/* chord popover */
.popover {
  position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 10px 14px 8px; box-shadow: var(--shadow-3); text-align: center; color: var(--chord); font-weight: 750;
  animation: fade .15s;
}

/* ---------- larger screens ---------- */
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) {
  main { padding: 16px 28px 150px; }
  .appbar { padding-left: 20px; padding-right: 20px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* text pairs inside rows and buttons stack as lines */
.row .t, .row .a, .opt .t, .opt .s, .version-btn .t, .version-btn .s, .tile .t, .tile .a { display: block; }
