﻿.patternsBanner .icon,
.patternsBanner .icon svg {
  width: 100px !important;
  height: 100px !important;
  min-width: 100px !important;
  min-height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
}

.wrap, .hero, .header.bannerHeader, .hero.hero-grid.hero-grid-patterns {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.patternIcon {
  position: relative;
  z-index: 2;

  width: 100px;
  height: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.patternIcon svg {
  width: 100%;
  height: 100%;
}

/* Ensure Patterns banner matches Keys banner layering */
.hero.hero-grid.hero-grid-patterns {
  background: none;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  border: none;
  box-shadow: none;
}
/* Static dotbeat strip for hero visuals */
.dotbeat-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px auto;
  max-width: 220px;
  padding: 18px 0;
}

.dotbeat-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #fff3b9, #f0c45b 72%);
  opacity: 0.92;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.72), 0 10px 22px rgba(7,14,30,0.5);
  display: inline-block;
}

.dotbeat-dot.strong {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 30% 24%, #ffe3a0, #d69425 78%);
  box-shadow: 0 0 0 2px rgba(255,248,219,0.76), 0 0 20px rgba(240,196,91,0.3);
}

:root {
  --bg-top: var(--site-bg-top, #0c1d3f);
  --bg-bottom: var(--site-bg-bottom, #112244);
  --panel: var(--site-panel, #0f2252);
  --panel-border: var(--site-panel-border, rgba(255, 255, 255, 0.18));
  /* Elevation system: body (dark stage) → card (white overlay = lighter) → inset (black overlay = darker) */
  --shell-bg: rgba(255, 255, 255, 0.05);
  --shell-border: rgba(255, 255, 255, 0.12);
  --surface-card: rgba(255, 255, 255, 0.08);
  --card-bg: var(--surface-card);
  --card-border-soft: rgba(255, 255, 255, 0.14);
  --inset-bg: rgba(0, 0, 0, 0.18);
  --inset-border: rgba(255, 255, 255, 0.10);
  --support-bg: rgba(255, 255, 255, 0.06);
  --support-bg-soft: rgba(255, 255, 255, 0.06);
  --support-border: rgba(255, 255, 255, 0.10);
  --scaffold-bg: rgba(255, 255, 255, 0.03);
  --scaffold-border: rgba(255, 255, 255, 0.07);
  --text: var(--site-text, #f5f7fb);
  --muted: #c6cfde;
  --gold: var(--site-gold, #e2b95f);
  --gold-bright: var(--site-gold-bright, #f0c45b);
  --teal: var(--ui-teal, #2d8b9f);
  --teal-light: var(--ui-teal-soft, #4fd1c5);
  --card-hover: rgba(240, 196, 91, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --beat-line: rgba(185, 192, 207, 0.28);
  --beat-line-strong: rgba(185, 192, 207, 0.5);
  --active-glow: rgba(240, 196, 91, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 0 24px 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.14), transparent 28%),
    radial-gradient(circle at 70% 80%, rgba(240, 196, 91, 0.07), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.wrap {
  margin: 0 auto;
}


.wordmark-inline {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  text-transform: none;
  letter-spacing: -0.03em;
}

.hero,
.pattern-card,
.related-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border-soft);
}

.hero {
  --hero-scene-width: min(50vw, 520px);
  --hero-scene-right: 44px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 18px;
  padding: 34px 38px 36px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.14), transparent 28%),
    linear-gradient(180deg, #0c1d3f 0%, #112244 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.hero-grid {
  background:
    radial-gradient(circle at top left, rgba(111, 87, 255, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(90, 170, 220, 0.14), transparent 28%),
    linear-gradient(180deg, #0c1d3f 0%, #112244 100%);
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 2;
}

.hero-copy {
  max-width: 760px;
  flex: 1 1 58%;
}

/* Match banner width to .wrap and center it */
.hero-ambient-lines span {
  position: absolute;
  left: 120px;
  right: -20px;
  height: 1px;
  background: rgba(214, 223, 238, 0.12);
}

.hero-ambient-lines span:nth-child(1) { top: 56px; }
.hero-ambient-lines span:nth-child(2) { top: 96px; }
.hero-ambient-lines span:nth-child(3) { top: 136px; }
.hero-ambient-lines span:nth-child(4) { top: 176px; }

.hero-visual {
  width: min(100%, var(--hero-scene-width));
  margin-right: var(--hero-scene-right);
  margin-left: 0;
  padding: 8px 0 0;
  flex: 0 1 34%;
}

.hero-visual-label {
  margin-bottom: 6px;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.hero-visual-grid {
  --grid-columns: 8;
  --grid-rows: 3;
  position: relative;
  min-height: 184px;
  padding: 14px 0 12px;
  border-radius: 24px;
  background: transparent;
  border: none;
  overflow: hidden;
}

.hero-visual-grid::after {
  display: none;
}

.hero-visual-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((100% / var(--grid-columns)) - 1px),
      rgba(255, 255, 255, 0.06) calc((100% / var(--grid-columns)) - 1px),
      rgba(255, 255, 255, 0.06) calc(100% / var(--grid-columns))
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% calc(100% / var(--grid-rows));
}

.hero-grid-nut {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(255, 229, 167, 0.95), rgba(240, 196, 91, 0.65));
  box-shadow: 0 0 18px rgba(240, 196, 91, 0.18);
  border-radius: 50%;
}

.hero-grid-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  left: calc(((var(--marker-col) - 0.5) / var(--grid-columns)) * 100%);
  top: calc(((var(--marker-row) - 0.5) / var(--grid-rows)) * 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 28%, #fff4c6, #f0c45b 76%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.68),
    0 0 18px rgba(240, 196, 91, 0.22);
}

.marker-col-1 { --marker-col: 1; }
.marker-col-3 { --marker-col: 3; }
.marker-col-4 { --marker-col: 4; }
.marker-col-5 { --marker-col: 5; }
.marker-col-8 { --marker-col: 8; }
.marker-row-1 { --marker-row: 1; }
.marker-row-2 { --marker-row: 2; }
.marker-row-3 { --marker-row: 3; }

.hero-grid-marker-strong {
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 30% 24%, #ffe3a0, #d69425 78%);
  box-shadow:
    0 0 0 1px rgba(255, 248, 219, 0.76),
    0 0 20px rgba(240, 196, 91, 0.3);
}

.hero-grid-marker-soft {
  opacity: 0.88;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.show-more-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #74d8d0, #58b8b0);
  color: #0d3533;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(88, 184, 176, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.show-more-btn:hover,
.show-more-btn:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: linear-gradient(180deg, #83ddd6, #4ca8a1);
  box-shadow: 0 16px 28px rgba(88, 184, 176, 0.22);
}

.page-shell {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.concept-shell {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.concept-intro {
  display: grid;
  gap: 18px;
  padding: 0;
  margin-bottom: 0;
}

.concept-copy h2 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.concept-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.concept-card-label {
  margin-bottom: 8px;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.concept-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.concept-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.concept-visual {
  overflow: hidden;
}

.concept-visual-image {
  display: block;
  width: 100%;
  height: auto;
}

.pattern-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.controls-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.panel-title {
  margin-bottom: 14px;
  color: rgba(240, 196, 91, 0.92);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.control-group,
.tempo-group {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.panel-note {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.sidebar-summary-card,
.sidebar-families-card {
  padding: 4px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sidebar-families-card {
  margin-top: 10px;
  padding: 12px 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-controls-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0;
}

.sidebar-summary-label {
  margin-bottom: 10px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-summary-title {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.sidebar-summary-meta {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-summary-meta div:first-child {
  color: var(--text);
  font-weight: 700;
}

.sidebar-summary-chords {
  margin-top: 14px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sidebar-summary-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-summary-copy-muted {
  padding-top: 12px;
  border-top: 0;
}

.sidebar-summary-card.empty .sidebar-summary-meta,
.sidebar-summary-card.empty .sidebar-summary-chords,
.sidebar-summary-card.empty .sidebar-summary-copy {
  display: none;
}

.family-list {
  display: grid;
  gap: 12px;
}

.family-item + .family-item {
  padding-top: 10px;
  border-top: 0;
}

.family-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.family-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.song-context-card {
  margin-top: 4px;
  padding: 18px 22px;
  border-radius: 24px;
  background: var(--support-bg-soft);
  border: 1px solid var(--support-border);
}

.supporting-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.song-context-label {
  margin-bottom: 8px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.song-context-title {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.song-context-formula {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.song-context-meta {
  margin-top: 6px;
  color: rgba(245, 247, 251, 0.92);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.panel-links {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.panel-link[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.panel-link.is-hidden {
  display: none;
}

.control-group span,
.tempo-group span {
  color: var(--muted);
  font-size: 13px;
}

.control-group select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.control-group select option {
  color: var(--text);
  background: #142449;
}

.control-group select:focus {
  outline: none;
  border-color: rgba(240, 196, 91, 0.34);
  box-shadow: 0 0 0 3px rgba(240, 196, 91, 0.08);
}

.tempo-control {
  justify-self: end;
}

.tempo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  width: 100%;
  max-width: 100%;
}

.tempo-slider {
  width: 92px;
  accent-color: #2d8b9f;
  cursor: pointer;
}

.tempo-time-sig {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tempo-time-sig strong {
  color: var(--gold-bright);
  font-weight: 800;
}

.tempo-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.tempo-label {
  margin-right: 4px;
  color: rgba(245, 247, 251, 0.78);
  font-size: 13px;
  font-weight: 600;
}


.tempo-unit {
  color: rgba(245, 247, 251, 0.72);
  font-size: 13px;
}

#tempoValue {
  min-width: 2ch;
  color: #f5f7fb;
  font-weight: 700;
  text-align: center;
}

.panel-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.action-btn {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 22px;
  font: inherit;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}

.action-play {
  background: linear-gradient(180deg, rgba(116, 216, 208, 0.96) 0%, rgba(88, 184, 176, 0.92) 100%);
  color: #0d3533;
  border: 1px solid rgba(88, 184, 176, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(5, 12, 28, 0.24);
}

.action-play:hover,
.action-play:focus-visible {
  border-color: rgba(88, 184, 176, 0.72);
  background: linear-gradient(180deg, rgba(131, 221, 214, 0.98) 0%, rgba(76, 168, 161, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 22px rgba(5, 12, 28, 0.28);
}

.action-play.is-active {
  border-color: rgba(88, 184, 176, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(45, 139, 159, 0.2),
    0 12px 24px rgba(5, 12, 28, 0.3);
}

.main-panel {
  display: grid;
  gap: 18px;
}

.combo-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1.15fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 20px;
}

.pattern-card,
.related-card {
  border-radius: 24px;
  padding: 24px 26px;
}

.flow-helper {
  border-radius: 24px;
  padding: 18px 20px 20px;
  background: linear-gradient(180deg, rgba(28, 48, 86, 0.9), rgba(18, 34, 66, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(6, 12, 28, 0.18);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.flow-helper-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.flow-helper-text {
  margin: 0 0 10px;
}

.pattern-header,
.related-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(240, 196, 91, 0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pattern-header h2,
.related-header h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.related-header h3 {
  font-size: 28px;
}

.pattern-meta {
  min-width: 140px;
  text-align: right;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.pattern-meta strong {
  color: var(--gold-bright);
}

.pattern-description,
.related-header p,
.animator-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.notation-card,
.animator-card {
  margin-top: 20px;
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: var(--inset-bg);
  border: 1px solid var(--inset-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 26px rgba(6, 12, 28, 0.18);
}

.combo-detail-row .notation-card,
.combo-detail-row .song-context-card {
  margin-top: 0;
  height: 100%;
}

.combo-detail-row .song-context-card {
  justify-self: stretch;
  width: 100%;
  background: var(--inset-bg);
  border: 1px solid var(--inset-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 26px rgba(6, 12, 28, 0.18);
}

.animator-card {
  margin-top: 24px;
  padding: 24px 22px 20px;
  border-color: rgba(240, 196, 91, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 30px rgba(6, 12, 28, 0.2),
    0 0 0 1px rgba(240, 196, 91, 0.04);
}

.notation-label,
.animator-label {
  margin-bottom: 10px;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.animator-label .brand-dot {
  color: var(--text);
}

.animator-label .brand-beat {
  color: var(--gold);
}

.notation-value {
  font-size: 24px;
  letter-spacing: 0.08em;
  word-spacing: 0.18em;
  overflow-wrap: anywhere;
}

.notation-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.animator-intro {
  margin: 0 0 18px;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.animator-controls {
  margin-bottom: 18px;
  width: 100%;
}

.animator-controls > * {
  min-width: 0;
}

.inline-control {
  margin-bottom: 0;
}

.animator-support-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.support-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: end;
}

.support-song-select {
  margin-bottom: 0;
}

.animator-support-stack .supporting-group {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.inline-actions {
  display: grid;
  grid-template-columns: minmax(180px, 224px) auto minmax(0, max-content);
  align-items: center;
  gap: 16px;
  margin: 0;
  width: 100%;
}

.listen-status {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.animator-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 78px;
}

.toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(245, 247, 251, 0.88);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.toggle-option:focus-visible {
  outline: none;
}

.toggle-checkbox {
  position: relative;
}

.toggle-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-box {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.toggle-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #f5f7fb;
  border-bottom: 2px solid #f5f7fb;
  opacity: 0;
  transform: rotate(45deg) scale(0.82);
  transition: opacity 0.14s ease;
}

.toggle-text {
  color: rgba(245, 247, 251, 0.88);
}

.toggle-checkbox input:checked + .toggle-box,
.listen-toggle.is-active .toggle-box {
  border-color: rgba(90, 170, 220, 0.72);
  background: linear-gradient(180deg, rgba(45, 139, 159, 0.92) 0%, rgba(32, 98, 120, 0.96) 100%);
  box-shadow: 0 0 0 1px rgba(45, 139, 159, 0.18);
}

.toggle-checkbox input:checked + .toggle-box::after,
.listen-toggle.is-active .toggle-box::after {
  opacity: 1;
}

.toggle-option:hover .toggle-box,
.toggle-option:focus-visible .toggle-box {
  border-color: rgba(90, 170, 220, 0.5);
}

.listen-toggle[aria-pressed="true"] .toggle-text {
  color: #f5f7fb;
}

.listen-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}

.listen-toggle:disabled .toggle-box {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.listen-toggle[hidden] {
  display: none;
}

.listen-toggle:not([hidden]) {
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(90, 170, 220, 0.46);
  background: linear-gradient(180deg, rgba(45, 139, 159, 0.18), rgba(32, 98, 120, 0.14));
  margin-top: 2px;
}

.listen-toggle:not([hidden]):not(:disabled):hover,
.listen-toggle:not([hidden]):not(:disabled):focus-visible {
  border-color: rgba(90, 170, 220, 0.64);
  background: linear-gradient(180deg, rgba(45, 139, 159, 0.26), rgba(32, 98, 120, 0.2));
  outline: none;
}

.listen-toggle.is-active:not([hidden]) {
  border-color: rgba(90, 170, 220, 0.72);
  background: linear-gradient(180deg, rgba(45, 139, 159, 0.36), rgba(32, 98, 120, 0.3));
}

.listen-toggle .toggle-text::before {
  content: "♪ ";
  opacity: 0.78;
}

.dot-track-shell {
  position: relative;
  margin-top: 8px;
  width: 100%;
  min-width: 0;
  padding: 24px 20px 46px;
  border-radius: 24px;
  overflow: hidden;
}

.dot-track {
  display: grid;
  gap: 0;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.dot-track.step-count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dot-track.step-count-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dot-track.step-count-8 {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.dot-track.step-count-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.dot-track.step-count-16 {
  grid-template-columns: repeat(16, minmax(0, 1fr));
}

.track-slot {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-slot.beat-start::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  bottom: 18px;
  width: 1px;
  background: var(--beat-line);
}

.track-slot.bar-start::before {
  background: var(--beat-line-strong);
}

.track-slot-label {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
}

.track-rest-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  min-height: 20px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  transform: translateY(2px);
}

.stroke {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0.92;
  transition: transform 0.28s ease-out, opacity 0.28s ease-out;
}

.stroke-dot {
  width: var(--dot-size, 12px);
  height: var(--dot-size, 12px);
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #fff3b9, #f0c45b 72%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(7, 14, 30, 0.5);
  transition: transform 0.28s ease-out, background 0.28s ease-out, box-shadow 0.28s ease-out;
}

/* Standardize dot sizes — direction, not duration */
.stroke .stroke-dot {
  width: 13px;
  height: 13px;
}

.stroke.down .stroke-dot {
  width: 17px;
  height: 17px;
  background: radial-gradient(circle at 28% 22%, #ecfccb, #65a30d 76%);
  box-shadow:
    0 0 0 1px rgba(220, 252, 180, 0.72),
    0 10px 22px rgba(7, 14, 30, 0.56);
}

.stroke.down.normal .stroke-dot {
  opacity: 0.88;
}

.stroke.down.accent .stroke-dot {
  box-shadow:
    0 0 0 1px rgba(220, 252, 180, 0.86),
    0 0 0 4px rgba(101, 163, 13, 0.16),
    0 12px 24px rgba(7, 14, 30, 0.6);
}

.stroke.up .stroke-dot {
  background: radial-gradient(circle at 28% 22%, #bfdbfe, #2563eb 76%);
  box-shadow:
    0 0 0 1px rgba(191, 219, 254, 0.78),
    0 8px 18px rgba(7, 14, 30, 0.34);
}

.stroke.up.light .stroke-dot {
  opacity: 0.7;
}

.stroke.up.accent .stroke-dot {
  background: radial-gradient(circle at 28% 22%, #bfdbfe, #2563eb 76%);
  box-shadow:
    0 0 0 1px rgba(191, 219, 254, 0.86),
    0 0 0 4px rgba(37, 99, 235, 0.16),
    0 10px 22px rgba(7, 14, 30, 0.42);
}

.stroke.mute .stroke-dot,
.stroke.chuck .stroke-dot {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(240, 196, 91, 0.94) 0%, rgba(180, 115, 21, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 243, 210, 0.7),
    0 10px 20px rgba(7, 14, 30, 0.46);
}

.stroke-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: -1;
  width: 1em;
  min-height: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", sans-serif;
}

.stroke.accent .stroke-arrow {
  color: rgba(255, 239, 188, 0.94);
}

.stroke.light .stroke-arrow {
  color: rgba(255, 255, 255, 0.42);
}

.stroke.mute .stroke-arrow {
  font-size: 12px;
  min-height: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.stroke.active {
  opacity: 1;
  transform: translateY(-2px);
  transition: transform 0.05s ease-out, opacity 0.05s ease-out;
}

.stroke.primed .stroke-dot,
.track-slot.is-primed .stroke-dot {
  transform: scale(1.14);
  box-shadow:
    0 0 0 1px rgba(255, 244, 210, 0.72),
    0 0 14px rgba(240, 196, 91, 0.42),
    0 0 0 3px rgba(240, 196, 91, 0.14);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.stroke.active .stroke-dot {
  background: var(--gold-bright);
  box-shadow:
    0 0 0 4px var(--active-glow),
    0 0 22px rgba(255, 179, 71, 0.42);
  transform: scale(1.08);
  transition: transform 0.05s ease-out, background 0.05s ease-out, box-shadow 0.05s ease-out;
}

.stroke.active .stroke-arrow {
  color: rgba(255, 227, 160, 0.92);
}

.playhead-line {
  position: absolute;
  top: 14px;
  bottom: 30px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(250, 250, 255, 0.38), rgba(240, 196, 91, 0.28));
  box-shadow: 0 0 16px rgba(240, 196, 91, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition: opacity 0.15s ease;
}

.animator-summary {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.dot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #ffd97a, #c7861e 76%);
  box-shadow:
    0 0 0 1px rgba(255, 244, 210, 0.72),
    0 8px 18px rgba(7, 14, 30, 0.5);
}

.legend-dot.stroke-down {
  background: radial-gradient(circle at 28% 22%, #ecfccb, #65a30d 72%);
  width: 13px;
  height: 13px;
}

.legend-dot.stroke-up {
  background: radial-gradient(circle at 28% 22%, #bfdbfe, #2563eb 72%);
}

.legend-dot.stroke-chuck {
  background: linear-gradient(180deg, rgba(240, 196, 91, 0.94) 0%, rgba(180, 115, 21, 0.98) 100%);
  border-radius: 3px;
}

.note-sixteenth {
  width: 8px;
  height: 8px;
}

.note-eighth {
  width: 12px;
  height: 12px;
}

.note-quarter {
  width: 17px;
  height: 17px;
}

.note-half {
  width: 23px;
  height: 23px;
}

.note-whole {
  width: 30px;
  height: 30px;
}

.inline-actions {
  margin: 0;
}

.inline-actions .action-btn {
  white-space: nowrap;
}

.related-songs {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-songs-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.request-song-panel {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.request-song-intro {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.request-song-trigger {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold-bright);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.request-song-trigger:hover,
.request-song-trigger:focus-visible {
  text-decoration: underline;
}

.request-song-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.request-song-form h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 24px;
}

.request-song-copy,
.request-song-help {
  margin: 0;
  color: var(--muted);
}

.request-song-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.request-song-field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.request-song-field span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.request-song-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 24, 49, 0.5);
  color: var(--text);
  font: inherit;
}

.request-song-field input:focus {
  outline: none;
  border-color: rgba(240, 196, 91, 0.34);
  box-shadow: 0 0 0 3px rgba(240, 196, 91, 0.08);
}

.request-song-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.request-song-submit {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f4ca63, #ebb948);
  color: #15233f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.request-song-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 14px;
}

.request-song-help {
  margin-top: 10px;
  font-size: 13px;
}

.related-song {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  position: relative;
  overflow: hidden;
}

.related-song::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light), var(--gold-bright));
  opacity: 0.72;
}

.related-song:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: rgba(79, 209, 197, 0.26);
}

.related-song:focus-visible {
  outline: 2px solid rgba(79, 209, 197, 0.7);
  outline-offset: 2px;
}

.related-song-title {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.related-song-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.related-song-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.related-song-badge-both {
  background: rgba(240, 196, 91, 0.14);
  color: var(--gold-bright);
  border: 1px solid rgba(240, 196, 91, 0.28);
}

.related-song-badge-progression,
.related-song-badge-pattern {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.feel-badge {
  --feel-accent: #f0c45b;
  --feel-bg: rgba(240, 196, 91, 0.14);
  --feel-border: rgba(240, 196, 91, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--feel-bg) 84%, rgba(15, 27, 58, 0.44)), rgba(10, 18, 40, 0.52)),
    var(--feel-bg);
  border: 1px solid var(--feel-border);
  color: rgba(245, 247, 251, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 22px color-mix(in srgb, var(--feel-accent) 22%, transparent);
}

.feel-badge-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 14px;
  color: var(--feel-accent);
}

.feel-badge-mark svg {
  width: 24px;
  height: 14px;
  overflow: visible;
}

.feel-badge-mark path,
.feel-badge-mark line,
.feel-badge-mark polyline,
.feel-badge-mark circle {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 32%, transparent));
}

.feel-badge-mark circle[fill] {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}

.feel-badge::after {
  content: '';
  width: 1px;
  height: 14px;
  background: color-mix(in srgb, var(--feel-accent) 26%, rgba(255, 255, 255, 0.08));
}

.feel-badge-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.24);
}

.siteFooter {
  width: min(1320px, 96vw);
  margin: 22px auto 0;
  padding: 18px 32px 28px;
  text-align: center;
  color: rgba(222, 232, 244, 0.82);
  font-size: 0.92rem;
  line-height: 1.6;
}

.siteFooter .footerTitle,
.siteFooter .footerText,
.siteFooter .footerContact,
.siteFooter .footerMeta,
.siteFooter .footerShareText {
  text-align: center;
}

.siteFooter .footerTitle {
  font-weight: 700;
  color: #f5f7fb;
  margin-bottom: 6px;
}

.siteFooter .footerText {
  max-width: 900px;
  margin: 0 auto 10px;
  line-height: 1.7;
}

.siteFooter .footerContact {
  margin-bottom: 8px;
  color: rgba(222, 232, 244, 0.9);
}

.siteFooter .footerContactLink {
  color: #f5f7fb;
  text-decoration: none;
}

.siteFooter .footerContactLink:hover,
.siteFooter .footerContactLink:focus-visible {
  text-decoration: underline;
}

.footerShare {
  margin-bottom: 8px;
}

.footerShareLinks {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footerShareLink {
  color: #f5f7fb;
  text-decoration: none;
}

.footerShareLink:hover,
.footerShareLink:focus-visible {
  text-decoration: underline;
}

.footerShareSep {
  color: rgba(185, 192, 207, 0.9);
}

.siteFooter .footerMeta {
  font-size: 0.88rem;
  color: rgba(185, 192, 207, 0.9);
}

.siteFooter .footerWordmark {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.03em;
}

.siteFooter .footerWordmark .brand-dot {
  color: #f5f7fb;
}

.siteFooter .footerWordmark .brand-beat {
  color: var(--gold);
}

.siteFooter .footerWordmark .brand-tm {
  display: inline-block;
  margin-left: 1px;
  font-size: 0.5em;
  color: #f5f7fb;
  opacity: 0.92;
  vertical-align: text-top;
  transform: translateY(0.02em);
}

@media (max-width: 1200px) {
  .inline-actions {
    grid-template-columns: minmax(132px, 180px) minmax(0, 1fr);
    align-items: start;
  }

  .action-play {
    order: 1;
    grid-column: 1;
    min-width: 0;
  }

  .tempo-control {
    order: 2;
    grid-column: 2;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .tempo-pill {
    width: 100%;
    min-width: 0;
  }

  .animator-toggle-group {
    order: 3;
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .pattern-layout {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    position: static;
    gap: 6px;
    padding-top: 14px;
    padding-bottom: 16px;
  }

  .panel-title {
    margin-bottom: 0;
  }

  .sidebar-controls-group {
    display: flex;
    flex-direction: column;
    order: 1;
    margin-top: 0;
    padding-top: 0;
  }

  .control-progress {
    order: 1;
  }

  .control-key {
    order: 2;
  }

  .control-pattern {
    order: 3;
  }

  .sidebar-families-card {
    order: 4;
  }

  .sidebar-summary-card {
    order: 5;
  }

  .panel-note {
    order: 6;
    margin: 0 0 8px;
  }

  .sidebar-families-card {
    margin-top: 8px;
  }

  .sidebar-summary-card,
  .sidebar-families-card {
    padding: 8px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar-summary-copy-muted,
  .family-item + .family-item {
    border-top: 0;
    padding-top: 8px;
  }

  .combo-detail-row {
    grid-template-columns: 1fr;
  }

  .related-songs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-song-fields {
    grid-template-columns: 1fr;
  }

  .request-song-actions {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .controls-panel {
    gap: 6px;
  }

  .panel-title,
  .sidebar-controls-group {
    margin: 0;
  }

  .pattern-card {
    display: flex;
    flex-direction: column;
  }

  .animator-card {
    order: 1;
  }

  .animator-support-stack {
    order: 2;
  }

  .combo-detail-row {
    order: 3;
    gap: 0;
  }

  .support-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .support-song-select {
    order: 1;
  }

  .song-context-card {
    order: 2;
  }

  .combo-detail-row .notation-card,
  .combo-detail-row .song-context-card {
    margin-top: 0;
    padding: 12px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .combo-detail-row .notation-card,
  .combo-detail-row .song-context-card {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .notation-card .notation-label,
  .song-context-card .song-context-label {
    margin-bottom: 8px;
  }

  .animator-card,
  .song-context-card,
  .sidebar-summary-card,
  .sidebar-families-card,
  .flow-helper {
    box-shadow: none;
  }

  .song-context-card,
  .sidebar-summary-card,
  .sidebar-families-card,
  .flow-helper {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .combo-detail-row .notation-card,
  .combo-detail-row .song-context-card {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    padding: 12px 0 0 !important;
  }

  .combo-detail-row .song-context-card {
    margin-top: 10px;
  }

  .controls-panel .sidebar-summary-card,
  .controls-panel .sidebar-families-card {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  .request-song-panel {
    display: none !important;
  }
}

@media (max-width: 980px) {
  body {
    padding: 0 16px 16px;
  }

  .pattern-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .main-panel {
    display: contents;
  }

  .pattern-card {
    order: 1;
    border-radius: 24px;
  }

  .controls-panel {
    order: 2;
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border-soft);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  }

  .panel-title {
    margin-bottom: 8px;
  }

  .sidebar-controls-group {
    display: grid;
    gap: 6px;
  }

  .control-progress,
  .control-key,
  .control-pattern {
    display: grid !important;
  }

  .sidebar-summary-card {
    padding: 12px 0 0;
    margin-top: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-families-card {
    margin-top: 8px;
    padding: 12px 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .panel-note {
    margin: 0;
  }

  .related-card {
    order: 3;
    border-radius: 24px;
  }

  .request-song-panel {
    display: none;
  }

  .page-shell {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .siteFooter {
    margin-top: 18px;
    padding: 16px 18px 24px;
  }

  .nav-inner {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .nav-inner::-webkit-scrollbar {
    display: none;
  }

  .nav-links {
    width: auto;
    flex-wrap: nowrap;
    flex: 0 0 auto;
  }

  .nav-link {
    flex: 0 0 auto;
  }

  .hero,
    .pattern-card,
    .related-card,
    .concept-shell,
  .controls-panel {
    padding: 20px;
  }

  .hero,
  .pattern-header,
  .related-header {
    display: grid;
  }

  .patternsBanner {
    gap: 10px;
    padding: 14px 16px;
    min-height: 104px;
  }

  .patternsBanner .brandText {
    min-width: 0;
    max-width: 100%;
  }

  .patternsBanner .brandTitle {
    font-size: clamp(2rem, 7vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    overflow-wrap: normal;
    word-break: normal;
  }

  .patternsBanner .brandTag {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.45;
    max-width: none;
  }

  .hero-ambient-lines span {
    left: 20px;
    right: 20px;
  }

  .hero-visual {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .animator-controls {
    margin-bottom: 14px;
  }

  .inline-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: 100%;
    align-items: start;
  }

  .action-play,
  .tempo-control {
    width: auto;
  }

  .action-play {
    grid-column: 1;
  }

  .tempo-control {
    grid-column: 2;
    justify-self: end;
  }

  .animator-toggle-group {
    grid-column: 1 / -1;
  }

  .pattern-meta {
    min-width: 0;
  }
  .pattern-header h2,
  .related-header h3 {
    margin: 0;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.02em;
  }

  .pattern-meta {
    text-align: left;
  }

  .animator-card {
    margin-top: 18px;
    padding: 18px 16px 16px;
    border-radius: 24px;
  }

  .animator-intro {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.45;
  }

  .animator-toggle-group {
    flex-direction: row;
    gap: 16px;
    min-width: 0;
  }

  .tempo-pill {
    min-height: 42px;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .tempo-slider {
    width: 100px;
  }

  .dot-track-shell {
    overflow-x: hidden;
    border-radius: 28px;
    padding: 16px 12px 30px;
  }

  .dot-track {
    width: 100%;
    min-width: 0;
  }

  .track-slot {
    min-height: 56px;
  }

  .track-slot-label {
    font-size: 11px;
  }

  .dot-legend {
    gap: 10px;
  }

  .related-songs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 12px 12px;
  }

  .concept-copy h2 {
    font-size: 24px;
  }

  .pattern-card,
  .related-card,
  .concept-shell,
  .controls-panel {
    padding: 16px;
  }

  .request-song-panel {
    display: none !important;
  }

  .request-song-form h2 {
    font-size: 22px;
  }

  .page-shell {
    padding: 0;
  }

  .hero-visual-grid {
    min-height: 148px;
  }

  .footerShareLinks {
    gap: 6px;
  }

  .nav-link {
    flex-basis: auto;
    padding: 0 10px;
    font-size: 13px;
  }

  .controls-panel {
    position: static;
    background: var(--card-bg);
    border-color: var(--card-border-soft);
    box-shadow: none;
  }

  .panel-note {
    margin-bottom: 12px;
  }

  .sidebar-summary-card {
    padding: 12px 0 0;
    margin-top: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-families-card {
    margin-top: 8px;
    padding: 12px 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .controls-panel .sidebar-summary-card {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .controls-panel .sidebar-families-card {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  .combo-detail-row .notation-card,
  .combo-detail-row .song-context-card {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    padding: 12px 0 0 !important;
  }

  .combo-detail-row .notation-card,
  .combo-detail-row .song-context-card {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .sidebar-summary-copy-muted,
  .family-item + .family-item {
    border-top: 0;
    padding-top: 8px;
  }

  .related-songs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .animator-controls {
    gap: 8px;
  }

  .inline-actions {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .inline-actions > * {
    min-width: 0;
  }

  .tempo-control {
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-self: stretch;
  }

  .tempo-pill {
    display: grid;
    grid-template-columns: auto minmax(68px, 1fr) max-content;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 40px;
    padding: 0 6px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
  }

  .tempo-label {
    width: auto;
    margin-right: 0;
    text-align: left;
    white-space: nowrap;
    font-size: 12px;
  }

  .tempo-slider {
    width: 100%;
    min-width: 0;
  }

  .tempo-unit,
  #tempoValue {
    white-space: nowrap;
    font-size: 12px;
  }

  .tempo-unit {
    display: none;
  }

  .action-play {
    min-width: 0;
    padding: 0 10px;
    min-height: 40px;
    border-radius: 12px;
  }

  .animator-support-stack {
    gap: 10px;
    margin-top: 16px;
  }

  .support-row {
    gap: 0;
  }

  .panel-links,
  .supporting-group {
    padding-left: 0;
    padding-right: 0;
  }

  .panel-links .panel-link + .panel-link {
    margin-top: 8px;
  }

  .dot-track {
    min-width: 0;
  }

  .legend-item {
    font-size: 11px;
  }
}

