:root {
  font-family: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  color: #efeee8;
  background: #0b0b0a;
  font-synthesis: none;
  --bg: #0b0b0a;
  --surface: #11110f;
  --surface-raised: #161613;
  --line: #2a2924;
  --line-soft: #1e1e1a;
  --text: #efeee8;
  --muted: #8d8b80;
  --accent: #c9ff4a;
  --accent-dim: #8fb336;
  --accent-ink: #11120c;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }
/* Keep the `hidden` attribute authoritative — several components below set an
   explicit display (flex/grid), which would otherwise override it. */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 56px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
kbd { font-family: inherit; border: 1px solid var(--line); border-bottom-color: #3a3930; padding: 1px 6px; border-radius: 4px; font-size: 11px; color: var(--muted); }

/* ===================== SHELL / SIDEBAR ===================== */
.app-shell { display: flex; min-height: 100vh; max-width: 1360px; margin: 0 auto; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand-logo { display: block; width: 188px; height: auto; }
.brand-mark { width: 22px; height: 22px; display: grid; align-content: center; gap: 3px; flex: 0 0 auto; }
.brand-mark i { display: block; height: 1px; background: var(--text); transform-origin: left center; }
.brand-mark i:nth-child(1) { width: 22px; }
.brand-mark i:nth-child(2) { width: 16px; }
.brand-mark i:nth-child(3) { width: 10px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; margin-top: 40px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 7px;
  color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 620; letter-spacing: -.01em;
  transition: background .15s ease, color .15s ease;
}
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--text); background: var(--surface-raised); }
.nav-item.active .nav-icon { color: var(--accent); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.foot-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.foot-actions-row { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.text-btn { align-self: flex-start; border: 0; border-bottom: 1px solid #555349; padding: 2px 0 4px; background: transparent; color: var(--muted); font-size: 12px; }
.text-btn:hover { color: var(--text); border-color: var(--text); }

.main-col { flex: 1 1 auto; min-width: 0; padding: 0 28px; }
.topbar { display: none; height: 66px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar-tools { display: flex; align-items: center; gap: 18px; }
.language-picker select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 24px 6px 8px; color: var(--text); background: var(--surface); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 981px) { .topbar { display: flex; } }
.brand-mobile .brand-logo { width: 150px; }
.edition { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

main { max-width: 720px; }
.view { display: none; }
.view.active { display: block; animation: view-in .32s cubic-bezier(.22,.8,.36,1) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}

/* ===================== TYPE / INTRO ===================== */
.intro { padding: 56px 0 40px; }
.intro-tight { padding: 40px 0 30px; }
.kicker, .section-index { color: var(--accent); font-size: 11px; line-height: 1; font-weight: 780; text-transform: uppercase; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 14px 0 0; font-size: clamp(38px, 7vw, 60px); line-height: .96; letter-spacing: -.05em; font-weight: 710; }
h1 span { color: #8c8a80; }
.h1-mid { font-size: clamp(32px, 5.5vw, 46px); }
h2 { margin: 8px 0 0; font-size: clamp(20px, 4vw, 25px); line-height: 1.08; letter-spacing: -.03em; font-weight: 650; }
h3 { font-size: 19px; font-weight: 660; letter-spacing: -.02em; margin: 10px 0 6px; }

/* ===================== PANEL / FORM (shared) ===================== */
.panel { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.panel-head { display:flex; flex-wrap:wrap; justify-content:space-between; gap:10px 18px; align-items:flex-start; margin-bottom:26px; }

.field-label, .metric-label { display:block; margin-bottom:9px; color:var(--muted); font-size:11px; font-weight:720; text-transform:uppercase; letter-spacing:.105em; }
.full-field { margin-bottom: 18px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px 14px; }
.text-input, .number-input, .select-input {
  width:100%;
  height: 52px;
  border:1px solid var(--line);
  color:var(--text);
  background:var(--surface);
  border-radius: 7px;
  padding:0 14px;
  outline:none;
  transition: border-color .18s ease, background .18s ease;
}
.text-input { font-size: 16px; }
.text-input:focus, .number-input:focus, .select-input:focus { border-color:#69675d; background: #141411; }
.number-input { appearance: textfield; padding-right: 52px; font-size: 17px; font-weight: 650; }
.number-input::-webkit-inner-spin-button, .number-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-with-unit { position: relative; }
.input-with-unit > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #6f6d64; font-size: 10px; font-weight: 760; letter-spacing: .08em; }
.select-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #77746a 50%), linear-gradient(135deg, #77746a 50%, transparent 50%); background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.suggestion-box { height:52px; display:flex; align-items:center; border-bottom:1px solid #5d5b51; color: var(--text); font-size:17px; font-weight:680; }

.primary-btn, .secondary-btn, .control-btn, .rating-btn { border:0; }
.primary-btn {
  width:100%;
  margin-top:26px;
  min-height:54px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 18px;
  background:var(--accent);
  color:var(--accent-ink);
  border-radius: 7px;
  font-weight:780;
  text-decoration: none;
}
.primary-btn:hover { filter: brightness(.94); }
.primary-btn span:last-child { font-size: 18px; }
.primary-btn.small { margin-top: 16px; min-height: 46px; font-size: 14px; }

.practice-card { padding-bottom: 44px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; color: #b5b2a8; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.status-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(201,255,74,.08); }
.practice-display { display:grid; grid-template-columns:1fr 1fr; gap:0; border-top:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft); margin: 6px 0 28px; }
.metric-block { padding: 26px 0; }
.metric-block + .metric-block { padding-left: 28px; border-left: 1px solid var(--line-soft); }
.big-number { display:flex; align-items:baseline; gap:8px; font-size: clamp(48px, 13vw, 76px); line-height:.92; font-weight:560; letter-spacing:-.065em; font-variant-numeric: tabular-nums; }
.unit { font-size:11px; letter-spacing:.08em; color:#77756c; font-weight:720; }
.slider-wrap { padding: 4px 0 20px; }
input[type="range"] { width:100%; height: 2px; margin:0; accent-color:var(--accent); }
.controls-row { display:grid; grid-template-columns:74px 1fr 74px; gap:8px; }
.control-btn { min-height:48px; border:1px solid var(--line); border-radius:7px; padding:0 10px; color:var(--text); background:var(--surface); font-weight:680; }
.control-btn:hover { background:var(--surface-raised); }
.control-main { border-color:#4a493f; background:#1a1a16; }
.secondary-btn { width:100%; min-height:48px; margin-top:8px; border-radius:7px; background:transparent; color:#bbb8ae; border:1px solid var(--line); font-weight:680; }
.secondary-btn:hover { border-color:#4a493f; color:var(--text); }

.result-head { align-items:flex-end; }
.muted { max-width: 200px; margin: 0; color:var(--muted); font-size:12px; line-height: 1.4; text-align:right; }
.rating-grid { display:grid; grid-template-columns:repeat(3, 1fr); border:1px solid var(--line); border-radius:7px; overflow:hidden; }
.rating-btn { min-height:126px; padding:16px; background:var(--surface); color:var(--text); text-align:left; border-right:1px solid var(--line); transition: background .15s ease; }
.rating-btn:last-child { border-right:0; }
.rating-btn:hover { background:#1a1a16; }
.rating-key { display:block; color:#66645c; font-size:10px; letter-spacing:.1em; margin-bottom:25px; }
.rating-btn strong { display:block; font-size:16px; font-weight:680; letter-spacing:-.02em; }
.rating-btn small { display:block; margin-top:5px; color:#77756c; font-size:11px; }

.storage-note {
  display: flex; align-items: baseline; gap: 8px;
  margin: -6px 0 22px; color: #77756c; font-size: 12px; line-height: 1.5;
}
.storage-note::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: #5f5d54; flex: 0 0 auto; transform: translateY(-1px);
}
.empty-state { padding:20px 0 4px; color:#747168; }
.empty-state p { margin:12px 0 0; font-size:13px; }
.empty-line { display:block; width:100%; height:1px; background:var(--line-soft); }
.progress-list { display:grid; }
.progress-item { display:grid; grid-template-columns:1fr auto auto; gap:12px; align-items:center; min-height:70px; border-top:1px solid var(--line-soft); padding:14px 0; }
.progress-item:last-child { border-bottom:1px solid var(--line-soft); }
.progress-title { font-weight:650; letter-spacing:-.015em; }
.progress-meta { color:#77756c; font-size:11px; margin-top:5px; }
.progress-bpm { font-size:22px; font-weight:600; letter-spacing:-.035em; font-variant-numeric: tabular-nums; }
.progress-bpm::after { content:" BPM"; color:#6c6a62; font-size:9px; letter-spacing:.06em; font-weight:700; }
.progress-delete {
  width:28px; height:28px; border-radius:999px; border:1px solid transparent;
  background:transparent; color:#5f5d54; font-size:16px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.progress-delete:hover { color:#ff8a7a; border-color:#3a2c27; background:#1a1310; }

footer { display:flex; gap:8px; align-items:center; border-top:1px solid var(--line); padding:22px 0 8px; color:#5f5d55; font-size:11px; text-transform:uppercase; letter-spacing:.09em; }
footer span { color:var(--accent); }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 12px); opacity: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-raised); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; font-weight: 620; letter-spacing: -.01em;
  padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--accent); flex: 0 0 auto; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 900px) { .toast { bottom: calc(78px + env(safe-area-inset-bottom)); } }

/* ===================== HOME ===================== */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.continue-panel { border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 24px; background: var(--surface); }
.week-dots { display: flex; gap: 6px; margin-top: 16px; }
.week-dots i { width: 9px; height: 9px; border-radius: 2px; background: var(--line-soft); display: block; }
.week-dots i.filled { background: var(--accent); }
.week-dots i.today { box-shadow: 0 0 0 1px var(--accent); }

.continue-panel h3 { margin: 10px 0 4px; }
.continue-meta { color: var(--muted); font-size: 13px; }

.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.quick-card {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 16px; text-decoration: none; color: var(--text);
  background: var(--surface); transition: border-color .15s ease, background .15s ease;
}
.quick-card svg { width: 20px; height: 20px; color: var(--accent); }
.quick-card span { font-size: 13.5px; font-weight: 640; letter-spacing: -.01em; }
.quick-card:hover { border-color: #4a493f; background: var(--surface-raised); }

/* ===================== METRONOME ===================== */
.metronome-card { text-align: center; }
.metro-display { padding: 6px 0 18px; }
.beat-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; }
.beat-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-soft); display: block; transition: background .06s ease, transform .06s ease; }
.beat-dots i.on { background: var(--accent); transform: scale(1.25); }
.beat-dots i.accent-on { background: var(--text); transform: scale(1.4); }
.metro-number { justify-content: center; }
.tempo-name { margin-top: 10px; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; }
.controls-row.three { grid-template-columns: 84px 1fr 84px; max-width: 420px; margin: 0 auto; }
.tap-btn { max-width: 420px; margin-left: auto; margin-right: auto; display: flex; justify-content: space-between; align-items: center; padding: 0 18px; }
.tap-hint { color: #6c6a62; font-size: 11px; }

.metro-options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin-top: 32px; text-align: left; max-width: 480px; margin-left: auto; margin-right: auto; }
.volume-group { max-width: 480px; margin: 22px auto 0; text-align: left; }
.volume-group input[type="range"] { margin-top: 10px; }
.session-volume { margin: 20px auto 4px; max-width: none; }
.segmented { display: grid; grid-auto-flow: column; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segmented button { border: 0; background: var(--surface); color: var(--muted); padding: 10px 4px; font-size: 12.5px; font-weight: 650; border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--surface-raised); color: var(--accent); }
.segmented button:hover:not(.active) { color: var(--text); }

.kbd-hint { margin-top: 22px; color: #6c6a62; font-size: 11.5px; }

/* ===================== PRACTICE / presets ===================== */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preset-chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; letter-spacing: -.005em; }
.preset-chip:hover { color: var(--text); border-color: #4a493f; }
.preset-chip.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ===================== LIBRARY (Scales + Chords) ===================== */
.lib-tabs { max-width: 320px; margin: 28px 0 0; }
.lib-tabs button { padding: 12px 4px; font-size: 13.5px; }

.chord-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.chord-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 16px 12px 14px; text-align: center; cursor: pointer;
  transition: border-color .15s ease;
}
.chord-card.selected { border-color: var(--accent); }
.chord-card h3 { font-size: 16px; margin: 0; }
.chord-card .chord-type { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; margin-top: -6px; }
.chord-svg { width: 100%; max-width: 108px; }
.chord-svg svg { display: block; width: 100%; height: auto; }
.chord-practice-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 650;
  border-bottom: 1px solid #4a493f; padding: 1px 0 3px;
}
.chord-practice-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ===================== SCALES ===================== */
.note-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.note-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 7px; min-height: 46px; font-weight: 680; font-size: 14px;
  letter-spacing: -.01em;
}
.note-btn:hover { border-color: #4a493f; background: var(--surface-raised); }
.note-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.scale-result { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.note-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 34px; padding: 0 12px;
  border-radius: 7px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 680; font-variant-numeric: tabular-nums;
}
.note-chip.root { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.formula-row .note-chip { background: transparent; color: var(--muted); border-color: var(--line-soft); font-weight: 600; font-size: 12.5px; }

.exercise-diagram { margin-top: 6px; }
.exercise-diagram .exercise-diagram-svg svg { min-width: 0; max-width: 480px; }
/* Scale/arpeggio blocks reuse the wide fretboard diagram, which needs its
   natural width back (and scrolls horizontally inside the panel). */
.exercise-diagram .exercise-diagram-svg.wide svg { min-width: 640px; max-width: none; }

/* ===================== GUIDED ROUTINES ===================== */
.guided-panel .preset-row { margin-bottom: 4px; }

.routine-list { display: grid; margin-top: 4px; }
.routine-item {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: start;
  border-top: 1px solid var(--line-soft); padding: 16px 0;
}
.routine-item:last-of-type { border-bottom: 1px solid var(--line-soft); }
.routine-num {
  font-size: 11px; font-weight: 760; letter-spacing: .06em; color: var(--accent);
  line-height: 1.6; font-variant-numeric: tabular-nums;
}
.routine-name { font-weight: 650; letter-spacing: -.015em; font-size: 15px; }
.routine-note { color: #77756c; font-size: 12px; line-height: 1.55; margin-top: 5px; max-width: 46ch; }
.routine-meta { display: flex; align-items: baseline; gap: 14px; white-space: nowrap; }
.routine-mins, .routine-bpmv {
  font-size: 19px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.routine-bpmv { color: var(--muted); font-size: 15px; }
.routine-meta small { font-size: 9px; letter-spacing: .06em; font-weight: 700; color: #6c6a62; margin-left: 3px; }

.routine-item.is-break { opacity: .62; }
.routine-item.is-break .routine-num { color: #6c6a62; }
.routine-item.is-break .routine-name { font-weight: 600; color: var(--muted); }

/* In-session routine progress */
.routine-bar { margin: 0 0 26px; }
.routine-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.routine-step {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: #6f6d64; font-size: 11.5px; font-weight: 680;
  font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.routine-step:hover { color: var(--text); border-color: #4a493f; }
.routine-step.done { color: var(--accent-dim); border-color: #33402048; }
.routine-step.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.routine-step.is-break { border-style: dashed; }
.routine-coach { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; max-width: 52ch; }

.routine-controls { display: flex; align-items: center; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.routine-controls .secondary-btn { margin: 0; flex: 1 1 auto; }

.pattern-tabs { max-width: 380px; margin-top: 4px; }
.pattern-hint { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pattern-chips { margin-top: 12px; }
.pattern-chips .note-chip { background: transparent; border-style: dashed; color: #bbb8ae; }

.fretboard-wrap { margin-top: 30px; }
.fretboard-svg { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 18px 14px; }
.fretboard-svg svg { display: block; width: 100%; min-width: 640px; height: auto; }
.fretboard-legend { display: flex; gap: 20px; margin-top: 12px; color: var(--muted); font-size: 11.5px; }
.fretboard-legend span { display: inline-flex; align-items: center; gap: 7px; }
.fretboard-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.fretboard-legend .dot-root { background: var(--accent); }
.fretboard-legend .dot-tone { background: #6f6d64; }
.fretboard-hint { display: none; }

/* ===================== PROGRESS ===================== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 34px 0 0; }
.stat-tile { border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px; background: var(--surface); }
.stat-tile span { display: block; font-size: 28px; font-weight: 640; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-tile small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }

.calendar-wrap { overflow-x: auto; padding-bottom: 4px; }
.calendar-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; width: max-content; }
.calendar-grid i { width: 11px; height: 11px; border-radius: 2px; display: block; background: var(--line-soft); }
.calendar-grid i.lvl1 { background: #3c4a22; }
.calendar-grid i.lvl2 { background: #5c7530; }
.calendar-grid i.lvl3 { background: #8fb336; }
.calendar-grid i.lvl4 { background: var(--accent); }
.calendar-legend { display: flex; align-items: center; gap: 5px; margin-top: 12px; color: #6c6a62; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; }
.calendar-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--line-soft); }
.calendar-legend .lvl1 { background: #3c4a22; }
.calendar-legend .lvl2 { background: #5c7530; }
.calendar-legend .lvl3 { background: #8fb336; }
.calendar-legend .lvl4 { background: var(--accent); }

.best-pill { display:flex; align-items:baseline; gap:8px; white-space:nowrap; }
.best-pill span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.1em; }
.best-pill strong { font-size:14px; font-weight:700; }

/* ===================== TAB BAR (mobile) ===================== */
.tab-bar { display: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
  .fretboard-hint { display: block; margin: 10px 0 0; color: #6c6a62; font-size: 11px; }
  .sidebar { display: none; }
  .app-shell { max-width: 760px; }
  .main-col { padding: 0 22px; padding-bottom: 84px; }
  .topbar { display: flex; }
  main { max-width: none; }

  .tab-bar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(11,11,10,.92); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 1px; text-decoration: none; color: var(--muted);
    font-size: 9.5px; font-weight: 650; letter-spacing: .005em; border-radius: 8px;
  }
  .tab-item svg { width: 20px; height: 20px; }
  .tab-item.active { color: var(--accent); }
}

@media (max-width: 560px) {
  .main-col { padding: 0 18px 84px; }
  .topbar { height: 60px; }
  .edition { display:none; }
  .intro { padding: 40px 0 30px; }
  .intro-tight { padding: 30px 0 24px; }
  .home-grid { grid-template-columns: 1fr; }
  .quick-row { grid-template-columns: 1fr 1fr; }
  .quick-row a:last-child { grid-column: 1 / -1; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .metro-options { grid-template-columns: 1fr; }
  .chord-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; gap:16px 10px; }
  .practice-display { grid-template-columns: 1fr 1fr; }
  .metric-block + .metric-block { padding-left:18px; }
  .big-number { font-size: clamp(42px, 14vw, 64px); }
  .controls-row { grid-template-columns:64px 1fr 64px; }
  .controls-row.three { grid-template-columns:64px 1fr 64px; }
  .rating-btn { min-height:112px; padding:13px 11px; }
  .rating-key { margin-bottom:20px; }
  .result-head { align-items:flex-start; }
  .muted { max-width:130px; }
}

@media (max-width: 390px) {
  .form-grid { grid-template-columns:1fr; }
  .practice-display { grid-template-columns:1fr; }
  .metric-block + .metric-block { padding-left:0; border-left:0; border-top:1px solid var(--line-soft); }
  .rating-grid { grid-template-columns:1fr; }
  .rating-btn { min-height:auto; border-right:0; border-bottom:1px solid var(--line); display:grid; grid-template-columns:34px 1fr auto; align-items:center; gap:8px; }
  .rating-btn:last-child { border-bottom:0; }
  .rating-key, .rating-btn strong, .rating-btn small { margin:0; }
  .rating-btn small { text-align:right; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
