/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #eef2ff;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --success:       #16a34a;
  --secondary:     #6b7280;
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --chord-color:   #2563eb;
  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --font-mono:     'Courier New', Courier, monospace;
}

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

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* Hamburger (mobile) */
.hamburger { display: none; cursor: pointer; font-size: 1.4rem; margin-left: auto; user-select: none; }
.nav-toggle-input { display: none; }
.nav-mobile-links { display: none; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-toggle-input:checked ~ .nav-mobile-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    gap: 0.25rem;
    box-shadow: var(--shadow-md);
  }
}

/* ============================================================
   Main Layout
   ============================================================ */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.subtitle { color: var(--text-muted); margin-top: 0.25rem; }
.back-link { font-size: 0.9rem; color: var(--text-muted); display: inline-block; margin-bottom: 0.5rem; }
.back-link:hover { color: var(--primary); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

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

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

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

.btn-sm  { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.btn-lg  { padding: 0.65rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ============================================================
   Forms
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--text); }

input[type="text"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.form-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-group-grow { flex: 1; min-width: 200px; }
.form-group-checkbox { flex-shrink: 0; padding-bottom: 0.1rem; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.form-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }

/* ============================================================
   Search
   ============================================================ */
.search-container { position: relative; margin-bottom: 1.5rem; }

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-size: 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.415l-3.868-3.833zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 0.9rem center;
  box-shadow: var(--shadow);
}

.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }

.search-spinner { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); display: none; }
.htmx-request .search-spinner { display: inline; }

.search-hint, .search-empty { color: var(--text-muted); text-align: center; padding: 2rem; }
.result-count { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }

/* ============================================================
   Song List (search results)
   ============================================================ */
.song-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }

.song-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
}

.song-list-item:hover { box-shadow: var(--shadow-md); }

.song-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--text);
}

.song-list-link:hover { text-decoration: none; }

.song-list-title { font-weight: 500; }

.song-list-row {
  display: flex;
  align-items: center;
}

.song-list-row .song-list-link {
  flex: 1;
}

.add-pl-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.song-list-item:hover .add-pl-btn { opacity: 1; }

/* ============================================================
   Song View Page
   ============================================================ */
.song-page { max-width: 800px; }

.song-header { margin-bottom: 1.5rem; }
.song-header-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.song-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.song-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; padding-top: 0.25rem; }
.song-title { font-size: 2rem; font-weight: 700; line-height: 1.2; }

.font-size-controls { display: flex; gap: 0.25rem; }
.font-size-controls .btn { font-weight: 700; min-width: 2.2rem; }

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

.key-display {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.key-label { color: var(--text-muted); }

.key-original {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

.key-arrow { color: var(--text-muted); }

.key-current {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
}

.key-offset {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.transpose-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-left: auto; }

/* Song body - chord display */
.song-body {
  --song-font-size: 17px;
  font-family: var(--font-mono);
  font-size: var(--song-font-size);
  line-height: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.song-line {
  margin-bottom: 0.1rem;
  line-height: 1.15;
}

.chord-row {
  color: var(--chord-color);
  font-weight: 700;
  white-space: pre;
  font-size: var(--song-font-size, 17px);
  min-height: 1.3em;
  line-height: 1.3;
}

.lyric-row {
  color: var(--text);
  white-space: pre;
  font-size: var(--song-font-size, 17px);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.song-spacer { height: 1.2rem; }

.song-section {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .song-body { font-size: 0.95rem; padding: 1rem; }
  .chord-row, .lyric-row { font-size: 0.95rem; }
  .song-title { font-size: 1.5rem; }
}

/* ============================================================
   Song Editor
   ============================================================ */
.song-form { max-width: 100%; }

.editor-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 0.75rem;
}

.editor-hint code {
  background: #e2e8f0;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  min-height: 500px;
}

@media (max-width: 768px) {
  .editor-container { grid-template-columns: 1fr; }
}

.editor-pane, .preview-pane {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-label {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.code-editor {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 1rem;
  border: none;
  resize: none;
  min-height: 480px;
  background: #1e1e2e;
  color: #cdd6f4;
  outline: none;
}

.preview-pane {
  background: var(--surface);
  overflow-y: auto;
}

.preview-pane .chord-row { font-size: 0.95rem; }
.preview-pane .lyric-row { font-size: 0.95rem; }

#preview-pane {
  padding: 1rem;
  font-family: var(--font-mono);
  overflow-y: auto;
  min-height: 480px;
}

.preview-placeholder { color: var(--text-muted); font-family: system-ui, sans-serif; font-size: 0.9rem; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.card-narrow { max-width: 480px; }

/* ============================================================
   Tables
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

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

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg); }

.table-actions { white-space: nowrap; text-align: right; display: flex; gap: 0.4rem; justify-content: flex-end; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-public  { background: #dcfce7; color: #15803d; }
.badge-private { background: #fef9c3; color: #854d0e; }
.badge-admin    { background: var(--primary-light); color: var(--primary); }
.badge-user     { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-no-chords {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.5;
  padding: 0;
  border-radius: 0;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error   { background: var(--danger-light); color: var(--danger); border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: var(--success); border: 1px solid #86efac; }

/* ============================================================
   Playlists
   ============================================================ */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.playlist-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: var(--text);
}

.playlist-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.playlist-card-date { font-size: 0.8rem; color: var(--text-muted); }
.playlist-card-title { font-size: 1.05rem; font-weight: 600; }
.playlist-card-count { font-size: 0.82rem; color: var(--text-muted); margin-top: auto; padding-top: 0.5rem; }

/* Playlist detail */
.playlist-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .playlist-layout { grid-template-columns: 1fr; }
}

.playlist-items { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.playlist-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
}

.playlist-item:hover { box-shadow: var(--shadow); }

.playlist-item-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding-top: 0.1rem;
  flex-shrink: 0;
  user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.playlist-num {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 1.5rem;
  padding-top: 0.1rem;
  flex-shrink: 0;
}

.playlist-item-content { flex: 1; min-width: 0; }
.playlist-song-title { font-weight: 600; font-size: 1rem; color: var(--text); }
.playlist-song-title:hover { color: var(--primary); }

.playlist-notes-display {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-style: italic;
}

.notes-form { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.notes-input { flex: 1; min-width: 0; font-size: 0.85rem; padding: 0.3rem 0.6rem; }
.saved-indicator { font-size: 0.8rem; color: var(--success); }

/* ============================================================
   Two column layout (users page)
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ============================================================
   Auth page
   ============================================================ */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 3rem;
}

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

.auth-title { font-size: 1.5rem; margin-bottom: 1.25rem; }
.auth-hint { margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* ============================================================
   Utilities
   ============================================================ */
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 0.85rem; }
.link        { color: var(--primary); }
.link:hover  { text-decoration: underline; }
.hidden      { display: none !important; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ============================================================
   Language switcher
   ============================================================ */
.lang-switcher {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  margin-left: 0.5rem;
}

.lang-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.lang-btn:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.lang-btn.active { background: var(--primary); color: #fff; }

/* ============================================================
   Letter filter
   ============================================================ */
.letter-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.letter-btn {
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

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

.letter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   Theme filter
   ============================================================ */
.theme-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.theme-btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

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

.theme-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   Theme badge on song cards
   ============================================================ */
.badge-theme {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 500;
}

.song-list-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* ============================================================
   Themes admin page
   ============================================================ */
.themes-admin { max-width: 600px; }

.theme-create-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.theme-name-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

.theme-name-input:focus { outline: 2px solid var(--primary); border-color: transparent; }

.themes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
}

.theme-name { font-weight: 500; flex: 1; }
.theme-song-count { font-size: 0.82rem; color: var(--text-muted); }

/* ============================================================
   Theme checkboxes in song editor
   ============================================================ */
.theme-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.5rem 0;
  align-items: center;
}

.theme-new-inline { margin-left: 0.25rem; }

.theme-new-input {
  padding: 0.25rem 0.6rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  width: 160px;
}

.theme-new-input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
  background: var(--surface);
}

/* ============================================================
   Playlist picker (song page)
   ============================================================ */
.playlist-add-section {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.playlist-picker {
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-width: 480px;
}

.picker-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.picker-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border-radius: calc(var(--radius) - 2px);
}

.picker-pl-title { font-size: 0.9rem; flex: 1; }
.picker-date { font-size: 0.78rem; color: var(--text-muted); }
.picker-added { font-size: 0.82rem; color: var(--success); font-weight: 500; }
.picker-empty { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.picker-new summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--primary);
  padding: 0.3rem 0;
  user-select: none;
}

.picker-new-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.picker-new-input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

.picker-new-input:focus { outline: 2px solid var(--primary); border-color: transparent; }
