/* Persian deserves a real Persian face.
 *
 * Vazirmatn (SIL OFL 1.1, vendored under assets/fonts with its licence) rather
 * than whatever the OS happens to pick: macOS lands on SF Arabic, Windows on
 * Segoe UI, and both render Persian with Latin-ish proportions and digits that
 * do not match the ones the app prints (۱۲۳). One variable file covers every
 * weight the UI uses, self-hosted because the CSP allows fonts from nowhere
 * else — and because the app must work from a file:// path with no network.
 */
@font-face {
  font-family: Vazirmatn;
  src: url("assets/fonts/vazirmatn-var.woff2") format("woff2-variations"),
       url("assets/fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d1017;
  --bg-raise: #151a24;
  --bg-card: #1b212e;
  --line: #262e3d;
  --text: #e8ecf4;
  --muted: #8e98ab;
  --accent: #ffd166;
  --good: #2fd67a;
  --bad: #ff6b6b;
  --blue: #6aa9ff;
  --radius: 14px;

  /* Latin keeps the system UI face; Persian leads with Vazirmatn. Per-glyph
     fallback cannot do this for us — SF and Segoe both *have* Persian
     glyphs, so they would win before the fallback ever reached Vazirmatn. */
  --font-ui: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root:lang(fa) {
  --font-ui: Vazirmatn, ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Several components below set display, which would otherwise beat [hidden]. */
[hidden] { display: none !important; }

.noscript-notice { padding: 2rem; text-align: center; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(1200px 700px at 20% -10%, #1a2233 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Persian text breathes better with a touch more leading. */
html[lang="fa"] body { line-height: 1.7; }
html[lang="fa"] .brand { direction: ltr; } /* keep the logo latin */

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark { font-size: 20px; }

/* How you are playing: one row per option, big enough for a thumb. */
.input-options { display: grid; gap: 8px; margin: 16px 0 4px; }
.input-option {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon name" "icon note";
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  text-align: start;
  font: inherit;
  color: var(--text);
  background: #141a25;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.input-option .icon { grid-area: icon; color: var(--muted); }
.input-name { grid-area: name; font-weight: 600; }
.input-note { grid-area: note; color: var(--muted); font-size: 12px; }
.input-option:hover { border-color: #3b475e; }
.input-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: #1e2131;
}
.input-option[aria-pressed="true"] .icon { color: var(--accent); }

/* The hand picker sits in the controls row and borrows the input picker's
   segmented look, so "which hand am I practising" reads the same way as
   "what am I playing on". Hidden entirely for single-line songs. */
.hand-picker {
  display: flex;
  gap: 4px;
  background: #0f131b;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.hand-picker button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  line-height: 0;
  transition: background 0.15s, color 0.15s;
}
.hand-picker svg { display: block; }
.hand-picker button:hover { color: var(--text); }
.hand-picker button[aria-pressed="true"] {
  background: var(--accent);
  color: #201a08;
  font-weight: 600;
}
.hand-picker button:disabled { cursor: default; opacity: 0.6; }
/* The teacher toggle: same family, its own colour — green is "the app plays",
   the same green as a hit note, and visibly not the amber of a chosen hand. */
.hand-picker .accompany {
  margin-inline-start: 4px;
  border-inline-start: 1px solid var(--line);
  border-radius: 0 999px 999px 0;
  padding-inline-start: 10px;
}
[dir="rtl"] .hand-picker .accompany { border-radius: 999px 0 0 999px; }
.hand-picker .accompany[aria-pressed="true"] {
  background: #143d28;
  color: #3fe98c;
  font-weight: 600;
}

/* What the microphone hears, floating in the stage's other corner — shown
   only while the mic is the input, because that is the only time it exists. */
.listen {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  background: rgba(15, 19, 27, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.meter {
  width: 64px;
  height: 8px;
  border-radius: 999px;
  background: #0f131b;
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--good), var(--accent));
  transition: width 0.06s linear;
}
/* Signal present but below the sensitivity floor — being ignored. */
.meter-fill.gated { background: #5a6376; }

.heard {
  min-width: 64px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.heard-note {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.heard-cents { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.heard-cents.sharp { color: var(--bad); }
.heard-cents.flat { color: var(--blue); }
.heard-cents.intune { color: var(--good); }

.ghost {
  border: 1px solid var(--line);
  background: #0f131b;
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}
.ghost:hover { border-color: #3a4457; }
.ghost[aria-pressed="false"] { opacity: 0.45; }

/* ---------- layout ---------- */

.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 0;
}

.sidebar {
  border-inline-end: 1px solid var(--line);
  padding: 14px;
  overflow-y: auto;
  background: #10141d;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 2px 0 6px;
}

.song-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 12px 0 4px;
}

.search {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  margin-bottom: 4px;
}
.search:focus { outline: none; border-color: var(--accent); }
.search::placeholder { color: var(--muted); }

.no-results {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 4px;
}

.song {
  width: 100%;
  text-align: start;
  border: 1px solid transparent;
  background: var(--bg-card);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.song:hover { border-color: #33405a; }
.song[aria-current="true"] { border-color: var(--accent); background: #221f14; }
.song-name { flex: 1; font-size: 14px; }
/* The exercise number inside a book: fixed width so a column of them lines up
   whether it reads 1 or 60 (or ۱ and ۶۰). */
.song-number {
  flex: none;
  min-width: 1.6em;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: #1b2233;
  border-radius: 5px;
  padding: 2px 4px;
}
.song[aria-current="true"] .song-number { color: var(--accent); }
/* Premium songs stay visible and browsable — the lock is the invitation. */
.lock { font-size: 11px; opacity: 0.75; }
.level {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}

/* ---------- settings ---------- */

.setting {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  /* The modal centres its contents; a list of settings must not be. */
  text-align: start;
}
.setting:first-of-type { border-top: 0; }
.setting-label { display: grid; gap: 2px; min-width: 0; }
.setting-label span { font-size: 14px; }
.setting-label small { color: var(--muted); font-size: 12px; }

/* One segmented control, used for both the label mode and the play mode. */
.segmented {
  display: flex;
  gap: 4px;
  background: #0f131b;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  flex: none;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--accent);
  color: #201a08;
  font-weight: 600;
}

.slider-row { display: flex; align-items: center; gap: 10px; }
.number-row { display: flex; align-items: baseline; gap: 6px; }
.number-row input[type="number"] {
  width: 5.5ch;
  padding: 6px 4px 6px 10px;
  background: #0f131b;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  text-align: center;
}
.number-row .unit { color: var(--muted); font-size: 13px; }

/* The metronome button: green while anything ticks, pendulum kicks per click.
   The tiny number under the pendulum is the song's practice tempo in bpm. */
.metronome-btn {
  line-height: 0;
  padding-block: 3px;
  padding-inline: 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.metronome-btn .met-tempo {
  font-size: 8.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.metronome-btn.is-on .met-tempo { color: inherit; }
.metronome-btn.is-on { color: #3fe98c; border-color: #1e5c38; }
.metronome-btn .pendulum, .metronome-btn .bob { transform-origin: 12px 17px; }
.metronome-btn.is-tick .pendulum, .metronome-btn.is-tick .bob {
  animation: pendulum-kick 0.18s ease-out;
}
@keyframes pendulum-kick {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-38deg); }
  100% { transform: rotate(0deg); }
}
.slider-row output { color: var(--muted); font-size: 13px; min-width: 4ch; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .setting { grid-template-columns: 1fr; }
}

/* ---------- books in the sidebar ---------- */

/* A book is a course, not thirty loose songs, so it collapses to one card.
   Hanon alone is 30 exercises and would otherwise bury every other lesson. */
.book-entry {
  width: 100%;
  text-align: start;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, #1d2536, #171d2a);
  border: 1px solid #2e394d;
  border-radius: 12px;
  padding: 10px 11px;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.book-entry:hover { border-color: #45536e; }
/* The book holding the lesson you are playing is marked, since the row itself
   is hidden inside it. */
.book-entry.has-current { border-color: var(--accent); background: #221f14; }
.book-icon { font-size: 17px; line-height: 1; flex: none; }
.book-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.book-entry-title {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-entry-meta { font-size: 11px; color: var(--muted); }

.chevron { flex: none; color: var(--muted); font-size: 16px; line-height: 1; }
/* The arrow points the way you travel, which reverses with the writing system. */
html[dir="rtl"] .chevron { transform: scaleX(-1); }

.sidebar-back {
  width: 100%;
  text-align: start;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 6px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-back:hover { color: var(--text); }

.book-head { margin: 2px 0 8px; padding: 0 2px; }
.book-head-title { font-size: 13.5px; font-weight: 600; }
.book-head-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Thirty exercises need to fit; a full-size row each would mean scrolling
   past two screens of them to reach number 30. */
.song.compact {
  padding: 5px 9px;
  margin-bottom: 3px;
  border-radius: 8px;
  gap: 6px;
}
.song.compact .song-name { font-size: 12.5px; }
.song.compact .song-number { font-size: 10px; padding: 1px 3px; min-width: 1.5em; }
.song.compact .level { font-size: 9px; }

.stage {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}

/* One line when it fits. Three groups, each of which wraps whole: a cluster
   of buttons that breaks in the middle is harder to read than one that moves
   down together. */
.stage-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.head-song {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.head-song h1 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-play, .head-setup {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 60ch; }

.hud {
  margin-inline-start: auto;
  display: flex;
  gap: 10px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 14px;
  min-width: 78px;
  text-align: center;
}
.stat-value { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* ---------- controls ---------- */

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spacer { flex: 1 1 auto; }

button.primary, button.secondary {
  font: inherit;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid var(--line);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #201a08;
  font-weight: 650;
}
button.primary:hover { filter: brightness(1.08); }
button.secondary { background: var(--bg-card); color: var(--text); }
button.secondary:hover { border-color: #3a4457; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.wide { width: 100%; }
/* First bottom-pinned button carries the flex push; the rest stack under it. */
.sidebar :nth-child(1 of button.wide) { margin-top: auto; }

.toggle-group {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 10px;
}
.toggle-group select,
.toggle-group input[type="range"] { font: inherit; }
.toggle-group select {
  background: #0f131b;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 6px;
}
.toggle-group input[type="range"] { width: 92px; accent-color: var(--accent); }
.toggle-group output { color: var(--text); font-variant-numeric: tabular-nums; min-width: 36px; }

/* ---------- board ---------- */

.board {
  position: relative; /* anchors the floating notation toggle */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0a0d13;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  /* The piano itself never flips: low notes on the left, everywhere on Earth. */
  direction: ltr;
}

#roll { flex: 1 1 auto; display: block; min-height: 0; }

.keyboard {
  position: relative;
  height: 150px;
  flex: 0 0 auto;
  background: #05070b;
  border-top: 1px solid #000;
  touch-action: none;
  user-select: none;
}

.key {
  position: absolute;
  top: 0;
  border-radius: 0 0 6px 6px;
  transition: background 0.05s, box-shadow 0.08s;
}
.key.white {
  height: 100%;
  background: linear-gradient(#fdfdfd, #dfe3e9);
  border: 1px solid #22262e;
  z-index: 1;
}
.key.black {
  height: 62%;
  background: linear-gradient(#31363f, #14171c);
  border: 1px solid #000;
  z-index: 2;
}
.key-label {
  position: absolute;
  bottom: 7px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #98a0ae;
  pointer-events: none;
}

.key.is-target.white { background: linear-gradient(#fff3d0, #ffd166); box-shadow: 0 0 16px rgba(255,209,102,0.55); }
.key.is-target.black { background: linear-gradient(#c9a03c, #8a6a19); box-shadow: 0 0 16px rgba(255,209,102,0.4); }
.key.is-down.white { background: linear-gradient(#cfd6e0, #aeb7c4); }
.key.is-down.black { background: linear-gradient(#4b525d, #24282f); }
.key.is-hit.white { background: linear-gradient(#c9ffe0, #2fd67a); }
.key.is-hit.black { background: linear-gradient(#2fd67a, #16824a); }
.key.is-wrong.white { background: linear-gradient(#ffd4d4, #ff6b6b); }
.key.is-wrong.black { background: linear-gradient(#ff6b6b, #9c2b2b); }

.footnote { margin: 0; color: var(--muted); font-size: 12px; }
kbd {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  font: 11px ui-monospace, monospace;
  margin: 0 1px;
}

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  width: min(430px, 92vw);
  text-align: center;
}
.modal-card.wide-card { width: min(640px, 92vw); text-align: start; }
.modal-card h2 { margin: 6px 0 14px; }
.stars { font-size: 30px; letter-spacing: 6px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.result-grid div {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 4px;
}
.result-grid span { display: block; font-size: 19px; font-weight: 700; }
.result-grid small { color: var(--muted); font-size: 11px; }
.result-note { color: var(--muted); font-size: 13px; min-height: 20px; }

.help-list { padding-left: 20px; color: var(--text); }
.help-list li { margin-bottom: 10px; }
.help-list em { color: var(--accent); font-style: normal; }
.tip {
  background: #221f14;
  border: 1px solid #3a3520;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #e9dcb6;
}

.modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  z-index: 50;
  font-size: 14px;
  max-width: 80vw;
}
.toast[hidden] { display: none; }
.toast.bad { border-color: var(--bad); color: #ffd3d3; }

/* ---------- narrow screens: phones, and phones held sideways ---------- */

/* The lesson list becomes a drawer rather than disappearing. It used to be
   `display: none`, which left a phone with no way to reach any song at all. */
.drawer-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .drawer-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(84vw, 300px);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
  }
  [dir="rtl"] .sidebar { transform: translateX(102%); }
  body.drawer-open .sidebar { transform: none; }

  body.drawer-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(4, 6, 10, 0.6);
  }

  /* A phone in landscape is about 390px tall: a fixed-height board leaves the
     piano a sliver. So the page scrolls instead, and the board keeps a height
     a hand can actually aim at. */
  body { overflow: auto; }
  .stage { min-height: 0; }
  .board { min-height: 320px; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .brand { font-size: 15px; }
  .head-song h1 { font-size: 17px; }
}

/* Very short viewports — landscape phones — get a shorter board so the head
   and the keyboard both stay on screen without hunting. */
@media (max-height: 480px) {
  .board { min-height: 240px; }
  .topbar { padding: 6px 12px; }
}

/* Touch targets: 44px is the smallest a fingertip hits reliably. */
@media (pointer: coarse) {
  .primary, .secondary, .ghost { min-height: 44px; }
  .hand-picker button, .notation-toggle button { min-height: 38px; }
  .song { padding-block: 12px; }
}


/* Buttons that carry an icon: the icon and label sit on one line. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.icon-btn .icon { flex: none; }
.icon-only { padding-inline: 9px; }

/* Blocks or staff, floating over the stage's corner, out of the fall line. */
.notation-toggle {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(15, 19, 27, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.notation-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s, color 0.15s;
}
.notation-toggle button:hover { color: var(--text); }
.notation-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: #201a08;
}


/* Who made this song: the small i beside the title, and its card. */
.title-row { display: flex; align-items: center; gap: 8px; }
.info-btn { line-height: 0; padding: 4px; color: var(--muted); }
.info-btn:hover { color: var(--text); }
.info-rows { margin: 14px 0 4px; display: grid; gap: 10px; }
.info-row { display: flex; align-items: baseline; gap: 12px; }
.info-row dt { color: var(--muted); font-size: 13px; min-width: 9ch; }
.info-row dd { margin: 0; font-weight: 600; }

/* ---------------- account, favorites, buying ---------------- */

/* The account button glows quietly once you are signed in. */
#btn-account.is-signed-in { color: var(--accent); }

/* Sign-in modal: a phone, then a code. */
.auth-step { display: grid; gap: 10px; margin-top: 12px; }
.text-field {
  width: 100%;
  padding: 10px 12px;
  background: #0f131b;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}
.text-field:focus { outline: none; border-color: var(--accent); }
.code-field {
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.5ch;
  font-variant-numeric: tabular-nums;
}
.auth-error {
  margin: 12px 0 0;
  color: #ff8c7a;
  font-size: 13px;
}

/* The heart beside the title: hollow until it is yours. */
.fav-btn.is-on { color: #ff6b81; }
.fav-btn.is-on:hover { color: #ff8a9b; }

/* A song sold on its own wears its price where the padlock would sit. */
.price-tag {
  flex: none;
  font-size: 10.5px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}

/* The buy sheet's headline number. */
.buy-price {
  margin: 14px 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* The player's shelf card: same shape as a book, warmer mark. */
.mine-entry .book-icon { color: #ff6b81; line-height: 0; }

/* A quiet way out of the app: the arrangers' page. Deliberately a real <a> to
   a real URL, not a button — it is a page a crawler should follow. */
.sidebar-link {
  display: block;
  margin-top: 10px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.sidebar-link:hover { color: var(--accent); }
