/* ===========================================================================
   ceol web — master stylesheet

   This file is intentionally thin. The styles are split into modules under
   modules/. The @import order below replays the modules in the exact same
   sequence the rules originally appeared in this file — CSS is order-sensitive
   (cascade + specificity ties depend on source order), so this order MUST be
   preserved. Do not reorder.

   @import statements must come first in a stylesheet, so nothing else lives
   above this block.
   --------------------------------------------------------------------------- */
:root {
  --surface: #F5F4F0;
  --surface-sheet: #FAFAF8;
  --dark: #1A1A1A;
  --dark-hover: #2A2A2A;
  --dark-input: #111111;
  --fg: #1A1A1A;
  --fg-secondary: #666666;
  --fg-inverse: #F5F4F0;
  --fg-muted: #888888;
  --fg-dim: #555555;
  --accent: #8F5A3C;
  --border: #E0E0E0;
  --border-dark: #333333;
  --bar-bg: #EEEDEA;

  --font-heading: 'Newsreader', serif;
  --font-body: 'Geist', -apple-system, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Newsreader:wght@300;400;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

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

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--fg);
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 20px;
  overflow: hidden;
  position: relative;
}

.sidebar-header { display: flex; flex-direction: column; gap: 4px; }
.app-title-row { display: flex; align-items: baseline; gap: 8px; }
.app-name { font-family: var(--font-heading); font-size: 28px; font-weight: 300; color: var(--fg-inverse); letter-spacing: 1px; }
.app-version { font-family: var(--font-mono); font-size: 10px; color: var(--fg-secondary); letter-spacing: 1px; }
.app-tagline { font-family: var(--font-mono); font-size: 10px; color: var(--fg-secondary); letter-spacing: 2px; }

/* Tab bar */
.tab-bar {
  display: flex;
  background: var(--dark-input);
  border-radius: 6px;
  padding: 3px;
}
.tab {
  flex: 1;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: var(--fg-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}
.tab.active {
  background: var(--dark-hover);
  color: var(--fg-inverse);
  font-weight: 500;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  padding: 6px 12px;
  border-radius: 14px;
  border: none;
  background: var(--dark-hover);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--accent);
  color: var(--fg-inverse);
}

/* Filters row with add button */
.filters-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.filters-row .filters { flex: 1; }
.add-tune-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px dashed #555;
  background: transparent;
  color: var(--fg-muted);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-tune-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Tunes content wrapper */
.tunes-content { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }

/* Sets tab */
.sets-content { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.add-set-btn {
  width: 100%;
  padding: 10px;
  border: 1px dashed #555;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
}
.add-set-btn:hover { border-color: var(--accent); color: var(--accent); }
.set-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sets-empty { color: var(--fg-dim); font-size: 12px; text-align: center; padding: 20px 0; }

.set-card { border-radius: 4px; overflow: hidden; padding: 12px; }
.set-card.active { background: var(--dark-hover); }
.set-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  cursor: pointer;
}
.set-card-header:hover { background: var(--dark-hover); }
.set-info { display: flex; flex-direction: column; gap: 2px; }
.set-name { font-size: 13px; color: #aaa; }
.set-card.active .set-name { color: var(--fg-inverse); font-weight: 500; }
.set-meta { font-family: var(--font-mono); font-size: 10px; color: var(--fg-dim); }
.set-expand { color: var(--fg-dim); font-size: 12px; }

.set-tunes { padding: 4px 12px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.set-tune-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 4px 8px;
  font-size: 12px;
}
.set-tune-num { font-family: var(--font-mono); font-size: 10px; color: var(--fg-dim); width: 16px; }
.set-tune-name { color: #aaa; cursor: pointer; flex: 1; }
.set-tune-name:hover { color: var(--fg-inverse); }
.set-tune-remove {
  border: none; background: transparent; color: var(--fg-dim); cursor: pointer;
  font-size: 14px; opacity: 0;
}
.set-tune-row:hover .set-tune-remove { opacity: 1; }
.set-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 2px;
}
.set-add-btn {
  border: 1px dashed #555; background: transparent; color: var(--fg-muted);
  font-size: 14px; cursor: pointer; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.set-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.delete-set {
  border: none; background: transparent; color: #666; font-size: 11px;
  font-family: var(--font-body); cursor: pointer;
}
.delete-set:hover { color: #e55; }
.set-add-inline { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }

/* Set creation form */
.set-creation {
  background: #222222;
  border-radius: 6px;
  border: 1px solid var(--accent);
  padding: 10px 12px;
}
.set-name-input { display: flex; }
.set-input {
  width: 100%;
  background: var(--dark);
  border: 1px solid #444;
  border-radius: 3px;
  padding: 6px 8px;
  color: var(--fg-inverse);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
}
.set-input:focus { border-color: var(--accent); }
.set-input::placeholder { color: #555; }
.set-creation-header {
  font-size: 13px; font-weight: 500; color: var(--fg-inverse); margin-bottom: 8px;
}
.set-creation-tunes { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.set-creation-tune-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #aaa; }
.set-creation-hints {
  font-family: var(--font-mono); font-size: 9px; color: var(--fg-dim);
  text-align: center; margin-top: 8px;
}
.set-tune-picker { display: flex; flex-direction: column; gap: 4px; }

/* Typeahead */
.typeahead-dropdown {
  background: var(--dark);
  border: 1px solid #444;
  border-radius: 3px;
  margin-top: 2px;
  overflow: hidden;
}
.typeahead-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 12px;
  color: #aaa;
  cursor: pointer;
}
.typeahead-item:hover, .typeahead-item.highlighted {
  background: var(--accent);
  color: var(--fg-inverse);
}
.typeahead-name { flex: 1; }
.typeahead-item.highlighted .typeahead-name { font-weight: 500; }
.typeahead-type { font-family: var(--font-mono); font-size: 10px; opacity: 0.7; text-transform: capitalize; }

/* Wave 1 D — mobile always-expanded set cards (design 7VNKz). Replaces the
   accordion on the mobile sets list; rendered only in mobile-list-view, which is
   hidden on desktop, so no media query is needed. */
.mset-list { display: flex; flex-direction: column; gap: 10px; }
.mset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: #2A2A2A;
  cursor: pointer;
}
.mset-header { display: flex; align-items: center; justify-content: space-between; }
.mset-name { font-family: var(--font-heading); font-size: 16px; font-weight: 500; color: var(--fg-inverse); }
.mset-count { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-muted); }
.mset-tunes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mset-tune { display: flex; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: #D4D2CC; }
.mset-num { color: #D4D2CC; }
.mset-tune-name { color: #D4D2CC; }
.mset-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.mset-progress { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; }
.mset-progress.all { color: #3B6B4F; }
.mset-progress.partial { color: #8F6F3C; }
.mset-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mset-play {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
}
.mset-play:active { opacity: 0.85; }
.mset-play-icon { font-size: 11px; }
/* Section buttons wrapper */
.section-btns { display: flex; gap: 8px; }

/* Learned indicator */
.learned-indicator { color: #2A6B3A; font-size: 11px; flex-shrink: 0; }

/* Learned toggle */
.learned-toggle {
  padding: 5px 12px; border-radius: 4px; border: none;
  background: var(--dark); color: var(--fg-inverse);
  font-family: var(--font-body); font-size: 12px; font-weight: 500; cursor: pointer;
  margin-left: 8px;
}
.learned-toggle.active { background: #2A6B3A; }

/* Session tab */
.session-content { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }

/* Wave 1 B — session-ready hero card (design J8hkB). Big learned count beside a
   two-line sub-label, Start button inside the card. */
.session-hero-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  background: #2A2A2A;
}
.session-hero-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--fg-secondary); /* #666 — exact design J8hkB heroLabel shade */
}
.session-hero-num { display: flex; align-items: flex-end; gap: 8px; }
.session-hero-big {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  color: var(--fg-inverse);
}
.session-hero-sub {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--fg-muted);
}
.session-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}
.session-start-icon { flex-shrink: 0; }
.session-start:active { opacity: 0.85; }
.session-start:disabled { opacity: 0.4; cursor: default; }
.session-preview { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.session-preview-label { font-family: var(--font-mono); font-size: 9px; font-weight: 500; color: var(--fg-dim); letter-spacing: 1px; }
.session-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12px; }
.session-item-icon { color: var(--fg-dim); font-size: 12px; }
.session-set .session-item-icon { color: var(--accent); }
.session-set { background: var(--dark-hover); border-radius: 4px; padding: 8px 10px; }
.session-item-info { display: flex; flex-direction: column; gap: 2px; }
.session-item-name { color: #aaa; }
.session-set .session-item-name { color: #ccc; font-weight: 500; }
.session-item-meta { font-family: var(--font-mono); font-size: 9px; color: var(--fg-dim); }
.session-empty { color: var(--fg-dim); font-size: 12px; text-align: center; padding: 20px 0; }

/* Session active */
.session-active-header { display: flex; justify-content: space-between; align-items: center; }
.session-active-label { font-family: var(--font-mono); font-size: 9px; font-weight: 500; color: var(--accent); letter-spacing: 1px; }
.session-active-count { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--fg-inverse); }
.session-progress-bar { width: 100%; height: 4px; border-radius: 2px; background: #333; }
.session-progress-fill { height: 4px; border-radius: 2px; background: var(--accent); transition: width 0.3s; }
/* Wave 1 C — session-live now-playing card (design XwIFG): accent-bordered card
   with a labelled dot, big tune title, type/key/bpm meta, and Skip / Pause. */
.session-now-playing {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background: #2A2A2A;
  border: 1px solid var(--accent);
}
.session-now-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
}
.session-now-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.session-now-set { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-muted); margin-bottom: -8px; }
.session-now-name { font-family: var(--font-heading); font-size: 22px; font-weight: 500; color: var(--fg-inverse); }
.session-now-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--fg-muted); }
.session-now-controls { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.session-skip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #444;
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg-muted);
  cursor: pointer;
}
.session-skip:hover { border-color: var(--fg-muted); color: var(--fg-inverse); }
.session-skip-icon { flex-shrink: 0; }
.session-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.session-pause:active { opacity: 0.85; }
.session-next { padding: 12px 16px; border-radius: 8px; border: 1px solid #333; display: flex; flex-direction: column; gap: 4px; }
.session-next-label { font-family: var(--font-mono); font-size: 9px; color: var(--fg-dim); letter-spacing: 2px; }
.session-next-name { font-family: var(--font-heading); font-size: 15px; color: #D4D2CC; }
.session-next-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-secondary); }
.session-history { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.session-history-label { font-family: var(--font-mono); font-size: 9px; color: #444; letter-spacing: 1px; }
.session-history-item { display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-size: 11px; color: var(--fg-dim); }
.session-history-check { color: var(--fg-dim); }
.session-end {
  width: 100%; padding: 10px; border: 1px solid #555; border-radius: 4px;
  background: transparent; color: var(--fg-muted);
  font-family: var(--font-body); font-size: 12px; cursor: pointer;
}
.session-end:hover { border-color: #888; color: var(--fg-inverse); }
.tab.session-live { background: var(--accent); }

/* Item #5 — session-complete summary (design LQ3CL). Centred check / heading /
   stat line / Practice-again + Done. Renders in the session tab on :done. */
.session-complete {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 24px;
}
.session-complete-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(143, 90, 60, 0.16); /* accent @ 16% */
  color: var(--accent);
}
.session-complete-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 500;
  color: var(--fg-inverse);
}
.session-complete-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fg-muted);
}
.session-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
}
.session-complete-again {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}
.session-complete-again:active { opacity: 0.85; }
.session-complete-done {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--dark-hover);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
}
.session-complete-done:active { background: #333; }
/* Tune list */
.tune-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tune-row-wrap { position: relative; }
.tune-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 4px;
  gap: 10px;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-family: var(--font-heading);
}
.tune-row:hover { background: var(--dark-hover); }
.tune-row:hover .tune-row-menu-btn { opacity: 1; }
.tune-row.active { background: var(--dark-hover); border-left-color: var(--accent); }
.tune-row.learned { border-left-color: #3B6B4F; }
.tune-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tune-name {
  font-family: var(--font-heading);
  font-size: 14px;
  color: #D4D2CC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tune-row.active .tune-name { color: var(--fg-inverse); font-weight: 500; }
.tune-row.learned .tune-name { color: #A8A8A8; }
.tune-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-secondary); text-transform: capitalize; }
.tune-row.active .tune-meta { color: var(--fg-muted); }
.tune-row-menu-btn {
  border: none;
  background: transparent;
  color: var(--fg-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  padding: 4px 6px;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}
.tune-row-menu-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.tune-row.active .tune-row-menu-btn { opacity: 0.7; }

.tune-context-menu {
  position: absolute;
  right: 8px;
  top: 100%;
  margin-top: 4px;
  z-index: 20;
  min-width: 180px;
  padding: 4px;
  background: var(--dark-hover);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #EEEEEE;
  font-family: var(--font-heading);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.cm-item:hover { background: rgba(255,255,255,0.06); }
.cm-icon { width: 14px; display: inline-flex; justify-content: center; color: #AAAAAA; }
.cm-item-danger { color: #D9534F; }
.cm-item-danger .cm-icon { color: #D9534F; }
.cm-divider { height: 1px; background: #3A3A3A; margin: 0 4px; }

/* Main area */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}

.tune-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
}
.title-block { display: flex; flex-direction: column; gap: 2px; }
.tune-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.tune-title:hover { border-bottom-color: var(--border); }
.tune-title.edit-mode { border-bottom-color: var(--border); }
.inline-edit-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  border: none;
  border-bottom: 2px solid var(--accent);
  background: transparent;
  outline: none;
  padding: 0;
  width: 100%;
  color: var(--fg);
}
.meta-field.clickable {
  cursor: pointer;
  text-transform: capitalize;
  border-bottom: 1px solid transparent;
}
.meta-field.clickable:hover { border-bottom-color: var(--fg-secondary); }
.tune-title-meta.edit-mode .meta-field.clickable { border-bottom-color: var(--fg-secondary); }
.meta-sep { cursor: default; }
.delete-tune {
  border: none;
  background: transparent;
  color: #999;
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  margin-left: 8px;
}
.delete-tune:hover { color: #e55; }
.tune-title-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-secondary); letter-spacing: 0.5px; text-transform: capitalize; }

.section-controls { display: flex; gap: 8px; }
.section-btn {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-secondary);
  cursor: pointer;
}
.section-btn.active {
  background: var(--accent);
  color: var(--fg-inverse);
  border-color: var(--accent);
  font-weight: 600;
}

.divider { height: 1px; background: var(--border); }

/* Sheet music */
.sheet-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 40px;
  background: var(--surface-sheet);
}
.sheet-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--fg-secondary);
  font-size: 14px;
}

/* abcjs overrides */
#sheet-music { max-width: 990px; margin: 0 auto; }
#sheet-music svg { max-width: 100%; height: auto; }

/* Edit toggle button */
.edit-toggle {
  padding: 5px 12px;
  border-radius: 4px;
  border: none;
  background: var(--dark);
  color: var(--fg-inverse);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
}
.edit-toggle.active {
  background: var(--accent);
}

/* Settings view (main-view = :settings) */
.settings-view { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.settings-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 32px; gap: 16px;
}
.settings-title { font-family: var(--font-heading); font-size: 24px; font-weight: 500; }
.settings-back {
  background: transparent; border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-secondary); cursor: pointer;
}
.settings-back:hover { border-color: var(--fg-secondary); color: var(--fg); }
.settings-body { padding: 0 32px 32px; display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.settings-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.settings-card-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 2px; color: var(--fg-secondary);
  margin-bottom: 4px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 16px;
  border-top: 1px solid var(--border);
}
.settings-row:first-of-type { border-top: none; }
.settings-row-text { font-family: var(--font-heading); font-size: 14px; }
.settings-row-value { font-family: var(--font-mono); font-size: 12px; color: var(--fg-secondary); }
.settings-row-link {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); text-decoration: none;
}
.settings-row-link:hover { text-decoration: underline; }
.settings-action {
  background: var(--accent); color: #fff;
  border: none; padding: 8px 16px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer;
}
.settings-action-danger { background: transparent; color: #D9534F; border: 1px solid #D9534F; }
.settings-action-danger:hover { background: #D9534F; color: #fff; }

/* Wave 1 E — Export/Import as icon + text + chevron list rows (design ddeLd).
   The card supplies horizontal padding, so rows use vertical padding only.
   Greys (--fg-muted/--fg-secondary) read on both the light desktop card and the
   dark mobile card; the title flips to --fg-inverse on mobile (see mobile.css). */
.settings-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
/* Grey alpha reads on both the light desktop card and the dark mobile card. */
.settings-list-row:hover { background: rgba(127, 127, 127, 0.08); }
.settings-list-row:active { background: rgba(127, 127, 127, 0.14); }
.settings-list-icon { display: flex; color: var(--fg-muted); flex-shrink: 0; }
.settings-list-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.settings-list-title { font-family: var(--font-heading); font-size: 15px; color: var(--fg); }
.settings-list-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-muted); }
.settings-list-chevron { color: var(--fg-secondary); font-size: 18px; line-height: 1; flex-shrink: 0; }
.settings-list-divider { height: 1px; background: var(--border); }

.new-tune-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid #3A3A3A;
  border-radius: 4px;
  padding: 10px 0;
  font-family: var(--font-heading);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}
.new-tune-btn:hover { border-color: var(--fg-muted); color: var(--fg-inverse); }
.new-tune-icon { font-size: 14px; }

.sidebar-settings-btn {
  display: flex !important; align-items: center; justify-content: center; gap: 6px;
}
.sidebar-settings-btn.active { background: var(--dark-hover); color: var(--fg-inverse); }
.settings-gear { font-size: 14px; }

/* Set detail (main-view = :set) */
.set-detail { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.set-detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 32px;
  gap: 16px;
  background: var(--surface-sheet);
}
.set-detail-title { font-family: var(--font-heading); font-size: 24px; font-weight: 500; }
.set-detail-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-secondary);
  letter-spacing: 1px; margin-top: 4px;
}
.set-detail-actions { display: flex; align-items: center; gap: 8px; }
.set-detail-play {
  background: var(--accent); color: #fff;
  border: none; padding: 10px 18px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
}
.set-detail-more {
  background: transparent; border: 1px solid var(--border);
  width: 36px; height: 36px; border-radius: 4px;
  font-size: 16px; cursor: pointer; color: var(--fg-secondary);
}
.set-detail-list-label {
  padding: 16px 32px 8px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 2px; color: var(--fg-secondary);
}
.set-detail-list { padding: 0 32px 32px; display: flex; flex-direction: column; gap: 4px; }
.set-detail-tune-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.set-detail-grip { color: var(--fg-secondary); cursor: grab; font-size: 14px; }
.set-detail-num {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--fg-secondary);
  width: 18px; text-align: center;
}
.set-detail-tune-info { flex: 1; cursor: pointer; }
.set-detail-tune-name { font-family: var(--font-heading); font-size: 16px; font-weight: 500; }
.set-detail-tune-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-secondary);
  text-transform: capitalize; margin-top: 2px;
}
.set-detail-check { color: #3B6B4F; font-size: 14px; }
.set-detail-remove {
  background: transparent; border: none; cursor: pointer;
  color: var(--fg-secondary); font-size: 18px;
  width: 28px; height: 28px; border-radius: 4px;
}
.set-detail-remove:hover { background: rgba(0,0,0,0.05); color: #D9534F; }

/* EDITING TUNE strip (shows above tune-header when editor open) */
.editing-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 32px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
}
.editing-strip-icon { font-size: 13px; }
.editing-strip-spacer { flex: 1; }
/* Desktop already shows "✓ Done" on the tune-header edit-toggle; only
   mobile (where .tune-header is hidden, see mobile.css) needs this button
   as its close affordance. */
@media (min-width: 721px) { .editing-strip-done { display: none; } }
.editing-strip-help {
  font-weight: 400;
  letter-spacing: 1px;
  opacity: 0.85;
  font-size: 10px;
}

/* Editor split */
.editor-split {
  display: flex;
  flex-direction: column;
  height: 180px;
  min-height: 120px;
  flex-shrink: 0;
}
.split-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 32px;
}
.split-line { flex: 1; height: 1px; background: transparent; }
.split-grip { color: #ccc; font-size: 14px; cursor: row-resize; user-select: none; }

/* Editor panel */
.editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1E1E1E;
  padding: 16px 32px;
  gap: 8px;
  min-height: 0;
}
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.editor-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 1px;
}
.editor-hints {
  display: flex;
  gap: 12px;
}
.editor-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
}
.editor-hint.accent { color: var(--accent); }
.editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: #D4D4D4;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 8px 0;
  min-height: 0;
}
.editor-textarea::placeholder { color: #444; }

/* Playback bar */
.playback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bar-bg);
}
.left-controls, .center-controls, .right-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.play-btn {
  padding: 10px 20px;
  border-radius: 4px;
  border: none;
  background: var(--accent);
  color: var(--fg-inverse);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.play-btn.playing {
  background: var(--dark);
}
.playback-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-left: 4px;
}
.control-btn.active {
  background: var(--accent);
  color: var(--fg-inverse);
  border-color: var(--accent);
}
.control-btn, .tempo-btn {
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: transparent;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-secondary);
  cursor: pointer;
}
.tempo-label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; cursor: default; }
.tempo-label.tempo-modified { color: var(--accent); }
.guitar-btn {
  padding: 8px 14px;
  border-radius: 4px;
  border: none;
  background: var(--dark);
  color: var(--fg-inverse);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.guitar-btn.active {
  background: var(--accent);
}

/* Scrollbar styling for tune list */
.tune-list::-webkit-scrollbar { width: 4px; }
.tune-list::-webkit-scrollbar-track { background: transparent; }
.tune-list::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 2px; }

/* Sidebar footer (backup/restore) */
.sidebar-footer {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-dark);
}
.sidebar-footer-btn {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
}
.sidebar-footer-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Backup status banner — floats above sidebar footer */
.backup-status {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-body);
  animation: backup-status-fade 3s ease forwards;
  z-index: 10;
}
.backup-status.kind-success { background: #1F3A2A; border: 1px solid #3B6B4F; color: #C7E6D2; }
.backup-status.kind-error   { background: #3A1F22; border: 1px solid #7A3A40; color: #F0C8CD; }
.backup-status-icon { font-weight: 500; }
.backup-status.kind-success .backup-status-icon { color: #7FCFA0; }
.backup-status.kind-error   .backup-status-icon { color: #E89099; }
@keyframes backup-status-fade {
  0%   { opacity: 0; transform: translateY(4px); }
  10%  { opacity: 1; transform: translateY(0); }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

/* B3 — mobile backup-status toast. The desktop banner lives in the sidebar,
   which is display:none on mobile, so mobile got no export/import feedback.
   Render the same banner in a fixed bottom toast on mobile only (hidden on
   desktop to avoid doubling with the sidebar copy). */
.mobile-backup-status { display: none; }
@media (max-width: 720px) {
  .mobile-backup-status {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    /* clear the 56px FAB (bottom:24px) so the toast doesn't sit on top of it */
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
    z-index: 85; /* transient toast — above tune-editor (80) so feedback always shows */
  }
  .mobile-backup-status .backup-status {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
  }
}

/* Notes drawer — desktop. Element always in the DOM when a tune is selected;
   .open class toggles its visibility. (Mobile overrides below use position
   fixed + transform transitions.) */
.notes-panel {
  display: none;
  flex-direction: column;
  background: var(--surface-sheet);
  border-top: 1px solid var(--border);
  padding: 12px 32px 14px;
  gap: 10px;
  height: 248px; /* room for the title block + footer (Wave 1 A) */
  flex-shrink: 0;
}
.notes-panel.open { display: flex; }
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notes-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-secondary);
  letter-spacing: 2px;
  font-weight: 500;
}
.notes-close {
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-size: 18px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  line-height: 1;
}
.notes-close:hover { background: var(--border); color: var(--fg); }
.notes-textarea {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #E5E4E0;
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
  resize: none;
  outline: none;
}
.notes-textarea:focus { border-color: var(--accent); }
.notes-textarea::placeholder { color: var(--fg-dim); }

/* Wave 1 A — notes title block + footer (design vWmaK) */
.notes-title-block { display: flex; flex-direction: column; gap: 2px; }
.notes-tune-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
}
.notes-tune-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--fg-secondary);
}
.notes-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notes-saved {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--fg-secondary);
}
.notes-saved::before { content: "✓ "; }
.notes-count {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--fg-muted);
}
/* ===========================================================================
   Mobile tune-details editor — full-screen overlay reached from the FAB
   ("New tune") or the (forthcoming) action sheet's "Edit details" row.
   Design source: design.pen frames FvkOu (new) + kMKsH (edit).
   --------------------------------------------------------------------------- */

.te-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #1A1A1A;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.15s;
}

/* Hide on desktop — desktop uses inline tune-header click-to-cycle fields. */
@media (min-width: 721px) {
  .te-overlay { display: none !important; }
}

/* Top bar — Cancel · title · Save pill */
.te-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px 16px;
}
.te-cancel {
  background: transparent;
  border: none;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: #888;
  cursor: pointer;
}
.te-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  color: #F5F4F0;
}
.te-save {
  background: var(--accent);
  border: none;
  border-radius: 14px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  cursor: pointer;
}
.te-save:active { opacity: 0.85; }

/* Body — scrollable column of labelled sections */
.te-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 20px calc(env(safe-area-inset-bottom, 0px) + 24px) 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.te-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* allows truncation in flex row */
}

/* Two sections side by side (KEY + MODE) */
.te-row {
  display: flex;
  gap: 12px;
}
.te-row > .te-section { flex: 1; }

.te-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: #666;
}

.te-input {
  background: #2A2A2A;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: #F5F4F0;
  width: 100%;
  outline: none;
}
.te-input::placeholder { color: #555; font-weight: 400; }
.te-input:focus { outline: 1px solid var(--accent); }

/* Chip rows (type, time-sig) — horizontal scroll if overflow */
.te-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.te-chip-row::-webkit-scrollbar { display: none; }

.te-chip {
  flex: 0 0 auto;
  background: #2A2A2A;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: #AAAAAA;
  cursor: pointer;
  white-space: nowrap;
  text-transform: capitalize;
}
.te-chip:active { background: #333; }
.te-chip.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Native select dressed to match design — chevron drawn separately */
.te-select-wrap {
  position: relative;
  background: #2A2A2A;
  border-radius: 8px;
}
.te-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 14px 36px 14px 14px;
  width: 100%;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: #F5F4F0;
  outline: none;
  cursor: pointer;
}
.te-select:focus { outline: 1px solid var(--accent); border-radius: 8px; }
.te-select-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: #888;
  font-size: 16px;
  pointer-events: none;
}
.te-select option {
  background: #2A2A2A;
  color: #F5F4F0;
}
/* ===========================================================================
   Mobile bottom action sheet — shared shell for the tune sheet (⋮ on a tune
   row, replaces the swipe-peek per G8) and the set sheet (⋮ on the set
   detail). One renderer: views/mobile-bottom-sheet.
   Design source: design.pen frames qgF2n (tune) + kihYP (set).
   --------------------------------------------------------------------------- */

.as-overlay {
  position: fixed;
  inset: 0;
  z-index: 75; /* below tune-editor (80), above coachmark (60) */
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  animation: fade-in 0.15s;
}

@media (min-width: 721px) {
  .as-overlay { display: none !important; }
}

.as-sheet {
  width: 100%;
  background: #1F1F1F;
  border-radius: 20px 20px 0 0;
  padding: 12px 0 0 0;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.2s;
  /* leaves room for the home indicator on iPhones with safe-area */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.as-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
}
.as-handle-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #444;
}

.as-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px 16px 20px;
  min-width: 0;
}
.as-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: #F5F4F0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: #888;
  text-transform: capitalize;
}

.as-divider {
  height: 1px;
  background: #2A2A2A;
}

.as-actions {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
}

.as-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  font-family: var(--font-heading);
  font-size: 16px;
  color: #EEEEEE;
  text-align: left;
  cursor: pointer;
}
.as-row:active { background: #2A2A2A; }
.as-row-icon {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  color: #AAAAAA;
  font-size: 14px;
}
.as-row-danger { color: #D9534F; }
.as-row-danger .as-row-icon { color: #D9534F; }

.as-cancel-wrap {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 16px 12px;
}
.as-cancel {
  background: #2A2A2A;
  border: none;
  border-radius: 10px;
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #F5F4F0;
  cursor: pointer;
}
.as-cancel:active { background: #333; }

/* ---------------------------------------------------------------------------
   Mobile shell (≤720px)
   - Hide persistent sidebar
   - Show top app bar (back/hamburger + title)
   - Bottom-sheet drawer holds tabs + settings
   --------------------------------------------------------------------------- */
:root { --mobile-bp: 720px; }

.mobile-top-bar { display: none; }

@media (max-width: 720px) {
  .sidebar { display: none; }
  .app-layout { flex-direction: column; }
  .main-area { width: 100%; }

  .mobile-top-bar {
    display: flex; align-items: center; gap: 12px;
    height: 52px; padding: 0 16px;
    background: var(--dark); color: var(--fg-inverse);
    position: sticky; top: 0; z-index: 30;
    flex-shrink: 0;
  }
  .mobile-back {
    background: transparent; border: none; color: var(--fg-inverse);
    font-size: 22px; line-height: 1; cursor: pointer;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  }
  .mobile-title {
    flex: 1; font-family: var(--font-heading); font-size: 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-title-block { flex: 1; min-width: 0; }
  .mobile-title-block .mobile-title { font-size: 18px; line-height: 1.1; }
  .mobile-title-meta {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px;
    color: var(--fg-muted); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-top-bar.with-detail {
    height: 56px; padding: 6px 12px;
    background: var(--surface-sheet); color: var(--fg);
  }
  .mobile-top-bar.with-detail .mobile-back { color: var(--fg); }
  .mobile-top-bar.with-detail .mobile-title { color: var(--fg); }
  .mobile-top-bar.with-detail .mobile-title-meta { color: var(--fg-muted); }
  .mobile-top-bar.with-detail .mobile-top-section-btns { background: #FFFFFF; }
  .mobile-top-section-btns {
    display: flex; align-items: center; gap: 4px;
    background: #2a2a2a; border-radius: 6px; padding: 3px;
  }
  .mts-btn {
    background: transparent; border: none;
    color: var(--fg-muted);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
    padding: 4px 8px; border-radius: 4px;
    cursor: pointer; min-width: 28px;
  }
  .mts-btn.active { background: var(--accent); color: #fff; }
  .mobile-top-bar-spacer { width: 32px; }

  /* Shared bottom-sheet handle (action-sheet, controls-sheet) */
  .mobile-drawer-handle {
    width: 40px; height: 4px; background: #444; border-radius: 2px;
    margin: 0 auto 12px;
  }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Hide mobile top bar on desktop */
@media (min-width: 721px) { .mobile-top-bar { display: none !important; } }

/* Modal (delete confirm etc.) */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in 0.15s;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  max-width: 360px; width: 100%;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-title { font-family: var(--font-heading); font-size: 18px; }
.modal-body { font-family: var(--font-heading); font-size: 14px; color: var(--fg-secondary); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-cancel, .modal-destructive {
  padding: 10px 16px; border-radius: 4px;
  font-family: var(--font-heading); font-size: 13px;
  cursor: pointer; border: 1px solid var(--border); background: transparent;
}
.modal-destructive { background: #D9534F; color: #fff; border-color: #D9534F; }

/* Active swipe state (no transition during drag). The 60px swipe-peek was
   removed (G8) — per-tune actions live in the bottom action sheet now. */
.tune-row.swiping { transition: none !important; }

/* Right-swipe-to-learn hint (desktop hides it; mobile shows it behind row) */
.tune-row-learn-hint { display: none; }

/* Inline tune-context-menu only used on desktop (hover-style). On touch the
   swipe-left peek provides Edit / Delete; tune actions live in controls sheet. */
@media (max-width: 720px) {
  .tune-context-menu { display: none !important; }
}

/* tune-main wraps the header + sheet + (desktop) playback bar; it must fill
   .main-area so .sheet-area's flex:1 has a height to grow into. */
.tune-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Mobile detail view (≤720px) */
.mobile-playback-bar { display: none; }
.controls-sheet-backdrop { display: none; }

@media (max-width: 720px) {
  /* match the fixed playback bar exactly (60px) so no background strip leaks */
  .tune-main { padding-bottom: 60px; background: var(--bar-bg); }
  /* Tune title + meta + section controls all live in mobile-top-bar now.
     The desktop .tune-header is fully hidden on mobile detail view. */
  .tune-header { display: none; }
  /* Hide redundant abc.js-rendered title/composer above the staff */
  .abcjs-title, .abcjs-rhythm, .abcjs-tempo, .abcjs-author, .abcjs-origin { display: none; }
  /* Hide tune-row right ⋮ on mobile (swipe gesture provides actions) */
  .tune-row-menu-btn { display: none; }
  /* Tell the browser horizontal gestures on rows are app-handled, so the
     iOS back-gesture doesn't intercept right swipes. */
  .tune-row-wrap, .tune-row { touch-action: pan-y; }
  /* Mobile tune list runs roomier than the desktop sidebar list — the
     mobile design (ZV3rw) wants taller rows + larger title. Base .tune-row
     / .tune-name keep the desktop design values. */
  .mobile-tune-list .tune-row { padding: 14px 12px; border-radius: 6px; }
  .mobile-tune-list .tune-name { font-size: 16px; }
  /* Learn hint only renders while the wrap is in a right-swipe gesture.
     The gesture module sets .swipe-right on the wrap during touchmove. */
  .tune-row-wrap.swipe-right .tune-row-learn-hint {
    display: flex; align-items: center; gap: 10px;
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 140px; padding: 0 18px;
    background: rgba(59,107,79,0.18);
    color: #3B6B4F;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    pointer-events: none;
  }
  .tune-row-learn-check {
    width: 22px; height: 22px; border-radius: 11px;
    background: rgba(59,107,79,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
  }
  .sheet-area { padding: 16px; }
  .editing-strip { padding: 8px 16px; font-size: 10px; }
  .editing-strip-help { display: none; }
  .editing-strip-done {
    margin-left: auto;
    background: var(--accent); color: #fff; border: none;
    padding: 6px 14px; border-radius: 4px;
    font-family: var(--font-heading); font-size: 12px; cursor: pointer;
  }
  /* ABC editor — full bleed, no cramped hints */
  .editor-split { height: 200px; }
  .split-divider { padding: 0 16px; }
  .editor-panel { padding: 12px 16px; }
  .editor-hints { display: none; }
  .editor-textarea { font-size: 12px; line-height: 1.5; }

  /* Desktop bar off, mobile slim bar on */
  .playback-bar { display: none !important; }
  .mobile-playback-bar {
    display: flex; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: 60px; padding: 0 16px;
    background: var(--bar-bg); border-top: 1px solid var(--border);
  }
  /* equal-flex left + right groups → play button is geometrically centred */
  .mpb-tempo {
    flex: 1; display: flex; align-items: center; justify-content: flex-start; gap: 4px;
  }
  .mpb-tempo-btn {
    width: 26px; height: 26px; border-radius: 13px;
    border: 1px solid #d0d0d0; background: transparent;
    font-size: 13px; line-height: 1; color: var(--fg-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .mpb-bpm { font-family: var(--font-mono); font-size: 12px; font-weight: 500; min-width: 50px; text-align: center; }
  .mpb-bpm.modified { color: var(--accent); }
  .mpb-bpm-unit { font-size: 9px; color: var(--fg-secondary); margin-left: 3px; letter-spacing: 1px; }
  .mpb-play {
    width: 48px; height: 48px; border-radius: 24px; flex-shrink: 0;
    border: none; background: var(--accent); color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .mpb-play.playing { background: var(--dark); }
  /* ▶ glyph has more whitespace on the right side; nudge to optical-centre */
  .mpb-play-icon { font-size: 16px; line-height: 1; transform: translateX(1px); }
  .mpb-play.playing .mpb-play-icon { transform: none; }
  .mpb-actions {
    flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  }
  .mpb-icon {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid #d0d0d0; background: transparent;
    color: var(--fg-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  .mpb-icon:focus { outline: none; }
  .mpb-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .mpb-icon.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* "NOW PLAYING" controls bottom sheet. Always in the DOM; .open toggles
     fade-in of backdrop + slide-up of inner sheet. Reverse on dismiss. */
  .controls-sheet-backdrop {
    display: flex; align-items: flex-end;
    position: fixed; inset: 0; z-index: 55;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease-out;
  }
  .controls-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
  .controls-sheet {
    width: 100%; max-height: 88vh; overflow-y: auto;
    background: #0A0A0A; color: var(--fg-inverse);
    border-radius: 20px 20px 0 0;
    padding: 8px 16px 24px;
    display: flex; flex-direction: column; gap: 14px;
    transform: translateY(100%);
    transition: transform 0.22s ease-out;
  }
  .controls-sheet-backdrop.open .controls-sheet { transform: translateY(0); }
  .controls-sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .controls-sheet-label {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--fg-muted);
  }
  .controls-sheet-close {
    background: transparent; border: none; color: var(--fg-muted);
    font-size: 22px; line-height: 1; cursor: pointer;
  }
  .controls-sheet-title-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  }
  .controls-sheet-title-block { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
  .controls-sheet-title { font-family: var(--font-heading); font-size: 26px; font-weight: 500; }
  .controls-sheet-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); }
  .cs-learned-icon {
    background: transparent; border: none; color: var(--fg-muted);
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
  }
  .cs-learned-icon.active { color: var(--accent); background: rgba(143,90,60,0.12); }
  .controls-sheet-parts { display: flex; gap: 6px; }
  .cs-part {
    flex: 1; padding: 12px 0; border-radius: 6px;
    border: 1px solid #333; background: #1F1F1F; color: var(--fg-muted);
    font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 1px; cursor: pointer;
  }
  .cs-part.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .controls-sheet-tempo {
    background: #1F1F1F; border-radius: 10px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
  }
  .cs-tempo-label {
    align-self: flex-start;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-muted);
  }
  .cs-tempo-row { display: flex; align-items: center; gap: 24px; }
  .cs-tempo-btn {
    width: 40px; height: 40px; border-radius: 20px;
    border: 1px solid #444; background: var(--dark); color: var(--fg-inverse);
    font-size: 18px; line-height: 1; cursor: pointer;
  }
  .cs-tempo-val { font-family: var(--font-heading); font-size: 42px; font-weight: 500; line-height: 1; }
  .cs-tempo-unit { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); margin-left: 6px; letter-spacing: 1px; }
  .cs-tempo-reset {
    background: transparent; border: none; color: var(--fg-dim);
    font-family: var(--font-mono); font-size: 11px; cursor: pointer;
  }
  .cs-tempo-reset.hidden { visibility: hidden; }
  .controls-sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cs-toggle {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 0; border-radius: 12px;
    border: 1px solid #2A2A2A; background: #1F1F1F; color: var(--fg-muted);
    font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 1px; cursor: pointer;
  }
  .cs-toggle.active {
    border-color: var(--accent); color: var(--accent);
    background: rgba(143,90,60,0.12);
  }
  .cs-toggle.active .cs-toggle-icon { color: var(--accent); }
  .cs-toggle-icon { font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }

  .controls-sheet-play {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 18px; border-radius: 12px; border: none;
    background: var(--accent); color: #fff;
    font-family: var(--font-mono); font-size: 14px; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  }
  .controls-sheet-play.playing { background: var(--dark-hover); }
  .cs-play-icon { font-size: 14px; }

  /* Notes panel slides up FROM BEHIND the fixed mobile-playback-bar (z 30).
     Always in the DOM when a tune is selected; .open class drives the
     transition in both directions. padding-bottom = 60 (bar) + 12 (buffer).
     Force display:flex (overrides desktop's display:none default). */
  .notes-panel {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    max-height: calc(50vh + 72px);
    padding-bottom: 72px;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.22s ease-out;
    pointer-events: none;
  }
  .notes-panel.open { transform: translateY(0); pointer-events: auto; }
}

/* Onboarding coachmark (shown once, mobile only) */
.coachmark-overlay { display: none; }

@media (max-width: 720px) {
  .coachmark-overlay {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 80;
    background: #1a1a1a;
    animation: fade-in 0.2s;
  }
  .coachmark-app-header {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px 20px 16px;
  }
  .coachmark-logo {
    font-family: var(--font-heading); font-size: 32px; font-weight: 300;
    color: #f5f4f0; letter-spacing: 1px;
  }
  .coachmark-tagline {
    font-family: var(--font-mono); font-size: 10px; font-weight: normal;
    color: #666; letter-spacing: 2px; text-transform: uppercase;
  }
  .coachmark-hint-area {
    flex: 1; display: flex; align-items: center; justify-content: center;
  }
  .coachmark-peek-row {
    display: flex; align-items: center;
    width: 100%; height: 64px;
  }
  .coachmark-learned-action {
    display: flex; align-items: center; gap: 8px;
    width: 180px; height: 64px;
    padding-left: 16px;
    background: rgba(59,107,79,0.2);
    border-radius: 6px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    color: #3b6b4f; letter-spacing: 1px;
  }
  .coachmark-learned-icon { font-size: 14px; }
  .coachmark-tune-cell {
    flex: 1; display: flex; flex-direction: column; gap: 3px;
    padding: 0 12px;
    background: #2a2a2a; border-radius: 6px;
    height: 64px; justify-content: center;
    margin-left: 2px;
  }
  .coachmark-tune-name {
    font-family: var(--font-heading); font-size: 16px; color: #f5f4f0;
  }
  .coachmark-tune-meta {
    font-family: var(--font-mono); font-size: 10px; color: #888; letter-spacing: 1px;
  }
  .coachmark-cap1 {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    color: #888; letter-spacing: 2px; text-transform: uppercase;
    text-align: center; padding: 16px 20px 4px;
  }
  .coachmark-cap2 {
    font-family: var(--font-mono); font-size: 10px; color: #555; letter-spacing: 1px;
    text-align: center; padding: 0 20px 24px;
  }
  .coachmark-ok {
    margin: 0 20px 32px;
    padding: 14px;
    background: var(--accent); color: #fff;
    border: none; border-radius: 8px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    letter-spacing: 1px; cursor: pointer;
  }
}

/* Mobile landscape — wider sheet, thinner playback bar */
@media (max-width: 720px) and (orientation: landscape) {
  .mobile-top-bar { height: 44px; }
  .tune-main { padding-bottom: 60px; }
  .mobile-playback-bar { height: 48px; }
  .mpb-play { width: 38px; height: 38px; }
  .mpb-icon { width: 32px; height: 32px; }
  .sheet-area { padding: 8px 24px; }
  .editing-strip { display: none; }
}

/* Mobile session + settings layouts */
@media (max-width: 720px) {
  .session-content {
    padding: 16px;
    display: flex; flex-direction: column; gap: 16px;
  }
  .session-preview-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--fg-muted); padding: 8px 0; }
  .session-item, .session-set {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--dark-hover); border-radius: 8px;
    margin-bottom: 4px;
  }
  .session-end {
    width: 100%; padding: 14px; margin-top: auto;
    background: transparent; color: var(--fg-inverse);
    border: 1px solid #444; border-radius: 8px;
    font-family: var(--font-heading); font-size: 14px;
  }

  /* Settings on mobile */
  .settings-header { padding: 16px; }
  .settings-title { font-size: 22px; }
  .settings-body { padding: 0 16px 32px; max-width: 100%; }
  .settings-card { padding: 12px 14px; }
  .settings-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 0; }
  .settings-action { width: 100%; padding: 12px; }
  .settings-back { display: none; } /* top bar back covers this */
}

/* Mobile sets tab styling */
@media (max-width: 720px) {
  .sets-content { padding: 0 16px; }
  .add-set-btn {
    width: 100%; padding: 14px 12px; margin: 8px 0;
    background: transparent; color: var(--fg-muted);
    border: 1px solid #3A3A3A; border-radius: 6px;
    font-family: var(--font-mono); font-size: 11px; font-weight: normal;
    letter-spacing: 1px;
  }
  .set-card { background: var(--dark-hover); border-radius: 8px; padding: 14px; margin-bottom: 8px; }
  .set-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .set-name { font-family: var(--font-heading); font-size: 16px; font-weight: 500; color: var(--fg-inverse); }
  .set-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); }
  .set-input {
    width: 100%; padding: 12px;
    background: var(--dark); color: var(--fg-inverse);
    border: 1px solid #333; border-radius: 6px;
    font-family: var(--font-heading); font-size: 14px;
  }
  .set-creation { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }
  .set-creation-tunes { display: flex; flex-direction: column; gap: 4px; }
  .set-creation-tune-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--dark-hover); border-radius: 6px;
  }
  .set-creation-tune-row .set-tune-num {
    color: var(--fg-muted); font-family: var(--font-mono); font-size: 12px;
    width: 18px;
  }
  .set-creation-tune-row .set-tune-remove {
    margin-left: auto; background: transparent; border: none;
    color: var(--fg-muted); font-size: 18px; cursor: pointer;
  }
  .set-creation-hints { font-family: var(--font-mono); font-size: 10px; color: var(--fg-dim); }
  .typeahead-dropdown {
    background: var(--dark-hover); border-radius: 6px;
    overflow: hidden;
  }
  .typeahead-item {
    display: flex; justify-content: space-between;
    padding: 10px 12px; cursor: pointer;
    font-family: var(--font-heading); font-size: 14px;
  }
  .typeahead-item.highlighted { background: var(--accent); color: #fff; }

  /* Set detail on mobile takes full bleed */
  .set-detail-header { padding: 16px; flex-direction: column; align-items: flex-start; }
  .set-detail-actions { width: 100%; justify-content: space-between; }
  .set-detail-play { flex: 1; }
  .set-detail-list { padding: 0 16px 32px; }
}

/* Mobile list view (≤720px). main-area renders tune-main + mobile-list-view
   together; the .show-mobile-list class on .app-layout picks which one shows. */
.mobile-list-view { display: none; }

@media (max-width: 720px) {
  .app-layout.show-mobile-list .tune-main,
  .app-layout.show-mobile-list .mobile-playback-bar { display: none; }
  /* hide the slim top-bar — list view has its own richer header */
  .app-layout.show-mobile-list .mobile-top-bar { display: none; }
  .app-layout.show-mobile-list .mobile-list-view {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    background: var(--dark); color: var(--fg-inverse);
    overflow-y: auto;
  }

  /* List view header */
  .mobile-list-header {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px 20px 16px;
  }
  .mobile-list-title-row {
    display: flex; align-items: center; justify-content: space-between;
  }
  .mobile-list-logo-block { display: flex; align-items: baseline; gap: 8px; }
  .mobile-list-logo {
    font-family: var(--font-heading); font-size: 28px; font-weight: 300;
    color: #f5f4f0; letter-spacing: 1px;
  }
  .mobile-list-version {
    font-family: var(--font-mono); font-size: 10px; color: #888; letter-spacing: 1px;
  }
  .mobile-list-menu {
    background: none; border: none; color: #888;
    font-size: 20px; cursor: pointer; padding: 4px;
  }
  .mobile-list-tagline {
    font-family: var(--font-mono); font-size: 10px; font-weight: normal;
    color: #666; letter-spacing: 2px; text-transform: uppercase;
  }

  /* Segmented tabs */
  .mobile-list-tabs { padding: 0 20px 12px; }
  .mobile-tabs-inner {
    display: flex; background: #111; border-radius: 8px; padding: 3px; gap: 0;
  }
  .mobile-tab {
    flex: 1; padding: 8px 0; border: none; border-radius: 6px;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
    color: #888; background: transparent; cursor: pointer;
  }
  .mobile-tab.active { background: #2a2a2a; color: #f5f4f0; }

  .mobile-filters {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding: 0 20px 12px;
  }
  .mobile-tune-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 80px; }

  /* Empty filter state */
  .mobile-empty-state, .sets-empty, .session-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px; padding: 40px;
    text-align: center;
  }
  .mobile-empty-state .empty-icon,
  .sets-empty .empty-icon,
  .session-empty .empty-icon {
    width: 64px; height: 64px; border-radius: 32px;
    background: #222222; color: #666666;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .mobile-empty-state .empty-title,
  .sets-empty .empty-title,
  .session-empty .empty-title {
    font-family: var(--font-heading); font-size: 22px; font-weight: 500;
    color: var(--fg-inverse);
  }
  .mobile-empty-state .empty-subtitle,
  .sets-empty .empty-subtitle,
  .session-empty .empty-subtitle {
    font-family: var(--font-mono); font-size: 11px; font-weight: normal;
    color: var(--fg-muted); letter-spacing: 1px;
  }

  /* Floating action button */
  .mobile-fab {
    position: fixed; right: 20px; bottom: 24px; z-index: 25;
    width: 56px; height: 56px; border-radius: 28px;
    background: var(--accent); color: #fff; border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    font-size: 28px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .mobile-fab-icon { line-height: 1; }
}


/* ===========================================================================
   Mobile dark-theme overrides (≤720px)
   The notes-sheet, delete-confirm modal, set-detail and settings screens reuse
   the light desktop palette by default. The mobile design specifies a dark
   treatment for each. These overrides re-theme them for mobile ONLY — the
   shared base rules keep their desktop (light) values untouched.
   --------------------------------------------------------------------------- */
@media (max-width: 720px) {
  /* notes-sheet — vWmaK (dark bottom sheet) */
  .notes-panel {
    background: #0A0A0A;
    border-top: 1px solid #0A0A0A;
  }
  .notes-label { color: var(--accent); }
  .notes-textarea {
    background: #1F1F1F;
    border: 1px solid #1F1F1F;
    color: var(--fg-inverse);
    font-size: 13px;
  }
  .notes-textarea::placeholder { color: #444; }
  .notes-close { color: var(--fg-muted); }
  .notes-close:hover { background: #2A2A2A; color: var(--fg-inverse); }
  /* Wave 1 A — title block + footer, dark */
  .notes-tune-title { color: var(--fg-inverse); }
  .notes-tune-meta { color: var(--fg-muted); }
  .notes-saved { color: var(--fg-muted); }
  .notes-count { color: var(--fg-muted); }

  /* delete-confirm modal — JyFJG (dark modal #262626) */
  .modal {
    background: #262626;
    border-radius: 14px;
  }
  .modal-title { color: var(--fg-inverse); font-weight: 600; }
  .modal-body {
    font-family: var(--font-mono);
    color: #A8A8A8;
  }
  .modal-cancel, .modal-destructive {
    font-family: var(--font-mono);
    font-weight: 600;
  }
  .modal-cancel { color: var(--fg-muted); border-color: #3A3A3A; }

  /* set-detail — sgPmc (dark theme #1A1A1A) */
  .set-detail-header { background: transparent; }
  .set-detail-title { font-size: 16px; font-weight: 500; color: var(--fg-inverse); }
  .set-detail-meta { color: var(--fg-muted); }
  .set-detail-tune-row {
    background: var(--dark-hover);
    border: none;
    border-radius: 6px;
    padding: 14px 12px;
  }
  .set-detail-tune-name { color: var(--fg-inverse); }
  .set-detail-num { color: var(--fg-secondary); }
  .set-detail-grip { color: var(--fg-secondary); }
  .set-detail-play {
    font-size: 13px;
    font-weight: 600;
  }
  .set-detail-list-label {
    padding: 0 20px 8px 20px;
    color: var(--fg-secondary);
  }
  .set-detail-more { color: var(--fg-muted); border-color: #3A3A3A; }

  /* settings — ddeLd (dark theme #1A1A1A, cards #2A2A2A cr 10) */
  .settings-card {
    background: var(--dark-hover);
    border: none;
    border-radius: 10px;
  }
  .settings-card-label { color: var(--fg-secondary); }
  .settings-row { border-top-color: #1F1F1F; }
  .settings-row-text { color: var(--fg-inverse); }
  .settings-row-value { color: var(--fg-muted); }
  .settings-list-title { color: var(--fg-inverse); }
  .settings-list-divider { background: #1F1F1F; }

  /* session-ready / session-live — CSS-only token corrections (XwIFG / J8hkB).
     Hero-card / now-card structural markup is out of Wave-1 CSS scope. */
  .session-start {
    font-family: var(--font-mono);
    font-weight: 600;
    border-radius: 8px;
  }
  .session-item, .session-set {
    border-radius: 6px;
    padding: 10px 12px;
  }
  .session-item-name { font-family: var(--font-mono); }
  .session-preview-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--fg-dim);
  }
}
/* ===========================================================================
   Mobile full-screen set editor — Item #3, design.pen frame he1dM.
   Reuses the .te-* overlay shell (tune-editor.css): .te-overlay/.te-top/
   .te-body/.te-section/.te-label/.te-input + the desktop-hide @media. This
   module adds the set-specific .se-* rows, the add-tune picker, the Save
   disabled state, and the viewport-gated "+ New Set" buttons. Imported last
   so its visibility rules win source-order ties over sets/mobile modules.
   --------------------------------------------------------------------------- */

/* Save pill is disabled until the draft has a name + ≥1 tune. */
.te-save.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* TUNES section header — label left, live count right (he1dM stTunesSec). */
.se-tunes-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.se-tunes-count {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--fg-secondary);
}

.se-tune-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Draggable tune row — grip · title/meta · remove (he1dM stT1). */
.se-tune-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dark-hover);
  border-radius: 8px;
  padding: 12px 14px;
}
.se-grip {
  flex: 0 0 auto;
  color: var(--fg-secondary);
  font-size: 14px;
  cursor: grab;
  touch-action: none; /* let the drag handler own vertical movement */
  user-select: none;
}
.se-tune-row.se-dragging {
  opacity: 0.9;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.se-tune-info {
  flex: 1;
  min-width: 0; /* enables ellipsis truncation */
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.se-tune-name {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--fg-inverse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-tune-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-tune-remove {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.se-tune-remove:active { color: #D9534F; }

/* Dashed "Add tune" button (he1dM stAddBtn). */
.se-add-tune {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px dashed #3A3A3A;
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fg-muted);
  cursor: pointer;
}
.se-add-tune:active { border-color: var(--accent); color: var(--accent); }
.se-add-tune-icon { font-size: 14px; }

/* Inline tune picker — revealed by the Add tune button. */
.se-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.se-picker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.se-picker-input {
  flex: 1;
  background: var(--dark-hover);
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-inverse);
  outline: none;
}
.se-picker-input::placeholder { color: #555; }
.se-picker-input:focus { outline: 1px solid var(--accent); }
.se-picker-done {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fg-muted);
  cursor: pointer;
}
.se-picker-results {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}
.se-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #1F1F1F;
  cursor: pointer;
}
.se-picker-item:active { background: var(--dark-hover); }
.se-picker-name {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--fg-inverse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-picker-type {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--fg-muted);
}

/* ---------------------------------------------------------------------------
   Viewport-gated "+ New Set" buttons. Desktop keeps the inline-wizard button
   (.add-set-btn → :set/start-create); mobile shows .add-set-btn--mobile →
   :set-editor/open-new. Both render; CSS picks one per viewport.
   --------------------------------------------------------------------------- */
.add-set-btn--mobile { display: none; }

@media (max-width: 720px) {
  .sets-content > .add-set-btn { display: none; }
  .add-set-btn--mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 8px 0;
    padding: 14px 12px;
    background: transparent;
    border: 1px solid #3A3A3A;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--fg-muted);
    cursor: pointer;
  }
  .add-set-btn--mobile:active { border-color: var(--accent); color: var(--accent); }
}
