:root {
  --color-primary: #52f989;
  --color-primary-dim: #3dd472;
  --color-accent: #faa630;
  --color-accent-dim: #c98213;

  --color-bg: #0b0d10;
  --color-bg-elev: #12161b;
  --color-surface: #161b22;
  --color-surface-2: #1c222b;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);

  --color-text: #e6edf3;
  --color-text-muted: #8b949e;
  --color-text-dim: #6e7681;

  --gt-fb-bg: #1a1410;
  --gt-fb-fret: #4a4036;
  --gt-fb-nut: #d6cfc4;
  --gt-fb-string: #8a8275;
  --gt-fb-inlay: #2c2620;
  --gt-fb-axis: #8b949e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

/* ---------- Header ---------- */
.gt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elev);
}
.gt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.gt-brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: inline-flex; align-items: center; justify-content: center;
  color: #0b0d10; font-weight: 800;
}
.gt-back {
  font-size: 13px;
  color: var(--color-text-muted);
}
.gt-back:hover { color: var(--color-text); }

/* ---------- Tabs ---------- */
.gt-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 22px 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elev);
}
.gt-tab {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.gt-tab:hover { color: var(--color-text); }
.gt-tab.is-active {
  color: var(--color-text);
  background: var(--color-bg);
  border-color: var(--color-border);
  margin-bottom: -1px;
}

/* ---------- Panes ---------- */
.gt-pane { display: none; padding: 22px; max-width: 1200px; margin: 0 auto; }
.gt-pane.is-active { display: block; }

/* ---------- Trainer ---------- */
.gt-trainer-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .gt-trainer-layout { grid-template-columns: 1fr; }
}

.gt-trainer-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  max-height: 75vh;
  overflow-y: auto;
}

.gt-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--color-surface-2);
  overflow: hidden;
  margin-bottom: 6px;
}
.gt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-dim), var(--color-primary));
  transition: width 0.3s;
}
.gt-progress-text {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.gt-stage-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  margin: 14px 4px 6px;
  font-weight: 700;
}
.gt-stage-header:first-of-type { margin-top: 4px; }

.gt-lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.gt-lesson-item:hover:not(:disabled) {
  background: var(--color-surface-2);
}
.gt-lesson-item.is-active {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
}
.gt-lesson-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gt-lesson-num {
  display: inline-block;
  width: 22px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-dim);
  font-variant-numeric: tabular-nums;
}
.gt-lesson-name { flex: 1; }
.gt-lesson-state {
  font-size: 12px;
  color: var(--color-text-dim);
}
.gt-lesson-item.is-done .gt-lesson-state { color: var(--color-primary); }
.gt-lesson-item.is-available .gt-lesson-state { color: var(--color-accent); }

.gt-trainer-main {
  min-width: 0;
}

.gt-lesson-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.gt-lesson-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 600;
}
.gt-lesson-title {
  margin: 4px 0 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.gt-diagrams {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.gt-diagram-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gt-diagram-caption {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.gt-diagram-arrow {
  font-size: 24px;
  color: var(--color-text-dim);
}

.gt-instruction {
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--color-text);
}

.gt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 10px 14px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.gt-legend b {
  color: var(--color-text);
  font-weight: 700;
  margin-right: 4px;
}
.gt-legend-title {
  font-weight: 700;
  color: var(--color-text);
  margin-right: 4px;
}
.gt-legend-sep {
  width: 1px;
  height: 14px;
  background: var(--color-border-strong);
}
.gt-legend-mark {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
}
.gt-legend-o { border: 1.5px solid var(--color-text); background: transparent; }
.gt-legend-x {
  border: none;
  text-align: center;
  font-size: 14px;
  line-height: 14px;
  color: var(--color-text);
}

.gt-why {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.gt-why summary {
  cursor: pointer;
  color: var(--color-accent);
  font-weight: 600;
  outline: none;
}
.gt-why p { margin: 8px 0 0; color: var(--color-text-muted); }

.gt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.gt-btn {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.gt-btn:active { transform: translateY(1px); }
.gt-btn-primary {
  background: var(--color-primary);
  color: #0b0d10;
}
.gt-btn-primary:hover { background: var(--color-primary-dim); }
.gt-btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.gt-btn-ghost:hover { background: var(--color-surface-2); }

.gt-done-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 8px 12px;
  background: rgba(82, 249, 137, 0.1);
  border-radius: 8px;
}

.gt-link {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  text-align: left;
}
.gt-link:hover { text-decoration: underline; }

/* ---------- Chord diagram ---------- */
.gt-cd {
  display: block;
  width: 180px;
  height: 230px;
}
.gt-cd-fret { stroke: #6e7681; stroke-width: 1.2; }
.gt-cd-string { stroke: #8b949e; stroke-width: 1.5; stroke-linecap: round; }
.gt-cd-nut { fill: var(--color-text); }
.gt-cd-fretnum { fill: var(--color-text-muted); }
.gt-cd-open { fill: none; stroke: var(--color-text); stroke-width: 1.5; }
.gt-cd-mute line { stroke: var(--color-text-muted); stroke-width: 1.5; stroke-linecap: round; }
.gt-cd-dot { fill: var(--color-primary); }
.gt-cd-finger { fill: #0b0d10; font-weight: 700; }
.gt-cd-barre { fill: var(--color-primary); opacity: 0.85; }

/* Lefty-flipped chord diagram — mirror the SVG, counter-mirror text */
.gt-cd.gt-lefty { transform: scaleX(-1); }
.gt-cd.gt-lefty .gt-cd-finger,
.gt-cd.gt-lefty .gt-cd-fretnum {
  transform: scaleX(-1);
  transform-origin: center;
  transform-box: fill-box;
}

/* ---------- Thumb-mute illustration ---------- */
.gt-tm-wrap {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px 14px;
  margin: 0 0 18px;
}
.gt-tm-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin-bottom: 10px;
}
.gt-tm-diagrams {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-end;
}
.gt-tm-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gt-tm-caption {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
  text-align: center;
}
.gt-tm {
  display: block;
  width: 200px;
  height: 180px;
  overflow: visible;
}
.gt-tm-string { stroke: #8b949e; stroke-width: 1.5; stroke-linecap: round; }
.gt-tm-string.is-muted { stroke: var(--color-accent); stroke-width: 2.4; }
.gt-tm-nut { fill: var(--color-text); }
.gt-tm-strlbl { fill: var(--color-text-muted); font-weight: 600; }
.gt-tm-strlbl.is-muted { fill: var(--color-accent); font-weight: 800; }
.gt-tm-thumb {
  fill: rgba(250, 166, 48, 0.18);
  stroke: var(--color-accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.gt-tm-nail {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.2;
  opacity: 0.6;
}
.gt-tm-touch {
  fill: var(--color-accent);
  stroke: var(--color-bg);
  stroke-width: 1.2;
}
.gt-tm-thumblbl {
  fill: var(--color-accent);
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Lefty: mirror the diagram and counter-mirror the text */
.gt-tm.gt-lefty { transform: scaleX(-1); }
.gt-tm.gt-lefty .gt-tm-strlbl,
.gt-tm.gt-lefty .gt-tm-thumblbl {
  transform: scaleX(-1);
  transform-origin: center;
  transform-box: fill-box;
}

/* ---------- Fretboard ---------- */
.gt-fb-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.gt-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gt-control-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 600;
}
.gt-select {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
}
.gt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}
.gt-toggle input { accent-color: var(--color-primary); }

.gt-cd-input {
  min-width: 180px;
  outline: none;
}
.gt-cd-input:focus { border-color: var(--color-primary); }

.gt-fb-wrap {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.gt-fb-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
}
.gt-fb-svg .gt-cell { cursor: pointer; }
.gt-fb-svg .gt-cell:hover { fill: rgba(255, 255, 255, 0.04); }

.gt-fb-board { fill: var(--gt-fb-bg); }
.gt-fb-fret { stroke: var(--gt-fb-fret); }
.gt-fb-nut { stroke: var(--gt-fb-nut); }
.gt-fb-string { stroke: var(--gt-fb-string); }
.gt-fb-inlay { fill: var(--gt-fb-inlay); }
.gt-axis { fill: var(--gt-fb-axis); }
.gt-fb-capo {
  fill: rgba(220, 200, 160, 0.85);
  stroke: rgba(60, 50, 30, 0.7);
  stroke-width: 1;
  pointer-events: none;
}
.gt-fb-blocked {
  fill: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.gt-note { stroke: rgba(0, 0, 0, 0.4); stroke-width: 1; }
.gt-note.is-scale { fill: rgba(139, 148, 158, 0.55); }
.gt-note.is-accent { fill: var(--color-accent); }
.gt-note.is-root { fill: var(--color-primary); }
.gt-note.is-chord { fill: var(--color-primary); }
.gt-note.is-chord-root { fill: var(--color-primary); stroke: var(--color-text); stroke-width: 2; }
.gt-note.is-faded { fill: rgba(139, 148, 158, 0.18); }
.gt-note.is-spotlight { stroke: var(--color-accent); stroke-width: 3; }
.gt-note.is-chord-bass { fill: var(--color-accent); stroke: var(--color-text); stroke-width: 2; }

.gt-note-label {
  fill: #0b0d10;
  font-weight: 700;
  pointer-events: none;
  font-family: inherit;
}
.gt-note.is-scale + .gt-note-label,
.gt-note.is-faded + .gt-note-label { fill: var(--color-text); }

.gt-finger-dot { fill: var(--color-text); stroke: var(--color-bg); stroke-width: 2; opacity: 0.95; }
.gt-finger-label { fill: #0b0d10; font-weight: 700; pointer-events: none; font-family: inherit; }

.gt-axis { font-family: inherit; }
.gt-fb-svg text, .gt-cd text { font-family: inherit; }

.gt-fb-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transform: translate(-50%, 0);
  opacity: 0;
  transition: opacity 0.1s;
}
.gt-fb-tooltip.is-visible { opacity: 1; }

/* Lefty fretboard */
.gt-lefty .gt-fb-svg { transform: scaleX(-1); }
.gt-lefty .gt-fb-svg .gt-note-label,
.gt-lefty .gt-fb-svg .gt-finger-label,
.gt-lefty .gt-fb-svg .gt-sw-pick-step-label,
.gt-lefty .gt-fb-svg .gt-sw-pick-note-label,
.gt-lefty .gt-fb-svg .gt-sw-strum-shape-label,
.gt-lefty .gt-fb-svg .gt-sw-hopo-label,
.gt-lefty .gt-fb-svg .gt-sw-chord-tone-empty-label,
.gt-lefty .gt-fb-svg .gt-sw-chord-chromatic-label,
.gt-lefty .gt-fb-svg .gt-axis {
  transform: scaleX(-1);
  transform-origin: center;
  transform-box: fill-box;
}

/* Chord chips */
.gt-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin-bottom: 10px;
}
.gt-fb-chips-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.gt-fb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gt-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--color-text);
  transition: border-color 0.12s, background 0.12s;
  min-width: 48px;
}
.gt-chip:hover { border-color: var(--color-primary); }
.gt-chip.is-active {
  background: rgba(82, 249, 137, 0.12);
  border-color: var(--color-primary);
}
.gt-chip-roman {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.gt-chip-name {
  font-size: 14px;
  font-weight: 700;
}
.gt-chip-clear { background: transparent; min-width: 0; }

/* Chord info panel */
.gt-fb-info {
  min-height: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
}
.gt-fb-info:empty { display: none; }
.gt-info-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.gt-info-roman {
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-dim);
}
.gt-info-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}
.gt-info-notes {
  font-size: 14px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.gt-info-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.gt-info-line {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.gt-muted { color: var(--color-text-muted); font-size: 13px; margin: 4px 0; }

/* ---------- Trainer lesson links ---------- */
.gt-lesson-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

/* ---------- Tips pane ---------- */
.gt-tip-related-wrap:empty { display: none; }
.gt-tip-related {
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.gt-tip-related-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gt-tip-related-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
}
.gt-tip-related-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}
.gt-tip-related .gt-tip-grid { margin-bottom: 10px; }

.gt-tip-filters {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-tip-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.gt-tip-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  min-width: 54px;
}
.gt-tip-chip {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.gt-tip-chip:hover { border-color: var(--color-primary); }
.gt-tip-chip.is-active {
  background: rgba(82, 249, 137, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.gt-tip-section { margin-bottom: 20px; }
.gt-tip-section:last-child { margin-bottom: 0; }
.gt-tip-topic-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin: 0 0 10px;
}

.gt-tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.gt-tip-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gt-tip-card.is-pinned {
  border-color: var(--color-primary);
  background: rgba(82, 249, 137, 0.04);
}
.gt-tip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.gt-tip-level {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
}
.gt-tip-level.is-beginner {
  color: var(--color-primary);
  border-color: rgba(82, 249, 137, 0.5);
  background: rgba(82, 249, 137, 0.08);
}
.gt-tip-level.is-intermediate {
  color: var(--color-accent);
  border-color: rgba(250, 166, 48, 0.5);
  background: rgba(250, 166, 48, 0.08);
}
.gt-tip-level.is-advanced {
  color: #cfa8ff;
  border-color: rgba(180, 130, 255, 0.5);
  background: rgba(180, 130, 255, 0.08);
}
.gt-tip-topic {
  font-size: 11px;
  color: var(--color-text-dim);
  font-weight: 600;
}
.gt-tip-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.gt-tip-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ---------- Theory tab ---------- */
.gt-th-pane { max-width: 1200px; }

.gt-th-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  align-items: start;
}
.gt-th-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 8px;
  position: sticky;
  top: 12px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gt-th-nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

@media (max-width: 820px) {
  .gt-th-layout { grid-template-columns: 1fr; }
  .gt-th-nav {
    position: static;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    gap: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .gt-th-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 10px;
  }
}
.gt-th-nav-item:hover { color: var(--color-text); background: var(--color-surface-2); }
.gt-th-nav-item.is-active {
  color: var(--color-text);
  background: var(--color-surface-2);
  border-color: var(--color-primary);
}

.gt-th-content { min-width: 0; }

.gt-th-section { display: flex; flex-direction: column; gap: 16px; }
.gt-th-section-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.gt-th-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.gt-th-card-head { margin-bottom: 14px; }
.gt-th-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.005em;
}
.gt-th-concept {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.gt-th-card-body > * + * { margin-top: 12px; }
.gt-th-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.gt-th-ctrls { gap: 12px; }
.gt-th-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 600px) {
  .gt-th-cols-2 { grid-template-columns: 1fr; }
}

.gt-th-caption {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.gt-th-mini {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin-bottom: 4px;
}
.gt-th-pill {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.gt-th-fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
}
.gt-th-fld span { font-weight: 700; }
.gt-th-fld .gt-select { font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--color-text); }
.gt-th-range { width: 140px; accent-color: var(--color-primary); }

.gt-th-info {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-text);
}
.gt-th-info strong { font-weight: 700; }

.gt-th-equals {
  font-size: 22px;
  color: var(--color-text-dim);
  font-weight: 700;
  margin: 0 4px;
}

.gt-th-bigchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 14px 18px;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
}
.gt-th-bigchip.is-correct {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(82, 249, 137, 0.08);
}

/* ---------- Piano strip (SVG) ---------- */
.gt-pno {
  display: block;
  background: transparent;
  margin: 6px 0;
}
.gt-pno-w {
  fill: #f5f1ea;
  stroke: #2a2a2a;
  stroke-width: 0.6;
}
.gt-pno-b {
  fill: #1c1f24;
  stroke: #050505;
  stroke-width: 0.6;
}
.gt-pno-w.is-on    { fill: var(--color-primary); }
.gt-pno-w.is-root  { fill: var(--color-accent); }
.gt-pno-w.is-accent { fill: #f1c40f; }
.gt-pno-b.is-on    { fill: var(--color-primary-dim); }
.gt-pno-b.is-root  { fill: var(--color-accent-dim); }
.gt-pno-b.is-accent { fill: #c39a08; }
.gt-pno-w.is-pulse, .gt-pno-w.is-on.is-pulse, .gt-pno-w.is-root.is-pulse, .gt-pno-w.is-accent.is-pulse {
  fill: #ffffff;
  stroke: var(--color-accent);
  stroke-width: 2;
}
.gt-pno-b.is-pulse, .gt-pno-b.is-on.is-pulse, .gt-pno-b.is-root.is-pulse, .gt-pno-b.is-accent.is-pulse {
  fill: var(--color-accent);
  stroke: #ffffff;
  stroke-width: 2;
}

.gt-pno-l {
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  pointer-events: none;
}
.gt-pno-l-w { fill: #2a2a2a; }
.gt-pno-l-b { fill: #f0f0f0; }

/* ---------- Section 2 fret mirror ---------- */
.gt-th-frets {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
  margin: 8px 0;
}
.gt-th-fret {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  color: var(--color-text);
  cursor: pointer;
  padding: 8px 4px;
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.gt-th-fret:hover { border-color: var(--color-primary); background: var(--color-surface); }
.gt-th-fret.is-pulse {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #0b0d10;
}
.gt-th-fret.is-pulse .gt-th-fret-num,
.gt-th-fret.is-pulse .gt-th-fret-note { color: #0b0d10; }
.gt-th-fret-num { font-size: 10px; color: var(--color-text-dim); font-weight: 700; }
.gt-th-fret-note { font-size: 13px; font-weight: 700; }

/* ---------- Sine waves (1.2) ---------- */
.gt-th-sine {
  display: block;
  background: var(--color-bg);
  border-radius: 8px;
  padding: 6px;
  border: 1px solid var(--color-border);
}

/* ---------- 4.2 Consonance Sorter ---------- */
.gt-th-cons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 700px) {
  .gt-th-cons { grid-template-columns: 1fr; }
}
.gt-th-cons-col {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 10px;
}
.gt-th-cons-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}
.gt-th-cons-card {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  transition: border-color 0.12s, background 0.12s;
}
.gt-th-cons-card:hover { border-color: var(--color-primary); background: rgba(82, 249, 137, 0.05); }
.gt-th-cons-short {
  font-weight: 800;
  color: var(--color-primary);
  min-width: 44px;
}
.gt-th-cons-name {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- 5.2 Scale Degree Namer chips ---------- */
.gt-th-deg-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 700px) {
  .gt-th-deg-row { grid-template-columns: repeat(4, 1fr); }
}
.gt-th-deg-chip {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  text-align: center;
}
.gt-th-deg-chip:hover { border-color: var(--color-primary); }
.gt-th-deg-chip.is-pulse {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #0b0d10;
}
.gt-th-deg-chip.is-pulse .gt-th-deg-num,
.gt-th-deg-chip.is-pulse .gt-th-deg-name,
.gt-th-deg-chip.is-pulse .gt-th-deg-fn { color: #0b0d10; }
.gt-th-deg-num { font-size: 11px; color: var(--color-text-dim); font-weight: 700; }
.gt-th-deg-name { font-size: 16px; font-weight: 800; }
.gt-th-deg-fn { font-size: 10px; color: var(--color-text-muted); margin-top: 2px; }

/* ---------- 5.3 Circle of Fifths ---------- */
.gt-th-circle-wrap { justify-content: center; }
.gt-th-circle-major {
  font-size: 18px;
  font-weight: 800;
  fill: var(--color-text);
}
.gt-th-circle-minor {
  font-size: 13px;
  font-weight: 600;
  fill: var(--color-text-muted);
}
.gt-th-circle-major.is-pulse,
.gt-th-circle-minor.is-pulse {
  fill: var(--color-accent);
  font-weight: 900;
}

/* ---------- 8 Circle of Fifths (dedicated section) ---------- */
.gt-th-cof-wrap { padding: 8px 0; }
.gt-th-cof-svg { max-width: 100%; height: auto; overflow: visible; }
.gt-th-cof-svg .gt-th-cof-rotor {
  transform-box: view-box;
  transform-origin: 220px 220px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.gt-th-cof-svg .gt-th-cof-rot-text {
  transform-box: view-box;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), fill 0.18s, font-weight 0.18s;
}
.gt-th-cof-svg .gt-th-circle-major { font-size: 20px; }
.gt-th-cof-svg .gt-th-circle-major.is-on { fill: var(--color-primary); }
.gt-th-cof-svg .gt-th-circle-minor { font-size: 14px; }
.gt-th-cof-svg .gt-th-circle-minor.is-on { fill: var(--color-primary); }
.gt-th-cof-acc {
  font-size: 12px;
  font-weight: 700;
  fill: var(--color-text-dim);
  letter-spacing: 0.04em;
}
.gt-th-cof-acc.is-on { fill: var(--color-accent, var(--color-primary)); }
.gt-th-cof-info { font-size: 14px; }

/* Chord-class colors when a key is selected */
.gt-th-cof-svg .gt-th-circle-major.is-deg-maj { fill: var(--color-primary); font-weight: 900; }
.gt-th-cof-svg .gt-th-circle-major.is-deg-dim { fill: #c084fc; font-weight: 800; font-style: italic; }
.gt-th-cof-svg .gt-th-circle-minor.is-deg-min { fill: var(--color-accent); font-weight: 800; }
.gt-th-cof-svg .gt-th-circle-major.is-selected,
.gt-th-cof-svg .gt-th-circle-minor.is-selected {
  paint-order: stroke;
  stroke: currentColor;
  stroke-width: 0.6;
}

/* Degree-number badges on the rim/centre */
.gt-th-cof-deg {
  font-size: 10px;
  font-weight: 800;
  fill: transparent;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.gt-th-cof-deg.is-deg-maj { fill: var(--color-primary); }
.gt-th-cof-deg.is-deg-dim { fill: #c084fc; }
.gt-th-cof-deg.is-deg-min { fill: var(--color-accent); }
.gt-th-cof-deg.is-deg-borrow { fill: #f472b6; }
.gt-th-cof-svg .gt-th-circle-major.is-deg-borrow { fill: #f472b6; font-weight: 800; }

/* Pulse must come last so it overrides degree colors during walk playback */
.gt-th-cof-svg .gt-th-circle-major.is-pulse,
.gt-th-cof-svg .gt-th-circle-minor.is-pulse {
  fill: var(--color-accent);
  font-weight: 900;
}
.gt-th-cof-acc.is-pulse { fill: var(--color-accent); font-weight: 900; }

.gt-th-cof-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.gt-th-cof-bignum {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}
.gt-th-cof-bigsym {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.gt-th-cof-keyname {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-left: auto;
  font-weight: 600;
}
.gt-th-cof-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gt-th-cof-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-2);
  color: var(--color-text-dim);
}
.gt-th-cof-chip.is-on {
  background: rgba(82, 249, 137, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.gt-th-cof-chip.is-off { opacity: 0.5; }

/* ---------- 6.2 Minor switcher rows ---------- */
.gt-th-minor-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
}
.gt-th-minor-row:first-child { border-top: none; }
.gt-th-minor-label { display: flex; flex-direction: column; gap: 6px; }

/* ---------- 7.1 Relative twin label row ---------- */
.gt-th-rel-label { display: flex; gap: 24px; }

/* ---------- 8.2 Mode pair cards ---------- */
.gt-th-pair-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}
.gt-th-pair-card:last-child { margin-bottom: 0; }

/* ---------- 9.1 Scale library grid ---------- */
.gt-th-scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.gt-th-scale-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 10px;
}
.gt-th-formula {
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---------- 10.2 Triad wheel ---------- */
.gt-th-wheel { display: block; margin: 0 auto; }
.gt-th-wheel-text {
  font-size: 14px;
  font-weight: 700;
  fill: var(--color-text);
  pointer-events: none;
}
.gt-th-wheel-roman {
  font-size: 28px;
  font-weight: 800;
  fill: var(--color-text);
}
.gt-th-wheel-slot circle { transition: fill 0.12s; }

/* ---------- 14.1 Progression slots ---------- */
.gt-th-prog-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gt-th-slot {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 70px;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  text-align: center;
}
.gt-th-slot:hover { border-color: var(--color-primary); }
.gt-th-slot-roman { font-size: 12px; color: var(--color-text-dim); font-weight: 700; }
.gt-th-slot-name { font-size: 14px; font-weight: 700; }

/* ---------- 14.2 Cadence cards ---------- */
.gt-th-cad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.gt-th-cad-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 12px;
}

/* ---------- 15.1 Metronome ---------- */
.gt-th-meter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gt-th-beat {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  transition: background 0.08s, border-color 0.08s;
}
.gt-th-beat.is-down { border-color: var(--color-accent); }
.gt-th-beat.is-on { background: var(--color-primary); border-color: var(--color-primary); }
.gt-th-beat.is-down.is-on { background: var(--color-accent); }

/* ---------- 15.2 Note value tree ---------- */
.gt-th-tree { display: flex; flex-direction: column; gap: 6px; }
.gt-th-tree-row {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  gap: 10px;
  align-items: center;
}
.gt-th-tree-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 600;
}
.gt-th-tree-blocks {
  display: grid;
  gap: 2px;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.gt-th-tree-block {
  background: var(--color-primary-dim);
  height: 18px;
  border-radius: 3px;
  opacity: 0.7;
}

/* ---------- 16.2 Octave board ---------- */
.gt-th-board {
  display: block;
  background: var(--gt-fb-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  margin: 4px 0;
}
.gt-th-board-axis {
  fill: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
}
.gt-th-board-dot-label {
  fill: #0b0d10;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

/* ---------- 17 cheat sheet ---------- */
.gt-th-sheet {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text);
  line-height: 1.6;
  font-size: 14px;
}
.gt-th-sheet li { margin-bottom: 6px; }

/* ---------- Practice pane ---------- */
.gt-prog-intro {
  margin-bottom: 22px;
}
.gt-prog-intro-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.gt-prog-intro-body {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
  max-width: 820px;
}

/* Top-level section divider for the Practice pane (Rhythm vs Chord
 * Progressions). Reads as a sibling section, not a sub-section: thick top
 * border, accent-colored eyebrow, large title. */
.gt-prac-section {
  padding-top: 22px;
  margin-top: 28px;
  border-top: 2px solid var(--color-border-strong);
}
.gt-prac-section:first-of-type {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}
.gt-prac-section-head {
  margin-bottom: 16px;
}
.gt-prac-section-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.gt-prac-section-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.gt-prac-section-blurb {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 820px;
}

.gt-prog-howto {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  max-width: 760px;
}
.gt-prog-howto summary {
  cursor: pointer;
  color: var(--color-accent);
  font-weight: 600;
  outline: none;
  list-style-position: outside;
}
.gt-prog-howto[open] summary { margin-bottom: 6px; }
.gt-prog-howto-list {
  margin: 6px 0 4px;
  padding-left: 20px;
  color: var(--color-text-muted);
  line-height: 1.55;
}
.gt-prog-howto-list li { margin-bottom: 6px; }
.gt-prog-howto-list li:last-child { margin-bottom: 0; }
.gt-prog-howto-list li strong { color: var(--color-text); font-weight: 700; }

.gt-prog-section-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin: 18px 0 10px;
}
.gt-prog-section-header:first-child { margin-top: 0; }

/* ---------- Rhythm exercises (Practice pane) ---------- */
.gt-rh-wrap { margin-bottom: 0; }

.gt-rh-intro { margin-bottom: 14px; }
.gt-rh-intro-body {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 820px;
}
.gt-rh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.gt-rh-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.gt-rh-legend .gt-strum-glyph {
  display: inline-block;
  width: 14px;
  text-align: center;
}

.gt-rh-group { margin-top: 18px; }
.gt-rh-group:first-of-type { margin-top: 14px; }
.gt-rh-group-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin: 0 0 10px;
}
.gt-rh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.gt-rh-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gt-rh-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.gt-rh-titlewrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gt-rh-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.gt-rh-time {
  font-size: 11px;
  color: var(--color-text-dim);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gt-rh-level {
  align-self: flex-start;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
}
.gt-rh-level.is-beginner {
  color: var(--color-primary);
  border-color: rgba(82, 249, 137, 0.5);
  background: rgba(82, 249, 137, 0.08);
}
.gt-rh-level.is-intermediate {
  color: var(--color-accent);
  border-color: rgba(250, 166, 48, 0.5);
  background: rgba(250, 166, 48, 0.08);
}

.gt-rh-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}
.gt-rh-tip {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.gt-rh-tip strong { color: var(--color-accent); font-weight: 700; }

.gt-rh-songs {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.gt-rh-songs-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-text-dim);
}

.gt-rh-ctrls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-top: 6px;
}
.gt-rh-play {
  padding: 6px 14px;
  font-size: 13px;
}
.gt-rh-bpm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 180px;
  min-width: 160px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
}
.gt-rh-bpm-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-text-dim);
}
.gt-rh-bpm-slider {
  flex: 1;
  min-width: 80px;
  accent-color: var(--color-primary);
}
.gt-rh-bpm-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  min-width: 64px;
  text-align: right;
}
.gt-rh-click {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
.gt-rh-click input { accent-color: var(--color-primary); }

/* ---------- Pattern grid (shared by rhythm cards) ----------
 * Default = 8 cells (eighth notes). Modifier classes set 12 (triplets) or
 * 16 (sixteenths) so the same cell styling stretches to fit. */
.gt-strum-pattern {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.gt-strum-pattern.is-r12 { grid-template-columns: repeat(12, 1fr); gap: 3px; }
.gt-strum-pattern.is-r16 { grid-template-columns: repeat(16, 1fr); gap: 2px; }

.gt-strum-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 0 5px;
  transition: background 0.05s, border-color 0.05s, box-shadow 0.05s;
}
.gt-strum-cell.is-beat {
  border-color: var(--color-border-strong);
  background: var(--color-bg-elev);
}
.gt-strum-cell.is-now {
  background: rgba(82, 249, 137, 0.18);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(82, 249, 137, 0.25);
}

.gt-strum-pattern.is-r16 .gt-strum-cell { padding: 6px 0 4px; }
.gt-strum-pattern.is-r12 .gt-strum-cell { padding: 7px 0 4px; }

.gt-strum-glyph {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.gt-strum-pattern.is-r12 .gt-strum-glyph { font-size: 16px; }
.gt-strum-pattern.is-r16 .gt-strum-glyph { font-size: 13px; }
.gt-strum-glyph.is-down { color: var(--color-primary); }
.gt-strum-glyph.is-up { color: var(--color-accent); }
.gt-strum-glyph.is-mute { color: #cfa8ff; }
.gt-strum-glyph.is-skip { color: var(--color-text-dim); }
.gt-strum-count {
  font-size: 10px;
  color: var(--color-text-dim);
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.gt-strum-pattern.is-r16 .gt-strum-count { font-size: 9px; margin-top: 2px; }
.gt-strum-pattern.is-r12 .gt-strum-count { font-size: 9px; margin-top: 3px; }
.gt-strum-cell.is-beat .gt-strum-count { color: var(--color-text-muted); }

/* Custom pattern builder */
.gt-rh-custom .gt-strum-cell {
  cursor: pointer;
  transition: background 0.05s, border-color 0.05s, box-shadow 0.05s;
}
.gt-rh-custom .gt-strum-cell:hover {
  border-color: var(--color-primary);
  background: rgba(82, 249, 137, 0.08);
}

.gt-rh-custom-res {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gt-rh-res-btn {
  padding: 5px 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 20px;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.gt-rh-res-btn:hover { color: var(--color-text); border-color: var(--color-primary); }
.gt-rh-res-btn.is-active {
  background: rgba(82, 249, 137, 0.12);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.gt-prog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.gt-prog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gt-prog-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.gt-prog-genre {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(250, 166, 48, 0.1);
  border: 1px solid rgba(250, 166, 48, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
}
.gt-prog-key {
  font-size: 11px;
  color: var(--color-text-dim);
  font-weight: 600;
}
.gt-prog-key-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gt-prog-key-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
}
.gt-prog-key-select {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.gt-prog-key-select:hover { border-color: var(--color-primary); }
.gt-prog-key-select:focus { outline: none; border-color: var(--color-primary); }

.gt-prog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.gt-prog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.gt-prog-play {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 13px;
}

.gt-prog-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.gt-prog-chord {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 52px;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.gt-prog-chord:hover { border-color: var(--color-primary); }
.gt-prog-chord:active { transform: translateY(1px); }
.gt-prog-chord.is-playing {
  background: rgba(82, 249, 137, 0.15);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(82, 249, 137, 0.25);
}
.gt-prog-roman {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-dim);
  letter-spacing: 0.05em;
}
.gt-prog-chord-name {
  font-size: 15px;
  font-weight: 800;
}
.gt-prog-chord.is-playing .gt-prog-chord-name { color: var(--color-primary); }
.gt-prog-arrow {
  color: var(--color-text-dim);
  font-size: 14px;
  padding: 0 2px;
}

.gt-prog-blurb {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.gt-prog-songs {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}
.gt-prog-songs-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  font-weight: 700;
  margin-bottom: 4px;
}
.gt-prog-songs ul {
  margin: 0;
  padding-left: 18px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.gt-prog-songs li { margin-bottom: 2px; }

/* ---------- Songs pane ---------- */
.gt-song-wrap { display: flex; flex-direction: column; gap: 10px; }
.gt-song-list {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  margin-bottom: 8px;
}

.gt-song-card { gap: 12px; }

.gt-song-capo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(82, 249, 137, 0.1);
  border: 1px solid rgba(82, 249, 137, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
}
.gt-song-keypill,
.gt-song-scalepill {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 2px 10px;
}

.gt-song-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gt-song-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.gt-song-artist {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.gt-song-technique {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border-left: 2px solid var(--color-accent);
  padding: 8px 12px;
  border-radius: 4px;
}
.gt-song-technique strong {
  color: var(--color-accent);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.gt-song-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-song-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.gt-song-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.gt-song-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-text-dim);
}
.gt-song-section-play {
  padding: 3px 10px;
  font-size: 12px;
}
.gt-song-section-play[data-active="1"] {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.gt-song-steps { gap: 4px 6px; }
.gt-song-chord { min-width: 44px; padding: 5px 9px; }
.gt-song-chord .gt-prog-chord-name { font-size: 14px; }
.gt-song-chord-unknown {
  opacity: 0.6;
  border-style: dashed;
}
.gt-song-chord-unknown:hover { border-color: var(--color-text-dim); }

.gt-song-sw-link {
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 10px;
}

.gt-song-strum-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-song-strum-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-text-dim);
}
.gt-song-strum-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gt-song-strum-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Settings pane ---------- */
.gt-settings-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  max-width: 520px;
}
.gt-settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.gt-settings-row:last-child { border-bottom: none; }
.gt-settings-row label { font-weight: 600; font-size: 14px; }
.gt-settings-row p { margin: 2px 0 0; color: var(--color-text-muted); font-size: 13px; }

/* ---------- Sub-tabs (used inside the Fretboard pane) ---------- */
.gt-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}
.gt-subtab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.gt-subtab:hover { color: var(--color-text); }
.gt-subtab.is-active {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
  margin-bottom: -1px;
}
.gt-subpane { display: none; }
.gt-subpane.is-active { display: block; }

/* ---------- Songwriter ---------- */
.gt-input {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}
.gt-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.gt-sw-tempo { width: 90px; }

.gt-sw-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.gt-sw-meta .gt-control { flex: 1 1 160px; min-width: 120px; }
.gt-sw-meta-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.gt-sw-note-btn[data-has-notes="1"] {
  border-color: rgba(82, 249, 137, 0.45);
  color: var(--color-primary);
  background: rgba(82, 249, 137, 0.08);
}
.gt-sw-note-btn[data-has-notes="1"]:hover {
  background: rgba(82, 249, 137, 0.14);
}

.gt-sw-metro {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  margin-bottom: 16px;
}
.gt-sw-metro-info {
  font-size: 13px;
  color: var(--color-muted, #888);
  font-variant-numeric: tabular-nums;
}
.gt-sw-metro-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.gt-sw-metro-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-border);
  transition: background 80ms linear, transform 80ms linear, border-color 80ms linear;
}
.gt-sw-metro-dot.is-accent { border-color: var(--color-primary); }
.gt-sw-metro-dot.is-on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.25);
}
.gt-sw-metro-dot.is-accent.is-on { box-shadow: 0 0 0 3px rgba(255,255,255,0.08); }

.gt-sw-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.gt-sw-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  position: relative;
}
.gt-sw-section.is-dragging { opacity: 0.5; }
.gt-sw-section.is-drop-before::before,
.gt-sw-section.is-drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  pointer-events: none;
}
.gt-sw-section.is-drop-before::before { top: -8px; }
.gt-sw-section.is-drop-after::after { bottom: -8px; }
.gt-sw-section-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gt-sw-section-handle {
  flex: 0 0 auto;
  cursor: grab;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted, #888);
  font-size: 14px;
  line-height: 1;
  padding: 6px 6px;
  letter-spacing: -2px;
  user-select: none;
  touch-action: none;
}
.gt-sw-section-handle:hover {
  background: var(--color-bg);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.gt-sw-section.is-dragging .gt-sw-section-handle { cursor: grabbing; }
.gt-sw-section-name {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 15px;
  background: transparent;
  border-color: transparent;
  padding: 6px 8px;
}
.gt-sw-section-name:hover,
.gt-sw-section-name:focus { background: var(--color-bg); border-color: var(--color-border-strong); }

.gt-sw-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--color-border);
  position: relative;
}
.gt-sw-line.is-dragging { opacity: 0.5; }
.gt-sw-line.is-drop-before::before,
.gt-sw-line.is-drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  pointer-events: none;
  z-index: 10;
}
.gt-sw-line.is-drop-before::before { top: -2px; }
.gt-sw-line.is-drop-after::after { bottom: -2px; }

.gt-sw-line-handle {
  flex: 0 0 auto;
  cursor: grab;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted, #888);
  font-size: 14px;
  line-height: 1;
  padding: 6px 6px;
  letter-spacing: -2px;
  user-select: none;
  touch-action: none;
}
.gt-sw-line-handle:hover {
  background: var(--color-bg);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.gt-sw-line.is-dragging .gt-sw-line-handle { cursor: grabbing; }

.gt-sw-line:first-of-type { border-top: none; }
.gt-sw-line-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}
.gt-sw-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.gt-sw-cell:hover { border-color: var(--color-primary); }
.gt-sw-cell.is-selected {
  background: rgba(82, 249, 137, 0.12);
  border-color: var(--color-primary);
}
.gt-sw-cell-name-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.1;
}
.gt-sw-cell-name { font-weight: 700; font-size: 14px; }
.gt-sw-cell-mode {
  font-size: 12px;
  color: var(--color-text-muted);
}
.gt-sw-cell.is-selected .gt-sw-cell-mode { color: var(--color-text); }
.gt-sw-cell.gt-sw-cell-melody { border-style: dashed; color: var(--color-accent); }
.gt-sw-cell.gt-sw-cell-melody:hover { border-color: var(--color-accent); }
.gt-sw-cell.gt-sw-cell-melody.is-selected { background: rgba(255, 145, 82, 0.1); border-color: var(--color-accent); border-style: solid; }

/* Bar cell — wider than a chord cell so the per-beat chord labels fit. */
.gt-sw-cell.gt-sw-cell-bar { border-style: dashed; }
.gt-sw-cell.gt-sw-cell-bar:hover { border-color: var(--color-primary); border-style: solid; }
.gt-sw-cell.gt-sw-cell-bar.is-selected { border-style: solid; }
.gt-sw-bar-beats {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gt-sw-bar-beat {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-bg-elev);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.gt-sw-cell.is-selected .gt-sw-bar-beat { background: rgba(82, 249, 137, 0.18); border-color: var(--color-primary); }

/* Bar editor — chord-per-beat row + strum slot grid. */
.gt-sw-bar-editor { display: flex; flex-direction: column; gap: 10px; }
.gt-sw-bar-chord-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.gt-sw-bar-chord-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}
.gt-sw-bar-chord-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}
.gt-sw-bar-chord-sel {
  width: 100%;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.gt-sw-bar-chord-sel:hover, .gt-sw-bar-chord-sel:focus { outline: none; border-color: var(--color-primary); }
.gt-sw-bar-chord-custom { display: flex; flex-direction: column; gap: 3px; }
.gt-sw-bar-chord-custom-name {
  width: 100%;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  padding: 5px 7px;
  font-family: inherit;
  font-size: 13px;
}
.gt-sw-bar-chord-custom-name:focus { outline: none; border-color: var(--color-primary); }
.gt-sw-bar-chord-custom-status { font-size: 11px; line-height: 1.3; }
.gt-sw-bar-chord-custom-status.is-error { color: var(--color-danger, #c0392b); }

.gt-sw-bar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.gt-sw-bar-grid.is-n12 { grid-template-columns: repeat(12, 1fr); gap: 3px; }
.gt-sw-bar-grid.is-n16 { grid-template-columns: repeat(16, 1fr); gap: 2px; }
.gt-sw-bar-grid.is-n6 { grid-template-columns: repeat(6, 1fr); }
.gt-sw-bar-grid.is-n9 { grid-template-columns: repeat(9, 1fr); }
.gt-sw-bar-grid.is-n4 { grid-template-columns: repeat(4, 1fr); }
.gt-sw-bar-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 0 5px;
  cursor: pointer;
  transition: background 0.05s, border-color 0.05s;
}
.gt-sw-bar-slot:hover { border-color: var(--color-primary); background: rgba(82, 249, 137, 0.08); }
.gt-sw-bar-slot.is-beat { background: var(--color-bg-elev); border-color: var(--color-border-strong); }
.gt-sw-bar-slot-glyph { font-size: 18px; font-weight: 800; line-height: 1; }
.gt-sw-bar-grid.is-n12 .gt-sw-bar-slot-glyph { font-size: 16px; }
.gt-sw-bar-grid.is-n16 .gt-sw-bar-slot-glyph { font-size: 13px; }
.gt-sw-bar-slot-glyph.is-down { color: var(--color-primary); }
.gt-sw-bar-slot-glyph.is-up { color: var(--color-accent); }
.gt-sw-bar-slot-glyph.is-mute { color: #cfa8ff; }
.gt-sw-bar-slot-glyph.is-skip { color: var(--color-text-dim); }
.gt-sw-bar-slot-count {
  font-size: 10px;
  margin-top: 4px;
  color: var(--color-text-dim);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gt-sw-bar-grid.is-n16 .gt-sw-bar-slot-count { font-size: 9px; margin-top: 2px; }
.gt-sw-bar-grid.is-n12 .gt-sw-bar-slot-count { font-size: 9px; margin-top: 3px; }
.gt-sw-bar-slot.is-beat .gt-sw-bar-slot-count { color: var(--color-text-muted); }
.gt-sw-bar-slot.is-selected {
  border-color: var(--color-primary);
  background: rgba(82, 249, 137, 0.18);
  box-shadow: 0 0 0 2px rgba(82, 249, 137, 0.25);
}
.gt-sw-bar-slot.is-selected .gt-sw-bar-slot-count { color: var(--color-primary); }
.gt-sw-bar-slot.has-slot-override {
  border-color: var(--color-accent, var(--color-primary));
}
.gt-sw-bar-slot.has-slot-override::after {
  content: "•";
  position: absolute;
  margin-top: -10px;
  color: var(--color-accent, var(--color-primary));
  font-size: 14px;
  line-height: 1;
}
.gt-sw-bar-slot { position: relative; }
.gt-sw-bar-slot-glyph { cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.gt-sw-bar-slot-glyph:hover { background: var(--color-surface-3, rgba(255,255,255,0.08)); }

.gt-sw-add-cell,
.gt-sw-line-del {
  background: transparent;
  border: 1px dashed var(--color-border-strong);
  color: var(--color-text-muted);
  border-radius: 8px;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
}
.gt-sw-add-cell:hover { color: var(--color-primary); border-color: var(--color-primary); }
.gt-sw-line-del:hover { color: #ff7b6b; border-color: #ff7b6b; }

.gt-sw-line-play {
  background: transparent;
  border: 1px solid var(--color-border-strong);
  color: var(--color-primary);
  border-radius: 8px;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.gt-sw-line-play:hover {
  background: rgba(82, 249, 137, 0.08);
  border-color: var(--color-primary);
}

.gt-sw-line-dup {
  background: transparent;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  border-radius: 8px;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.gt-sw-line-dup:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.gt-sw-add-line { margin-top: 10px; }
.gt-sw-add-section { align-self: flex-start; }

.gt-sw-editor {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.gt-sw-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  margin-bottom: 14px;
}
.gt-sw-editor-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.gt-sw-custom-chord {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-sw-custom-chord-name { flex: 1; }
.gt-sw-custom-chord-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.gt-sw-custom-chord-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gt-sw-custom-chord-str {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.gt-sw-custom-chord-fret { width: 54px; text-align: center; }
.gt-sw-custom-chord-hint { margin: 0; font-size: 12px; }
.gt-sw-custom-chord-status { margin: 0; font-size: 12px; line-height: 1.4; }
.gt-sw-custom-chord-status.is-error { color: var(--color-danger, #c0392b); }

.gt-sw-mode {
  display: inline-flex;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 2px;
}
.gt-sw-mode-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.gt-sw-mode-btn.is-active {
  background: var(--color-primary);
  color: #0b0d10;
}

.gt-sw-pattern-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gt-sw-pattern {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  text-align: left;
  min-width: 140px;
}
.gt-sw-pattern:hover { border-color: var(--color-primary); }
.gt-sw-pattern.is-active {
  background: rgba(82, 249, 137, 0.12);
  border-color: var(--color-primary);
}
.gt-sw-pattern-sym {
  display: inline-flex;
  gap: 6px;
  font-size: 18px;
  line-height: 1;
}
.gt-sw-sym {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.gt-sw-pattern-name {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gt-sw-pattern.is-active .gt-sw-pattern-name { color: var(--color-text); }

.gt-sw-apply {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gt-sw-pick {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-sw-pick-board { margin: 4px 0 8px; padding: 12px; }
.gt-sw-pick-board .gt-fb-svg { max-height: 220px; }

.gt-sw-pick-shape {
  fill: rgba(139, 148, 158, 0.28);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
  pointer-events: none;
}
/* Position selector above the fretboard. Picks which 5-fret window's
 * chord-tone empty circles to render below. */
.gt-sw-fret-pos-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.gt-sw-fret-pos-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-right: 2px;
}
.gt-sw-fret-pos-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 4px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gt-sw-fret-pos-btn:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
}
.gt-sw-fret-pos-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #0b0d10;
}

/* Translucent band on the fretboard that highlights the active position. */
.gt-sw-fret-region {
  fill: rgba(82, 249, 137, 0.05);
  pointer-events: none;
}

/* Hollow chord-tone markers within the active position window. */
.gt-sw-chord-tone-empty {
  fill: rgba(82, 249, 137, 0.10);
  stroke: var(--color-primary);
  stroke-width: 1.25;
  stroke-dasharray: 2 2;
  pointer-events: none;
}
.gt-sw-chord-tone-empty-label {
  fill: var(--color-primary);
  font-family: inherit;
  font-weight: 600;
  pointer-events: none;
}
.gt-sw-chord-tone-selected {
  fill: var(--color-primary);
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 1;
  pointer-events: none;
}
.gt-sw-chord-chromatic {
  fill: transparent;
  stroke: rgba(139, 148, 158, 0.28);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  pointer-events: none;
}
.gt-sw-chord-chromatic-selected {
  fill: rgba(139, 148, 158, 0.35);
  stroke: rgba(139, 148, 158, 0.7);
  stroke-width: 1;
  pointer-events: none;
}
.gt-sw-chord-chromatic-label {
  fill: rgba(139, 148, 158, 0.5);
  font-family: inherit;
  pointer-events: none;
}
.gt-sw-pick-step-dot {
  fill: var(--color-primary);
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 1;
  pointer-events: none;
}
.gt-sw-pick-step-label {
  fill: #0b0d10;
  font-family: inherit;
  font-weight: 700;
  pointer-events: none;
}
.gt-sw-pick-note-label {
  fill: var(--gt-fb-axis);
  font-family: inherit;
  pointer-events: none;
}

.gt-sw-pick-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.gt-sw-pick-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}
.gt-sw-pick-step-num {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}
.gt-sw-pick-step-name { font-weight: 700; }
button.gt-sw-pick-step-name-btn {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
  transition: color 120ms ease;
}
button.gt-sw-pick-step-name-btn:hover { color: var(--color-accent); }
.gt-sw-pick-step-rm {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.gt-sw-pick-step-rm:hover { color: #ff7b6b; }

/* HO/PO fretboard markers */
.gt-sw-hopo-dot {
  fill: #d97706;
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 1;
  pointer-events: none;
}
.gt-sw-hopo-label {
  fill: #fff8ec;
  font-family: inherit;
  font-weight: 800;
  pointer-events: none;
}

/* HO/PO embellishment list */
.gt-sw-pick-input-mode { margin-bottom: 4px; }
.gt-sw-hopo-section-label { margin-top: 8px; }
.gt-sw-hopo-hint { margin-bottom: 4px; }
.gt-sw-hopo-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.gt-sw-hopo-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid #d97706;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}
.gt-sw-hopo-step-name { font-weight: 700; }
.gt-sw-hopo-type-btn {
  background: #d97706;
  border: none;
  border-radius: 4px;
  color: #fff8ec;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1;
}
.gt-sw-hopo-type-btn:hover { background: #f59e0b; }

/* Strum-mode chord shape — clearly visible chord positions on the fretboard. */
.gt-sw-strum-shape {
  fill: var(--color-primary);
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 1;
  pointer-events: none;
  transition: fill 0.08s ease-out;
}
.gt-sw-strum-shape-label {
  fill: #0b0d10;
  font-family: inherit;
  font-weight: 800;
  pointer-events: none;
}
.gt-sw-strum-shape-muted {
  fill: rgba(139, 148, 158, 0.18);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  pointer-events: none;
}
.gt-sw-strum-muted-label {
  fill: rgba(139, 148, 158, 0.45);
}

/* Playback pulse: brief flash on the chord chip and on fretboard markers
 * so the user can see what's currently being played. */
.gt-sw-cell.is-pulse {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #0b0d10;
  box-shadow: 0 0 0 2px rgba(250, 166, 48, 0.35);
}
.gt-sw-cell.is-pulse .gt-sw-cell-mode { color: #0b0d10; }
.gt-sw-pick-shape.is-pulse,
.gt-sw-strum-shape.is-pulse,
.gt-sw-pick-step-dot.is-pulse,
.gt-sw-hopo-dot.is-pulse,
.gt-sw-chord-tone-selected.is-pulse,
.gt-sw-chord-tone-empty.is-pulse,
.gt-sw-chord-chromatic-selected.is-pulse,
.gt-sw-chord-chromatic.is-pulse,
.gt-sw-melody-scale-dot.is-pulse,
.gt-sw-melody-chromatic-dot.is-pulse {
  fill: var(--color-accent);
  stroke: #fff;
  stroke-width: 2;
}

/* ---------- Custom strum pattern grid ---------- */
.gt-sw-custom-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-sw-custom-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.gt-sw-custom-grid.is-n4  { grid-template-columns: repeat(4, 1fr); }
.gt-sw-custom-grid.is-n6  { grid-template-columns: repeat(6, 1fr); }
.gt-sw-custom-grid.is-n9  { grid-template-columns: repeat(9, 1fr);  gap: 3px; }
.gt-sw-custom-grid.is-n12 { grid-template-columns: repeat(12, 1fr); gap: 3px; }
.gt-sw-custom-grid.is-n16 { grid-template-columns: repeat(16, 1fr); gap: 2px; }

.gt-sw-custom-beat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.gt-sw-custom-beat:hover { border-color: var(--color-primary); }
.gt-sw-custom-beat.is-beat { background: var(--color-surface-2); }

.gt-sw-custom-grid.is-n9 .gt-sw-custom-beat,
.gt-sw-custom-grid.is-n12 .gt-sw-custom-beat { padding: 8px 0 5px; }
.gt-sw-custom-grid.is-n16 .gt-sw-custom-beat { padding: 7px 0 4px; }

.gt-sw-custom-glyph {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 4px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.gt-sw-custom-glyph:hover { background: var(--color-surface-3, rgba(255,255,255,0.08)); }
.gt-sw-custom-grid.is-n9 .gt-sw-custom-glyph,
.gt-sw-custom-grid.is-n12 .gt-sw-custom-glyph { font-size: 15px; }
.gt-sw-custom-grid.is-n16 .gt-sw-custom-glyph { font-size: 13px; }
.gt-sw-custom-glyph.is-down { color: var(--color-primary); }
.gt-sw-custom-glyph.is-up { color: var(--color-accent); }
.gt-sw-custom-glyph.is-mute { color: #cfa8ff; }
.gt-sw-custom-glyph.is-skip { color: var(--color-text-dim); opacity: 0.35; }

.gt-sw-custom-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-dim);
}
.gt-sw-custom-grid.is-n12 .gt-sw-custom-count,
.gt-sw-custom-grid.is-n16 .gt-sw-custom-count { font-size: 9px; margin-top: 2px; }
.gt-sw-custom-beat.is-beat .gt-sw-custom-count { color: var(--color-text-muted); }

.gt-sw-custom-chord-sel {
  margin-top: 5px;
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  text-align-last: center;
}
.gt-sw-custom-chord-sel:hover { border-color: var(--color-primary); color: var(--color-text); }
.gt-sw-custom-chord-sel.has-override {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(82, 249, 137, 0.1);
}
.gt-sw-custom-grid.is-n12 .gt-sw-custom-chord-sel,
.gt-sw-custom-grid.is-n16 .gt-sw-custom-chord-sel {
  font-size: 10px;
  padding: 1px 2px;
  margin-top: 3px;
}

.gt-sw-custom-clear-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gt-sw-custom-beat.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(82, 249, 137, 0.35);
  background: rgba(82, 249, 137, 0.06);
}
.gt-sw-custom-beat.is-selected .gt-sw-custom-count {
  color: var(--color-primary);
}

.gt-sw-slot-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
  padding: 8px 12px;
  background: rgba(82, 249, 137, 0.08);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.gt-sw-slot-banner-tag {
  font-weight: 700;
  color: var(--color-primary);
}
.gt-sw-slot-banner-meta {
  color: var(--color-text-muted);
  flex: 1;
}
.gt-sw-slot-banner-close { margin-left: auto; }

.gt-sw-slot-editor {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-sw-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gt-sw-slot-title {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 14px;
}
.gt-sw-slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gt-sw-slot-row .gt-control-label {
  min-width: 64px;
}
.gt-sw-slot-row .gt-input,
.gt-sw-slot-row .gt-select {
  flex: 1 1 auto;
  min-width: 200px;
}
.gt-sw-slot-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gt-sw-slot-notes .gt-section-label { margin-top: 4px; }

/* ---------- Melody / Solo Builder ---------- */
.gt-sw-melody {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-top: 16px;
}
.gt-sw-melody-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 10px;
}
.gt-sw-melody-controls .gt-control { flex: 1 1 200px; }
.gt-sw-melody-hint { margin: 0 0 8px; font-size: 13px; }
.gt-sw-melody-board { margin: 4px 0 10px; }
.gt-sw-melody-seq-wrap { margin-bottom: 10px; }
.gt-sw-melody-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.gt-sw-melody-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}
.gt-sw-melody-note-num {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}
.gt-sw-melody-note-name { font-weight: 700; }
.gt-sw-melody-note-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.gt-sw-melody-note-pick:hover .gt-sw-melody-note-name { color: var(--color-primary); }
.gt-sw-melody-note.is-highlighted {
  background: var(--color-surface-3, var(--color-surface-2));
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary) inset;
}
.gt-sw-melody-note.is-highlighted .gt-sw-melody-note-name { color: var(--color-primary); }
.gt-sw-melody-scale-dot.is-highlighted,
.gt-sw-melody-chromatic-dot.is-highlighted {
  fill: var(--color-primary);
  stroke: var(--color-primary);
  stroke-width: 2.5;
  stroke-dasharray: none;
}
.gt-sw-melody-hopo-btn {
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  color: var(--color-text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1.4;
  min-width: 20px;
}
.gt-sw-melody-hopo-btn:hover { border-color: var(--color-primary); color: var(--color-text); }
.gt-sw-melody-hopo-btn.is-ho { color: var(--color-primary); border-color: var(--color-primary); }
.gt-sw-melody-hopo-btn.is-po { color: var(--color-accent); border-color: var(--color-accent); }

/* Scale tone fretboard markers */
.gt-sw-melody-scale-dot {
  fill: var(--color-surface-2);
  stroke: var(--color-primary);
  stroke-width: 1.5;
  pointer-events: none;
  transition: fill 0.1s;
}
.gt-sw-melody-scale-dot.is-root {
  fill: var(--color-accent);
  stroke: var(--color-accent-dim);
}
.gt-sw-melody-scale-dot.is-used {
  fill: var(--color-primary);
  stroke: var(--color-primary-dim);
}
.gt-sw-melody-scale-dot.is-root.is-used {
  fill: var(--color-accent-dim);
  stroke: var(--color-accent);
}
.gt-sw-melody-scale-label {
  fill: var(--color-text);
  font-family: inherit;
  font-weight: 700;
  pointer-events: none;
}
.gt-sw-melody-scale-degree {
  fill: var(--color-text-muted);
  font-family: inherit;
  pointer-events: none;
}
.gt-sw-melody-seq-badge {
  fill: var(--color-bg);
  font-family: inherit;
  font-weight: 800;
  pointer-events: none;
}

.gt-sw-melody-chromatic-dot {
  fill: transparent;
  stroke: var(--color-text-muted);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  pointer-events: none;
}
.gt-sw-melody-chromatic-dot.is-used {
  fill: rgba(139, 148, 158, 0.25);
  stroke-dasharray: none;
}
.gt-sw-melody-chromatic-label {
  fill: var(--color-text-muted);
  font-family: inherit;
  font-weight: 500;
  pointer-events: none;
}

/* Make fretboard cells show a pointer cursor over scale tones */
.gt-sw-melody-board .gt-cell { cursor: pointer; }

/* Lefty flip for melody labels */
.gt-lefty .gt-fb-svg .gt-sw-melody-scale-label,
.gt-lefty .gt-fb-svg .gt-sw-melody-scale-degree { transform: scaleX(-1); }

/* ---------- Inline guitar tab (sequence + chord) ---------- */
.gt-inline-tab-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.gt-inline-tab {
  display: table;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  margin: 4px 0 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  overflow: hidden;
}
.gt-ita-row { display: table-row; }
.gt-ita-cell {
  display: table-cell;
  padding: 2px 5px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.gt-ita-row:last-child .gt-ita-cell { border-bottom: 0; }
.gt-ita-str-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 2px 8px 2px 8px;
  border-right: 1px solid var(--color-border-strong);
  min-width: 14px;
}
.gt-ita-hdr-cell { border-bottom: 1px solid var(--color-border-strong); }
.gt-ita-step-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 5px;
  min-width: 26px;
  line-height: 1.4;
  border-radius: 3px;
}
.gt-ita-step-btn:hover { color: var(--color-accent); }
.gt-ita-step-btn.is-highlighted { color: var(--color-primary); }
.gt-ita-fret {
  font-weight: 700;
  color: var(--color-text);
  min-width: 18px;
  display: inline-block;
}
.gt-ita-fret.is-highlighted { color: var(--color-primary); }
.gt-ita-fret.is-ho { color: var(--color-primary); }
.gt-ita-fret.is-po { color: var(--color-accent); }
.gt-ita-dash {
  color: rgba(255, 255, 255, 0.18);
  display: inline-block;
  min-width: 18px;
}
.gt-ita-dash-cell { text-align: center; }
.gt-ita-ctrl-row .gt-ita-cell {
  border-top: 1px solid var(--color-border-strong);
  padding: 2px 4px;
}
.gt-ita-ctrl-cell { white-space: nowrap; }
button.gt-ita-fret-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--color-text);
  padding: 2px 5px;
  min-width: 26px;
  border-radius: 3px;
  display: block;
  width: 100%;
}
button.gt-ita-fret-btn:hover { color: var(--color-accent); background: rgba(255, 255, 255, 0.06); }
.gt-ita-rm-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.gt-ita-rm-btn:hover { color: #ff7b6b; }
.gt-ita-hopo-btn {
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  color: var(--color-text-dim);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 3px;
  line-height: 1.4;
  margin-right: 2px;
}
.gt-ita-hopo-btn:hover { border-color: var(--color-primary); color: var(--color-text); }
.gt-ita-hopo-btn.is-ho { color: var(--color-primary); border-color: var(--color-primary); }
.gt-ita-hopo-btn.is-po { color: var(--color-accent); border-color: var(--color-accent); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }

  .gt-header { padding: 10px 14px; }
  .gt-brand { font-size: 14px; gap: 8px; }
  .gt-brand-mark { width: 24px; height: 24px; border-radius: 6px; }
  .gt-back { font-size: 12px; }

  .gt-tabs {
    padding: 10px 10px 0;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .gt-tabs::-webkit-scrollbar { display: none; }
  .gt-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }

  .gt-pane { padding: 14px; }

  .gt-lesson-card { padding: 16px; }
  .gt-lesson-title { font-size: 20px; }

  .gt-fb-controls { padding: 12px; gap: 12px; }
  .gt-fb-chips-wrap { padding: 12px; }
  .gt-fb-info { padding: 12px; }

  .gt-rh-grid,
  .gt-prog-list,
  .gt-song-list,
  .gt-tip-grid,
  .gt-th-scale-grid,
  .gt-th-cad-grid { grid-template-columns: 1fr; }

  .gt-th-circle,
  .gt-th-wheel,
  .gt-th-cof-svg { max-width: 100%; height: auto; }

  .gt-th-frets { gap: 2px; }
  .gt-th-fret { padding: 6px 1px; }
  .gt-th-fret-num { font-size: 9px; }
  .gt-th-fret-note { font-size: 11px; }

  .gt-settings-card { padding: 14px 16px; }
  .gt-settings-row { flex-wrap: wrap; gap: 10px; }

  .gt-sw-meta { padding: 12px; gap: 10px 12px; }
  .gt-sw-meta-actions { margin-left: 0; width: 100%; }
  .gt-sw-metro { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .gt-sw-metro-dots { margin-left: 0; width: 100%; justify-content: flex-start; }
  .gt-sw-section { padding: 12px; }
  .gt-sw-editor { padding: 12px; }
  .gt-sw-editor-actions { margin-left: 0; }
  .gt-sw-slot-row .gt-input,
  .gt-sw-slot-row .gt-select { min-width: 0; width: 100%; }

  .gt-prog-card { padding: 14px; }
  .gt-rh-card { padding: 12px 14px; }

  .gt-trainer-sidebar { max-height: none; padding: 12px; }

  .gt-th-section-title { font-size: 19px; }
  .gt-th-card { padding: 14px; }

  .gt-th-tree-row { grid-template-columns: 90px 1fr 32px; gap: 8px; }
  .gt-th-minor-row { grid-template-columns: 1fr; gap: 8px; }

  .gt-subtab { padding: 7px 12px; font-size: 12px; }
}

/* ---------- Modal ---------- */
.gt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: gt-modal-fade 0.18s ease-out;
}
@keyframes gt-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.gt-modal {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gt-modal-title {
  font-weight: 700;
  font-size: 16px;
  margin: 0 32px 0 0;
}
.gt-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.gt-modal-close:hover { background: rgba(255, 255, 255, 0.06); }
.gt-modal-body { display: flex; flex-direction: column; gap: 10px; }
.gt-modal-foot { display: flex; justify-content: flex-end; gap: 8px; }

.gt-sw-notes-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-sw-notes-help {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.gt-sw-notes-meta {
  font-size: 12px;
  color: var(--color-text-dim);
}
.gt-sw-notes-editor {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  line-height: 1.55;
  font-family: inherit;
}

/* ---------- Songwriter generator panel ---------- */
.gt-sw-generate-btn { white-space: nowrap; }
.gt-sw-gen { display: flex; flex-direction: column; gap: 12px; }
.gt-sw-gen-blurb { margin: 0; font-size: 13px; line-height: 1.45; }
.gt-sw-gen-field { width: 100%; }
.gt-sw-gen-field .gt-control-label { font-size: 12px; }
.gt-sw-gen-row { display: flex; gap: 10px; }
.gt-sw-gen-row .gt-sw-gen-field { flex: 1 1 0; min-width: 0; }
.gt-sw-gen-prog,
.gt-sw-gen-key,
.gt-sw-gen-rhythm { width: 100%; }
.gt-sw-gen-tempo { width: 100%; }
.gt-sw-gen-title { width: 100%; }
.gt-sw-gen-structure {
  margin: 0;
  font-size: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
@media (max-width: 480px) {
  .gt-sw-gen-row { flex-direction: column; gap: 8px; }
}

/* ---------- Songwriter key + circle button ---------- */
.gt-sw-key-control {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.gt-sw-key-control .gt-select { flex: 1; min-width: 0; }
.gt-sw-cof-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- Circle of fifths widget ---------- */
.gt-cof-widget { display: flex; flex-direction: column; gap: 12px; }
.gt-cof-widget-circle { display: flex; justify-content: center; }
.gt-cof-widget-svg { width: 100%; max-width: 420px; height: auto; }
.gt-cof-widget-info { text-align: center; font-size: 13px; }

@media (max-width: 480px) {
  .gt-modal { padding: 14px 12px 10px; }
  .gt-cof-widget-svg { max-width: 100%; }
  .gt-cof-widget-info { font-size: 12px; }
}

/* ---------- Tab export modal ---------- */
.gt-modal.gt-modal-wide { max-width: 960px; }

.gt-sw-tab-export {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gt-sw-tab-sheet {
  background: #fff;
  color: #111;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gt-sw-tab-sheet-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #111;
}
.gt-sw-tab-sheet-artist {
  font-size: 14px;
  color: #444;
  margin-top: -8px;
}
.gt-sw-tab-sheet-meta {
  font-size: 12px;
  color: #555;
  font-variant-numeric: tabular-nums;
}
.gt-sw-tab-legend {
  font-size: 11px;
  color: #666;
  border-top: 1px dashed #ccc;
  border-bottom: 1px dashed #ccc;
  padding: 6px 0;
}
.gt-sw-tab-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Try to keep a section together on the same printed page. */
  break-inside: avoid;
  page-break-inside: avoid;
}
.gt-sw-tab-section-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #222;
  margin-top: 4px;
  text-transform: uppercase;
}
.gt-sw-tab-system {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  color: #111;
  background: #fafafa;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 8px 10px;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ---------- Print: only the tab sheet ---------- */
@media print {
  body.gt-printing-tab > *:not(.gt-modal-backdrop) { display: none !important; }
  body.gt-printing-tab .gt-modal-backdrop {
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
    animation: none !important;
    display: block !important;
  }
  body.gt-printing-tab .gt-modal {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }
  body.gt-printing-tab .gt-modal-close,
  body.gt-printing-tab .gt-modal-title,
  body.gt-printing-tab .gt-modal-foot { display: none !important; }
  body.gt-printing-tab .gt-modal-body { gap: 0 !important; }
  body.gt-printing-tab .gt-sw-tab-sheet {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  body.gt-printing-tab .gt-sw-tab-system {
    background: #fff !important;
    border-color: #ddd !important;
    overflow: visible !important;
    font-size: 10px;
    line-height: 1.3;
  }
  @page { margin: 16mm 14mm; }
}

/* ---------- Tuner ---------- */
.gt-tuner-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
}
.gt-tuner-ctrls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.gt-tuner-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 16px;
  margin-bottom: 24px;
}
.gt-tuner-dial {
  position: relative;
  width: 240px;
  height: 120px;
  overflow: hidden;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--color-border);
}
.gt-tuner-marks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: absolute;
  bottom: 0;
  padding: 0 10px;
}
.gt-tuner-mark {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-dim);
}
.gt-tuner-mark-flat { color: var(--color-accent); }
.gt-tuner-mark-sharp { color: #f472b6; }
.gt-tuner-mark-center { color: var(--color-primary); }

.gt-tuner-needle {
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 4px;
  height: 110px;
  background: var(--color-text);
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(0deg);
  border-radius: 2px;
  transition: transform 0.1s ease-out, background 0.2s;
}
.gt-tuner-needle.is-tuned { background: var(--color-primary); }
.gt-tuner-needle.is-flat { background: var(--color-accent); }
.gt-tuner-needle.is-sharp { background: #f472b6; }

.gt-tuner-note {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--color-text);
  transition: color 0.2s;
}
.gt-tuner-note.is-tuned { color: var(--color-primary); }
.gt-tuner-note.is-flat { color: var(--color-accent); }
.gt-tuner-note.is-sharp { color: #f472b6; }

.gt-tuner-status {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.gt-tuner-cents {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-dim);
  margin-top: 4px;
  height: 20px;
}

.gt-tuner-strings {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.gt-tuner-string {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.gt-tuner-string:hover {
  border-color: var(--color-primary-dim);
}
.gt-tuner-string.is-active {
  background: rgba(82, 249, 137, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.1);
}

/* ---------- Metronome ---------- */
.gt-metro-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.gt-metro-bpm-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gt-metro-step {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gt-metro-bpm-input {
  width: 120px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.gt-metro-bpm-input::-webkit-outer-spin-button,
.gt-metro-bpm-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.gt-metro-bpm-unit {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-dim);
}
.gt-metro-slider {
  width: 100%;
}
.gt-metro-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
  min-height: 32px;
  flex-wrap: wrap;
}
.gt-metro-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 2px solid var(--color-border-strong);
  transition: background 0.08s ease-out, border-color 0.08s ease-out, transform 0.08s ease-out;
}
.gt-metro-dot.is-accent {
  border-color: var(--color-accent);
}
.gt-metro-dot.is-now {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.25);
}
.gt-metro-dot.is-accent.is-now {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.gt-metro-ctrls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.gt-metro-play {
  min-width: 140px;
  font-size: 16px;
  padding: 12px 22px;
}
.gt-metro-beats {
  min-width: 140px;
}
.gt-metro-tap-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.gt-metro-tap {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  padding: 18px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.08s, border-color 0.08s, transform 0.05s;
}
.gt-metro-tap:hover { background: var(--color-surface); }
.gt-metro-tap.is-tapped {
  background: rgba(82, 249, 137, 0.15);
  border-color: var(--color-primary);
  transform: scale(0.98);
}
.gt-metro-tap-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  min-height: 18px;
}
@media (max-width: 520px) {
  .gt-metro-card { padding: 18px; }
  .gt-metro-bpm-input { font-size: 32px; width: 100px; }
  .gt-metro-step { width: 40px; height: 40px; }
  .gt-metro-play { width: 100%; min-width: 0; }
  .gt-metro-beats { width: 100%; }
}
