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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #222;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

body.dark { background: #252525; color: #eee; }

/* Navigation - bottom bar */
#mainNav {
  display: flex;
  background: #fff;
  border-top: 1px solid #ddd;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}

body.dark #mainNav {
  background: #0d0d0d;
  border-color: #222;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.6);
}

.nav-btn {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  color: #888;
  font-size: 12px;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-btn.active {
  color: #f0c040;
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #f0c040;
}

.nav-btn:hover { color: #f0c040; }
body.dark .nav-btn { color: #ccc; }
body.dark .nav-btn.active { color: #f0c040; }
body.dark .nav-btn:hover { color: #f0c040; }

.nav-icon {
  font-size: 24px;
  line-height: 1;
}

.nav-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  padding-bottom: 80px;
  width: 100%;
}


h1 {
  margin-bottom: 24px;
  font-size: 24px;
  letter-spacing: -0.5px;
}

h2 {
  margin: 24px 0 12px;
  font-size: 18px;
  letter-spacing: -0.3px;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.toolbar input, .toolbar select {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.toolbar input:focus, .toolbar select:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}

body.dark .toolbar input, body.dark .toolbar select {
  background: #1e1e1e;
  border-color: #3a3a3a;
  color: #eee;
}

body.dark .toolbar input:focus, body.dark .toolbar select:focus {
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

.toolbar input[type="text"] { flex: 1; min-width: 150px; }

/* Buttons */
button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0c040, #d4a020);
  color: #1a1a1a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #f5d060, #e0b030);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

button.secondary {
  background: linear-gradient(135deg, #555, #444);
  color: #eee;
}

button.secondary:hover {
  background: linear-gradient(135deg, #666, #555);
}

button.danger {
  background: linear-gradient(135deg, #d94a4a, #b33);
  color: #fff;
}

button.danger:hover {
  background: linear-gradient(135deg, #e55, #c44);
}

/* Song cards - grid layout */
#songList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.song-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  overflow: hidden;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

body.dark .song-card {
  background: #1e1e1e;
  border-color: #333;
}

body.dark .song-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.song-card-thumb {
  width: 80px;
  min-width: 80px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #ccc;
}

.song-card-info {
  flex: 1;
  overflow: hidden;
  padding: 14px;
}

.song-card-info h3 {
  font-size: 18px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card-artist {
  display: block;
  font-size: 14px;
  color: #888;
  margin-bottom: 6px;
}

.song-card .meta { font-size: 13px; color: #888; display: block; margin-bottom: 6px; }

.song-card .status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.gig-ready { background: #d4edda; color: #155724; }
.status.needs-work { background: #fff3cd; color: #856404; }
body.dark .status.gig-ready { background: #1b4332; color: #95d5b2; }
body.dark .status.needs-work { background: #3d2e00; color: #ffd166; }

/* Song card menu */
.song-card-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.song-card-menu:hover { background: rgba(255,255,255,0.1); }

.song-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 50;
  min-width: 120px;
}

.song-menu.open { display: block; }

body.dark .song-menu {
  background: #2a2a2a;
  border-color: #444;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.song-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 0;
  color: #eee;
  font-size: 13px;
  box-shadow: none;
  font-weight: 400;
}

.song-menu button:hover {
  background: rgba(240,192,64,0.1);
  transform: none;
  box-shadow: none;
}

.song-menu button.danger:hover {
  background: rgba(217,74,74,0.1);
}

/* Editor */
.editor-form { display: flex; flex-direction: column; gap: 14px; }

.editor-form input, .editor-form select, .editor-form textarea {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-form input:focus, .editor-form select:focus, .editor-form textarea:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}

body.dark .editor-form input, body.dark .editor-form select, body.dark .editor-form textarea {
  background: #1e1e1e;
  border-color: #3a3a3a;
  color: #eee;
}

body.dark .editor-form input:focus, body.dark .editor-form select:focus, body.dark .editor-form textarea:focus {
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

.editor-row { display: flex; gap: 10px; }
.editor-row > * { flex: 1; }
.editor-form textarea { min-height: 300px; font-family: Menlo, monospace; line-height: 1.6; }
.editor-actions { display: flex; gap: 10px; }

/* Performance header */
.perf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #e0e0e0;
  border-bottom: 1px solid #ccc;
  border-radius: 12px 12px 0 0;
  gap: 16px;
}

body.dark .perf-header {
  background: #1a1a1a;
  border-color: #333;
}

.perf-header-menu {
  font-size: 24px;
  color: #888;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  position: relative;
}

.perf-header-menu:hover { background: rgba(255,255,255,0.1); }

.back-btn {
  padding: 8px 16px;
  font-size: 16px;
  border-radius: 8px;
  background: none;
  color: #f0c040;
  box-shadow: none;
  border: none;
  font-weight: 600;
  margin-bottom: 16px;
}

.back-btn:hover {
  background: rgba(240,192,64,0.1);
  transform: none;
  box-shadow: none;
}

.perf-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.perf-thumbnail {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #f0c040, #d4a020);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 8px rgba(240,192,64,0.3);
}

body.dark .perf-thumbnail {
  background: linear-gradient(135deg, #f0c040, #d4a020);
}

.perf-song-name {
  display: block;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: -0.3px;
}

.perf-artist {
  display: block;
  font-size: 16px;
  color: #888;
  margin-top: 3px;
}

.perf-key-badge {
  display: inline-block;
  font-size: 15px;
  color: #f0c040;
  font-weight: bold;
  margin-top: 4px;
}

.perf-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.perf-controls-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 60px;
  padding: 10px 0 20px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.perf-controls-bar label {
  display: block;
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: center;
}

.perf-key-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.perf-capo-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.perf-scroll-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.perf-lock-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.perf-lock-controls button {
  font-size: 50px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
}

.perf-lock-controls button:hover {
  background: rgba(255,255,255,0.1);
  transform: none;
  box-shadow: none;
}

.scroll-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scroll-group button {
  font-size: 50px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
}

.scroll-group button:hover {
  background: rgba(255,255,255,0.1);
  transform: none;
  box-shadow: none;
}

.scroll-group input[type="range"] {
  accent-color: #f0c040;
  width: 160px;
}

.scroll-group input[type="range"]:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.perf-key-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.perf-key-group button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 22px;
  border-radius: 50%;
  background: #444;
  color: #eee;
  box-shadow: none;
}

.perf-key-group button:hover {
  background: #555;
  transform: none;
}

.perf-key-group button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.perf-key-group button:disabled:hover {
  background: #444;
}

.perf-key-group span {
  font-weight: bold;
  min-width: 40px;
  text-align: center;
  font-size: 22px;
}

.perf-capo-controls input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #333;
  color: #eee;
  font-size: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
}

.perf-capo-controls input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Performance body */
.perf-body {
  padding: 24px;
  background: #f0f0f0;
  min-height: calc(100vh - 140px);
  border-radius: 0 0 12px 12px;
}

body.dark .perf-body { background: #2a2a2a; }

.mobile-sheet,
.mobile-sheet-overlay {
  display: none !important;
}



.perf-controls { display: flex; align-items: center; gap: 6px; }

/* Performance content */
.perf-content {
  font-family: Menlo, monospace;
  line-height: 1.6;
  font-size: 18px;
}

.perf-content .chord-line,
.perf-content .lyric-line {
  white-space: pre-wrap;
  display: block;
}

.perf-content .chord { color: #c8960c; font-weight: bold; }
body.dark .perf-content .chord { color: #f0c040; }

.perf-content .section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  margin-bottom: 10px;
}

.perf-content .section-badge {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1;
  min-width: 40px;
  text-align: center;
}

.perf-content .section-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.perf-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: #eee;
  border-radius: 8px;
  margin-bottom: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
}

body.dark .perf-flow { background: #1e1e1e; }

.perf-flow .flow-item {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-weight: 700;
  transition: all 0.15s ease;
  min-width: 36px;
  text-align: center;
  font-size: 14px;
}

.perf-flow .flow-item:hover {
  background: #f0c040;
  color: #1a1a1a;
  border-color: #f0c040;
}

body.dark .perf-flow .flow-item {
  background: #333;
  border-color: #444;
  color: #ddd;
}

body.dark .perf-flow .flow-item:hover {
  background: #f0c040;
  color: #1a1a1a;
  border-color: #f0c040;
}

.perf-content .chord-line {
  color: #c8960c;
  font-weight: bold;
  margin-bottom: 0;
  line-height: 1.4;
}

body.dark .perf-content .chord-line { color: #f0c040; }

.perf-content .lyric-line {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Setlists */
.setlist-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #f0c040;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.setlist-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

body.dark .setlist-card {
  background: #1e1e1e;
  border-color: #333;
  border-left-color: #f0c040;
}

body.dark .setlist-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.setlist-card h3 { margin-bottom: 10px; font-size: 15px; }
.setlist-card ol { padding-left: 20px; }
.setlist-card li { padding: 5px 0; font-size: 13px; }

#setlistSongPicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

#setlistSongPicker label {
  padding: 6px 12px;
  background: #e8e8e8;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

#setlistSongPicker label:hover { background: #f0c040; color: #1a1a1a; }
body.dark #setlistSongPicker label { background: #333; }
body.dark #setlistSongPicker label:hover { background: #f0c040; color: #1a1a1a; }

#setlistOrder {
  min-height: 40px;
  border: 2px dashed #3a3a3a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 14px;
}

#setlistOrder .order-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f0f0;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  transition: background 0.15s;
}

#setlistOrder .order-item span {
  flex: 1;
}

#setlistOrder .order-item:hover { background: #e8e8e8; }
body.dark #setlistOrder .order-item { background: #333; }
body.dark #setlistOrder .order-item:hover { background: #3a3a3a; }

/* Account */
.account-section { margin-bottom: 24px; }

.account-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #888;
}

.account-section input, .account-section select {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  width: 100%;
  max-width: 300px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.account-section input:focus, .account-section select:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}

body.dark .account-section input, body.dark .account-section select {
  background: #1e1e1e;
  border-color: #3a3a3a;
  color: #eee;
}

.account-section button { margin-right: 10px; margin-top: 6px; }

/* Home stats */
#homeStats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  flex: 1;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

body.dark .stat-card {
  background: #1e1e1e;
  border-color: #333;
}

body.dark .stat-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.stat-card .number {
  font-size: 32px;
  font-weight: bold;
  color: #f0c040;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card .label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Recent songs */
.recent-song {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #1e1e1e;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-song:hover {
  transform: translateX(4px);
  background: #262626;
}

.recent-song-num {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  min-width: 20px;
  text-align: center;
}

.recent-song-thumb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ccc;
}

.recent-song-info {
  flex: 1;
  overflow: hidden;
}

.recent-song-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-song-artist {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.recent-song-key {
  font-size: 13px;
  font-weight: 600;
  color: #f0c040;
  min-width: 30px;
  text-align: right;
}

/* Setlist editor */
#setlistName {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #1e1e1e;
  color: #eee;
  margin-bottom: 16px;
}

#setlistName:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

/* Song Picker Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #252525;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #333;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  box-shadow: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover {
  color: #fff;
  background: none;
  transform: none;
  box-shadow: none;
}

.modal-content > input[type="text"] {
  margin: 16px 24px;
  padding: 12px 16px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #1e1e1e;
  color: #eee;
  font-size: 15px;
}

.modal-content > input[type="text"]:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

.song-picker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 16px;
}

.picker-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-tile:hover {
  background: #2a2a2a;
  border-color: #444;
}

.picker-tile.selected {
  border-color: #f0c040;
  background: rgba(240,192,64,0.05);
}

.picker-tile-thumb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ccc;
}

.picker-tile-info {
  flex: 1;
  overflow: hidden;
}

.picker-tile-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-tile-artist {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.picker-tile-check {
  font-size: 18px;
  color: #f0c040;
  font-weight: bold;
  min-width: 24px;
  text-align: center;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #333;
  text-align: right;
}

.setlist-editor-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.setlist-editor-body h3 {
  margin: 16px 0 10px;
  font-size: 15px;
  color: #aaa;
}

/* Setlist card layout */
.setlist-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.setlist-card-content {
  flex: 1;
}

.setlist-card-menu {
  font-size: 20px;
  color: #888;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  position: relative;
}

.setlist-card-menu:hover {
  background: rgba(255,255,255,0.1);
}
@media (max-width: 768px) {
  main {
    max-width: 100%;
    padding: 16px 12px;
    padding-bottom: 80px;
  }

  .toolbar { flex-direction: column; }
  .toolbar input, .toolbar select, .toolbar button { width: 100%; }
  .editor-row { flex-direction: column; }
  #homeStats { flex-direction: column; }

  #songList {
    grid-template-columns: 1fr;
  }

  .perf-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 8px;
    position: relative;
  }

  .perf-header-left {
    flex: 1;
    overflow: hidden;
    gap: 8px;
  }

  .perf-thumbnail {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 16px;
  }

  .perf-song-name {
    font-size: 15px;
  }

  .perf-artist {
    font-size: 11px;
  }

  .perf-key-badge {
    font-size: 11px;
  }

  .perf-header-menu {
    position: static;
    font-size: 20px;
    padding: 4px 8px;
  }

  .perf-body {
    padding: 6px 4px;
  }

  .perf-controls-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    padding: 6px 0 10px 0;
    justify-content: space-around;
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 12px;
  }

  .perf-controls-bar label {
    display: none;
  }

  .perf-key-controls,
  .perf-capo-controls {
    cursor: pointer;
  }

  .perf-key-controls .perf-key-group button,
  .perf-capo-controls input {
    display: none;
  }

  .perf-key-controls .perf-key-group span {
    font-size: 14px;
    background: #333;
    padding: 6px 12px;
    border-radius: 6px;
    min-width: auto;
  }

  .perf-key-controls .perf-key-group span::before {
    content: 'Key: ';
    font-weight: 400;
    color: #888;
  }

  .perf-capo-controls::after {
    content: attr(data-label);
    font-size: 14px;
    background: #333;
    padding: 6px 12px;
    border-radius: 6px;
    color: #eee;
  }

  .scroll-group button {
    font-size: 20px;
  }

  .scroll-group input[type="range"] {
    display: none;
  }

  .perf-lock-controls button {
    font-size: 20px;
    padding: 2px 4px;
  }

  .perf-lock-controls {
    margin-left: 0;
  }

  /* Bottom sheet for key/capo */
  .mobile-sheet {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e1e1e;
    border-top: 1px solid #444;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    z-index: 300;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  }

  .mobile-sheet.open {
    display: block !important;
  }

  .mobile-sheet-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
  }

  .mobile-sheet-overlay.open {
    display: block !important;
  }

  .mobile-sheet-overlay.open {
    display: block;
  }

  .mobile-sheet h3 {
    text-align: center;
    margin-bottom: 16px;
    font-size: 16px;
    color: #eee;
  }

  .mobile-sheet-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .mobile-sheet-keys button {
    padding: 12px 8px;
    font-size: 15px;
    border-radius: 8px;
    background: #333;
    color: #eee;
    border: none;
    box-shadow: none;
    font-weight: 600;
  }

  .mobile-sheet-keys button:hover {
    transform: none;
    box-shadow: none;
  }

  .mobile-sheet-keys button.active {
    background: #f0c040;
    color: #1a1a1a;
  }

  .mobile-capo-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .mobile-capo-picker button {
    width: 44px;
    height: 44px;
    font-size: 16px;
    border-radius: 8px;
    background: #333;
    color: #eee;
    border: none;
    box-shadow: none;
    font-weight: 600;
  }

  .mobile-capo-picker button:hover {
    transform: none;
    box-shadow: none;
  }

  .mobile-capo-picker button.active {
    background: #f0c040;
    color: #1a1a1a;
  }

  .perf-content {
    font-size: 10px;
  }

  .perf-content .chord-line,
  .perf-content .lyric-line {
    white-space: pre;
    overflow-x: auto;
    display: block;
  }

  .perf-content .section-title {
    margin-top: 16px;
    margin-bottom: 6px;
    gap: 6px;
  }

  .perf-content .section-badge {
    padding: 5px 8px;
    font-size: 10px;
    min-width: 24px;
    border-radius: 4px;
  }

  .perf-content .section-label {
    font-size: 10px;
  }

  .perf-song-name {
    font-size: 20px;
  }

  .perf-flow {
    gap: 4px;
    padding: 6px 4px;
    margin-bottom: 12px;
  }

  .perf-flow .flow-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .modal-content {
    max-width: 100%;
    max-height: 90vh;
    margin: 10px;
    border-radius: 10px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .song-card {
    padding: 8px;
  }

  .song-card-thumb {
    width: 40px;
    min-width: 40px;
    font-size: 18px;
  }

  .song-card-info h3 {
    font-size: 13px;
  }

  .song-card-artist {
    font-size: 11px;
  }

  .song-card .meta {
    font-size: 10px;
  }

  .nav-icon {
    font-size: 20px;
  }

  .nav-text {
    font-size: 10px;
  }

  .back-btn {
    font-size: 14px;
    padding: 6px 12px;
  }

  .recent-song {
    padding: 10px 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card .number {
    font-size: 26px;
  }
}

/* Font size controls */
.perf-font-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.font-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.font-group button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  background: #444;
  color: #eee;
  box-shadow: none;
}

.font-group button:hover {
  background: #555;
  transform: none;
  box-shadow: none;
}

@media (max-width: 768px) {
  .font-group button {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 4px;
  }

  .font-group {
    gap: 4px;
  }

  .perf-font-controls label {
    font-size: 8px;
  }
}

/* Login page */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: #f0c040;
}

.login-subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form input {
  padding: 14px 16px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #252525;
  color: #eee;
  font-size: 15px;
}

.login-form input:focus {
  outline: none;
  border-color: #f0c040;
  box-shadow: 0 0 0 3px rgba(240,192,64,0.1);
}

.login-form button {
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
}

.login-error {
  color: #e05555;
  font-size: 13px;
  min-height: 20px;
}

/* Setlist view */
.setlist-view h2 {
  margin: 0 0 16px;
}

.setlist-count {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.setlist-song-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setlist-song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #1e1e1e;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setlist-song-item:hover {
  background: #262626;
  transform: translateX(4px);
}

.setlist-song-num {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  min-width: 24px;
  text-align: center;
}

.setlist-song-thumb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ccc;
}

.setlist-song-info {
  flex: 1;
  overflow: hidden;
}

.setlist-song-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setlist-song-artist {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.setlist-song-key {
  font-size: 13px;
  font-weight: 600;
  color: #f0c040;
  min-width: 30px;
  text-align: right;
}
