/* ================================================================
   MELODY MONKEY — shared lesson page styles
   Used by every standalone SEO lesson under /lessons/*.html
   ================================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b0b12;
  --bg-2: #11111e;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #f0f0f5;
  --text-2: #a8a8bf;
  --muted: #6a6a82;
  --accent-1: #f59e0b;
  --accent-2: #8b5cf6;
  --accent-3: #ec4899;
  --grad: linear-gradient(135deg, #f59e0b 0%, #8b5cf6 60%, #ec4899 100%);
  --radius: 20px;
  --radius-sm: 12px;
  --key-white: #f4f4f8;
  --key-white-in: #fff;
  --key-black: #1c1c28;
}
:root[data-theme="light"] {
  --bg: #f0f0f8;
  --bg-2: #e6e6f0;
  --card: rgba(0,0,0,0.03);
  --card-hover: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --text: #1a1a2a;
  --text-2: #4a4a6a;
  --muted: #8a8aaa;
  --key-white: #ffffff;
  --key-white-in: #fff;
  --key-black: #23233a;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f0f0f8; --bg-2: #e6e6f0; --card: rgba(0,0,0,0.03); --card-hover: rgba(0,0,0,0.06);
    --border: rgba(0,0,0,0.08); --border-strong: rgba(0,0,0,0.14);
    --text: #1a1a2a; --text-2: #4a4a6a; --muted: #8a8aaa; --key-black: #23233a;
  }
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top nav ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand svg { width: 34px; height: 34px; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--text-2); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.nav-link:hover { color: var(--text); background: var(--card-hover); text-decoration: none; }
.nav-cta { background: var(--grad); color: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.nav-cta:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); }
/* Matches the app shell's .theme-toggle-btn (Website/CSS/style.css) look -
   pill shape, SVG icon + text label - just wired to this page's own
   --card/--border/--text-2 variable names instead of style.css's. */
.theme-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 10px;
  transition: 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  min-height: 30px;
  line-height: 1;
}
.theme-btn:hover { background: var(--card-hover); color: var(--text); }
.theme-btn .icon-svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.theme-btn .label-text { font-size: 11px; font-weight: 500; }

/* ---- Layout ---- */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px 90px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 30px 0 10px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-1); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--accent-1); margin-bottom: 4px; }
.pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #10b981; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); padding: 4px 11px; border-radius: 999px; }
h1 { font-family: 'Nunito', sans-serif; font-size: clamp(30px, 6vw, 46px); font-weight: 900; letter-spacing: -1px; line-height: 1.12; margin: 14px 0 18px; }
h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lede { font-size: 18px; color: var(--text-2); margin-bottom: 4px; line-height: 1.6; }
.meta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 4px; font-size: 13px; color: var(--muted); }

h2 { font-family: 'Nunito', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin: 48px 0 14px; line-height: 1.25; }
h3 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; }
p { margin: 14px 0; color: var(--text); }
.section-text { color: var(--text-2); }
strong { color: var(--text); font-weight: 700; }
article ol, article ul { padding-left: 22px; margin: 14px 0; color: var(--text-2); }
article ol li, article ul li { margin: 8px 0; line-height: 1.6; }

.formula-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.step-tag { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; padding: 9px 15px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--card); }
.step-tag.whole { color: var(--accent-2); }
.step-tag.half { color: var(--accent-1); }

/* ---- Interactive card ---- */
.interactive {
  background: linear-gradient(180deg, var(--card) 0%, transparent 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  margin: 26px 0;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}
.interactive-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.interactive-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 18px; }
.interactive-hint { font-size: 13px; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0 22px; }
.control-group { display: flex; align-items: center; gap: 9px; }
.control-group label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 13px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
}
select:hover { border-color: var(--accent-1); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--grad); color: #fff; border: none; border-radius: 10px;
  padding: 10px 17px; font-size: 14px; font-weight: 700; font-family: inherit;
}
.embed-snippet { margin: 14px 0 28px; }
.embed-snippet textarea {
  width: 100%; resize: vertical; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px;
  font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 1.5;
  margin-bottom: 10px;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border-strong); }

/* scale/interval note chips */
.scale-notes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.note-chip {
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 76px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 12px 10px; cursor: pointer; transition: transform 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}
.note-chip:hover { border-color: var(--accent-1); transform: translateY(-2px); }
.note-chip.playing { border-color: var(--accent-1); background: rgba(245,158,11,0.14); }
.note-chip .nc-note { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 21px; line-height: 1.1; }
.note-chip .nc-degree { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: 0.3px; line-height: 1; }
.note-chip .nc-name { font-size: 10.5px; color: var(--accent-2); font-weight: 700; line-height: 1.2; text-align: center; }

/* piano */
.piano-wrap { overflow-x: auto; padding-bottom: 8px; }
.piano { position: relative; display: flex; height: 172px; min-width: 440px; user-select: none; }
.wkey {
  position: relative; flex: 1; background: var(--key-white); border: 1px solid #2a2a3a;
  border-radius: 0 0 7px 7px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 9px; font-size: 11px; color: #55556a; font-weight: 700;
}
.wkey:active { background: #e6e6ef; }
.wkey.in-scale { background: linear-gradient(180deg, rgba(245,158,11,0.18), var(--key-white-in)); }
.wkey.in-scale.tonic { background: linear-gradient(180deg, rgba(245,158,11,0.45), rgba(245,158,11,0.12)); }
.wkey.playing { background: linear-gradient(180deg, var(--accent-1), #ffd27f); }
.bkey {
  position: absolute; top: 0; width: 58%; height: 62%; background: var(--key-black);
  border-radius: 0 0 6px 6px; cursor: pointer; z-index: 2; transform: translateX(-50%);
  border: 1px solid #000; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  font-size: 9px; color: #9a9ab5; font-weight: 700;
}
.bkey.in-scale { background: linear-gradient(180deg, var(--accent-1), #4a3410); color: #fff; }
.bkey.in-scale.tonic { background: linear-gradient(180deg, var(--accent-1), var(--accent-3)); }
.bkey.playing { background: linear-gradient(180deg, #ffd27f, var(--accent-1)); color: #000; }
.wkey.picked-first, .bkey.picked-first { outline: 3px solid var(--accent-2); outline-offset: -3px; z-index: 3; }

/* scale fretboard diagram (MM.renderFretboardScale) -- .fretboard-wrap is the
   same reusable horizontal-scroll wrapper the table-based .fretboard below
   uses; the dots are named .scale-dot (not .fret-dot) specifically so they
   don't inherit that unrelated component's div/table-cell styling. */
.fretboard-svg { display: block; min-width: 420px; }
.scale-dot { fill: var(--text-2); cursor: pointer; }
.scale-dot.tonic { fill: var(--accent-1); }
.scale-dot:hover, .scale-dot:focus { fill: var(--accent-1); outline: none; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* guitar fretboard (reusable across instrument/theory lessons) */
.fretboard-wrap { overflow-x: auto; padding-bottom: 8px; }
.fretboard { border-collapse: separate; border-spacing: 0; min-width: 520px; }
.fretboard td { width: 46px; height: 34px; text-align: center; position: relative; border-right: 2px solid #6b5a3a; border-bottom: 1px solid rgba(255,255,255,0.08); }
.fretboard td.nut { border-right: 4px solid var(--text-2); width: 30px; }
.fretboard .fret-num { color: var(--muted); font-size: 11px; font-weight: 700; border: none; height: 20px; }
.fret-dot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; }
.fret-dot.on { background: var(--accent-1); }
.fret-dot.root { background: var(--grad); }

/* guitar chord diagrams */
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px; margin: 6px 0 4px; }
.chord-card {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 12px 8px 10px; text-align: center; transition: transform 0.1s ease, border-color 0.1s ease;
}
.chord-card:hover { border-color: var(--accent-1); transform: translateY(-2px); }
.chord-card .cc-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 16px; margin-bottom: 6px; }
.chord-card .cc-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.chord-diagram { width: 100%; max-width: 120px; height: auto; }
/* diatonic-chord fallback when chord_shapes.py has no shape (diminished) --
   an honest placeholder, never a guessed diagram. */
.cc-noshape { font-size: 11px; color: var(--muted); padding: 26px 4px; line-height: 1.4; }

/* staff notation (simplified/illustrative) */
.staff-wrap { overflow-x: auto; padding: 6px 0 10px; }
.staff-svg { display: block; min-width: 320px; }
.staff-svg .clef-glyph, .staff-svg .rest-glyph { fill: var(--text); font-family: 'Noto Music', serif; }
.staff-svg .acc-glyph { fill: var(--accent-1); font-family: 'Noto Music', serif; }
.staff-svg .note-head { cursor: pointer; }
.staff-svg .note-head ellipse { transition: fill 0.12s ease, stroke 0.12s ease; }
.staff-svg .note-head:hover ellipse { stroke: var(--accent-1); }
.staff-svg .note-head.active ellipse { fill: var(--accent-1) !important; stroke: var(--accent-1); }
.staff-svg .note-head:focus { outline: none; }
.staff-svg .note-head:focus ellipse { stroke: var(--accent-2); stroke-width: 2; }
.staff-grand { display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--border-strong); border-radius: 3px; padding-left: 10px; margin-left: -14px; }

/* rhythm / metronome */
.tempo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 10px 0 20px; }
.tempo-slider { flex: 1 1 200px; min-width: 160px; accent-color: var(--accent-1); height: 6px; cursor: pointer; }
.bpm-readout { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 22px; min-width: 96px; }
.bpm-readout .unit { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.beat-dots { display: flex; gap: 10px; margin: 4px 0 20px; flex-wrap: wrap; }
.beat-dot {
  width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--border-strong);
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
}
.beat-dot.accent { border-color: var(--accent-2); }
.beat-dot.lit { background: var(--grad); transform: scale(1.28); border-color: transparent; }
.pulse-ring {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--muted);
  transition: transform 0.08s ease, border-color 0.08s ease, background 0.08s ease; flex-shrink: 0;
}
.pulse-ring.lit { border-color: var(--accent-1); background: rgba(245,158,11,0.16); transform: scale(1.1); color: var(--accent-1); }
.rhythm-strip { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 8px; }
.rbeat {
  flex: 0 0 auto; min-width: 46px; height: 46px; border-radius: 10px; background: var(--card);
  border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-2); transition: background 0.1s ease, border-color 0.1s ease;
}
.rbeat.on { border-color: var(--accent-2); }
.rbeat.lit { background: var(--grad); color: #fff; border-color: transparent; }
.rbeat.rest { color: var(--muted); font-style: italic; }

/* circle of fifths */
.cof-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: center; }
.cof-wheel { flex: 0 0 auto; }
.cof-wheel svg { width: 300px; max-width: 74vw; height: auto; }
.cof-seg { cursor: pointer; }
.cof-seg .cof-ring { fill: var(--card); stroke: var(--border-strong); stroke-width: 1; transition: fill 0.12s ease; }
.cof-seg:hover .cof-ring { fill: var(--card-hover); }
.cof-seg.sel .cof-ring { fill: rgba(245,158,11,0.18); stroke: var(--accent-1); stroke-width: 2; }
.cof-major { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; fill: var(--text); }
.cof-minor { font-weight: 600; font-size: 11px; fill: var(--text-2); }
.cof-seg.sel .cof-major { fill: var(--accent-1); }
.cof-info { flex: 1 1 240px; min-width: 220px; }
.cof-info .cof-key { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 24px; }
.cof-info .cof-notes { font-size: 16px; color: var(--text); margin: 6px 0 10px; letter-spacing: 0.5px; }
.cof-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 14px; font-size: 14px; }
.cof-info dt { color: var(--muted); }
.cof-info dd { color: var(--text); }

/* degree/reference table */
.table-wrap { overflow-x: auto; margin: 18px 0; }
table.lesson-table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 14px; }
table.lesson-table th, table.lesson-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
table.lesson-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
table.lesson-table td:first-child { font-weight: 700; }

/* callout */
.callout { background: var(--card); border-left: 3px solid var(--accent-1); border-radius: 0 12px 12px 0; padding: 15px 20px; margin: 24px 0; color: var(--text-2); }
.callout strong { color: var(--text); }

/* FAQ */
details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 2px 20px; margin: 12px 0; }
details[open] { border-color: var(--border-strong); }
summary { cursor: pointer; font-weight: 700; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--accent-1); font-size: 22px; font-weight: 700; flex-shrink: 0; }
details[open] summary::after { content: '−'; }
details p { color: var(--text-2); margin: 0 0 16px; }

/* related / CTA */
.cta-card { background: var(--grad); border-radius: var(--radius); padding: 30px; text-align: center; margin: 48px 0 12px; color: #fff; }
.cta-card h2 { color: #fff; margin: 0 0 10px; }
.cta-card p { color: rgba(255,255,255,0.92); margin: 0 0 18px; }
.cta-card .btn { background: #fff; color: #1a1a2a; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.related a { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 15px 17px; color: var(--text); display: block; }
.related a:hover { border-color: var(--border-strong); background: var(--card-hover); text-decoration: none; }
.related .r-tag { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.related .r-title { display: block; font-weight: 700; margin-top: 5px; line-height: 1.35; }

footer { border-top: 1px solid var(--border); padding: 34px 24px; text-align: center; color: var(--muted); font-size: 13px; line-height: 2; }
footer a { color: var(--text-2); }

@media (max-width: 600px) {
  .nav-link { display: none; }
  .wrap { padding: 0 16px 70px; }
  .interactive { padding: 18px; }
  h2 { margin-top: 40px; }
}

/* ================================================================
   LIVE TOOL WIDGETS — /tools/tuner and /tools/metronome
   ----------------------------------------------------------------
   These pages used to describe a tool and link to the app for it, so a
   searcher landing on "free online guitar tuner" got prose and a CTA.
   The widgets below run the real JS/tuner.js and JS/metronome.js inline
   on the page instead.

   Adapted from CSS/embed-tuner.css (which stays as-is: it's a standalone
   stylesheet for the third-party iframe at /embed/tuner and styles <body>
   itself, so it can't be linked from a full page). Everything here is
   scoped under .tool-live and driven by lesson.css tokens, so it themes
   with the rest of the page instead of forcing a dark palette.
   ================================================================ */
.tool-live {
  /* metronome.js writes these two straight into element.style, and they're
     named for the app's stylesheet (style.css), not this one. Aliased here
     so the pulse renders instead of resolving to an invalid value. */
  --text-muted: var(--muted);
  --glow-accent: rgba(245,158,11,0.45);
  max-width: 460px;
}
.tool-live .tool-note {
  font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.5;
}

/* ---- Tuner ---- */
.tuner-display { text-align: center; padding: 10px 0 2px; }
.tuner-note {
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 54px;
  letter-spacing: 1px; line-height: 1.15; color: var(--text); transition: color 0.15s;
}
.tuner-note.in-tune { color: #34d399; }
.tuner-note.sharp { color: var(--accent-1); }
.tuner-detail {
  display: flex; justify-content: center; gap: 20px; font-size: 14px;
  color: var(--text-2); margin-top: 2px; font-variant-numeric: tabular-nums;
}
.tuner-detail .freq { font-weight: 600; }
.tuner-detail .cents { font-weight: 600; min-width: 62px; }
.tuner-detail .cents.flat { color: #6a9fd8; }
.tuner-detail .cents.sharp { color: var(--accent-1); }
.tuner-detail .cents.in-tune { color: #34d399; }

.tuner-meter {
  position: relative; height: 6px; background: var(--card-hover);
  border-radius: 40px; margin: 18px 0 10px; overflow: visible;
}
.tuner-meter .track-bg {
  position: absolute; inset: 0; border-radius: 40px; opacity: 0.3;
  background: linear-gradient(to right, #6a9fd8 0%, #6a9fd8 42%, #34d399 45%,
              #34d399 55%, var(--accent-1) 58%, var(--accent-1) 100%);
}
.tuner-meter .center-mark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 13px; background: var(--border-strong); border-radius: 2px;
}
.tuner-meter .needle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 21px; background: var(--text); border-radius: 4px;
  transition: left 0.08s ease-out; will-change: left;
}
.tuner-meter .needle.in-tune { background: #34d399; box-shadow: 0 0 22px rgba(52,211,153,0.45); }

.hz-control { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.hz-control label { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.hz-control input[type="range"] {
  width: 130px; height: 3px; -webkit-appearance: none; appearance: none;
  background: var(--border-strong); border-radius: 4px; outline: none;
}
.hz-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent-1); cursor: pointer; border: 2px solid var(--bg);
}
.hz-control input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent-1);
  cursor: pointer; border: 2px solid var(--bg);
}
.hz-control .hz-value {
  font-size: 16px; font-weight: 700; color: var(--text); min-width: 58px;
  text-align: center; font-variant-numeric: tabular-nums;
}
.hz-control .hz-value small { font-size: 11px; font-weight: 500; color: var(--muted); }

.tuner-actions { display: flex; justify-content: center; margin-top: 16px; }
.mic-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 30px;
  color: var(--text); padding: 9px 22px; font-size: 14px; font-weight: 700; font-family: inherit;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.mic-btn:hover { border-color: var(--accent-1); background: var(--card-hover); }
.mic-btn.active { background: rgba(52,211,153,0.12); border-color: #34d399; color: #34d399; }
.mic-btn.active svg { animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---- Metronome ---- */
.metro-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 12px 0 4px; }
.metro-pulse {
  width: 84px; height: 84px; border-radius: 50%; background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
.metro-beat-count {
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 34px;
  color: var(--bg); line-height: 1; font-variant-numeric: tabular-nums;
}
.metro-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.metro-row label { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.metro-row input[type="number"] {
  width: 92px; background: var(--bg-2); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 12px; font-size: 17px; font-weight: 700; font-family: inherit;
  text-align: center; font-variant-numeric: tabular-nums;
}
.metro-row input[type="number"]:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 1px; }
.start-stop-btn {
  cursor: pointer; background: var(--grad); color: #fff; border: none; border-radius: 10px;
  padding: 10px 26px; font-size: 15px; font-weight: 800; font-family: inherit; min-width: 96px;
}
.start-stop-btn:hover { filter: brightness(1.07); }
.beat-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.beat-picker .nav-btn {
  cursor: pointer; background: var(--card); color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 7px 15px; font-size: 13px; font-weight: 700; font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.beat-picker .nav-btn:hover { border-color: var(--accent-1); color: var(--text); }
.beat-picker .nav-btn.active-mode { border-color: var(--accent-1); color: var(--accent-1); background: var(--card-hover); }

.tool-live :focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .tuner-meter .needle { transition: none; }
  .mic-btn.active svg { animation: none; }
  .metro-pulse { transition: none; }
}
