:root {
  --paper: #f4efe4;
  --card: #fffaf1;
  --ink: #1c1712;
  --muted: #5c4f40;
  --rule: #d7c8ae;
  --accent: #5a3a22;
  --accent-soft: #e6dac4;
  --play: #2d5a3d;
  --shadow: 0 1px 2px rgba(40, 24, 8, 0.08), 0 8px 24px rgba(40, 24, 8, 0.06);
  font-family: "Iowan Old Style", Palatino, Palatino Linotype, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, #fffdf8 0%, transparent 50%),
    var(--paper);
  color: var(--ink);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 28px 64px;
}

.masthead h1 {
  margin: 0 0 10px;
  font-size: 2.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
  font-family: system-ui, -apple-system, sans-serif;
}

.lede, .summary, .hint, .now {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.lede {
  margin: 0;
  max-width: 46rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.98rem;
}

.pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin: 28px 0 12px;
  padding: 18px 18px 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.scale-note {
  flex-basis: 100%;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent, #5a3a22);
  background: #f6efe6;
  border-radius: 6px;
  font: 0.88rem/1.4 system-ui, -apple-system, sans-serif;
  color: var(--ink);
}
.scale-note[hidden] { display: none; }
.prog-info {
  flex-basis: 100%;
  margin: -6px 0 8px;
  font: 0.82rem/1.4 system-ui, -apple-system, sans-serif;
  color: var(--muted);
}
.prog-info a { color: var(--accent); }

.pickers label,
.transport label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pickers select {
  min-width: 180px;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 500 0.95rem/1.2 system-ui, -apple-system, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

.summary {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.chords {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
}

/* Keep Play/Stop visible when a voicing menu is open. */
.chords:has(.dd.open) {
  padding-bottom: 220px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 14px 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.card.active {
  border-color: #1a6b66;
  background: #eef6ea;
  box-shadow: 0 0 0 3px #a8c97a, var(--shadow);
}

.numeral {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 2px;
  font-family: system-ui, -apple-system, sans-serif;
  /* no uppercase: vi vs VI and bVII carry meaning */
}

.chord-name {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.1;
}

.notes {
  margin: 8px 0 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
}

.bars-local {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.bars-local input {
  width: 52px;
  padding: 2px 4px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font: 0.8rem system-ui, sans-serif;
}

.dd {
  position: relative;
}

.dd-btn {
  width: 100%;
  text-align: left;
  padding: 8px 28px 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 500 0.9rem/1.3 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

.dd-btn::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  margin-top: 22px;
  border: 5px solid transparent;
  border-top-color: var(--muted);
  pointer-events: none;
}

.card .dd { position: relative; }

.card .dd-btn {
  position: relative;
}

.card .dd-btn::after {
  top: 50%;
  right: 10px;
  margin-top: -2px;
}

.dd-menu {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px 0;
}

.dd.open .dd-menu { display: block; }

.dd-group {
  padding: 4px 0 6px;
}

.dd-group-label {
  padding: 6px 10px 2px;
  font: 600 0.68rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dd-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font: 0.88rem/1.3 system-ui, sans-serif;
  color: var(--ink);
  cursor: pointer;
}

.dd-item:hover,
.dd-item:focus {
  background: #f3ead9;
  outline: none;
}

.dd-item.selected {
  background: var(--accent-soft);
  font-weight: 600;
}

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.btn {
  font: 600 0.95rem/1 system-ui, -apple-system, sans-serif;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.btn.primary {
  background: var(--play);
  border-color: var(--play);
  color: #fff;
}

.btn:disabled { opacity: 0.5; cursor: default; }

.check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95rem !important;
  color: var(--ink) !important;
}

.slider {
  min-width: 200px;
}

.slider input[type="range"] {
  width: 180px;
  accent-color: var(--accent);
}

.slider span {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
}

.now {
  margin: 14px 0 8px;
  font-weight: 600;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 40rem;
}

@media (max-width: 640px) {
  .page { padding: 24px 16px 48px; }
  .pickers select { min-width: 100%; max-width: 100%; }
  .chords { grid-template-columns: 1fr 1fr; }
  /* An odd last card (3-chord progressions) spans the row: no blank box. */
  .chords .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.transport-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  width: 100%;
}

.transport-row + .transport-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.transport label select {
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 500 0.95rem/1.2 system-ui, -apple-system, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

.chart-panel {
  margin: 8px 0 22px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 4px 18px 8px;
}

.chart-panel[open] {
  padding-bottom: 20px;
}

.chart-panel > summary {
  cursor: pointer;
  list-style: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 4px;
  color: var(--ink);
}

.chart-panel > summary::-webkit-details-marker { display: none; }

.chart-panel > summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border: 5px solid transparent;
  border-left-color: var(--accent);
  transform: translateY(-1px);
}

.chart-panel[open] > summary::before {
  border-left-color: transparent;
  border-top-color: var(--accent);
  transform: translate(2px, 1px);
}

.chart-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 42rem;
}

.chart-panel h3 {
  margin: 14px 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px 8px;
}

.chart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
}

.chart-item .chart-numeral {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.chart-item .chart-caption {
  margin: 2px 0 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
}

.chart-item .chord-diag {
  width: 124px;
  height: auto;
  display: block;
}

.chart-item.missing {
  min-height: 120px;
  justify-content: center;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  text-align: center;
}

/* ---- Neck view ---- */
.neck-panel {
  margin: 6px 0 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
}
.neck-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
}
.neck-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  margin-left: 6px;
}
.neck-tip {
  margin: 0 0 8px;
  color: var(--muted);
  font: 0.82rem/1.4 system-ui, -apple-system, sans-serif;
}
.neck-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.neck-svg svg {
  display: block;
  width: 766px;
  max-width: none;
  height: auto;
}
@media (min-width: 820px) {
  .neck-svg svg { width: 100%; }
}
.neck-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 0;
  font: 0.8rem/1.3 system-ui, -apple-system, sans-serif;
  color: var(--muted);
}
.neck-legend li { display: flex; align-items: center; gap: 6px; }
.neck-legend .sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid transparent;
}
.sw-chord { background: #1a6b66; border-color: #1a6b66 !important; }
.sw-scale { background: #a8c97a; border-color: #3f6e2e !important; }
.sw-outside { background: #e69f00; border-color: #8a5a00 !important; border-radius: 2px; width: 11px; height: 11px; transform: rotate(45deg); }
.sw-added { background: #3d9fd6; border-color: #005f96 !important; border-style: dashed !important; }
.sw-root { background: #a8c97a; border: 1.5px solid #3b2a1a !important; border-radius: 3px !important; }
.sw-croot { background: #1a6b66; border: 2.5px solid #3b2a1a !important; }
.card { cursor: pointer; }
.card.neck-focus:not(.active) { border-color: #3f6e2e; }

/* ---- Songs that use this progression ---- */
.songs-panel {
  margin: 0 0 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
}
.songs-panel[hidden] { display: none; }
.songs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.songs-head h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.seg-btn {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font: 600 0.85rem/1 system-ui, -apple-system, sans-serif;
  color: var(--muted);
  cursor: pointer;
  min-height: 36px;
}
.seg-btn.on { background: var(--accent); color: #fff; }
.songs-sub {
  margin: 8px 0 6px;
  color: var(--muted);
  font: 0.85rem/1.4 system-ui, -apple-system, sans-serif;
}
.songs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
}
.song {
  padding: 9px 2px;
  border-top: 1px solid var(--rule);
}
.song-top { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.song-title { font-weight: 700; font-size: 0.98rem; color: var(--ink); }
.song-artist { color: var(--muted); font-size: 0.9rem; }
.song-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}
.chip {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}
.song-key { color: var(--ink); font-weight: 600; }
.song-capo { color: #2a6f7a; font-weight: 600; }
.song-capo.same { color: var(--play); }
.song-src { color: var(--accent); }
.songs-more { display: block; width: 100%; margin: 10px 0 2px; min-height: 44px; }
.songs-more[hidden] { display: none; }
.songs-foot {
  margin: 8px 0 0;
  color: var(--muted);
  font: 0.75rem/1.4 system-ui, -apple-system, sans-serif;
}

/* ---- Pedalboard ---- */
.pedalboard {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.pb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-bottom: 12px; }
.pb-head h3 { margin: 0; font-size: 1.05rem; }
.pb-tip { flex: 1 1 320px; margin: 0; color: var(--muted); font-size: 0.85rem; }
.pb-master { display: flex; align-items: center; gap: 14px; }
#pb-master-knob { display: flex; gap: 10px; }
.pb-master .knob-wrap { color: var(--ink); }
.pb-master .knob-cap { background: radial-gradient(circle at 35% 30%, #6b5440, #2e241b 70%); }
.pb-pedals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, #2b2621 0 2px, #332d27 2px 6px);
}
.pedal {
  --pc: #5c4f40;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 210px;
  padding: 18px 8px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 88%, #fff 12%), var(--pc) 40%, color-mix(in srgb, var(--pc) 85%, #000 15%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -2px 0 rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.45);
  color: #fbf6ec;
}
.pedal-order { position: absolute; top: 5px; left: 8px; font-size: 0.65rem; opacity: 0.7; }
.led {
  position: absolute; top: 7px; right: 9px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #2a3a2c; border: 1px solid rgba(0,0,0,0.5);
  transition: background 0.12s, box-shadow 0.12s;
}
.pedal.on .led { background: #8dff9a; box-shadow: 0 0 8px 2px rgba(141,255,154,0.75); }
.pedal-knobs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; min-height: 92px; }
.pedal-knobs.k4 { display: grid; grid-template-columns: repeat(2, 40px); column-gap: 14px; }
.pedal-toggles { display: flex; justify-content: center; }
.pedal-toggles:empty { display: none; }
.mini-toggle {
  min-height: 32px; padding: 4px 10px; border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.45); background: rgba(0,0,0,0.25);
  color: #fbf6ec; font-size: 0.7rem; letter-spacing: 0.03em; cursor: pointer;
}
.mini-toggle[aria-pressed="true"] { background: #a8c97a; color: #1c1712; border-color: #a8c97a; }
.pedal-stereo {
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75;
}
.knob-wrap { display: flex; flex-direction: column; align-items: center; width: 40px; user-select: none; -webkit-user-select: none; }
.knob {
  width: 36px; height: 36px; border-radius: 50%;
  touch-action: none; cursor: ns-resize;
  background: #15120f; padding: 2px;
  box-shadow: 0 2px 3px rgba(0,0,0,0.5);
}
.knob:focus-visible { outline: 2px solid #fbf6ec; outline-offset: 2px; }
.knob-cap {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4440, #1c1917 70%);
}
.knob-cap::after {
  content: ""; position: absolute; left: 50%; top: 3px;
  width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px; background: #f4efe4;
}
.knob.turning .knob-cap { filter: brightness(1.25); }
.knob-label { font-size: 0.66rem; margin-top: 3px; letter-spacing: 0.02em; text-transform: uppercase; }
.knob-val { font-size: 0.68rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.pedal-name {
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; background: rgba(0,0,0,0.18);
}
.footswitch {
  margin-top: auto;
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid #9a9a9a;
  background: radial-gradient(circle at 40% 35%, #f2f2f2, #a7a7a7 55%, #6e6e6e);
  box-shadow: 0 3px 4px rgba(0,0,0,0.55);
  cursor: pointer;
}
.footswitch:active, .footswitch[aria-pressed="true"] { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.footswitch:focus-visible { outline: 2px solid #fbf6ec; outline-offset: 3px; }
@media (max-width: 640px) {
  .pb-pedals {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .pedal { flex: 0 0 162px; scroll-snap-align: start; }
  .knob { width: 40px; height: 40px; }
  .knob-wrap { width: 44px; }
  .pedal-knobs.k4 { grid-template-columns: repeat(2, 44px); }
  .mini-toggle { min-height: 44px; }
}

/* ---- Tap a song to load it ---- */
.song { cursor: pointer; border-radius: 8px; transition: background 0.12s; }
.song:hover { background: #f3ead9; }
.song:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.song.loaded { background: #eef6ea; box-shadow: inset 3px 0 0 #1a6b66; }
.song-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.song-time.approx { font-style: italic; }
.song-loaded {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: #eef6ea; border: 1px solid #a8c97a; color: var(--ink); font-size: 0.9rem;
}
.song-loaded[hidden] { display: none; }
.song-loaded .btn { min-height: 40px; }

/* Beat on/off with its own volume (Nov 22) */
.beat-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: system-ui, -apple-system, sans-serif; }
.beat-feel { font-size: 0.85rem; opacity: 0.8; }
.beat-knob .knob-wrap { width: 56px; color: var(--ink); }
.beat-knob .knob-label { white-space: nowrap; }
.beat-knob .knob-cap { background: radial-gradient(circle at 35% 30%, #6b5440, #2e241b 70%); }
.song-loaded { font-family: system-ui, -apple-system, sans-serif; }
.bars-local input[step="any"] { width: 72px; }
.beat-feel.off { opacity: 0.4; text-decoration: line-through; }

/* ---- Song Builder (Ken, Nov 23) ---- */
.builder {
  margin: 16px 0 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 4px 18px 10px;
  font-family: system-ui, -apple-system, sans-serif;
}
.builder[open] { padding-bottom: 18px; }
.builder > summary {
  cursor: pointer; list-style: none; padding: 12px 2px; color: var(--ink);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
}
.builder > summary::-webkit-details-marker { display: none; }
.builder > summary::before {
  content: ""; display: inline-block; width: 0; height: 0; border: 6px solid transparent;
  border-left-color: var(--accent); align-self: center;
}
.builder[open] > summary::before { border-left-color: transparent; border-top-color: var(--accent); transform: translate(2px, 3px); }
.sb-sum-title { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.sb-sum-sub { font-size: 0.88rem; color: var(--muted); }
.sb-h { margin: 18px 0 8px; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sb-hint { font-size: 0.82rem; color: var(--muted); margin: 6px 0; }
.sb-top, .sb-addrow, .sb-playrow, .sb-saverow, .sb-sheet-btns { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.builder label { display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.builder input[type="text"], .builder input[type="number"], .builder select {
  font: 0.95rem system-ui, -apple-system, sans-serif; padding: 8px 10px; border: 1px solid var(--rule);
  border-radius: 8px; background: #fff; color: var(--ink); min-height: 40px; box-sizing: border-box;
}
.builder .btn { min-height: 40px; }
.sb-templates-wrap { margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 4px; }
.sb-templates-wrap > summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--ink); }
.sb-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sb-tpl { background: #fffdf8; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.sb-tpl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sb-tpl h5 { margin: 0; font-size: 1rem; color: var(--ink); }
.sb-letters { font-size: 0.75rem; color: #fff; background: var(--accent); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.sb-about { margin: 0; font-size: 0.85rem; color: var(--ink); line-height: 1.4; }
.sb-layout { margin: 0; font-size: 0.78rem; color: var(--muted); }
.sb-use { align-self: flex-start; }
.sb-ex summary { cursor: pointer; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.sb-examples { margin: 6px 0 0; padding-left: 20px; font-size: 0.82rem; line-height: 1.45; }
.sb-ex-title { font-weight: 600; }
.sb-ex-note { color: var(--muted); }
.sb-examples a { color: var(--accent); }
.sb-sections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sb-section { border: 1px solid var(--rule); border-radius: 10px; background: #fffdf8; padding: 10px 12px; }
.sb-section.sb-active { border-color: #1a6b66; box-shadow: inset 4px 0 0 #1a6b66; background: #eef6ea; }
.sb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sb-fields { margin-top: 8px; align-items: flex-end; }
.sb-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex: none; }
.sb-name { flex: 1 1 140px; font-weight: 600; }
.sb-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.builder .sb-mini { padding: 6px 10px; min-height: 36px; font-size: 0.85rem; }
.sb-f-prog { flex: 2 1 200px; }
.sb-f-key { flex: 1 1 150px; }
.sb-repeat { width: 72px; }
.sb-tempo { width: 96px; }
.sb-tempo::placeholder { color: var(--muted); }
.sb-preview { margin: 8px 0 0; font-size: 0.9rem; color: var(--ink); }
.sb-keytext { font-size: 0.75rem; color: var(--muted); margin-right: 6px; }
.sb-empty { color: var(--muted); font-size: 0.9rem; }
.sb-playrow { margin-top: 16px; }
.sb-now { margin: 8px 0 0; font-size: 0.92rem; color: var(--ink); min-height: 1.3em; }
.sb-chart { display: flex; flex-direction: column; gap: 8px; }
.sb-block { border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; background: #fffdf8; }
.sb-block.sb-active { border-color: #1a6b66; background: #eef6ea; }
.sb-block-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.9rem; }
.sb-x { color: var(--accent); font-weight: 700; }
.sb-meta { color: var(--muted); font-size: 0.8rem; }
.sb-chords { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sb-chord { min-width: 64px; border: 1px solid var(--rule); border-radius: 8px; padding: 4px 8px; background: #fff; display: flex; flex-direction: column; align-items: center; }
.sb-chord.sb-active { background: #1a6b66; border-color: #1a6b66; color: #fff; }
.sb-chord.sb-active .sb-cnum, .sb-chord.sb-active .sb-cbars { color: #e4f3ef; }
.sb-cnum { font-size: 0.72rem; color: var(--muted); }
.sb-cname { font-weight: 700; font-size: 1rem; }
.sb-cbars { font-size: 0.68rem; color: var(--muted); }
.sb-sheet { margin-top: 14px; }
.sb-sheet > summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 6px 0; }
.sb-sheet-text { white-space: pre-wrap; font: 0.85rem/1.5 ui-monospace, Menlo, Consolas, monospace; background: #fffdf8; border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.sb-saverow { margin-top: 16px; border-top: 1px solid var(--rule); padding-top: 12px; }
.sb-status { font-size: 0.88rem; color: var(--accent); min-height: 1.2em; margin: 8px 0 0; }
@media (max-width: 600px) {
  .builder { padding: 2px 12px 8px; }
  .sb-fields label { flex: 1 1 45%; }
  .sb-f-prog { flex-basis: 100%; }
  .sb-templates { grid-template-columns: 1fr; }
  .sb-playrow .btn { flex: 1 1 40%; }
}
@media print {
  body.print-sheet * { visibility: hidden; }
  body.print-sheet .sb-sheet-text, body.print-sheet .sb-sheet-text * { visibility: visible; }
  body.print-sheet .sb-sheet-text { position: absolute; left: 0; top: 0; width: 100%; border: none; font-size: 11pt; }
}
/* Nov 23: long progression names made the picker wider than a phone screen */
.pickers label { min-width: 0; max-width: 100%; }
.pickers select { max-width: 100%; }

/* Phone audio (Nov 23) */
.audio-notice { font: 600 0.9rem system-ui, -apple-system, sans-serif; padding: 9px 14px; border-radius: 8px;
  border: 1px solid #b8860b; background: #fff6dc; color: var(--ink); cursor: pointer; }
.audio-notice[hidden] { display: none; }
.sound-hint { flex-basis: 100%; margin: 2px 0 0; font: 0.8rem system-ui, -apple-system, sans-serif; color: var(--muted); }

/* ---- Box patterns for lead (Nov 23) ---- */
.box-panel { margin-top: 16px; }
.box-lead, .box-tip { margin: 0 0 12px; font-size: 0.88rem; color: var(--muted, #5b4f43); }
.box-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 10px; }
.box-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; min-width: 0; max-width: 100%; }
.box-controls select { max-width: 100%; min-height: 36px; }
.box-controls .box-check, .box-actions .box-check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.box-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 8px; }
.box-actions .btn { min-height: 40px; }
.box-lead-toggle { font-size: 0.88rem; }
.box-suggest { margin: 4px 0 6px; font-size: 0.88rem; }
.linkish { background: none; border: 0; padding: 0 2px; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; }
.box-title { margin: 6px 0; font-size: 0.92rem; }
.neck-panel.lead-on { box-shadow: 0 0 0 2px #5a3a22 inset, var(--shadow); }
.box-panel [hidden] { display: none !important; }

/* ---- Mic play-along (Nov 23) ---- */
/* Red is reserved for wrong notes only (out of key while playing along). */
:root { --wrong: #c62828; --wrong-ink: #7f1515; }
.mic-panel { margin-top: 16px; }
.mic-panel [hidden] { display: none !important; }
.mic-warn { margin: 0 0 10px; font-size: 0.9rem; background: #f6ecd9; border-left: 4px solid #5a3a22; padding: 8px 10px; border-radius: 6px; }
.mic-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 8px; }
.mic-actions .btn { min-height: 44px; }
.mic-actions .box-check { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; }
.mic-status { margin: 4px 0 10px; font-size: 0.85rem; color: var(--muted, #5b4f43); }
.mic-bass-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 4px 0 8px; padding: 8px 10px; border: 1px solid #d8c7a8; border-radius: 10px; background: #f7efe2; }
.mic-bass-row[hidden] { display: none; }
.mic-bass-row .box-tip { flex-basis: 100%; margin: 0; }
.mic-bass-row .btn { min-height: 44px; }
.mic-bass-feedback { font-size: 0.88rem; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.mic-readout { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-bottom: 10px; }
.mic-tuner { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mic-note { font-size: 2rem; font-weight: 800; min-width: 3.2ch; color: var(--ink); }
.mic-meter { position: relative; width: 160px; max-width: 40vw; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #e9d9bd, #a8c97a 40%, #a8c97a 60%, #e9d9bd); }
.mic-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #3b2a1a; }
.mic-needle { position: absolute; left: 50%; top: -4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: #5a3a22; transition: left 80ms linear; }
.mic-cents { font-size: 0.85rem; min-width: 11ch; }
.mic-result { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; }
.mic-class { font-weight: 700; }
.mic-class[data-cls="chord"] { color: #1a6b66; }
.mic-class[data-cls="scale"] { color: #3f6e2e; }
.mic-class[data-cls="out"] { color: var(--wrong); }
.mic-panel.listening { box-shadow: 0 0 0 2px #1a6b66 inset, var(--shadow); }
.sw-wrong { background: var(--wrong); border-color: var(--wrong-ink) !important; position: relative; }
.sw-wrong::before, .sw-wrong::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 1.5px;
  background: #fff;
  transform-origin: center;
}
.sw-wrong::before { transform: translate(-50%, -50%) rotate(45deg); }
.sw-wrong::after { transform: translate(-50%, -50%) rotate(-45deg); }
.mic-bleed-tip { margin: 0 0 10px; font-size: 0.85rem; color: #5a3a22; }
@keyframes mic-hit-pulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.4; }
}
.mic-hits .mic-hit-halo { pointer-events: none; }
.mic-hits .mic-hit-pulse { animation: mic-hit-pulse 0.9s ease-in-out infinite; pointer-events: none; }

.mic-result { align-items: flex-start; }

/* Instrument picker (Nov 23) */
.inst-row { align-items: center; }
.inst-status { font-size: 0.9em; color: #6b5a4a; min-height: 1.2em; }
.inst-credits { font-size: 0.85em; color: #5a3a22; margin-left: auto; }

/* Record and export (Nov 23) */
.rec-panel { margin-top: 16px; }
.rec-panel [hidden] { display: none !important; }
.rec-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 8px 0; }
.rec-hint { font-size: 0.85rem; color: #6b5a4a; margin: 4px 0 8px; }
.rec-takes { margin: 6px 0; padding-left: 0; list-style: none; }
.rec-take { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid #e3d8c8; }
.rec-take-name { font-weight: 600; min-width: 60px; }
#rec-meter { width: 120px; }
.rec-export-links { display: flex; flex-wrap: wrap; gap: 10px; }
.rec-live { min-height: 1.3em; margin: 4px 0; }
.rec-review { flex-basis: 100%; }
.rec-review-score { margin: 2px 0 6px; font-size: 0.9rem; }
.rec-timeline { display: flex; flex-wrap: wrap; gap: 4px; }
.rec-bar { display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 3px 4px; border-radius: 6px; border: 1px solid #d8cbb8; background: #faf6ef; font-size: 0.75rem; line-height: 1.2; color: #3b2a1c; }
.rec-bar small { color: #6b5a4a; font-size: 0.7rem; }
.rec-bar.has-notes { background: #a8c97a; border-color: #3f6e2e; }
.rec-bar.has-out { background: #fff; border: 2px solid var(--wrong); }
.rec-bar.has-out i { font-style: normal; font-weight: 700; color: var(--wrong-ink); font-size: 0.7rem; }

/* Ear training + scale fit (Nov 23) */
.ear-panel, .fit-panel { margin-top: 16px; }
.ear-panel [hidden], .fit-panel [hidden] { display: none !important; }
.ear-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ear-choice { min-height: 44px; }
.ear-choice.right { background: #1a6b66; border-color: #1a6b66; color: #fff; }
.ear-choice.wrong { background: #fff; border: 2px solid var(--wrong); color: var(--wrong-ink); }
.ear-feedback { font-weight: 600; min-height: 1.4em; }
.ear-feedback.ok { color: #1a6b66; }
.ear-feedback.bad { color: var(--wrong-ink); }
.ear-score { color: var(--muted, #5c4f40); font-size: 0.92em; }
.tune-row input[type="number"] { width: 5.5em; }
.tune-preset[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.fit-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fit-list { list-style: none; padding: 0; margin: 8px 0; }
.fit-row { border-top: 1px solid var(--rule, #d9cbb0); padding: 10px 0; }
.fit-about { color: var(--muted, #5c4f40); font-size: 0.92em; }
.fit-notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.fit-note { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.6em; padding: 3px 4px; border-radius: 6px; background: #a8c97a; border: 1px solid #3f6e2e; }
.fit-note.ct { background: #1a6b66; border-color: #1a6b66; color: #fff; }
.fit-note.color { outline: 2px solid var(--accent); outline-offset: 1px; }
.fit-note small { font-size: 0.78em; }
.fit-tension { font-size: 0.92em; }
.fit-actions { margin-top: 6px; }
.ear-choice:disabled { opacity: 1; }
.ear-choice:disabled:not(.right):not(.wrong) { opacity: 0.55; }

/* Pitch trainer + fretboard note trainer (Nov 23) */
.pt-panel, .fb-panel { margin-top: 16px; }
.pt-honest { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 4px; }
.pt-answer, .fb-answer { min-height: 44px; min-width: 3.2em; }
.pt-answer.right, .fb-answer.right { background: #1a6b66; border-color: #1a6b66; color: #fff; }
.pt-answer.wrong, .fb-answer.wrong { background: #fff; border: 2px solid var(--wrong); color: var(--wrong-ink); }
.pt-answer:disabled, .fb-answer:disabled { opacity: 1; }
.pt-answer:disabled:not(.right):not(.wrong), .fb-answer:disabled:not(.right):not(.wrong) { opacity: 0.55; }
.pt-options { flex-direction: column; align-items: flex-start; }
.fb-panel .box-actions, .pt-panel .box-actions { margin-top: 14px; }
/* Keep the instrument status from reflowing the page while samples load
   (a reflow between touchend and click made iPhone taps land on the wrong control). */
#inst-status { display: block; flex: 1 1 100%; order: 3; min-height: 1.3em; line-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-footer { margin: 18px 0 8px; text-align: center; }
.app-footer .copyright { font-size: 0.85em; color: #6b5a4a; margin: 0; }
.app-footer .edition { font-size: 0.95em; color: #5a3a22; margin: 0 0 4px; }
.app-footer .edition a { color: #5a3a22; }

/* Teaching features C: modes by parent scale, chord builder */
.md-table-wrap { overflow-x: auto; margin: 8px 0; }
.md-table { border-collapse: collapse; font-size: 0.92em; min-width: 520px; }
.md-table th, .md-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid #e4d9cc; white-space: nowrap; }
.md-table tr.md-sel td { background: #f3e8d8; }
.md-table .md-char { color: #a86f10; }
.md-panel .box-actions, .cb-panel .box-actions { margin-top: 10px; }
.cb-name { font-size: 1.3em; color: #5a3a22; }
.cb-shapes .btn[aria-pressed="true"] { background: #5a3a22; color: #fff; border-color: #5a3a22; }
/* The sound notice floats instead of pushing the page down: on iPhone a
   notice that appeared mid-tap shifted the page and sent the tap to the
   control above (Nov 23, part C). */
.audio-notice:not([hidden]) { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; box-shadow: 0 4px 14px rgba(40, 28, 16, 0.25); max-width: calc(100vw - 32px); }

/* Teaching features D: arpeggios and triads, practice plan */
.ar-panel .box-actions, .pp-panel .box-actions { margin-top: 10px; }
.ar-shapes .btn[aria-pressed="true"], #ar-shapes .btn[aria-pressed="true"] { background: #5a3a22; color: #fff; border-color: #5a3a22; }
.pp-week { display: flex; gap: 6px; margin: 6px 0; }
.pp-day { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 0.8rem system-ui, sans-serif; border: 2px solid #c9b8a4; color: #6b5a4a; }
.pp-day.on { background: #5a3a22; border-color: #5a3a22; color: #fff; }
.pp-list { padding-left: 1.3em; }
.pp-list li { margin: 8px 0; }
.pp-list li.done strong { text-decoration: line-through; color: #6b5a4a; }

/* ---- Free Key-of-C sampler (P1, Nov 23 2026; sampler.html only) ---- */
.sampler-strip, .sampler-offer {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px; margin: 0 0 18px;
}
.sampler-tag { margin: 0 0 10px; font-weight: 600; }
.sampler-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.presale-btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  background: #a86f10; border-color: #a86f10; color: #fffaf1;
}
.presale-btn:hover { background: #8a5a0c; }
.sampler-offer h2 { margin: 0 0 8px; }
.sampler-offer ul { margin: 6px 0 12px; padding-left: 1.2em; }
body.sampler #mic-panel, body.sampler #rec-panel, body.sampler #box-patterns,
body.sampler #pp-panel, body.sampler #fit-panel, body.sampler #pt-panel,
body.sampler #fb-panel, body.sampler #md-panel, body.sampler #cb-panel,
body.sampler #ar-panel, body.sampler #pedalboard, body.sampler #songs-panel,
body.sampler #songwriter-panel, body.sampler #key-songs-panel { display: none; }
/* Step 11 (Nov 24): key change templates need all 12 keys, so the Key of C sampler hides them. */
body.sampler #sb-keychange-wrap { display: none; }
body.sampler #key-select { opacity: 0.85; }

/* ---- Stage Mode (P2, Nov 23 2026): charcoal, warm wood, amber ---- */
.masthead { position: relative; }
.stage-toggle { float: right; margin: 0 0 8px 12px; font-size: 0.85rem; }
html[data-theme="stage"] {
  --paper: #1d1915;
  --card: #29231d;
  --ink: #f1e6d2;
  --muted: #c4b092;
  --rule: #4d3f31;
  --accent: #e0a030;
  --accent-soft: #3d3024;
  --play: #3f7a52;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}
html[data-theme="stage"], html[data-theme="stage"] body {
  background: radial-gradient(1200px 500px at 10% -10%, #2c241c 0%, transparent 50%), var(--paper);
  color: var(--ink);
}
html[data-theme="stage"] .pickers select,
html[data-theme="stage"] .dd-btn,
html[data-theme="stage"] .dd-menu,
html[data-theme="stage"] .btn,
html[data-theme="stage"] .transport label select,
html[data-theme="stage"] .chart-item,
html[data-theme="stage"] .seg,
html[data-theme="stage"] .sb-tpl,
html[data-theme="stage"] .sb-section,
html[data-theme="stage"] .sb-block,
html[data-theme="stage"] .sb-chord,
html[data-theme="stage"] .sb-sheet-text,
html[data-theme="stage"] .builder input[type="text"],
html[data-theme="stage"] .builder input[type="number"],
html[data-theme="stage"] .builder select,
html[data-theme="stage"] .rec-bar,
html[data-theme="stage"] input[type="number"],
html[data-theme="stage"] select {
  background: #332b23; color: var(--ink); border-color: var(--rule);
}
html[data-theme="stage"] .btn.primary { background: #3f7a52; border-color: #3f7a52; color: #fffaf1; }
html[data-theme="stage"] .presale-btn { background: #e0a030; border-color: #e0a030; color: #1d1915; }
html[data-theme="stage"] .scale-note,
html[data-theme="stage"] .mic-warn,
html[data-theme="stage"] .audio-notice { background: #3d3024; color: var(--ink); }
html[data-theme="stage"] .card.active,
html[data-theme="stage"] .song.loaded,
html[data-theme="stage"] .song-loaded,
html[data-theme="stage"] .sb-section.sb-active,
html[data-theme="stage"] .sb-block.sb-active { background: #2f3a2c; }
html[data-theme="stage"] .dd-item:focus,
html[data-theme="stage"] .song:hover,
html[data-theme="stage"] .md-table tr.md-sel td { background: #3d3024; }
html[data-theme="stage"] .dd-item.selected { background: #4a3a28; }
html[data-theme="stage"] a { color: #e8b860; }
/* Diagrams and the neck stay on a warm light board so the dots read clearly. */
html[data-theme="stage"] .chart-item svg,
html[data-theme="stage"] .neck-svg svg { background: #efe3cc; border-radius: 6px; }
.sampler-offer { margin-top: 18px; }
body.sampler .page > p.hint { display: none; }

/* ---- Start Here tour (P3, Nov 23 2026) ---- */
.tour-invite {
  background: var(--card); border: 1px solid var(--rule); border-left: 4px solid #a86f10;
  border-radius: 12px; padding: 10px 14px; margin: 0 0 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.tour-invite p { margin: 0; flex: 1 1 260px; }
.tour-card {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px)); z-index: 50;
  background: var(--card); color: var(--ink); border: 2px solid #a86f10;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(40, 24, 8, 0.3); padding: 12px 14px;
}
.tour-card h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.tour-card p { margin: 0 0 10px; }
.tour-count { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.tour-actions { display: flex; gap: 8px; }
.tour-lit { outline: 3px solid #e0a030; outline-offset: 4px; border-radius: 12px; }
body.sampler .tour-invite, body.sampler #tour-again { display: none; }
.tour-invite[hidden], .tour-card[hidden] { display: none; }

/* ---- Band Stack, 4-string bass neck, Print This Key (Nov 23 2026, Ken t1466u/t1467u) ---- */
.band-stack {
  margin: 16px 0 18px; padding: 14px 16px 12px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow);
  font-family: system-ui, -apple-system, sans-serif;
}
.bs-head h3 { margin: 0 0 2px; font-size: 1.05rem; font-weight: 600; }
.bs-tip { margin: 0 0 10px; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.bs-presets-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.bs-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.bs-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-preset { padding: 7px 12px; font-size: 0.86rem; }
.bs-preset.on { background: #a86f10; border-color: #a86f10; color: #fffaf1; }
.bs-tracks { display: grid; gap: 8px; }
.bs-track {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 10px; border: 1px solid var(--rule); border-left: 5px solid #8a5a32;
  border-radius: 10px; background: rgba(255, 250, 241, 0.5);
}
.bs-guitar { border-left-color: #8a5a32; }
.bs-bass { border-left-color: #2f5d3a; }
.bs-keys { border-left-color: #1a6b66; }
.bs-drums { border-left-color: #a86f10; }
.bs-track.silent { opacity: 0.6; }
.bs-track.soloed { box-shadow: 0 0 0 2px #e0a030 inset; }
.bs-name { font-weight: 700; min-width: 56px; }
.bs-track .check { font-size: 0.88rem !important; }
.bs-solo { padding: 6px 10px; font-size: 0.82rem; }
.bs-solo.on { background: #e0a030; border-color: #a86f10; color: #1c1712; }
.bs-vol { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; min-width: 0; }
.bs-vol input[type="range"] { width: 110px; accent-color: var(--accent); }
.bs-vol-val { min-width: 2.2em; font-variant-numeric: tabular-nums; color: var(--muted); }
.bs-sel { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; }
.bs-sel select { min-height: 32px; max-width: 170px; }
.bs-summary { margin: 8px 0 0; font-size: 0.84rem; color: var(--accent); min-height: 1.2em; }
html[data-theme="stage"] .bs-track { background: #2f2820; }
html[data-theme="stage"] .bs-preset.on { background: #e0a030; border-color: #e0a030; color: #1d1915; }
html[data-theme="stage"] .bs-solo.on { background: #e0a030; color: #1d1915; }
@media (max-width: 600px) {
  .bs-track { gap: 6px 10px; }
  .bs-vol input[type="range"] { width: 90px; }
  .bs-sel select { max-width: 130px; }
}

.neck-head { position: relative; }
.neck-mode { display: inline-flex; gap: 0; margin: 4px 0 8px; border-radius: 9px; overflow: hidden; border: 1px solid var(--rule); }
.neck-mode-btn { border: 0; border-radius: 0; padding: 7px 12px; font-size: 0.84rem; background: transparent; }
.neck-mode-btn[aria-pressed="true"] { background: #2f5d3a; color: #fffaf1; }
html[data-theme="stage"] .neck-mode-btn { background: #332b23; }
html[data-theme="stage"] .neck-mode-btn[aria-pressed="true"] { background: #3f7a52; color: #fffaf1; }
.neck-panel.bass-mode .neck-svg svg { width: 766px; }
@media (min-width: 820px) { .neck-panel.bass-mode .neck-svg svg { width: 100%; } }
.neck-svg .bn-hit { cursor: pointer; }
.bass-guide { margin: 10px 0 0; font-family: system-ui, -apple-system, sans-serif; }
.bass-guide[hidden], .bass-legend[hidden], .neck-legend[hidden] { display: none; }
.bg-title { margin: 0 0 6px; font-size: 0.86rem; font-weight: 700; color: var(--accent); }
.bg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 12px; min-width: 112px; border-left: 5px solid #2f5d3a; text-align: left; }
.bg-item strong { font-size: 1.05rem; }
.bg-item small, .bg-label { font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.bg-5 { border-left-color: #1a6b66; }
.bg-8 { border-left-color: #8a5a32; }
.bg-approach { border-left-color: #e69f00; }
.bass-legend {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0;
  font: 0.8rem/1.3 system-ui, -apple-system, sans-serif; color: var(--muted);
}
.bass-legend li { display: flex; align-items: center; gap: 6px; }
.bass-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid transparent; }
.sw-b-r { background: #2f5d3a; border-color: #1c3a24 !important; }
.sw-b-3 { background: #e69f00; border-color: #8a5a00 !important; }
.sw-b-5 { background: #1a6b66; border-color: #145450 !important; }
.sw-b-7 { background: #8a5a32; border-color: #5a3a22 !important; }
.bass-legend .sw-scale { background: #e6f0dc; }

/* Bass scale shapes (Bass Edition B2) */
.bass-shape-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 8px; font: 0.86rem/1.3 system-ui, -apple-system, sans-serif; }
.bass-shape-bar[hidden] { display: none; }
.bass-shape-bar label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bass-shape-bar select { max-width: 100%; }
.bass-shape-info { flex-basis: 100%; margin: 0; color: var(--muted); }
.bass-legend .sw-shape { border-radius: 4px; border: 2px dashed #2f5d3a !important; background: rgba(47, 93, 58, 0.14); }

.print-key { margin-top: 4px; font-size: 0.88rem; padding: 8px 14px; }
.print-sheet { display: none; }
@media print {
  @page { size: letter portrait; margin: 0.4in; }
  html, body.printing-key { background: #fff !important; }
  body.printing-key .page, body.printing-key .tour-card, body.printing-key .tour-invite { display: none !important; }
  body.printing-key .print-sheet { display: block; }
}
/* the sheet itself: black on white, one US Letter page */
.ps-page { width: 7.7in; color: #000; background: #fff; font: 11pt/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; }
.ps-page * { color: #000; }
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
.ps-eyebrow { margin: 0; font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.08em; }
.ps-title { margin: 2px 0 0; font: 700 28pt/1.1 Georgia, "Times New Roman", serif; }
.ps-meta { margin: 0; text-align: right; font-size: 9.5pt; }
.ps-sec { margin: 0 0 16px; break-inside: avoid; }
.ps-sec h2 { margin: 0 0 6px; font-size: 11.5pt; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #000; padding-bottom: 2px; }
.ps-scale { border-collapse: collapse; }
.ps-scale th, .ps-scale td { border: 1px solid #000; padding: 5px 14px; text-align: center; font-size: 14pt; }
.ps-scale th { text-align: left; font-size: 8.5pt; text-transform: uppercase; }
.ps-scale td { font-weight: 700; }
.ps-chords { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 5px; }
.ps-chord { border: 1px solid #000; border-radius: 4px; padding: 3px 3px 4px; text-align: center; }
.ps-chord p { margin: 0; }
.ps-num { font: 700 12pt Georgia, serif; }
.ps-name { font-weight: 700; font-size: 13pt; }
.ps-notes { font-size: 10pt; }
.ps-7 { font-size: 9pt; }
.ps-bass { font-size: 10pt; margin: 4px 0 !important; line-height: 1.35; }
.ps-diag svg { width: 100%; max-width: 112px; height: auto; filter: grayscale(1) contrast(1.4); }
.ps-bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; border-left: 2px solid #000; }
.ps-bar { position: relative; border: 1px solid #000; border-left: 0; padding: 16px 5px 8px; min-height: 52px; display: flex; flex-direction: column; align-items: center; }
.ps-bar strong { font-size: 16pt; }
.ps-bar small { font-size: 9.5pt; }
.ps-barnum { position: absolute; top: 1px; left: 3px; font-size: 6.5pt; }
.ps-cont strong { font-weight: 400; }
.ps-neck svg { width: 100%; height: auto; }
.ps-tab svg { width: 100%; height: auto; display: block; }
/* bass sheet with tab (B4): a little tighter so it stays on one page */
.ps-has-tab .ps-sec { margin-bottom: 9px; }
.ps-has-tab .ps-scale th, .ps-has-tab .ps-scale td { padding: 3px 12px; font-size: 12.5pt; }
.ps-has-tab .ps-bar { min-height: 40px; padding: 13px 5px 4px; }
.ps-has-tab .ps-bar strong { font-size: 14pt; }
.ps-has-tab .ps-neck svg { width: 88%; }
.ps-neck-gtr svg rect[fill="#f1dcaa"] { fill: #fff; stroke: #000; stroke-width: 1; }
.ps-neck-gtr svg circle[data-inlay] { fill: #bbb; }
.ps-neck-gtr svg line { stroke: #333; }
.ps-neck-gtr svg [data-role="scale"] { fill: #fff; stroke: #000; }
.ps-neck-gtr svg [data-role="chord"] { fill: #000; stroke: #000; }
.ps-neck-gtr svg text { fill: #000; }
.ps-neck-gtr svg [data-role="chord"] + text { fill: #fff; }
.ps-foot { margin-top: 14px; padding-top: 5px; border-top: 1px solid #000; font-size: 8.5pt; text-align: center; letter-spacing: 0.02em; }
.sb-kc .sb-tpl-head { flex-direction: column; align-items: flex-start; gap: 4px; }
.sb-kc .sb-letters { white-space: normal; }

/* Name That Progression quiz (step 12, Nov 24 2026). Phone portrait first. */
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-choice { width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding: 8px 10px; }
.quiz-reveal { margin: 6px 0 8px; padding-left: 1.2em; color: var(--ink, #2b2621); }
.quiz-reveal li { margin: 3px 0; }
.quiz-lock { border-left: 3px solid var(--accent, #5a3a22); padding-left: 8px; }
.quiz-panel select option:disabled { color: var(--muted, #5c4f40); }
@media (max-width: 340px) { .quiz-choices { grid-template-columns: 1fr; } }

/* Fret trainer fix (Nov 29): the whole neck fits the screen, so the question
   dot is never scrolled out of sight on a phone held upright. */
.neck-svg svg.fb-diag { width: 100%; max-width: 640px; }
.fb-levelup {
  margin: 12px 0 8px;
  padding: 12px 14px;
  border: 2px solid #1f7a74;
  border-radius: 10px;
  background: #e6f3f1;
  color: #10403c;
  font-weight: 700;
  line-height: 1.4;
}
.fb-levelup[hidden] { display: none; }
html[data-theme="stage"] .fb-levelup { background: #1f3a37; color: #e8f4f2; border-color: #4fb3a9; }

/* Songs in this key (Nov 30, 2026) */
.key-songs-list .key-song-link { display: block; padding: 8px 4px; color: inherit; text-decoration: none; min-height: 44px; }
.key-songs-list .key-song-title { display: block; font-weight: 600; }
.key-songs-list .key-song-meta { display: block; font-size: 0.9em; opacity: 0.85; overflow-wrap: anywhere; }
.key-songs-list .key-song-book .key-song-title::after { content: " \2605"; color: #b8860b; }

/* Dec 1 2026: larger small print on phones (labels were 9-11.5px, hard to read in portrait). */
@media (max-width: 640px) {
  .eyebrow, .transport label, .builder label { font-size: 0.82rem; }
  .chart-item .chart-numeral, .chart-item .chart-caption, .sb-letters, .sb-layout, .sb-keytext, .sb-cnum, .rec-bar small { font-size: 0.82rem; }
  .knob-label { font-size: 0.72rem; letter-spacing: 0; }
  .knob-val { font-size: 0.74rem; }
  .pedal-stereo, .pedal-order { font-size: 0.7rem; letter-spacing: 0.04em; }
}
