/* Fraunces (SIL Open Font License 1.1), served with the site — no third-party font request. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/fraunces-latin-standard-normal.woff2") format("woff2-variations"),
       url("assets/fonts/fraunces-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/fraunces-latin-ext-standard-normal.woff2") format("woff2-variations"),
       url("assets/fonts/fraunces-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --surface: #141414;
  --line: #2a2a2a;
  --line-strong: #3d3d3d;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --dim: #757575;
  --accent: #ffffff;
  --accent-ink: #0a0a0a;
  --accent-soft: #1c1c1c;
  --paper: #fafafa;
  --ink: #111111;
  --ink-muted: #555555;
  --ink-line: #e0e0e0;
  --hot: #111111;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --t-fast: 150ms;
  --t-med: 200ms;
  --radius: 16px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* One restrained focus ring everywhere — adapts to ink or night contexts. */
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Press feedback — interactive elements feel alive but restrained. */
button {
  touch-action: manipulation;
  border-radius: var(--radius-pill);
}
.primary,
.quiet,
.home-upload-cta,
.result-empty-upload {
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease),
    opacity var(--t-fast) var(--ease);
}
.primary:active,
.home-upload-cta:active,
.result-empty-upload:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto !important;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  overscroll-behavior-y: none;
}
.home,
.discover,
.explain-pane {
  scroll-behavior: smooth;
}
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- header ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid transparent;
  background: var(--bg);
  z-index: 20;
  transition: border-color 0.35s ease, background 0.35s ease, padding 0.2s ease;
}
.bar:focus-within {
  border-bottom-color: var(--line);
}
body.is-studio .bar {
  padding: 6px 16px;
  gap: 10px;
  min-height: 44px;
  background: #070707;
  border-bottom-color: #141414;
}
body.is-discover .bar {
  border-bottom-color: var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
  opacity: 0.72;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}
body.is-home .top-search {
  margin-left: 6px;
}
.brand:hover { opacity: 1; }
body.is-studio .brand {
  opacity: 0.7;
}
body.is-studio .brand:hover {
  opacity: 1;
}
.studio-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 2px;
}
.studio-nav-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  color: var(--muted);
}
.studio-nav-btn:hover:not(:disabled) {
  color: var(--text);
}
.studio-nav-btn:disabled,
.studio-nav-btn.is-dim {
  opacity: 0.28;
  cursor: default;
}
.brand-name {
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1;
}
body.is-studio .brand-name {
  font-size: 11px;
  letter-spacing: 0.16em;
}
.lune-mark {
  display: block;
  flex-shrink: 0;
  color: var(--text);
}
.brand .lune-mark {
  width: 22px;
  height: 22px;
}
body.is-studio .brand .lune-mark {
  width: 18px;
  height: 18px;
}

/* Quiet single-piece title (no tab chrome) */
.studio-piece-quiet {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(42vw, 420px);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #8a8a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
body.is-studio .studio-piece-quiet {
  display: block;
}

/* Score · Explain · Piano — rounded segment in the top bar */
.studio-seg {
  display: none;
  align-items: stretch;
  gap: 2px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px;
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-pill);
}
body.is-studio .studio-seg {
  display: inline-flex;
}
.studio-tab {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-bottom: none;
  background: transparent;
  color: #5e5e5e;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 16px;
  min-height: 32px;
  min-width: 76px;
  cursor: pointer;
  margin-bottom: 0;
  border-radius: var(--radius-pill);
  transition: color 0.14s ease, background 0.14s ease;
}
.studio-tab:hover {
  color: #f0f0f0;
  background: #1c1c1c;
}
.studio-tab:active {
  color: #0a0a0a;
  background: #e8e8e8;
}
.studio-tab.on {
  color: #0a0a0a;
  background: #f2f2f2;
  border-bottom-color: transparent;
}
.studio-tab:focus {
  outline: none;
}
.studio-tab:focus-visible {
  color: #0a0a0a;
  outline: 2px solid #f2f2f2;
  outline-offset: 2px;
}

/* ---------- piece tabs (quiet underline + portrait) ---------- */
.piece-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(40vw, 440px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding: 0;
  border-bottom: 1px solid #1f1f1f;
}
body.is-studio .piece-tabs {
  max-width: min(36vw, 380px);
}
.piece-tabs.piece-tabs-solo {
  flex: 0 0 auto;
  max-width: none;
  border-bottom: none;
  overflow: visible;
}
.piece-tab {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  max-width: 180px;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #6e6e6e;
  margin-bottom: -1px;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.piece-tab:hover {
  color: #c8c8c8;
  background: transparent;
}
.piece-tab.on {
  background: transparent;
  color: #f2f2f2;
  border-bottom-color: #f2f2f2;
}
.piece-tab-face {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  flex: 0 0 auto;
  margin-left: 8px;
  filter: grayscale(1) contrast(1.05) opacity(0.8);
  background: #2a2a2a;
}
.piece-tab.on .piece-tab-face {
  filter: grayscale(1) contrast(1.1) opacity(1);
}
.piece-tab-label {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 8px 6px 8px 5px;
  min-height: 34px;
  cursor: pointer;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.piece-tab-close {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 8px 8px 8px 2px;
  min-height: 34px;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.14s ease;
}
.piece-tab-close:hover {
  opacity: 1;
}
.piece-tab-add {
  appearance: none;
  border: none;
  background: transparent;
  color: #5a5a5a;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  align-self: center;
  border-radius: var(--radius-pill);
  transition: color 0.14s ease, background 0.14s ease;
}
.piece-tab-add:hover {
  color: #e8e8e8;
  background: #1a1a1a;
}
body.is-studio .piece-tab.on {
  background: transparent;
  border-bottom-color: #f2f2f2;
  color: #f2f2f2;
}
.piece-tab-label:focus-visible,
.piece-tab-close:focus-visible,
.piece-tab-add:focus-visible {
  outline: 1px solid #cfcfcf;
  outline-offset: -2px;
}

.top-search {
  flex: 1;
  display: flex;
  gap: 10px;
  max-width: 520px;
}
/* Studio: collapse search — reveal only when opening another piece */
body.is-studio .top-search {
  display: none;
  max-width: 240px;
  flex: 0 1 240px;
}
body.is-studio.studio-search-open .top-search {
  display: flex;
}
body.is-studio #btn-open {
  display: none;
}
.top-search input {
  flex: 1;
  background: #111;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  font: inherit;
  padding: 11px 18px;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.top-search input::placeholder { color: var(--dim); }
.top-search input:focus {
  border-color: #f0f0f0;
  background: #161616;
}
body.is-home .top-search input {
  border-color: #2f2f2f;
  background: #0e0e0e;
}
body.is-home .top-search input:focus {
  border-color: #f0f0f0;
}

.top-search .search-go {
  border: 1px solid #3a3a3a;
  background: #f2f2f2;
  color: #0a0a0a;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 18px;
  min-width: 0;
  border-radius: var(--radius-pill);
}
.top-search .search-go:hover {
  color: #0a0a0a;
  border-color: #ffffff;
  background: #ffffff;
}
body.is-home .top-search .search-go {
  color: #0a0a0a;
}
body.is-home .top-search .search-go:hover {
  color: #0a0a0a;
}


.top-search button,
.primary,
.quiet {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  letter-spacing: 0.04em;
}
.top-search button {
  background: #f2f2f2;
  border: 1px solid #f2f2f2;
  color: #0a0a0a;
  font-weight: 500;
  padding: 10px 18px;
  letter-spacing: 0.08em;
}
.top-search button.search-go {
  font-weight: 500;
  color: #0a0a0a;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 10px 18px;
}
.top-search button.search-go:hover {
  color: #0a0a0a;
  border-color: #ffffff;
  background: #ffffff;
}
.top-search button:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #0a0a0a;
  opacity: 1;
}
.primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius-pill);
}
.primary:hover {
  background: #e8e8e8;
  border-color: #e8e8e8;
}
.quiet {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  border-radius: var(--radius-pill);
}
.quiet:hover {
  color: var(--text);
  border-color: #f0f0f0;
  background: #161616;
}
.quiet.ink {
  border-color: var(--ink-line);
  color: var(--ink-muted);
  background: transparent;
}
.quiet.ink:hover {
  color: #f5f5f5;
  border-color: var(--ink);
  background: var(--ink);
}

.results {
  position: absolute;
  left: 120px;
  right: 120px;
  top: 64px;
  max-width: 560px;
  max-height: 380px;
  overflow: auto;
  background: rgba(16, 16, 16, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid #343434;
  border-radius: var(--radius);
  z-index: 30;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 56px rgba(0, 0, 0, 0.6);
  animation: results-in 0.16s var(--ease) both;
  scrollbar-width: thin;
}
@keyframes results-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.result {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #1f1f1f;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.005em;
  padding: 13px 18px 12px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}
.result:hover,
.result.is-active {
  background: #1d1d1d;
  padding-left: 22px;
}
.result.is-active {
  box-shadow: inset 2px 0 0 #f0f0f0;
}
.result:focus-visible {
  outline: none;
  background: #1d1d1d;
  box-shadow: inset 2px 0 0 #f0f0f0;
}
.result:last-child { border-bottom: none; }
.result small {
  display: block;
  color: var(--dim);
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.result-empty {
  cursor: default;
  padding: 16px 18px 18px;
}
.result-empty:hover { background: transparent; }
.result-empty-msg {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.result-empty-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.result-empty-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  margin: 0 0 10px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
}
.result-empty-upload:hover {
  background: #e8e8e8;
  border-color: #e8e8e8;
}
.result-empty-link {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-empty-link:hover { color: var(--text); }

.btn-search {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #3a3a3a;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
}
.btn-search:hover,
body.phone-search-open .btn-search {
  border-color: #f0f0f0;
  color: #f2f2f2;
}
.upload-icon { display: none; }
.upload-btn {
  border-color: var(--line-strong);
  color: var(--text);
  min-height: 40px;
}
body.is-home .upload-btn {
  border-color: #3a3a3a;
}

/* ---------- home ---------- */
.home {
  flex: 1;
  overflow: auto;
  padding: 0;
  background: var(--bg);
}
.home-hero {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: flex-end;
  /* Keep giant brand clear of the sticky search bar */
  padding: 120px 36px 96px;
  position: relative;
  isolation: isolate;
  background: #080808;
  overflow: hidden;
  /* Night vignette — monochrome inset shadow, no gradient imagery */
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.72), inset 0 -60px 90px rgba(0, 0, 0, 0.5);
}
/* Night grain — denser, quieter atmosphere (no gradients) */
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.62;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.78'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: 0;
}
/* Score-plane cue: faint staff lines across the night field (SVG, no gradients) */
.home-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 64px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='64' preserveAspectRatio='none'%3E%3Cg stroke='%23ffffff' stroke-width='1'%3E%3Cline x1='0' y1='8' x2='100%25' y2='8'/%3E%3Cline x1='0' y1='20' x2='100%25' y2='20'/%3E%3Cline x1='0' y1='32' x2='100%25' y2='32'/%3E%3Cline x1='0' y1='44' x2='100%25' y2='44'/%3E%3Cline x1='0' y1='56' x2='100%25' y2='56'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 64px;
  background-repeat: no-repeat;
}
.home-hero-motif {
  position: absolute;
  right: clamp(24px, 8vw, 96px);
  top: clamp(48px, 12vh, 120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: motif-in 1.4s ease 0.2s both;
}
.home-motif-mark {
  width: clamp(120px, 22vw, 220px);
  height: clamp(120px, 22vw, 220px);
  color: #ffffff;
  opacity: 0.07;
}
.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  animation: home-in 1s ease both;
}
.home-lockup {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.6vw, 24px);
  margin: 28px 0 44px;
  animation: brand-in 1.1s ease both;
}
.home-mark {
  width: clamp(56px, 9vw, 88px);
  height: clamp(56px, 9vw, 88px);
  margin-bottom: 0.12em;
  flex-shrink: 0;
  color: var(--text);
  opacity: 0.92;
}
.home-brand {
  margin: 0;
  font-size: clamp(112px, 22vw, 208px);
  color: var(--text);
  line-height: 0.76;
  letter-spacing: -0.06em;
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "WONK" 0.6;
  position: relative;
}
.home-brand::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  margin-top: 18px;
  background: var(--text);
  opacity: 0.4;
  animation: brand-rule 1.2s ease 0.35s both;
}
.home h1 {
  margin: 0 0 18px;
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.2;
  max-width: 16ch;
  color: var(--text);
  letter-spacing: -0.03em;
  text-wrap: balance;
  animation: home-in 1s ease 0.08s both;
}
.lead {
  color: var(--muted);
  margin: 0 0 36px;
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.75;
  max-width: 30ch;
  letter-spacing: 0.005em;
  animation: home-in 1s ease 0.14s both;
}
.home-cue {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0.9;
  animation: home-in 1s ease 0.22s both;
}
.home-cue::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-right: 10px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.7;
}
.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 28px;
  animation: home-in 1s ease 0.28s both;
}
.home-upload-cta {
  min-height: 44px;
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
}
.home-upload-cta:hover {
  background: #e8e8e8;
  border-color: #e8e8e8;
}
.home-cta-note {
  font-size: 13px;
  color: var(--muted);
  max-width: 22ch;
  line-height: 1.4;
}

.about-maker {
  max-width: 1080px;
  margin: 0 auto;
  padding: 112px 36px 160px;
  animation: home-in 0.9s ease 0.12s both;
  position: relative;
  background: #0a0a0a;
}
.about-maker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 1px;
  background: var(--line);
  opacity: 0.8;
}
.about-maker-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(36px, 6vw, 64px);
  align-items: center;
}
.about-kicker {
  margin: 0 0 16px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
.about-maker h2 {
  margin: 0 0 40px;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 14ch;
  color: var(--text);
}
.about-columns {
  display: grid;
  gap: 28px;
  max-width: 52ch;
}
.about-maker p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 17px;
  letter-spacing: 0.005em;
}
.about-maker strong { color: var(--text); font-weight: 550; }
.about-maker-visual {
  margin: 0;
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

/* Quiet ending — hairline, mark, one line, shortcut hint */
.home-footer {
  padding: 48px 36px 64px;
  text-align: center;
  background: #080808;
  border-top: 1px solid #161616;
}
.home-footer-mark {
  display: inline-block;
  color: #8a8a8a;
  margin-bottom: 14px;
}
.home-footer-line {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6e6e6e;
}
.home-footer-keys {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #4a4a4a;
  font-variant-numeric: tabular-nums;
}

/* Home chapters — below-the-fold continuity with night-studio hero */
.home-chapter {
  max-width: 1080px;
  margin: 0 auto;
  padding: 88px 36px 24px;
  position: relative;
  background: #090909;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.home-chapter + .home-chapter {
  padding-top: 72px;
}
.home-chapter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 1px;
  background: var(--line);
  opacity: 0.55;
}
.home-chapter-copy {
  min-width: 0;
}
.home-chapter .about-kicker {
  margin: 0 0 14px;
}
.home-chapter h2 {
  margin: 0 0 22px;
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  max-width: 16ch;
  color: var(--text);
}
.home-chapter p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 17px;
  letter-spacing: 0.005em;
  max-width: 42ch;
}
.home-chapter-visual {
  margin: 0;
  width: 100%;
  max-width: 420px;
  justify-self: end;
}
.home-chapter-flip .home-chapter-copy {
  order: 2;
}
.home-chapter-flip .home-chapter-visual {
  order: 1;
  justify-self: start;
}
.home-viz {
  display: block;
  width: 100%;
  height: auto;
  color: var(--text);
}
.home-meet-frame {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: center;
  /* Same figure proportions as the SVG product reflections (360 × 220) */
  aspect-ratio: 360 / 220;
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}
/* Crisp hairline strokes inside the product-reflection figures */
.home-viz line {
  shape-rendering: crispEdges;
}
.home-meet-face {
  width: 96px;
  height: 128px;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  filter: grayscale(1) contrast(1.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}
.home-meet-copy {
  min-width: 0;
}
.home-meet-kicker {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.home-meet-title {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}
.home-meet-by {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.home-meet-note {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.55;
  max-width: 28ch;
}
.home-chapter.is-in {
  animation: home-in 0.85s ease both;
}

/* Intentional product-reflection motion (2–3 cues) */
.home-viz-playhead {
  animation: home-playhead 2.8s ease-in-out infinite;
  transform-origin: center top;
}
.home-viz-scrub,
.home-viz-scrub-knob {
  animation: home-scrub 2.8s ease-in-out infinite;
}
.home-viz-key-lit {
  animation: home-key-press 2.4s ease-in-out infinite;
}
.home-viz-finger {
  animation: home-finger-pulse 2.4s ease-in-out infinite;
}
.home-viz-bar-hilite {
  animation: home-bar-glow 3.2s ease-in-out infinite;
}

@keyframes home-playhead {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes home-scrub {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
@keyframes home-key-press {
  0%, 100% { fill: #d8d8d8; }
  45%, 60% { fill: #bdbdbd; }
}
@keyframes home-finger-pulse {
  0%, 100% { opacity: 0.7; }
  45%, 60% { opacity: 1; }
}
@keyframes home-bar-glow {
  0%, 100% { opacity: 0.06; }
  50% { opacity: 0.14; }
}

@media (prefers-reduced-motion: reduce) {
  .home-viz-playhead,
  .home-viz-scrub,
  .home-viz-scrub-knob,
  .home-viz-key-lit,
  .home-viz-finger,
  .home-viz-bar-hilite {
    animation: none;
  }
}

@keyframes home-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes brand-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes brand-rule {
  from { width: 0; opacity: 0; }
  to { width: min(140px, 32%); opacity: 0.4; }
}
@keyframes motif-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- discover ---------- */
.discover {
  flex: 1;
  overflow: auto;
  padding: 0 0 100px;
  background: var(--bg);
}
.discover-stage {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 0;
}
.nav-arrows {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 28px;
}
.composer-hero {
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 48px;
  padding: 0 0 40px;
  border-bottom: 1px solid var(--line);
  animation: rise 0.55s ease both;
  min-height: min(62vh, 560px);
}
.composer-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(58vh, 520px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #2e2e2e;
  background: var(--bg-2);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 60px rgba(0, 0, 0, 0.5);
  min-height: 220px;
}
.composer-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  filter: grayscale(1) contrast(1.08);
  transform: scale(1.02);
  transition: transform 8s ease;
}
.composer-hero:hover .composer-photo img {
  transform: scale(1.06);
}
.composer-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(72px, 12vw, 120px);
  color: var(--text);
  font-weight: 400;
  background: var(--bg-2);
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.composer-intro h1 {
  margin: 0 0 12px;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.discover-by {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 18px;
}
.story-hook {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
  color: var(--dim);
  max-width: 28ch;
}

.discover-chapters {
  display: grid;
  gap: 48px;
  margin-bottom: 48px;
}
.chapter {
  border: none;
  background: transparent;
  overflow: visible;
  animation: rise 0.45s ease both;
}
.chapter + .chapter {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.chapter-label {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.chapter-title {
  margin: 0 0 18px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.2;
}
.chapter-body {
  padding: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 17px;
  max-width: 62ch;
}
.chapter-body p {
  margin: 0 0 16px;
}
.chapter-body p:last-child { margin-bottom: 0; }
.chapter-body ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.chapter-body li {
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 15px;
  line-height: 1.55;
}

.discover-cta {
  position: sticky;
  bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(12, 12, 12, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.cta-note {
  flex: 1 1 220px;
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}
.primary.big {
  padding: 14px 22px;
  font-size: 16px;
}

/* ---------- studio ---------- */
.studio {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #070707;
}
.studio-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.studio-panel[hidden] {
  display: none !important;
}
/* Smooth 200ms fade/rise when a panel takes the stage */
.studio-panel.panel-in {
  animation: panel-in var(--t-med) var(--ease) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
/* Shared keyboard dock sits between the active panel and transport */
body.is-panel-score .studio > .piano-dock.is-slim {
  order: 0;
}
body.is-panel-piano .studio-panel.piano-pane {
  flex: 1 1 auto;
  min-height: 0;
}
/* Keyboard stays a fixed strip so the tempo dock never falls off-screen */
body.is-panel-piano .studio > .piano-dock.is-focus {
  flex: 0 0 auto;
  min-height: 0;
}
.piece-head.score-tools-head {
  justify-content: space-between;
  padding: 4px 12px;
  border-bottom: 1px solid #191919;
  background: #0b0b0b;
  min-height: 0;
  gap: 8px;
  align-items: center;
}
.score-tools-head .tog.pill {
  min-height: 34px;
  padding: 6px 14px 7px;
  font-size: 11px;
  letter-spacing: 0.14em;
}
.score-tools-head .xor-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid #e8e8e8;
}
.score-tools-head .xor-group .tog.pill {
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #8a8a8a;
  box-shadow: none;
  min-width: 88px;
  justify-content: center;
}
.score-tools-head .xor-group .tog.pill:hover {
  color: #222;
  background: transparent;
}
.score-tools-head .xor-group .tog.pill:has(input:checked),
.score-tools-head .xor-group .tog.pill.on {
  color: #0a0a0a;
  background: transparent;
  border-bottom: 2px solid #0a0a0a;
  margin-bottom: -1px;
}

/* Score annotation segmented control — Notes | Fingers | Off */
.anno-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.anno-control-label {
  display: none;
}
.anno-seg {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #2e2e2e;
  background: #121212;
  min-height: 36px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  padding: 2px;
  gap: 2px;
}
.anno-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  cursor: pointer;
  user-select: none;
}
.anno-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.anno-opt span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 32px;
  padding: 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #9a9a9a;
  border-right: none;
  border-radius: var(--radius-pill);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.anno-opt:last-child span {
  border-right: none;
}
.anno-opt:hover span {
  color: #f0f0f0;
  background: #1c1c1c;
}
.anno-opt:has(input:checked) span,
.anno-opt.on span {
  color: #0a0a0a;
  background: #f2f2f2;
}
.anno-opt:has(input:focus-visible) span {
  outline: 2px solid #e8e8e8;
  outline-offset: -3px;
}
.score-kbd-toggle {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid #2e2e2e;
  background: #121212;
  border-radius: var(--radius-pill);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}
.score-kbd-toggle:hover,
.score-kbd-toggle.on {
  color: #0a0a0a;
  background: #f2f2f2;
  border-color: #f2f2f2;
}
/* The score is a lit page on a dark stage */
.score-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #0d0d0d;
  color: var(--ink);
}

/* Explain panel */
.explain-pane {
  background: var(--bg);
  color: var(--text);
  overflow: auto;
}
.explain-stage {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}
.explain-hero {
  min-height: min(52vh, 480px);
}
.explain-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  align-items: center;
}
/* Piano panel — falling-note tutorial + shared keyboard dock */
.piano-pane {
  background: #0a0a0a;
  color: var(--text);
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.is-panel-piano .piano-pane {
  flex: 1 1 auto;
  min-height: 0;
}
.piano-stage {
  max-width: none;
  margin: 0;
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}
.piano-tut-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.piano-tut-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a7a7a;
}
.piano-tut-meta {
  margin: 0;
  font-size: 12px;
  color: #6a6a6a;
  text-align: right;
}
.piano-roll {
  position: relative;
  flex: 1 1 auto;
  min-height: 280px;
  border: 1px solid #1a1a1a;
  background: #050505;
  overflow: hidden;
}
body.is-panel-piano .piano-roll {
  min-height: min(52vh, 420px);
}
.piano-roll canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.piano-roll-hit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 2px;
  background: rgba(245, 245, 245, 0.5);
  box-shadow: 0 0 12px rgba(245, 245, 245, 0.25);
  pointer-events: none;
}
.piano-focus-note {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #7a7a7a;
  text-align: center;
}

/* Practice tempo: slider with original-bpm marker + metronome */
.tempo-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid #2a2a2a;
  padding-left: 10px;
  margin-left: 4px;
  min-width: 0;
  flex: 0 1 240px;
  max-width: 260px;
}
.metro-btn {
  color: #8a8a8a;
  flex-shrink: 0;
}
.metro-btn:hover,
.metro-btn.on {
  color: #f2f2f2;
}
.metro-btn.on {
  background: rgba(255, 255, 255, 0.08);
}
.bpm-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 90px;
  height: 28px;
  display: flex;
  align-items: center;
}
.bpm-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: #3a3a3a;
  border-radius: 999px;
  outline: none;
  margin: 0;
}
.bpm-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f2f2f2;
  border: none;
  cursor: pointer;
}
.bpm-wrap input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f2f2f2;
  border: none;
  cursor: pointer;
}
.bpm-orig-mark {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 8px;
  margin-left: -1px;
  background: #a8a8a8;
  border-radius: 1px;
  pointer-events: none;
}
.bpm-orig-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 6px;
  height: 6px;
  border: 1px solid #a8a8a8;
  border-radius: 50%;
  background: #0a0a0a;
}
.bpm-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #d0d0d0;
  min-width: 4.8em;
}
.bpm-readout {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}
.bpm-unit {
  font-size: 11px;
  color: #7a7a7a;
  letter-spacing: 0.04em;
}
.bpm-meter {
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid #2a2a2a;
  font-size: 11px;
  color: #8a8a8a;
  letter-spacing: 0.04em;
}

/* Quiet access chips — overview + score */
.access-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.access-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  background: transparent;
  color: #8a8a8a;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
.access-chip:hover {
  color: #f0f0f0;
  border-color: #4a4a4a;
}
.access-chip.on {
  color: #0a0a0a;
  background: #f2f2f2;
  border-color: #f2f2f2;
}
.score-tools-head .access-chip {
  border-color: #d8d8d8;
  color: #555;
  background: #fff;
}
.score-tools-head .access-chip:hover {
  color: #111;
  border-color: #111;
}
.score-tools-head .access-chip.on {
  color: #fff;
  background: #111;
  border-color: #111;
}
.explain-access {
  margin-top: 14px;
  margin-left: 0;
}
.explain-pane .access-chip {
  border-color: #d0d0d0;
  color: #444;
  background: #fff;
}
.explain-pane .access-chip.on {
  color: #fff;
  background: #111;
  border-color: #111;
}
.quiet-chip {
  opacity: 0.75;
}
.home-access-line {
  margin: 18px 0 0;
  max-width: 36ch;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.create-account-story {
  color: #b8b8b8 !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
  margin: 0 0 22px !important;
  max-width: 36ch;
}
.auth-dialog {
  max-width: min(420px, calc(100vw - 32px)) !important;
  padding: 28px 28px 26px !important;
  border-radius: 10px !important;
  border-color: #262626 !important;
  background: #0c0c0c !important;
}
.auth-dialog h2 {
  font-size: 28px !important;
  letter-spacing: -0.02em;
  margin: 0 0 10px !important;
  color: #f4f4f4;
}
.auth-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a7a7a;
  font-family: var(--serif);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.auth-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-step[hidden] {
  display: none !important;
}
.auth-form label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin: 0;
  font-family: var(--serif);
}
.auth-form input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  background: #141414;
  color: #f2f2f2;
  font-size: 15px;
  font-family: inherit;
}
.auth-form input::placeholder {
  color: #666;
}
.auth-form input:focus {
  outline: none;
  border-color: #555;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
#create-code {
  font-size: 22px;
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.auth-submit {
  width: 100%;
  margin-top: 8px;
  min-height: 46px;
  justify-content: center;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.auth-code-hint {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #b0b0b0;
}
.auth-code-hint strong {
  color: #f0f0f0;
  font-weight: 500;
}
.auth-alt {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.auth-alt .quiet {
  flex: 1 1 auto;
  min-height: 40px;
  justify-content: center;
}
.auth-msg {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.auth-foot {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #6a6a6a !important;
  max-width: 40ch;
}
.auth-keep-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.auth-keep-nav .primary,
.auth-keep-nav .quiet {
  flex: 1 1 140px;
  min-height: 44px;
  justify-content: center;
}
.home-feature-list-slim {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}
.home-feature-list-slim li {
  max-width: 48ch;
}

/* Shared slim transport under Score / Piano */
.studio-dock {
  flex-shrink: 0;
  background: #070707;
  border-top: 1px solid #161616;
}
.studio-dock .companion-bar {
  background: #0a0a0a;
  border-top: none;
  color: var(--text);
  padding: 8px 16px 10px;
}
.studio-dock .transport-play {
  background: #f2f2f2;
  border-color: #f2f2f2;
  color: #0a0a0a;
}
.studio-dock .transport-play:hover {
  background: #e4e4e4;
  border-color: #e4e4e4;
}
.studio-dock .quiet.ink {
  color: #8a8a8a;
}
.studio-dock .quiet.ink:hover {
  color: #f0f0f0;
  border-color: transparent;
}
.studio-dock .scrub-meta {
  color: #6e6e6e;
}
.studio-dock #scrub-bar {
  color: #d0d0d0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  min-width: 4.5em;
}
.studio-dock .scrub-tick {
  background: #333333;
}
.studio-dock .scrub-tick::after {
  display: none;
}
.studio-dock .transport-stop {
  min-width: 64px;
  min-height: 40px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.studio-dock .transport-stop:disabled {
  opacity: 0.35;
  cursor: default;
}
.studio-dock .piano-speed {
  border-left: 1px solid #2a2a2a;
  padding-left: 8px;
  margin-left: 2px;
}
.studio-dock .speed-btn {
  color: #7a7a7a;
}
.studio-dock .speed-btn:hover {
  color: #e0e0e0;
}
.studio-dock .speed-btn.on {
  color: #f2f2f2;
  border-bottom-color: #f2f2f2;
}
/* Tempo + metronome stay on Score and Piano */
/* Piano tab: keyboard is the stage — no Hide chrome */
body.is-panel-piano .piano-dock-hide {
  display: none;
}
body.is-panel-piano .piano-dock-label {
  opacity: 0.55;
}
.piece-head {
  padding: 10px 22px 12px;
  border-bottom: 1px solid #ececec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--paper);
  flex-shrink: 0;
}
.piece-head.slim { min-height: 0; }
.piece-head-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}
.piece-titles { min-width: 0; }
.piece-head h2 {
  margin: 0;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(36vw, 360px);
  color: var(--ink);
  opacity: 0.88;
}
.piece-head p {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.piece-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}
.mode-tabs {
  display: inline-flex;
  border: none;
  border-bottom: 1px solid #e8e8e8;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  gap: 0;
}
.mode-tab {
  border: none;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font: inherit;
  padding: 7px 12px 9px;
  cursor: pointer;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  font-size: 12px;
  text-transform: uppercase;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.mode-tab:hover {
  color: var(--ink);
}
.mode-tab.on {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 500;
}

.score-scroll {
  flex: 1;
  overflow: auto;
  padding: 24px clamp(16px, 3.5vw, 48px) 48px;
  position: relative;
  animation: score-in 0.45s ease both;
  background: #0d0d0d;
  scrollbar-width: thin;
}
@keyframes score-in {
  from { opacity: 0.45; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
/* White paper page with a crisp lit edge against the night frame */
.score-page {
  background: var(--paper);
  border: 1px solid #050505;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 24px 60px rgba(0, 0, 0, 0.6);
  padding: clamp(14px, 2.5vw, 36px) clamp(10px, 2vw, 28px) clamp(18px, 3vw, 44px);
  min-height: 120px;
}
.score-page:has(#osmd:empty) {
  visibility: hidden;
}
.score.scan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.score.scan img,
.score.scan canvas {
  max-width: 100%;
  border: 1px solid #050505;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 18px 48px rgba(0, 0, 0, 0.55);
}

.playhead-line {
  position: absolute;
  top: 0;
  bottom: auto;
  width: 2px;
  background: #0a0a0a;
  z-index: 6;
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
  will-change: transform;
  transition: transform 0.05s linear, top 0.12s ease, height 0.12s ease, opacity 0.2s ease;
  opacity: 0.92;
  box-shadow: none;
}
.playhead-line.on {
  opacity: 1;
}
.playhead-line.scrubbing {
  transition: none;
  opacity: 1;
  width: 3px;
}
.playhead-line::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -7px;
  width: 16px;
  height: 14px;
  background: #0a0a0a;
  border-radius: 0;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  box-shadow: 0 0 0 8px transparent;
}
.playhead-line::after {
  /* Invisible hit strip for silky drag */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 26px;
  background: transparent;
}
.measure-hilite {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  transition: left 0.1s linear, width 0.1s linear, top 0.12s ease, height 0.12s ease;
}

.selection-hilites {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.selection-hilite {
  position: absolute;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.06);
  border: 1.5px solid rgba(0, 0, 0, 0.5);
  outline: 1px solid rgba(255, 255, 255, 0.65);
  outline-offset: -3px;
}

/* Bar under the cursor — quiet affordance that measures are clickable */
.hover-hilite {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  border-radius: 1px;
  transition: left 0.09s var(--ease), top 0.09s var(--ease), width 0.09s var(--ease),
    height 0.09s var(--ease), opacity 0.15s var(--ease);
}

#osmd {
  width: 100%;
  max-width: 100%;
}
/* Bars are tap targets — never let a tap paint a text selection */
.score-scroll,
#osmd,
#osmd svg {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#osmd.score-interactive {
  cursor: pointer;
}
#osmd.score-interactive svg {
  transition: opacity 0.15s ease;
}

/* ---------- digital piano dock (under score or Piano focus) ---------- */
.piano-dock {
  flex-shrink: 0;
  border-top: 1px solid #1c1c1c;
  background: #0b0b0b;
  color: #f0f0f0;
  z-index: 11;
}
.piano-dock.collapsed,
.piano-dock[hidden] {
  display: none !important;
  border: none;
  padding: 0;
  margin: 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
}
.piano-dock.is-slim {
  background: #0b0b0b;
  border-top: 1px solid #1c1c1c;
}
.piano-dock .piano-dock-hide {
  color: #8a8a8a;
}
.piano-dock .piano-dock-hide:hover {
  color: #f0f0f0;
  border-color: transparent;
}
.piano-dock.is-focus {
  background: #0c0c0c;
  border-top: 1px solid #1c1c1c;
  color: #f0f0f0;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.piano-dock.is-focus .piano-dock-head {
  border-bottom-color: #1c1c1c;
}
.piano-dock.is-focus .piano-dock-label {
  color: #8a8a8a;
}
.piano-dock.is-focus .piano-dock-hide {
  color: #8a8a8a;
}
.piano-dock.is-focus .piano-panel {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 6px 12px 10px;
}
.piano-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 14px;
  border-bottom: 1px solid #191919;
  min-height: 30px;
}
.piano-dock-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a7a7a;
}
.piano-dock-hide {
  font-size: 11px;
  letter-spacing: 0.04em;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.piano-speed {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.speed-btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #6a6a6a;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  min-height: 32px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.speed-btn:hover {
  color: #111;
  background: #ececec;
}
.speed-btn.on {
  color: #0a0a0a;
  background: #f2f2f2;
  border-bottom-color: transparent;
}
.piano-dock .speed-btn {
  color: #8a8a8a;
}
.piano-dock .speed-btn:hover {
  color: #0a0a0a;
  background: #ececec;
}
.piano-dock .speed-btn.on {
  color: #0a0a0a;
  background: #f2f2f2;
}
.piano-panel {
  padding: 0 0 6px;
}
.lune-kbd-host {
  --key-w: 20px;
  --black-w: 12px;
  --kbd-h: 88px;
  width: 100%;
}
.piano-dock.is-slim .lune-kbd-host {
  --key-w: 18px;
  --black-w: 11px;
  --kbd-h: 78px;
}
.piano-dock.is-focus .lune-kbd-host {
  --key-w: 22px;
  --black-w: 14px;
  --kbd-h: 120px;
  min-height: 120px;
}
.lune-kbd-track {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  height: var(--kbd-h);
  padding: 0 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  scrollbar-width: thin;
  /* Felt rail above the keys */
  background: #161616;
  border: 1px solid #0b0b0b;
  border-radius: 12px;
  box-shadow: inset 0 3px 0 #000000, inset 0 4px 0 #2a2a2a;
}
.piano-dock.is-slim .lune-kbd-track {
  background: #141414;
  border-color: #0b0b0b;
}
.lune-kbd-whites {
  display: flex;
  height: 100%;
  width: max-content;
  position: relative;
  z-index: 1;
}
.lune-kbd-blacks {
  position: absolute;
  left: 10px;
  top: 0;
  height: 62%;
  width: max-content;
  pointer-events: none;
  z-index: 2;
}
.lune-key {
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  position: relative;
  cursor: default;
  outline: none;
}
.lune-key.white {
  width: var(--key-w);
  height: 100%;
  flex: 0 0 var(--key-w);
  /* Ivory: top sheen and a solid lip at the key's front edge */
  background: #f6f5f1;
  border-right: 1px solid #c9c7c1;
  border-bottom: none;
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 -5px 0 #e6e4de,
    inset 0 -6px 0 #b9b7b1;
  box-sizing: border-box;
  border-radius: 0 0 2px 2px;
  transition: background 0.1s var(--ease), box-shadow 0.1s var(--ease);
}
.lune-key.white:first-child {
  border-left: 1px solid #c9c7c1;
}
.lune-key.white.on {
  background: #1f1f1f;
  border-right-color: #0d0d0d;
  box-shadow:
    inset 0 2px 0 #000000,
    inset 0 -4px 0 #0a0a0a;
}
.lune-key-notch {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  background: #c4c2bc;
  border-radius: 50%;
  pointer-events: none;
}
.lune-key.white.on .lune-key-notch {
  background: #4e4e4e;
}
.lune-key.black {
  position: absolute;
  top: 0;
  width: var(--black-w);
  height: 100%;
  /* Ebony: slight top highlight, solid front bevel */
  background: #141414;
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 3px 3px;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    inset 1px 0 0 #2c2c2c,
    inset 0 -4px 0 #000000;
  transition: background 0.1s var(--ease), box-shadow 0.1s var(--ease);
}
.lune-key.black.on {
  background: #e8e8e8;
  border-color: #2a2a2a;
  box-shadow: inset 0 -3px 0 #c6c6c6;
}
.lune-key-finger {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #222;
  pointer-events: none;
  user-select: none;
}
.lune-key.white.on .lune-key-finger {
  color: #f5f5f5;
  bottom: 12px;
}
.lune-key.black .lune-key-finger {
  bottom: 8px;
  color: #eee;
  font-size: 9px;
}
.lune-key.black.on .lune-key-finger {
  color: #111;
}

/* ---------- companion dock ---------- */
.companion-bar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px 12px;
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid #e6e6e6;
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
  animation: companion-in 0.35s ease both;
  flex-shrink: 0;
}
@keyframes companion-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.companion-play {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  flex: 1 1 100%;
  min-width: 0;
}
.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}
.transport .transport-scrub {
  flex: 1 1 160px;
  min-width: 120px;
}
.transport-play {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 40px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.transport-play:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.transport-play:active {
  transform: translateY(1px);
  box-shadow: none;
}
.transport-scrub {
  flex: 1 1 auto;
  min-width: 0;
}
.scrub-track-wrap {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
}
.scrub-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  bottom: 9px;
  pointer-events: none;
  z-index: 0;
}
.scrub-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #c8c8c8;
  transform: translateX(-0.5px);
}
.scrub-tick::after {
  content: "";
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 4px;
  height: 4px;
  background: #777;
  border-radius: 50%;
}
.companion-play .scrubber {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  width: 100%;
}
.transport-stop {
  flex: 0 0 auto;
}
.quiet.ink.danger {
  border-color: #999;
  color: #333;
}
.companion-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
}
/* Practice options live in the top studio chrome — always reachable */
.studio-toggles {
  gap: 0;
  padding: 0;
  border: none;
  width: auto;
  flex: 0 1 auto;
  max-width: 100%;
}
.tog-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.tog-group + .tog-group,
.tog-group + .tog.pill {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid #e8e8e8;
}
.tog.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  min-height: 36px;
  background: transparent;
  color: var(--ink-muted);
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.tog.pill:hover {
  color: var(--ink);
  background: #111;
  color: #f5f5f5;
  border-color: #111;
}
.tog.pill:has(input:checked),
.tog.pill.on {
  border-color: var(--ink);
  background: var(--ink);
  color: #f5f5f5;
}
.tog.pill:focus-within {
  outline: none;
}
.tog.pill:has(input:focus-visible) {
  outline: 1px solid #888;
  outline-offset: -2px;
}
.tog.pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  margin: 0;
}
.companion-hint {
  margin: 0;
  flex: 1 1 100%;
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
  padding: 2px 0;
}
/* Machined scrubber — slim track, precise handle */
.scrubber input[type="range"] {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 28px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: grab;
  background: transparent;
}
.scrubber input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: #2c2c2c;
  border-radius: 1px;
}
.scrubber input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 1px solid #0a0a0a;
  margin-top: -6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: transform var(--t-fast) var(--ease);
}
.scrubber input[type="range"]:hover::-webkit-slider-thumb,
.scrubber input[type="range"].scrubbing::-webkit-slider-thumb {
  transform: scale(1.2);
}
.scrubber input[type="range"]::-moz-range-track {
  height: 2px;
  background: #2c2c2c;
}
.scrubber input[type="range"]::-moz-range-progress {
  height: 2px;
  background: #e8e8e8;
}
.scrubber input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 1px solid #0a0a0a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.scrubber input[type="range"].scrubbing,
.scrubber input[type="range"]:active {
  cursor: grabbing;
}
.scrub-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.scrub-keys {
  flex: 1 1 auto;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4e4e4e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
#scrub-bar {
  font-variant-numeric: tabular-nums;
  color: #333;
  font-weight: 500;
  letter-spacing: 0.02em;
}
#scrub-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Studio primary buttons stay ink on paper */
.score-pane .primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.score-pane .primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
}

/* ---------- coach panel (right sidebar / phone sheet) ---------- */
.coach {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 92px;
  width: min(380px, 42vw);
  max-width: 100%;
  margin: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border: none;
  border-left: 1px solid #cfcfcf;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: -18px 0 44px rgba(0, 0, 0, 0.1);
  z-index: 25;
  padding: 0;
  color: var(--ink);
  animation: coach-in 0.22s var(--ease);
}
@keyframes coach-in {
  from { transform: translateX(12px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
body.coach-open.is-panel-score .score-pane {
  padding-right: min(380px, 42vw);
}
body.coach-open.is-panel-score .studio-dock {
  padding-right: min(380px, 42vw);
}
.coach-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.coach-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #ebebeb;
  flex: 0 0 auto;
}
.coach-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
}
.coach-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: #111;
  line-height: 1.15;
}
.coach-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.coach-clear {
  font-size: 11px;
  letter-spacing: 0.04em;
  min-height: 32px;
  padding: 4px 8px;
}
.coach-close {
  position: static;
  border: none;
  background: transparent;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
}
.coach-close:hover {
  color: #111;
  background: #efefef;
}
.coach-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 20px;
  -webkit-overflow-scrolling: touch;
}
.coach-lead {
  margin: 0 0 14px !important;
  font-size: 13px !important;
  color: #666 !important;
  line-height: 1.5;
}
.coach-bar-block + .coach-bar-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #ebebeb;
}
.coach .help-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #ebebeb;
  background: #fafafa;
}
.dim { color: var(--dim) !important; font-size: 13px; }

#help-body h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: #111;
}
#help-body h4 {
  margin: 14px 0 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
}
#help-body p,
#help-body li {
  margin: 0 0 8px;
  color: #444;
  font-size: 14px;
  line-height: 1.55;
}
#help-body ul {
  margin: 0;
  padding-left: 16px;
}

.focus-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.focus-list li {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  color: #222;
  background: #fff;
}
.chunk {
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.chunk .label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
}
.chunk p { margin: 0; color: #555; }
.notes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 10px;
  margin: 0 0 4px;
  padding: 0;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: none;
  border-radius: 0;
  padding: 2px 0 2px 8px;
  border-left: 2px solid #d8dce8;
  font-size: 15px;
  font-family: var(--serif);
  font-weight: 500;
  background: transparent;
  color: #111;
  box-shadow: none;
  line-height: 1.25;
}
.chip:hover {
  border-left-color: #13244d;
  transform: none;
}
.chip i,
.chip .tone-finger {
  font-style: normal;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-left: 0;
  vertical-align: baseline;
  color: #13244d;
  line-height: 1;
  opacity: 0.85;
}
.chip.finger-only { font-size: 14px; }
.chip.finger-only b {
  color: #13244d;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  margin-right: 2px;
  font-weight: 700;
}
.hand-label {
  margin: 10px 0 4px !important;
  font-size: 10px !important;
  color: #7a7a7a !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.chip.letter {
  min-width: 0;
  text-align: left;
}
.chip.letter.chord,
.chip.finger-only.chord {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 2px 0 2px 8px;
  min-width: 0;
}
.chip.letter.chord .chord-tone,
.chip.finger-only.chord .chord-tone {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 5px;
  line-height: 1.2;
  white-space: nowrap;
}
.chip.letter.chord .chord-tone .tone-letter,
.chip.finger-only.chord .chord-tone .tone-letter {
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
}
.chip.letter.chord .chord-tone .tone-finger,
.chip.finger-only.chord .chord-tone .tone-finger {
  font-style: normal;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.85;
  min-width: 0;
  text-align: center;
  vertical-align: baseline;
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  z-index: 40;
  font-size: 13px;
  box-shadow: var(--shadow);
}

/* Letter / finger overlays — score-relative SVG font-size (user units via attr).
   Quiet but readable — engraver ink, not washed-out grey. */
#osmd svg text.lune-letter {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  /* a shade softer than the engraving so letters read as guidance, not notes */
  fill: #3a3a3a;
  fill-opacity: 1;
  paint-order: stroke fill;
  stroke: #fafafa;
  /* paper-coloured halo: staff lines never strike through a label */
  stroke-width: 2.6px;
  stroke-linejoin: round;
  stroke-opacity: 1;
  pointer-events: none;
  user-select: none;
}
#osmd svg .lune-leader-layer line,
#osmd svg line.lune-leader {
  stroke: #1a1a1a;
  stroke-width: 0.45;
  stroke-opacity: 0.42;
  fill: none;
  pointer-events: none;
}
#osmd svg text.lune-finger {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  fill: #1a1a1a;
  fill-opacity: 0.94;
  paint-order: stroke fill;
  stroke: #fafafa;
  /* paper-coloured halo: staff lines never strike through a label */
  stroke-width: 2.6px;
  stroke-linejoin: round;
  stroke-opacity: 1;
  pointer-events: none;
  user-select: none;
}
#osmd svg .vf-fingering,
#osmd svg text.vf-fingering {
  font-family: var(--serif) !important;
  font-size: 1.4em !important;
  font-weight: 600 !important;
  fill: #2c2c2c !important;
  fill-opacity: 0.78 !important;
}

@media (max-width: 800px) {
  html, body, #app {
    overflow-x: hidden;
    max-width: 100%;
  }
  .bar {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand {
    min-width: 0;
    flex-shrink: 0;
  }
  .brand .lune-mark {
    width: 20px;
    height: 20px;
  }
  .brand-name {
    font-size: 11px;
    letter-spacing: 0.16em;
  }
  .bar {
    position: relative;
  }
  body:not(.is-studio) .bar {
    flex-wrap: nowrap;
  }
  .btn-search {
    display: inline-flex;
    margin-left: auto;
  }
  body.is-studio .btn-search {
    display: none;
  }
  .top-search {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: 100%;
    flex: none;
    order: 0;
    max-width: none;
    z-index: 40;
    padding-top: 8px;
  }
  body.phone-search-open .top-search,
  body.is-studio.studio-search-open .top-search {
    display: flex;
  }
  .top-search .search-go {
    display: none;
  }
  .top-search input {
    min-width: 0;
    padding: 11px 16px;
    font-size: 16px; /* avoid iOS zoom */
  }
  .upload-label { display: none; }
  .upload-icon { display: block; }
  #btn-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    min-height: 36px;
    margin-left: 8px;
    padding: 0;
  }
  body.is-studio #btn-open {
    display: none;
  }
  body.phone-search-open .results,
  body.is-studio.studio-search-open .results {
    top: 108px;
  }
  .results { left: 12px; right: 12px; max-width: none; }
  .home-hero {
    min-height: calc(100vh - 96px);
    padding: 88px 16px 56px;
    align-items: flex-end;
  }
  .home-hero-motif {
    right: 12px;
    top: 36px;
  }
  .home-motif-mark {
    width: 72px;
    height: 72px;
  }
  .home-hero::after {
    display: none;
  }
  .home-lockup {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 36px;
  }
  .home-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 0;
  }
  .home-brand { font-size: clamp(64px, 22vw, 112px); max-width: 100%; }
  .home h1 { max-width: 100%; font-size: clamp(22px, 6vw, 30px); }
  .lead { max-width: 100%; margin-bottom: 24px; }
  .home-cta-row { margin-top: 22px; }
  .home-brand::after { margin-top: 14px; width: min(100px, 40%); }
  .about-maker { padding: 72px 20px 112px; }
  .home-footer { padding: 36px 20px 56px; }
  .about-maker::before { left: 20px; right: 20px; }
  .about-maker-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .about-maker-visual {
    max-width: none;
    justify-self: stretch;
    order: -1;
  }
  .home-chapter {
    padding: 64px 20px 16px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .home-features {
    padding: 56px 20px 16px;
  }
  .home-features::before { left: 20px; right: 20px; }
  .home-chapter::before { left: 20px; right: 20px; }
  .home-chapter + .home-chapter { padding-top: 56px; }
  .home-chapter-visual,
  .home-chapter-flip .home-chapter-visual {
    max-width: none;
    justify-self: stretch;
    order: -1;
  }
  .home-chapter-flip .home-chapter-copy {
    order: 0;
  }
  .lune-kbd-host {
    --key-w: 15px;
    --black-w: 9px;
    --kbd-h: 64px;
  }
  .piano-dock.is-slim .lune-kbd-host {
    --key-w: 14px;
    --black-w: 9px;
    --kbd-h: 58px;
  }
  .piano-dock.is-focus .lune-kbd-host {
    --key-w: 18px;
    --black-w: 11px;
    --kbd-h: min(36vh, 200px);
  }
  .piano-dock-head {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }
  .studio-dock .piano-speed {
    width: 100%;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    justify-content: space-between;
    order: 2;
  }
  .speed-btn {
    padding: 8px 10px;
    min-height: 44px;
  }
  .score-kbd-toggle {
    min-height: 44px;
  }
  .composer-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 24px;
  }
  .composer-photo {
    max-width: min(280px, 100%);
    max-height: 360px;
    aspect-ratio: 3 / 4;
    width: 100%;
  }
  .piece-head {
    flex-direction: column;
    align-items: stretch;
    padding: 6px 12px 8px;
    gap: 4px;
  }
  .piece-head.score-tools-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    gap: 6px 10px;
  }
  .score-kbd-toggle {
    align-self: center;
  }
  .piece-head h2 { max-width: none; font-size: 15px; }
  .piece-head p { display: none; }
  .piece-head-actions {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .mode-tabs {
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
  }
  .mode-tab {
    flex: 1;
    text-align: center;
    padding: 11px 10px 12px;
    min-height: 44px;
  }
  .studio-toggles {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  /* Score toolbar: annotate control left, keyboard toggle right, one row */
  .score-tools-head .studio-toggles {
    width: auto;
    flex: 0 1 auto;
    padding-bottom: 0;
    overflow: visible;
  }
  .studio-toggles .tog-group {
    display: contents;
  }
  .tog-group + .tog-group,
  .tog-group + .tog.pill {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
  .studio-toggles .tog.pill {
    flex: 1 1 0;
    justify-content: center;
    min-height: 44px;
    min-width: 0;
    padding: 8px 4px;
    font-size: 10px;
    letter-spacing: 0.03em;
    gap: 0;
    border-bottom: none;
    white-space: nowrap;
  }
  .studio-toggles .tog.pill input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
  }
  .studio-toggles .tog.pill {
    border-bottom: 2px solid transparent;
  }
  .studio-toggles .tog.pill:has(input:checked),
  .studio-toggles .tog.pill.on {
    border-bottom-color: var(--ink);
    background: transparent;
    color: var(--ink);
  }
  .score-scroll {
    padding: 12px 8px 24px;
    -webkit-overflow-scrolling: touch;
  }
  .score-page {
    padding: 10px 6px 16px;
  }
  .scrub-keys {
    display: none;
  }
  #osmd {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  #osmd svg {
    max-width: 100%;
    height: auto;
  }
  .companion-bar {
    left: auto;
    right: auto;
    bottom: auto;
    padding: 8px 10px 10px;
    gap: 6px;
  }
  .transport {
    flex-wrap: wrap;
    gap: 6px 8px;
  }
  .transport-play,
  .transport-stop {
    min-width: 72px;
    min-height: 44px;
  }
  .scrub-track-wrap {
    height: 36px;
  }
  .scrubber input[type="range"] {
    height: 36px;
  }
  .coach {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(62vh, 520px);
    border-left: none;
    border-top: 1px solid #d0d0d0;
    border-radius: 20px 20px 0 0;
    animation: coach-sheet-in 0.24s ease;
  }
  @keyframes coach-sheet-in {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  body.coach-open.is-panel-score .score-pane,
  body.coach-open.is-panel-score .studio-dock {
    padding-right: 0;
  }
  .coach-title {
    font-size: 22px;
  }
  .help-actions button {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .bar {
    padding: 6px 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }
  body.is-studio .bar {
    flex-wrap: wrap;
  }
  body.is-studio .bar {
    padding: 4px 10px 6px;
  }
  .brand .lune-mark {
    width: 18px;
    height: 18px;
  }
  .brand-name {
    display: none;
  }
  .studio-piece-quiet {
    max-width: none;
    flex: 1 1 auto;
    font-size: 12px;
    order: 2;
  }
  .piece-tabs {
    max-width: none;
    flex: 1 1 100%;
    order: 4;
  }
  /* Solo +: sit beside the quiet title, not on its own row */
  body.is-studio .piece-tabs.piece-tabs-solo {
    flex: 0 0 auto;
    order: 3;
    width: auto;
    max-width: none;
  }
  body.is-studio .studio-seg {
    width: 100%;
    order: 5;
    margin-left: 0;
    justify-content: stretch;
  }
  .studio-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    min-width: 0;
    min-height: 38px;
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .explain-stage,
  .piano-stage {
    padding: 16px 12px 40px;
  }
  .piano-stage {
    padding: 12px 10px 8px;
  }
  .explain-hero {
    min-height: 0;
  }
  .score-scroll {
    padding: 10px 6px 20px;
  }
  .score-page {
    padding: 8px 4px 14px;
  }
  .studio-dock .companion-bar {
    padding: 8px 10px 10px;
  }
}

/* Overlay size comes from SVG font-size attr (user units) — no phone px override */
@media (max-width: 520px) {
  #osmd svg text.lune-letter,
  #osmd svg text.lune-finger {
    stroke-opacity: 1;
  }
  .anno-control {
    gap: 6px;
  }
  .anno-opt span {
    min-width: 52px;
    padding: 0 10px;
    font-size: 11px;
    min-height: 30px;
  }
  .piece-head.score-tools-head {
    padding: 4px 10px;
    gap: 8px;
  }
  .score-kbd-toggle {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 10px;
  }
  .transport {
    gap: 8px;
  }
  .transport-play {
    min-width: 72px;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 11px;
  }
}

/* ---------- coach: bar headline + line summary + actions ---------- */
.bar-headline {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px 3px;
  border: 1px solid #ddd;
  border-radius: var(--radius-pill);
  background: #fff;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #666;
  vertical-align: 3px;
  white-space: nowrap;
}
.coach-line-block {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #ebebeb;
}
.line-summary {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.line-summary li {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 13.5px;
  line-height: 1.5;
}
.coach .help-actions button {
  flex: 1 1 auto;
  min-height: 40px;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease,
    opacity 0.14s ease;
}
.coach .help-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
.coach .help-actions button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 1px;
}

/* ---------- piano loader (B&W, calm) ---------- */
.lune-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(2px);
}
.lune-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 38px;
  background: #0e0e0e;
  border: 1px solid #262626;
  border-radius: var(--radius);
}
.loader-piano {
  position: relative;
  display: flex;
  gap: 1px;
  height: 64px;
}
.loader-piano .lk.w {
  width: 22px;
  height: 64px;
  background: #f2f2f2;
  border: 1px solid #0a0a0a;
  border-radius: 0 0 2px 2px;
  transform-origin: top center;
  animation: lk-press 2.4s ease-in-out infinite;
}
.loader-piano .lk.w:nth-child(1) { animation-delay: 0s; }
.loader-piano .lk.w:nth-child(2) { animation-delay: 0.17s; }
.loader-piano .lk.w:nth-child(3) { animation-delay: 0.34s; }
.loader-piano .lk.w:nth-child(4) { animation-delay: 0.51s; }
.loader-piano .lk.w:nth-child(5) { animation-delay: 0.68s; }
.loader-piano .lk.w:nth-child(6) { animation-delay: 0.85s; }
.loader-piano .lk.w:nth-child(7) { animation-delay: 1.02s; }
.loader-piano .lk.b {
  position: absolute;
  top: 0;
  width: 13px;
  height: 39px;
  background: #0d0d0d;
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 2px 2px;
  z-index: 2;
}
.loader-piano .lk.b1 { left: 16px; }
.loader-piano .lk.b2 { left: 39px; }
.loader-piano .lk.b3 { left: 85px; }
.loader-piano .lk.b4 { left: 108px; }
.loader-piano .lk.b5 { left: 131px; }
@keyframes lk-press {
  0%, 10%, 100% { transform: none; background: #f2f2f2; }
  4% { transform: translateY(3px) scaleY(0.97); background: #d9d9d9; }
}
.lune-loader-text {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #bdbdbd;
}
.lune-loader-text::after {
  content: "…";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: loader-ellipsis 1.6s steps(4, end) infinite;
}
@keyframes loader-ellipsis {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "…"; }
}
@media (prefers-reduced-motion: reduce) {
  .loader-piano .lk.w {
    animation: none;
  }
  .lune-loader-text::after {
    animation: none;
  }
}

/* ===================================================================
   Navy as a quiet accent only — never a wash over the whole UI.
   =================================================================== */
:root {
  --navy-abyss: #0a0a0a;
  --navy-deep: #121212;
  --navy: #2a2a2a;
  --navy-line: #333;
  --navy-ink: #6b7fa3; /* soft accent: LH keys, rare highlights */
}

body,
#app {
  background: var(--bg);
}

/* logo staff lines: one place navy is allowed to show */
.lune-mark g {
  stroke: var(--navy-ink);
  opacity: 0.55;
}
.lune-mark path {
  filter: none;
}
.home-mark path {
  filter: none;
}

.bar {
  background: rgba(10, 10, 10, 0.88);
  border-bottom-color: #1c1c1c !important;
}

#q {
  border-color: #2a2a2a !important;
  background-color: #0e0e0e !important;
}
#q:focus,
#q:focus-visible {
  border-color: #666 !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08) !important;
  outline: none;
}
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline-color: #c8c8c8;
}

.studio-seg,
.anno-seg,
.piece-tabs {
  border-color: #2a2a2a !important;
  background-color: #101010 !important;
}

.quiet,
button.quiet,
.result,
.search-results,
#search-results {
  border-color: #2a2a2a !important;
}
.search-results,
#search-results {
  background: #0e0e0e !important;
}

.score-page {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px #222;
}

#osmd svg .lune-hilite,
#osmd svg rect.lune-sel,
#osmd svg .lune-playhead {
  fill: rgba(255, 255, 255, 0.1) !important;
  stroke: rgba(255, 255, 255, 0.35) !important;
}

input[type="range"] {
  accent-color: #d0d0d0;
}

.toast {
  border: 1px solid #2a2a2a;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}

::selection {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ===================================================================
   Launch review fixes
   =================================================================== */

/* Speed lives on the Score tab too, and the chosen speed is obvious. */
body.is-panel-score .studio-dock .piano-speed {
  display: inline-flex;
}
.speed-btn.on,
.studio-dock .speed-btn.on,
.piano-dock .speed-btn.on {
  color: #0a0a0a !important;
  background: #f2f2f2 !important;
  border-bottom-color: transparent !important;
  font-weight: 600;
}

/* Bar panel is light paper: chips need ink, not the night-theme white. */
.coach .chip,
.coach .chip .tone-letter,
.coach .chip b,
.coach .chip i {
  color: #111;
}
.coach .chip.finger-only b,
.coach .chip .tone-finger,
.coach .chip.letter i {
  color: #1a1a1a;
  font-weight: 700;
  opacity: 1;
}
/* Secondary bar-panel actions read as buttons, not disabled text. */
.coach .help-actions .quiet {
  color: #111 !important;
  background: #fff !important;
  border: 1px solid #8a8a8a !important;
  opacity: 1 !important;
}
.coach .help-actions .quiet:hover {
  border-color: #13244d !important;
  color: #13244d !important;
}
.coach .help-actions button {
  min-height: 44px;
}

/* Touch screens: every control is at least 44px. */
@media (pointer: coarse), (max-width: 760px) {
  .speed-btn,
  .studio-tab,
  .anno-opt span,
  .coach-close,
  .coach-clear,
  .piece-tab-add,
  .piece-tab-close,
  .transport-play,
  .transport-stop,
  .quiet,
  .primary,
  .link-btn {
    min-height: 44px;
  }
  .coach-close,
  .piece-tab-add,
  .piece-tab-close {
    min-width: 44px;
  }
}

/* Phone: the bar sheet stays short and the score scrolls above it. */
@media (max-width: 760px) {
  .coach {
    max-height: min(46vh, 420px) !important;
  }
  body.coach-open.is-panel-score .score-scroll {
    padding-bottom: calc(min(46vh, 420px) + 24px);
  }
}

/* Fine print: sources and licenses, present but out of the way. */
.fine-print {
  font-size: 11px;
  line-height: 1.6;
  color: #8b93a7;
  letter-spacing: 0.01em;
  margin: 18px auto 6px;
  max-width: 760px;
  text-align: center;
}
.fine-print a,
.fine-print .link-btn {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(139, 147, 167, 0.5);
  text-underline-offset: 2px;
}
.score-scroll .fine-print {
  margin-top: 14px;
}
.link-btn,
a.link-btn,
.home-access-line a {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #d8d8d8;
  cursor: pointer;
  border-radius: 0;
  text-decoration: underline;
  text-decoration-color: #555;
  text-underline-offset: 3px;
}
.link-btn:hover,
a.link-btn:hover,
.home-access-line a:hover {
  color: #fff;
  text-decoration-color: #aaa;
}
.home-footer-legal {
  margin-top: 10px;
}

.credits-dialog {
  max-width: min(640px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 22px 26px 26px;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  background: #101010;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  line-height: 1.6;
}
.credits-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}
.credits-dialog h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 8px;
}
.credits-dialog h3 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 6px;
}
.credits-dialog ul {
  margin: 0;
  padding-left: 18px;
}
.credits-dialog li + li {
  margin-top: 4px;
}
.credits-dialog a {
  color: #c9d6f5;
}
.credits-close-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 4px;
}

/* Engraved letter / finger lane (lyric line under each staff). */
#osmd svg text.lane-letter,
#osmd svg text.lane-finger {
  font-family: var(--serif) !important;
  font-weight: 600 !important;
  fill: #1c2b52 !important; /* deep navy: guidance, distinct from the black engraving */
}
#osmd svg text.lane-finger {
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Repertoire · bar notes · review · play along · access · study
   ===================================================================== */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}

/* header button */
.rep-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border-color: var(--line-strong);
  color: var(--text);
}
.rep-btn:hover,
body.is-repertoire .rep-btn {
  border-color: #555;
  background: #161616;
}
.rep-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #f0f0f0;
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
@media (max-width: 760px) {
  .rep-btn-label { display: none; }
  .rep-btn { min-width: 44px; justify-content: center; }
}

/* Repertoire page */
.repertoire,
.study {
  flex: 1;
  overflow: auto;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(19, 36, 77, 0.55), transparent 60%),
    var(--bg);
  color: var(--text);
}
.rep-inner,
.study-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.rep-hero h1,
.study-inner h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  margin: 0 0 10px;
}
.rep-lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
  margin: 0 0 18px;
}
.rep-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}
.rep-account strong { color: var(--text); font-weight: 600; }
.rep-acct-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a4a4a;
}
.rep-acct-dot.on { background: #8fb0ff; box-shadow: 0 0 0 3px rgba(143, 176, 255, 0.18); }
.rep-section { margin-top: 40px; }
.rep-section h2 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}
.rep-empty {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  padding: 18px 20px;
  border: 1px dashed #2a2f3d;
  border-radius: 14px;
}
.rep-empty em { color: var(--muted); font-style: normal; font-weight: 600; }
.rep-today { display: grid; gap: 10px; }
.rep-today-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--navy-line, #1d3366);
  background: linear-gradient(180deg, rgba(19, 36, 77, 0.45), rgba(10, 21, 48, 0.3));
  border-radius: 14px;
}
.rep-today-t { font-family: var(--serif); font-size: 18px; flex: 1 1 200px; }
.rep-today-bars { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-bar {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid #3a4a72;
  background: transparent;
  color: #dfe7fb;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.rep-bar:hover { background: #c9d6f5; color: var(--navy-abyss, #050b1c); border-color: #c9d6f5; }
.rep-add { display: flex; gap: 8px; }
.rep-add input,
.lp-dialog input,
.lp-dialog textarea,
.study-start input {
  flex: 1;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #2f3546;
  background: #0e1220;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.rep-add input:focus,
.lp-dialog input:focus,
.lp-dialog textarea:focus,
.study-start input:focus {
  outline: none;
  border-color: #8fb0ff;
  box-shadow: 0 0 0 3px rgba(143, 176, 255, 0.18);
}
.rep-suggest {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.rep-sug {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "t go" "c go";
  text-align: left;
  gap: 2px 12px;
  padding: 10px 14px;
  border: 1px solid #222838;
  border-radius: 12px;
  background: #0d1019;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.rep-sug:hover { border-color: var(--navy-ink, #2c4a8a); background: #101a33; }
.rep-sug-t { grid-area: t; font-family: var(--serif); font-size: 16px; }
.rep-sug-c { grid-area: c; color: var(--dim); font-size: 12.5px; }
.rep-sug-go { grid-area: go; align-self: center; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #8fb0ff; }
.rep-sug-typed { border-style: dashed; grid-template-areas: "t" "c"; grid-template-columns: 1fr; }
.rep-list { display: grid; gap: 10px; }
.rep-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid #1e2433;
  border-radius: 16px;
  background: #0c0f17;
}
.rep-card-main { flex: 1 1 260px; min-width: 0; }
.rep-card h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 0; }
.rep-card-by { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }
.rep-card-meta { margin: 0; color: var(--dim); font-size: 13px; }
.rep-card-meta strong { color: #c9d6f5; font-weight: 600; }
.rep-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rep-card select {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #2f3546;
  background: #0e1220;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.rep-remove.danger,
.quiet.danger { color: #ffb4b4 !important; border-color: #6b2b2b !important; }
.rep-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #1a1f2c;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rep-study-link { text-decoration: none; display: inline-flex; align-items: center; }

/* dialogs */
.lp-dialog label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.lp-dialog textarea { width: 100%; resize: vertical; }
.lp-dialog input { width: 100%; }
.lp-dialog .primary { margin-top: 14px; }
.lp-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.lp-callout {
  padding: 12px 14px;
  border: 1px solid var(--navy-line, #1d3366);
  border-radius: 12px;
  background: rgba(19, 36, 77, 0.35);
}
.lp-switch {
  display: flex !important;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #1a2240;
  cursor: pointer;
  color: var(--text) !important;
  font-size: 14px !important;
  margin: 0 !important;
}
.lp-switch input { width: 20px !important; height: 20px; min-height: 0 !important; margin-top: 2px; accent-color: #8fb0ff; flex: 0 0 auto; }
.lp-switch strong { display: block; font-weight: 600; }
.lp-switch small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.lp-assign-out input { margin-top: 14px; font-size: 13px; }

/* coach additions (light sheet) */
.lp-coach {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ebebeb;
}
.lp-h {
  margin: 16px 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b6b6b;
  font-weight: 600;
}
.lp-tools { margin-top: 0; }
.lp-chip {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid #d6dbe8;
  background: #fff;
  color: var(--navy, #13244d);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.lp-chip:hover { border-color: var(--navy, #13244d); background: #f1f4fb; }
.lp-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lp-note {
  position: relative;
  padding: 10px 34px 10px 12px;
  border-radius: 10px;
  background: #f3f5fa;
  border-left: 3px solid var(--navy, #13244d);
}
.lp-note.lp-src-teacher { border-left-color: #b8860b; background: #fbf7ec; }
.lp-note p { margin: 0; color: #111; font-size: 14.5px; line-height: 1.45; }
.lp-meta { display: block; margin-top: 3px; font-size: 11.5px; color: #777; }
.lp-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 18px;
  cursor: pointer;
}
.lp-del:hover { color: #111; background: #e6e9f2; }
.lp-empty { color: #777; font-size: 13.5px; line-height: 1.5; }
.lp-note-form textarea {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6dbe8;
  font: inherit;
  font-size: 14.5px;
  resize: vertical;
  color: #111;
  background: #fff;
}
.lp-note-form textarea:focus { outline: none; border-color: var(--navy, #13244d); box-shadow: 0 0 0 3px rgba(19, 36, 77, 0.12); }
.lp-note-form .lp-row { margin-top: 8px; }
.lp-mic,
.lp-save {
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lp-mic { border: 1px solid #d6dbe8; background: #fff; color: var(--navy, #13244d); }
.lp-mic.on { background: var(--navy, #13244d); color: #fff; border-color: var(--navy, #13244d); animation: lp-pulse 1.2s ease-in-out infinite; }
.lp-mic:disabled { opacity: 0.45; cursor: not-allowed; }
.lp-save { border: 1px solid var(--navy, #13244d); background: var(--navy, #13244d); color: #fff; }
.lp-save:hover { background: var(--navy-deep, #0a1530); }
@keyframes lp-pulse { 50% { box-shadow: 0 0 0 6px rgba(19, 36, 77, 0.15); } }
.lp-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lp-grade {
  min-height: 44px;
  border: 1px solid #d6dbe8;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.lp-grade:hover { border-color: #13244d; }
.lp-grade.lp-again.picked { background: #7a1f1f; color: #fff; border-color: #7a1f1f; }
.lp-grade.lp-hard.picked { background: #8a5a12; color: #fff; border-color: #8a5a12; }
.lp-grade.lp-good.picked { background: var(--navy, #13244d); color: #fff; border-color: var(--navy, #13244d); }
.lp-grade.lp-easy.picked { background: #1f5e3a; color: #fff; border-color: #1f5e3a; }
.lp-due { margin: 8px 0 0; font-size: 12.5px; color: #6b6b6b; }
.lp-teacher {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fbf7ec;
  border-left: 3px solid #b8860b;
  font-size: 14px;
  color: #222;
}
.lp-teacher p { margin: 4px 0 0; }

/* score toolbar */
.lp-tools-bar { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.lp-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3b8;
  border: 1px solid #262c3b;
  background: #0e111a;
}
.lp-tool:hover,
.lp-tool.on { color: #fff; border-color: var(--navy-ink, #2c4a8a); background: var(--navy-deep, #0a1530); }
.lp-tool.on svg { color: #8fb0ff; }
.lp-add.in { color: #c9d6f5; border-color: var(--navy-ink, #2c4a8a); }
.lp-add.in::before { content: "✓"; margin-right: 2px; }
@media (max-width: 760px) {
  .lp-tool-label { display: none; }
  .lp-tool { min-width: 40px; justify-content: center; }
  .lp-tools-bar .lp-add .lp-add-label { font-size: 10px; }
}
.explain-pane .lp-add,
.explain-pane .lp-braille { text-decoration: none; display: inline-flex; align-items: center; }

/* marks on the score */
.lp-marks { position: absolute; inset: 0 auto auto 0; width: 0; height: 0; z-index: 4; }
.lp-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  border: 2px solid #fff;
  background: var(--navy, #13244d);
  color: #fff;
  font: 700 11px/18px system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(10, 21, 48, 0.35);
}
.lp-mark:hover { background: var(--navy-ink, #2c4a8a); }
.lp-mark-assigned { background: #b8860b; }
.lp-heat {
  position: absolute;
  pointer-events: none;
  border-radius: 4px;
  background: #e2574c;
  mix-blend-mode: multiply;
}
.lf-hilite {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  border-radius: 4px;
  background: rgba(44, 74, 138, 0.12);
  border: 2px solid rgba(44, 74, 138, 0.75);
  transition: left 120ms var(--ease), top 120ms var(--ease), width 120ms var(--ease);
}

/* play-along panel + assignment banner */
.score-pane { position: relative; }
.lf-panel {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 24px);
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: rgba(5, 11, 28, 0.94);
  border: 1px solid var(--navy-line, #1d3366);
  color: #e8edf8;
  font-size: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.lf-dot { width: 10px; height: 10px; border-radius: 50%; background: #e2574c; animation: lp-blink 1.4s infinite; }
@keyframes lp-blink { 50% { opacity: 0.35; } }
.lf-meter { width: 60px; height: 4px; border-radius: 2px; background: #1d2a4a; overflow: hidden; }
.lf-meter i { display: block; height: 100%; background: #8fb0ff; transform-origin: left; transform: scaleX(0); }
.lf-panel.lf-wrong { animation: lf-shake 360ms; }
@keyframes lf-shake { 25% { border-color: #e2574c; } 50% { transform: translateX(calc(-50% + 3px)); } 75% { transform: translateX(calc(-50% - 3px)); } }
.lf-panel .quiet.ink { color: #c9d6f5; border-color: #2c4a8a; }
@media (max-width: 760px) {
  .lf-panel { border-radius: 16px; bottom: 10px; }
}
.lp-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(90deg, #13244d, #0a1530);
  border-bottom: 1px solid var(--navy-ink, #2c4a8a);
  color: #eef2fb;
}
.lp-banner-text { flex: 1 1 280px; }
.lp-banner-text p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.lp-banner-k { font-size: 11px !important; letter-spacing: 0.14em; text-transform: uppercase; color: #c9d6f5; }
.lp-banner-bars { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lp-banner-actions { display: flex; gap: 8px; }

/* reading & access */
body.lp-large { font-size: 118%; }
body.lp-large .coach-body,
body.lp-large .lp-note p { font-size: 17px; }
body.lp-large button { min-height: 48px; }
body.lp-large #osmd svg text.lane-letter,
body.lp-large #osmd svg text.lane-finger { font-weight: 700 !important; }
body.lp-readable,
body.lp-readable button,
body.lp-readable input,
body.lp-readable textarea { font-family: "Atkinson Hyperlegible", system-ui, sans-serif; letter-spacing: 0.01em; }
body.lp-readable #osmd svg text.lane-letter,
body.lp-readable #osmd svg text.lane-finger,
body.lp-readable .study-staff svg text.lane-letter { font-family: "Atkinson Hyperlegible", system-ui, sans-serif !important; }
body.lp-contrast #osmd svg text.lane-letter,
body.lp-contrast #osmd svg text.lane-finger { fill: #000 !important; font-weight: 700 !important; }
body.lp-contrast .coach-sheet { background: #fff; color: #000; }

/* study */
.study-start { display: grid; gap: 8px; max-width: 420px; margin-top: 18px; }
.study-start label { font-size: 13px; color: var(--muted); }
.study-start .primary { justify-self: start; margin-top: 8px; }
.study-about { margin-top: 28px; color: var(--muted); font-size: 14px; max-width: 60ch; }
.study-about summary { cursor: pointer; color: var(--text); }
.study-progress { height: 4px; border-radius: 2px; background: #1a1f2c; overflow: hidden; margin-bottom: 18px; }
.study-progress i { display: block; height: 100%; background: #8fb0ff; }
.study-staff {
  display: flex;
  justify-content: center;
  min-height: 220px;
  margin: 12px auto 20px;
  max-width: 360px;
  padding: 12px;
  border-radius: 16px;
  background: var(--paper);
}
.study-staff svg text.lane-letter { font-family: var(--serif); font-weight: 600; fill: #1c2b52; }
.study-keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 520px; margin: 0 auto; }
.study-key {
  min-height: 60px;
  border: 1px solid #2f3546;
  background: #0e1220;
  color: var(--text);
  font-family: var(--serif);
  font-size: 24px;
  cursor: pointer;
  border-radius: 14px;
}
.study-key:hover:not(:disabled) { border-color: #8fb0ff; }
.study-key.right { background: #1f5e3a; border-color: #1f5e3a; }
.study-key.wrong { background: #7a1f1f; border-color: #7a1f1f; }
.study-feedback { text-align: center; min-height: 1.6em; font-size: 18px; color: #c9d6f5; }
.study-result { display: flex; gap: 12px; margin: 18px 0; }
.study-result div { flex: 1; padding: 18px; border-radius: 14px; border: 1px solid var(--navy-line, #1d3366); background: rgba(19, 36, 77, 0.35); }
.study-result span { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.study-result strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; }
.study-result small { color: var(--muted); }

.rep-acct-text { display: inline-flex; align-items: center; gap: 8px; }
.rep-acct-dot { flex: 0 0 auto; }
.rep-remove { color: var(--muted); }
.study-staff > div { display: flex; justify-content: center; align-items: center; width: 100%; }

/* ===================================================================
   Calm studio — header, menus, home, coach, phone
   =================================================================== */

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: var(--navy-line);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.credits-dialog .icon-btn,
.coach .icon-btn,
.lp-dialog .icon-btn {
  color: inherit;
}
.coach .icon-btn:hover,
.credits-dialog .icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.bar {
  min-height: 56px;
  height: 56px;
  padding: 0 24px;
  gap: 12px;
}
.top-search {
  max-width: 480px;
  margin: 0 auto;
}
body.is-studio .bookmark-btn { display: inline-flex !important; }
.bookmark-btn { display: none; }
.bookmark-btn .bookmark-filled { display: none; }
.bookmark-btn.in .bookmark-outline { display: none; }
.bookmark-btn.in .bookmark-filled { display: block; }
.bookmark-btn.in { color: #c9d6f5; }
.bookmark-btn.in::before { content: none; }
body.is-studio .top-search,
body.is-studio #btn-search { display: none; }
body.is-studio.studio-search-open .top-search { display: flex; }
body.is-studio .rep-btn-label { display: none; }
body.is-studio .rep-btn { min-width: 44px; justify-content: center; padding: 0 8px; }
body.is-studio .studio-seg {
  margin-left: auto;
  margin-right: 0;
}
.piece-tabs {
  max-width: min(36vw, 420px);
}
body.is-studio .piece-tabs:not([hidden]) { display: flex; }
body.is-home .bookmark-btn,
body.is-repertoire .bookmark-btn,
body.is-study .bookmark-btn { display: none; }

.lune-menu {
  position: fixed;
  z-index: 80;
  min-width: 180px;
  padding: 8px;
  margin: 0;
  background: var(--navy-abyss);
  border: 1px solid var(--navy-line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: var(--text);
}
.lune-menu.is-open {
  animation: lune-menu-in 160ms var(--ease);
}
@keyframes lune-menu-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.lune-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.lune-menu-item:hover,
.lune-menu-item:focus-visible {
  background: var(--navy-deep);
}
.lune-menu-item[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}
.lune-menu-check {
  width: 16px;
  flex: 0 0 16px;
  font-size: 12px;
}
.lune-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
}
.lune-menu-icon svg { width: 18px; height: 18px; }
.lune-menu-label { flex: 1 1 auto; min-width: 0; }
.lune-menu-hint {
  margin-left: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.lune-menu.is-paper {
  background: #fff;
  border-color: #d6dbe8;
  color: var(--ink);
}
.lune-menu.is-paper .lune-menu-item:hover,
.lune-menu.is-paper .lune-menu-item:focus-visible {
  background: #f1f4fb;
}
.lune-menu.is-paper .lune-menu-hint { color: #777; }

.home h1 {
  font-size: clamp(36px, 6vw, 56px);
  max-width: 16ch;
}
.home-chapter h2 {
  font-size: clamp(21px, 3vw, 26px);
}

/* Home: one compact search in the header — no second hero field. */
body.is-home .top-search {
  display: flex;
  flex: 0 1 280px;
  max-width: 280px;
  margin: 0;
  gap: 0;
}
body.is-home .top-search input {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 999px;
  background: #121212;
  border-color: #2a2a2a;
}
body.is-home .top-search input:focus {
  border-color: #555;
  background: #161616;
}
body.is-home .top-search .search-go {
  display: none;
}
body.is-home #btn-search { display: none; }
@media (max-width: 760px) {
  body.is-home #btn-search { display: inline-flex; }
  body.is-home .top-search { display: none; }
  body.is-home.phone-search-open .top-search { display: flex; max-width: none; flex: 1; }
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 420px;
  margin: 8px 0 16px;
}
.hero-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--navy-line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.hero-chip:hover {
  color: var(--text);
  background: var(--navy-deep);
}

.home-features {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 36px 24px;
  position: relative;
}
.home-features::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 1px;
  background: var(--line);
  opacity: 0.55;
}
.home-features-inner { max-width: 640px; }
.home-features h2 {
  margin: 0 0 12px;
  font-weight: 400;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.home-features-lead {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 42ch;
}
.home-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.home-feature-list li {
  display: grid;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid #1a1f2c;
}
.home-feature-list li:last-child { border-bottom: 1px solid #1a1f2c; }
.home-feature-list strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  color: var(--text);
}
.home-feature-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.home-features-keys {
  margin: 24px 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--dim);
}

.home-continue {
  max-width: 420px;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--navy-line);
  border-radius: 16px;
  background: rgba(5, 11, 28, 0.45);
}
.home-continue-k {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-continue-t {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 18px;
}
.home-continue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-today-mock {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}
.home-today-k {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-today-card {
  padding: 16px;
  border: 1px solid var(--navy-line);
  border-radius: 16px;
  background: rgba(19, 36, 77, 0.35);
}
.home-today-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 18px;
}
.home-today-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-today-bars span {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid #3a4a72;
  border-radius: 999px;
  color: #dfe7fb;
  font-size: 13px;
  line-height: 24px;
}

.score-tools-head {
  min-height: 48px;
  background: #0b0b0b;
  border-bottom: 1px solid #191919;
}
.lp-tools-bar { gap: 8px; }
.lp-tool {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.lp-tool:hover,
.lp-tool.on {
  color: var(--text);
  border-color: var(--navy-ink);
  background: var(--navy-deep);
}
.lp-chip {
  min-height: 44px;
  border-radius: 999px;
}
#tempo-control {
  display: inline-flex;
}
body.is-panel-score .studio-dock .tempo-control,
body.is-panel-piano .studio-dock .tempo-control {
  display: inline-flex;
}
@media (max-width: 720px) {
  .tempo-control {
    max-width: none;
    flex: 1 1 100%;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    margin-top: 4px;
  }
  .bpm-meter { display: none; }
  .piano-tut-meta { display: none; }
  .access-strip { margin-left: 4px; }
  .access-chip { min-height: 36px; padding: 0 9px; }
}
.transport-stop-icon { display: none; }
.coach-handle {
  display: none;
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: #d0d0d0;
}
.coach-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
}
.coach-diff {
  margin: 8px 0 0;
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #d6dbe8;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555;
}
.coach .hand-label {
  font-size: 10px !important;
  letter-spacing: 0.16em !important;
  color: #7a7a7a !important;
}
.coach-bar-block > h4 {
  margin: 18px 0 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a7a7a;
}
.coach-bar-block > h4:first-child {
  margin-top: 0;
}
.coach-advice {
  padding: 0 0 0 12px;
  border: none;
  border-left: 2px solid #13244d;
  border-radius: 0;
  background: transparent;
}
.coach-advice p {
  margin: 0;
  color: #1a1a1a;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
}
.coach-advice-more {
  margin-top: 10px;
}
.coach-more-btn,
.lp-banner-more {
  background: none;
  border: none;
  padding: 0;
  margin-top: 12px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #13244d;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid #b8c0d4;
  text-underline-offset: 0;
  min-height: 32px;
  border-radius: 0;
}
.coach-more-btn:hover,
.lp-banner-more:hover {
  border-bottom-color: #13244d;
}
.lp-note-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.lp-note-grow {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.lp-note-form textarea {
  margin-top: 0;
  min-height: 44px;
  max-height: 88px;
  padding: 12px 44px 12px 12px;
  border-radius: 12px;
  resize: none;
}
.lp-note-form .lp-mic {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
}
.lp-note-form .lp-mic span { display: none; }
.help-actions { align-items: center; }
.help-actions #btn-hear { flex: 1 1 auto; }
.lp-banner-text p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-banner.is-open .lp-banner-text p { display: block; overflow: visible; }
.lp-banner-hide {
  width: 44px;
  height: 44px;
}
.rep-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rep-today-head h2 { margin: 0; }
.rep-foot {
  gap: 8px;
  color: var(--dim);
}
.rep-foot .link-btn,
.rep-foot a {
  background: none;
  border: none;
  padding: 0;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.rep-foot .link-btn:hover,
.rep-foot a:hover { color: var(--text); }
.rep-account .link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 44px;
}
body.is-study .top-search,
body.is-study #btn-repertoire,
body.is-study #btn-search { display: none; }
.study-staff {
  width: 360px;
  height: 260px;
  max-width: 100%;
}

@media (max-width: 760px) {
  .bar {
    height: auto;
    min-height: 52px;
    padding: 4px 12px;
  }
  .brand-name { display: none; }
  body.is-studio .piece-tabs { display: none !important; }
  body.is-studio .studio-piece-quiet {
    display: block;
    flex: 1 1 auto;
    max-width: none;
  }
  body.is-studio .studio-seg {
    order: 20;
    width: 100%;
    margin: 0;
    height: 44px;
    justify-content: stretch;
  }
  body.is-studio .studio-tab {
    flex: 1;
    min-width: 0;
    min-height: 44px;
  }
  .coach-handle { display: block; }
  .transport-stop .stop-label { display: none; }
  .transport-stop-icon { display: block; }
  .lp-tool-label { display: none; }
  .help-actions #btn-hear { flex: 1 1 auto; }
  html, body, #app { overflow-x: hidden; max-width: 100%; }
}

@media (max-width: 360px) {
  .bar { padding: 4px 8px; gap: 4px; }
}

/* ===================================================================
   Welcome gate · onboarding · practice plans
   =================================================================== */
body.is-welcome header.bar,
body.is-onboard header.bar,
body.is-welcome .results,
body.is-onboard .results,
body.is-welcome #keep-account-banner,
body.is-onboard #keep-account-banner {
  display: none !important;
}
body.is-welcome,
body.is-onboard {
  overflow: auto;
}

.welcome, .onboard {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  background: #070707;
  color: var(--text);
}

/* —— Welcome hero (full first viewport) —— */
.welcome-hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 0 36px 72px;
  overflow: hidden;
  background: #080808;
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.72), inset 0 -60px 90px rgba(0, 0, 0, 0.5);
}
.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.62;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.78'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.welcome-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28%;
  height: 64px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='64' preserveAspectRatio='none'%3E%3Cg stroke='%23ffffff' stroke-width='1'%3E%3Cline x1='0' y1='8' x2='100%25' y2='8'/%3E%3Cline x1='0' y1='20' x2='100%25' y2='20'/%3E%3Cline x1='0' y1='32' x2='100%25' y2='32'/%3E%3Cline x1='0' y1='44' x2='100%25' y2='44'/%3E%3Cline x1='0' y1='56' x2='100%25' y2='56'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 64px;
  background-repeat: no-repeat;
}
.welcome-hero-motif {
  position: absolute;
  right: clamp(24px, 8vw, 96px);
  top: clamp(48px, 12vh, 120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: welcome-motif-in 1.4s ease 0.25s both;
}
.welcome-motif-mark {
  width: clamp(120px, 22vw, 220px);
  height: clamp(120px, 22vw, 220px);
  color: #ffffff;
  opacity: 0.07;
}
.welcome-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}
.welcome-lockup {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.6vw, 24px);
  margin: 0 0 36px;
  animation: welcome-rise 1.1s ease both;
}
.welcome-mark {
  width: clamp(56px, 9vw, 88px);
  height: clamp(56px, 9vw, 88px);
  margin-bottom: 0.12em;
  flex-shrink: 0;
  color: var(--text);
  opacity: 0.92;
}
.welcome-brand {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(96px, 20vw, 188px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.76;
  font-variation-settings: "SOFT" 50, "WONK" 0.6;
  position: relative;
}
.welcome-brand::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  margin-top: 16px;
  background: var(--text);
  opacity: 0.4;
  animation: welcome-brand-rule 1.2s ease 0.4s both;
}
.welcome-hero h1 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  max-width: 16ch;
  animation: welcome-rise 0.95s ease 0.1s both;
}
.welcome-lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.55;
  max-width: 42ch;
  animation: welcome-rise 0.95s ease 0.18s both;
}
.welcome-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  animation: welcome-rise 0.95s ease 0.26s both;
}
.welcome-fine {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--dim);
  animation: welcome-rise 0.95s ease 0.32s both;
}
.welcome-scroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: #8a8a8a;
  font-family: var(--serif);
  font-size: 14px;
  cursor: pointer;
  animation: welcome-rise 0.95s ease 0.4s both;
}
.welcome-scroll:hover { color: #d0d0d0; }
.welcome-scroll svg {
  animation: welcome-bounce 1.8s ease-in-out infinite;
}

/* —— Story chapters —— */
.welcome-story {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 28px 24px;
}
.welcome-story-head { max-width: 36ch; margin-bottom: 48px; }
.welcome-story-head h2 {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.15;
}
.welcome-story-lead {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.welcome-chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 36px 48px;
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid #1a1a1a;
}
.welcome-chapter-flip { direction: rtl; }
.welcome-chapter-flip > * { direction: ltr; }
.welcome-step {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6a6a6a;
}
.welcome-chapter-copy h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
}
.welcome-chapter-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 36ch;
}
.welcome-chapter-visual { margin: 0; }
.welcome-viz {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #1e1e1e;
}
.welcome-key-lit {
  animation: welcome-key-pulse 2.4s ease-in-out infinite;
}

.welcome-diff {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 28px 24px;
}
.welcome-diff h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
}
.welcome-diff-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 24px;
}
.welcome-diff-list li { display: grid; gap: 6px; max-width: 48ch; }
.welcome-diff-list strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.welcome-diff-list span { color: var(--muted); font-size: 15px; line-height: 1.5; }

.welcome-close {
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 28px 96px;
  text-align: left;
  border-top: 1px solid #1a1a1a;
}
.welcome-close-brand {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.welcome-close h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 500;
}
.welcome-close > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 40ch;
}

/* —— Onboard —— */
.onboard-stage {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 96px;
  animation: welcome-rise 0.55s ease both;
}
.onboard-stage h1 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  max-width: 16ch;
}
.onboard-help {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 42ch;
}
.onboard-stage .eyebrow { margin-bottom: 12px; }
.onboard-progress {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.onboard-progress li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5a5a5a;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.onboard-progress li span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #333;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
}
.onboard-progress li em {
  font-style: normal;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0;
}
.onboard-progress li.on { color: #f0f0f0; }
.onboard-progress li.on span {
  background: #f0f0f0;
  color: #0a0a0a;
  border-color: #f0f0f0;
}
.onboard-progress li.done { color: #9a9a9a; }
.onboard-progress li.done span {
  border-color: #666;
  color: #c8c8c8;
}
.onboard-intro {
  display: grid;
  gap: 0;
  margin: 8px 0 32px;
}
.onboard-intro article {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 14px;
  border-top: 1px solid #222;
  padding: 18px 0;
}
.onboard-intro-n {
  font-family: var(--serif);
  font-size: 14px;
  color: #6a6a6a;
  padding-top: 4px;
}
.onboard-intro h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  grid-column: 2;
}
.onboard-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  grid-column: 2;
}
.onboard-diff {
  color: var(--dim);
  font-size: 14px;
  margin: 18px 0 0;
  max-width: 46ch;
}
.onboard-chips, .onboard-grades {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 28px;
}
.onboard-chip, .onboard-grade {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #333;
  border-radius: 999px;
  background: transparent;
  color: #c8c8c8;
  font-family: var(--serif);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.onboard-grade { min-width: 48px; justify-content: center; }
.onboard-chip:hover, .onboard-grade:hover { border-color: #666; color: #f0f0f0; }
.onboard-chip.on, .onboard-grade.on {
  background: #f2f2f2;
  color: #0a0a0a;
  border-color: #f2f2f2;
}
.onboard-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.onboard-recs {
  list-style: none;
  margin: 20px 0 28px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.onboard-rec {
  width: 100%;
  text-align: left;
  border: 1px solid #2a2a2a;
  background: #101010;
  color: #f0f0f0;
  padding: 16px 18px;
  border-radius: 2px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.onboard-rec:hover { border-color: #555; background: #141414; }
.onboard-rec-featured {
  border-color: #4a4a4a;
  background: #161616;
  padding-top: 14px;
}
.onboard-rec-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 4px;
}
.onboard-rec strong { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.onboard-rec span { color: #8a8a8a; font-size: 13px; }
.home-rec-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.rep-plan-card {
  border: 1px solid #222;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #0e0e0e;
}
.rep-plan-top h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.rep-plan-summary {
  margin: 10px 0;
  color: #a8a8a8;
  font-size: 14px;
  line-height: 1.45;
}
.rep-plan-steps {
  margin: 0 0 14px;
  padding-left: 18px;
  color: #c8c8c8;
  font-size: 14px;
  display: grid;
  gap: 8px;
}
.rep-plan-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-to-plan { margin: 8px 0 16px; }

.piano-tut-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
}
.piano-tut-hands { display: inline-flex; gap: 6px; margin-left: auto; }
.piano-tut-legend {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0 4px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a6a6a;
}
.piano-tut-legend .tut-rh::before,
.piano-tut-legend .tut-lh::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 1px;
  vertical-align: middle;
}
.piano-tut-legend .tut-rh::before { background: #e8e8e8; }
.piano-tut-legend .tut-lh::before { background: #8a9bb8; }

body.needs-onboard .top-search { opacity: 0.45; pointer-events: none; }

.keep-account-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 20px;
  background: #0e0e0e;
  border-bottom: 1px solid #1e1e1e;
  color: #a8a8a8;
  font-size: 14px;
}
.keep-account-banner p { margin: 0; max-width: 52ch; line-height: 1.45; }
.keep-account-banner strong { color: #f0f0f0; font-weight: 500; }
.keep-account-banner .primary {
  font-weight: 500;
  min-height: 40px;
}

@keyframes welcome-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes welcome-motif-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes welcome-brand-rule {
  from { width: 0; }
  to { width: min(120px, 28vw); }
}
@keyframes welcome-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
@keyframes welcome-key-pulse {
  0%, 100% { fill: #d8d8d8; }
  50% { fill: #f5f5f5; }
}

@media (max-width: 820px) {
  .welcome-chapter,
  .welcome-chapter-flip {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 20px;
  }
}
@media (max-width: 720px) {
  .welcome-hero { padding: 0 20px 56px; }
  .welcome-story { padding: 48px 18px 16px; }
  .welcome-diff, .welcome-close { padding-left: 18px; padding-right: 18px; }
  .onboard-stage { padding: 36px 18px 72px; }
  .piano-tut-hands { margin-left: 0; width: 100%; }
  .keep-account-banner { padding: 12px 14px; }
  .onboard-progress li em { display: none; }
}

/* —— Landing: simulation · access chapters · tour tip —— */
.home-cta-hero { margin: 0 0 22px; gap: 12px; }
.home-fine-line {
  margin: 18px 0 0;
  font-size: 13px;
  color: #7a7a7a;
  letter-spacing: 0.02em;
}

.home-sim {
  padding: 96px 0 112px;
  border-top: 1px solid #1a1a1a;
  background: #050505;
  box-shadow: inset 0 40px 80px rgba(0, 0, 0, 0.45);
}
.home-sim-inner { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.home-sim-head { max-width: 36ch; margin: 0 auto 40px; text-align: center; }
.home-sim-head h2 {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  line-height: 1.1;
}
.home-sim-lead {
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 42ch;
}
.sim-stage {
  display: grid;
  gap: 28px;
}
.sim-viewport {
  border: 1px solid #1c1c1c;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.sim-frame {
  position: relative;
  min-height: min(52vh, 460px);
  background: #070707;
  overflow: hidden;
}
.sim-scene {
  position: absolute;
  inset: 0;
  padding: 28px;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.65s ease, transform 0.65s ease;
  pointer-events: none;
  display: flex;
  align-items: stretch;
}
.sim-scene.on {
  opacity: 1;
  transform: none;
}
.sim-scene-full { padding: 0; }
.sim-card {
  flex: 1;
  border: 1px solid #222;
  background: #0c0c0c;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sim-caption {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.sim-caption h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 500;
}
.sim-caption > p:not(.sim-kicker) {
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  max-width: 38ch;
}
.sim-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6a6a6a;
}
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.sim-dots {
  display: inline-flex;
  gap: 8px;
}
.sim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #3a3a3a;
  cursor: pointer;
}
.sim-dot.on { background: #f0f0f0; }
.sim-try {
  margin: 48px auto 0;
  padding-top: 36px;
  border-top: 1px solid #222;
  max-width: 40ch;
  text-align: center;
  animation: welcome-rise 0.55s ease both;
}
.sim-try h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}
.sim-try > p {
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}
.sim-try .home-cta-row {
  justify-content: center;
}

/* Simulation scene visuals */
.sim-ui-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.sim-pill {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid #333;
  border-radius: 999px;
  color: #8a8a8a;
  font-family: var(--serif);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}
.sim-pill.on {
  background: #f2f2f2;
  color: #0a0a0a;
  border-color: #f2f2f2;
}
.sim-staff {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.sim-staff-line {
  height: 1px;
  background: #333;
}
.sim-notes {
  display: flex;
  gap: 28px;
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 18px;
  color: #f0f0f0;
}
.sim-notes span {
  display: grid;
  gap: 6px;
  justify-items: center;
}
.sim-notes i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f0f0f0;
}
.sim-playhead {
  margin-top: 28px;
  height: 3px;
  background: #222;
  position: relative;
  overflow: hidden;
}
.sim-playhead em {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 34%;
  background: #f0f0f0;
  animation: sim-play 3.2s ease-in-out infinite;
}
/* Real piano board in the simulation */
.sim-piano {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #050505;
}
.sim-piano-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 8px;
  flex-shrink: 0;
}
.sim-piano-meta {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #666;
  font-family: var(--serif);
}
.sim-fall {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  margin: 0 12px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(100% / 14 - 1px),
      rgba(255, 255, 255, 0.03) calc(100% / 14 - 1px),
      rgba(255, 255, 255, 0.03) calc(100% / 14)
    );
}
.sim-fall b {
  --ww: calc(100% / 14);
  position: absolute;
  left: calc(var(--col) * var(--ww) + var(--ww) * 0.18);
  bottom: 0;
  width: calc(var(--ww) * 0.64);
  height: var(--h);
  border-radius: 4px 4px 1px 1px;
  transform: translateY(-140%);
  animation: fall-note 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
  animation-delay: var(--d);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
}
.sim-fall b.rh { background: #f2f2f2; }
.sim-fall b.lh { background: #8a9bb8; box-shadow: 0 0 16px rgba(138, 155, 184, 0.18); }
.sim-fall b.black-note {
  width: calc(var(--ww) * 0.42);
  left: calc(var(--col) * var(--ww));
}
.sim-fall-hit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(245, 245, 245, 0.55);
  box-shadow: 0 0 18px rgba(245, 245, 245, 0.28);
}
.sim-piano-board {
  position: relative;
  height: 118px;
  margin: 0 10px 12px;
  border-radius: 0 0 6px 6px;
  background: #111;
  box-shadow: inset 0 4px 0 #000, 0 10px 28px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.sim-piano-felt {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: #1a1a1a;
  border-bottom: 1px solid #0a0a0a;
  z-index: 3;
}
.sim-piano-whites {
  display: flex;
  height: 100%;
  position: relative;
  z-index: 1;
  padding: 6px 2px 0;
}
.sim-piano-whites .w {
  flex: 1 1 0;
  margin: 0 1px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, #fbfaf6 0%, #f0eee8 72%, #e4e1d8 100%);
  border: 1px solid #c9c6be;
  border-top: none;
  box-shadow:
    inset 0 -10px 0 #d8d5cc,
    inset 1px 0 0 rgba(255, 255, 255, 0.55);
}
.sim-piano-whites .w.on {
  background: linear-gradient(180deg, #e8e6e0 0%, #d4d1c8 100%);
  box-shadow: inset 0 -8px 0 #c4c1b8;
}
.sim-piano-blacks {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 6px;
  height: 62%;
  z-index: 2;
  pointer-events: none;
}
.sim-piano-blacks .bk {
  --ww: calc(100% / 14);
  position: absolute;
  left: calc((var(--n) + 1) * var(--ww) - var(--ww) * 0.32);
  width: calc(var(--ww) * 0.62);
  height: 100%;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(180deg, #2a2a2a 0%, #0a0a0a 55%, #050505 100%);
  border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 6px rgba(0, 0, 0, 0.45);
}
.sim-piano-blacks .bk.on {
  background: linear-gradient(180deg, #3a3a3a 0%, #161616 100%);
}
.sim-access-sample {
  margin: 36px 0 0;
  font-family: "Atkinson Hyperlegible", var(--serif), Georgia, serif;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: #f2f2f2;
}
.sim-ask {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  height: auto;
  align-content: stretch;
}
.sim-ask-score {
  border: 1px solid #2a2a2a;
  padding: 14px;
  position: relative;
}
.sim-ask-hilite {
  position: absolute;
  left: 28%;
  top: 22%;
  width: 22%;
  height: 48%;
  border: 1px solid #f0f0f0;
  background: rgba(255, 255, 255, 0.06);
}
.sim-ask-panel {
  border: 1px solid #2a2a2a;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.sim-ask-panel strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.sim-ask-panel span { color: #8a8a8a; font-size: 13px; }
.sim-access-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.sim-access-row .sim-pill.on { animation: tour-pulse 1.4s ease-in-out infinite; }
.sim-plan {
  border: 1px solid #2a2a2a;
  padding: 18px;
  margin-top: 20px;
}
.sim-plan strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}
.sim-plan span { color: #8a8a8a; font-size: 14px; line-height: 1.45; }

@keyframes sim-play {
  0% { width: 8%; }
  50% { width: 62%; }
  100% { width: 8%; }
}
@keyframes fall-note {
  0% { transform: translateY(-130%); opacity: 0.3; }
  70% { opacity: 1; }
  100% { transform: translateY(0); opacity: 0.95; }
}

.home-access-chapter .home-chapter-copy code {
  font-size: 0.92em;
  color: #d0d0d0;
}
.access-demo {
  border: 1px solid #222;
  background: #0c0c0c;
  min-height: 220px;
  padding: 28px 24px;
  display: grid;
  align-content: center;
  gap: 12px;
}
.access-demo-k {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6a6a6a;
}
.access-demo-sample {
  margin: 0;
  font-family: "Atkinson Hyperlegible", var(--serif), Georgia, serif;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: 0.04em;
  color: #f2f2f2;
}
.access-demo-chip {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #444;
  color: #f0f0f0;
  font-family: var(--serif);
  font-size: 15px;
}
.access-demo-note {
  margin: 0;
  color: #8a8a8a;
  font-size: 14px;
  line-height: 1.45;
  max-width: 28ch;
}

.lune-tour {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  padding: 20px 20px 16px;
  background: #111;
  border: 1px solid #333;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  color: #f0f0f0;
}
.lune-tour-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a7a7a;
}
.lune-tour h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.lune-tour p {
  margin: 0 0 16px;
  color: #b0b0b0;
  font-size: 14px;
  line-height: 1.5;
}
.lune-tour-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.lune-tour-nav #lune-tour-skip { margin-right: auto; }
.tour-pulse {
  animation: tour-pulse 1.2s ease-in-out infinite;
  outline: 1px solid #f0f0f0 !important;
}
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 245, 245, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(245, 245, 245, 0); }
}

@media (max-width: 720px) {
  .home-sim { padding: 64px 0 80px; }
  .home-sim-inner { padding: 0 16px; }
  .sim-frame { min-height: 320px; }
  .sim-piano-board { height: 96px; }
  .sim-ask { grid-template-columns: 1fr; }
  .lune-tour { right: 12px; bottom: 12px; }
}
