@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f8ff;
  --bg-alt: #e9effc;
  --panel: rgba(255, 255, 255, 0.94);
  --accent: #2f6cf7;
  --accent-2: #5f8dff;
  --accent-3: #2a55cc;
  --text: #101829;
  --muted: #5f6c86;
  --stroke: rgba(16, 24, 41, 0.12);
  --shadow: 0 20px 50px rgba(36, 67, 132, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #fafdff 0%, #f1f5ff 58%, #ebf1ff 100%);
  min-height: 100vh;
  position: relative;
}

.hero.compact .logo {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.bg-orbit {
  position: fixed;
  inset: -20% auto auto -10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(47, 108, 247, 0.2), rgba(95, 141, 255, 0.12), transparent 72%);
  filter: blur(0px);
  z-index: -2;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(16, 24, 41, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 41, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  z-index: -3;
  opacity: 0.45;
}

.hero {
  padding: 28px 8vw 20px;
}

.hero.compact {
  padding-bottom: 10px;
}

.topbar.compact {
  justify-content: flex-start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  gap: 0;
  align-items: flex-start;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.logo-pick {
  width: 31px;
  height: 35px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(255, 255, 255, 0.18));
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, #ffffff, #adadad);
  color: #050505;
}

.brand-title {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 1.4px;
  font-size: 1.15rem;
  text-transform: uppercase;
}

.brand-title.glow {
  font-size: 2.45rem;
  letter-spacing: 3.2px;
  background: linear-gradient(120deg, #1e5bdf, #3e74f0, #6798ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 10px 28px rgba(47, 108, 247, 0.24);
}

.brand-sub {
  font-size: 0.85rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.compact-title {
  height: 0;
  margin: 0;
  padding: 0;
}

.brand-sub {
  font-size: 13px;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--muted);
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(216, 216, 216, 0.15);
  border: 1px solid rgba(216, 216, 216, 0.3);
  color: #dcdcdc;
  font-size: 13px;
}

.hero-content {
  margin-top: 50px;
  display: grid;
  grid-template-columns: 1.1fr 0.7fr;
  gap: 36px;
  align-items: center;
}

.hero h1 {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 18px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--panel);
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.hero-card-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-card-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.hero-card-footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding: 40px 8vw 80px;
}

.section-title h2 {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin: 0 0 8px;
}

.section-title p {
  color: var(--muted);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.grid.practice-grid {
  grid-template-columns: minmax(320px, 1fr);
  align-items: stretch;
  gap: 28px;
}

.card.builder,
.grid.practice-grid {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.card.fretboard-card {
  max-width: 1200px;
  margin: 14px auto 0;
  width: 100%;
}

.card.builder {
  padding: 21px 22px;
}

.stack {
  display: grid;
  gap: 20px;
}

.preset-carousel {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  gap: 10px;
  margin-bottom: 0;
  padding-bottom: 4px;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}

.preset-row::-webkit-scrollbar {
  height: 6px;
}

.preset-row .btn.small {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 7px 11px;
  font-size: 0.78rem;
  scroll-snap-align: start;
}

.preset-nav {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(241, 245, 255, 0.9);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.preset-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.preset-nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 24px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  position: relative;
}

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.practice-hub {
  display: grid;
  gap: 14px;
  height: 100%;
  position: relative;
}

.progression-block {
  display: grid;
  gap: 10px;
}

.progression-sections {
  display: grid;
  gap: 10px;
}

.progression-section {
  display: grid;
  gap: 8px;
}

.progression-section-head {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--muted);
  margin-top: 2px;
}

.key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.left-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.key-row .transport-mini {
  margin-left: auto;
}

.tempo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  min-height: 0;
}
.key-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.3), rgba(168, 168, 168, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #f0f0f0;
  font-size: 1.05rem;
  letter-spacing: 0.4px;
  width: fit-content;
  margin-bottom: 0;
  box-shadow: 0 10px 22px rgba(255, 255, 255, 0.2), 0 0 14px rgba(168, 168, 168, 0.18);
  cursor: pointer;
}

.key-banner:active {
  transform: translateY(1px);
}

.key-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.key-picker {
  position: absolute;
  top: 54px;
  left: 0;
  min-width: 260px;
  background: rgba(12, 15, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 20;
}

.key-picker.open {
  display: grid;
  gap: 12px;
}

.key-picker-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.key-picker-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(40px, 1fr));
  gap: 6px;
}

.key-picker-notes button {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

.key-picker-notes button.active,
.key-picker-modes button.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  color: #f2f2f2;
}

.key-picker-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.key-banner span {
  color: #f6f6f6;
  font-weight: 600;
}

@keyframes keyPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(255, 255, 255, 0.2), 0 0 14px rgba(168, 168, 168, 0.18);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(255, 255, 255, 0.3), 0 0 20px rgba(168, 168, 168, 0.26);
  }
}

.key-banner.pulse {
  animation: keyPulse 1.2s ease-in-out 1;
}

.key-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #d5d5d5;
  padding: 0 2px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: none;
  margin-bottom: 6px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.key-lock svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.key-lock .icon-locked {
  display: none;
}

.key-lock .icon-unlocked {
  display: block;
}

.key-lock:hover {
  color: #e0e0e0;
  opacity: 1;
}

.key-lock[aria-pressed="true"] {
  color: #e8e8e8;
}

.key-lock[aria-pressed="true"] .icon-locked {
  display: block;
}

.key-lock[aria-pressed="true"] .icon-unlocked {
  display: none;
}

.key-refresh {
  display: none;
  position: static;
  margin-left: 8px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.24), rgba(168, 168, 168, 0.16));
  color: #e5e5e5;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 255, 255, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.key-refresh svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.key-refresh:hover {
  color: #f0f0f0;
  border-color: rgba(255, 184, 95, 0.75);
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(255, 255, 255, 0.24);
}

.progression.large {
  padding: 18px;
  gap: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  grid-auto-rows: minmax(70px, auto);
  overflow: visible;
}

.progression.large .progression-item {
  min-width: 0;
  padding: 16px 18px;
  box-sizing: border-box;
  overflow: visible;
  word-break: break-word;
}

@media (min-width: 901px) and (max-width: 1200px) {
  .key-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
  }

  .left-controls {
    min-width: 0;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .left-controls .tempo-pill {
    flex: 1 1 auto;
    min-width: 250px;
  }

  .key-row .transport-mini {
    margin-left: 0;
    justify-self: end;
    white-space: normal;
  }

  .key-row .key-banner,
  .key-row .key-lock {
    margin-bottom: 0;
  }

  .key-row .transport-mini .btn.primary.play {
    padding: 11px 18px;
    font-size: 0.94rem;
  }

  .key-row .transport-mini .btn.ghost {
    padding: 10px 12px;
    font-size: 0.88rem;
  }
}

@media (max-width: 900px) {
  .progression.large {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 14px;
  }

  .progression-item {
    min-height: 90px;
    padding: 16px 18px;
  }

  .progression-item span {
    font-size: 0.85rem;
  }

  .progression-item strong {
    font-size: 1.35rem;
  }
  .progression.large {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

.control-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.section-control-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.section-control-row label {
  gap: 4px;
  font-size: 0.8rem;
}

.section-control-row select {
  min-width: 72px;
  padding: 8px 10px;
}

.section-control-row .btn.active {
  background: rgba(244, 141, 75, 0.18);
  border-color: rgba(244, 141, 75, 0.55);
  color: #e4e4e4;
}

.slider-group {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(12, 15, 23, 0.6);
  margin-top: 12px;
}

.slider-group .btn {
  justify-self: start;
}

.latency-test {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.focus-tools .note-list {
  margin-top: 8px;
  min-height: 34px;
}

.focus-tools .btn {
  margin-top: 8px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

label.toggle {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

label.toggle input {
  width: 18px;
  height: 18px;
}

label.toggle.compact {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

select,
input[type="range"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 20, 0.8);
  color: var(--text);
  font-family: inherit;
}

input[type="range"] {
  height: 28px;
  background: transparent;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 20, 0.8);
  color: var(--text);
  font-family: inherit;
}

.tempo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tempo-pill .tempo-wrap {
  gap: 6px;
}

.tempo-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f2f2f2;
  white-space: nowrap;
}

.tempo-value {
  cursor: text;
}

.tempo-inline-input {
  width: 78px;
  min-width: 78px;
  height: 30px;
  padding: 4px 8px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: #f2f2f2;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 12, 24, 0.82);
}

.tempo-range-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.tempo-step {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 16, 28, 0.4);
  color: rgba(247, 252, 255, 0.92);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.tempo-step:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mobile-transport {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  gap: 8px;
  grid-template-columns: 42px minmax(170px, 1fr) 42px;
  background: rgba(9, 12, 20, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 28px rgba(5, 7, 13, 0.42);
  backdrop-filter: blur(12px);
  z-index: 40;
}

.mobile-transport .btn {
  min-height: 42px;
}

.mobile-transport .mobile-refresh {
  grid-column: 1;
  justify-self: start;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-transport .mobile-refresh svg {
  width: 19px;
  height: 19px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.mobile-transport .btn.primary.play {
  grid-column: 2;
  width: 100%;
  max-width: 280px;
  min-height: 46px;
  justify-self: center;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.96rem;
  box-shadow: 0 10px 24px rgba(168, 168, 168, 0.28);
}

.mobile-transport .mobile-icon {
  grid-column: 3;
  justify-self: end;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-transport .mobile-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.9;
}

.mobile-compact summary {
  font-size: 0.8rem;
}

.tempo-label.funky span {
  font-weight: 600;
  color: #ededed;
}

.btn {
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #050505;
  box-shadow: 0 12px 30px rgba(168, 168, 168, 0.35);
}

.btn.primary.play {
  padding: 16px 28px;
  font-size: 1.05rem;
  box-shadow: 0 18px 40px rgba(168, 168, 168, 0.45);
}

.btn.ghost.stop {
  border-color: rgba(168, 168, 168, 0.4);
  color: #cecece;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn.small {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn:hover {
  transform: translateY(-2px);
}

.note {
  margin-top: 14px;
  font-size: 0.86rem;
  color: rgba(170, 177, 198, 0.74);
}

.progression-tools {
  display: grid;
  gap: 15px;
  margin: 14px 0;
}

.generator {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 14px;
}

.generator-row {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

#generateProg.btn.primary.play {
  padding: 11px 18px;
  font-size: 0.93rem;
  box-shadow: 0 12px 26px rgba(168, 168, 168, 0.32);
}

.generator-row .control-row {
  flex: 1;
  min-width: 260px;
}

.builder {
  margin-bottom: 24px;
}

.palette {
  display: grid;
  gap: 6px;
}

.palette-drawer {
  margin-top: 2px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 14px 12px;
}

.palette-drawer summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  margin-bottom: 6px;
}

.palette-drawer summary::-webkit-details-marker {
  display: none;
}

.palette-drawer summary::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}

.palette-drawer[open] summary::after {
  transform: rotate(180deg);
}

.palette .card-title {
  display: none;
}

.palette-note {
  margin: 0 0 8px 0;
  font-size: 0.8rem;
}

.palette-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.palette-section:first-of-type {
  border-top: none;
  padding-top: 2px;
}

.palette-section summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.75rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  margin: 0 0 2px;
  padding-bottom: 2px;
}

.palette-section summary::-webkit-details-marker {
  display: none;
}

.palette-section summary::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}

.palette-section[open] summary::after {
  transform: rotate(180deg);
}

.palette-section .chord-pool {
  margin-top: 6px;
}

.palette-section.diatonic .chord-btn {
  border-color: rgba(216, 216, 216, 0.25);
  background: rgba(216, 216, 216, 0.08);
}

.palette-section.extensions .chord-btn {
  border-color: rgba(168, 168, 168, 0.25);
  background: rgba(168, 168, 168, 0.08);
}

.palette-section.borrowed .chord-btn {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.palette .chord-btn {
  font-size: 0.85rem;
  padding: 7px 10px;
}

.palette .chord-btn {
  cursor: grab;
}

.palette .chord-btn:active {
  cursor: grabbing;
}

.details {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
}

.details summary {
  cursor: pointer;
  font-weight: 400;
  margin-bottom: 10px;
}

.builder-details {
  margin-top: 4px;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.builder-details > summary {
  font-size: 0.82rem;
  margin-bottom: 0;
}

.builder-details[open] {
  margin-top: 2px;
}

.builder-details[open] > summary {
  margin-bottom: 8px;
}

.chord-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chord-btn,
.progression-item {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 0.9rem;
  color: #f3f3f3;
}

.progression-item {
  display: grid;
  gap: 2px;
  min-width: 86px;
  position: relative;
}

.progression-add {
  min-height: 70px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(170, 177, 198, 0.82);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.progression-add span {
  font-size: 1.25rem;
  line-height: 1;
}

.progression-add:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(220, 226, 240, 0.92);
  background: rgba(255, 255, 255, 0.06);
}

.progression-inline-add {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(214, 221, 236, 0.84);
  font-size: 1.34rem;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 3;
  transition: color 0.18s ease, transform 0.18s ease;
}

.progression-inline-add:hover {
  color: rgba(246, 250, 255, 0.98);
  transform: translateY(-50%) scale(1.08);
}

.progression-mobile-add {
  display: none;
}

.progression-item span {
  font-size: 0.75rem;
  color: var(--muted);
}

.progression-item strong {
  overflow-wrap: anywhere;
}

.progression-item span::after {
  content: "•";
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.25);
}

.progression-item strong {
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.4px;
  text-shadow: 0 6px 18px rgba(17, 19, 26, 0.55);
}

.progression-item .beats {
  font-size: 0.7rem;
  color: var(--muted);
}

.progression-item.playing {
  background: rgba(216, 216, 216, 0.2);
  border-color: rgba(216, 216, 216, 0.6);
  box-shadow: 0 10px 30px rgba(216, 216, 216, 0.2);
}

.progression-item.playing::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(216, 216, 216, 0.9);
  box-shadow: 0 0 10px rgba(216, 216, 216, 0.6);
}

.progression-item.selected {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.2);
}

.remove-chord {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  cursor: pointer;
}

.chord-editor {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.chord-editor.hidden {
  display: none;
}

.editor-header {
  font-weight: 600;
}

.selected-chord {
  font-size: 1.1rem;
  font-weight: 600;
}

.editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.editor-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-buttons .btn.active {
  background: rgba(216, 216, 216, 0.2);
  border-color: rgba(216, 216, 216, 0.6);
}

.chord-popup {
  position: fixed;
  z-index: 30;
  min-width: 280px;
  max-width: 340px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 13, 20, 0.96);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 10px;
}

.chord-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chord-popup-title {
  font-size: 0.82rem;
  color: rgba(223, 227, 241, 0.95);
  font-weight: 600;
}

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

.chord-popup .btn.small {
  padding: 7px 12px;
}

.progression {
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
}

.progression-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  align-items: center;
  justify-content: space-between;
}

.progression-actions-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progression-hint {
  color: rgba(170, 177, 198, 0.66);
}

.progression-input {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.spicy-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spicy-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.spicy-category {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(183, 191, 214, 0.86);
  margin-bottom: 6px;
}

.spicy-pill {
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(168, 168, 168, 0.18);
  border: 1px solid rgba(168, 168, 168, 0.4);
  font-size: 0.85rem;
  line-height: 1.3;
  max-width: min(560px, 100%);
  white-space: normal;
}

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

.now-playing {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(216, 216, 216, 0.3);
  background: rgba(216, 216, 216, 0.08);
}

.now-playing.large {
  margin-top: 0;
  padding: 20px;
}

.now-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.now-chord {
  font-size: 2.4rem;
  font-weight: 600;
}

.now-details {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.fretboard-block {
  display: grid;
  gap: 14px;
  margin-top: 2px;
}

.fretboard-wrapper {
  display: grid;
  gap: 8px;
}

.fretboard-markers {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.fretboard-markers div {
  padding: 2px 0;
  letter-spacing: 0.4px;
}

.fretboard-head {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.fretboard-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.focus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.focus-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.playback {
  display: flex;
  gap: 10px;
  align-items: center;
}

.transport-mini {
  position: static;
  z-index: 7;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 15, 23, 0.66);
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
}

.transport-mini .btn.primary.play {
  padding: 13px 22px;
  font-size: 1rem;
  box-shadow: 0 14px 30px rgba(168, 168, 168, 0.38);
}

.transport-mini .btn.ghost {
  padding: 11px 16px;
  font-size: 0.93rem;
}

.transport-mini .btn.rewind {
  min-width: 42px;
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1;
}

.transport-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.transport-meta .count-in {
  margin-top: 0;
}

.style-pill,
.rhythm-pill {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(186, 192, 212, 0.85);
  font-size: 0.74rem;
  letter-spacing: 0.3px;
}

.style-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 12px;
  font-weight: 600;
}

.style-pill::after {
  content: "▾";
  font-size: 0.62rem;
  opacity: 0.72;
  transform: translateY(1px);
  transition: transform 140ms ease, opacity 140ms ease;
}

.style-pill[aria-expanded="true"]::after {
  transform: rotate(180deg) translateY(-1px);
  opacity: 0.94;
}

.style-pill:hover,
.rhythm-pill:hover {
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(219, 223, 236, 0.95);
}

.style-wrap,
.rhythm-wrap {
  position: relative;
  width: fit-content;
}

.style-editor,
.rhythm-editor {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  min-width: 220px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 13, 20, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 8px;
}

.style-editor-head {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(157, 166, 190, 0.92);
}

.style-editor label,
.rhythm-editor label {
  font-size: 0.75rem;
  gap: 6px;
}

.style-editor select,
.rhythm-editor select {
  padding: 7px 9px;
  border-radius: 10px;
}

.style-editor-note {
  font-size: 0.69rem;
  line-height: 1.35;
  color: rgba(152, 160, 184, 0.9);
}

.style-select {
  appearance: none;
  font-weight: 600;
  border: 1px solid rgba(134, 177, 255, 0.42);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(191, 213, 255, 0.94) 50%),
    linear-gradient(135deg, rgba(191, 213, 255, 0.94) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.style-select:focus {
  outline: none;
  border-color: rgba(140, 192, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(94, 154, 255, 0.24);
}

.style-select optgroup {
  color: rgba(203, 217, 245, 0.88);
  font-style: normal;
}

.form-chip {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  margin-top: 2px;
  padding: 7px 10px;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(170, 177, 198, 0.8);
  font-size: 0.78rem;
  letter-spacing: 0.35px;
}

.form-chip:hover {
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(219, 223, 236, 0.95);
}

.vary-b-chip {
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 209, 167, 0.9);
}

.vary-a-chip {
  border-color: rgba(216, 216, 216, 0.35);
  color: rgba(189, 239, 255, 0.9);
}

.vary-a-chip:hover {
  border-color: rgba(108, 228, 255, 0.62);
  color: rgba(226, 248, 255, 0.98);
}

.vary-b-chip:hover {
  border-color: rgba(255, 168, 101, 0.62);
  color: rgba(255, 235, 207, 0.98);
}

.form-chip-wrap {
  position: relative;
  width: fit-content;
}

.form-editor {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  min-width: 210px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 13, 20, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 8px;
}

.form-editor label {
  font-size: 0.75rem;
  gap: 6px;
}

.form-editor select {
  padding: 7px 9px;
  border-radius: 10px;
}

.count-in {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.count-in span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.count-in span.active {
  color: #050505;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(168, 168, 168, 0.35);
}

.level-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-row span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 40px;
  text-align: right;
}

.session-timer {
  font-size: 2.4rem;
  font-weight: 600;
  margin: 10px 0 18px;
}

.session-controls {
  display: flex;
  gap: 12px;
}

.session-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 600;
}

.note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-list span {
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(216, 216, 216, 0.15);
  border: 1px solid rgba(216, 216, 216, 0.3);
  font-size: 0.85rem;
}

.audio-credits {
  margin-top: 10px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
}

.auto-align {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
  flex-wrap: wrap;
}

.auto-align .note {
  margin: 0;
}

.fretboard {
  --fret-gap: 4px;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: var(--fret-gap);
  position: relative;
}

.fretboard::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((100% - (12 * var(--fret-gap))) / 13 + (var(--fret-gap) / 2));
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(245, 245, 236, 0.66), rgba(224, 224, 214, 0.56));
  box-shadow: 0 0 3px rgba(235, 235, 225, 0.08);
  pointer-events: none;
  z-index: 2;
}

.hidden {
  display: none !important;
}

.fret {
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.fret.active {
  background: linear-gradient(135deg, rgba(216, 216, 216, 0.85), rgba(255, 255, 255, 0.75));
  color: #101010;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(216, 216, 216, 0.35);
}

.fret.overlay {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(228, 234, 248, 0.12));
  color: rgba(235, 240, 255, 0.95);
  font-weight: 600;
}

.fret.root {
  background: linear-gradient(135deg, rgba(168, 168, 168, 0.9), rgba(255, 255, 255, 0.9));
  color: #101010;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.keyboard-wrapper {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.keyboard-grid {
  position: relative;
  height: 132px;
  min-width: 680px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(12, 15, 23, 0.16));
}

.keyboard-key {
  position: absolute;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  font-size: 0.62rem;
  letter-spacing: 0.2px;
  line-height: 1;
  user-select: none;
  border: 1px solid rgba(14, 18, 30, 0.2);
  color: rgba(95, 103, 127, 0.8);
}

.keyboard-key.white {
  height: 100%;
  background: linear-gradient(180deg, rgba(230, 238, 252, 0.88), rgba(184, 198, 226, 0.86));
  color: rgba(34, 42, 63, 0.86);
  box-shadow: inset 0 -12px 18px rgba(19, 25, 39, 0.18);
}

.keyboard-key.black {
  height: 63%;
  z-index: 3;
  top: 0;
  border-radius: 0 0 9px 9px;
  border-color: rgba(0, 0, 0, 0.38);
  background: linear-gradient(180deg, rgba(52, 59, 80, 0.98), rgba(23, 28, 41, 0.98));
  color: rgba(214, 221, 241, 0.75);
  box-shadow: 0 8px 14px rgba(4, 7, 14, 0.45);
}

.keyboard-key.white.active {
  background: linear-gradient(165deg, rgba(216, 216, 216, 0.92), rgba(255, 255, 255, 0.84));
  color: #111111;
  font-weight: 700;
}

.keyboard-key.black.active {
  background: linear-gradient(165deg, rgba(216, 216, 216, 0.86), rgba(255, 255, 255, 0.78));
  color: #121212;
  font-weight: 700;
}

.keyboard-key.white.overlay {
  background: linear-gradient(165deg, rgba(233, 239, 252, 0.98), rgba(200, 211, 235, 0.96));
  color: rgba(60, 68, 94, 0.96);
}

.keyboard-key.black.overlay {
  background: linear-gradient(165deg, rgba(84, 94, 124, 0.98), rgba(42, 51, 74, 0.98));
}

.keyboard-key.white.root {
  background: linear-gradient(165deg, rgba(168, 168, 168, 0.92), rgba(255, 255, 255, 0.9));
  color: #111111;
  font-weight: 700;
}

.keyboard-key.black.root {
  background: linear-gradient(165deg, rgba(168, 168, 168, 0.85), rgba(255, 255, 255, 0.82));
  color: #111111;
}

.preset {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.preset:hover {
  transform: translateY(-4px);
}

.preset-notes {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.footer {
  padding: 24px 8vw 30px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 1200px;
  margin: 0 auto;
}

.footer.footer-credits {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-meta {
  font-size: 0.95rem;
}

.footer-attribution {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.52);
  white-space: nowrap;
  text-align: center;
}

/* Back-compat: if an older cached markup still renders .footer-shortcuts, style it like attribution and place it below. */
.footer.footer-credits .footer-attribution:first-child {
  order: 1;
}

.footer.footer-credits .footer-shortcuts,
.footer.footer-credits .footer-attribution + .footer-attribution {
  order: 2;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.52);
  white-space: nowrap;
  text-align: center;
}

/* Back-compat: force-hide any stale cached Copy Chords controls. */
#copyProgression,
button[title*="Copy progression"],
button[title*="Copy Chords"] {
  display: none !important;
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }

  main,
  .section,
  .grid.practice-grid,
  .card.practice-hub,
  .progression-block {
    min-width: 0;
  }

  .hero {
    padding: 20px 6vw 10px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .brand-title.glow {
    font-size: 1.5rem;
  }

  .logo-pick {
    width: 27px;
    height: 31px;
  }

  .section {
    padding: 18px 5vw 86px;
  }

  .grid.practice-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .generator-row {
    flex-direction: column;
    align-items: stretch;
  }

  .control-row {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .control-row,
  .generator,
  .generator-row,
  .card.builder,
  .section {
    width: 100%;
  }

  .control-row label,
  .control-row select,
  .control-row input,
  .generator-row .btn {
    width: 100%;
    max-width: 100%;
  }

  .control-row label,
  .tempo-pill,
  .key-banner,
  .key-row,
  .progression-actions,
  .palette,
  .palette-drawer,
  .chord-editor,
  .fretboard-block,
  .count-in,
  .mobile-transport {
    max-width: 100%;
  }

  .generator-row .btn {
    width: 100%;
  }

  .progression-block .key-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-right: 0;
  }

  .progression-block {
    gap: 8px;
  }

  .progression-sections {
    gap: 8px;
  }

  .progression-block .key-row .left-controls {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .key-pill-wrap {
    display: inline-flex;
    align-items: center;
  }

  .key-lock {
    margin-left: 4px;
    margin-bottom: 0;
    min-width: 28px;
    min-height: 28px;
  }

  .key-lock svg {
    width: 21px;
    height: 21px;
  }

  .key-banner {
    min-height: 52px;
    padding: 12px 18px;
    font-size: 1.1rem;
  }

  .key-refresh {
    display: inline-flex;
    position: absolute;
    top: 14px;
    right: 14px;
    margin-left: 0;
  }

  .progression-block .sub-title {
    display: none;
  }

  .tempo-pill {
    min-height: 0;
    padding: 0;
    width: auto;
    flex: 0 0 auto;
  }

  .tempo-pill .tempo-wrap {
    gap: 8px;
  }

  .tempo-pill .tempo-wrap span {
    min-width: 78px;
    font-size: 0.9rem;
  }

  .tempo-inline-input {
    min-width: 78px;
    height: 32px;
    font-size: 0.9rem;
  }

  .tempo-step {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 1.18rem;
  }

  .progression.large {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    grid-auto-rows: minmax(110px, auto);
    padding: 12px;
    gap: 10px;
  }

  .progression-item {
    min-height: 88px;
    padding: 12px;
  }

  .progression-item strong {
    font-size: 1.02rem;
    display: block;
  }

  .progression-item span {
    font-size: 0.75rem;
    display: block;
  }

  .progression-item .beats {
    font-size: 0.64rem;
  }

  .progression-actions {
    flex-wrap: wrap;
  }

  .progression-actions-right {
    width: 100%;
    justify-content: flex-start;
  }

  .mobile-transport {
    display: grid;
  }

  .transport-mini {
    display: none;
  }

  .chord-popup {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    max-width: none;
    min-width: 0;
    max-height: 62vh;
    overflow: auto;
  }

  .count-in {
    display: none;
  }

  .transport-meta {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 6px;
  }

  .style-pill,
  .rhythm-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.88rem;
    min-height: 44px;
    padding: 10px 13px;
  }

  .fretboard-wrapper {
    overflow-x: auto;
  }

  .fretboard {
    min-width: 720px;
  }

  .palette {
    gap: 10px;
  }

  .chord-pool {
    gap: 6px;
  }

  .chord-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .form-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.88rem;
    min-height: 44px;
    padding: 10px 13px;
  }

  .form-chip-wrap {
    position: relative;
  }

  .key-picker {
    min-width: min(92vw, 380px);
    padding: 14px;
    border-radius: 14px;
  }

  .key-picker-label {
    font-size: 0.86rem;
  }

  .key-picker-notes {
    gap: 8px;
  }

  .key-picker-notes button {
    min-height: 42px;
    font-size: 0.96rem;
    padding: 9px 10px;
  }

  .key-picker-modes .btn {
    min-height: 42px;
    font-size: 0.96rem;
    padding: 9px 14px;
  }

  .style-editor,
  .rhythm-editor,
  .form-editor {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    min-width: 0;
    width: min(320px, calc(100vw - 24px));
    padding: 12px;
    border-radius: 14px;
    max-height: min(56vh, 420px);
    overflow: auto;
    z-index: 45;
  }

  .style-editor,
  .rhythm-editor {
    left: 0;
  }

  .style-editor label,
  .rhythm-editor label,
  .form-editor label {
    font-size: 0.92rem;
    gap: 8px;
  }

  .style-editor select,
  .rhythm-editor select,
  .form-editor select {
    min-height: 44px;
    font-size: 16px;
    padding: 10px 12px;
  }

  .form-editor {
    left: 0;
  }

  .chord-popup {
    padding: 14px;
    border-radius: 14px;
    gap: 12px;
  }

  .chord-popup-title {
    font-size: 0.96rem;
  }

  .chord-popup .btn.small {
    min-height: 42px;
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .chord-popup-actions .btn {
    flex: 1 1 120px;
  }

  .chord-popup label {
    font-size: 0.9rem;
  }

  .chord-popup input[type="text"] {
    min-height: 44px;
    font-size: 16px;
  }

  .palette-drawer summary,
  .palette-section summary,
  .builder-details > summary {
    font-size: 0.92rem;
    min-height: 34px;
    line-height: 1.35;
    padding: 4px 0;
  }

  .progression-inline-add {
    display: none !important;
  }

  .progression-mobile-add {
    display: grid;
    grid-column: 1 / -1;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 2px auto 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(241, 245, 255, 0.92);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
  }

  .progression-mobile-add:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
  }

  .progression-section-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(18, 23, 38, 0.96);
    padding: 3px 0;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer.footer-credits {
    align-items: center;
  }

  .footer-attribution {
    white-space: normal;
  }

  .footer.footer-credits .footer-shortcuts,
  .footer.footer-credits .footer-attribution + .footer-attribution {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  input[type="range"] {
    height: 24px;
  }

  .progression.large {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(96px, auto);
  }

  .progression-item strong {
    font-size: 1.5rem;
  }

  .progression-item span {
    font-size: 0.8rem;
  }

  .key-banner {
    font-size: 1.1rem;
    padding: 12px 18px;
    min-height: 52px;
  }

  .tempo-pill {
    min-height: 0;
    padding: 0;
  }

  .tempo-pill .tempo-wrap {
    gap: 8px;
  }

  .tempo-inline-input {
    min-width: 78px;
    height: 34px;
  }

  .tempo-step {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 1.22rem;
  }

  .progression.large {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(96px, auto);
    overflow: visible;
    gap: 8px;
  }

  .progression-item {
    min-width: 0;
  }

  .progression-item strong {
    font-size: 1.1rem;
  }

  .card {
    padding: 14px;
  }

  .chord-editor,
  .generator {
    padding: 10px;
  }
}

/* KORDY Light Theme Overrides */
body {
  color: var(--text);
}

.logo-pick {
  display: none;
}

.card,
.hero-card,
.generator,
.chord-editor,
.now-playing,
.spicy-row {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(16, 24, 41, 0.12);
  box-shadow: 0 16px 40px rgba(37, 65, 130, 0.12);
}

.key-banner {
  background: linear-gradient(120deg, rgba(47, 108, 247, 0.94), rgba(65, 128, 255, 0.88));
  border-color: rgba(36, 88, 210, 0.65);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 108, 247, 0.24);
}

.key-banner span {
  color: #ffffff;
}

.key-picker,
.style-editor,
.rhythm-editor,
.chord-popup {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(16, 24, 41, 0.18);
  box-shadow: 0 16px 34px rgba(19, 42, 99, 0.16);
}

.key-picker-label,
.style-editor-head,
.style-editor-note,
.rhythm-editor label,
.note,
.editor-label,
.spicy-title,
.spicy-category,
.now-label,
.footer,
.footer-attribution {
  color: #5f6c86;
}

.key-picker-notes button,
.key-picker-modes .btn,
.style-editor select,
.rhythm-editor select,
select,
input {
  border-color: rgba(16, 24, 41, 0.18);
  background: #ffffff;
  color: #101829;
}

.key-picker-notes button.active,
.key-picker-modes button.active,
.editor-buttons .btn.active,
.progression-item.playing {
  background: rgba(47, 108, 247, 0.14);
  border-color: rgba(47, 108, 247, 0.46);
  color: #123783;
  box-shadow: 0 10px 24px rgba(47, 108, 247, 0.16);
}

.progression-item,
.chord-btn,
.progression-add {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(16, 24, 41, 0.14);
  color: #0f172a;
}

.progression-item strong,
.card-title,
.selected-chord {
  color: #0f172a;
  text-shadow: none;
}

.btn.primary,
.mobile-transport .btn.primary.play,
.transport-mini .btn.primary.play,
#generateProg.btn.primary.play {
  background: linear-gradient(135deg, #2f6cf7, #214fc2);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(47, 108, 247, 0.28);
}

.btn.ghost {
  color: #0f172a;
  border-color: rgba(16, 24, 41, 0.2);
  background: rgba(255, 255, 255, 0.75);
}

.style-pill,
.rhythm-pill {
  border-color: rgba(47, 108, 247, 0.28);
  background: rgba(47, 108, 247, 0.06);
  color: #24458f;
}

.style-pill:hover,
.rhythm-pill:hover {
  border-color: rgba(47, 108, 247, 0.42);
  color: #1f3f88;
}

.spicy-pill {
  background: rgba(47, 108, 247, 0.1);
  border-color: rgba(47, 108, 247, 0.35);
  color: #1f3f88;
}
