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

body {
  background: linear-gradient(145deg, #faf8f4 0%, #f0ece4 50%, #e8e2d8 100%);
  min-height: 100vh;
  font-family: 'Outfit', sans-serif;
  color: #333;
  font-size: 16px;
  transition: background 0.6s ease;
}
body.dark-mode {
  background: linear-gradient(145deg, #1a1d24 0%, #22262e 50%, #2a2e38 100%);
  color: #d8d8d8;
}
body.dark-mode .container { color: #d8d8d8; }
body.dark-mode .key-btn { background: #2a2e38; color: #aaa; border: 1px solid #3a3e48; box-shadow: none; }
body.dark-mode .key-btn:hover { background: #3a3e48; color: #ddd; }
body.dark-mode .key-btn.active { background: #c8a04a; color: #111; }
body.dark-mode .tab-btn { background: #2a2e38; color: #aaa; border-color: #3a3e48; box-shadow: none; }
body.dark-mode .tab-btn.active { background: #c8a04a; color: #111; border-color: #c8a04a; }
body.dark-mode .progression-builder { background: #22262e; border-color: #3a3e48; }
body.dark-mode .progression-line { background: #2a2e38; border-color: #3a3e48; }
body.dark-mode .progression-line.current { border-color: #c8a04a; background: #2e3240; }
body.dark-mode .progression-chord { background: #2a2e38; border-color: #3a3e48; }
body.dark-mode .progression-chord .chord-name { color: #c8a04a; }
body.dark-mode .progression-chord .chord-roman { color: #888; }
body.dark-mode .progression-title { color: #888; }
body.dark-mode .song-name-input { color: #e0d8c8; border-bottom-color: rgba(200,160,74,0.25); }
body.dark-mode .song-name-input::placeholder { color: #555; }
body.dark-mode .song-name-input:focus { border-bottom-color: #c8a04a; }
body.dark-mode .key-label { color: #888; }
body.dark-mode .tagline { color: #666; }
body.dark-mode .logo { color: #ebe8e2; }
body.dark-mode .logo span { color: #d4a853; }
body.dark-mode .logo-container { background: rgba(255,255,255,0.05); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
body.dark-mode .tagline { color: #606068; }
body.dark-mode .tool-buttons button { background: #2a2e38; color: #aaa; border-color: #3a3e48; box-shadow: none; }
body.dark-mode .tool-buttons button:hover { background: #3a3e48; color: #ddd; }
body.dark-mode .tool-buttons button.active { background: #c8a04a; color: #111; border-color: #c8a04a; }
body.dark-mode .chord-box { background: #2a2e38; border-color: #3a3e48; }
body.dark-mode .chord-box:hover { background: #3a3e48; border-color: #c8a04a; }
body.dark-mode .chord-box .note { color: #e0e0e0; }
body.dark-mode .chord-box .chord-type { color: #999; }
body.dark-mode .chord-numeral { color: #c8a04a; }
body.dark-mode .tone-bot { background: #3a3e48; color: #ccc; border-color: #4a4e58; }
body.dark-mode .chord-row { background: rgba(255,255,255,0.03); }
body.dark-mode .chord-row.secondary { border-color: #3a3e48; }
body.dark-mode .chord-row.main { border-color: #4a4e58; background: rgba(255,255,255,0.05); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
body.dark-mode .chord-row.modal { border-color: #3a3e48; }
body.dark-mode .row-label { background: #22262e; color: #999; border-color: #3a3e48; }
body.dark-mode .row-warning { background: #2a2200; color: #c8a04a; border-color: #4a3a00; }
body.dark-mode .nav-text { background: #22262e; color: #888; border-color: #3a3e48; }
body.dark-mode .chord-detail-panel { background: #22262e; border-color: #3a3e48; box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
body.dark-mode .chord-detail-title { color: #e0e0e0; }
body.dark-mode .info-panel { background: #22262e; border-color: #3a3e48; color: #aaa; }
body.dark-mode .info-panel h4 { color: #c8a04a; }
body.dark-mode .variation-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .variation-btn:hover { border-color: #c8a04a; color: #ddd; }
body.dark-mode .variation-btn.active { background: #c8a04a; color: #111; border-color: #c8a04a; }
body.dark-mode .theory-context { background: #2a2e38; border-left-color: #c8a04a; }
body.dark-mode .theory-item { color: #aaa; }
body.dark-mode .theory-item strong { color: #c8a04a; }
body.dark-mode .clear-btn { background: #2a2e38; border-color: #3a3e48; color: #888; }
body.dark-mode .add-line-btn { background: #2a2e38; border-color: #3a3e48; color: #888; }
body.dark-mode .tuner-btn, body.dark-mode .chordpicker-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .tuner-btn.active, body.dark-mode .chordpicker-btn.active { background: #c8a04a; color: #111; border-color: #c8a04a; }
body.dark-mode .play-btn { background: #c8a04a; color: #111; }
body.dark-mode .looper-play-btn { background: #c8a04a; color: #111; }
body.dark-mode .style-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .style-btn.active { background: #c8a04a; color: #111; border-color: #c8a04a; }
body.dark-mode .bpm-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .bpm-display { color: #aaa; }
body.dark-mode .track-btn { background: #2a2e38; border-color: #3a3e48; }
body.dark-mode .track-btn.active { background: #2e3240; border-color: #c8a04a; }
body.dark-mode .variant-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .variant-btn.active { background: #c8a04a; color: #111; border-color: #c8a04a; }
body.dark-mode .looper-controls { border-bottom-color: #3a3e48; }
body.dark-mode .repeat-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .repeats-label { color: #888; }
body.dark-mode .line-header { border-bottom-color: #3a3e48; }
body.dark-mode .prog-arrow { color: #555; }
body.dark-mode .file-btn { background: #2a2e38; border-color: #3a3e48; color: #aaa; }
body.dark-mode .tool-toggle-btn { background: #2a2e38; border-color: #3a3e48; color: #c8a04a; }
@media (max-width: 900px) { body.dark-mode .tool-buttons { background: #22262e; border-color: #3a3e48; } }
body.dark-mode .site-footer { background: linear-gradient(135deg, #1a1d24 0%, #22262e 100%); border-top-color: #c8a04a; }
body.dark-mode .support-desc { color: #999; }
body.dark-mode .footer-credit { color: #777; }
body.dark-mode .donation-btn { background: linear-gradient(135deg, #c8a04a, #a07830); color: #111; border-color: #c8a04a; }
body.dark-mode .donation-btn:hover { background: linear-gradient(135deg, #dbb455, #b88a3a); box-shadow: 0 4px 16px rgba(200, 160, 74, 0.4); }

.container { max-width: 1600px; margin: 0 auto; padding: 15px 40px; }

.header { text-align: center; margin-bottom: 20px; }
.logo-container { display: inline-flex; align-items: center; justify-content: center; gap: 15px; background: rgba(255,255,255,0.7); padding: 12px 30px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.logo-image { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.logo { font-family: 'Playfair Display', Georgia, serif; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; color: #2c2c2c; }
.logo span { color: #c8a04a; }
.tagline { font-size: 12px; color: #888; letter-spacing: 0.15em; margin-top: 8px; font-weight: 500; text-transform: uppercase; }

/* CONTROLS */
.key-selector { display: flex; align-items: center; justify-content: center; margin-bottom: 15px; gap: 6px; flex-wrap: wrap;}
.key-label { font-size: 12px; color: #666; letter-spacing: 0.1em; margin-right: 10px; font-weight: 700; }
.key-btn { width: 38px; height: 38px; border: none; border-radius: 6px; background: #fff; color: #555; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.key-btn:hover { background: #f0f0f0; color: #333; transform: translateY(-2px); }
.key-btn.active { background: #fdd835; color: #1a1a1a; font-weight: 800; box-shadow: 0 4px 15px rgba(253,216,53,0.4); }

/* Controls bar: harmony tabs left, tools right */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: nowrap;
}
.controls-left { display: flex; align-items: center; flex-shrink: 0; }
.controls-right { display: flex; align-items: center; gap: 8px; position: relative; flex-shrink: 0; margin-left: auto; }

.tool-toggle-btn {
  display: none; /* hidden on desktop, shown on mobile */
  background: #fff;
  color: #8b7355;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.tool-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.scale-btn, .fretboard-btn, .arpeggiator-btn, .keyfinder-btn, .info-btn { background: #fff; color: #8b7355; border: 1px solid #ccc; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 12px; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,0.06); transition: all 0.15s; }
.scale-btn:hover, .fretboard-btn:hover, .arpeggiator-btn:hover, .keyfinder-btn:hover, .info-btn:hover { background: #f5f5f5; color: #333; }
.fretboard-btn.active, .arpeggiator-btn.active, .keyfinder-btn.active, .info-btn.active { background: #fdd835; color: #1a1a1a; border-color: #e6b800; }

@media (max-width: 900px) {
  .tool-toggle-btn { display: block; }
  .tool-buttons { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 8px; flex-direction: column; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 160px; }
  .tool-buttons.open { display: flex; }
}

.tab-buttons { display: flex; justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 0; }
.tab-btn { padding: 8px 20px; background: #fff; border: 1px solid #ccc; border-radius: 6px; color: #666; font-size: 12px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.06); transition: all 0.15s ease; }
.tab-btn.active { background: #fdd835; color: #1a1a1a; border-color: #e6b800; font-weight: bold; }

/* PROGRESSION - NOW AT TOP, COMPACT */
.progression-builder { background: #fff; border-radius: 10px; padding: 12px 18px; border: 1px solid #ddd; margin-bottom: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.06); }
.progression-header { display: flex; justify-content: space-between; margin-bottom: 10px; align-items: center; }
.progression-title { font-size: 11px; color: #666; letter-spacing: 0.1em; font-weight: 700; }
.clear-btn { background: #f5f5f5; border: 1px solid #ccc; color: #666; padding: 4px 10px; font-size: 10px; cursor: pointer; border-radius: 4px; transition: all 0.15s; }
.progression-area { display: flex; flex-direction: column; gap: 10px; min-height: 36px; }

/* Song Name */
.song-name-row {
  margin-bottom: 10px;
}
.song-name-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(200,160,74,0.3);
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  padding: 4px 2px;
  outline: none;
  transition: border-color 0.2s;
}
.song-name-input::placeholder {
  color: #bbb;
  font-weight: 400;
}
.song-name-input:focus {
  border-bottom-color: #c8a04a;
}

/* Multi-line progression */
.progression-lines { display: flex; flex-direction: column; gap: 8px; }
.progression-line {
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}
.progression-line.current { border-color: #fdd835; background: #fffef5; }
.progression-line.playing-line { background: #fffde7; }

.line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.line-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.line-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.line-label {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.05em;
}
.line-repeats {
  display: flex;
  align-items: center;
  gap: 3px;
}
.repeats-label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
}
.repeat-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #666;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.repeat-btn.infinite {
  font-size: 16px;
  line-height: 0;
  padding-bottom: 2px;
}
.repeat-btn:hover { background: #e8e8e8; color: #333; }
.repeat-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

.remove-line-btn {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  transition: color 0.15s;
}
.remove-line-btn:hover { color: #ff5555; }

.line-chords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  cursor: pointer;
}
.line-empty {
  font-style: italic;
  color: #bbb;
  font-size: 11px;
}

.add-line-btn {
  background: #f5f5f5;
  border: 2px dashed #ccc;
  color: #888;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  width: 100%;
}
.add-line-btn:hover { background: #fff; border-color: #fdd835; color: #666; }

.progression-chord { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 6px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.15s ease; overflow: visible; }
.progression-chord:hover { border-color: #fdd835; transform: translateY(-2px); }
.progression-chord .chord-name { color: #c9a000; font-weight: 700; font-size: 14px; }
.remove-btn { background: none; border: none; color: #999; cursor: pointer; font-size: 16px; line-height: 1; transition: color 0.15s; }
.remove-btn:hover { color: #ff5555; }
.progression-empty { font-style: italic; color: #999; font-size: 12px; }
.prog-arrow { font-size: 16px; color: #bbb; font-weight: bold; }
.play-btn { background: #fdd835; color: #111; font-weight: 800; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; transition: all 0.15s ease; font-size: 10px; }
.play-btn:hover { background: #ffeb3b; transform: scale(1.05); }
.progression-chord.playing { border-color: #fdd835; box-shadow: 0 0 20px rgba(253,216,53,0.5); background: #fffde7; transform: scale(1.05); }

/* CHORD GRID */
.chord-grid { position: relative; padding: 5px; }
.chord-row { display: flex; justify-content: center; align-items: center; padding: 12px 15px; margin-bottom: 6px; border-radius: 12px; position: relative; transition: all 0.15s ease; }
.chord-row.secondary { border: 2px dashed #ccc; background: rgba(255,255,255,0.5); margin-top: 10px; }
.chord-row.main { border: 2px solid #bbb; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.chord-row.modal { border: 2px solid #ccc; background: rgba(255,255,255,0.5); }
.chord-row.dark-harmony { border: 2px solid #666; background: rgba(100,100,100,0.1); }

/* ===== DARK HARMONY LAYOUT ===== */
.dark-harmony-container { padding: 5px 0; }

.dark-header { text-align: center; margin-bottom: 16px; padding: 12px 20px; background: rgba(0,0,0,0.15); border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); }
.dark-header-title { font-size: 18px; font-weight: 600; color: #e0e0e0; letter-spacing: 0.02em; }
.dark-header-sub { font-size: 11px; font-weight: 400; color: #888; margin-top: 2px; }

/* Section boxes */
.dark-section { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); margin-bottom: 0; border-radius: 12px; position: relative; padding: 28px 24px 16px; }
.dark-main-row { border-color: rgba(200, 160, 74, 0.35); background: rgba(200, 160, 74, 0.04); box-shadow: 0 2px 12px rgba(200, 160, 74, 0.08); }
.dark-sec-row { border-style: solid; border-color: rgba(255,255,255,0.12); }
.dark-section .row-label { background: #2a2e38; color: #aaa; border-color: #3a3e48; }
.dark-main-row .row-label { background: #c8a04a; color: #111; border-color: #c8a04a; }
.row-label-sub { font-weight: 400; opacity: 0.7; margin-left: 3px; }

/* Chord grid — generous gaps everywhere */
.dark-chords-grid { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }

/* Per-chord cells — generous width to prevent crowding */
.dark-chord-cell { display: flex; flex-direction: column; align-items: center; min-width: 90px; }
.chord-enharmonic { font-size: 9px; color: #888; font-weight: 500; height: 14px; line-height: 14px; letter-spacing: 0.02em; opacity: 0.8; }
.dark-ext-hint { font-size: 9px; color: #999; font-weight: 500; margin-top: 2px; letter-spacing: 0.02em; opacity: 0.7; height: 14px; }

/* Override chord-wrapper width in dark harmony for more room */
.dark-section .chord-wrapper { width: 80px; }
.dark-section .chord-tones { gap: 3px; }
.dark-section .chord-tones .tone-pill { font-size: 9px; padding: 1px 5px; min-width: 22px; }

/* ===== TOP ROW: Sec Dim V + Neapolitan side by side ===== */
.dark-top-row { display: flex; gap: 10px; align-items: stretch; }
.dark-top-row .dark-sec-row { flex: 1; min-width: 0; }

/* Neapolitan box — dashed gold border, sits at end of top row */
.dark-neap-box { flex: 0 0 auto; min-width: 130px; border-style: dashed !important; border-color: rgba(200, 160, 74, 0.3) !important; background: rgba(200, 160, 74, 0.03) !important; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dark-neap-box .row-label { background: rgba(200, 160, 74, 0.15); color: #c8a04a; border-color: rgba(200, 160, 74, 0.3); }
.dark-neap-grid { flex-direction: column; align-items: center; }
.dark-neap-bass { font-size: 14px; font-weight: 600; color: #c8a04a; margin-top: -2px; letter-spacing: 0.02em; }

/* ===== ARROW BARS between rows ===== */
.dark-arrow-bar { position: relative; display: flex; align-items: center; justify-content: space-between; margin: 2px 0; padding: 0 12px; height: 36px; }
.dark-arrow-bar::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #c8a04a; opacity: 0.25; }
.dark-arrow-bar-label { position: relative; z-index: 1; font-size: 10px; color: #888; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; display: flex; align-items: center; gap: 8px; background: #1a1d24; padding: 2px 10px; }
.dark-arrow-bar-label svg { width: 16px; height: 11px; fill: none; stroke: #888; stroke-width: 1.5; }

/* Resolution labels — the specific target chord */
.dark-arrow-resolve { color: #c8a04a; }
.dark-arrow-resolve svg { stroke: #c8a04a; }
.dark-resolve-target { display: inline-flex; align-items: center; gap: 3px; background: rgba(200, 160, 74, 0.12); border: 1px solid rgba(200, 160, 74, 0.3); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #e0d0a0; letter-spacing: 0.02em; margin: 0 2px; }
.dark-resolve-numeral { font-size: 9px; font-weight: 500; color: #c8a04a; opacity: 0.8; }

/* Neapolitan resolution hint */
.dark-neap-resolve { font-size: 9px; color: #c8a04a; opacity: 0.8; margin-top: 6px; letter-spacing: 0.03em; text-align: center; font-weight: 500; }

/* ===== MAIN CHORDS — START HERE ===== */
.dark-main-section { position: relative; }
.dark-start-badge { position: absolute; left: -4px; top: 50%; transform: translateY(-50%) rotate(180deg); background: #c8a04a; color: #111; font-size: 9px; font-weight: 700; padding: 6px 5px; border-radius: 8px; letter-spacing: 0.06em; text-transform: uppercase; z-index: 2; writing-mode: vertical-lr; white-space: nowrap; }

/* Example progressions */
.dark-examples { margin-top: 16px; background: rgba(0,0,0,0.15); border-radius: 12px; padding: 14px 16px; border: 1px solid rgba(255,255,255,0.06); }
.dark-examples-title { font-size: 11px; font-weight: 600; color: #aaa; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; text-align: center; }
.dark-example-list { display: flex; flex-direction: column; gap: 6px; }
.dark-example-item { display: flex; align-items: center; gap: 12px; padding: 7px 14px; background: rgba(255,255,255,0.04); border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); }
.dark-ex-prog { font-size: 12px; color: #ddd; font-weight: 500; font-family: 'Outfit', monospace; letter-spacing: 0.02em; flex: 1; }
.dark-ex-label { font-size: 9px; font-weight: 600; color: #888; letter-spacing: 0.03em; white-space: nowrap; }
.dark-ex-label::before { content: '→ '; color: #c8a04a; }

@media (max-width: 768px) {
  .dark-top-row { flex-direction: column; }
  .dark-neap-box { min-width: auto; }
  .dark-chords-grid { gap: 12px; }
  .dark-chord-cell { min-width: 74px; }
  .dark-section .chord-wrapper { width: 72px; }
  .dark-example-item { flex-direction: column; align-items: flex-start; gap: 2px; }
  .dark-start-badge { position: static; writing-mode: horizontal-tb; transform: none; text-align: center; margin-bottom: 6px; display: inline-block; }
  .dark-main-section { text-align: center; }
}

.row-label { position: absolute; top: -10px; left: 20px; background: #f5f2ed; padding: 1px 10px; font-size: 10px; font-weight: 700; color: #666; letter-spacing: 0.05em; border: 1px solid #ccc; border-radius: 12px; font-family: 'Outfit', sans-serif; }

/* INCREASED GAP for chord wrappers to separate chord tones */
.chords-container { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.chord-wrapper { display: flex; flex-direction: column; align-items: center; width: 70px; }
.chord-wrapper.empty { opacity: 0.3; }
.chord-numeral { font-size: 11px; color: #8b7355; margin-bottom: 4px; font-weight: 700; font-family: 'Outfit', sans-serif; }

.chord-box { width: 62px; height: 62px; background: #f8f8f8; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; border: 2px solid #ddd; transition: all 0.15s ease; }
.chord-box:hover { transform: translateY(-3px); border-color: #fdd835; background: #fff; }
.chord-box.highlighted { border-color: #fdd835; box-shadow: 0 0 15px rgba(253, 216, 53, 0.4); transform: scale(1.05); }
.chord-box.selected { border-color: #c8a04a; background: #faf5ee; }
.chord-box.empty { cursor: default; }
.chord-box.empty:hover { transform: none; border-color: #ddd; background: #f8f8f8; }
.chord-box .note { font-size: 22px; font-weight: 700; color: #2a2a2a; font-family: 'Outfit', sans-serif; }
.chord-box .chord-type { font-size: 11px; color: #777; margin-top: -2px; font-weight: 500; }

.connector-area { min-height: 25px; display: flex; align-items: center; justify-content: center; padding: 4px 0; overflow: visible; }
.nav-text { font-size: 9px; color: #888; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; background: #f5f2ed; padding: 3px 8px; border-radius: 12px; border: 1px solid #ccc; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* MAIN LAYOUT - Horizontal split for chord detail */
.main-content { display: flex; gap: 20px; align-items: flex-start; }
.chord-section { flex: 1; min-width: 0; }
.detail-section { flex: 0 0 300px; position: sticky; top: 10px; }

@media (max-width: 1100px) {
  .main-content { flex-direction: column; }
  .chord-section { width: 100%; }
  .detail-section { flex: none; width: 100%; position: static; }
}

/* CHORD TONES (Double Stack) - more compact */
.chord-tones { display: flex; gap: 3px; margin-top: 5px; justify-content: center; }
.tone-stack { display: flex; flex-direction: column; width: 18px; cursor: pointer; transition: transform 0.1s; }
.tone-stack:hover { transform: translateY(-2px); }
.tone-top { height: 12px; border-top-left-radius: 3px; border-top-right-radius: 3px; color: #111; font-weight: 800; font-size: 8px; display: flex; align-items: center; justify-content: center; }
.tone-bot { height: 14px; background: #e0e0e0; color: #333; font-size: 8px; font-weight: 700; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; display: flex; align-items: center; justify-content: center; border: 1px solid #ccc; border-top: none; }
.tone-stack.selected-note .tone-bot { background: #333; color: #fff; }

/* DETAIL PANEL - Always visible in side panel */
.chord-detail-panel { background: #fff; border-radius: 10px; padding: 15px; border: 1px solid #ddd; box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.chord-detail-panel.always-visible { display: block; }

.chord-detail-header { display: flex; justify-content: space-between; margin-bottom: 12px; align-items: center; }
.chord-detail-title { font-size: 20px; color: #2a2a2a; font-weight: 700; font-family: 'Outfit', sans-serif; }
.chord-detail-close { background: #f5f5f5; border: 1px solid #ccc; color: #666; padding: 6px 14px; cursor: pointer; border-radius: 6px; font-size: 12px; display: none; }
.chord-variations { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.variation-btn { background: #f5f5f5; border: 1px solid #ccc; color: #555; padding: 5px 10px; font-size: 11px; cursor: pointer; border-radius: 4px; transition: all 0.15s; font-weight: 500; }
.variation-btn:hover { border-color: #fdd835; color: #333; background: #fff; }
.variation-btn.active { background: #fdd835; color: #1a1a1a; border-color: #fdd835; font-weight: 800; }
.chord-diagrams { display: flex; gap: 10px; margin-bottom: 10px; justify-content: flex-start; flex-wrap: wrap; flex-direction: column; }
.chord-diagram { background: #1a1a20; padding: 4px; border-radius: 6px; border: 1px solid #444; }

/* Diagram categories (Oolimo-style) */
.diagram-category {
  margin-bottom: 16px;
}
.category-label {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dotted #555;
}
.category-diagrams {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.oolimo-btn { background: #f5f5f5; border: 1px solid #ccc; color: #666; padding: 8px; cursor: pointer; width: 100%; text-align: center; border-radius: 6px; font-size: 11px; transition: all 0.15s; }
.oolimo-btn:hover { background: #fff; color: #333; border-color: #aaa; }

/* GUITAR NECK */
.fretboard-container { margin-top: 12px; padding: 15px; background: #2a2a30; border-radius: 10px; border: 1px solid #444; overflow-x: auto; box-shadow: inset 0 0 30px rgba(0,0,0,0.3); }
.fretboard-container.hidden { display: none; }
.scale-board { margin-bottom: 20px; }
.scale-header { display: flex; justify-content: space-between; margin-bottom: 8px; color: #ccc; font-size: 13px; font-weight: 600; padding: 0 10px; }
.scale-select { background: #3a3a40; border: 1px solid #555; color: #fdd835; padding: 5px 12px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.scale-select optgroup { background: #2a2a30; color: #888; font-size: 10px; }
.scale-select option { background: #3a3a40; color: #fff; }

/* Custom scrollbar for fretboard */
.fretboard-container::-webkit-scrollbar {
  height: 8px;
}
.fretboard-container::-webkit-scrollbar-track {
  background: #1a1a20;
  border-radius: 10px;
}
.fretboard-container::-webkit-scrollbar-thumb {
  background: #5a5a60;
  border-radius: 10px;
}
.fretboard-container::-webkit-scrollbar-thumb:hover {
  background: #7a7a80;
}

/* Scale Info Button */
.scale-info-btn {
  background: transparent;
  border: 1px solid #555;
  color: #fdd835;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scale-info-btn:hover { background: #fdd835; color: #111; border-color: #fdd835; }

/* Scale Info Popup */
.scale-info-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.scale-info-popup.hidden { display: none; }
.scale-info-content {
  background: linear-gradient(145deg, #2a2e35 0%, #1e2228 100%);
  padding: 20px 25px;
  border-radius: 12px;
  border: 1px solid #444;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  position: relative;
  color: #ddd;
}
.scale-info-content h3 {
  color: #fdd835;
  font-size: 18px;
  margin: 0 0 8px 0;
}
.scale-info-feel {
  color: #a09888;
  font-style: italic;
  font-size: 13px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #444;
}
.scale-info-section {
  margin-bottom: 12px;
}
.scale-info-section strong {
  color: #c4a878;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.scale-info-section p {
  margin: 5px 0 0 0;
  font-size: 13px;
  line-height: 1.4;
}
.scale-info-tip {
  background: rgba(253,216,53,0.1);
  border: 1px solid rgba(253,216,53,0.3);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 15px;
  font-size: 12px;
  line-height: 1.4;
}
.scale-info-tip strong {
  color: #fdd835;
}
.scale-subtitle {
  font-size: 14px;
  color: #888;
  font-weight: 400;
}
.scale-info-blues {
  background: rgba(106, 155, 212, 0.15);
  border: 1px solid rgba(106, 155, 212, 0.4);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.4;
}
.scale-info-blues strong {
  color: #6a9bd4;
}
.blues-badge {
  display: inline-block;
  background: #6a9bd4;
  color: #111;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

/* Scale boards header with Add button */
.scale-boards-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 10px; }
.scale-boards-header span { color: #fdd835; font-size: 15px; font-weight: 700; }
.add-scale-btn { background: #4a4a48; border: 1px solid #6a6a60; color: #d0ccc0; padding: 5px 12px; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 600; transition: all 0.15s; }
.add-scale-btn:hover { background: #5a5a55; color: #e8e4d8; border-color: #8a8878; }

.scale-controls { display: flex; gap: 8px; align-items: center; }
.remove-scale-btn { background: #5a4a4a; border: 1px solid #8a6868; color: #e0c0c0; width: 26px; height: 26px; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: bold; transition: all 0.15s; }
.remove-scale-btn:hover { background: #7a5a5a; color: #ffe0e0; border-color: #aa7878; }

/* CAGED Toggle Button */
.caged-toggle-btn {
  background: #3a3a40;
  border: 1px solid #555;
  color: #aaa;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: all 0.15s;
}
.caged-toggle-btn:hover { background: #4a4a50; color: #fff; border-color: #777; }
.caged-toggle-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

/* Blues Toggle Button */
.blues-toggle-btn {
  background: #3a3a40;
  border: 1px solid #555;
  color: #aaa;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s;
}
.blues-toggle-btn:hover { background: #4a5a70; color: #8ab4e8; border-color: #6a9bd4; }
.blues-toggle-btn.active {
  background: #6a9bd4;
  color: #111;
  border-color: #6a9bd4;
  box-shadow: 0 0 8px rgba(106, 155, 212, 0.4);
}

/* Blue Notes Styling */
.neck-note.blue-note {
  opacity: 0.75;
  border: 2px dashed rgba(255,255,255,0.5);
  box-shadow: 0 0 6px rgba(106, 155, 212, 0.6);
}

/* CAGED Shape Buttons Row */
.caged-buttons {
  position: relative;
  height: 28px;
  margin-bottom: 5px;
  padding-left: 50px;
  min-width: 950px;
}

.caged-shape-btn {
  position: absolute;
  transform: translateX(-50%);
  background: #4a4a50;
  border: 2px solid #666;
  color: #ccc;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: all 0.15s;
  z-index: 10;
}
.caged-shape-btn:hover {
  background: #5a5a60;
  color: #fff;
  border-color: #888;
  transform: translateX(-50%) scale(1.1);
}
.caged-shape-btn.active {
  background: #fdd835;
  color: #111;
  border-color: #fdd835;
  box-shadow: 0 0 10px rgba(253, 216, 53, 0.5);
}

/* CAGED Fret Highlighting */
.fret-cell.caged-highlight {
  background: rgba(255, 248, 180, 0.22);
}
.fret-cell.nut.caged-highlight {
  background: rgba(255, 248, 180, 0.28);
}
.fnum.caged-highlight {
  color: #fdd835;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(253, 216, 53, 0.6);
}

.guitar-neck { display: flex; flex-direction: column; background: linear-gradient(180deg, #3a3020 0%, #2a2015 100%); border: 1px solid #000; position: relative; min-width: 950px; padding-left: 50px; border-radius: 5px; overflow: hidden; }
.neck-row { display: flex; position: relative; height: 32px; }

/* FIX: fret-cell always takes up space regardless of content */
.fret-cell {
  flex: 1;
  border-right: 2px solid #1a1a1a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: transparent;
  min-width: 50px;
}
.fret-cell::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--string-height, 1px);
  background: var(--string-color, #888);
  transform: translateY(-50%);
  z-index: 1;
}

/* FIX: Nut cell has fixed width and always displays string */
.fret-cell.nut {
  flex: 0 0 25px;
  min-width: 25px;
  max-width: 25px;
  border-right: 6px solid #d4c8a0;
  background: #1a1a1a;
}
.fret-cell.nut::before {
  left: 0;
  right: -6px;
}
.fret-cell:last-child { border-right: none; }

/* String thicknesses via CSS variables - applied per row */
.neck-row:nth-child(2) .fret-cell { --string-height: 1px; --string-color: #c0c0c0; }
.neck-row:nth-child(3) .fret-cell { --string-height: 1px; --string-color: #b0b0b0; }
.neck-row:nth-child(4) .fret-cell { --string-height: 2px; --string-color: #a0a0a0; }
.neck-row:nth-child(5) .fret-cell { --string-height: 2px; --string-color: #909090; }
.neck-row:nth-child(6) .fret-cell { --string-height: 3px; --string-color: #808080; }
.neck-row:nth-child(7) .fret-cell { --string-height: 3px; --string-color: #707070; }

.fret-numbers { display: flex; margin-bottom: 3px; }
.fnum { flex: 1; text-align: center; font-size: 10px; color: #666; font-weight: bold; min-width: 50px; }
.fnum.nut { flex: 0 0 25px; min-width: 25px; max-width: 25px; }

.string-name { position: absolute; left: -45px; width: 35px; text-align: right; font-size: 12px; color: #888; line-height: 32px; font-weight: 700; z-index: 5; }

.neck-note { width: 26px; height: 28px; z-index: 10; border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; color: #111; box-shadow: 0 2px 4px rgba(0,0,0,0.7); cursor: pointer; line-height: 1; transition: transform 0.1s; gap: 0px; }
.neck-note .note-interval { font-size: 10px; }
.neck-note .note-name { font-size: 7px; opacity: 0.8; }
.neck-note:hover { transform: scale(1.15); z-index: 20; }
.neck-note.root { border: 2px solid #fff; box-shadow: 0 0 10px #fff; }
.neck-note.chord-tone { outline: 2px solid #fdd835; outline-offset: 1px; }

.inlay-dot { position: absolute; width: 10px; height: 10px; background: rgba(200,180,140,0.3); border-radius: 50%; z-index: 0; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* ========== ARPEGGIATOR ========== */
.arpeggiator-container {
  background: linear-gradient(145deg, #2a2e35 0%, #1e2228 100%);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid #3a3a40;
}
.arpeggiator-container.hidden { display: none; }
.tuner-container.hidden { display: none; }

.arp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #3a3a40;
}
.arp-title {
  color: #fdd835;
  font-size: 16px;
  font-weight: 700;
}
.arp-subtitle {
  color: #888;
  font-size: 12px;
}

.arp-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.arp-picker {
  flex: 1;
}
.arp-roots {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.arp-root-btn {
  background: #3a3a40;
  border: 1px solid #555;
  color: #aaa;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  min-width: 36px;
}
.arp-root-btn:hover { background: #4a4a50; color: #fff; border-color: #777; }
.arp-root-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

.arp-selectors {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.arp-selector-group {
  flex: 1;
}
.arp-label {
  display: block;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.arp-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.arp-qual-btn, .arp-ext-btn {
  background: #3a4048;
  border: 1px solid #4a5058;
  color: #bbb;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  text-align: center;
}
.arp-qual-btn:hover, .arp-ext-btn:hover { background: #4a5058; color: #fff; }
.arp-qual-btn.active, .arp-ext-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

.arp-result {
  background: #1a1e24;
  border-radius: 10px;
  padding: 15px 20px;
  text-align: center;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.arp-chord-name {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}
.arp-tones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.arp-tone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 40px;
}
.arp-tone-degree {
  font-size: 12px;
  font-weight: 800;
  color: #111;
}
.arp-tone-note {
  font-size: 9px;
  color: #333;
  font-weight: 600;
}
.arp-play-btn {
  background: #c8a04a;
  border: none;
  color: #111;
  padding: 8px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.arp-play-btn:hover { background: #d4ad58; }

.arp-lock-btn {
  background: transparent;
  border: 1px solid rgba(200, 160, 74, 0.4);
  color: #c8a04a;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.arp-lock-btn:hover {
  background: rgba(200, 160, 74, 0.15);
  border-color: #c8a04a;
}

/* Locked arpeggiator boards */
.arp-locked-board {
  border: 1px solid rgba(200, 160, 74, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(200, 160, 74, 0.04);
  position: relative;
}
.arp-locked-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.arp-locked-chord {
  font-size: 18px;
  font-weight: 800;
  color: #c8a04a;
  min-width: 60px;
}
.arp-locked-tones {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.arp-tone.mini {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}
.arp-tone.mini .arp-tone-degree { font-size: 10px; }
.arp-tone.mini .arp-tone-note { font-size: 8px; }
.arp-unlock-btn {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(255,100,100,0.3);
  color: #e57373;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.arp-unlock-btn:hover {
  background: rgba(255,100,100,0.15);
  border-color: #e57373;
}

.arp-locked-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid rgba(200, 160, 74, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-left: auto;
    margin-right: 8px;
}
.arp-locked-view-toggle .arp-view-btn {
    padding: 3px 10px;
    font-size: 10px;
}

.arp-neck-container {
  margin-top: 15px;
  overflow-x: auto;
}
.arp-locked-board .arp-neck-container {
  margin-top: 8px;
}

/* Arpeggiator View Toggle */
.arp-view-toggle {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.arp-view-btn {
  background: #3a3a40;
  border: 1px solid #555;
  color: #aaa;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}
.arp-view-btn:hover { background: #4a4a50; color: #fff; }
.arp-view-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

/* Arpeggiator Shape Buttons */
.arp-shapes-row {
  position: relative;
  height: 36px;
  margin: 10px 0;
  padding-left: 50px;
  min-width: 950px;
  display: flex;
  align-items: center;
  overflow-x: auto;
}
.arp-shapes-label {
  position: absolute;
  left: 0;
  color: #888;
  font-size: 11px;
  font-weight: 600;
}
.arp-shape-btn {
  position: absolute;
  transform: translateX(-50%);
  background: #4a4a50;
  border: 2px solid #666;
  color: #ccc;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.15s;
}
.arp-shape-btn:hover {
  background: #5a5a60;
  color: #fff;
  border-color: #888;
  transform: translateX(-50%) scale(1.1);
}
.arp-shape-btn.active {
  background: #fdd835;
  color: #111;
  border-color: #fdd835;
  box-shadow: 0 0 10px rgba(253, 216, 53, 0.5);
}

/* ========== LOOPER CONTROLS ========== */
.looper-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
}

.looper-play-btn {
  background: #c8a04a;
  border: none;
  color: #111;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
  min-width: 80px;
}
.looper-play-btn:hover { background: #d4ad58; }
.looper-play-btn:disabled { background: #ccc; cursor: not-allowed; }
.looper-play-btn.playing {
  background: #c44;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.looper-style {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.style-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #666;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}
.style-btn:hover { background: #e8e8e8; color: #333; }
.style-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

.looper-bpm {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bpm-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #666;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s;
}
.bpm-btn:hover { background: #e0e0e0; color: #333; }
.bpm-display {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  min-width: 60px;
  text-align: center;
}

.looper-tracks {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.track-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
  opacity: 0.5;
}
.track-btn:hover { background: #e0e0e0; opacity: 0.8; }
.track-btn.active {
  background: #faf5ee;
  border-color: #c8a04a;
  opacity: 1;
}

/* File buttons */
.looper-file-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.file-btn {
  background: #f5f5f5;
  border: 1px solid #ccc;
  color: #666;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}
.file-btn:hover { background: #e8e8e8; color: #333; }
.file-btn.disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.file-btn.undo-btn, .file-btn.redo-btn { font-size: 12px; }
.file-btn.clear-btn { color: #c55; }
.file-btn.clear-btn:hover { background: #fee; color: #a33; }

/* Variant buttons */
.looper-variant {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.variant-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #666;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.15s;
}
.variant-btn:hover { background: #e0e0e0; }
.variant-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

/* Infinite loop button */
.repeat-btn.infinite {
  font-size: 14px;
  padding: 2px 8px;
}
.repeat-btn.infinite.active {
  background: #faf5ee;
  border-color: #c8a04a;
  color: #8b7355;
}

/* Chord roman numeral display */
.chord-roman {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  font-weight: 600;
}
.progression-chord {
  flex-direction: column;
  min-width: 90px;
  text-align: center;
  padding: 10px 14px;
  overflow: visible;
}
.progression-chord .chord-name {
  font-weight: 700;
  font-size: 15px;
}
.progression-chord .chord-roman {
  color: #888;
  font-size: 10px;
}

/* Drag and drop */
.line-drag-handle {
  cursor: grab;
  color: #bbb;
  font-size: 14px;
  padding: 0 4px;
  user-select: none;
}
.line-drag-handle:hover { color: #888; }

.progression-chord[draggable="true"] {
  cursor: grab;
  position: relative;
}
.progression-chord[draggable="true"]:active {
  cursor: grabbing;
}
.progression-chord.dragging {
  opacity: 0.4;
  transform: scale(0.92);
}
/* Drop insertion indicators — bright vertical bar on left or right */
.progression-chord.drop-before::before,
.progression-chord.drop-after::after {
  content: '';
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  background: #c8a04a;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(200, 160, 74, 0.6);
  z-index: 5;
}
.progression-chord.drop-before::before { left: -6px; }
.progression-chord.drop-after::after { right: -6px; }
.progression-chord.drop-before,
.progression-chord.drop-after {
  background: rgba(200, 160, 74, 0.08);
}
.progression-chord.drag-over {
  border-color: #fdd835;
  box-shadow: 0 0 10px rgba(253, 216, 53, 0.5);
}

.progression-line.dragging-line {
  opacity: 0.5;
  transform: scale(0.98);
}
.progression-line.drag-over-line {
  border-color: #c8a04a;
  box-shadow: 0 0 10px rgba(200, 160, 74, 0.5);
}

.line-chords.drag-over {
  background: rgba(253, 216, 53, 0.1);
}

.progression-chord.playing {
  background: #fdd835 !important;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(253, 216, 53, 0.5);
}

/* Arpeggiator button styling */
.arpeggiator-btn {
  background: #fff;
  border: 1px solid #ccc;
  color: #8b7355;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: all 0.15s;
}
.arpeggiator-btn:hover { background: #f5f5f5; color: #333; }
.arpeggiator-btn.active { background: #fdd835; color: #111; border-color: #e6b800; }

/* POPUP */
.scale-popup { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 999; backdrop-filter: blur(8px); }
.scale-popup.hidden { display: none; }
.scale-popup-content { background: #fff; padding: 30px; border-radius: 12px; border: 1px solid #ddd; max-width: 600px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); position: relative; }
.degree-grid { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.degree-card { background: #fff; padding: 12px 18px; border-radius: 8px; border: 2px solid #ddd; text-align: center; min-width: 60px; }
.deg-num { color: #888; font-size: 12px; margin-bottom: 5px; font-weight: bold; }
.deg-note { font-weight: bold; font-size: 18px; color: #333; }
.close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; color: #888; font-size: 24px; cursor: pointer; }
.close-btn:hover { color: #333; }

.info-panel { background: #fff; border: 1px solid #ddd; padding: 15px; border-radius: 8px; margin-top: 12px; font-size: 13px; line-height: 1.5; color: #555; box-shadow: 0 4px 15px rgba(0,0,0,0.06); }
.info-panel.hidden { display: none; }
.info-panel h4 { color: #2a2a2a; margin-top: 0; margin-bottom: 8px; font-size: 14px; font-family: 'Outfit', sans-serif; }

/* Songwriter Theory Context */
.theory-context { background: #faf8f4; border-left: 3px solid #c8a04a; padding: 15px; margin-bottom: 15px; border-radius: 5px; }
.theory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theory-item { font-size: 12px; color: #555; line-height: 1.4; }
.theory-item.full { grid-column: span 2; border-top: 1px solid #ddd; padding-top: 10px; margin-top: 3px; color: #333; }
.theory-item strong { color: #8b7355; display: block; margin-bottom: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Outfit', sans-serif; }

/* ====== CHORD PICKER (Oolimo-style) ====== */
.chord-picker-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}
.chord-picker-popup.hidden { display: none; }

.chord-picker-content {
  background: linear-gradient(180deg, #2a2e35 0%, #1e2228 100%);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #444;
  max-width: 550px;
  width: 95%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.chord-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.chord-picker-title { font-size: 18px; color: #c4b89a; font-weight: 300; letter-spacing: 0.05em; }
.chord-picker-close { background: none; border: none; color: #888; font-size: 24px; cursor: pointer; }
.chord-picker-close:hover { color: #fff; }

/* Root note selection grid */
.root-note-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  margin-bottom: 15px;
  background: #1a1d22;
  padding: 8px;
  border-radius: 6px;
}
.root-note-btn {
  background: #2a2e35;
  border: 1px solid #3a3e45;
  color: #a09888;
  padding: 8px 0;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.root-note-btn .sharp-flat {
  font-size: 9px;
  color: #666;
  display: block;
  margin-top: 1px;
}
.root-note-btn:hover { background: #3a4045; color: #d4c8b8; }
.root-note-btn.active {
  background: #fdd835;
  color: #111;
  border-color: #fdd835;
  box-shadow: 0 0 10px rgba(253,216,53,0.4);
  font-weight: 700;
}

/* Quality buttons grid */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: #1a1d22;
  padding: 12px;
  border-radius: 6px;
}
.quality-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.quality-col-label {
  font-size: 10px;
  color: #888;
  text-align: center;
  padding: 5px;
  background: #1e2228;
  border-radius: 4px;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.quality-btn {
  background: #3a4550;
  border: 1px solid #4a5560;
  color: #a0b8c0;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.quality-btn:hover { background: #4a5a65; color: #d0e0e8; border-color: #6a7a85; }
.quality-btn.active {
  background: #fdd835;
  color: #111;
  border-color: #fdd835;
  box-shadow: 0 0 10px rgba(253,216,53,0.4);
  font-weight: 700;
}

.chord-picker-result {
  margin-top: 12px;
  text-align: center;
  padding: 12px;
  background: #1a1d22;
  border-radius: 6px;
}
.result-chord-name {
  font-size: 24px;
  color: #fdd835;
  font-weight: 700;
  margin-bottom: 10px;
}
.add-to-progression-btn {
  background: #fdd835;
  color: #111;
  font-weight: 700;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  margin-right: 8px;
}
.add-to-progression-btn:hover { background: #ffeb3b; transform: scale(1.05); }

.open-picker-btn {
  background: #fff;
  border: 1px solid #ccc;
  color: #8b7355;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
  margin-left: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.open-picker-btn:hover { background: #f5f5f5; color: #6a5535; border-color: #aaa; }

/* Secondary Dominant Row Warning */
.row-warning {
  position: absolute;
  top: -10px;
  right: 20px;
  background: #fff3e0;
  padding: 2px 10px;
  font-size: 9px;
  font-weight: 600;
  color: #e65100;
  border: 1px solid #ffcc80;
  border-radius: 12px;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
}
body.dark-mode .row-warning { background: rgba(200, 160, 74, 0.12); color: #c8a04a; border-color: rgba(200, 160, 74, 0.25); }
body.dark-mode .dark-section .row-warning { background: rgba(200, 160, 74, 0.08); color: #999; border-color: rgba(255,255,255,0.08); }

/* Secondary Dominant Warning in Theory Panel */
.sec-dom-warning {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border: 1px solid #ffcc80;
  border-left: 4px solid #ff9800;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #e65100;
  line-height: 1.4;
}
.sec-dom-warning strong {
  color: #bf360c;
}

/* Key Finder Button */
.keyfinder-btn {
  background: #fff;
  color: #8b7355;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: all 0.15s;
}
.keyfinder-btn:hover { background: #f5f5f5; color: #333; }
.keyfinder-btn.active { background: #fdd835; color: #1a1a1a; border-color: #e6b800; }

/* ===== KEY FINDER POPUP ===== */
.key-finder-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.key-finder-popup.hidden { display: none; }
.key-finder-content {
  background: #2a2a30;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.key-finder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.key-finder-title { color: #fdd835; font-size: 18px; font-weight: 700; }
.key-finder-close {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
}
.key-finder-close:hover { color: #fff; }
.key-finder-desc { color: #888; font-size: 12px; margin-bottom: 16px; }

.kf-root-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.kf-root-btn {
  padding: 8px 4px;
  background: #3a3a40;
  border: 1px solid #555;
  border-radius: 4px;
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.kf-root-btn:hover { background: #4a4a50; }
.kf-root-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }
.kf-root-btn small { display: block; font-size: 9px; color: #888; }
.kf-root-btn.active small { color: #666; }

.kf-quality-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.kf-quality-btn {
  padding: 6px 12px;
  background: #3a3a40;
  border: 1px solid #555;
  border-radius: 4px;
  color: #ccc;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kf-quality-btn:hover { background: #4a4a50; }
.kf-quality-btn.active { background: #fdd835; color: #111; border-color: #fdd835; }

.kf-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kf-preview {
  background: #1a1a20;
  padding: 8px 16px;
  border-radius: 6px;
  color: #fdd835;
  font-size: 18px;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
}
.kf-add-btn {
  background: #c8a04a;
  color: #111;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.kf-add-btn:hover { background: #d4ad58; }

.kf-progression {
  background: #1a1a20;
  padding: 12px;
  border-radius: 6px;
  min-height: 50px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.kf-empty { color: #555; font-size: 12px; }
.kf-chord {
  background: #3a3a40;
  padding: 6px 12px;
  border-radius: 4px;
  color: #fdd835;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kf-remove {
  color: #888;
  cursor: pointer;
  font-size: 12px;
}
.kf-remove:hover { color: #f44; }
.kf-arrow { color: #555; }

.kf-result {
  background: #1a1a20;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.kf-result-label { color: #888; font-size: 11px; margin-bottom: 6px; }
.kf-result-keys { color: #c8a04a; font-size: 16px; font-weight: 700; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kf-key-result { margin-right: 12px; }

/* Key blocks with chord chips */
.kf-key-block {
  margin-bottom: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}
.kf-key-block.selected {
  border-color: rgba(200, 160, 74, 0.3);
  background: rgba(200, 160, 74, 0.05);
}
.kf-key-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kf-key-name {
  color: #c8a04a;
  font-size: 14px;
  font-weight: 700;
  font-family: Outfit, sans-serif;
}
.kf-key-chords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kf-key-chord-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: #222;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: Outfit, sans-serif;
  min-width: 48px;
  text-align: center;
}
.kf-key-chord-item:hover:not(.matched) {
  background: #c8a04a;
  color: #111;
}
.kf-key-chord-item.matched {
  background: #c8a04a;
  color: #111;
  cursor: default;
}
.kf-key-chord-roman {
  font-size: 10px;
  font-weight: 700;
  color: inherit;
  opacity: 0.8;
  margin-bottom: 2px;
}
.kf-key-chord-name {
  font-size: 13px;
  font-weight: 700;
}

.kf-select-btn {
  background: #333;
  color: #888;
  border: 1px solid #444;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: Outfit, sans-serif;
}
.kf-select-btn:hover {
  background: #444;
  color: #c8a04a;
  border-color: #c8a04a;
}
.kf-select-btn.active {
  background: #c8a04a;
  color: #111;
  border-color: #c8a04a;
}

.kf-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.kf-clear-btn {
  background: #555;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.kf-clear-btn:hover { background: #666; }
.kf-use-btn {
  background: #fdd835;
  color: #111;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.kf-use-btn:hover { background: #ffeb3b; }

/* ========== KO-FI WIDGET FIX ========== */
.floatingchat-container-wrap {
  z-index: 9999 !important;
  overflow: visible !important;
}
.floatingchat-container-wrap-mo498 {
  z-index: 9999 !important;
}

/* ========== RHYMEFORGE BANNER ========== */
.rf-banner {
  display: block;
  max-width: 900px;
  width: calc(100% - 40px);
  margin: 30px auto;
  background: linear-gradient(135deg, #0e0e14 0%, #14141e 50%, #0e0e14 100%);
  border: 1px solid #252530;
  border-radius: 14px;
  padding: 24px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.rf-banner::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4a853, transparent);
}
.rf-banner::after {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 120px;
  background: radial-gradient(ellipse, rgba(212,168,83,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.rf-banner:hover {
  border-color: rgba(212,168,83,0.25);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 60px rgba(212,168,83,0.05);
  transform: translateY(-2px);
}

.rf-banner-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.rf-banner-from {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #606068;
  font-weight: 500;
  background: rgba(212,168,83,0.06);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212,168,83,0.1);
}
.rf-banner-lemon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.rf-banner-middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.rf-banner-text { flex: 1; }
.rf-banner-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 800;
  color: #ebe8e2;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.rf-banner-title span { color: #d4a853; }
.rf-banner-body {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-size: 13px;
  color: #a0a0a8;
  line-height: 1.6;
  max-width: 540px;
}
.rf-banner-body strong { color: #ebe8e2; font-weight: 600; }

.rf-banner-cta-wrap {
  flex-shrink: 0;
}
.rf-banner-cta {
  padding: 11px 24px;
  background: linear-gradient(135deg, #d4a853, #8b6914);
  color: #08080c;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', 'Outfit', sans-serif;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.rf-banner:hover .rf-banner-cta {
  background: linear-gradient(135deg, #e4bc6c, #d4a853);
  box-shadow: 0 4px 20px rgba(212,168,83,0.3);
}

.rf-rhyme-types {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.rf-chip {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #252530;
  color: #606068;
}
.rf-c1 { color: #5ec269; border-color: rgba(94,194,105,0.2); }
.rf-c2 { color: #4db8d4; border-color: rgba(77,184,212,0.2); }
.rf-c3 { color: #e06b5e; border-color: rgba(224,107,94,0.2); }
.rf-c4 { color: #e8a94e; border-color: rgba(232,169,78,0.2); }
.rf-c5 { color: #a86bd4; border-color: rgba(168,107,212,0.2); }

@media (max-width: 700px) {
  .rf-banner { width: calc(100% - 24px); padding: 20px 16px; }
  .rf-banner-middle { flex-direction: column; text-align: center; }
  .rf-banner-body { max-width: none; }
  .rf-banner-cta { width: 100%; text-align: center; display: block; }
  .rf-rhyme-types { justify-content: center; }
}

/* ========== FOOTER / DONATION SECTION ========== */
.site-footer {
  background: linear-gradient(135deg, #faf8f4 0%, #f0ece4 100%);
  border-top: 2px solid #c8a04a;
  padding: 24px 40px;
  margin-top: 40px;
  text-align: center;
}
.footer-content {
  max-width: 600px;
  margin: 0 auto;
}
.donation-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.donation-btn {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(135deg, #c8a04a 0%, #a07830 100%);
  color: #fff;
  border: 2px solid transparent;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(200, 160, 74, 0.3);
}
.donation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 160, 74, 0.5);
  color: #fff;
  text-decoration: none;
}
.donation-btn:visited { color: #fff; }
.support-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
  font-family: 'Outfit', sans-serif;
}
.footer-credit {
  font-size: 13px;
  color: #888;
  margin-top: 12px;
}
.footer-contact {
  font-size: 12px;
  color: #999;
  margin-top: 10px;
  font-family: 'Outfit', sans-serif;
}
.footer-contact a {
  color: #c8a04a;
  text-decoration: none;
  font-weight: 600;
}
.footer-contact a:hover {
  text-decoration: underline;
}
body.dark-mode .footer-contact { color: #777; }
body.dark-mode .footer-contact a { color: #d4a853; }

/* ========== MOBILE RESPONSIVENESS ========== */

/* Tablets (max-width: 1024px) */
@media (max-width: 1024px) {
  .container { padding: 12px 20px; }

  .chords-container { gap: 12px; }

  .fretboard-container { overflow-x: auto; }
  .guitar-neck { min-width: 100%; }
  .caged-buttons { min-width: 100%; }
  .arp-shapes-row { min-width: 100%; }

  .tool-buttons { gap: 6px; }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .container { padding: 10px 12px; }

  .logo { font-size: 24px; }
  .logo-image { width: 40px; height: 40px; }
  .tagline { font-size: 11px; }

  .key-selector { gap: 4px; margin-bottom: 10px; }
  .key-btn { width: 32px; height: 32px; font-size: 12px; }

  .tool-buttons {
    gap: 4px;
    flex-wrap: wrap;
  }
  .scale-btn, .fretboard-btn, .arpeggiator-btn, .keyfinder-btn, .info-btn, .tuner-btn, .chordpicker-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .tab-buttons { gap: 8px; margin-bottom: 10px; }
  .tab-btn { padding: 6px 12px; font-size: 11px; }

  .progression-builder { padding: 10px 12px; margin-bottom: 10px; }
  .progression-title { font-size: 10px; }

  .chords-container { gap: 12px; }
  .chord-wrapper { width: 60px; }
  .chord-box { width: 56px; height: 56px; }
  .chord-box .note { font-size: 18px; }

  .chord-row { padding: 10px 12px; margin-bottom: 4px; }

  .chord-detail-title { font-size: 16px; }

  .fretboard-container { padding: 12px; margin-top: 10px; overflow-x: auto; }
  .guitar-neck { min-width: calc(100vw - 24px); padding-left: 45px; }
  .caged-buttons { min-width: calc(100vw - 24px); padding-left: 45px; }

  .arp-controls { gap: 12px; }
  .arp-selectors { gap: 12px; }
  .arp-result { min-width: 140px; font-size: 24px; }

  .arp-shapes-row { min-width: calc(100vw - 24px); }
  .arp-neck-container { overflow-x: auto; }

  .looper-controls { gap: 10px; }
  .looper-play-btn { padding: 6px 12px; font-size: 12px; }
  .looper-style { gap: 2px; }
  .style-btn { padding: 4px 8px; font-size: 10px; }

  .looper-file-btns { margin-left: 0; margin-top: 8px; }

  .site-footer { padding: 20px 12px; }
  .donation-buttons { gap: 8px; }
  .donation-btn { padding: 8px 18px; font-size: 13px; }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .container { padding: 8px; }

  .logo-container { padding: 8px 16px; gap: 8px; }
  .logo { font-size: 20px; }
  .logo-image { width: 32px; height: 32px; }
  .tagline { font-size: 10px; margin-top: 4px; }

  .key-label { display: none; }
  .key-btn { width: 28px; height: 28px; font-size: 11px; }

  .tool-buttons { gap: 3px; }
  .scale-btn, .fretboard-btn, .arpeggiator-btn, .keyfinder-btn, .info-btn, .tuner-btn, .chordpicker-btn {
    padding: 5px 8px;
    font-size: 10px;
  }

  .tab-buttons { gap: 4px; margin-bottom: 8px; }
  .tab-btn { padding: 5px 10px; font-size: 10px; }

  .progression-builder { padding: 8px 10px; margin-bottom: 8px; }
  .progression-title { font-size: 9px; }
  .progression-header { margin-bottom: 6px; }

  .chords-container { gap: 8px; }
  .chord-wrapper { width: 50px; }
  .chord-box { width: 50px; height: 50px; }
  .chord-box .note { font-size: 16px; }
  .chord-box .chord-type { font-size: 10px; }

  .chord-row { padding: 8px 10px; margin-bottom: 3px; }
  .row-label { font-size: 8px; top: -8px; left: 12px; padding: 0 6px; }

  .chord-detail-panel { padding: 12px; }
  .chord-detail-title { font-size: 14px; }

  .variation-btn { padding: 4px 8px; font-size: 10px; }

  .fretboard-container { padding: 10px; margin-top: 8px; }
  .guitar-neck { min-width: calc(100vw - 16px); padding-left: 40px; }
  .caged-buttons { min-width: calc(100vw - 16px); padding-left: 40px; height: 24px; }
  .string-name { font-size: 10px; left: -38px; width: 30px; line-height: 28px; }
  .fret-cell { min-width: 42px; height: 28px; }
  .neck-row { height: 28px; }
  .neck-note { width: 22px; height: 24px; }

  .arp-controls { gap: 8px; }
  .arp-title { font-size: 14px; }
  .arp-subtitle { font-size: 10px; }
  .arp-selector-group { flex: 1; }
  .arp-label { font-size: 9px; }
  .arp-result { min-width: 120px; }
  .arp-chord-name { font-size: 24px; }
  .arp-tone { padding: 4px 6px; min-width: 32px; }

  .arp-shapes-row { min-width: calc(100vw - 16px); height: 32px; }
  .arp-shape-btn { width: 24px; height: 24px; font-size: 10px; }

  .looper-controls { gap: 6px; }
  .looper-play-btn { padding: 6px 10px; font-size: 11px; min-width: 70px; }
  .looper-style { gap: 2px; }
  .style-btn { padding: 4px 6px; font-size: 9px; }
  .bpm-btn { width: 24px; height: 24px; }
  .bpm-display { min-width: 50px; font-size: 11px; }
  .looper-tracks { gap: 2px; }
  .track-btn { padding: 3px 6px; font-size: 14px; }
  .looper-file-btns { margin-top: 6px; }
  .file-btn { padding: 4px 8px; font-size: 10px; }

  .site-footer { padding: 16px 8px; margin-top: 30px; }
  .donation-buttons { gap: 6px; }
  .donation-btn { padding: 8px 14px; font-size: 12px; }

  .kf-result-keys { grid-template-columns: 1fr; }

  /* Stack buttons vertically on very small screens */
  .looper-controls { flex-direction: column; align-items: stretch; }
  .looper-play-btn { width: 100%; }
  .looper-style { justify-content: center; }
  .looper-bpm { justify-content: center; }
  .looper-tracks { justify-content: center; }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
  .container { padding: 6px; }

  .logo { font-size: 18px; }
  .logo-image { width: 28px; height: 28px; }
  .logo-container { gap: 6px; padding: 6px 12px; }

  .key-btn { width: 26px; height: 26px; font-size: 10px; }

  .chords-container { gap: 6px; }
  .chord-wrapper { width: 48px; }
  .chord-box { width: 48px; height: 48px; }

  .guitar-neck { padding-left: 38px; }
  .caged-buttons { padding-left: 38px; }
  .string-name { left: -36px; width: 28px; font-size: 9px; }
}

/* ===== PROGRESSION ANALYSIS STYLES ===== */

.analysis-btn {
    background: none;
    border: 1px solid rgba(200, 160, 74, 0.3);
    color: #c8a04a;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    transition: all 0.2s;
    line-height: 1;
}
.analysis-btn:hover {
    background: rgba(200, 160, 74, 0.15);
    border-color: #c8a04a;
    transform: scale(1.1);
}

.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.analysis-section {
    border-bottom: 1px solid rgba(200, 160, 74, 0.15);
    padding-bottom: 14px;
}
.analysis-section:last-child { border-bottom: none; padding-bottom: 0; }

.analysis-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #c8a04a;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Character Badge */
.character-badge {
    display: inline-block;
    background: linear-gradient(135deg, #c8a04a, #a07830);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* Mood Arc */
.mood-bar-container {
    margin-bottom: 6px;
}
.mood-bar {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 50px;
    padding: 4px 0;
}
.mood-segment {
    flex: 1;
    min-width: 12px;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s;
}
.mood-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.mood-narrative {
    font-size: 12px;
    color: #bbb;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.4;
}

/* Cadences */
.cadence-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cadence-item {
    background: rgba(200, 160, 74, 0.06);
    border: 1px solid rgba(200, 160, 74, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
}
.cadence-tag {
    display: inline-block;
    background: #c8a04a;
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
}
.cadence-chords {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 4px;
}
.cadence-pos {
    color: #888;
    font-size: 10px;
}
.cadence-desc {
    font-size: 12px;
    color: #bbb;
    line-height: 1.4;
    margin-bottom: 4px;
}
.cadence-tip {
    font-size: 11px;
    color: #c8a04a;
    line-height: 1.4;
}
.cadence-none {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Transitions */
.transition-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.transition-row {
    padding: 8px 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    border-left: 3px solid transparent;
}
.transition-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.strength-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.transition-chords {
    font-weight: 600;
    font-size: 13px;
    color: #eee;
}
.transition-arrow-sm {
    color: #c8a04a;
    margin: 0 2px;
}
.transition-romans {
    font-size: 11px;
    color: #888;
}
.transition-strength {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin-left: auto;
}
.transition-explain {
    font-size: 12px;
    color: #bbb;
    line-height: 1.4;
    margin-bottom: 2px;
}
.transition-voice {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
}

/* Substitutions */
.substitution-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.substitution-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sub-chord {
    font-weight: 600;
    font-size: 13px;
    color: #eee;
}
.sub-roman {
    font-weight: 400;
    font-size: 11px;
    color: #888;
}
.sub-alternatives {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.suggestion-chip {
    display: inline-block;
    font-size: 11px;
    background: rgba(200, 160, 74, 0.1);
    border: 1px solid rgba(200, 160, 74, 0.25);
    color: #ccc;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: default;
    transition: background 0.2s;
    line-height: 1.4;
}
.suggestion-chip:hover {
    background: rgba(200, 160, 74, 0.2);
    color: #fff;
}

/* Light mode: give the analysis panel its own dark card so text is always readable */
.analysis-panel {
    background: #1e2028;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(200, 160, 74, 0.15);
}
/* In dark mode the side panel is already dark, so lighter background is fine */
body.dark-mode .analysis-panel {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Pop-out button */
.popout-btn {
    background: none;
    border: 1px solid rgba(200, 160, 74, 0.3);
    color: #c8a04a;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
    margin-left: 8px;
}
.popout-btn:hover {
    background: rgba(200, 160, 74, 0.15);
    border-color: #c8a04a;
    transform: scale(1.1);
}
/* Position within various headers */
.chord-picker-header .popout-btn,
.key-finder-header .popout-btn {
    margin-left: auto;
    margin-right: 8px;
}
.arp-header .popout-btn {
    margin-left: 8px;
}
.scale-boards-header .popout-btn {
    margin-left: 8px;
}

/* ===== GUITAR TUNER STYLES ===== */

.tuner-btn, .chordpicker-btn {
    background: #fff;
    color: #8b7355;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.15s;
}
.tuner-btn:hover, .chordpicker-btn:hover { background: #f5f5f5; color: #333; }
.tuner-btn.active, .chordpicker-btn.active { background: #fdd835; color: #1a1a1a; border-color: #e6b800; }

.panel-close-btn {
    background: none;
    border: 1px solid rgba(255,100,100,0.2);
    color: #e57373;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    margin-left: 4px;
    flex-shrink: 0;
}
.panel-close-btn:hover {
    background: rgba(255,100,100,0.15);
    border-color: #e57373;
}

.tuner-panel {
    background: linear-gradient(180deg, #1a1d24 0%, #22262e 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(200, 160, 74, 0.2);
}
.tuner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.tuner-title {
    font-size: 18px;
    font-weight: 700;
    color: #c8a04a;
}
.tuner-mode-toggle {
    display: flex;
    gap: 0;
    border: 1px solid rgba(200, 160, 74, 0.3);
    border-radius: 6px;
    overflow: hidden;
}
.tuner-mode-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}
.tuner-mode-btn.active {
    background: #c8a04a;
    color: #111;
}
.tuner-tuning-select {
    background: #2a2e38;
    color: #ccc;
    border: 1px solid rgba(200, 160, 74, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
}

/* Tuner Display */
.tuner-display {
    text-align: center;
    margin-bottom: 20px;
}
.tuner-note-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}
.tuner-note-name {
    font-size: 72px;
    font-weight: 800;
    color: #888;
    line-height: 1;
    min-width: 100px;
    transition: color 0.2s;
}
.tuner-flat-indicator,
.tuner-sharp-indicator {
    font-size: 32px;
    color: #333;
    transition: color 0.2s;
}
.tuner-flat-indicator.active { color: #f44336; }
.tuner-sharp-indicator.active { color: #f44336; }
.tuner-cents {
    font-size: 18px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 600;
}
.tuner-freq {
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
}

/* Needle gauge */
/* Unified vertical scrolling visualizer */
.tuner-vgraph {
    width: 100%;
    max-width: 420px;
    height: 300px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    border: 1px solid rgba(200, 160, 74, 0.15);
    margin: 0 auto 8px;
    display: block;
}

/* String buttons — clean horizontal bar */
.tuner-strings-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    flex-wrap: wrap;
}
.tuner-str-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid rgba(200, 160, 74, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 52px;
}
.tuner-str-btn:hover {
    border-color: rgba(200, 160, 74, 0.5);
    background: rgba(200, 160, 74, 0.1);
}
.tuner-str-btn.active {
    border-color: #c8a04a;
    background: rgba(200, 160, 74, 0.15);
    color: #c8a04a;
    box-shadow: 0 0 12px rgba(200, 160, 74, 0.2);
}
.tuner-str-name {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}
.tuner-str-name sub {
    font-size: 11px;
    opacity: 0.6;
}
.tuner-str-label {
    font-size: 10px;
    opacity: 0.5;
    white-space: nowrap;
}

/* Start button */
.tuner-start-row {
    text-align: center;
}
.tuner-start-btn {
    background: #c8a04a;
    color: #111;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.tuner-start-btn:hover {
    background: #d4ad58;
    transform: translateY(-1px);
}
.tuner-start-btn.active {
    background: #f44336;
    color: #fff;
}
.tuner-start-btn.active:hover {
    background: #e53935;
}

/* ===== CHORD SHAPE EDITOR ===== */

/* Chord shape button on progression chips */
.chord-shape-btn {
    background: none;
    border: none;
    color: rgba(200, 160, 74, 0.5);
    font-size: 10px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    position: absolute;
    top: 2px;
    left: 2px;
}
.chord-shape-btn:hover { color: #c8a04a; }

/* Mini chord diagram on the chip */
.mini-chord-svg {
    display: block;
    margin: 0 auto 6px;
    max-width: 100%;
    height: auto;
    overflow: visible;
}

/* Shape editor overlay */
.chord-shape-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chord-shape-editor {
    background: #1e2028;
    border: 1px solid rgba(200, 160, 74, 0.3);
    border-radius: 12px;
    padding: 20px;
    min-width: 320px;
    max-width: 400px;
}
.shape-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.shape-editor-title {
    color: #c8a04a;
    font-weight: 600;
    font-size: 16px;
}
.shape-editor-close {
    background: none;
    border: 1px solid rgba(255,100,100,0.3);
    color: #e57373;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}
.shape-fret-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #aaa;
    font-size: 13px;
}
.shape-fret-nav button {
    background: rgba(200, 160, 74, 0.15);
    border: 1px solid rgba(200, 160, 74, 0.3);
    color: #c8a04a;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.shape-string-headers {
    display: grid;
    grid-template-columns: 30px repeat(6, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}
.shape-string-header-spacer {
    /* Empty cell for alignment with fret numbers */
}
.shape-string-header {
    text-align: center;
    cursor: pointer;
    padding: 4px 0;
    border-radius: 4px;
    transition: background 0.15s;
}
.shape-string-header:hover { background: rgba(200, 160, 74, 0.1); }
.shape-string-name {
    display: block;
    color: #ccc;
    font-size: 11px;
    font-weight: 600;
}
.shape-string-state {
    display: block;
    font-size: 10px;
    color: rgba(200, 160, 74, 0.6);
    min-height: 12px;
}
.shape-fret-rows {
    /* Container for fret rows */
}
.shape-fret-row {
    display: grid;
    grid-template-columns: 30px repeat(6, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}
.shape-fret-num {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shape-fret-cell {
    height: 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.shape-fret-cell:hover {
    background: rgba(200, 160, 74, 0.15);
    border-color: rgba(200, 160, 74, 0.3);
}
.shape-fret-cell.active {
    background: rgba(200, 160, 74, 0.3);
    border-color: #c8a04a;
}
.shape-fret-cell.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    background: #c8a04a;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.shape-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.shape-editor-footer button {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
}
.shape-editor-footer button:first-child {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
}
.shape-editor-footer button:last-child {
    background: #c8a04a;
    border: none;
    color: #111;
    font-weight: 600;
}

/* ========== MELODY TAB EDITOR ========== */
.tab-toggle-btn {
    background: none;
    border: 1px solid rgba(200, 160, 74, 0.3);
    color: #999;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: Outfit, sans-serif;
}
.tab-toggle-btn:hover {
    border-color: #c8a04a;
    color: #c8a04a;
}
.tab-toggle-btn.active {
    background: #c8a04a;
    color: #111;
    border-color: #c8a04a;
}

.tab-section {
    margin-top: 8px;
    padding: 10px 8px;
    background: #111118;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(200, 160, 74, 0.15);
}

.tab-grid {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: fit-content;
}

.tab-labels {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
    margin-right: 4px;
}
.tab-label {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #c8a04a;
    opacity: 0.8;
    user-select: none;
}

.tab-barline {
    width: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 1px;
    flex-shrink: 0;
    margin: 0 2px;
    align-self: stretch;
}

.tab-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding: 0 1px;
    border-radius: 4px;
    transition: background 0.1s;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.tab-column:hover {
    background: rgba(200, 160, 74, 0.08);
}
.tab-column:hover .tab-col-remove {
    opacity: 1;
}

.tab-col-remove {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0 4px;
    line-height: 1;
    z-index: 2;
}
.tab-col-remove:hover { color: #f44; }

.tab-cell {
    width: 32px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.1s;
    border-radius: 3px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tab-cell:hover {
    background: rgba(200, 160, 74, 0.15);
}
.tab-cell.has-note {
    background: rgba(200, 160, 74, 0.12);
}

.tab-dash {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: rgba(255,255,255,0.25);
    user-select: none;
}

.tab-fret {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #f0e0a0;
}

.tab-cell.editing {
    background: rgba(200, 160, 74, 0.2);
}

.tab-cell-input {
    width: 28px;
    height: 22px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #c8a04a;
    border-radius: 3px;
    color: #fff;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    padding: 0;
    -moz-appearance: textfield;
}
.tab-cell-input::-webkit-inner-spin-button,
.tab-cell-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tab-add-col {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    flex-shrink: 0;
    background: none;
    border: 1px dashed rgba(200, 160, 74, 0.3);
    border-radius: 6px;
    color: rgba(200, 160, 74, 0.5);
    font-size: 18px;
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.15s;
    align-self: stretch;
}
.tab-add-col:hover {
    border-color: #c8a04a;
    color: #c8a04a;
    background: rgba(200, 160, 74, 0.1);
}

/* Light mode overrides for tab */
body:not(.dark-mode) .tab-section {
    background: #2a2a34;
    border-color: rgba(160, 130, 50, 0.2);
}
body:not(.dark-mode) .tab-barline {
    background: rgba(255,255,255,0.2);
}
body:not(.dark-mode) .tab-dash {
    color: rgba(255,255,255,0.2);
}
body:not(.dark-mode) .tab-fret {
    color: #f0e0a0;
}
body:not(.dark-mode) .tab-cell:hover {
    background: rgba(200, 160, 74, 0.15);
}
body:not(.dark-mode) .tab-cell.has-note {
    background: rgba(200, 160, 74, 0.12);
}
body:not(.dark-mode) .tab-cell.editing {
    background: rgba(200, 160, 74, 0.2);
}
body:not(.dark-mode) .tab-cell-input {
    background: rgba(0,0,0,0.4);
    border-color: #c8a04a;
    color: #fff;
}
body:not(.dark-mode) .tab-col-remove:hover { color: #f44; }
body:not(.dark-mode) .tab-label {
    color: #c8a04a;
}
body:not(.dark-mode) .tab-add-col {
    border-color: rgba(200, 160, 74, 0.3);
    color: rgba(200, 160, 74, 0.5);
}
body:not(.dark-mode) .tab-add-col:hover {
    border-color: #c8a04a;
    color: #c8a04a;
    background: rgba(200, 160, 74, 0.1);
}
body:not(.dark-mode) .tab-column {
    border-right-color: rgba(255,255,255,0.04);
}
body:not(.dark-mode) .tab-cell {
    border-bottom-color: rgba(255,255,255,0.05);
}
body:not(.dark-mode) .tab-artic-sym {
    color: #82b4dc;
}
body:not(.dark-mode) .tab-artic-col {
    background: rgba(255,255,255,0.02);
}
body:not(.dark-mode) .tab-toolbar button {
    color: #aaa;
    border-color: rgba(200, 160, 74, 0.25);
}
body:not(.dark-mode) .tab-transpose-btn {
    color: #aaa;
}

/* Tab toolbar */
.tab-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}
.tab-analysis-btn {
    background: none;
    border: 1px solid rgba(200, 160, 74, 0.25);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 8px;
    transition: all 0.15s;
    line-height: 1.2;
}
.tab-analysis-btn:hover {
    border-color: #c8a04a;
    background: rgba(200, 160, 74, 0.1);
}

/* Articulation columns between note columns */
.tab-artic-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 12px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}
.tab-artic-cell {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.tab-artic-cell:hover {
    background: rgba(130, 180, 220, 0.15);
}
.tab-artic-sym {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #82b4dc;
}
.tab-artic-empty {
    display: block;
    width: 6px;
    height: 1px;
    background: rgba(255,255,255,0.04);
}

/* Out-of-key note highlighting */
.tab-cell.out-of-key {
    background: rgba(255, 80, 80, 0.15) !important;
}
.tab-cell.out-of-key .tab-fret {
    color: #ff6b6b;
}

/* Melody analysis results */
.tab-analysis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
    border: 1px solid rgba(200, 160, 74, 0.15);
    position: relative;
}
.tab-analysis-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: Outfit, sans-serif;
}
.tab-analysis-badge.good {
    background: rgba(80, 200, 120, 0.2);
    color: #50c878;
    border: 1px solid rgba(80, 200, 120, 0.3);
}
.tab-analysis-badge.warn {
    background: rgba(255, 160, 60, 0.2);
    color: #ffa03c;
    border: 1px solid rgba(255, 160, 60, 0.3);
}
.tab-analysis-badge.key {
    background: rgba(200, 160, 74, 0.2);
    color: #c8a04a;
    border: 1px solid rgba(200, 160, 74, 0.3);
}
.tab-analysis-badge.outside {
    background: rgba(255, 80, 80, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 80, 80, 0.25);
}
.tab-analysis-text {
    font-size: 11px;
    color: #999;
    font-family: Outfit, sans-serif;
}
.tab-analysis-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.tab-analysis-close:hover { color: #f44; }

/* Light mode overrides for articulations and analysis */
body:not(.dark-mode) .tab-artic-sym {
    color: #c06060;
}
body:not(.dark-mode) .tab-artic-empty {
    background: rgba(0,0,0,0.06);
}
body:not(.dark-mode) .tab-artic-cell:hover {
    background: rgba(200, 160, 74, 0.12);
}
body:not(.dark-mode) .tab-cell.out-of-key {
    background: rgba(255, 80, 80, 0.12) !important;
}
body:not(.dark-mode) .tab-cell.out-of-key .tab-fret {
    color: #cc4444;
}
body:not(.dark-mode) .tab-analysis {
    background: rgba(0,0,0,0.04);
    border-color: rgba(160, 130, 50, 0.2);
}
body:not(.dark-mode) .tab-analysis-text {
    color: #777;
}

/* Tab transpose buttons */
.tab-transpose {
    display: flex;
    gap: 4px;
}
.tab-transpose-btn {
    background: none;
    border: 1px solid rgba(200, 160, 74, 0.25);
    color: #999;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: Outfit, sans-serif;
}
.tab-transpose-btn:hover {
    border-color: #c8a04a;
    color: #c8a04a;
    background: rgba(200, 160, 74, 0.1);
}
.tab-transpose-btn:active {
    background: #c8a04a;
    color: #111;
}
.tab-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

/* Save dialog overlay */
.save-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.save-dialog {
    background: #2a2e38;
    border-radius: 12px;
    padding: 24px 28px;
    min-width: 340px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(200, 160, 74, 0.2);
}
.save-dialog-title {
    font-family: Outfit, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #c8a04a;
    margin-bottom: 16px;
}
.save-dialog-label {
    font-family: Outfit, sans-serif;
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 6px;
}
.save-dialog-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(200, 160, 74, 0.3);
    border-radius: 6px;
    color: #fff;
    font-family: Outfit, sans-serif;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
}
.save-dialog-input:focus {
    border-color: #c8a04a;
}
.save-dialog-hint {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    margin-bottom: 18px;
    font-family: Outfit, sans-serif;
}
.save-dialog-safari-hint {
    font-size: 11px;
    color: #c8a04a;
    background: rgba(200,160,74,0.1);
    border: 1px solid rgba(200,160,74,0.2);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 14px;
    font-family: Outfit, sans-serif;
    line-height: 1.4;
}
.save-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.save-dialog-cancel {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: Outfit, sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.save-dialog-cancel:hover {
    border-color: #888;
    color: #ddd;
}
.save-dialog-confirm {
    background: #c8a04a;
    border: none;
    color: #111;
    padding: 8px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-family: Outfit, sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s;
}
.save-dialog-confirm:hover {
    background: #d4af5a;
}

/* Light mode save dialog */
body:not(.dark-mode) .save-dialog {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
body:not(.dark-mode) .save-dialog-input {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}
body:not(.dark-mode) .save-dialog-input:focus {
    border-color: #c8a04a;
}
body:not(.dark-mode) .save-dialog-cancel {
    border-color: #ddd;
    color: #666;
}
body:not(.dark-mode) .save-dialog-cancel:hover {
    border-color: #999;
    color: #333;
}
