/* ===== CSS Custom Properties ===== */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface2: #e8e8ed;
  --border: #d1d1d6;
  --text: #1c1c1e;
  --text-muted: #6c6c70;
  --primary: #1a56db;
  --primary-hover: #1341b0;
  --primary-text: #ffffff;
  --accent: #d63031;
  --accent-hover: #b71c1c;
  --chord-bg: #e8f0fe;
  --chord-text: #1a56db;
  --chord-border: #c5d8f8;
  --danger: #d63031;
  --success: #27ae60;
  --warning: #f39c12;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --nav-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

[data-theme="dark"] {
  --bg: #0f0f12;
  --surface: #1c1c1f;
  --surface2: #2c2c30;
  --border: #3a3a3e;
  --text: #f2f2f7;
  --text-muted: #98989e;
  --primary: #4a8cff;
  --primary-hover: #6aa0ff;
  --primary-text: #ffffff;
  --accent: #ff6b6b;
  --accent-hover: #ff8787;
  --chord-bg: #1a2a4a;
  --chord-text: #7ab3ff;
  --chord-border: #2a3f6a;
  --danger: #ff6b6b;
  --success: #2ecc71;
  --warning: #f1c40f;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.3);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; font-family: var(--font); }

input, textarea, select {
  font-family: var(--font);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

textarea { resize: vertical; min-height: 120px; line-height: 1.5; }

label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text-muted); }

/* ===== Navigation ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  transition: background var(--transition), border-color var(--transition);
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; opacity: 0.85; }
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  background: none;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--chord-bg); color: var(--primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-user {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Theme toggle */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--border); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius);
  font-size: 1rem;
}

/* ===== Layout ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: background var(--transition), border-color var(--transition);
}

.card-body { padding: 1.25rem; }
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ===== Song List ===== */
.song-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.song-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}
.song-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.song-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.song-card-artist {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.song-card-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

/* ===== Tags / Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary { background: var(--chord-bg); color: var(--chord-text); }
.badge-secondary { background: var(--surface2); color: var(--text-muted); }
.badge-key {
  background: var(--surface2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.songbook-key-btn {
  cursor: pointer;
  transition: all var(--transition);
}
.songbook-key-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.songbook-key-btn.custom {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}
[data-theme="dark"] .songbook-key-btn.custom {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #93c5fd;
}
.key-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.key-preset-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.key-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Song Detail / Lyrics ===== */
.song-header {
  margin-bottom: 1.5rem;
}
.song-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.song-artist {
  font-size: 1.05rem;
  color: var(--text-muted);
}
.song-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Transposer */
.transposer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.transposer-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.transposer-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.transpose-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.transpose-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.transpose-display {
  min-width: 48px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-mono);
  color: var(--primary);
}

.transpose-reset {
  font-size: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.transpose-reset:hover { background: var(--surface2); color: var(--text); }

/* Lyrics display */
.lyrics {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.strophe {
  line-height: 2;
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.strophe:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.chord {
  display: inline-block;
  background: var(--chord-bg);
  color: var(--chord-text);
  border: 1px solid var(--chord-border);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: baseline;
  transition: background var(--transition), color var(--transition);
  cursor: default;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.search-bar input {
  flex: 1;
}

/* Snippet in Suchergebnissen */
.song-card-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  margin-top: 0.1rem;
}

/* Treffer-Hervorhebung */
mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
[data-theme="dark"] mark {
  background: #713f12;
  color: #fef08a;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== Auth Forms ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group { margin-bottom: 1rem; }

.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.form-row .form-group { flex: 1; margin-bottom: 0; }

/* ===== Alerts ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

[data-theme="dark"] .alert-error { background: #3b0c0c; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .alert-success { background: #052e16; border-color: #14532d; color: #86efac; }

/* ===== Songbook List ===== */
.songbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.songbook-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.songbook-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.songbook-card-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.songbook-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.songbook-card-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Songbook new card */
.songbook-card-new {
  border-style: dashed;
  border-color: var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 100px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.songbook-card-new .plus { font-size: 1.75rem; line-height: 1; color: var(--primary); }
.songbook-card-new:hover { background: var(--surface2); color: var(--primary); }

/* ===== Songbook Song List ===== */
.songbook-song-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.songbook-song-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.songbook-song-item:hover { border-color: var(--primary); }

.songbook-song-info {
  flex: 1;
  cursor: pointer;
}
.songbook-song-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.songbook-song-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Song Editor ===== */
.song-editor {
  max-width: 720px;
}

.lyrics-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  padding: 1.5rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.empty-state-text { font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ===== Filter Row ===== */
.filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  font-weight: 500;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--chord-bg); border-color: var(--primary); color: var(--primary); }

/* ===== Divider ===== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ===== Back Button ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  margin-bottom: 1rem;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--primary); }

/* ===== Dropdown Menu ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 150;
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--surface2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fef2f2; }
[data-theme="dark"] .dropdown-item.danger:hover { background: #3b0c0c; }

/* ===== Toast Notifications ===== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  max-width: 300px;
  pointer-events: auto;
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(10px); }
}

/* ===== Loading ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex;
  justify-content: center;
  padding: 3rem;
}

/* ===== Select in add-to-book ===== */
.songbook-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 300px;
  overflow-y: auto;
}
.songbook-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  gap: 0.5rem;
}
.songbook-select-item:hover { border-color: var(--primary); background: var(--chord-bg); }
.songbook-select-item.added { opacity: 0.5; cursor: default; }
.songbook-select-item.added:hover { border-color: var(--border); background: var(--surface); }

/* ===== Hamburger ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: rgba(0,0,0,0.3);
  z-index: 98;
}
.nav-overlay.open { display: block; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* --- Nav mobile --- */
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    text-align: left;
    border-radius: var(--radius);
    width: 100%;
  }

  .nav-right {
    gap: 0.35rem;
  }
  .nav-user { display: none; }

  /* --- Layout --- */
  .container, .container-wide { padding: 1rem 0.85rem; }
  .song-grid { grid-template-columns: 1fr; }
  .songbook-grid { grid-template-columns: 1fr; }

  /* --- Typography --- */
  .page-title { font-size: 1.3rem; }
  .song-title { font-size: 1.4rem; }
  .lyrics { padding: 1rem 0.85rem; font-size: 1rem; line-height: 2.1; }

  /* --- Page header --- */
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .page-header > div:last-child { width: 100%; display: flex; gap: 0.5rem; flex-wrap: wrap; }

  /* --- Forms --- */
  .form-row { flex-direction: column; gap: 1rem; }
  .auth-card { padding: 1.25rem; }

  /* --- Song detail header --- */
  .song-header > div:first-child { flex-direction: column; gap: 0.75rem; }
  .song-header > div:first-child > div:last-child { width: 100%; justify-content: flex-start; }

  /* --- Transposer --- */
  .transpose-btn { width: 44px; height: 44px; font-size: 1.3rem; }
  .transpose-display { min-width: 52px; font-size: 1.1rem; }

  /* --- Songbook song items --- */
  .songbook-song-item { padding: 0.85rem 0.75rem; gap: 0.5rem; }
  .songbook-song-title { font-size: 1rem; }

  /* --- Toast --- */
  #toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
  .toast { max-width: 100%; }

  /* --- Filter chips: horizontal scroll --- */
  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; -webkit-overflow-scrolling: touch; }
  .filter-chip { flex-shrink: 0; padding: 0.4rem 0.85rem; font-size: 0.85rem; }

  /* --- Buttons: größere Tap-Flächen --- */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }

  /* --- Modal --- */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.25rem;
  }

  /* --- Admin table --- */
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3),
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) { display: none; }
}

/* ===== Admin Table ===== */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover { background: var(--surface2); }

.admin-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}
[data-theme="dark"] .badge-pending {
  background: #3d2500;
  color: #fcd34d;
}
.user-pending { background: #fffbeb !important; }
[data-theme="dark"] .user-pending { background: #1c1500 !important; }
.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
[data-theme="dark"] .alert-success {
  background: #052e16;
  color: #86efac;
  border-color: #166534;
}

.badge-admin {
  background: #fef3c7;
  color: #92400e;
}
[data-theme="dark"] .badge-admin {
  background: #451a03;
  color: #fcd34d;
}


/* ===== Admin Sections ===== */
.admin-section {
  margin-bottom: 2.5rem;
}
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.admin-section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

/* ===== Genre Picker (Song Editor) ===== */
.genre-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  min-height: 2.5rem;
}
.genre-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.genre-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.genre-chip:hover:not(.selected) {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Genre Admin List ===== */
.genre-admin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.genre-admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem 0.25rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text);
}
.genre-admin-edit,
.genre-admin-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}
.genre-admin-edit:hover { color: var(--primary); }
.genre-admin-del:hover { color: var(--danger); }

/* ===== Utility ===== */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
