@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Source+Code+Pro:wght@400;500&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&family=DM+Mono:wght@400;500;600&family=Syne:wght@700&display=swap');

:root {
  --bg: #0e0e0e;
  --bg2: #141414;
  --surface: #1a1a1a;
  --surface2: #222222;
  --surface3: #2a2a2a;
  --border: #333333;
  --border2: #444444;
  --accent: #e8922a;
  --accent-dim: #3d2200;
  --accent-glow: rgba(232,146,42,0.12);
  --blue: #6aabcf;
  --blue-dim: #0e1e2a;
  --green: #4a9e6a;
  --green-dim: #0a1a10;
  --text: #e2e2e2;
  --text1: #e2e2e2;
  --text2: #9a9a9a;
  --text3: #555555;
  --tab-bg: #080808;
  --tab-text: #c8c8c8;
  --ear-bg: #1e1608;
  --sidebar-w: 280px;
  --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(14,14,14,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px;
  z-index: 200;
  gap: 16px;
}

.topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-decoration: none;
}

.topbar-logo span { color: var(--text2); font-style: italic; font-size: 13px; }

.topbar-weeks {
  display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap;
}

.topbar-week {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.topbar-week:hover { color: var(--accent); border-color: var(--border2); }
.topbar-week.active { color: var(--accent); background: var(--accent-dim); border-color: var(--accent); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.sidebar-toggle {
  background: none; border: 1px solid var(--border2);
  color: var(--text2); cursor: pointer;
  padding: 6px 10px; border-radius: 4px;
  font-size: 13px; transition: all 0.15s;
}
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── LAYOUT ── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-header {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

.sidebar-week { border-bottom: 1px solid var(--border); }

.sidebar-week-header {
  display: flex; align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  gap: 10px;
  transition: background 0.1s;
  text-decoration: none;
  user-select: none;
}

.sidebar-week-header:hover { background: var(--surface); color: var(--text); }
.sidebar-week-header.active { color: var(--accent); }

.sidebar-week-num {
  width: 22px; height: 22px;
  background: var(--surface3);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text3);
}

.sidebar-week-header.active .sidebar-week-num {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-days { display: none; }
.sidebar-days.open { display: block; }

.sidebar-day {
  display: flex; align-items: center;
  padding: 7px 16px 7px 36px;
  font-size: 12px;
  color: var(--text3);
  text-decoration: none;
  gap: 8px;
  transition: all 0.1s;
}

.sidebar-day:hover { color: var(--text); background: var(--surface); }
.sidebar-day.active { color: var(--blue); background: var(--blue-dim); }

.sidebar-day-num {
  font-family: 'Source Code Pro', monospace;
  font-size: 10px;
  color: var(--text3);
  width: 30px;
  flex-shrink: 0;
}

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.25s ease;
  max-width: calc(100vw - var(--sidebar-w));
}

.sidebar.collapsed ~ .main {
  margin-left: 0;
  max-width: 100vw;
}

.content-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text3); text-decoration: none; transition: color 0.1s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text3); }
.breadcrumb .current { color: var(--text2); }

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text2);
  font-style: italic;
  font-family: 'Playfair Display', serif;
}

/* ── WEEK OVERVIEW ── */
.week-overview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 36px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text2);
}

/* ── DAY CARD ── */
.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 28px;
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.day-card-header {
  display: flex; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.day-card-header:hover { background: var(--surface2); }

.day-badge {
  background: var(--accent-dim);
  color: var(--accent);
  font-family: 'Source Code Pro', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid var(--accent);
  flex-shrink: 0;
}

.day-title-block { flex: 1; min-width: 0; }
.day-title { font-size: 15px; font-weight: 500; color: var(--text); }
.day-subtitle { font-size: 12px; color: var(--text3); margin-top: 2px; font-style: italic; }

.day-toggle {
  color: var(--text3); font-size: 14px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.day-toggle.open { transform: rotate(180deg); }

.day-card-body { padding: 24px; display: none; }
.day-card-body.open { display: block; }

.day-intro {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── SECTION ── */
.section { margin-bottom: 28px; }

.section-header {
  display: flex; align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.section-badge.theory { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(106,171,207,0.2); }
.section-badge.guitar { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,158,106,0.2); }
.section-badge.ear    { background: var(--ear-bg); color: #c8a060; border: 1px solid rgba(200,160,96,0.2); }

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.section-content {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text2);
}

.section-content p { margin-bottom: 12px; }
.section-content p:last-child { margin-bottom: 0; }

.section-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}
.src-table,
.section-content .src-table,
.song-ref .src-table,
.song-ref-body .src-table {
  width: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 0 !important;
  font-size: inherit !important;
}
.src-table td {
  border: none !important;
  vertical-align: middle !important;
}
.src-table .src-sep,
.src-table td:empty {
  background: transparent !important;
  padding: 0 3px !important;
}

.section-content th {
  background: #0a0a0a;
  color: var(--accent);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--border);
}

.section-content td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}

.section-content tr:nth-child(even) td { background: var(--surface2); }

/* ── CALLOUT ── */
.callout {
  border-radius: 6px;
  padding: 16px 20px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.7;
}

.callout.theory { background: var(--blue-dim); border: 1px solid rgba(106,171,207,0.2); border-left: 3px solid var(--blue); }
.callout.ear    { background: var(--ear-bg); border: 1px solid rgba(200,160,96,0.2); border-left: 3px solid #c8a060; }
.callout.neutral { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--border2); }
.callout.warning { background: #1a0a15; border: 1px solid rgba(180,80,120,0.2); border-left: 3px solid #b45080; }

.callout-title {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.callout.theory .callout-title { color: var(--blue); }
.callout.ear    .callout-title { color: #c8a060; }
.callout.neutral .callout-title { color: var(--accent); }
.callout.warning .callout-title { color: #b45080; }

/* ── TAB BLOCK ── */
.tab-wrap { margin: 12px 0; }

.tab-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}

.tab-block {
  background: var(--tab-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre;
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--tab-text);
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ── RECAP BOX ── */
.recap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin-top: 20px;
}

.recap-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.recap ul { list-style: none; }
.recap li {
  font-size: 13px;
  color: var(--text2);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.55;
}

.recap li::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--accent);
  font-size: 12px;
}

/* ── KEY CONCEPTS TABLE ── */
.concepts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.concept-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}

.concept-key {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
}

.concept-val {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

/* ── DAY SUMMARY CARD ── */
.day-summary-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--surface2);
}

.day-summary-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}

.day-summary-intro {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}

.day-parts {
  display: flex; gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.day-part-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 3px;
  font-weight: 400;
}

.day-part-pill.theory { background: var(--blue-dim); color: var(--blue); }
.day-part-pill.guitar { background: var(--green-dim); color: var(--green); }
.day-part-pill.ear    { background: var(--ear-bg); color: #c8a060; }

/* ── EAR TRAINING BADGE ── */
.ear-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: #c8a060;
  color: #0a0800;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── INLINE STYLES ── */
code {
  font-family: 'Source Code Pro', monospace;
  background: var(--surface3);
  color: var(--blue);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}

strong, b { font-weight: 500; color: var(--text); }
em, i { font-style: italic; color: var(--text2); }

/* ── INDEX PAGE ── */
.index-hero {
  text-align: center;
  padding: 60px 0 48px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.index-hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.index-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.15;
}

.index-hero-sub {
  font-size: 15px;
  color: var(--text2);
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 48px;
}

.week-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.15s;
  display: block;
}

.week-tile:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-1px);
}

.week-tile-num {
  font-family: 'Source Code Pro', monospace;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

.week-tile-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.25;
}

.week-tile-sub {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

.week-tile-days {
  display: flex; gap: 4px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.week-tile-day {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--surface3);
  color: var(--text3);
  border-radius: 3px;
}

/* ── COURSE STATS ── */
.stats-row {
  display: flex; gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1; min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  text-align: center;
}

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── PAGE NAV ── */
.page-nav {
  display: flex;
  gap: 12px;
  margin-top: 40px;
}

.page-nav-btn {
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text2);
  background: var(--surface);
  transition: all 0.15s;
}

.page-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── TS / ROOT PILL ── */
.ts {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  background: var(--surface3);
  border-radius: 3px;
  padding: 2px 4px;
}
.ts.active { color: var(--accent); background: rgba(232,168,56,0.15); }

.root-pill {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1;
}
.root-pill:hover {
  border-color: rgba(255,255,255,0.35);
  color: var(--text1);
}
.root-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── SONG REFERENCE CALLOUT ── */
.song-ref {
  margin: 16px 0 24px;
  padding: 14px 16px;
  background: var(--surface2);
  border-left: 3px solid #7c6aab;
  border-radius: 0 6px 6px 0;
}
.song-ref-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.song-ref-icon { font-size: 14px; }
.song-ref-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9a86c8;
}
.song-ref-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.song-ref-artist {
  font-size: 11px;
  color: #9a86c8;
  margin-bottom: 8px;
}
.song-ref-body {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.65;
}
.song-ref-chords {
  margin-top: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
}
.src-table {
  border-collapse: separate;
  border-spacing: 0;
  width: auto;
}
.src-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 10px 4px 0;
  vertical-align: bottom;
  white-space: nowrap;
}
.src-chord {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
  text-align: center;
  padding: 4px 10px 0;
  background: var(--surface3);
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
}
.src-deg {
  font-size: 10.5px;
  color: var(--text3);
  text-align: center;
  padding: 3px 10px 5px;
  border-top: 1px solid var(--border);
  background: var(--surface3);
  white-space: nowrap;
}
.src-sep {
  color: var(--text3);
  padding: 0 3px;
  font-size: 11px;
  vertical-align: middle;
  background: transparent;
}

/* ── SCALE/CHORD CONSTRUCTION BLOCKS ── */
.construct-block {
  margin: 18px 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.construct-header {
  padding: 10px 16px;
  background: var(--surface3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.construct-chord-name {
  font-family: 'Source Code Pro', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.construct-formula {
  font-size: 12px;
  color: var(--text3);
}
.construct-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.construct-step { display: flex; flex-direction: column; gap: 5px; }
.construct-step-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text3);
}
.construct-tab {
  font-family: 'Source Code Pro', monospace;
  font-size: 11.5px;
  background: var(--surface3);
  border-radius: 5px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.7;
  color: var(--text2);
}
.construct-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text2);
}
.legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.construct-note {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--surface3);
  border-radius: 5px;
  border-left: 2px solid var(--border);
}

/* degree highlight colours */
.d1  { color: #e8a838; font-weight: 700; }
.d2  { color: #74d4c8; font-weight: 700; }
.d3  { color: #5bba8c; font-weight: 700; }
.d4  { color: #e8d080; font-weight: 700; }
.d5  { color: #6ab0e8; font-weight: 700; }
.d6  { color: #88c8a0; font-weight: 700; }
.d7  { color: #c97be8; font-weight: 700; }
.d9  { color: #74d4c8; font-weight: 700; }
.db3 { color: #5bba8c; font-weight: 700; }
.db6 { color: #e8a070; font-weight: 700; }
.db7 { color: #e87c7c; font-weight: 700; }
.dmute { color: var(--text3); }

/* ── CHORD LIBRARY ── */
.chord-lib-browse {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 400px;
  opacity: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chord-lib-browse.collapsed {
  max-height: 0;
  opacity: 0;
}

.chord-diagram-wrap {
  position: relative;
  overflow: hidden;
  text-align: center;
}
.chord-diagram-wrap > div {
  display: inline-block;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.chord-diagram-wrap.slide-up > div   { opacity:0; transform: translateY(-8px); }
.chord-diagram-wrap.slide-down > div { opacity:0; transform: translateY(8px); }

.chord-pos-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}
.chord-pos-btn {
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 10px;
  width: 20px; height: 20px;
  border-radius: 3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
  padding: 0;
  line-height: 1;
}
.chord-pos-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chord-pos-btn:disabled { opacity: 0.2; cursor: default; }
.chord-pos-dots {
  display: flex; gap: 3px; align-items: center;
}
.chord-pos-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--border2);
  transition: background 0.1s;
}
.chord-pos-dot.active { background: var(--accent); }

.chord-unpin-all {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text2);
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  cursor: pointer;
  padding: 2px 8px;
  margin-left: auto;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
  line-height: 1.4;
}
.chord-unpin-all:hover { color: #e87c7c; border-color: #e87c7c; background: rgba(232,124,124,0.08); }

.chord-lib-btn {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  color: var(--text2);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.chord-lib-btn:hover { border-color: rgba(255,255,255,0.4); color: var(--text1); }
.chord-lib-btn.active { border-color: var(--accent); color: var(--accent); }

.chord-lib-panel {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: linear-gradient(180deg, rgba(20,18,16,0.99) 0%, rgba(12,12,12,0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(232,168,56,0.15);
  z-index: 190;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.45s cubic-bezier(0.16,1,0.3,1), opacity 0.35s ease, transform 0.35s ease;
}
.chord-lib-panel.open {
  max-height: 80vh;
  opacity: 1;
  transform: translateY(0);
  overflow-y: auto;
}
.chord-lib-inner {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,168,56,0.06) 0%, transparent 70%);
}

.chord-lib-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.chord-lib-roots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.chord-lib-root {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chord-lib-root:hover { border-color: var(--accent); color: var(--accent); }
.chord-lib-root.active { background: var(--accent); border-color: var(--accent); color: #1a1a1a; font-weight: 700; }

.chord-lib-results {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0;
  justify-content: center;
}
.chord-lib-results::-webkit-scrollbar { width: 4px; }
.chord-lib-results::-webkit-scrollbar-track { background: transparent; }
.chord-lib-results::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.chord-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}
.chord-card:hover { border-color: rgba(232,168,56,0.3); background: rgba(232,168,56,0.05); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.chord-card.pinned { border-color: var(--accent); background: rgba(232,168,56,0.08); }

.chord-card-name {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text1);
  text-align: center;
  margin-bottom: 6px;
}
.chord-card.pinned .chord-card-name { color: var(--accent); }

.chord-diagram svg {
  display: block;
  margin: 0 auto;
}

.chord-pin-indicator {
  position: absolute;
  top: 4px; right: 5px;
  font-size: 8px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.1s;
}
.chord-card.pinned .chord-pin-indicator { opacity: 1; }

.chord-unpin-btn {
  position: absolute;
  top: 3px; right: 4px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 9px;
  cursor: pointer;
  padding: 2px 3px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}
.chord-unpin-btn:hover { color: var(--text1); background: rgba(255,255,255,0.08); }

.chord-lib-pinned-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  justify-content: center;
  width: 100%;
}
.chord-lib-pinned-label {
  width: 100%;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 2px;
  text-align: center;
}
.chord-lib-empty {
  font-size: 11.5px;
  color: var(--text3);
  font-style: italic;
  padding: 4px 0;
  width: 100%;
  text-align: center;
}

/* ── EXERCISE BLOCK ── */
.exercise-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  margin: 24px 0 8px;
  overflow: hidden;
}
.exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(232,105,58,0.07);
  border-bottom: 1px solid var(--border);
}
.exercise-icon { font-size: 15px; }
.exercise-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.exercise-body {
  padding: 16px 18px 18px;
}
.exercise-intro {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.7;
  margin: 0 0 14px;
}
.exercise-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.ex-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.6;
}
.ex-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}
.ex-step-text strong { color: var(--text); }
.exercise-tab-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.ex-tab {
  margin: 10px 0 6px;
}
.ex-tip {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(106,171,207,0.08);
  border: 1px solid rgba(106,171,207,0.18);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}
.ex-tip-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-right: 8px;
  text-transform: uppercase;
}

/* ── STYLED TAB ── */
.styled-tab-wrap { margin: 12px 0; }
.styled-tab-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.styled-tab {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text2);
  overflow-x: auto;
  white-space: pre;
}
.styled-tab .t-string { color: var(--text3); }
.styled-tab .t-accent { color: var(--accent); font-weight: 600; }
.styled-tab .t-dim    { color: var(--text3); font-style: italic; }

/* ── SCALE TABLE (neck map / exercise diagrams) ── */
.scale-table-wrap { margin: 14px 0 6px; }
.scale-table-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.scale-table-box {
  background: var(--surface3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 8px 12px;
  overflow-x: auto;
  width: 100%;
}
.scale-table {
  border-collapse: collapse;
  font-family: 'DM Mono', monospace;
  width: 100%;
}
.scale-table th,
.scale-table td {
  text-align: center;
  padding: 2px 5px;
  white-space: nowrap;
  line-height: 1;
}
.st-string-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  text-align: left;
  width: 20px;
  border-right: 1px solid rgba(255,255,255,0.12);
  padding-right: 8px;
}
.st-fret-num {
  font-size: 10px;
  color: var(--text3);
  font-weight: 400;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  min-width: 34px;
}
.scale-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.scale-table tbody tr:first-child td { padding-top: 5px; }
.scale-table tbody tr:last-child  td { padding-bottom: 5px; }
.st-cell { padding: 3px 5px; }
.st-cell-nut { padding: 3px 5px; border-right: 1px solid rgba(255,255,255,0.12); }
.st-combined {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}
.st-deg-sup {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.8;
  margin-left: 1px;
}
.st-empty { color: rgba(255,255,255,0.15); font-size: 10px; }
.st-col-sizer { width: 38px; padding: 0; height: 0; line-height: 0; font-size: 0; }
.st-foot-cell {
  text-align: center;
  padding: 3px 2px 2px;
  vertical-align: top;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.st-foot-num {
  display: block;
  font-size: 9.5px;
  color: var(--text1);
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  line-height: 1.3;
}
.st-foot-dot {
  display: block;
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  line-height: 1;
  letter-spacing: 0;
}
.st-foot-nut {
  display: block;
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}

/* ── TABLET (≤900px) ── */
@media (max-width: 900px) {
  .topbar-weeks { display: none; }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
    --header-h: 52px;
  }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-logo { font-size: 13px; }
  .topbar-weeks { display: none; }
  .topbar-btn { padding: 6px 12px; font-size: 13px; }
  .sidebar { box-shadow: 4px 0 32px rgba(0,0,0,0.6); z-index: 200; }
  .sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w) - 4px)); }
  .main { margin-left: 0 !important; max-width: 100vw !important; }
  .content-inner { padding: 20px 16px 64px; }
  .breadcrumb { font-size: 11px; margin-bottom: 20px; gap: 5px; }
  .page-eyebrow { font-size: 10px; }
  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 12px; }
  .week-overview { padding: 14px 16px; font-size: 13px; }
  .day-card-header { padding: 12px 14px; gap: 10px; }
  .day-badge { font-size: 9.5px; padding: 2px 7px; }
  .day-title { font-size: 13.5px; }
  .day-subtitle { font-size: 11px; }
  .day-card-body { padding: 16px; }
  .day-intro { font-size: 13px; margin-bottom: 16px; padding-bottom: 12px; }
  .section { margin-bottom: 20px; }
  .section-title { font-size: 13px; }
  .section-content { font-size: 13px; }
  .section-content table { font-size: 11.5px; }
  .section-content th { font-size: 10px; padding: 6px 8px; }
  .section-content td { padding: 5px 8px; }
  .callout { padding: 12px 14px; font-size: 12.5px; }
  .callout-title { font-size: 10.5px; }
  .tab-block { font-size: 11px; padding: 10px 12px; }
  .tab-label { font-size: 10px; }
  .recap { padding: 12px 14px; }
  .recap li { font-size: 12px; }
  .concepts-grid { grid-template-columns: 1fr; gap: 8px; }
  .concept-key { font-size: 11px; }
  .concept-val { font-size: 11px; }
  .index-hero { padding: 32px 0 28px; }
  .index-hero-title { font-size: 30px; }
  .index-hero-sub { font-size: 13px; }
  .index-grid { grid-template-columns: 1fr; gap: 10px; }
  .week-tile { padding: 16px; }
  .week-tile-title { font-size: 15px; }
  .week-tile-sub { font-size: 11px; }
  .stats-row { gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 9.5px; }
  .page-nav { flex-direction: column; gap: 10px; align-items: stretch; }
  .page-nav-btn { text-align: center; }
  .sidebar-day { padding: 9px 14px 9px 34px; font-size: 12px; }
  .sidebar-week-header { padding: 11px 14px; }
  .construct-tab { font-size: 10px; padding: 8px 10px; }
  .construct-chord-name { font-size: 13px; }
}

/* ── SMALL PHONE (≤390px) ── */
@media (max-width: 390px) {
  .content-inner { padding: 16px 12px 60px; }
  .page-title { font-size: 20px; }
  .index-hero-title { font-size: 26px; }
  .day-card-body { padding: 14px 12px; }
  .tab-block { font-size: 10.5px; }
}

/* ── Tuner Panel ─────────────────────────────────────────────────── */
.topbar > #tuner-btn { margin-left: auto; }

.tuner-panel {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: linear-gradient(180deg, rgba(20,18,16,0.99) 0%, rgba(12,12,12,0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(232,168,56,0.15);
  z-index: 190;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.45s cubic-bezier(0.16,1,0.3,1), opacity 0.35s ease, transform 0.35s ease;
}
.tuner-panel.open {
  max-height: 360px;
  opacity: 1;
  transform: translateY(0);
  overflow-y: auto;
}
.tuner-panel-inner {
  padding: 16px 20px 18px;
  max-width: 720px;
  margin: 0 auto;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,168,56,0.06) 0%, transparent 70%);
}

.tuner-pre { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.tuner-start-btn {
  padding: 10px 26px; border-radius: 100px; border: 1px solid var(--accent);
  background: rgba(255,138,61,0.12); color: var(--accent);
  font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: .03em; cursor: pointer;
  transition: all .2s ease;
}
.tuner-start-btn:hover { background: var(--accent); color: #0a0a0a; }
.tuner-status { font-size: 11px; color: #8a8a8a; text-align: center; line-height: 1.5; }
.tuner-hint { font-size: 10.5px; color: #666; }

.tuner-live { display: none; flex-direction: column; gap: 10px; }
.tuner-live.on { display: flex; }

.tuner-row-top { display: flex; align-items: center; gap: 24px; }
.tuner-note-wrap { display: flex; align-items: baseline; min-width: 110px; justify-content: flex-end; flex-shrink: 0; }
.tuner-note-letter { font-size: 56px; font-weight: 700; letter-spacing: -.02em; color: #f5f5f5; line-height: 1; font-family: 'Inter', sans-serif; }
.tuner-note-acc { font-size: 32px; font-weight: 500; color: #b0b0b0; line-height: 1; }
.tuner-note-oct { font-size: 16px; font-weight: 600; color: #707070; font-family: 'JetBrains Mono', 'DM Mono', monospace; margin-left: 4px; }
.tuner-note-letter.in-tune, .tuner-note-letter.in-tune + .tuner-note-acc { color: #4a9e6a; text-shadow: 0 0 16px rgba(74,158,106,0.35); }

.tuner-meter-wrap { flex: 1; min-width: 0; }
.tuner-target { font-size: 10px; color: #707070; letter-spacing: .12em; text-transform: uppercase; font-family: 'JetBrains Mono','DM Mono',monospace; text-align: center; margin-bottom: 6px; min-height: 12px; }
.tuner-target b { color: var(--accent); font-weight: 600; }
.tuner-meter { position: relative; height: 36px; display: flex; align-items: center; justify-content: center; }
.tuner-meter-track { position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: #232323; transform: translateY(-50%); }
.tuner-meter-zero { position: absolute; top: 50%; left: 50%; width: 2px; height: 16px; background: #707070; transform: translate(-50%,-50%); }
.tuner-meter-needle {
  position: absolute; top: 50%; left: 50%; width: 3px; height: 30px;
  background: var(--accent); border-radius: 2px;
  transform: translate(-50%,-50%);
  transition: left .08s cubic-bezier(.2,.8,.3,1), background .25s;
  box-shadow: 0 0 12px rgba(255,138,61,0.35);
}
.tuner-meter-needle.in-tune { background: #4a9e6a; box-shadow: 0 0 14px rgba(74,158,106,0.4); }
.tuner-cents-row { display: flex; justify-content: space-between; font-family: 'JetBrains Mono','DM Mono',monospace; font-size: 10px; color: #707070; letter-spacing: .06em; margin-top: 4px; }
.tuner-cents-mid { color: #b0b0b0; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tuner-cents-mid.in-tune { color: #4a9e6a; }

.tuner-row-bottom { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tuner-strings { display: flex; gap: 5px; flex-shrink: 0; }
.tuner-string-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #232323;
  background: #1a1a1a; color: #b0b0b0; font-size: 11px; font-weight: 600;
  font-family: 'JetBrains Mono','DM Mono',monospace; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  -webkit-appearance: none; appearance: none;
}
.tuner-string-btn:hover { border-color: #707070; color: #f5f5f5; }
.tuner-string-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(255,138,61,0.12); }
.tuner-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.tuner-hz { font-family: 'JetBrains Mono','DM Mono',monospace; font-size: 11px; color: #b0b0b0; letter-spacing: .05em; text-align: right; }
.tuner-level-wrap { width: 100%; }
.tuner-level-track { width: 100%; height: 3px; background: #1a1a1a; border-radius: 2px; overflow: hidden; }
.tuner-level-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #4a9e6a, #ff8a3d); transition: width .08s linear; }

.tuner-panel.stale .tuner-note-letter,
.tuner-panel.stale .tuner-note-acc,
.tuner-panel.stale .tuner-note-oct,
.tuner-panel.stale .tuner-meter-needle,
.tuner-panel.stale .tuner-cents-mid,
.tuner-panel.stale .tuner-target { opacity: 0.28; transition: opacity .4s ease; }
.tuner-panel.stale .tuner-meter-needle { box-shadow: none; }

@media (max-width: 600px) {
  .tuner-panel-inner { padding: 12px 14px 14px; }
  .tuner-row-top { gap: 14px; }
  .tuner-note-letter { font-size: 44px; }
  .tuner-note-acc { font-size: 24px; }
  .tuner-note-wrap { min-width: 80px; }
  .tuner-row-bottom { gap: 12px; }
  .tuner-info { min-width: 100%; }
  .tuner-hz { text-align: center; }
}
