/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f1ea;
  --bg-mesh-1: #ffd6a5;
  --bg-mesh-2: #bdb2ff;
  --bg-mesh-3: #ffadad;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-solid: rgba(255, 255, 255, 0.86);
  --ink: #201c2e;
  --ink-soft: #4c465e;
  --ink-mute: #6f6880;
  --accent: #ff6a5b;
  --accent-rgb: 255, 106, 91;
  --accent-ink: #ffffff;
  --accent-2: #6a5cff;
  --line: rgba(32, 28, 46, 0.1);
  --shadow-color: 32, 28, 46;
  --serif: "Plus Jakarta Sans", "Inter", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1420;
  --bg-mesh-1: #4f9dff;
  --bg-mesh-2: #7dd3fc;
  --bg-mesh-3: #16283f;
  --surface: #16202f;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-solid: rgba(22, 32, 47, 0.92);
  --ink: #eef3fa;
  --ink-soft: #c2cee0;
  --ink-mute: #8b9bb5;
  --accent: #4f9dff;
  --accent-rgb: 79, 157, 255;
  --accent-ink: #071019;
  --accent-2: #7dd3fc;
  --line: rgba(238, 243, 250, 0.12);
  --shadow-color: 0, 0, 0;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420;
    --bg-mesh-1: #4f9dff;
    --bg-mesh-2: #7dd3fc;
    --bg-mesh-3: #16283f;
    --surface: #16202f;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-solid: rgba(22, 32, 47, 0.92);
    --ink: #eef3fa;
    --ink-soft: #c2cee0;
    --ink-mute: #8b9bb5;
    --accent: #4f9dff;
    --accent-rgb: 79, 157, 255;
    --accent-ink: #071019;
    --accent-2: #7dd3fc;
    --line: rgba(238, 243, 250, 0.12);
    --shadow-color: 0, 0, 0;
    color-scheme: dark;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
/* The [hidden] attribute and a class's own "display: flex/grid" rule have
   equal CSS specificity, so whichever is declared later in the stylesheet
   wins — meaning an element can end up "hidden" yet still visibly laid
   out. Force hidden to always mean hidden, full stop. */
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  transition: background-color 0.5s var(--ease-out), color 0.5s var(--ease-out);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; font-family: var(--serif); font-weight: 700; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 720px)  { .container { padding-inline: 2rem; } }
@media (min-width: 1280px) { .container { padding-inline: 2.5rem; } }

/* =============================================================
   3. Typography helpers
   ============================================================= */
.kicker, .section-kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.9rem;
  display: inline-block;
}
.section-kicker--onimg { color: #ffd9c9; }

.section-title {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  max-width: 20ch;
}
.section-title--onimg { color: #fff; max-width: 16ch; }
.section-sub {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: 1rem;
}

/* =============================================================
   4. Components — buttons, chips, glass
   ============================================================= */
.glass {
  background: var(--glass-solid);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 20px 50px -25px rgba(var(--shadow-color), 0.35);
}
@supports (backdrop-filter: blur(20px)) {
  .glass {
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background-color .3s, border-color .3s, color .3s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(var(--accent-rgb), 0.55);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -14px rgba(var(--accent-rgb), 0.6); }

.btn-outline {
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.86rem; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.02rem; }

.btn-chip {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform .3s var(--ease-soft), border-color .3s, color .3s;
}
.btn-chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.btn-chip-ghost { background: transparent; }

.btn-tap {
  padding: 1rem 1.6rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 14px 30px -14px rgba(var(--accent-rgb), 0.6);
  transition: transform .12s var(--ease-out);
}
.btn-tap:active { transform: scale(0.94); }

/* magnetic wrapper (added by JS) */
.has-magnetic { display: inline-flex; position: relative; isolation: isolate; }
.magnetic-inner { display: inline-flex; align-items: center; justify-content: center; gap: inherit; will-change: transform; transition: transform .8s var(--ease-soft); }

.chord-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; height: 2.4rem; padding-inline: 0.5rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
}

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 200;
  transition: background-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--glass-solid);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 40px -20px rgba(var(--shadow-color), 0.4);
}
@supports (backdrop-filter: blur(20px)) {
  .nav.is-scrolled { background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
  color: var(--ink);
  white-space: nowrap; flex-shrink: 0;
}
.nav-logo em { color: var(--accent); font-style: normal; }
.nav-logo-mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 1rem;
}
.nav-links { display: none; align-items: center; gap: 1.5rem; }
.nav-link {
  position: relative; padding: 0.3rem 0;
  font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
  white-space: nowrap;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-dropdown { position: relative; }
.nav-dropdown::after {
  /* invisible bridge over the gap so hover doesn't drop while crossing it */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 0.6rem;
}
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 50%; margin-top: 0.6rem;
  min-width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 24px 50px -20px rgba(var(--shadow-color), 0.45);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
@supports (backdrop-filter: blur(20px)) {
  .nav-dropdown-menu { backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; pointer-events: auto; transform: translate(-50%, 0);
}
.nav-dropdown-menu a {
  display: block; padding: 0.6rem 0.8rem; border-radius: 9px;
  font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--surface); color: var(--ink); }

.nav-actions { display: none; align-items: center; gap: 0.9rem; }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: border-color .3s, color .3s, transform .3s var(--ease-soft);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

.nav-burger {
  display: inline-grid; place-items: center; gap: 4px;
  width: 40px; height: 40px;
}
.nav-burger span { display: block; width: 20px; height: 1.6px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .3s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 72px 0 0 0; z-index: 190;
  background: var(--bg);
  padding: 1.6rem 1.5rem 2.5rem;
  display: grid; gap: 1.05rem; align-content: start;
  overflow-y: auto;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .55s var(--ease-soft);
}
.nav-mobile[data-open="true"] { clip-path: inset(0); }
.nav-mobile a { font-size: 1.2rem; font-weight: 600; font-family: var(--serif); }
.nav-mobile-group { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); margin-top: 0.4rem; }
.nav-mobile-sub { padding-left: 1rem; font-size: 1.02rem !important; color: var(--ink-soft); }
.nav-mobile-actions { display: grid; gap: 0.8rem; margin-top: 0.6rem; }
.nav-mobile-actions .btn { width: 100%; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-actions { display: flex; }
  .nav-burger { display: none; }
}

/* =============================================================
   6. Sections — Hero
   ============================================================= */
.hero {
  position: relative;
  padding-block: 8.5rem 5rem;
  overflow: clip;
  isolation: isolate;
}
.hero-mesh {
  position: absolute; inset: -10%; z-index: -1;
  background:
    radial-gradient(at 18% 25%, var(--bg-mesh-1) 0%, transparent 52%),
    radial-gradient(at 82% 20%, var(--bg-mesh-2) 0%, transparent 52%),
    radial-gradient(at 50% 92%, var(--bg-mesh-3) 0%, transparent 55%);
  filter: blur(70px) saturate(150%);
  opacity: .55;
  animation: meshDrift 26s ease-in-out infinite;
}
.hero-mesh--soft { opacity: .3; }
@keyframes meshDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.18) rotate(8deg); }
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero-copy { max-width: 640px; }
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.3rem);
  max-width: 15ch;
}
.hero-title em { color: var(--accent); font-style: italic; }
.hero-sub {
  font-size: 1.14rem; color: var(--ink-soft);
  margin-top: 1.4rem; max-width: 50ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.8rem; }
.hero-links a { font-size: 0.88rem; color: var(--ink-mute); font-weight: 500; position: relative; padding-bottom: 2px; }
.hero-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-out);
}
.hero-links a:hover { color: var(--accent); }
.hero-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.hero-visual { position: relative; justify-self: center; width: 100%; max-width: 420px; }
.hero-photo {
  border-radius: 28px; overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(var(--shadow-color), 0.45);
  aspect-ratio: 4/5;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-float-card {
  position: absolute; left: -1.2rem; bottom: -1.4rem;
  padding: 1.1rem 1.3rem;
  border-radius: 18px;
  animation: floatY 5s ease-in-out infinite;
  min-width: 200px;
}
.hero-float-row { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.hero-float-label { font-size: 0.78rem; color: var(--ink-mute); font-weight: 500; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.hero-stats {
  margin-top: 5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem 1rem;
}
.stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.15rem; }
.stat-num { font-family: var(--serif); font-size: 2.1rem; font-weight: 800; color: var(--ink); }
.stat-suffix { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stat-label { flex-basis: 100%; font-size: 0.85rem; color: var(--ink-mute); }

@media (min-width: 720px) {
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
  .hero-copy { max-width: none; }
}

/* =============================================================
   7. Sections — generic + Features
   ============================================================= */
.section { position: relative; padding-block: 6.5rem; }
.section-editor, .section-cta { overflow: clip; isolation: isolate; }

.feature-grid {
  margin-top: 3rem;
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

.card { padding: 1.9rem; transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft); }
.feature-card h3 { font-size: 1.08rem; margin-bottom: 0.6rem; }
.feature-card p { color: var(--ink-soft); font-size: 0.92rem; }
.feature-icon {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 1.2rem; margin-bottom: 1rem;
}

.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.has-tilt:hover { transition-duration: .15s; box-shadow: 0 34px 70px -24px rgba(var(--shadow-color), 0.5); }

/* =============================================================
   8. Editor demo
   ============================================================= */
.section-sub { text-align: left; }
.editor-mockup { margin-top: 3rem; padding: 1.6rem; }
@media (min-width: 720px) { .editor-mockup { padding: 2.4rem; } }

.editor-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; flex-wrap: wrap; gap: 0.6rem; }
.editor-tabs { display: flex; gap: 1.5rem; }
.editor-tab { font-size: 0.88rem; font-weight: 600; color: var(--ink-mute); padding-bottom: 0.4rem; border-bottom: 2px solid transparent; }
.editor-tab.is-active { color: var(--ink); border-color: var(--accent); }
.editor-save { font-size: 0.78rem; color: var(--ink-mute); font-family: var(--mono); }

.song-info-card {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 1.6rem;
}
@media (min-width: 720px) { .song-info-card { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .song-info-card { grid-template-columns: repeat(6, 1fr); } }
.song-info-field label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 0.3rem; font-weight: 600; }
.song-info-field span { font-weight: 600; font-size: 0.92rem; }
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14); color: var(--accent);
  font-size: 0.78rem !important; font-weight: 600 !important;
}

.section-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.tag {
  padding: 0.35rem 0.8rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-mute);
}
.tag.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.lyric-sheet {
  padding: 1.6rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 1.8rem;
  overflow-x: auto;
}
.lyric-line { display: flex; flex-wrap: wrap; margin-bottom: 0.9rem; }
.lyric-line:last-child { margin-bottom: 0; }
.chord-word { display: inline-flex; flex-direction: column; margin-right: 0.55em; white-space: nowrap; }
.lyric-sheet { --lyric-scale: 1; }
.chord {
  font-family: var(--mono); font-weight: 700; font-size: calc(0.82rem * var(--lyric-scale, 1));
  color: var(--accent); height: 1.3em;
  transition: color .3s;
}
.word { font-size: calc(1.05rem * var(--lyric-scale, 1)); font-weight: 500; }

.editor-panels { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .editor-panels { grid-template-columns: repeat(3, 1fr); } }
.editor-panel {
  padding: 1.4rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.editor-panel h4 { font-size: 0.92rem; margin-bottom: 1rem; }

.transpose-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.key-select-row { margin-bottom: 1rem; }
.key-select-row label { display: block; font-size: 0.76rem; color: var(--ink-mute); margin-bottom: 0.4rem; font-weight: 600; }
.key-select-row select {
  width: 100%; padding: 0.65rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 0.9rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.1rem; min-height: 2.4rem; }
.chip-row .chord-chip { transition: opacity .3s, transform .3s var(--ease-soft); }
.chip-row .chord-chip.is-dim { opacity: 0.32; }
.chip-row .chord-chip.is-active-chip { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.toggle-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; color: var(--ink-soft); cursor: pointer; }
.toggle-row--sm { font-size: 0.76rem; margin-top: 0.6rem; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  position: relative; width: 38px; height: 22px; border-radius: 999px;
  background: var(--line); flex-shrink: 0; transition: background .3s;
}
.toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform .3s var(--ease-soft);
}
.toggle-row input:checked + .toggle-track { background: var(--accent); }
.toggle-row input:checked + .toggle-track::after { transform: translateX(16px); }

.bpm-demo { display: grid; gap: 0.9rem; justify-items: start; }
.bpm-readout { display: flex; align-items: baseline; gap: 0.4rem; }
.bpm-readout span:first-child { font-family: var(--serif); font-size: 2.4rem; font-weight: 800; }
.bpm-unit { font-size: 0.8rem; color: var(--ink-mute); font-weight: 600; }

/* =============================================================
   9. Marketplace
   ============================================================= */
.marketplace-banner { position: relative; height: 46vh; min-height: 320px; max-height: 460px; overflow: hidden; }
.marketplace-banner img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.05); }
.marketplace-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,8,16,0.35), rgba(10,8,16,0.75));
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 2rem;
}
.marketplace-grid {
  margin-top: -4.5rem;
  position: relative; z-index: 2;
  display: grid; gap: 1.2rem; grid-template-columns: 1fr;
}
@media (min-width: 720px) { .marketplace-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .marketplace-grid { grid-template-columns: repeat(4, 1fr); } }
.marketplace-card { display: flex; flex-direction: column; }
.marketplace-icon {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 1.2rem; margin-bottom: 0.9rem;
}
.marketplace-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.marketplace-card p { color: var(--ink-soft); font-size: 0.9rem; flex-grow: 1; }
.marketplace-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.marketplace-count { font-size: 0.78rem; color: var(--ink-mute); font-weight: 600; }
.marketplace-link { font-size: 0.86rem; font-weight: 700; color: var(--accent); }

/* =============================================================
   10. Challenges
   ============================================================= */
.challenge-grid { margin-top: 3rem; display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .challenge-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .challenge-grid { grid-template-columns: repeat(4, 1fr); } }
.challenge-card h3 { font-size: 1rem; margin: 0.7rem 0 0.5rem; }
.challenge-card p { color: var(--ink-soft); font-size: 0.88rem; }
.challenge-xp {
  display: inline-block; padding: 0.25rem 0.65rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  font-size: 0.74rem; font-weight: 700; font-family: var(--mono);
}

/* =============================================================
   11. Community
   ============================================================= */
.community-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .community-grid { grid-template-columns: 0.85fr 1.15fr; } }

.community-photos { position: relative; height: 420px; }
.community-photo { position: absolute; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(var(--shadow-color), 0.4); }
.community-photo img { width: 100%; height: 100%; object-fit: cover; }
.community-photo--a { width: 68%; height: 78%; left: 0; top: 0; }
.community-photo--b { width: 55%; height: 55%; right: 0; bottom: 0; border: 4px solid var(--bg); }

.testimonial-list { margin-top: 2.2rem; display: grid; gap: 1rem; }
.testimonial { padding: 1.6rem; }
.testimonial p { font-size: 1rem; color: var(--ink-soft); font-style: italic; }
.testimonial footer { margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-mute); font-style: normal; }
.testimonial footer strong { color: var(--ink); }

/* =============================================================
   12. Pricing
   ============================================================= */
.pricing-grid { margin-top: 3rem; display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: end; } }
.pricing-card { position: relative; padding: 2rem; }
.pricing-card--featured { border-color: var(--accent); transform: scale(1.02); }
.pricing-badge {
  position: absolute; top: -0.9rem; left: 2rem;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  font-size: 0.72rem; font-weight: 700;
}
.pricing-card h3 { font-size: 1.1rem; }
.pricing-price { font-family: var(--serif); font-size: 2.4rem; font-weight: 800; margin: 0.6rem 0 1.4rem; }
.pricing-price span { font-size: 1rem; font-weight: 500; color: var(--ink-mute); }
.pricing-features { display: grid; gap: 0.6rem; margin-bottom: 1.6rem; }
.pricing-features li { font-size: 0.9rem; color: var(--ink-soft); padding-left: 1.4rem; position: relative; }
.pricing-features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pricing-card .btn { width: 100%; }

/* =============================================================
   13. FAQ
   ============================================================= */
.faq-list { margin-top: 2.5rem; display: grid; gap: 0.8rem; max-width: 780px; }
.faq-item {
  padding: 1.2rem 1.4rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 0.98rem;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); transition: transform .3s var(--ease-soft); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.9rem; color: var(--ink-soft); font-size: 0.92rem; }

/* =============================================================
   14. CTA / footer
   ============================================================= */
.cta-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.section-cta .section-sub { text-align: center; }
.cta-form {
  margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.8rem;
  padding: 0.7rem; width: 100%; max-width: 480px;
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-soft);
}
.cta-form.is-sent { opacity: 0; transform: translateY(-12px); pointer-events: none; position: absolute; }
.field { position: relative; flex: 1 1 220px; }
.field input {
  width: 100%; padding: 1rem 1rem 0.4rem; border-radius: 14px;
  border: 1px solid transparent; background: var(--surface); color: inherit;
  font: inherit; font-size: 0.95rem;
}
.field label {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  pointer-events: none; transition: all .25s var(--ease-out);
  color: var(--ink-mute); font-size: 0.92rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label {
  top: 0.5rem; transform: none; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.cta-submit { position: relative; flex-shrink: 0; }
.cta-form-spinner { position: absolute; inset: 0; display: none; place-items: center; }
.cta-form.is-sending .cta-form-label { opacity: 0; }
.cta-form.is-sending .cta-form-spinner { display: grid; }
.cta-form-spinner::after {
  content: ""; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta-success {
  margin-top: 2.2rem; opacity: 0; transform: translateY(10px); height: 0; overflow: hidden;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-soft);
}
.cta-success.is-visible { opacity: 1; transform: none; height: auto; }
.cta-success p { color: var(--ink-soft); margin-top: 0.4rem; }

.footer { padding-block: 4.5rem 2.5rem; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand p { margin-top: 1rem; color: var(--ink-mute); font-size: 0.9rem; max-width: 34ch; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); margin-bottom: 1rem; }
.footer-col { display: grid; gap: 0.65rem; }
.footer-col a { font-size: 0.9rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 3.5rem; padding-top: 1.8rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: space-between;
  font-size: 0.82rem; color: var(--ink-mute);
}
.footer-credits a { color: var(--ink-mute); text-decoration: underline; }

/* =============================================================
   15. Effects — splash, scroll progress, reveal
   ============================================================= */
.splash {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .8s, clip-path 1s;
  animation: splashSafety .01s 3.2s forwards;
}
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-mark { font-family: var(--serif); font-weight: 800; font-size: 1.6rem; letter-spacing: 0.05em; }
.splash-line {
  display: block; width: 60px; height: 2px; margin-top: 1rem; border-radius: 2px; overflow: hidden;
  background: var(--line); position: relative;
}
.splash-line::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: splashBar 1.1s var(--ease-out) infinite;
}
@keyframes splashBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 250; background: transparent; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: 0 0; transform: scaleX(0); transition: transform .08s linear;
}

[data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft); }
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   16. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-mesh { animation: none; }
  .hero-float-card { animation: none; }
  .splash-line::after { animation: none; }
}

/* =============================================================
   17. App shell (editor.html, listing pages)
   ============================================================= */
.app-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-solid); border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(20px)) {
  .app-bar { background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
}
.app-main { padding: 2.5rem 1.25rem 6rem; }
@media (min-width: 720px) { .app-main { padding: 3.5rem 2rem 6rem; } }
.app-back { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; font-weight: 600; color: var(--ink-mute); margin-bottom: 1rem; }
.app-back:hover { color: var(--accent); }
.app-shell { max-width: 1100px; margin-inline: auto; }
.app-shell.app-shell--wide { max-width: 1240px; }
.app-title { margin-bottom: 1.6rem; max-width: 70ch; }
.app-title p.kicker { margin-bottom: 0.5rem; }

.page-banner { position: relative; height: 34vh; min-height: 240px; max-height: 360px; overflow: hidden; border-radius: 24px; margin-bottom: -3rem; }
.page-banner img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.05); }
.page-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,8,16,0.25), rgba(10,8,16,0.7));
  display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem;
}
.page-banner-mesh { position: relative; height: 26vh; min-height: 190px; border-radius: 24px; overflow: clip; margin-bottom: -3rem; display: flex; align-items: flex-end; padding: 2rem; isolation: isolate; }

.free-note {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(106, 200, 130, 0.14);
  color: #2f9e56;
  font-size: 0.82rem; font-weight: 600;
}
:root[data-theme="dark"] .free-note { background: rgba(106, 200, 130, 0.16); color: #7bdb9a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .free-note { background: rgba(106, 200, 130, 0.16); color: #7bdb9a; } }
.free-note::before { content: "✓"; font-weight: 800; }

/* =============================================================
   18. Filter bar + listing / profile cards
   ============================================================= */
.filter-bar {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  padding: 1.4rem; margin-top: 3rem; margin-bottom: 2.4rem;
}
.filter-bar input[type="search"], .filter-bar select {
  padding: 0.75rem 1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: inherit;
  font: inherit; font-size: 0.9rem;
}
.filter-bar input[type="search"] { flex: 1 1 240px; }
.filter-bar select { flex: 1 1 160px; }
.filter-count { align-self: center; font-size: 0.8rem; color: var(--ink-mute); white-space: nowrap; padding-inline: 0.3rem; }

.profile-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .profile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .profile-grid { grid-template-columns: repeat(3, 1fr); } }

.profile-card { display: flex; flex-direction: column; gap: 0.9rem; transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft), opacity .3s, transform .3s; }
.profile-avatar {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-family: var(--serif); font-size: 1.05rem;
}
.profile-head { display: flex; align-items: center; gap: 0.9rem; }
.profile-name { font-size: 1.02rem; font-weight: 700; }
.profile-role { font-size: 0.82rem; color: var(--ink-mute); }
.profile-meta { font-size: 0.84rem; color: var(--ink-soft); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.profile-tags span {
  padding: 0.25rem 0.6rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.72rem; font-weight: 600; color: var(--ink-soft);
}
.profile-rating { display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--ink-mute); }
.profile-rating strong { color: var(--ink); }
.profile-rating .stars { color: var(--accent); letter-spacing: 1px; }
.profile-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 0.9rem; border-top: 1px solid var(--line); gap: 0.6rem; }
.profile-price { font-weight: 700; font-size: 0.9rem; }

.filter-empty { text-align: center; padding: 3.5rem 1rem; color: var(--ink-mute); display: grid; gap: 0.4rem; }
.filter-empty[hidden] { display: none; }
.filter-empty strong { color: var(--ink); font-size: 1.05rem; }

/* =============================================================
   19. Song library rows (comunidad.html)
   ============================================================= */
.song-row-list { display: grid; gap: 0.7rem; margin-top: 2rem; }
.song-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem;
}
.song-row-title { font-weight: 700; font-size: 0.98rem; }
.song-row-meta { font-size: 0.82rem; color: var(--ink-mute); margin-top: 0.2rem; }
.song-row-stats { display: flex; align-items: center; gap: 1.1rem; font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; }
.song-row-stats .stars { color: var(--accent); }

.my-songs-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem;
}
.my-songs-head .section-title { margin-bottom: 0; }
.my-songs-head .btn { flex-shrink: 0; }
.my-songs-head-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; flex-shrink: 0; }
.folder-meta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 0.9rem; }
.folder-meta-date { font-size: 0.82rem; color: var(--ink-mute); }
.btn-chip-danger { color: #e5484d; border-color: rgba(229, 72, 77, 0.4); }
.btn-chip-danger:hover { color: #e5484d; border-color: #e5484d; }

.badge-privada { background: rgba(var(--accent-rgb), 0.14); color: var(--accent); }
.badge-publica { background: rgba(47, 158, 86, 0.14); color: #2f9e56; }
.badge-borrador { background: rgba(148, 141, 176, 0.18); color: var(--ink-mute); }
:root[data-theme="dark"] .badge-publica { background: rgba(123, 219, 154, 0.16); color: #7bdb9a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-publica { background: rgba(123, 219, 154, 0.16); color: #7bdb9a; } }

@media (max-width: 539px) {
  .song-row { grid-template-columns: 1fr; }
  .song-row-stats { justify-content: space-between; margin-top: 0.6rem; }
}

.my-song-row--clickable { cursor: pointer; transition: border-color .2s, transform .2s var(--ease-out); }
.my-song-row--clickable:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---- project folders (mis-canciones.html) ---- */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem; margin-top: 2rem; margin-bottom: 2.4rem;
}
.project-card {
  display: flex; align-items: flex-start; gap: 0.9rem; padding: 1.2rem 1.3rem;
  cursor: pointer; transition: border-color .2s, transform .2s var(--ease-out);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card-icon {
  flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--ink);
}
.project-card-icon svg { width: 26px; height: 26px; }
.project-card-body { min-width: 0; flex: 1; }
.project-card-name { font-weight: 700; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-count { font-size: 0.8rem; color: var(--ink-mute); margin-top: 0.2rem; }
.project-card-date { font-size: 0.76rem; color: var(--ink-mute); margin-top: 0.1rem; opacity: 0.8; }
.project-card-actions { display: flex; flex-direction: column; gap: 0.35rem; flex-shrink: 0; }
.my-song-row--clickable .song-row-stats a, .my-song-row--clickable .song-row-stats button { cursor: pointer; }

/* ---- song folder tag (shown when a search spans every folder) ---- */
.song-row-folder-tag {
  display: none; align-items: center; gap: 0.35rem; margin-top: 0.35rem;
  font-size: 0.74rem; font-weight: 600; color: var(--ink-mute);
}
.song-row-folder-tag:not([hidden]) { display: inline-flex; }
.song-row-folder-tag svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---- song options menu (mis-canciones.html) ---- */
/* .glass uses backdrop-filter, which creates its own stacking context per
   row — without this, an open dropdown gets painted behind the next row. */
.my-song-row { position: relative; }
.my-song-row:has(.song-menu:not([hidden])) { z-index: 20; }
.song-menu-wrap { position: relative; }
.song-menu {
  position: absolute; top: calc(100% + 0.4rem); right: 0; z-index: 5;
  min-width: 210px; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.45rem; box-shadow: 0 24px 50px -20px rgba(var(--shadow-color), 0.45);
  display: grid; gap: 0.15rem;
}
@supports (backdrop-filter: blur(20px)) {
  .song-menu { backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
}
.song-menu-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-mute); padding: 0.4rem 0.6rem 0.2rem;
}
.song-menu-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 0.5rem 0.6rem; border-radius: 9px; border: none; background: none;
  font: inherit; font-size: 0.86rem; font-weight: 500; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-menu-item:hover { background: var(--bg); color: var(--ink); }
.song-menu-item.is-current { color: var(--accent); font-weight: 700; }
.song-menu-item--danger { color: #e5484d; }
.song-menu-item--danger:hover { background: rgba(229, 72, 77, 0.12); color: #e5484d; }
.song-menu-divider { border: none; border-top: 1px solid var(--line); margin: 0.3rem 0.2rem; }
.song-menu-toast {
  position: absolute; top: calc(100% + 0.4rem); right: 0; z-index: 6;
  background: var(--ink); color: var(--bg); font-size: 0.78rem; font-weight: 600;
  padding: 0.45rem 0.8rem; border-radius: 999px; white-space: nowrap;
  animation: song-toast-fade 1.6s ease forwards;
}
@keyframes song-toast-fade {
  0% { opacity: 0; transform: translateY(-3px); }
  12%, 78% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-3px); }
}

/* =============================================================
   20. Song composer (editor.html — write & add chords freely)
   ============================================================= */
.song-header { margin-top: 0.8rem; display: grid; gap: 0.6rem; }
.song-title-input {
  font-family: var(--serif); font-weight: 800; font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  color: var(--ink); background: none; border: none; padding: 0.2rem 0; width: 100%;
}
.song-title-input::placeholder { color: var(--ink-mute); opacity: 0.6; }
.song-artist-input {
  font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600; color: var(--ink-soft);
  background: none; border: none; padding: 0.1rem 0; width: 100%;
}
.song-artist-input::placeholder { color: var(--ink-mute); opacity: 0.6; }
.song-title-input:focus, .song-artist-input:focus { outline: none; }
.song-title-input:focus-visible, .song-artist-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

.artist-field { position: relative; }
.artist-search-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 120;
  width: min(360px, 100%); max-height: 280px; overflow-y: auto;
  padding: 0.5rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(var(--shadow-color), 0.5);
}
.artist-search-panel[hidden] { display: none; }
.artist-search-option {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.55rem 0.7rem; border-radius: 10px; text-align: left;
  font-size: 0.86rem; font-weight: 600; color: var(--ink);
}
.artist-search-option:hover, .artist-search-option.is-focused { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.artist-search-option--self { color: var(--accent); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: 0.3rem; padding-bottom: 0.75rem; }
.artist-search-empty { padding: 0.6rem 0.7rem; font-size: 0.8rem; color: var(--ink-mute); }


/* ---- meta info row (tonalidad/bpm/compás/capo) — plain text chips,
   single line, no native dropdowns; click opens a custom popup. ---- */
.meta-info-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; }
.meta-info-chip { display: grid; gap: 0.3rem; text-align: left; }
.meta-info-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-mute); font-weight: 700;
}
.meta-info-value { font-size: 0.92rem; font-weight: 700; color: var(--accent); white-space: nowrap; transition: opacity .2s; }
.meta-info-chip:hover .meta-info-value { opacity: 0.8; }

.toolbar-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); }

.btn-chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.control-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap;
}
.control-chip button { color: var(--ink-mute); font-size: 0.7rem; }
.control-chip button:hover { color: var(--accent); }
.control-chip--speed span { min-width: 2.6em; text-align: center; font-family: var(--mono); color: var(--ink); }

.speed-control { display: flex; align-items: center; gap: 0.6rem; }
.speed-control button {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--ink-soft); font-size: 1rem; font-weight: 700;
}
.speed-control button:hover { color: var(--accent); border-color: var(--accent); }
.speed-control input[type="range"] {
  flex: 1; min-width: 0; accent-color: var(--accent); height: 4px;
}
.speed-control span {
  flex-shrink: 0; min-width: 2.8em; text-align: right;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700; color: var(--ink);
}

.instrument-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.instrument-toggle button {
  padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--ink-mute);
}
.instrument-toggle button.is-active { background: var(--ink); color: var(--bg); }
.instrument-toggle--sm button { padding: 0.3rem 0.6rem; font-size: 0.72rem; }
.instrument-toggle--block {
  display: flex; flex-direction: column; width: 100%;
  border-radius: 16px; padding: 4px; gap: 4px;
}
.instrument-toggle--block button { padding: 0.7rem 1rem; border-radius: 12px; font-size: 0.85rem; }

.icon-btn-sm {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  color: var(--ink-mute); font-size: 0.8rem;
  transition: color .2s, background .2s;
}
.icon-btn-sm:hover { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.icon-btn-sm--danger svg { width: 15px; height: 15px; }
.icon-btn-sm--danger:hover { color: #e5484d; background: rgba(229, 72, 77, 0.12); }

/* ---- meta row (tonalidad/bpm/cejilla/compás) + share/print actions,
   side by side on the same line, unboxed to match the page design ---- */
.meta-actions-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.9rem 1.4rem; margin-top: 0.6rem;
}
.meta-info-row, .recorder-share-group { flex-shrink: 0; }
.recorder-share-group { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.song-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; }
.share-group { display: grid; gap: 0.3rem; }
.share-icons-row { display: flex; align-items: center; gap: 0.7rem; }
.action-feedback { font-size: 0.78rem; font-weight: 700; color: #2f9e56; min-width: 1px; }

.icon-circle-btn {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: border-color .2s, color .2s, transform .2s var(--ease-out);
}
.icon-circle-btn svg { width: 16px; height: 16px; }
.icon-circle-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.icon-circle-btn--whatsapp:hover { border-color: #25D366; color: #25D366; }

/* ---- audio recorder (editor.html) — compact single-row toolbar: record,
   play the primary take, toggle the count-in metronome, pick an input
   device, and open the takes list in its own modal. ---- */
.recorder-card { padding: 0.7rem 1rem; }
.recorder-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.recorder-label { font-size: 1.05rem; flex-shrink: 0; line-height: 1; }

.recorder-btn-compact {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, transform .2s var(--ease-out);
}
.recorder-btn-compact:hover { border-color: var(--accent); transform: translateY(-1px); }
.recorder-btn-dot { width: 12px; height: 12px; border-radius: 50%; background: #e5484d; transition: border-radius .2s, width .2s, height .2s; }
.recorder-btn-compact.is-counting { border-color: var(--accent); }
.recorder-btn-compact.is-counting .recorder-btn-dot { animation: recorder-pulse 1s var(--ease-soft) infinite; }
.recorder-btn-compact.is-recording { border-color: #e5484d; }
.recorder-btn-compact.is-recording .recorder-btn-dot { width: 13px; height: 13px; border-radius: 3px; animation: recorder-pulse 1.4s var(--ease-soft) infinite; }
@keyframes recorder-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.recorder-icon-btn {
  position: relative; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); transition: border-color .2s, color .2s, transform .2s var(--ease-out);
}
.recorder-icon-btn svg { width: 16px; height: 16px; }
.recorder-icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.recorder-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.recorder-icon-btn:disabled:hover { border-color: var(--line); color: var(--ink-soft); }
.recorder-icon-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.recorder-icon-btn .icon-pause { display: none; }
.recorder-icon-btn.is-playing .icon-play { display: none; }
.recorder-icon-btn.is-playing .icon-pause { display: block; }
.recorder-badge {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--accent); color: #08131d;
  font-size: 0.6rem; font-weight: 800; display: grid; place-items: center; line-height: 1;
}

.recorder-input-select {
  flex-shrink: 1; min-width: 0; max-width: 10rem;
  appearance: none; -webkit-appearance: none; background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem 0.5rem;
  font-size: 0.74rem; font-family: inherit;
}

.recorder-countdown { font-size: 1.25rem; font-weight: 800; color: var(--accent); font-family: var(--mono); }
.recorder-timer { font-size: 0.98rem; font-weight: 700; color: #e5484d; font-family: var(--mono); }
.recorder-idle-text { font-size: 0.78rem; color: var(--ink-mute); }

@media (max-width: 640px) {
  .recorder-idle-text { flex-basis: 100%; order: 10; }
  .recorder-input-select { max-width: 7.5rem; }
}

/* ---- takes modal (editor.html) — opened from the recorder bar's list
   button; built on demand like the confirm/prompt modals. ---- */
.takes-modal-card {
  width: min(480px, 100%); max-height: min(560px, 80vh); padding: 1.5rem;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(var(--shadow-color), 0.5);
  display: flex; flex-direction: column; gap: 1.1rem;
}
.takes-modal-head { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.takes-modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.takes-modal-list { display: flex; flex-direction: column; gap: 0.6rem; overflow-y: auto; }
.takes-modal-empty { text-align: center; color: var(--ink-mute); font-size: 0.86rem; padding: 1.6rem 0; }
.take-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 0.5rem 0.9rem; padding: 0.7rem 0.85rem; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
}
.take-row.is-primary { border-color: var(--accent); }
.take-info { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.take-primary-star {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-mute); font-size: 1rem; line-height: 1; border: none; background: none;
}
.take-primary-star:hover { color: var(--accent); }
.take-row.is-primary .take-primary-star { color: var(--accent); }
.take-name-input {
  min-width: 0; flex-shrink: 1; background: none; border: none; color: var(--ink);
  font-weight: 600; font-size: 0.88rem; padding: 0.2rem 0.3rem; border-radius: 6px;
}
.take-name-input:hover, .take-name-input:focus { background: var(--surface); }
.take-name-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.take-duration { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-mute); flex-shrink: 0; }
.take-row audio { grid-column: 1 / -1; width: 100%; height: 32px; }
.take-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.take-actions .btn-chip { padding: 0.4rem 0.7rem; font-size: 0.76rem; }

/* ---- single continuous song editor ---- */
.song-editor-wrap { margin-top: 1.6rem; --lyric-scale: 1; }

/* ---- floating "+" section button + its drag/drop palette panel.
   Anchored bottom-LEFT — the toolbox rail now permanently owns the
   right edge at every breakpoint, so the right side is off-limits. ---- */
.marker-fab {
  position: fixed; left: 24px; bottom: 24px; z-index: 160;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 1.6rem; line-height: 1;
  box-shadow: 0 14px 30px -10px rgba(var(--shadow-color), 0.55);
  transition: transform .2s var(--ease-out);
}
.marker-fab:hover { transform: scale(1.06); }
.marker-fab[aria-expanded="true"] { transform: rotate(45deg); }
.marker-fab[aria-expanded="true"]:hover { transform: rotate(45deg) scale(1.06); }

.marker-panel {
  position: fixed; left: 24px; bottom: 90px; z-index: 159;
  width: 340px; max-width: calc(100vw - 48px); max-height: calc(100vh - 130px);
  overflow-y: auto; padding: 1.1rem; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(var(--shadow-color), 0.5);
}
.marker-panel[hidden] { display: none; }
.marker-panel-title { margin: 0 0 0.7rem; font-size: 0.85rem; font-weight: 700; }
.marker-palette-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.marker-palette-hint { margin: 0.8rem 0 0; font-size: 0.74rem; color: var(--ink-mute); }
.marker-chip {
  font-family: var(--mono); font-weight: 700; font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem; border-radius: 999px; cursor: grab;
  background: var(--bg); border: 1px dashed var(--line); color: var(--accent);
  transition: border-color .2s, transform .2s var(--ease-out);
}
.marker-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.marker-chip:active { cursor: grabbing; }
.marker-chip--modulation { color: var(--accent-2); }
.marker-chip--chord { color: var(--accent-2); border-style: solid; cursor: pointer; }
.marker-chip--chord:active { cursor: pointer; }

/* ---- standalone chord anchor: a chord with no word underneath it, used
   for instrumental solos/bridges. Just enough width to hover/click. ---- */
/* A free chord has no word to float above, so it isn't a floating label
   over blank space like a real word's chord — it's shown as plain, centered
   inline text sitting right on its own line. That's also what keeps several
   in a row from ever overlapping: each is a normal inline box, not an
   absolutely-positioned label ignoring its neighbors. */
.word-anchor--chord-only {
  min-width: 2.4em;
  text-align: center;
}
.word-anchor--chord-only .chord-slot {
  position: static;
  display: inline;
  top: auto;
  left: auto;
}

.song-editor {
  min-height: 60vh;
  padding: 1.4rem 1.6rem; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-size: calc(1rem * var(--lyric-scale, 1)); line-height: 2.3;
}
.song-editor:focus { outline: none; border-color: var(--accent); }
.song-editor:empty::before { content: attr(data-placeholder); color: var(--ink-mute); pointer-events: none; }

.song-marker {
  /* Extra room below (vs. above): a chord floats 1.55em above its own
     word, and a word right after a marker only has the marker's own
     margin to float into — asymmetric margin keeps that label clear of
     the tag instead of overlapping it. */
  display: block; margin: 0.9em 0 1.7em; padding: 0.3em 0.7em;
  width: fit-content; border-radius: 8px; cursor: pointer;
  font-family: var(--mono); font-weight: 700; font-size: 0.8em;
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.6;
  background: rgba(var(--accent-rgb), 0.1); color: var(--accent);
  transition: background .2s;
}
.song-marker:hover { background: rgba(var(--accent-rgb), 0.2); }
/* Free chords sit inline on their own line (no floating label to clear),
   so they don't need the extra bottom margin reserved above for a word's
   floating chord — without this override that margin just reads as a gap
   of dead space before the chord row. */
.song-marker:has(+ .word-anchor--chord-only) { margin-bottom: 0.9em; }
.song-marker--modulation { background: rgba(123, 92, 219, 0.12); color: var(--accent-2); }
.song-marker--modulation:hover { background: rgba(123, 92, 219, 0.22); }

.chord-ghost-btn {
  position: fixed; z-index: 140;
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-mute); font-size: 0.85rem; line-height: 1;
  opacity: 0; pointer-events: none;
  transition: opacity .15s var(--ease-out);
}
/* Invisible hit-area padding: the visible box stays small and unobtrusive,
   but a mouse landing within ~10px around it still counts as a hit — a
   20-24px button is an easy miss otherwise. */
.chord-ghost-btn::before {
  content: ""; position: absolute; inset: -10px;
}
.chord-ghost-btn.is-visible { opacity: 0.65; pointer-events: auto; }
.chord-ghost-btn:hover { opacity: 1 !important; border-color: var(--accent); color: var(--accent); }

.word-anchor { position: relative; display: inline-block; }
.chord-slot {
  position: absolute; top: -1.55em; left: 0;
  font-family: var(--mono); font-weight: 700; font-size: 0.72em;
  color: var(--accent); background: none; border: none; white-space: nowrap;
  padding: 0.1em 0.2em; border-radius: 5px;
}
.chord-slot:hover { background: rgba(var(--accent-rgb), 0.12); }

/* =============================================================
   21. Toolbox — always-docked right-side rail (editor.html),
   CifraClub-style rows. Expanded shows icon+label+control cards;
   collapsed shrinks to an icon-only rail. Always visible at every
   breakpoint — desktop defaults to expanded, mobile to collapsed —
   the in-panel button at the top switches between the two.
   ============================================================= */
.toolbox {
  position: fixed; top: 84px; right: 0; bottom: 16px; z-index: 155;
  width: 340px; max-width: 85vw;
  background: var(--glass-solid); border: 1px solid var(--line); border-right: none;
  border-radius: 18px 0 0 18px;
  padding: 0.9rem; overflow-y: auto; overflow-x: hidden;
  box-shadow: -10px 0 30px -18px rgba(var(--shadow-color), 0.4);
  transition: width .3s var(--ease-soft);
}
@supports (backdrop-filter: blur(20px)) {
  .toolbox { background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
}
.toolbox[data-toolbox-state="collapsed"] { width: 78px; }

.toolbox-icon-row { display: flex; justify-content: flex-start; margin-bottom: 0.7rem; }
.toolbox[data-toolbox-state="collapsed"] .toolbox-icon-row { justify-content: center; }
.toolbox-icon-btn {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: border-color .2s, color .2s;
}
.toolbox-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.toolbox-icon-btn svg { width: 19px; height: 19px; }
.toolbox[data-toolbox-state="collapsed"] .toolbox-collapse-icon { transform: scaleX(-1); }

.toolbox-rows { display: flex; flex-direction: column; }
.toolbox-rows[hidden] { display: none; }
.toolbox-row-group {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding-bottom: 0.8rem; margin-bottom: 0.8rem; border-bottom: 1px solid var(--line);
}
.toolbox-row-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.toolbox-reset-row { display: flex; justify-content: center; padding-top: 0.6rem; }

.tool-row {
  display: flex; align-items: center; gap: 0.75rem;
  height: 56px; padding: 0 0.85rem; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  transition: background .2s, transform .3s var(--ease-soft), width .3s var(--ease-soft), height .3s var(--ease-soft), border-radius .3s;
}
.tool-row-icon {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); color: var(--ink-soft);
}
.tool-row-icon svg { width: 17px; height: 17px; }
.tool-row-body {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; min-width: 0; flex: 1; height: 100%; overflow: hidden;
}
.tool-row-label {
  font-size: 0.82rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1;
}
.tool-row-control {
  display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0;
  white-space: nowrap;
}
.tool-row-control .btn-chip { flex-shrink: 0; }
.tool-row-play-btn { width: 30px; height: 30px; flex-shrink: 0; }
.tool-row-play-btn svg, .tool-row-play-btn { font-size: 0.7rem; }
.tool-row-play-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool-row-play-btn.is-beat { transform: scale(1.12); border-color: var(--accent); color: var(--accent); }
.tool-row-mini-value {
  max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
}
.tool-row--picker .tool-row-control { position: relative; padding-right: 1.05rem; }
.tool-row--picker .tool-row-control::after {
  content: "›"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  color: var(--ink-mute); font-size: 1.1rem; font-weight: 700; pointer-events: none; flex-shrink: 0;
}
.metronome-bpm-display { white-space: nowrap; }

/* ---- collapsed rail: icon-only circles, click any to expand ---- */
.toolbox[data-toolbox-state="collapsed"] .toolbox-row-group { align-items: center; gap: 0.6rem; }
.toolbox[data-toolbox-state="collapsed"] .tool-row {
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  justify-content: center; cursor: pointer;
}
.toolbox[data-toolbox-state="collapsed"] .tool-row-body { display: none; }
.toolbox[data-toolbox-state="collapsed"] .toolbox-reset-row { display: none; }

/* ---- toolbox drill-down: a row can open a detail sub-view inside the
   same panel, replacing the list; the back arrow returns to the list. ---- */
.toolbox[data-toolbox-state="collapsed"] .toolbox-detail { display: none; }
.toolbox-detail-back {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.3rem; margin-bottom: 1rem;
  font-size: 0.92rem; font-weight: 700; color: var(--ink);
}
.toolbox-detail-back svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-mute); }
.toolbox-detail-back:hover svg { color: var(--accent); }
.toolbox-detail-body { display: grid; gap: 1.2rem; padding: 0.4rem 0.6rem 1rem; }
.toolbox-detail-templates { display: none; }

/* ---- toolbox-group: one centered block inside a detail view (label on
   top, its control below), used by every drilled-down tool row. ---- */
.toolbox-group {
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  text-align: center;
}
.toolbox-group .speed-control,
.toolbox-group .chip-row { justify-content: center; }
.toolbox-group .instrument-toggle--block { max-width: 260px; }
.chip-row--center { justify-content: center; }
.chord-chip--wide { padding-inline: 0.9rem; height: auto; min-height: 2.4rem; }

@media (min-width: 1024px) {
  .app-shell--wide { transition: padding-right .3s var(--ease-soft); padding-right: 94px; }
  body.toolbox-expanded .app-shell--wide { padding-right: 356px; }
}

/* ---- reading mode (fullscreen, distraction-free, multi-column) ---- */
body.reading-mode .app-bar,
body.reading-mode .nav-mobile,
body.reading-mode .app-back,
body.reading-mode .song-header,
body.reading-mode .marker-fab,
body.reading-mode .marker-panel,
body.reading-mode .toolbox,
body.reading-mode .song-delete-zone {
  display: none !important;
}
@media (min-width: 1024px) {
  body.reading-mode .app-shell--wide { padding-right: 0; }
}
body.reading-mode .app-main { padding-top: 1.5rem; }
body.reading-mode .song-editor-wrap { margin-top: 0; }
body.reading-mode .song-editor {
  min-height: 90vh; font-size: calc(1.15rem * var(--lyric-scale, 1));
  background: var(--bg);
}
@media (min-width: 900px) {
  body.reading-mode .song-editor { column-count: 2; column-gap: 3rem; }
  body.reading-mode .song-marker { break-inside: avoid; }
}

/* ---- hover diagram peek (Diagramas: mostrar siempre) ---- */
.chord-hover-diagram {
  position: fixed; z-index: 290; padding: 0.8rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(var(--shadow-color), 0.5);
  pointer-events: none;
}
.chord-hover-diagram[hidden] { display: none; }
.chord-hover-diagram .chord-diagram-svg { width: 90px; height: auto; color: var(--ink-mute); }
.chord-hover-diagram .chord-diagram-svg--piano { width: 140px; }

/* ---- metrónomo ---- */
.metronome-bpm-display { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.metronome-pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--line);
  transition: background .08s, transform .08s;
}
.metronome-pulse.is-beat { background: var(--accent); transform: scale(1.4); }

/* =============================================================
   22. Chord popup (add / view diagram)
   ============================================================= */
.chord-popup {
  position: fixed; z-index: 300; width: 240px; max-height: calc(100vh - 24px);
  padding: 1.1rem; border-radius: 18px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(var(--shadow-color), 0.5);
}
.chord-popup[hidden] { display: none; }
.chord-popup-diagram { display: flex; justify-content: center; margin-bottom: 0.8rem; min-height: 90px; align-items: center; }
.chord-popup-diagram[hidden] { display: none; }
.chord-popup-diagram .chord-diagram-svg { width: 100px; height: auto; color: var(--ink-mute); }
.chord-popup-diagram .chord-diagram-svg--piano { width: 160px; }
.chord-popup .instrument-toggle[hidden] { display: none; }
.chord-popup-suggest-head { display: flex; align-items: center; justify-content: space-between; margin: 0.7rem 0 0.5rem; }
.chord-popup-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); margin: 0; }
.chord-search-toggle { width: 26px; height: 26px; font-size: 0.75rem; }
.chord-search-toggle.is-active { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.chord-popup .chip-row { margin-bottom: 0; }
.chord-popup-search { margin-bottom: 0.6rem; }
.chord-popup-search input {
  width: 100%; padding: 0.5rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 0.82rem;
}
.chord-popup-actions { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }

.chord-diagram-svg { width: 100%; max-width: 110px; height: auto; color: var(--ink-mute); }

/* ---- meta edit popup (tonalidad/bpm/compás/capo) ---- */
.meta-popup-number { margin-bottom: 0.2rem; }
.meta-popup-number input {
  width: 100%; padding: 0.55rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 700; text-align: center;
}
.meta-popup-metronome {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin-top: 0.7rem;
}

/* =============================================================
   23. Delete song button + shared confirm dialog
   ============================================================= */
.song-delete-zone { display: flex; justify-content: center; margin: 1.6rem 0 2rem; }
.text-danger-btn {
  font-size: 0.85rem; font-weight: 600; color: var(--ink-mute);
  padding: 0.5rem 0.9rem; border-radius: 999px;
  transition: color .2s, background .2s;
}
.text-danger-btn:hover { color: #e5484d; background: rgba(229, 72, 77, 0.1); }

.confirm-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(20, 16, 30, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.confirm-card {
  width: min(380px, 100%); padding: 1.6rem; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(var(--shadow-color), 0.5);
}
.confirm-title { margin: 0 0 0.6rem; font-size: 1.1rem; font-weight: 800; }
.confirm-message { margin: 0 0 1.4rem; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5; }
.confirm-input {
  width: 100%; margin-bottom: 1.4rem; padding: 0.6rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 0.92rem;
}
.confirm-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.7rem; }
.confirm-danger-btn { background: #e5484d; border-color: #e5484d; color: #fff; }
.confirm-danger-btn:hover { opacity: 0.9; }

/* ---- afinador (tuner) modal ---- */
.tuner-card { width: min(340px, 100%); text-align: center; }
.tuner-status { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 1rem; min-height: 2.4em; }
.tuner-display { display: grid; gap: 0.8rem; margin-bottom: 1.2rem; }
.tuner-note { font-family: var(--serif); font-weight: 800; font-size: 3rem; color: var(--ink); }
.tuner-meter { position: relative; height: 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.tuner-meter-center { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--line); transform: translateX(-50%); }
.tuner-meter-needle {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); transform: translate(-50%, -50%);
  transition: left .1s linear, background .15s;
}
.tuner-meter-needle.is-in-tune { background: #2f9e56; }
.tuner-cents { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-mute); }

/* ---- rasgueos (strumming) reference ---- */
.strum-list { display: grid; gap: 0.6rem; }
.strum-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
}
.strum-name { font-size: 0.85rem; font-weight: 600; }
.strum-pattern { font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.06em; color: var(--accent); }

/* =============================================================
   24. Responsive helpers
   ============================================================= */
@media (max-width: 539px) {
  .hero { padding-block: 7rem 3.5rem; }
  .hero-float-card { position: static; margin-top: 1rem; animation: none; }
  .hero-visual { max-width: 100%; }
}

/* =============================================================
   25. Print (editor.html) — only the song itself: title, artist,
   key/BPM/meter/capo, and the lyrics with their tags and chords.
   No nav, no editing chrome, no toolbox.
   ============================================================= */
@media print {
  .app-bar, .nav-mobile, .app-back,
  .marker-fab, .marker-panel, .toolbox,
  .song-delete-zone, .song-actions-row,
  .chord-ghost-btn, .chord-hover-diagram,
  .recorder-card,
  .skip-link {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .app-shell--wide { padding-right: 0 !important; }
  .song-title-input, .song-artist-input { color: #000; }
  .song-editor-wrap { margin-top: 1rem; }
  .song-editor {
    border: none; background: none; padding: 0; min-height: 0; color: #000;
    box-shadow: none; border-radius: 0; backdrop-filter: none;
  }
  .song-marker { break-inside: avoid; }
  .meta-info-chip { border: none; padding: 0; }
}
