*{box-sizing:border-box;font-family:system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial}
body{margin:18px;background:#fafafa;color:#111}
main{max-width:1100px;margin:0 auto}
h1{font-weight:600;margin:0}
.page-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.help-open{
  padding:6px 14px;font-size:14px;font-weight:500;border:1px solid rgba(0,0,0,0.12);
  border-radius:6px;background:#fff;cursor:pointer;color:#222;
  box-shadow:0 1px 2px rgba(0,0,0,0.04);
}
.help-open:hover{background:#f5f8ff;border-color:#bfe6ff}
.help-open:focus-visible{outline:2px solid #4da3ff;outline-offset:2px}

.help-dialog{
  max-width:min(560px,calc(100vw - 32px));width:100%;padding:0;border:none;border-radius:10px;
  box-shadow:0 12px 40px rgba(0,0,0,0.18);background:#fff;color:#111;
}
.help-dialog::backdrop{background:rgba(0,0,0,0.35)}
.help-dialog-panel{display:flex;flex-direction:column;max-height:min(85vh,calc(100dvh - 32px))}
.help-dialog-header{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 16px;border-bottom:1px solid #e8e8e8;flex-shrink:0;
}
.help-dialog-header h2{margin:0;font-size:1.1rem;font-weight:600}
.help-close{
  width:36px;height:36px;padding:0;border:1px solid rgba(0,0,0,0.1);border-radius:8px;
  background:#fafafa;font-size:22px;line-height:1;cursor:pointer;color:#444;
}
.help-close:hover{background:#f0f0f0}
.help-close:focus-visible{outline:2px solid #4da3ff;outline-offset:2px}
.help-dialog-body{
  padding:12px 16px 18px;overflow-y:auto;font-size:14px;line-height:1.5;
}
.help-section{margin-bottom:16px}
.help-section:last-child{margin-bottom:0}
.help-section h3{margin:0 0 6px;font-size:15px;font-weight:600;color:#333}
.help-section p{margin:0 0 8px;color:#444}
.help-section p:last-child{margin-bottom:0}
.help-section code{font-size:13px;background:#f0f0f0;padding:1px 5px;border-radius:4px}

.controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:10px 0}
.controls input[type=number]{width:80px}
.hint{color:#666;margin:6px 0}

.fretboard{border:1px solid #ccc;border-radius:6px;overflow:hidden;background:linear-gradient(#fff,#f7f7f7)}
.string-row{display:flex;border-top:1px solid rgba(0,0,0,0.04)}
.string-row:first-child{border-top:0}
.fret{flex:1;min-width:44px;position:relative;padding:14px 6px;border-left:1px solid rgba(0,0,0,0.06);display:flex;align-items:center;justify-content:center}
.fret:first-child{border-left:0}

/* removed nut styling (fret 0 was removed) */

.string-label{position:absolute;left:6px;top:6px;font-size:12px;color:#333;opacity:0.9}
/* circular note indicators on frets */
.note-label{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  font-size:13px;
  border-radius:50%;
  background:rgba(0,0,0,0.06);
  line-height:1;
}
/* scale highlight (lower visual priority than pinned/root) */
.note-label.in-scale{background:#4da3ff;color:#fff}
.note-label.pinned{background:#ffd74d;color:#000}
/* root highlight (chromatic selection) - stronger visual priority */
.note-label.root{background:#e55353;color:#fff;font-weight:700}

/* Fret markers removed */

/* Make grid responsive */
@media (max-width:700px){
  .fret{min-width:34px;padding:10px}
  .note-label{width:28px;height:28px;font-size:12px}
}

/* Visual difference for low strings (thicker) */
.string-6 .fret,.string-5 .fret{background:linear-gradient(#fff,#fbfbfb)}

/* Hover */
.fret:hover{background:linear-gradient(90deg, #fffef6, #fff)}

footer{margin-top:12px;color:#666}

/* Chromatic strip (C..B) */
.chromatic{margin:12px 0;padding:8px;border:1px solid #e6e6e6;border-radius:6px;background:linear-gradient(#fff,#fcfcfc)}
.chromatic .strip-title{margin:0 0 6px;font-size:14px;color:#333}
.chromatic-row{display:flex;gap:8px}
.chromatic .note-cell{flex:1;min-width:44px;padding:8px;border:1px solid rgba(0,0,0,0.06);border-radius:6px;text-align:center;background:linear-gradient(#fff,#f7f7f7);cursor:pointer;user-select:none;position:relative;z-index:10;pointer-events:auto}
.chromatic .note-cell.pinned{background:#e55353;color:#fff;font-weight:700;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.12)}
/* chromatic root styling (when used as root in scale or explicitly selected) */
.chromatic .note-cell.root{background:#e55353;color:#fff;font-weight:700;box-shadow:inset 0 -2px 0 rgba(0,0,0,0.12)}

/* Recent chords strip */
.recent-chords{margin:12px 0;padding:8px;border:1px solid #e6e6e6;border-radius:6px;background:linear-gradient(#fff,#fcfcfc)}
.chord-history{display:flex;gap:8px;flex-wrap:nowrap;overflow:auto;padding:6px 2px}
.chord-pill{flex:0 0 auto;padding:6px 10px;border-radius:16px;background:#f0f0f0;border:1px solid rgba(0,0,0,0.06);cursor:pointer;font-size:13px;position:relative}
.chord-pill:hover{background:#e6f0ff}
.chord-pill.active{background:#d6ecff;border-color:#bfe6ff}
.chord-pill .remove-btn{position:absolute;top:-9px;right:-9px;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;font-size:12px;color:#666;background:#fff;border:1px solid rgba(0,0,0,0.08);cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,0.06);z-index:5;padding:0}
.chord-pill .remove-btn:hover{background:#fff1f1;color:#b33}
/* chromatic strip scale highlight */
.chromatic .note-cell.scale{background:#d6ecff;border-color:#bfe6ff}

@media (max-width:700px){
  .chromatic .note-cell{min-width:36px;padding:6px;font-size:13px}
}
