/* Music symbols for the staff (SIL Open Font License, see fonts/bravura-license.txt). */
@font-face { font-family: "Bravura"; src: url("fonts/bravura.otf") format("opentype"); font-display: block; }

:root {
  --bg: #f7f5fb; --surface: #ffffff; --surface-2: #efeaf8; --text: #1d1b22; --muted: #5f5a6b;
  --primary: #5629a5; --on-primary: #ffffff; --primary-soft: #e9e0fa; --border: #d9d3e6; --danger: #b3261e;
  --radius: 14px; --scale: 1; --lyrics: #2873a7; --accent: #b45309;
}
[data-theme="dark"] {
  --bg: #141218; --surface: #1d1b22; --surface-2: #2a2631; --text: #ece6f3; --muted: #b3abc0;
  --primary: #c9b3ff; --on-primary: #2a1060; --primary-soft: #3a2d58; --border: #403a4a; --danger: #ffb4ab; --lyrics: #8cc4ec; --accent: #ffb870;
}
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
/* Phones: keep everything clear of the system's own buttons and bars (home bar, gesture bar, back/home buttons,
   rounded corners and camera cutouts). "dvh" is the part of the screen you can actually see, so nothing sits
   under the browser's own toolbar; "vh" is the fallback for older browsers. */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; font-weight: 600; }
h2 { font-size: 1.3rem; margin: 1.25rem 0 .5rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; font-weight: 600; }
p { margin: .25rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.page { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

button { font: inherit; color: inherit; cursor: pointer; }
.btn { border: 0; border-radius: 999px; padding: .75rem 1.25rem; background: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.wide { width: 100%; }
.btn-outline { border: 1.5px solid var(--border); border-radius: 999px; padding: .65rem 1.1rem; background: transparent; font-weight: 600; }
.btn-text { border: 0; background: transparent; color: var(--primary); font-weight: 600; padding: .6rem .5rem; }
.btn-danger { color: var(--danger); }
.center { align-self: center; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; background: var(--bg); }
.topbar .brand { font-weight: 700; font-size: 1.1rem; padding-left: 6px; }
.topbar .spacer { flex: 1; }
.top-back { min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* long composition names get "…" */
.avatar-btn { border: 0; padding: 0; background: transparent; border-radius: 50%; }

.avatar { border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.initials { background: #2f3e5c; color: #fff; font-weight: 600; }

.option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.option[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); padding: 11.5px; }
.option.dashed { border-style: dashed; }
.mark { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.option .title { font-weight: 600; }
.badge { margin-left: auto; font-size: .75rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.error { color: var(--danger); font-size: .9rem; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { text-align: left; border: 0; border-radius: 18px; padding: 16px; background: var(--surface); min-height: 140px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(60,30,120,.08); display: flex; flex-direction: column; gap: 6px; }
.tile .mark { background: var(--primary-soft); }
.tile .title { font-weight: 700; font-size: 1.05rem; }
/* Coming soon: a little quieter, with a "Soon" badge in the top-right corner. */
.tile { position: relative; }
.tile-soon { opacity: .78; }
.tile-soon .mark { background: var(--surface-2); }
.tile-badge { position: absolute; top: 12px; right: 12px; margin: 0; }

.card { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); }
hr { border: 0; border-top: 1px solid var(--border); margin: .75rem 0; width: 100%; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .85rem; color: var(--muted); }
.field input { font: inherit; padding: .7rem .8rem; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); }
.field input:focus { outline: 2px solid var(--primary); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--border); border-radius: 10px; padding: .45rem .8rem; background: transparent; }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); font-weight: 600; }

.switch-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.switch-row span { flex: 1; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; border: 0; background: var(--border); flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.avatar-option { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; font-size: .72rem; }
.avatar-option .ring { border: 3px solid transparent; border-radius: 50%; padding: 2px; }
.avatar-option[aria-pressed="true"] .ring { border-color: var(--primary); }
.avatar-option .add { width: 56px; height: 56px; border-radius: 50%; border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--primary); }

.bursts { display: flex; flex-wrap: wrap; gap: 6px; }
.burst { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; padding: 2px; }
.burst canvas { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); border: 3px solid transparent; }
.burst[aria-pressed="true"] canvas { border-color: var(--primary); }

.preview { background: var(--surface-2); border-radius: 12px; padding: 12px; }

/* Lyrics use px, so "Larger text" (which scales rem) doesn't touch them. Only the lyrics size setting does. */
.lyrics { font-size: calc(23px * var(--lyrics-scale, 1)); color: var(--lyrics); line-height: 1.3; }

.overlay { position: fixed; inset: 0; background: rgba(15,10,30,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
@media (min-width: 600px) { .overlay { align-items: center; } }
/* The round icon button used across the app (iconButton in karaoke.js) */
.round-icon { --kb: 46px; width: 46px; height: 46px; flex: none; padding: 0; border: none; border-radius: 50%; cursor: pointer;
  display: inline-grid; place-items: center; background: var(--primary); color: var(--on-primary, #fff); }
.round-icon.small { --kb: 38px; width: 38px; height: 38px; }
.round-icon.danger { background: var(--danger); }
.round-icon .kara-icon { display: grid; place-items: center; }
.round-icon[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: 0 0 12px var(--accent); }
.round-icon:disabled { opacity: .4; cursor: default; }
.round-icon:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .round-icon:hover:not(:disabled) { filter: brightness(1.12); } }
.vg-buttons { align-items: center; }
/* Intonation: the drone note that's playing glows amber */
.drone-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drone-head .switch-row { gap: 6px; font-size: .8rem; margin: 0; padding: 0; }
.drone-head .switch-row .switch { transform: scale(.75); transform-origin: right center; }
/* 7 columns: C … F♯ on top; G A♭ A B♭ B Low Mid below */
.drone-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.drone-grid .chip { min-width: 0; padding: 8px 0; text-align: center; justify-content: center; }
.drone-grid .drone-oct { font-size: .85rem; }
/* violin screens pulled up close to the top bar (like Voice Coach) */
.page.vio-tight { padding-top: 0; gap: 8px; }
.page.vio-tight h1 { margin: 0; }
.page.vio-tight > p { margin: 0; }
.intonation-panel .panel-rule { width: 100%; border: none; border-top: 1px solid rgba(127, 127, 127, .35); margin: 2px 0 0; }
.intonation-panel .vio-meter { padding: 0; margin: 0; gap: 4px; }
/* Test version: "just updated" banner at the top (never refreshes by itself) */
.tn-update { position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top)); z-index: 46;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 8px 8px 8px 14px; border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, .3); font-size: .9rem; }
.tn-update-x { flex: none; }
.tn-update-note { margin: 0; }
.tn-gate { max-width: 420px; margin: 0 auto; padding-top: calc(48px + env(safe-area-inset-top)); gap: 12px; text-align: center; }
.tn-gate h1 { margin: 0; color: var(--accent); }
.tn-guide-h { margin: 6px 0 0; font-size: 1rem; color: var(--accent); }
.tn-guide { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
/* Compose (violin): which string? */
.string-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.string-choices .chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; min-width: 0; }
.string-choices strong { font-family: Georgia, serif; font-style: italic; font-size: 1.2rem; }
/* Metronome: one panel */
.metro-panel, .practice-panel, .take-panel { gap: 10px; }
.metro-panel .panel-rule, .practice-panel .panel-rule { width: 100%; border: none; border-top: 1px solid rgba(127, 127, 127, .35); margin: 0; }
.metro-bpm { font-size: 1.6rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.metro-slide { display: flex; align-items: center; gap: 10px; }
.metro-go { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.metro-go .beat-dots { gap: 8px; flex-wrap: wrap; }
.metro-tap { padding: 10px 18px; }
.metro-row { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 6px; }
.metro-label { font-size: .85rem; font-weight: 700; color: var(--accent); }
.metro-choices { display: grid; gap: 6px; }
.metro-choices .chip { min-width: 0; padding: 7px 0; text-align: center; justify-content: center; font-size: .85rem; }
.metro-choices .metro-sym { font-size: 1.15rem; line-height: 1; }
.metro-panel .switch-row { margin: 0; padding: 0; font-size: .9rem; }
/* Practice log: one panel */
.practice-clock { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.practice-clock .vio-clock { font-size: 2.2rem; }
.practice-side { display: flex; gap: 6px; }
.practice-panel .vio-log-row { padding: 4px 2px; }
/* Record yourself: one panel */
.take-go { display: flex; align-items: center; justify-content: center; gap: 14px; }
.take-go .vio-clock { font-size: 2rem; }
.rec-btn:not([aria-pressed]) .kara-icon { color: #ff5a5a; }
.vio-take { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(127, 127, 127, .25); padding-top: 8px; }
.take-head { display: flex; align-items: center; gap: 8px; }
a.round-icon { text-decoration: none; }
/* Scales: one panel */
.scale-panel { gap: 8px; }
.scale-oct { display: flex; align-items: center; gap: 4px; }
.scale-oct .chip { min-width: 0; padding: 4px 10px; font-size: .85rem; }
.scale-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.scale-keys .chip, .scale-types .chip { min-width: 0; padding: 8px 0; text-align: center; justify-content: center; }
.scale-types .chip { font-size: .85rem; }
.scale-panel .score-scroll { margin: 0; }
.scale-legend { margin: 0; text-align: center; font-size: .75rem; }
.scale-actions { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.scale-actions .vio-sub { margin: 0; text-align: center; }
.scale-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.scale-mid .vio-sub:empty { display: none; }
.scale-panel .panel-rule { width: 100%; border: none; border-top: 1px solid rgba(127, 127, 127, .35); margin: 0; }
.vio-a4-grid { align-items: center; }
.vio-a4-grid > span { text-align: center; white-space: nowrap; }
.vio-a4-grid .chip { font-size: .85rem; }
.chip.drone-on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 10px var(--accent); }
.icon-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
/* "X is blocking your microphone" help: above every other pop-up */
.mic-help { z-index: 50; }
.mic-help-card { max-width: 460px; }
.mic-help-card h2 { margin: 0; color: var(--accent); }
.mic-help-card ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.mic-help-card .btn { text-align: center; text-decoration: none; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; max-height: calc(92dvh - env(safe-area-inset-top));
  overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0;
  padding: 22px calc(20px + env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) { .sheet { border-radius: 22px; } }
.sheet.small { max-width: 420px; }

/* Instruments menu */
.instrument-group { display: flex; flex-direction: column; gap: 6px; }
.instrument-family { margin: .5rem 0 0; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.instrument-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.instrument-tile { display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; padding: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.instrument-tile .title { font-weight: 600; }
.instrument-tile.ready { border-color: var(--primary); background: var(--primary-soft); }
@media (hover: hover) { .instrument-tile:hover { border-color: var(--primary); background: var(--primary-soft); } }

/* Violin tools */
.vio-meter { align-items: stretch; gap: 6px; }
.vio-note { font-size: 2.6rem; font-weight: 700; text-align: center; margin: 0; line-height: 1.1; }
.vio-sub { text-align: center; margin: 0; font-weight: 600; color: var(--muted); min-height: 1.4em; }
.vio-sub.good { color: #2e8b57; }
[data-theme="dark"] .vio-sub.good { color: #7fd6a4; }
/* The needle scale: -50 to +50 cents, with a green "in tune" band in the middle (±5). */
.vio-scale { position: relative; height: 46px; border-radius: 10px; background: var(--surface-2); margin: 4px 0 18px; }
.vio-zone { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; background: rgba(46, 139, 87, .25); }
.vio-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--muted); }
.vio-needle { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--danger);
  transition: left .12s; }
.vio-needle.good { background: #2e8b57; }
.vio-lbl { position: absolute; bottom: -18px; font-size: .72rem; color: var(--muted); }
.vio-lbl.l { left: 2px; } .vio-lbl.r { right: 2px; }
.vio-strings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vio-string { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface); font-size: 1.2rem; }
.vio-string[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.vio-a4 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.vio-on { border-color: var(--danger) !important; color: var(--danger); }
.btn.vio-on { background: var(--danger); color: #fff; }
.beat-dots { display: flex; justify-content: center; gap: 12px; }
.beat-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); }
.beat-dot.first { border-color: var(--accent); }
.beat-dot.on { background: var(--primary); border-color: var(--primary); }
.beat-dot.first.on { background: var(--accent); border-color: var(--accent); }
.vio-clock { font-size: 2.6rem; font-weight: 700; text-align: center; margin: 0; font-variant-numeric: tabular-nums; }
.vio-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vio-stats .card { align-items: center; gap: 0; }
.vio-big { font-size: 2rem; }
.vio-log-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); }
.vio-take audio { width: 100%; }
.scale-canvas { display: block; }
.record-btn { color: var(--danger); }
.room-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }

/* Voice check */
.voice-check { display: flex; flex-direction: column; gap: 10px; }
.voice-check h2 { margin-top: 0; }
.range-chart { display: block; width: 100%; max-width: 340px; height: auto; margin: 4px auto; color: #ddd;
  background: #0e0e14; border-radius: 14px; }
/* Voice Map: [note you're singing] [range chart] [Find your range] */
.map-row { display: grid; grid-template-columns: 54px minmax(0, 340px) 86px; justify-content: center; align-items: center; gap: 6px;
  max-width: 560px; width: 100%; margin: 0 auto; }
.map-row > * { min-width: 0; }
.map-row .range-chart { margin: 0; }
.map-tip { margin: 0; text-align: center; font-size: .9rem; }
.map-note { text-align: center; display: flex; flex-direction: column; gap: 14px; }
.map-slot { display: flex; flex-direction: column; align-items: center; }
.map-slot-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.map-note .coach-note { font-size: clamp(1.3rem, 6cqw, 2.2rem); font-weight: 700; transition: color .15s; white-space: nowrap; }
.map-slot.searching .coach-note { opacity: .55; }
.map-find { --kb: 48px; width: 48px; height: 48px; padding: 0; border-radius: 50%; justify-self: center;
  display: grid; place-items: center; }
.map-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.map-step { margin: 0; text-align: center; font-size: .8rem; line-height: 1.25; color: var(--accent); font-weight: 600; }
.map-step:empty { display: none; }
.map-side .map-find:not(.small) { --kb: 44px; width: 44px; height: 44px; }
.map-pair { display: flex; gap: 6px; }
.map-find.small { --kb: 38px; width: 38px; height: 38px; }
.map-find .kara-icon { display: grid; place-items: center; }
.voice-note { font-size: 3rem; font-weight: 600; text-align: center; margin: .25rem 0 0; font-variant-numeric: tabular-nums; }
.voice-hz { text-align: center; min-height: 1.2em; margin: 0; }
.voice-range { font-size: 1.5rem; font-weight: 600; margin: 0; }

/* Voice Coach */
/* Voice Coach sits right under the top bar (like Karaoke), so the tuner fits on screen. */
.page.coach { padding-top: 0; gap: 10px; }
/* The amber title and the four tabs (Vocal Tuner · Voice Map · Games · Exercises) share one row on any phone:
   both are sized from the page's width (cqw). */
.page.coach { container-type: inline-size; }
.page.coach h1 { margin: 0; font-size: clamp(.9rem, 4.4cqw, 1.25rem); white-space: nowrap; color: var(--accent); }
.coach-head { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.coach-head .chips { flex: 1 1 auto; min-width: 0; gap: clamp(3px, 1.2cqw, 6px); flex-wrap: nowrap; }
.coach-head .chips .chip { flex: 1 1 auto; min-width: 0; padding: .3em .45em; font-size: clamp(.58rem, 2.95cqw, .85rem); min-height: 0; white-space: nowrap; }
.coach-live { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 64px; }
.coach-note { font-size: 2.8rem; font-weight: 600; min-width: 3.2ch; text-align: center; font-variant-numeric: tabular-nums; }
.coach-staff { display: block; width: 100%; border-radius: 12px; cursor: pointer; }
.coach-cents { font-size: 1.15rem; font-weight: 600; text-align: center; margin: 0; }
.coach-cents.coach-centred { color: #2e8b57; }
[data-theme="dark"] .coach-cents.coach-centred { color: #7fd6a4; }
.coach-target { font-size: 1.4rem; min-width: 4ch; }
.coach-play { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.coach-check { display: flex; align-items: center; gap: 8px; }
.coach-check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* Compose */
.compose { gap: 6px; padding-top: 2px; }   /* tighter than other pages, so the staff sits higher */
.compose-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -6px -8px 0; }
.compose-title { border: 0; background: transparent; font-weight: 600; font-size: 1.05rem; padding: 6px 4px; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 45%; }
/* Palette: just the symbols, two rows of eight, no tiles (fits a ~390px phone). */
.palette-group { display: flex; flex-direction: column; gap: 0; }
/* Sits right on top of its icons (their top few pixels are empty), with space above to separate the rows. */
.palette-caption { font-size: .74rem; font-weight: 800; color: var(--accent); margin: 4px 0 -5px; line-height: 1; text-align: center;
  position: relative; pointer-events: none;
  text-transform: uppercase; letter-spacing: .06em; }
/* Music · Lyrics · Both: a three-part switch at the top of a composition. */
.write-switch { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--border); border-radius: 999px; padding: 3px; gap: 3px; }
.write-tab { border: 0; border-radius: 999px; background: transparent; padding: .35rem .5rem; font-weight: 700; color: var(--muted); }
.write-tab[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
@media (hover: hover) { .write-tab:hover:not([aria-selected="true"]) { background: var(--primary-soft); color: var(--text); } }
/* The Lyrics page */
.lyric-section { display: flex; flex-direction: column; gap: 4px; }
.lyric-head { display: flex; align-items: center; gap: 6px; }
.lyric-label { flex: 1; min-width: 0; border: 0; border-bottom: 1.5px solid transparent; background: transparent; color: var(--accent);
  font: inherit; font-weight: 800; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; padding: 2px 0; }
.lyric-label:focus { outline: none; border-bottom-color: var(--accent); }
.lyric-box { font: inherit; font-size: calc(1.05rem); line-height: 1.6; padding: .7rem .8rem; border-radius: 12px; resize: none; overflow: hidden;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); min-height: 5.5em; }
.lyric-box:focus { outline: 2px solid var(--primary); border-color: transparent; }
@media (hover: hover) { .lyric-box:hover, .lyric-label:hover { border-color: var(--primary); } }
/* The box for typing a word under a note (Both), placed over the staff where the word goes. */
.lyric-input { position: absolute; width: 90px; padding: 2px 4px; text-align: center; font: 15px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  border: 2px solid var(--primary); border-radius: 6px; background: #fff; color: #111; z-index: 2; }
.lyric-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(86,41,165,.25); }
/* 🎤 Speak on the Lyrics page */
.speak-btn { white-space: nowrap; }

.speak-status { margin: 0; color: var(--accent); }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); vertical-align: middle;
  animation: rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .25; } }
/* Third palette row: tabs in the same amber as the row titles; the chosen one is underlined.
   (Violin pieces have five tabs, so on small phones they tighten up to stay on one line.) */
@media (max-width: 420px) { .palette-tabs { gap: 0; } .palette-tabs .palette-tab { padding: 1px 4px 3px; letter-spacing: .02em; font-size: .7rem; } }
.palette-tabs { display: flex; justify-content: center; gap: 4px; margin: 4px 0 -3px; position: relative; }
.palette-tab { border: 0; background: transparent; padding: 1px 8px 3px; font-size: .74rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.palette-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
@media (hover: hover) { .palette-tab:hover { color: var(--accent); background: var(--primary-soft); } }
/* Symbols sit close together and centred, leaving room on the sides for more later. */
.palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2px; }
.palette-item { width: 42px; border: 0; border-radius: 10px; background: transparent; padding: 0 0 2px;
  display: flex; flex-direction: column; align-items: center; font-size: .62rem; line-height: 1.1; color: var(--muted);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.palette-item[aria-pressed="true"] { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.palette-icon { width: 40px; height: 44px; }
.compose-hint { margin: 0; color: var(--accent); flex: 1; min-width: 0; text-align: center; }
/* Hint on the left; Delete (when a symbol is selected) and ⚙ Options on the right, above the staff's top-right corner. */
.compose-hint-row { display: flex; align-items: center; gap: 6px; }
.options-btn { white-space: nowrap; }
.option-danger .title { color: var(--danger); }
.options-switch { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
@media (hover: hover) { .option-danger:hover:not(:disabled) { border-color: var(--danger); background: rgba(179, 38, 30, .08); } }
.option:disabled { opacity: .5; cursor: default; }
.compose-tips { padding: 0 .25rem; font-size: inherit; }
.palette-float { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; margin: -40px 0 0 -20px;
  padding: 2px 8px; border-radius: 8px; background: var(--primary); color: var(--on-primary); font-size: .75rem; }
.score-scroll { overflow-x: auto; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.score-canvas { display: block; touch-action: none; cursor: pointer; }
/* The clef strip sits over the left of the score and never scrolls; taps pass through to the score. */
.score-wrap { position: relative; }
.score-gutter { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 12px 0 0 12px;
  box-shadow: 3px 0 4px -3px rgba(0,0,0,.18); }
.compose-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* Time signature numbers shown stacked in the pop-up, like on a staff. */
.time-sig-big { display: flex; flex-direction: column; align-items: center; line-height: .95; font-weight: 800;
  font-size: 1.15rem; min-width: 1.6em; font-family: Georgia, "Times New Roman", serif; }
.compose-btn { padding: .5rem .8rem; color: var(--primary); }
.compose-btn.on { border-color: var(--danger); color: var(--danger); }
.compose-wide { grid-column: 1 / -1; }
/* Hidden from view, still there for keyboards and screen readers. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus-within { position: static; width: auto; height: auto; clip: auto; display: flex; gap: 6px; }
/* Clear (or Delete) on the left, Voices and staves on the right, always one row. */
.edit-row { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; line-height: 1; color: var(--primary); flex-shrink: 0; }
.small-btn { padding: .3rem .7rem; font-size: .82rem; flex-shrink: 0; }
/* Pop-up title with a ✕ in the top-right corner. */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { margin: 0; }
.sheet-x { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; border-radius: 50%; }
@media (hover: hover) { .sheet-x:hover { background: var(--primary-soft); color: var(--text); } }
/* Tempo pop-up: ▶/■ · Quick picks · ✓ */
.tempo-pick-row { display: flex; align-items: center; justify-content: space-between; }
/* A ▶ looks left of centre (its weight is on the flat side), so it's nudged right to look centred. */
.play-glyph { padding-left: 3px; }
.key-chip { display: flex; flex-direction: column; align-items: center; line-height: 1.15; padding: .35rem .6rem; }
.tempo-quick { font-size: 1rem; font-weight: 800; color: var(--accent); }
.tempo-tab { font-size: .85rem; }
.tempo-sound-now { padding: 0 .3rem; font-size: .9rem; font-weight: 600; }
.tempo-round { border: 1.5px solid var(--primary); border-radius: 50%; background: transparent; color: var(--primary); font-size: 1rem; }
.tempo-round.on { border-color: var(--danger); color: var(--danger); }
.tempo-set { background: var(--primary); color: var(--on-primary); font-size: 1.15rem; font-weight: 700; }
@media (hover: hover) {
  .tempo-round:hover { background: var(--primary-soft); }
  .tempo-set:hover { background: var(--primary); filter: brightness(1.15); }
}
.tempo-now { display: flex; align-items: baseline; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.tempo-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.tempo-actions .small-btn { padding: .5rem .4rem; font-size: .9rem; }
.voices-btn { margin-left: auto; padding: .3rem .75rem; font-size: .82rem; font-weight: 600;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row { display: flex; align-items: center; gap: 4px; }
.project-row .option { flex: 1; min-width: 0; }
.project-delete { flex-shrink: 0; }
.pick-box { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--on-primary); }
.project-pick[aria-checked="true"] .pick-box { background: var(--primary); border-color: var(--primary); }
.delete-list { margin: 0; padding-left: 1.2rem; }
.compose-tip { background: var(--primary-soft); border: 1.5px solid var(--primary); border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px; }
.compose-tip p { flex: 1; margin: 0; font-size: .9rem; }
.staff-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-num { font-weight: 600; min-width: 4.2em; }
.voice-select { flex: 1; min-width: 0; font: inherit; padding: .5rem .6rem; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); }

/* Karaoke: everything fits on one screen so singers don't scroll and lose their place. */
.karaoke { gap: 8px; padding-top: 4px; padding-bottom: 0; }
.kara-stage { display: flex; gap: 6px; align-items: stretch; }
.kara-panel { position: relative; flex: 1; min-width: 0; }
.kara-keybar { width: 40px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kara-key-label { border: 0; background: none; padding: 2px 0 0; font: inherit; font-size: .8rem; font-weight: 800; color: var(--primary);
  cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.kara-key-value { font-size: .85rem; font-weight: 700; color: var(--accent); min-height: 1.2em; }
.kara-key-slider { writing-mode: vertical-lr; direction: rtl; width: 28px; margin: 2px 0; accent-color: var(--primary); cursor: pointer; }
.kara-key-arrow { width: 30px; height: 22px; border: 1.5px solid var(--primary); border-radius: 8px; background: var(--surface); padding: 0;
  color: var(--primary); font-size: .7rem; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.kara-key-arrow:disabled { opacity: .4; cursor: default; }
.kara-key-arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kara-ready { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; border-radius: 12px; background: rgba(255, 251, 254, .72); pointer-events: none; }   /* the song window's paper color, in both themes */
.kara-ready[hidden] { display: none; }
.kara-ready-word { font-size: clamp(2.6rem, 12vw, 4.5rem); font-weight: 800; letter-spacing: .02em; color: #5629a5; line-height: 1; }
.kara-ready-key { font-size: 1rem; font-weight: 700; color: #b45309; }   /* fixed colors: the paper is light in both themes */
.kara-ready.counting { background: rgba(255, 251, 254, .45); }
.kara-ready.counting .kara-ready-word { font-size: clamp(4rem, 22vw, 7rem); }
/* Everything under the song window is centered on the window itself, not on the window plus the key slider
   (the slider column is 40px wide with a 6px gap). */
.kara-buttons, .kara-lines, .kara-mic, .kara-controls { padding-right: 46px; }
/* The button row: Pitch lyrics · seven player buttons · Staff. Everything is sized from the page's width (cqw) so
   the whole row fits on one line on any phone; play stays in the middle under the song window. */
.karaoke { container-type: inline-size; }
.kara-buttons { --kb: clamp(24px, 7.4cqw, 34px); --kg: clamp(3px, 1cqw, 8px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--kg); }
.kara-transport { display: flex; align-items: center; gap: var(--kg); }
.kara-toggle { height: var(--kb); padding: 0 clamp(5px, 1.6cqw, 11px); border-radius: calc(var(--kb) / 2); cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700;
  font-size: clamp(.6rem, 2.6cqw, .8rem); line-height: 1.05; white-space: nowrap; }
/* On: solid purple with light text, like the 🎤 when it's on, so it's obvious on phones in both themes. */
.kara-toggle[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.kara-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kara-toggle-left { justify-self: start; }
.kara-toggle-right { justify-self: end; }
.kara-skip, .kara-play { display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; cursor: pointer; line-height: 1; flex: none; }
.kara-skip { width: var(--kb); height: var(--kb); border: 1.5px solid var(--primary); background: var(--surface, #fff); color: var(--primary); }
.kara-skip:disabled { opacity: .4; cursor: default; }
.kara-skip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kara-mic-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.kara-icon { display: flex; }   /* no text baseline, so the drawn symbol sits dead centre */
.kara-play { width: calc(var(--kb) + 6px); height: calc(var(--kb) + 6px); border: 0; background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.kara-play:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Voice Coach: the Harmony Ring (the Vocal Tuner's main picture) */
.coach-ring { display: block; width: 100%; height: clamp(320px, 92vw, 400px); cursor: pointer; border-radius: 18px; box-shadow: 0 4px 18px rgba(40, 20, 90, .35); }
.tube-panel { position: relative; }
.tube-step { position: absolute; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .10); color: #fff; font: inherit; font-size: 1.6rem; font-weight: 700;
  line-height: 1; display: flex; align-items: center; justify-content: center; }
/* − 🎤 … ♪ +  in a strip under the tube (the tube itself is just the picture) */
.tube-panel { background: #120d22; border-radius: 18px; box-shadow: 0 4px 18px rgba(40, 20, 90, .35); overflow: hidden; }
.tube-panel .tube-canvas { cursor: default; border-radius: 0; box-shadow: none; }
.tube-tip { margin: 0; min-height: 1.3em; padding: 2px 14px 0; text-align: center; color: #ffd27a; font-size: .9rem; font-weight: 600; }
.tube-tip:empty { min-height: 0; padding: 0; }
/* voice report and voice focus */
.vi-finding { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.vi-finding .vi-text { margin: 0; font-weight: 600; }
.vi-finding.good .vi-text { color: var(--accent); }
.vi-icon { display: inline-block; width: 1.6em; }
.vi-finding p.small { margin: 0; }
.vi-rec { padding: 6px 12px; font-size: .9rem; }
.vf-bar { height: 10px; border-radius: 5px; background: var(--primary-soft); overflow: hidden; }
.vf-bar span { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.vf-live { text-align: center; font-size: 1.4rem; font-weight: 700; margin: 0; }
.vf-lyrics { text-align: center; font-style: italic; }
.vf-lyrics p { margin: 2px 0; }
.tube-bar { display: flex; align-items: center; gap: 8px; padding: 4px 12px 12px; }
.tube-spacer { width: 44px; flex: none; }
.tube-report { flex: 1; min-width: 0; height: 30px; align-self: flex-end; margin-bottom: -4px; padding: 0 6px; border-radius: 15px; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08); color: #fff; font: inherit;
  font-size: clamp(.66rem, 2.9cqw, .85rem); font-weight: 600; line-height: 1.05; white-space: normal; overflow: hidden; }
.tube-report:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .tube-report:hover { background: rgba(255, 255, 255, .2); } }
.tube-bar .tube-step { position: static; }
.tube-toggle { --kb: 44px; }
.tube-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 12px var(--accent); }
.tube-step:disabled { opacity: .3; cursor: default; }
.tube-step:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .tube-step:hover:not(:disabled) { background: rgba(255, 255, 255, .22); } }
/* Voice Coach games and exercises (games.js) */
.vg-list, .vg-view { display: flex; flex-direction: column; gap: 10px; }
.vg-canvas { display: block; width: 100%; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.vg-big { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--primary); text-align: center; min-height: 1.4em; }
.vg-small { margin: 0; text-align: center; min-height: 1.3em; }
.vg-buttons { justify-content: center; }
.vg-routine { gap: 6px; }
.vg-routine-time { font-size: 1.4rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
/* Tester notes (test version only): the 📝 button, the banner while tagging or showing, and the pins. */
.tn-fab { position: fixed; right: calc(12px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top)); z-index: 40;
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: #b45309; color: #fff; font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.tn-fab[hidden] { display: none; }
/* In the top bar, just left of the profile picture. */
.tn-top { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #b45309; background: transparent; font-size: 1rem;
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; margin-right: 4px; }
.tn-banner { position: fixed; left: 0; right: 0; top: 0; z-index: 45; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 10px calc(12px + env(safe-area-inset-left));
  background: #b45309; color: #fff; font-weight: 700; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.tn-banner-text { flex: 1; min-width: 0; font-size: .95rem; }
.tn-banner-btn { flex: none; border: 2px solid #fff; background: transparent; color: #fff; border-radius: 999px; padding: 4px 12px;
  font: inherit; font-weight: 700; cursor: pointer; }
.tn-pin { position: absolute; z-index: 35; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 2px solid #fff;
  color: #fff; font-size: .72rem; font-weight: 800; padding: 0; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .4); cursor: pointer; }
.tn-pin.tn-fixed { position: fixed; z-index: 42; }
.tn-pin.tn-big { width: 38px; height: 38px; margin: -19px 0 0 -19px; font-size: 1.1rem; animation: tn-pulse 1.2s ease-in-out infinite; }
@keyframes tn-pulse { 50% { box-shadow: 0 0 0 10px rgba(180, 83, 9, .25); } }
.tn-card { gap: 4px; }
.tn-card.tn-done { opacity: .6; }
.tn-card-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.tn-tag { letter-spacing: .04em; }
/* The Songs page: search, then the list (ready for a long song list). */
.song-search { width: 100%; box-sizing: border-box; font: inherit; padding: .6rem .8rem; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); }
.song-search:focus { outline: 2px solid var(--primary); border-color: transparent; }
.song-count { margin: -4px 0 0; }
.song-list { display: flex; flex-direction: column; gap: 8px; }
/* The title is centered over the song window (not over window + key slider); the key / section status sits at the
   far right, over the key slider. */
.kara-song-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; padding-right: 46px; }
.kara-song { grid-column: 2; border: 0; background: transparent; padding: 0; text-align: center; display: flex; flex-direction: column;
  align-items: center; min-width: 0; cursor: pointer; }
.kara-song-row .kara-status { grid-column: 3; justify-self: end; margin-right: -46px; padding-bottom: 3px; }
/* The song title: big and grand, like a marquee. Long titles shrink a little on narrow phones. */
.kara-song .title { font-size: clamp(1.6rem, 7.5cqw, 2.1rem); font-weight: 800; letter-spacing: -.01em; line-height: 1.1;
  color: var(--accent); font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif; }
.kara-song .title .kara-link { font-family: system-ui, sans-serif; font-size: .55em; vertical-align: middle; }
.kara-status { text-align: right; line-height: 1.2; }
.kara-link { color: var(--primary); }
.kara-canvas { display: block; width: 100%; border-radius: 12px; }
/* The current line and the next two follow the lyrics size setting, not "Larger text". */
/* Four lines, centered: the one being sung (amber, bold), then the next three. */
.kara-lines { min-height: calc(4 * 24px * var(--lyrics-scale, 1)); text-align: center; }
.kara-line { font-size: calc(16px * var(--lyrics-scale, 1)); color: var(--muted); margin: 0 0 4px; }
.kara-line.now { font-size: calc(18px * var(--lyrics-scale, 1)); font-weight: 700; color: var(--accent); }
.kara-mic { display: flex; align-items: center; justify-content: center; text-align: center; gap: 10px; flex-wrap: wrap; }
.kara-mic:has(> :empty:only-child) { display: none; }
/* While a song plays: the position slider with the time beside it, just under the lyrics (no bar). */
.kara-controls { margin: 4px 0 0; display: flex; align-items: center; gap: 10px; }
.kara-controls input[type="range"] { flex: 1; min-width: 0; accent-color: var(--primary); }
.kara-controls .kara-time { min-width: 0; font-size: .9rem; color: var(--muted); }
.key-slider { width: 100%; accent-color: var(--primary); }
.kara-row { display: flex; align-items: center; justify-content: space-evenly; gap: 8px; }
.kara-time { min-width: 6.5em; text-align: center; font-variant-numeric: tabular-nums; }
button:disabled { opacity: .45; cursor: default; }

/* Hover: anything clickable changes color under the mouse, so it's clear it can be clicked.
   Only on devices with a mouse, so taps on phones don't leave things highlighted. */
button, .option, .tile, .chip, .palette-item, .avatar-option, .burst { transition: background-color .12s, border-color .12s, color .12s, filter .12s; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { filter: brightness(1.15); }
  .btn-outline:hover:not(:disabled), .chip:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
  .btn-text:hover:not(:disabled) { background: var(--primary-soft); border-radius: 8px; }
  .btn-danger:hover:not(:disabled) { background: rgba(179, 38, 30, .1); }
  .option:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
  .tile:hover { background: var(--primary-soft); }
  .palette-item:hover { background: var(--primary-soft); color: var(--text); }
  .avatar-btn:hover { box-shadow: 0 0 0 3px var(--primary); }
  .avatar-option:hover .ring { border-color: var(--border); }
  .avatar-option:hover { background: var(--primary-soft); }
  .burst:hover canvas { border-color: var(--border); }
  .switch:hover { filter: brightness(1.1); }
  /* Karaoke's button row: the switches and round buttons light up under the mouse. */
  .kara-toggle:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
  .kara-toggle[aria-pressed="true"]:hover { background: var(--primary); color: var(--on-primary); filter: brightness(1.15); }
  .kara-skip:hover:not(:disabled) { background: var(--primary-soft); }
  .kara-mic-btn[aria-pressed="true"]:hover { background: var(--primary); filter: brightness(1.15); }
  .kara-play:hover { filter: brightness(1.15); }
  .kara-key-arrow:hover:not(:disabled) { background: var(--primary-soft); }
  .kara-key-label:hover { color: var(--primary); }
  .kara-song:hover .title { filter: brightness(1.2); }   /* the amber title just brightens under the mouse */
  .compose-title:hover { color: var(--primary); }
  .compose-tips:hover { text-decoration: underline; }
  .coach-staff:hover { outline: 2px solid var(--primary); outline-offset: 2px; }
  input[type="range"]:hover { filter: brightness(1.15); }
  .voice-select:hover, .field input:hover { border-color: var(--primary); }
}
button:disabled { cursor: default; }

.calm *, .calm *::after { transition: none !important; animation: none !important; }
