/* ==========================================================================
   EasyChording — "Ivory & Ebony" design system
   Warm paper, ink-black type, a single vermilion accent and piano-key motifs.
   ========================================================================== */

:root {
  --paper: #f7f3ea;
  --paper-2: #efe9dc;
  --card: #fffdf8;
  --ink: #1d1b18;
  --ink-2: #3b3833;
  --muted: #6e685d;
  --line: #e2dacb;
  --line-strong: #cfc5b2;
  --accent: #e2483d;
  --accent-ink: #b8322a;
  --accent-soft: #fbd9d3;
  --gold: #e7a83a;
  --teal: #2f6f73;
  --teal-soft: #d5e8e6;
  --chord: #c23a2f;
  --shadow: 0 1px 0 rgba(29, 27, 24, .04), 0 8px 24px -12px rgba(29, 27, 24, .18);
  --hard: 4px 4px 0 var(--ink);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans Devanagari', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --key-white: #fffdf8;
  --key-black: #1d1b18;
  --key-on: #fbd9d3;
  --key-on-black: #b8322a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13120f; --paper-2: #1a1915; --card: #1d1c18; --ink: #f1ebdd; --ink-2: #d8d1c1; --muted: #a49d8e;
    --line: #2f2c26; --line-strong: #423e36; --accent: #ff6a55; --accent-ink: #ff8a78; --accent-soft: #4a201b;
    --teal: #7cc4c4; --teal-soft: #1d3434; --chord: #ff7b67; --hard: 4px 4px 0 #000;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
    --key-white: #e9e3d6; --key-black: #0b0a09; --key-on: #ffb3a6; --key-on-black: #ff6a55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #13120f; --paper-2: #1a1915; --card: #1d1c18; --ink: #f1ebdd; --ink-2: #d8d1c1; --muted: #a49d8e;
  --line: #2f2c26; --line-strong: #423e36; --accent: #ff6a55; --accent-ink: #ff8a78; --accent-soft: #4a201b;
  --teal: #7cc4c4; --teal-soft: #1d3434; --chord: #ff7b67; --hard: 4px 4px 0 #000;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
  --key-white: #e9e3d6; --key-black: #0b0a09; --key-on: #ffb3a6; --key-on-black: #ff6a55;
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; outline: none; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--font-mono); font-size: .88em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; }
kbd { border-bottom-width: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1440px; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.js-only { display: none !important; }
.js .js-only { display: revert !important; }
.js .toolbar.js-only, .js .filters.js-only { display: flex !important; }
[hidden] { display: none !important; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5em; justify-content: center;
  padding: .7em 1.2em; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: .95rem; line-height: 1;
  text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s;
  white-space: nowrap;
}
.btn:hover { color: var(--paper); transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--accent); }
.btn:active { transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-ghost[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost[aria-pressed="true"] .i { fill: currentColor; }
.btn-sm { padding: .5em .9em; font-size: .85rem; }
.btn.is-playing { background: var(--accent); border-color: var(--accent); }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }

/* Header ------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.header-row { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand:hover { color: inherit; }
.logo-mark { width: 36px; height: 36px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.brand-name em { font-style: italic; font-weight: 500; color: var(--accent); margin-left: 2px; }
.main-nav { display: flex; gap: 2px; align-items: center; }
.main-nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.main-nav a:hover { background: var(--paper-2); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); box-shadow: inset 0 -2px 0 var(--accent); }
.hsearch { position: relative; flex: 1; max-width: 360px; margin-left: auto; display: flex; align-items: center; }
.hsearch > .i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.hsearch input { width: 100%; height: 42px; padding: 0 40px 0 38px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); outline: none; }
.hsearch input:focus { border-color: var(--ink); box-shadow: var(--hard); }
.hsearch-kbd { position: absolute; right: 10px; font-size: .75rem; color: var(--muted); padding: 0 .45em; }
.hsearch-list { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 320px; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--hard); max-height: 70vh; overflow: auto; }
.hsearch-list a { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; }
.hsearch-list [aria-selected="true"] a, .hsearch-list a:hover { background: var(--paper-2); color: var(--ink); }
.hs-type { grid-row: span 2; align-self: center; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px; background: var(--paper-2); color: var(--muted); min-width: 52px; text-align: center; }
.hs-song { background: var(--accent-soft); color: var(--accent-ink); }
.hs-chord { background: var(--teal-soft); color: var(--teal); }
.hs-name { font-weight: 600; }
.hs-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-all a { display: block; text-align: center; font-size: .85rem; color: var(--muted); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.nav-toggle { display: none; }
.keystrip {
  height: 7px;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, var(--key-black) 9px 17px, transparent 17px 25px, var(--key-black) 25px 33px, transparent 33px 49px, var(--key-black) 49px 57px, transparent 57px 65px, var(--key-black) 65px 73px, transparent 73px 81px, var(--key-black) 81px 89px, transparent 89px 112px),
    repeating-linear-gradient(90deg, var(--key-white) 0 15px, var(--line-strong) 15px 16px);
  border-top: 1px solid var(--line-strong); border-bottom: 1.5px solid var(--key-black);
}

@media (max-width: 1020px) {
  .nav-toggle { display: grid; }
  .main-nav { position: fixed; inset: 75px 0 auto 0; flex-direction: column; align-items: stretch; padding: 12px var(--gutter) 20px; background: var(--paper); border-bottom: 1.5px solid var(--ink); transform: translateY(-120%); transition: transform .2s; visibility: hidden; }
  .main-nav a { padding: 12px; font-size: 1.05rem; }
  .nav-open .main-nav { transform: none; visibility: visible; }
  .hsearch { max-width: none; }
}
@media (max-width: 640px) {
  .header-row { gap: 10px; }
  .brand-name { display: none; }
  .hsearch-kbd { display: none; }
  .hsearch-list { position: fixed; left: 12px; right: 12px; top: 78px; min-width: 0; }
}

/* Footer ------------------------------------------------------------------- */
.site-footer { margin-top: 80px; background: var(--ink); color: var(--paper); padding: 56px 0 28px; }
:root[data-theme="dark"] .site-footer { background: #0b0a09; color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #0b0a09; color: var(--ink); } }
.site-footer a { color: inherit; text-decoration: none; opacity: .8; }
.site-footer a:hover { opacity: 1; color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 32px; }
.footer-grid h2 { font-family: var(--font-body); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; opacity: .55; margin-bottom: 14px; }
.footer-grid div > a:not(.brand):not(.btn) { display: block; padding: 4px 0; font-size: .95rem; }
.footer-brand p { opacity: .7; max-width: 34ch; margin: 14px 0 18px; font-size: .95rem; }
.footer-brand .logo-mark rect:first-child { fill: var(--accent); }
.footer-brand .btn-ghost { color: inherit; border-color: rgba(255,255,255,.25); opacity: 1; }
.footer-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; opacity: .6; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Common page parts --------------------------------------------------------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 22px 0 8px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-right: 4px; color: var(--line-strong); }
.crumbs a { text-decoration: none; }
.page-head { padding: 18px 0 28px; max-width: 760px; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 10px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 62ch; }
.lead-sm { color: var(--ink-2); }
.h1-sub { font-style: italic; font-weight: 500; color: var(--muted); }
.block { margin: 56px 0; }
.block-tight { margin: 32px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.block-title { margin-bottom: 16px; }
.block-head .block-title { margin: 0; }
.more { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; white-space: nowrap; }
.count { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--paper-2); border-radius: 999px; padding: 2px 9px; font-family: var(--font-body); }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.notice { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.empty-state { color: var(--muted); padding: 24px 0; }
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
.note { font-family: var(--font-mono); color: var(--chord); }
.roman { font-family: var(--font-display); font-size: 1.1rem; }

/* Cards --------------------------------------------------------------------- */
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s, box-shadow .15s; position: relative; }
.card:hover { border-color: var(--ink); transform: translate(-3px, -3px); box-shadow: var(--hard); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card-link { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; height: 100%; }
.card-link:hover { color: inherit; }
.song-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.song-card-title { font-size: 1.25rem; margin: 0; }
.song-card-artist { color: var(--muted); font-size: .92rem; }
.song-card-chords { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 12px; }
.song-card-chords b { font-family: var(--font-mono); font-size: .78rem; padding: 2px 7px; border-radius: 6px; background: var(--paper-2); color: var(--chord); }
.song-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.arrow { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); transition: background .15s, color .15s; }
.card:hover .arrow { background: var(--accent); border-color: var(--accent); color: #fff; }
.keyb { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 .82rem var(--font-mono); }
.diff { display: inline-flex; align-items: flex-end; gap: 2px; font-size: .78rem; color: var(--muted); text-transform: capitalize; }
.diff i { width: 5px; border-radius: 2px; background: var(--line-strong); }
.diff i:nth-child(1) { height: 7px; } .diff i:nth-child(2) { height: 11px; } .diff i:nth-child(3) { height: 15px; }
.diff span { margin-left: 6px; }
.diff-1 i:nth-child(1), .diff-2 i:nth-child(-n+2), .diff-3 i { background: var(--teal); }
.diff-2 i:nth-child(-n+2) { background: var(--gold); }
.diff-3 i { background: var(--accent); }

/* Hero (home) --------------------------------------------------------------- */
.hero { padding: 48px 0 0; background: radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1; letter-spacing: -.035em; }
.hero h1 em { font-weight: 500; color: var(--accent); }
.hero-search { display: flex; align-items: center; gap: 8px; position: relative; max-width: 560px; margin: 28px 0 14px; padding: 6px 6px 6px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); box-shadow: var(--hard); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1.05rem; height: 44px; }
.hero-search > .i { color: var(--muted); }
.hero-quick { font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hero-quick a { color: var(--ink-2); font-weight: 500; }
.hero-card { margin: 0; padding: 22px; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); transform: rotate(1.2deg); }
.hero-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.hero-card-head .eyebrow { width: 100%; margin: 0; }
.hero-chord { font: 700 2.6rem/1 var(--font-mono); color: var(--chord); text-decoration: none; }
.hero-chord-name { color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
.hero-card-foot { display: flex; gap: 8px; margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 56px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.stats > div { padding: 20px 10px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--line-strong); }
.stats strong { display: block; font: 700 clamp(1.6rem, 3.5vw, 2.4rem)/1.1 var(--font-display); }
.stats span { color: var(--muted); font-size: .88rem; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line-strong); }
}

.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.genre-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 16px; border-radius: var(--radius); text-decoration: none; border: 1.5px solid var(--ink); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.genre-tile::after { content: ''; position: absolute; right: -10px; bottom: -10px; width: 80px; height: 50px; background: repeating-linear-gradient(90deg, currentColor 0 10px, transparent 10px 16px); opacity: .12; transform: rotate(-12deg); }
.genre-tile:hover { transform: translate(-3px, -3px); box-shadow: var(--hard); color: inherit; }
.genre-name { font: 700 1.3rem/1.1 var(--font-display); }
.genre-tile .count { align-self: flex-start; background: rgba(255,255,255,.55); color: inherit; }
.tone-0 { background: #fbd9d3; color: #5a1b15; }
.tone-1 { background: #d5e8e6; color: #173c3e; }
.tone-2 { background: #f7e3b8; color: #5a3d0a; }
.tone-3 { background: #e3dcf3; color: #2f2457; }
.tone-4 { background: #dfe9cf; color: #2c4214; }
.tone-5 { background: #1d1b18; color: #f7f3ea; }
.tone-5 .count { background: rgba(255,255,255,.15); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tool-card { display: flex; flex-direction: column; padding: 22px; text-decoration: none; }
.tool-card:hover { color: inherit; }
.tool-card h2, .tool-card h3 { margin: 14px 0 6px; font-size: 1.3rem; }
.tool-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.tool-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: var(--paper); }
.tool-ico .i { width: 24px; height: 24px; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.article-card { display: flex; flex-direction: column; padding: 22px; text-decoration: none; }
.article-card:hover { color: inherit; }
.article-card h3 { font-size: 1.35rem; margin: 4px 0 8px; }
.article-card p { color: var(--muted); flex: 1; }

.oss-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; padding: clamp(28px, 5vw, 48px); border-radius: 26px; background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.oss-band::before { content: ''; position: absolute; inset: auto -20px -30px auto; width: 260px; height: 120px; background: repeating-linear-gradient(90deg, var(--accent) 0 18px, transparent 18px 26px); opacity: .35; transform: rotate(-8deg); }
.oss-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.oss-band p { max-width: 58ch; opacity: .8; margin: 0; }
.oss-band a:not(.btn) { color: var(--gold); }
.oss-band .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.oss-band .btn-ghost { background: transparent; color: var(--paper); border-color: rgba(255,255,255,.35); }
.oss-actions { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
:root[data-theme="dark"] .oss-band { background: var(--card); border: 1.5px solid var(--line-strong); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .oss-band { background: var(--card); border: 1.5px solid var(--line-strong); color: var(--ink); } }

/* Keyboard SVG --------------------------------------------------------------- */
.kbd { display: block; width: 100%; height: auto; }
.kbd .kw { fill: var(--key-white); stroke: var(--key-black); }
.kbd .kb { fill: var(--key-black); stroke: var(--key-black); }
.kbd .kw.on { fill: var(--key-on); }
.kbd .kb.on { fill: var(--key-on-black); }
.kbd .dot { fill: var(--ink); }
.kbd .dot.rt { fill: var(--accent); }
.kbd .kb.on + .dot, .kbd .dot { stroke: none; }
.kbd .kl { fill: var(--paper); font-family: var(--font-body); font-weight: 700; }
.kbd-i [data-midi] { cursor: pointer; transition: fill .08s; }
.kbd-i .kw:not(.on):hover { fill: var(--paper-2); }
.kbd-i .kb:not(.on):hover { fill: var(--ink-2); }
:root[data-theme="dark"] .kbd .dot { fill: #1d1b18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kbd .dot { fill: #1d1b18; } }
:root[data-theme="dark"] .kbd .dot.rt { fill: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kbd .dot.rt { fill: var(--accent); } }
:root[data-theme="dark"] .kbd .kl { fill: #f7f3ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kbd .kl { fill: #f7f3ea; } }

/* Guitar chord boxes --------------------------------------------------------- */
.gtr { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 auto; overflow: visible; }
.gtr .gb-fret { stroke: var(--line-strong); stroke-width: 1; }
.gtr .gb-str { stroke: var(--ink-2); }
.gtr .gb-nut { fill: var(--ink); }
.gtr .gb-dot { fill: var(--ink); }
.gtr .gb-dot.rt, .gtr .gb-barre { fill: var(--accent); }
.gtr .gb-barre { opacity: .9; }
.gtr .gb-open { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.gtr .gb-open.rt { stroke: var(--accent); }
.gtr .gb-x { fill: var(--muted); font: 700 12px var(--font-body); }
.gtr .gb-fing { fill: var(--paper); font: 700 8.5px var(--font-body); }
.gtr .gb-note { fill: var(--muted); font: 600 7.5px var(--font-mono); }
.gtr .gb-pos { fill: var(--ink-2); font: 600 9px var(--font-mono); }
.cc-gtr .cc-frets { letter-spacing: .08em; }
.gtr-voicings { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gtr-voicings figure { margin: 0; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); text-align: center; }
.gtr-voicings figcaption { font: 600 .8rem var(--font-mono); color: var(--ink-2); margin-top: 6px; }
.gtr-voicings figcaption small { display: block; font: 500 .72rem var(--font-body); color: var(--muted); }

.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head .panel-title { margin: 0; }
/* Instrument switch ------------------------------------------------------------ */
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: 600 .82rem var(--font-body); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Tab sections ------------------------------------------------------------------ */
.sec-tab .sec-body { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; overflow-x: auto; }
.sec-tab .ln-tab { font-size: .82em; line-height: 1.45; }
.lyrics-only .sec-tab { display: none; }

/* Chord cards ----------------------------------------------------------------- */
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cc-grid-wide { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cc { margin: 0; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.cc:hover { border-color: var(--line-strong); }
.cc figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-name { font: 700 1.15rem var(--font-mono); color: var(--chord); text-decoration: none; }
.cc-play { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; flex: none; }
.cc-play svg { width: 14px; height: 14px; fill: currentColor; margin-left: 2px; }
.cc-play:hover, .cc-play.is-playing { background: var(--accent); }
.cc-notes { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-notes span { font: 600 .72rem var(--font-mono); padding: 1px 6px; border-radius: 5px; background: var(--paper-2); color: var(--ink-2); }
.cc-compact { padding: 10px; gap: 6px; }
.cc-compact .cc-name { font-size: 1rem; }
.cc-unknown .cc-missing { font-size: .8rem; color: var(--muted); padding: 22px 0; text-align: center; border: 1px dashed var(--line-strong); border-radius: 8px; }

/* Song index rows ----------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.field { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
.field:focus-within { border-color: var(--ink); }
.field input, .field select { border: 0; outline: 0; background: transparent; height: 100%; min-width: 0; }
.field input { width: 240px; max-width: 60vw; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-size: .88rem; font-weight: 500; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.song-rows { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; counter-reset: row; }
.song-rows > li { display: grid; grid-template-columns: 1fr auto 150px 120px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); counter-increment: row; }
.song-rows > li:last-child { border-bottom: 0; }
.song-rows > li:hover { background: var(--paper-2); }
.song-rows > li > a { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.sr-title { font-weight: 600; font-size: 1.05rem; }
.sr-artist { color: var(--muted); font-size: .88rem; }
.sr-genre a { font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) {
  .song-rows > li { grid-template-columns: 1fr auto; }
  .sr-diff, .sr-genre { display: none; }
}

.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.az a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); text-decoration: none; font-weight: 700; background: var(--card); }
.az a:hover { border-color: var(--ink); }
.az-group h2 { font-size: 2rem; color: var(--accent); }
.artist-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.artist-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; }
.artist-list a:hover { border-color: var(--ink); color: inherit; }

/* Song page ------------------------------------------------------------------- */
.song-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 12px 0 22px; }
.song-head h1 { margin-bottom: .15em; }
.song-by { font-size: 1.1rem; color: var(--muted); margin-bottom: 18px; }
.song-by a { color: var(--ink); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.facts > div { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; font-weight: 600; font-size: .92rem; }
.facts .keyb { min-width: 26px; height: 26px; font-size: .72rem; }
.song-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.toolbar { position: sticky; top: 76px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; margin-bottom: 26px; background: var(--card); border: 2px solid var(--ink); border-radius: 16px; box-shadow: var(--hard); }
.tb-group { display: inline-flex; align-items: center; gap: 6px; }
.tb-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-right: 2px; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 700; }
.tb-btn:hover { border-color: var(--ink); }
.tb-btn small { font-size: .7em; }
.tb-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-key { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--ink); color: var(--paper); font: 700 .95rem var(--font-mono); }
.tb-reset { font-size: .78rem; font-weight: 600; }
.tb-select { height: 34px; padding: 0 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; }
.tb-play { display: inline-flex; gap: 6px; padding: 0 12px; }
.tb-play .i-pause, .tb-play[aria-pressed="true"] .i-play { display: none; }
.tb-play[aria-pressed="true"] .i-pause { display: block; }
.tb-play .i { width: 14px; height: 14px; fill: currentColor; }
.tb-scroll input[type="range"] { width: 90px; accent-color: var(--accent); }
.tb-toggles { margin-left: auto; flex-wrap: wrap; }
.tb-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-size: .85rem; font-weight: 600; }
.tb-chip:hover { border-color: var(--ink); }
.tb-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tb-chip .i { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .toolbar { position: static; gap: 8px 10px; padding: 8px 10px; }
  .tb-scroll input[type="range"] { width: 70px; }
  .tb-toggles { margin-left: 0; }
  .tb-label { display: none; }
}

.song-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.song-side { position: sticky; top: 160px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 180px); overflow: auto; padding-bottom: 8px; scrollbar-width: thin; }
.song-side .cc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 960px) {
  .song-layout { grid-template-columns: 1fr; }
  .song-side { position: static; max-height: none; }
  .song-side .cc-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
.panel { padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); }
.panel-title { display: flex; justify-content: space-between; align-items: center; font: 700 .78rem var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.panel p { font-size: .94rem; }
.panel-hint { font-size: .8rem !important; color: var(--muted); margin: 10px 0 0; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wiki-panel p { font-size: .9rem; color: var(--ink-2); }
.wiki-credit { font-size: .74rem !important; color: var(--muted) !important; border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 6px; }
.credits { margin: 0; display: grid; gap: 4px; font-size: .88rem; }
.credits > div { display: flex; gap: 8px; }
.credits dt { color: var(--muted); min-width: 92px; }
.credits dd { margin: 0; }

/* The sheet itself */
.sheet { --sheet-scale: 1; font-size: calc(1.08rem * var(--sheet-scale)); line-height: 1.5; }
.sec { margin: 0 0 1.8em; padding-left: 18px; border-left: 3px solid var(--line); position: relative; }
.sec-chorus { border-left-color: var(--accent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 50%, transparent), transparent 70%); border-radius: 0 12px 12px 0; padding: 10px 0 10px 18px; }
.sec-bridge { border-left-color: var(--teal); }
.sec-label { font: 700 .72rem var(--font-body); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: .6em; }
.sec-chorus > .sec-label { color: var(--accent-ink); }
.ln { white-space: pre-wrap; word-break: break-word; min-height: 1.5em; }
.ln-ch { margin-top: .25em; }
.ln-empty { min-height: .9em; }
.ln-comment { font-style: italic; color: var(--muted); font-size: .92em; margin: .3em 0; }
.ln-comment::before { content: '♪ '; color: var(--accent); font-style: normal; }
.ln-tab { font-family: var(--font-mono); font-size: .85em; white-space: pre; overflow-x: auto; }
/* A chord sits in flow above its word: the box is as wide as the wider of the two,
   so chords can never collide, and its baseline is the lyric's baseline. */
.cs { display: inline-block; vertical-align: baseline; text-indent: 0; }
.ch {
  display: block; margin: 0 0 -.05em; padding: 0 .55em 0 0; border: 0; border-radius: 5px;
  background: none; cursor: pointer; text-align: left;
  font: 700 .86em/1.35 var(--font-mono); color: var(--chord); white-space: nowrap;
}
.ln-chonly .cs { margin-right: .3em; }
.ln-chonly .ch { padding: .1em .45em; background: var(--paper-2); }
.ln-chonly .w { display: none; }
.ch:hover { background: var(--accent-soft); }
.ch.is-current { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.lyrics-only .ch { display: none; }
.lyrics-only .ln-ch { margin-top: 0; }
.lyrics-only .ln-chonly { display: none; }

.pop { position: absolute; z-index: 50; width: 260px; padding: 6px; border-radius: 16px; background: var(--card); border: 2px solid var(--ink); box-shadow: var(--hard); }
.pop .cc { border: 0; }
.pop-close { position: absolute; top: -12px; right: -12px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); cursor: pointer; font-size: 1rem; line-height: 1; }
.practice-bar { position: fixed; z-index: 45; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 18px; background: var(--card); border: 2px solid var(--ink); box-shadow: var(--hard); width: min(520px, calc(100vw - 24px)); }
.practice-now { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.practice-now .cc { flex: 0 0 170px; border: 0; padding: 4px; }
.practice-meta { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.practice-meta b { font-family: var(--font-mono); color: var(--chord); }
.practicing .site-footer { padding-bottom: 200px; }

/* Stage mode: distraction-free, big type */
.stage .site-header, .stage .site-footer, .stage .crumbs, .stage .song-side, .stage .block, .stage .song-head-actions, .stage .facts { display: none !important; }
.stage .song-layout { grid-template-columns: 1fr; }
.stage .toolbar { top: 8px; }
.stage .sheet { font-size: calc(1.45rem * var(--sheet-scale)); max-width: 1100px; margin: 0 auto; columns: 2 420px; column-gap: 56px; }
.stage .sec { break-inside: avoid; }

/* Chord & scale pages ------------------------------------------------------------- */
.chord-hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; padding: 16px 0 12px; }
.chord-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.chord-sym { font-family: var(--font-mono); color: var(--chord); letter-spacing: -.03em; }
.chord-hero-kbd { margin: 0; padding: 18px; border: 2px solid var(--ink); border-radius: 20px; background: var(--card); box-shadow: var(--hard); }
.chord-hero-kbd figcaption { margin-top: 12px; font-size: .88rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chord-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.chord-side { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
@media (max-width: 900px) { .chord-hero, .chord-body { grid-template-columns: 1fr; } .chord-side { margin-top: 0; } }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.inv { margin: 0; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); }
.inv figcaption { display: flex; flex-direction: column; margin-bottom: 10px; }
.inv figcaption span { font-size: .85rem; color: var(--muted); }
.inv-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; }
.pill-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-grid a { padding: 4px 10px; border-radius: 8px; border: 1.5px solid var(--line); text-decoration: none; font: 600 .85rem var(--font-mono); background: var(--paper); }
.pill-grid a:hover { border-color: var(--ink); color: var(--chord); }
.pill-grid a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list span { color: var(--muted); font-size: .85rem; text-align: right; }
.side-link { display: flex; align-items: center; gap: 8px; padding: 6px 0; text-decoration: none; font-weight: 500; font-size: .93rem; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }

.lookup { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.lookup input { flex: 1; min-width: 220px; height: 48px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); font: 600 1.05rem var(--font-mono); outline: 0; }
.lookup input:focus { box-shadow: var(--hard); }
.lookup-msg { width: 100%; margin: 0; min-height: 1.4em; font-size: .9rem; color: var(--muted); }
.root-grid { display: grid; grid-template-columns: repeat(12, 1fr); border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--ink); gap: 2px; }
.root-grid a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 120px; padding: 10px 4px; text-decoration: none; background: var(--key-white); color: #1d1b18; transition: background .12s; }
.root-grid a:nth-child(2), .root-grid a:nth-child(4), .root-grid a:nth-child(7), .root-grid a:nth-child(9), .root-grid a:nth-child(11) { background: #1d1b18; color: #f7f3ea; }
.root-grid a:hover { background: var(--accent); color: #fff; }
.root-name { font: 700 1.3rem var(--font-mono); }
.root-alt { font: 600 .75rem var(--font-mono); opacity: .6; }
@media (max-width: 760px) { .root-grid { grid-template-columns: repeat(6, 1fr); } .root-grid a { min-height: 80px; } }
.root-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.root-strip a { min-width: 44px; padding: 6px 10px; text-align: center; border-radius: 10px; border: 1.5px solid var(--line); text-decoration: none; font: 700 .95rem var(--font-mono); background: var(--card); }
.root-strip a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.matrix td, .matrix th { padding: 8px 10px; white-space: nowrap; }
.matrix td a { font: 600 .9rem var(--font-mono); text-decoration: none; }
.matrix td a:hover { color: var(--chord); }
.matrix tbody tr:hover { background: var(--paper-2); }
.matrix-scales td { text-align: center; }
.type-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.type-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; }
.type-item:hover { border-color: var(--ink); color: inherit; }
.type-sym { display: grid; place-items: center; min-width: 64px; height: 44px; padding: 0 6px; border-radius: 10px; background: var(--paper-2); font: 700 .95rem var(--font-mono); color: var(--chord); }
.type-item > span:last-child { display: flex; flex-direction: column; }
.type-formula { font: 500 .78rem var(--font-mono); color: var(--muted); }
.md-chords { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 1.4em 0; }

/* Tools ------------------------------------------------------------------------ */
.finder { padding: clamp(14px, 3vw, 24px); border: 2px solid var(--ink); border-radius: 22px; background: var(--card); box-shadow: var(--hard); }
.finder-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.finder-result { display: flex; flex-direction: column; }
.finder-name { font: 700 clamp(1.8rem, 5vw, 2.8rem)/1.1 var(--font-mono); color: var(--chord); }
.finder-name a { text-decoration: none; }
.finder-alt { color: var(--muted); }
.finder-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.finder-kbd { overflow-x: auto; }
.finder-kbd .kbd { min-width: 640px; }
.finder-notes { margin: 12px 0 0; color: var(--muted); min-height: 1.6em; }
.finder-more { margin-top: 12px; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 12px 12px 0; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
.prose pre.code { padding: 16px; border-radius: 12px; background: var(--ink); color: var(--paper); overflow-x: auto; font: 500 .9rem/1.6 var(--font-mono); }
.prose pre.code code { background: none; border: 0; padding: 0; color: inherit; }
:root[data-theme="dark"] .prose pre.code { background: #0b0a09; color: var(--ink); }
.prose .table-wrap { margin: 1.2em 0; }
.prose-page { padding-bottom: 20px; }

.tx-controls, .editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px; margin-bottom: 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); box-shadow: var(--hard); }
.tx-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tx-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tx-title { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); min-height: 32px; }
.tx-pane textarea, .tx-out, .editor-src textarea { width: 100%; min-height: 420px; margin: 0; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); font: 500 .92rem/1.6 var(--font-mono); resize: vertical; white-space: pre; overflow: auto; tab-size: 4; }
.tx-pane textarea:focus, .editor-src textarea:focus { outline: 0; border-color: var(--ink); }
.tx-out { color: var(--ink); }
@media (max-width: 760px) { .tx-panes, .editor-panes { grid-template-columns: 1fr !important; } }
.editor-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.editor-src textarea { min-height: 70vh; }
.editor-preview { padding: 20px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); min-height: 70vh; }
.editor-preview .cc-grid { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.editor-title { margin-bottom: .1em; }
.editor-status { font-size: .82rem; color: var(--muted); }
.spacer { flex: 1; }

.metro { max-width: 560px; margin: 0 auto; padding: 32px; border: 2px solid var(--ink); border-radius: 26px; background: var(--card); box-shadow: 8px 8px 0 var(--ink); text-align: center; display: flex; flex-direction: column; gap: 22px; }
.metro-dial { display: flex; flex-direction: column; align-items: center; }
.metro-bpm { font: 700 clamp(4rem, 14vw, 6rem)/1 var(--font-display); letter-spacing: -.04em; }
.metro-unit { font-weight: 700; color: var(--muted); letter-spacing: .2em; font-size: .8rem; }
.metro-term { font-family: var(--font-display); font-style: italic; color: var(--accent-ink); font-size: 1.2rem; margin-top: 4px; }
.metro-beats { display: flex; justify-content: center; gap: 12px; min-height: 26px; }
.beat { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); transition: background .05s, transform .05s; }
.beat-accent { border-color: var(--accent); }
.beat.on { background: var(--ink); transform: scale(1.2); }
.beat-accent.on { background: var(--accent); }
.metro-range { width: 100%; accent-color: var(--accent); }
.metro-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.metro-start { min-width: 140px; font-size: 1.05rem; padding: .85em 1.6em; }
.metro-start .i { fill: currentColor; }
.metro-start .i-pause, .metro-start[aria-pressed="true"] .i-play { display: none; }
.metro-start[aria-pressed="true"] .i-pause { display: block; }
.metro-start[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }

/* Search & songbook ------------------------------------------------------------------ */
.search-page-form { margin-top: 0; }
.search-types { margin: 6px 0 18px; }
.search-summary { color: var(--muted); }
.search-results, .setlist { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 8px; }
.search-results a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; }
.search-results a:hover { border-color: var(--ink); color: inherit; }
.sr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sr-main span { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.songbook-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.setlist { counter-reset: set; }
.setlist li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
.setlist:not(.setlist-recent) li::before { counter-increment: set; content: counter(set); font: 700 1.2rem var(--font-display); color: var(--accent); min-width: 24px; }
.setlist li > a { flex: 1; display: flex; flex-direction: column; text-decoration: none; }
.setlist li > a span { color: var(--muted); font-size: .88rem; }
.setlist-ctl { display: flex; gap: 4px; }

/* 404 ------------------------------------------------------------------------------- */
.nf { text-align: center; padding-top: 60px; }
.nf .hero-search { margin: 28px auto; }
.nf-code { font: 700 clamp(6rem, 22vw, 11rem)/1 var(--font-display); letter-spacing: -.06em; margin: 0; }
.nf-code span { color: var(--accent); font-style: italic; }

/* Toast ---------------------------------------------------------------------------------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* Article ---------------------------------------------------------------------------------- */
.article-head { max-width: 760px; padding: 12px 0 24px; }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 100px; font-size: .9rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }
.prose { font-size: 1.06rem; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } .toc { position: static; } }

/* Print ------------------------------------------------------------------------------------- */
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #000; --chord: #000; }
  .site-header, .site-footer, .toolbar, .song-head-actions, .crumbs, .block, .panel-actions, .pop, .practice-bar, .toast, .songbook-bar, .setlist-ctl, .panel-hint { display: none !important; }
  body { font-size: 11pt; }
  .song-layout { display: block; }
  .song-side { position: static; max-height: none; overflow: visible; }
  .song-side .panel:not(:first-child) { display: none; }
  .sheet { columns: 2; column-gap: 32px; font-size: 11pt; }
  .sec { break-inside: avoid; }
  .sec-chorus { background: none; }
  .ch { color: #000; text-decoration: underline; }
  .cc-play { display: none; }
  .song-side .cc-grid { grid-template-columns: repeat(6, 1fr); }
  a { text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Indic scripts ----------------------------------------------------------------------- */
.song-native { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; color: var(--ink-2); margin: -.2em 0 .4em; }
.song-card-native { font-weight: 600; color: var(--ink-2); font-size: 1rem; }
:lang(hi), :lang(bn) { line-height: 1.75; }
.sheet:lang(hi), .sheet:lang(bn) { font-family: 'Noto Sans Devanagari', 'Noto Sans Bengali', var(--font-body); }
.sheet:lang(hi) .ch, .sheet:lang(bn) .ch { font-family: var(--font-mono); }
.genre-name [lang] { font-family: 'Noto Sans Devanagari', 'Noto Sans Bengali', var(--font-body); font-weight: 600; }

/* Ads (only rendered when AdSense is configured) ---------------------------------------- */
.ad { margin: 40px auto; padding: 10px; max-width: 970px; min-height: 280px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper-2); text-align: center; }
.ad-sidebar { margin: 0; min-height: 250px; }
.ad-label { display: block; margin-bottom: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stage .ad { display: none !important; }
@media print { .ad { display: none !important; } }

/* More scripts & right-to-left ---------------------------------------------------------- */
:lang(gu) { font-family: 'Noto Sans Gujarati', var(--font-body); line-height: 1.75; }
:lang(he) { font-family: 'Noto Sans Hebrew', var(--font-body); }
:lang(ur) { font-family: 'Noto Nastaliq Urdu', var(--font-body); line-height: 2.3; }
:lang(ja) { font-family: 'Noto Sans JP', var(--font-body); line-height: 1.8; }
:lang(ko) { font-family: 'Noto Sans KR', var(--font-body); line-height: 1.8; }
.sheet .ch { direction: ltr; unicode-bidi: isolate; }
.sheet[dir="rtl"] .ch { text-align: right; padding: 0 0 0 .55em; }
.sheet[dir="rtl"] .sec { border-left: 0; border-right: 3px solid var(--line); padding-left: 0; padding-right: 18px; }
.sheet[dir="rtl"] .sec-chorus { border-right-color: var(--accent); border-radius: 12px 0 0 12px; background: linear-gradient(270deg, color-mix(in srgb, var(--accent-soft) 50%, transparent), transparent 70%); }
/* Public submission form */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.form label small, .form legend small { font-weight: 400; color: var(--muted); }
.form input, .form textarea { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; }
.form textarea { font-family: var(--font-mono); font-size: .9rem; }
.form fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.form .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-help { color: var(--muted); font-size: .9rem; margin: 0; }
.form .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; }
.notice-ok { background: var(--teal-soft); color: var(--teal); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Chord detector ------------------------------------------------------------------------ */
.detector { padding: clamp(14px, 3vw, 24px); border: 2px solid var(--ink); border-radius: 22px; background: var(--card); box-shadow: var(--hard); }
.det-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.det-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 600; }
.det-tabs [role="tab"]:hover { border-color: var(--ink); }
.det-tabs [aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.det-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 8px; }
.det-panel > p { margin: 0; color: var(--ink-2); flex: 1 1 260px; }
.det-panel .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.det-file { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; font-size: .92rem; color: var(--ink-2); }
.det-file input { padding: 10px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--paper); }
.det-yt { display: flex; gap: 8px; width: 100%; }
.det-yt input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font: inherit; }
.det-yt input:focus { outline: 0; border-color: var(--ink); }
.det-video { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; border: 1.5px solid var(--ink); }
.det-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.det-help { margin: 0; font-size: .9rem; color: var(--muted); width: 100%; }
.det-status { min-height: 1.4em; margin: 6px 0 16px; color: var(--muted); font-size: .92rem; }
.det-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.det-now { padding: 18px; border-radius: 18px; background: var(--paper); border: 1.5px solid var(--line); }
.det-chord { display: block; font: 700 clamp(3rem, 10vw, 5.5rem)/1 var(--font-mono); color: var(--chord); margin: 6px 0 2px; }
.det-quality { display: block; color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 1.1rem; min-height: 1.4em; }
.det-conf { height: 8px; border-radius: 999px; background: var(--paper-2); margin: 12px 0 14px; overflow: hidden; }
.det-conf span { display: block; height: 100%; width: var(--v, 0%); background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .2s; }
.det-side { display: flex; flex-direction: column; gap: 16px; }
.det-meta { margin: 0; }
.det-meta div { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-radius: 14px; background: var(--paper); border: 1.5px solid var(--line); }
.det-meta dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.det-meta dd { margin: 0; font: 700 1.6rem var(--font-mono); color: var(--chord); }
.chroma { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 140px; padding: 10px; border-radius: 14px; background: var(--paper); border: 1.5px solid var(--line); }
.chroma-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.chroma-bar span { width: 100%; height: calc(var(--h) * 100%); min-height: 2px; border-radius: 4px 4px 2px 2px; background: var(--accent); opacity: calc(.35 + var(--h) * .65); transition: height .12s; }
.chroma-bar b { font: 600 .66rem var(--font-mono); color: var(--muted); }
.det-settings { display: flex; flex-direction: column; gap: 10px; font-size: .9rem; font-weight: 600; }
.det-settings label { display: flex; flex-direction: column; gap: 6px; }
.det-settings small { font-weight: 400; color: var(--muted); }
.det-settings input[type="range"] { accent-color: var(--accent); }
.det-check { flex-direction: row !important; align-items: center; }
.det-timeline-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 24px 0 10px; }
.det-timeline-head h2 { margin: 0; font-size: 1.2rem; }
.det-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.det-timeline { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.tl-chip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; }
.tl-chip:hover { border-color: var(--ink); }
.tl-chip time { font-size: .72rem; color: var(--muted); font-family: var(--font-mono); }
.tl-chip b { font: 700 1.1rem var(--font-mono); color: var(--chord); }
.tl-chip.is-current { background: var(--accent); border-color: var(--accent); }
.tl-chip.is-current b, .tl-chip.is-current time { color: #fff; }
@media (max-width: 800px) { .det-main { grid-template-columns: 1fr; } .det-yt { flex-direction: column; } }

/* AI Tutor ---------------------------------------------------------------------- */
.tutor { display: flex; flex-direction: column; gap: 18px; margin-bottom: 40px; }
.tu-setup { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tu-setup .seg button { display: inline-flex; align-items: center; gap: 6px; }
.tu-setup .seg svg { width: 16px; height: 16px; }
.tu-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.tu-field select { border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); padding: 6px 12px; font: inherit; }
.tu-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .tu-grid { grid-template-columns: 1fr; } .tu-path { order: 2; } }
.tu-units { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tu-unit { width: 100%; display: grid; grid-template-columns: 28px 1fr 18px; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 1.5px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.tu-unit:hover { background: var(--paper-2); }
.tu-unit[aria-current="step"] { border-color: var(--accent); background: var(--accent-soft, var(--paper-2)); }
.tu-unit-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper-2); font: 700 .8rem var(--font-mono); }
.tu-unit.is-done .tu-unit-n { background: var(--teal, #2a7f7f); color: #fff; }
.tu-unit-t { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.tu-unit-t small { display: block; font: 500 .74rem var(--font-mono); color: var(--muted); margin-top: 2px; }
.tu-unit-s { color: var(--teal, #2a7f7f); font-weight: 700; }
.tu-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tu-tabs { display: flex; gap: 6px; }
.tu-tabs button { border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font: 600 .85rem var(--font-body); cursor: pointer; }
.tu-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tu-card { border: 1.5px solid var(--line-strong); border-radius: var(--radius, 18px); background: var(--card); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--hard, none); }
.tu-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tu-card-head .eyebrow { margin: 0 0 4px; }
.tu-target { margin: 0; font-size: 1.9rem; }
.tu-target b { font-family: var(--font-mono); color: var(--chord); font-size: 2.6rem; }
.tu-ask { font-weight: 500; color: var(--muted); font-size: 1.2rem; }
.tu-score { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.tu-score b { display: block; font: 700 1.3rem var(--font-mono); color: var(--ink); }
.tu-diagram { max-width: 460px; width: 100%; margin: 0 auto; }
.tu-diagram .gtr { max-width: 190px; }
.tu-dg-cap { text-align: center; margin: 6px 0 0; color: var(--ink-2); font-size: .9rem; }
.tu-dg-cap b { font-family: var(--font-mono); margin: 0 3px; }
.tu-keys .kbd { max-width: 100%; }
.tu-keys-bar { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.tu-status { margin: 0; min-height: 1.6em; text-align: center; font-size: 1.02rem; }
.tu-status.ok { color: var(--teal, #2a7f7f); font-weight: 600; }
.tu-status.warn { color: var(--accent-ink, var(--accent)); }
.tu-meter { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.tu-meter span { display: block; height: 100%; width: calc(var(--v, 0) * 100%); background: linear-gradient(90deg, var(--accent), var(--teal, #2a7f7f)); transition: width .12s; }
.tu-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tu-progress { height: 4px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.tu-progress span { display: block; height: 100%; width: 0; background: var(--teal, #2a7f7f); transition: width .3s; }
.tu-tip { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); font-size: .92rem; color: var(--ink-2); }
.tu-tip::before { content: 'Tip · '; font-weight: 700; color: var(--ink); }
.tu-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tu-choice { min-width: 84px; padding: 12px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--paper); color: var(--ink); font: 700 1.2rem var(--font-mono); cursor: pointer; }
.tu-choice:hover { border-color: var(--ink); }
.tu-choice.is-right { background: var(--teal, #2a7f7f); color: #fff; border-color: transparent; }
.tu-choice.is-wrong { background: var(--accent); color: #fff; border-color: transparent; }
.tu-choice.is-off { opacity: .45; }
.tu-chat .panel-title { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.tu-chat .panel-title svg { width: 18px; height: 18px; }
.tu-chat-note { font-size: .78rem; color: var(--muted); margin: 0 0 10px; }
.tu-msgs { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; margin-bottom: 10px; }
.tu-msg p { margin: 0; padding: 10px 14px; border-radius: 14px; font-size: .93rem; line-height: 1.5; }
.tu-msg ul { margin: 6px 0; padding-left: 18px; }
.tu-msg-user { align-self: flex-end; max-width: 85%; }
.tu-msg-user p { background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.tu-msg-assistant { align-self: flex-start; max-width: 92%; }
.tu-msg-assistant p { background: var(--paper-2); border-bottom-left-radius: 4px; }
.tu-typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: tu-dot 1s infinite; }
.tu-typing span:nth-child(2) { animation-delay: .15s; } .tu-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes tu-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tu-typing span { animation: none; } }
.tu-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tu-ask-form { display: flex; gap: 8px; align-items: flex-end; }
.tu-ask-form textarea { flex: 1; min-width: 0; resize: vertical; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); padding: 10px 12px; font: inherit; }
.tu-privacy { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); margin: 0; }
.tu-privacy svg { width: 16px; height: 16px; flex: none; }
.tu-msg-assistant { background: var(--paper-2); border-radius: 14px; border-bottom-left-radius: 4px; padding: 10px 14px; }
.tu-msg-assistant p { background: none; padding: 0; margin: 0 0 6px; border-radius: 0; }
.tu-msg-assistant > :last-child { margin-bottom: 0; }
.tu-msg-assistant ul, .tu-msg-assistant ol { margin: 0 0 6px; padding-left: 20px; font-size: .93rem; }
.tu-typing { padding: 10px 14px; }

/* AI Piano Teacher ---------------------------------------------------------------- */
.piano { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }
.pt-connect { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); }
.pt-dev { flex: 1 1 260px; font-size: .86rem; color: var(--ink-2); }
.pt-field { display: inline-flex; align-items: center; gap: 6px; font: 600 .82rem var(--font-body); color: var(--ink-2); }
.pt-field select, .pt-field input[type="number"] { border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); padding: 5px 8px; font: inherit; }
.pt-field input[type="number"] { width: 80px; }
.pt-check { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-2); }
.pt-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-tabs button { border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font: 600 .86rem var(--font-body); cursor: pointer; }
.pt-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pt-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .pt-grid { grid-template-columns: 1fr; } .pt-side { order: 2; } }
.pt-side { display: flex; flex-direction: column; gap: 14px; }
.pt-side .panel { display: flex; flex-direction: column; gap: 10px; }
.pt-help { margin: 0; font-size: .86rem; color: var(--ink-2); }
.pt-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow-y: auto; }
.pt-lesson { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border: 1.5px solid transparent; border-radius: 12px; background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.pt-lesson:hover { background: var(--paper-2); }
.pt-lesson[aria-current="step"] { border-color: var(--accent); background: var(--accent-soft, var(--paper-2)); }
.pt-ln { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--paper-2); font: 700 .78rem var(--font-mono); }
.pt-lt { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.pt-lt small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }
.pt-stars { color: #e0a100; font-size: .8rem; letter-spacing: 1px; white-space: nowrap; }
.pt-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-search input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); padding: 5px 8px; font: inherit; }
.pt-search { display: flex; }
.pt-empty { padding: 8px; font-size: .84rem; color: var(--muted); }
[data-drill-list] .pt-lesson { grid-template-columns: auto 1fr auto; }
[data-drill-list] .pt-ln { width: auto; min-width: 26px; padding: 0 6px; border-radius: 13px; font-size: .68rem; }
.pt-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.pt-kpis b { display: block; font: 700 1.4rem var(--font-mono); }
.pt-kpis span { font-size: .72rem; color: var(--muted); }
.pt-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 70px; align-items: end; }
.pt-week div { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.pt-week i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--teal, #2a7f7f); }
.pt-week span { font-size: .66rem; color: var(--muted); }
.pt-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pt-head .eyebrow { margin: 0 0 2px; }
.pt-title { margin: 0; font-size: 1.6rem; }
.pt-focus { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.pt-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); }
.pt-tempo input { width: 110px; accent-color: var(--accent); }
.pt-tempo output { font: 600 .82rem var(--font-mono); min-width: 40px; }
.pt-sheet { max-height: 240px; overflow-y: auto; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); padding: 6px 4px; scroll-behavior: smooth; }
.pt-row { display: block; width: 100%; height: auto; }
.pt-row .sl { stroke: var(--ink-2); stroke-width: .8; opacity: .7; }
.pt-row .bl { stroke: var(--ink); stroke-width: 1.1; }
.pt-row .bl-end { stroke-width: 3; }
.pt-row .ledger, .pt-row .stem { stroke: var(--ink); stroke-width: 1.1; }
.pt-row .flag { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.pt-row .nh { fill: var(--ink); stroke: var(--ink); stroke-width: 1.2; }
.pt-row .nh.open { fill: var(--paper); }
.pt-row .dot, .pt-row .rest { fill: var(--ink); }
.pt-row .clef, .pt-row .restg { fill: var(--ink); font-family: "Noto Music", "Segoe UI Symbol", "Apple Symbols", serif; }
.pt-row .tsig { fill: var(--ink); font: 700 15px var(--font-display); }
.pt-row .acc { fill: var(--ink); font-size: 13px; }
.pt-row .barno { fill: var(--muted); font: 500 9px var(--font-mono); }
.pt-row .fing { fill: var(--muted); font: 700 9px var(--font-body); }
.pt-row .sn.is-now .nh, .pt-row .sn.is-now .stem { fill: var(--accent); stroke: var(--accent); }
.pt-row .sn.is-now .nh.open { fill: var(--paper); }
.pt-row .sn.is-hit .nh { fill: #2f9e5b; stroke: #2f9e5b; }
.pt-row .sn.is-hit .nh.open { fill: var(--paper); }
.pt-row .sn.is-miss .nh { fill: #d64545; stroke: #d64545; }
.pt-stage { position: relative; }
.pt-stage canvas { display: block; width: 100%; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card); touch-action: none; cursor: pointer; }
.pt-overlay { position: absolute; inset: 0 0 40% 0; display: grid; place-items: center; font: 800 5rem var(--font-display); color: var(--accent); pointer-events: none; text-shadow: 0 2px 0 var(--paper); }
.pt-chord { position: absolute; top: 14px; left: 0; right: 0; text-align: center; pointer-events: none; }
.pt-chord b { display: block; font: 700 2.6rem var(--font-mono); color: var(--chord); }
.pt-chord span { font: 600 .9rem var(--font-mono); color: var(--ink-2); }
.pt-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pt-status { flex: 1 1 200px; font-size: .98rem; }
.pt-status b { font-family: var(--font-mono); color: var(--chord); }
.pt-status sup { color: var(--muted); font-size: .7em; margin-left: 1px; }
.pt-status.warn { color: var(--accent-ink, var(--accent)); }
.pt-status.ok { color: #2f9e5b; font-weight: 600; }
.pt-octave { font: 500 .78rem var(--font-mono); color: var(--muted); }
.pt-results { display: flex; flex-direction: column; gap: 10px; }
.pt-results h3 { margin: 4px 0 0; font-size: 1rem; }
.pt-res-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pt-res-score b { display: block; font: 800 2.6rem/1 var(--font-display); }
.pt-res-score span { font-size: .75rem; color: var(--muted); }
.pt-res-stars span { font-size: 1.7rem; color: var(--line-strong); }
.pt-res-stars span.on { color: #e0a100; }
.pt-res-stats { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.pt-res-stats div { padding: 6px 10px; border-radius: 10px; background: var(--paper-2); }
.pt-res-stats span { display: block; font-size: .7rem; color: var(--muted); }
.pt-res-stats b { font: 700 .92rem var(--font-mono); }
.pt-heat { display: flex; flex-wrap: wrap; gap: 3px; }
.pt-heat i { width: 10px; height: 14px; border-radius: 3px; }
.pt-heat .h-hit { background: #2f9e5b; }
.pt-heat .h-late { background: #e0a100; }
.pt-heat .h-miss { background: #d64545; }
.pt-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.pt-res-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-ai .panel-title { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.pt-ai .panel-title svg { width: 18px; height: 18px; }
.pt-ai-note { font-size: .78rem; color: var(--muted); margin: 0 0 8px; }
.pt-settings { font-size: .88rem; }
.pt-settings summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.pt-settings[open] { display: flex; flex-direction: column; gap: 8px; }
.piano-faq { margin-top: 10px; }

/* Guides: answer box, byline, categories ------------------------------------------ */
.quick-answer { margin: 0 0 1.6em; padding: 16px 20px; border: 1.5px solid var(--teal, #2a7f7f); border-left-width: 6px; border-radius: 14px; background: var(--card); font-family: var(--font-body); font-style: normal; }
.quick-answer p { margin: 0; font-size: 1.04rem; line-height: 1.6; }
.byline { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.byline a { color: inherit; }
.learn-cat .block-title { margin-bottom: 14px; }
.learn-trust { margin: 26px 0 0; font-size: .9rem; color: var(--muted); }
.md-chords-gtr { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* Cookie consent ------------------------------------------------------------------ */
.consent { position: fixed; z-index: 70; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.consent p { margin: 0; flex: 1 1 260px; font-size: .88rem; }
.consent div { display: flex; gap: 8px; }
@media print { .consent { display: none; } }

/* ---- Song summary, how-to-play panel, share bar, footer profiles (SEO/AEO upgrade) ---- */
.song-summary { margin: 14px 0 0; max-width: 62ch; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.song-summary a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong, var(--line)); text-underline-offset: 2px; }
.how-to-play p { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; }
.how-to-play .mono { font-family: var(--font-mono, monospace); font-size: .85rem; overflow-wrap: anywhere; }
.panel-sub { margin: 12px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 22px 0 6px; }
.share-label { font-weight: 700; font-size: .82rem; color: var(--ink-2); margin-right: 4px; }
.share-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 .8rem var(--font-body, inherit); text-decoration: none; cursor: pointer; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn[hidden] { display: none; }
.share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.footer-follow { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 26px; font-size: .86rem; }
.footer-follow span { opacity: .7; }
.footer-follow a { color: inherit; }
@media print { .share { display: none; } }

/* Home-page video tutorial ------------------------------------------------ */
.tut .block-head { flex-wrap: wrap; align-items: center; }
.tut-langs { display: inline-flex; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); }
.tut-langs button { border: 0; background: none; color: var(--ink); font: 600 .92rem var(--font-body); padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.tut-langs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tut-pane { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.tut-pane[hidden] { display: none; }
.tut-player { position: relative; aspect-ratio: 16 / 9; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: #111; box-shadow: var(--hard); }
.tut-player video, .tut-player iframe { display: block; width: 100%; height: 100%; border: 0; background: #111; }
.tut-yt { display: grid; place-items: center; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #111 center / cover no-repeat; }
.tut-play { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .15s; }
.tut-play .i { width: 34px; height: 34px; margin-left: 4px; fill: currentColor; }
.tut-yt:hover .tut-play, .tut-yt:focus-visible .tut-play { transform: scale(1.08); }
.tut-title { margin: 0 0 8px; font: 700 1.25rem/1.25 var(--font-display); }
.tut-side p { margin: 0 0 12px; color: var(--ink-2); }
.tut-side .tut-label { margin: 16px 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tut-pane[lang="hi"] .tut-label { letter-spacing: 0; }
.tut-chapters { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--line); }
.tut-chapters button { display: flex; gap: 12px; width: 100%; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: .93rem; text-align: left; cursor: pointer; }
.tut-chapters button:hover, .tut-chapters button:focus-visible { color: var(--accent); background: var(--accent-soft); }
.tut-chapters .mono { min-width: 2.6em; color: var(--muted); }
@media (max-width: 860px) { .tut-pane { grid-template-columns: 1fr; gap: 18px; } }
