@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* ─────────────────────────── BASE ─────────────────────────── */
:root {
  --primary: #1d1d1f;
  --primary-hover: #434344;
  --apple-gray: #F5F5F7;
  --apple-border: #E5E5E7;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --success: #22c55e;
  --apple-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
  --apple-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

* {
  box-sizing: border-box;
}

.material-symbols-outlined {
  font-variation-settings: 'wght' 200, 'opsz' 20 !important;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02", "cv01", "cv02";
}

/* ─────────────────────── SCROLLBAR ─────────────────────── */
/* Global thin, minimal scrollbars */
*::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Firefox thin scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

/* ──────────────────────── LAYOUT ──────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--apple-border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-brand .material-symbols-outlined {
  color: var(--primary);
  font-size: 1.5rem;
}

.app-brand span {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

@media (max-width: 999px) {
  .app-brand span {
    display: none;
  }
}

.app-nav {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-left: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  height: 3.5rem;
  border-bottom: 2px solid transparent;
  padding-top: 2px;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.active {
  color: var(--text-main);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.nav-icon {
  display: none;
  font-size: 1.25rem;
}

.nav-label {
  display: inline;
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  background: var(--apple-gray);
  cursor: pointer;
  transition: all 0.15s;
}

.search-trigger:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.search-trigger-icon {
  font-size: 1rem;
  color: #94a3b8;
}

.search-trigger-text {
  font-size: 0.8125rem;
  color: #94a3b8;
  white-space: nowrap;
}

.search-trigger-kbd {
  display: flex;
  gap: 0.125rem;
  margin-left: 1rem;
}

/* ───── COMMAND PALETTE ───── */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(2px);
  z-index: 900;
}

.cmd-palette {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 40rem;
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 901;
  animation: cmd-enter 0.15s ease-out;
}

@keyframes cmd-enter {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.97) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.cmd-search-icon {
  font-size: 1.25rem;
  color: #94a3b8;
}

.cmd-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.0625rem;
  color: var(--text-main);
  font-family: inherit;
}

.cmd-input::placeholder {
  color: #94a3b8;
}

.cmd-results {
  max-height: 30rem;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.cmd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: #94a3b8;
  font-size: 0.8125rem;
}

.cmd-category-label {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.1s;
}

.cmd-item:hover {
  background: #f8fafc;
}

.cmd-item-active {
  background: rgba(22, 67, 156, 0.04) !important;
  border-left: 2px solid var(--primary);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cmd-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
}

.cmd-icon .material-symbols-outlined {
  font-size: 1.125rem;
}

.cmd-icon-song {
  background: rgba(22, 67, 156, 0.08);
  color: var(--primary);
}

.cmd-icon-action {
  background: rgba(22, 67, 156, 0.08);
  color: var(--primary);
}

.cmd-item-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
}

.cmd-item-title-action {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  line-height: 1.3;
}

.cmd-item-sub {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.3;
}

.cmd-item-action {
  color: var(--primary);
}

.cmd-item-hint {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
  flex-shrink: 0;
}

.cmd-item-shortcut {
  display: flex;
  gap: 0.125rem;
  flex-shrink: 0;
}

.cmd-kbd {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
}

.cmd-kbd-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  line-height: 1;
}

.cmd-kbd-xs {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.25rem;
  border-radius: 0.1875rem;
  background: #e2e8f0;
  font-size: 0.5625rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  line-height: 1;
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  font-size: 0.6875rem;
  color: #94a3b8;
  font-weight: 500;
}

.cmd-footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cmd-footer-hint {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cmd-footer-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cmd-footer-brand {
  font-weight: 700;
  color: #64748b;
}

.app-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid var(--apple-border);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  overflow: hidden;
}

.app-main {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.5rem;
}

/* Full-bleed pages (editor, reading) negate app-main padding */
.page-flush {
  margin: -1rem -1.5rem;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2rem;
  padding: 0 1.5rem;
  border-top: 1px solid var(--apple-border);
  background: #fff;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
  z-index: 50;
  position: relative;
}

.status-dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--success);
  margin-right: 0.25rem;
}

/* ──────────────────── BUTTONS ──────────────────── */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-danger,
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  padding: 0.5rem 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-0.5px);
}

.btn-outline {
  background: #fff;
  border-color: var(--apple-border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.btn-secondary {
  background: #fff;
  border-color: var(--apple-border);
  color: var(--text-main);
  box-shadow: var(--apple-shadow);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: var(--apple-shadow-hover);
}

.btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
}

.btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #171717;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-dark:hover {
  background: #262626;
}

/* ──────────────── FORM CONTROLS ──────────────── */
.input-field {
  width: 100%;
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text-main);
  padding: 0.375rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  transition: border-color 0.15s;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(19, 91, 236, 0.1);
}

.input-file {
  width: 100%;
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  padding: 0.375rem;
  font: inherit;
  font-size: 0.8125rem;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ──────────────── PANELS & CARDS ──────────────── */
.panel {
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.card-setlist {
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.3s;
}

.card-setlist:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.bullet-divider {
  display: inline-block;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: #cbd5e1;
}

.btn-icon-danger {
  padding: 0.5rem;
  color: var(--text-muted);
  border-radius: 0.5rem;
  transition: all 0.2s;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-icon-danger:hover {
  color: var(--danger);
  background: #fef2f2;
}

.card-dashed-new {
  border: 2px dashed var(--apple-border);
  border-radius: 0.75rem;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.card-dashed-new:hover {
  border-color: #cbd5e1;
}

.card-dashed-new .icon-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--apple-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.card-dashed-new .title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.card-dashed-new .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0 0;
}

.dashboard-card {
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  padding: 0.875rem;
}

.dashboard-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dashboard-value {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ──────── DASHBOARD LAYOUT ──────── */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 3rem;
}

.dashboard-header {
  margin-bottom: 0;
}

.dashboard-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0;
}

/* ──────── HERO GRID ──────── */
.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--apple-border);
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .dashboard-hero-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hero-card {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-main);
  border-bottom: 1px solid var(--apple-border);
}

@media (min-width: 768px) {
  .hero-card {
    border-bottom: none;
    border-right: 1px solid var(--apple-border);
  }

  .hero-card:last-child {
    border-right: none;
  }
}

.hero-card:hover {
  background: #fafafa;
}

.hero-icon-wrap {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--apple-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: transform 0.2s;
}

.hero-icon-wrap .material-symbols-outlined {
  font-size: 1.25rem;
}

.hero-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
}

.hero-actions-bottom {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.hero-btn {
  border-radius: 9999px;
  font-size: 0.875rem;
}

.hero-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  transition: color 0.15s;
}

.hero-link:hover {
  color: var(--text-main);
}

/* ──────── PANELS AREA ──────── */
.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .dashboard-panels {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.panel-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.panel-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

/* ──────── NEXT SERVICE PLAN ──────── */
.panel-box {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--apple-border);
}

.next-set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.next-set-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.next-set-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.next-set-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-icon:hover {
  background: var(--apple-gray);
  color: var(--text-main);
}

.next-set-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.next-set-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.next-set-item:hover {
  background: #fafafa;
  border-color: var(--apple-border);
}

.next-set-index {
  width: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
}

.next-set-item-body {
  flex: 1;
}

.next-set-item-body .title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.next-set-item-body .artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.25rem 0 0 0;
}

.key-badge {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--apple-gray);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.arrow-icon {
  color: #d1d5db;
  transition: all 0.2s;
}

.panel-empty {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ──────── RECENTLY ADDED ──────── */
.recent-songs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-song-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.recent-song-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.song-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--apple-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.song-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.song-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.125rem 0 0 0;
}

.recent-song-info h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.recent-song-info p {
  margin: 0.25rem 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.recent-song-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recent-song-key {
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--apple-gray);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid var(--apple-border);
}

.nav-icon {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ──────────────── TABLE/GRID ──────────────── */
.table-shell {
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.table-head {
  display: grid;
  grid-template-columns: 2rem 1fr 7.5rem 5rem 5rem 2.5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--apple-border);
  background: rgba(245, 245, 247, 0.5);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #94a3b8;
}

.table-row {
  display: grid;
  grid-template-columns: 2rem 1fr 7.5rem 5rem 5rem 2.5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--apple-border);
  transition: background 0.1s;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background: var(--apple-gray);
}

.table-row .drag-handle {
  color: #d4d4d4;
  cursor: grab;
  transition: color 0.15s;
}

.table-row:hover .drag-handle {
  color: #94a3b8;
}

.table-row .song-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  text-decoration: none;
}

.table-row .song-artist {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  min-width: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--apple-border);
  border-radius: 0.25rem;
  background: var(--apple-gray);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-main);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.15s;
}

.table-row:hover .row-actions {
  opacity: 1;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-button:hover {
  color: var(--text-main);
  background: var(--apple-gray);
}

/* ──────────────── ALERTS ──────────────── */
.alert-error {
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  color: var(--danger);
  font-size: 0.8125rem;
}

.alert-info {
  border: 1px solid rgba(19, 91, 236, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(19, 91, 236, 0.05);
  color: var(--primary);
  font-size: 0.8125rem;
}

/* ──────────────── CHORD SHEET ──────────────── */
.chord-sheet {
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.25;
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
}

.chord-blue {
  color: #3062d2;
  background: #eff3ff;
  border-radius: 0.25rem;
  padding: 0.0625rem 0.25rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.chord-paren {
  color: #a16207;
  font-weight: 600;
  font-size: 0.6875rem;
  font-style: italic;
}

/* Spin animation for loading spinners */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ─────────── SETLIST EDITOR LAYOUT ─────────── */
.setlist-workspace {
  display: grid;
  grid-template-columns: 1fr 20rem;
  min-height: calc(100vh - 7.5rem);
}

.setlist-main-panel {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.setlist-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.setlist-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .setlist-header {
    flex-direction: column;
    align-items: stretch;
  }
}


.set-title-input {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0;
  width: 100%;
  max-width: 24rem;
}

.set-title-input:focus {
  outline: none;
}

.set-submeta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.set-date-input {
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text-main);
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-family: inherit;
}

.set-date-input:focus {
  outline: none;
  border-color: var(--primary);
}

.set-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.set-add-inline {
  display: flex;
  gap: 0.375rem;
  flex: 1;
}

@media (max-width: 820px) {
  .set-add-inline {
    width: 100%;
  }

  .set-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .set-header-actions>.btn-primary {
    width: 100%;
    justify-content: center;
  }
}

.set-select {
  width: 14rem;
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--text-main);
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
}

@media (max-width: 820px) {
  .set-select {
    width: auto;
    flex: 1;
    min-width: 0;
    text-overflow: ellipsis;
  }
}

.set-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ──────── SET EDITOR ──────── */
.set-title-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  padding: 0;
  margin-bottom: 0.25rem;
  font-family: inherit;
}

.set-title-input::placeholder {
  color: #cbd5e1;
}

.set-date-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: inherit;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
}

.set-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

.set-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.set-input-sm,
.set-input-key {
  width: 100%;
  border: 1px solid var(--apple-border);
  background: #fff;
  color: var(--text-main);
  border-radius: 0.25rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.75rem;
  font-family: inherit;
}

.set-input-key {
  max-width: 3rem;
  text-align: center;
  font-weight: 700;
}

.set-input-sm:focus,
.set-input-key:focus,
.set-date-input:focus {
  outline: none;
  border-color: var(--primary);
}

.set-icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--apple-border);
  border-radius: 0.25rem;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.15s;
}

.set-icon-button:hover {
  color: var(--text-main);
  border-color: #94a3b8;
}

.setlist-grid-head,
.setlist-row {
  display: grid;
  grid-template-columns: 4.2rem 1fr 7.5rem 4.2rem 4.8rem 2.5rem;
  gap: 0.5rem;
  align-items: center;
}

.setlist-grid-head {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--apple-border);
  background: rgba(245, 245, 247, 0.5);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.setlist-grid-body {
  display: grid;
}

.setlist-row {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--apple-border);
  transition: background 0.1s;
}

.setlist-row:hover {
  background: var(--apple-gray);
}

.setlist-pos-cell {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.setlist-drag {
  color: #d4d4d4;
  cursor: grab;
  font-size: 1rem;
}

.setlist-song-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.setlist-song-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.setlist-song-ref {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
}

.setlist-actions-cell {
  display: flex;
  justify-content: flex-end;
}

.setlist-insert-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  font-style: italic;
  background: rgba(245, 245, 247, 0.3);
}

.setlist-empty {
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.setlist-footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
}

/* ──────── SETLIST SIDE PANEL (Automation Hub) ──────── */
.setlist-side-panel {
  border-left: 1px solid var(--apple-border);
  background: rgba(245, 245, 247, 0.3);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.setlist-side-panel h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.setlist-side-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.automation-block {
  background: #fff;
  border: 1px solid var(--apple-border);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.automation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: #94a3b8;
}

.automation-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
}

.automation-progress-row .progress-pct {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
}

.automation-progress-track {
  height: 0.375rem;
  width: 100%;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--apple-gray);
}

.automation-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  box-shadow: 0 0 6px rgba(19, 91, 236, 0.2);
  transition: width 0.3s;
}

.automation-status,
.automation-link {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.automation-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.automation-toggle input {
  accent-color: var(--primary);
}

.automation-note {
  margin-top: auto;
  border: 1px solid rgba(19, 91, 236, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: rgba(19, 91, 236, 0.03);
}

.automation-note p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  line-height: 1.4;
}

/* ──── SONG EDITOR (IDE-like, monochrome) ──── */
.song-editor-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 5.5rem);
}

@media (max-width: 820px) {
  .song-editor-shell {
    height: calc(100vh - 2rem);
    min-height: 0;
    overflow: hidden;
  }

  .song-editor-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
  }

  .song-meta-strip {
    display: flex !important;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }

  .song-meta-strip label {
    min-width: 5.5rem;
    flex-shrink: 0;
  }

  .song-editor-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .song-editor-body .song-source-pane,
  .song-editor-body .song-preview-pane {
    min-height: 0 !important;
    overflow-y: auto;
  }

  .song-editor-brand .material-symbols-outlined,
  .song-editor-brand .version-label,
  .song-editor-brand .song-divider {
    display: none;
  }

  .song-inline-title {
    width: 7rem;
    font-size: 0.6875rem;
  }

  .song-inline-artist {
    width: 5rem;
    font-size: 0.5625rem;
  }

  .song-transpose-group .label {
    display: none;
  }

  .btn-dark .commit-text {
    display: none;
  }
}

/* Contain horizontal overflow on the preview paper body */
.song-sheet-body {
  flex: 1;
  overflow-x: auto;
}

/* Responsive meta strip */
@media (max-width: 820px) {
  .song-meta-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

.song-editor-topbar {
  height: 2.5rem;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.song-editor-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.song-editor-brand .material-symbols-outlined {
  font-size: 1.125rem;
  color: #a3a3a3;
}

.song-editor-brand .version-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: #737373;
}

.song-divider {
  width: 1px;
  height: 1rem;
  background: #e5e5e5;
}

.song-inline-input {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  min-width: 0;
  padding: 0;
}

.song-inline-input:focus {
  outline: none;
}

.song-inline-title {
  font-weight: 600;
  font-size: 0.75rem;
  width: 12rem;
}

.song-inline-artist {
  font-size: 0.625rem;
  color: #a3a3a3;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  width: 10rem;
}

.song-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.song-editor-fab-container {
  display: none;
}

@media (max-width: 820px) {
  .desktop-only-actions {
    display: none !important;
  }

  .song-editor-fab-container {
    display: block;
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    right: 1.5rem;
    z-index: 100;
  }

  .fab-main-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #171717;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s;
  }

  .fab-main-btn .material-symbols-outlined {
    font-size: 1.5rem;
  }

  .fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
  }

  .fab-menu {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    min-width: 12rem;
    overflow: hidden;
    animation: fab-menu-up 0.2s ease-out;
    padding: 0.5rem 0;
  }

  @keyframes fab-menu-up {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.95);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .fab-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: #262626;
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .fab-menu-item:hover {
    background: #f5f5f5;
  }

  .fab-menu-item .material-symbols-outlined {
    font-size: 1.25rem;
    color: #525252;
  }

  .fab-menu-item.fab-danger {
    color: #ef4444;
  }

  .fab-menu-item.fab-danger .material-symbols-outlined {
    color: #ef4444;
  }

  .fab-menu-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 0.25rem 0;
  }

  .fab-transpose-group {
    padding: 0.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }

  .fab-transpose-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #a3a3a3;
    letter-spacing: 0.05em;
  }

  .fab-transpose-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f4f4f5;
    border-radius: 0.375rem;
    padding: 0.25rem;
  }

  .fab-transpose-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #525252;
    cursor: pointer;
  }

  .fab-transpose-select {
    flex: 1;
    height: 2rem;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    color: #262626;
    cursor: pointer;
  }
}

.song-transpose-group {
  display: flex;
  align-items: center;
  background: #f2f2f2;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  padding: 0.125rem;
}

.song-transpose-group .inner {
  display: flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-right: 1px solid #e5e5e5;
  gap: 0.5rem;
}

.song-transpose-group .label {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #a3a3a3;
}

.song-transpose-select {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.song-transpose-select:focus {
  outline: none;
}

.editor-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #525252;
  cursor: pointer;
  transition: all 0.1s;
}

.editor-icon-btn:hover {
  background: #fff;
}

.editor-icon-btn .material-symbols-outlined {
  font-size: 1rem;
}

.song-editor-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 45% 1fr;
}

/* Source pane */
.song-source-pane {
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
  border-right: 1px solid #e5e5e5;
}

.song-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.song-source-header .file-path {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.625rem;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  color: #a3a3a3;
}

.song-source-header .file-dots {
  display: flex;
  gap: 0.25rem;
}

.song-source-header .file-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #d4d4d4;
}

.song-source-header .file-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.625rem;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  color: #a3a3a3;
}

.song-source-header .live-indicator {
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.song-source-header .live-indicator::before {
  content: '';
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: #22c55e;
}

.song-source-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.song-line-gutter {
  width: 2.5rem;
  background: rgba(242, 242, 242, 0.5);
  border-right: 1px solid #e5e5e5;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.6875rem;
  color: #a3a3a3;
  user-select: none;
  line-height: 1.7;
}

.song-source-text {
  flex: 1;
  padding: 1rem;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  resize: none;
  border: none;
  background: transparent;
  color: #262626;
  tab-size: 4;
}

.song-source-text::placeholder {
  color: #d4d4d4;
}

.song-source-text:focus {
  outline: none;
}

/* Editor syntax tips panel */
.editor-tip-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #a3a3a3;
  padding: 0;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
}

.editor-tip-toggle:hover {
  color: var(--primary);
}

.editor-tips {
  padding: 0.5rem 0.75rem;
  background: #f8f8f8;
  border-bottom: 1px solid #e5e5e5;
}

.editor-tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem 0.75rem;
}

.editor-tip {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 0.5625rem;
  color: #737373;
}

.editor-tip code {
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  padding: 0.0625rem 0.25rem;
  border-radius: 0.125rem;
  white-space: nowrap;
}

.song-source-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 1rem;
  border-top: 1px solid #e5e5e5;
  background: #fff;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.5625rem;
  color: #a3a3a3;
}

.song-source-footer div {
  display: flex;
  gap: 1rem;
}

/* Preview pane */
.song-preview-pane {
  background: #f2f2f2;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.song-sheet-paper {
  width: 100%;
  max-width: 44rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  /* Emulate US Letter page: 8.5 x 11in aspect ratio */
  min-height: 58rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.song-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #171717;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.song-sheet-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.song-sheet-header p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #737373;
}

.song-sheet-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.song-sheet-meta .key-tag {
  display: inline-block;
  background: #171717;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.song-sheet-meta small {
  font-size: 0.625rem;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  color: #a3a3a3;
}

/* Song body content grows to fill available space — now handled by .song-sheet-body above */

/* Inside the preview paper, chord-sheet should not show scrollbar */
.song-sheet-paper .chord-sheet {
  overflow-x: visible;
}

.song-sheet-section {
  margin-bottom: 1rem;
}

.song-sheet-section h3 {
  margin: 0 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a3a3a3;
}

.song-sheet-line {
  margin-bottom: 1.25rem;
}

.song-sheet-chords {
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #171717;
  height: 1rem;
  letter-spacing: 0.02em;
}

.song-sheet-lyrics {
  font-size: 0.9375rem;
  color: #262626;
  line-height: 1.4;
}

/* Chorus border styling */
.song-sheet-section.is-chorus {
  border-left: 2px solid #e5e5e5;
  padding-left: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.song-sheet-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  font-size: 0.5625rem;
  color: #a3a3a3;
  border-top: 1px solid #f2f2f2;
  padding-top: 1rem;
  margin-top: auto;
}

/* Song meta strip below topbar */
.song-meta-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
}

.song-meta-strip label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #737373;
  white-space: nowrap;
}

.song-meta-input {
  min-width: 0;
  width: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  background: #fff;
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  font-family: inherit;
}

.song-meta-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ───── READING MODE ───── */
/* ── Global: no underlines on button-style links ── */
a.btn-primary,
a.btn-dark,
a.btn-outline,
a.editor-icon-btn,
a.reading-exit-button,
a.nav-link,
.app-nav a,
.card-actions a {
  text-decoration: none !important;
}

.reading-shell {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #fff;
}

.reading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--apple-border);
  background: #fff;
  flex-shrink: 0;
}

.reading-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reading-exit-button {
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text-muted);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}

.reading-exit-button:hover {
  color: var(--text-main);
  border-color: #94a3b8;
}

.reading-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--apple-border);
}

.reading-header-left h1 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.reading-header-left p {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.reading-header-meta {
  display: flex;
  gap: 2rem;
}

.reading-header-meta div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.reading-header-meta span {
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 600;
}

.reading-header-meta strong {
  font-size: 0.8125rem;
  font-weight: 700;
}

/* Main reading area */
.reading-main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.reading-chord-sheet {
  width: 100%;
  max-width: 100%;
}

/* Multi-column on wide screens */
.reading-columns {
  column-count: 1;
  column-gap: 2rem;
}

@media (min-width: 1200px) {
  .reading-columns {
    column-count: 2;
  }
}

@media (min-width: 1800px) {
  .reading-columns {
    column-count: 3;
  }
}

/* Font size variants */
.reading-font-sm {
  font-size: 0.85rem;
}

.reading-font-md {
  font-size: 1.275rem;
}

.reading-font-lg {
  font-size: 1.9rem;
}

/* Section container — tight spacing, avoid column breaks */
.reading-section {
  margin-bottom: 0.75rem;
  break-inside: avoid;
}

.reading-section-chorus {
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
}

.reading-section-label {
  font-size: 0.5625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a3a3a3;
  margin: 0 0 0.125rem;
}

.reading-section-chorus .reading-section-label {
  color: var(--primary);
}

/* Chord pre block inside reading — override the generic chord-sheet for tighter reading */
.reading-chord-pre {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  line-height: 1.3 !important;
  font-size: inherit !important;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Toolbar */
.reading-toolbar-wrap {
  padding: 0.5rem 1.5rem;
  border-top: 1px solid var(--apple-border);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.reading-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--apple-gray);
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  padding: 0.375rem 1rem;
}

.reading-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reading-toolbar-group-inline {
  gap: 0.25rem;
}

.reading-toolbar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.reading-toolbar-value {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
  min-width: 2rem;
  text-align: center;
}

.reading-toolbar-divider {
  width: 1px;
  height: 1rem;
  background: var(--apple-border);
}

.reading-range {
  width: 6rem;
  accent-color: var(--primary);
}

.reading-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}

.reading-icon-button:hover {
  background: var(--apple-gray);
}

.reading-flow-button {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.reading-flow-button:hover {
  background: var(--apple-gray);
}

.reading-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 1.5rem;
  border-top: 1px solid var(--apple-border);
  font-size: 0.625rem;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}

.reading-vignette {
  display: none;
}

/* ───── SET READING MODE ───── */
.setread-shell {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #fff;
}

.setread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--apple-border);
  background: #fff;
  flex-shrink: 0;
}

.setread-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.setread-header-left h1 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.setread-header-left p {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.setread-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setread-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--apple-border);
}

.setread-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Minimap (Scrollspy) */
.setread-minimap {
  display: none;
}

@media (min-width: 820px) {
  .setread-minimap {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    width: 280px;
    background: white;
    border: 1px solid var(--apple-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 50;
  }

  .setread-minimap-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #a3a3a3;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
  }

  .setread-minimap-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .setread-minimap-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #262626;
    transition: background-color 0.15s;
  }

  .setread-minimap-item:hover {
    background: #f4f4f5;
  }

  .setread-minimap-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: #737373;
    width: 1.25rem;
  }

  .setread-minimap-song-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .setread-minimap-key {
    font-size: 0.75rem;
    font-weight: 700;
    background: #171717;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
  }
}

/* Song cards */
.setread-song {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--apple-border);
  scroll-margin-top: 5.5rem;
}

.setread-song-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.setread-song-num {
  font-size: 0.625rem;
  font-weight: 800;
  color: #a3a3a3;
  margin-right: 0.5rem;
}

.setread-song-title-wrapper {
  container-type: inline-size;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.setread-song-title {
  font-size: 1rem;
  font-weight: 700;
  display: inline-block;
  animation: marquee-breathe 8s ease-in-out infinite alternate;
}

@keyframes marquee-breathe {

  0%,
  15% {
    transform: translateX(0);
  }

  85%,
  100% {
    transform: translateX(min(0px, calc(100cqw - 100%)));
  }
}

.setread-song-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6875rem;
  color: #a3a3a3;
  font-weight: 500;
}

.setread-key-badge {
  background: var(--primary);
  color: #fff;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
}

/* Song content */
.setread-song-content {
  columns: 2;
  column-gap: 2rem;
}

@media (max-width: 900px) {
  .setread-song-content {
    columns: 1;
  }
}

@media (min-width: 1800px) {
  .setread-song-content {
    columns: 3;
  }
}

.setread-section {
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

.setread-section-chorus {
  border-left: 2px solid var(--primary);
  padding-left: 0.625rem;
}

.setread-section-label {
  display: block;
  font-size: 0.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a3a3a3;
  margin-bottom: 0.125rem;
}

.setread-section-chorus .setread-section-label {
  color: var(--primary);
}

.setread-pre {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  font-size: inherit !important;
  line-height: 1.4 !important;
  overflow: visible !important;
}

/* ───── PRINT SET LAYOUT ───── */
.printset-shell {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.printset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.printset-header h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.printset-header p {
  margin: 0.125rem 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.printset-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Print area on screen — simulate paper */
.printset-area {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem;
  overflow: hidden;
}

/* Set header */
.printset-set-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #171717;
  padding-bottom: 0.375rem;
  margin-bottom: 1rem;
}

.printset-set-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.printset-set-header span {
  font-size: 0.5625rem;
  color: #a3a3a3;
  font-weight: 500;
}

/* Individual song block */
.printset-song {
  margin-bottom: 1.25rem;
  page-break-inside: avoid;
  break-inside: avoid;
}

.printset-song-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0.2rem;
  margin-bottom: 0.375rem;
}

.printset-song-title {
  font-size: 0.8125rem;
  font-weight: 700;
}

.printset-song-meta {
  font-size: 0.5625rem;
  color: #a3a3a3;
  font-weight: 500;
}

/* Song body — full width by default, columns when multi-section */
.printset-song-body.printset-cols {
  columns: 2;
  column-gap: 1.5rem;
}

.printset-section {
  margin-bottom: 0.375rem;
  break-inside: avoid;
}

.printset-section-chorus {
  border-left: 2px solid var(--primary);
  padding-left: 0.5rem;
}

.printset-section-label {
  display: block;
  font-size: 0.4375rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a3a3a3;
  margin-bottom: 0.0625rem;
}

.printset-section-chorus .printset-section-label {
  color: var(--primary);
}

.printset-pre {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  font-size: 0.8125rem !important;
  line-height: 1.35 !important;
  overflow: visible !important;
}

/* ─── CHECKBOX ─── */
.checkbox-field {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

/* ─── RUNNING HEADER (hidden on screen, repeated on every printed page) ─── */
.printset-running-header {
  display: none;
}

/* ─── LANDSCAPE MODE ─── */
.printset-landscape .printset-songs-wrap {
  columns: 2;
  column-gap: 1.5rem;
}

.printset-landscape .printset-song {
  break-inside: avoid;
}

.printset-landscape .printset-song-body.printset-cols {
  columns: 1;
}

/* ───── @MEDIA PRINT ───── */
@media print {
  @page {
    margin: 0.35in 0.4in;
    size: letter;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    font-size: 12px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  .print-area {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .app-shell,
  .app-topbar,
  .app-main {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  /* PrintSet specific */
  .printset-running-header {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.25in 0.4in;
    font-size: 9px;
    color: #999;
    border-bottom: 1px solid #ddd;
    background: #fff;
    z-index: 1000;
  }

  .printset-set-header {
    display: none !important;
  }

  .printset-area {
    max-width: 100% !important;
    padding: 0 !important;
    padding-top: 1.5rem !important;
  }

  .printset-song {
    margin-bottom: 0.75rem !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .printset-section {
    break-inside: avoid;
  }

  .printset-pre {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  .printset-song-body.printset-cols {
    columns: 2 !important;
    column-gap: 1rem !important;
  }

  /* Song editor print */
  .chord-sheet {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    background: transparent !important;
    overflow: visible !important;
    white-space: pre !important;
  }

  .song-editor-shell {
    display: block !important;
  }

  .song-source-pane {
    display: none !important;
  }

  .song-preview-pane {
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  .song-sheet-paper {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    min-height: auto !important;
  }

  .song-sheet-header {
    padding-bottom: 0.25rem !important;
    margin-bottom: 0.375rem !important;
  }

  .song-sheet-section {
    margin-bottom: 0.375rem !important;
  }

  .song-sheet-footer {
    position: static !important;
    margin-top: 0.5rem !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TAILWIND UTILITY CLASSES (inline, no npm required)
   ═══════════════════════════════════════════════════════════════ */

/* ── Display ── */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.grid {
  display: grid;
}

.hidden {
  display: none;
}

.block {
  display: block;
}

/* ── Flex Direction & Wrap ── */
.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1 1 0%;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

/* ── Align / Justify ── */
.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

/* ── Gap ── */
.gap-0\.5 {
  gap: 0.125rem;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-5 {
  gap: 1.25rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* ── Space-Y ── */
.space-y-2>*+* {
  margin-top: 0.5rem;
}

.space-y-3>*+* {
  margin-top: 0.75rem;
}

.space-y-4>*+* {
  margin-top: 1rem;
}

.space-y-5>*+* {
  margin-top: 1.25rem;
}

.space-y-6>*+* {
  margin-top: 1.5rem;
}

.space-y-8>*+* {
  margin-top: 2rem;
}

/* ── Grid Columns ── */
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.col-span-2 {
  grid-column: span 2 / span 2;
}

/* ── Width / Max-Width ── */
.w-full {
  width: 100%;
}

.max-w-sm {
  max-width: 24rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.min-w-0 {
  min-width: 0;
}

/* ── Height ── */
.h-64 {
  height: 16rem;
}

/* ── Position ── */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

/* ── Inset ── */
.top-1\/2 {
  top: 50%;
}

.left-2 {
  left: 0.5rem;
}

.left-2\.5 {
  left: 0.625rem;
}

.-translate-y-1\/2 {
  transform: translateY(-50%);
}

/* ── Margin ── */
.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.mr-1 {
  margin-right: 0.25rem;
}

/* ── Padding ── */
.p-0 {
  padding: 0;
}

.px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.pl-9 {
  padding-left: 2.25rem;
}

.pt-2 {
  padding-top: 0.5rem;
}

/* ── Border ── */
.border {
  border-width: 1px;
  border-style: solid;
  border-color: var(--apple-border);
}

.border-t {
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: var(--apple-border);
}

.border-gray-200 {
  border-color: #e5e7eb;
}

.rounded {
  border-radius: 0.25rem;
}

/* ── Text ── */
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.text-\[9px\] {
  font-size: 9px;
}

.text-\[10px\] {
  font-size: 10px;
}

.text-\[13px\] {
  font-size: 13px;
}

.text-\[18px\] {
  font-size: 18px;
}

.text-center {
  text-align: center;
}

/* ── Font Weight ── */
.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-mono {
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
}

/* ── Letter spacing ── */
.tracking-tight {
  letter-spacing: -0.025em;
}

.tracking-widest {
  letter-spacing: 0.1em;
}

/* ── Text Colors ── */
.text-primary {
  color: var(--primary);
}

.text-slate-300 {
  color: #cbd5e1;
}

.text-slate-400 {
  color: #94a3b8;
}

.text-slate-500 {
  color: #64748b;
}

.text-slate-900 {
  color: #0f172a;
}

.text-gray-400 {
  color: #9ca3af;
}

.text-gray-500 {
  color: #6b7280;
}

.text-red-400 {
  color: #f87171;
}

.text-blue-600 {
  color: #2563eb;
}

.text-system-gray-400 {
  color: #a3a3a3;
}

.text-white {
  color: #fff;
}

/* ── Background ── */
.bg-white {
  color: #0f172a;
  background-color: #fff;
}

.bg-gray-50 {
  background-color: #f9fafb;
}

/* ── Opacity ── */
.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

/* ── Transform ── */
.uppercase {
  text-transform: uppercase;
}

.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Cursor ── */
.cursor-not-allowed {
  cursor: not-allowed;
}

/* ── Transitions ── */
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-duration: 0.15s;
}

.transition-opacity {
  transition-property: opacity;
  transition-duration: 0.15s;
}

/* ── Hover ── */
.hover\:text-blue-600:hover {
  color: #2563eb;
}

.hover\:text-slate-600:hover {
  color: #475569;
}

.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

/* ── Group ── */
.group {
  position: relative;
}

/* ── Misc ── */
.align-middle {
  vertical-align: middle;
}

.overflow-hidden {
  overflow: hidden;
}

/* ── Responsive Breakpoints ── */
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sm\:w-auto {
    width: auto;
  }

  .sm\:mb-0 {
    margin-bottom: 0;
  }

  .sm\:flex-row {
    flex-direction: row;
  }

  .sm\:items-end {
    align-items: flex-end;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lg\:col-span-1 {
    grid-column: span 1 / span 1;
  }

  .lg\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SONG NORMALIZER WIZARD
   ═══════════════════════════════════════════════════════════════ */
.normalizer-shell {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.normalizer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.normalizer-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.normalizer-header p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.normalizer-actions {
  display: flex;
  gap: 0.5rem;
}

.normalizer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 0.75rem;
}

.normalizer-empty h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.normalizer-empty p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 28rem;
}

/* Summary bar */
.normalizer-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.normalizer-stat {
  display: flex;
  flex-direction: column;
}

.normalizer-stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Menlo', 'SF Mono', 'Monaco', ui-monospace, monospace;
}

.normalizer-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.normalizer-categories {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.normalizer-cat-badge {
  font-size: 0.5625rem;
  padding: 0.2rem 0.5rem;
  background: #f0f0f0;
  border-radius: 0.25rem;
  color: #737373;
  font-weight: 500;
}

.normalizer-cat-badge strong {
  color: var(--text-main);
  margin-left: 0.25rem;
}

/* Card list */
.normalizer-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.normalizer-card {
  border: 1px solid var(--apple-border);
  border-radius: 0.375rem;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s;
}

.normalizer-card:hover {
  border-color: #d4d4d4;
}

.normalizer-card-expanded {
  border-color: var(--primary);
}

.normalizer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  user-select: none;
}

.normalizer-card-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.normalizer-card-info strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.normalizer-card-artist {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.normalizer-card-badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.normalizer-issue-badge {
  font-size: 0.5rem;
  padding: 0.125rem 0.375rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Expanded body */
.normalizer-card-body {
  padding: 0.75rem;
  border-top: 1px solid var(--apple-border);
  background: #fafafa;
}

.normalizer-diff-block {
  margin-bottom: 0.75rem;
}

.normalizer-diff-header {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.375rem;
}

.normalizer-diff-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.normalizer-diff-panel {
  position: relative;
}

.normalizer-diff-label {
  position: absolute;
  top: 0.25rem;
  right: 0.375rem;
  font-size: 0.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.375rem;
  border-radius: 0.25rem;
  z-index: 1;
}

.normalizer-diff-before .normalizer-diff-label {
  background: #fee2e2;
  color: #991b1b;
}

.normalizer-diff-after .normalizer-diff-label {
  background: #dcfce7;
  color: #166534;
}

.normalizer-pre {
  font-size: 0.6875rem !important;
  line-height: 1.3 !important;
  max-height: 12rem;
  overflow-y: auto;
}

.normalizer-card-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--apple-border);
  margin-top: 0.5rem;
}

/* ──────────────── SCRAPED RESULTS (Command Palette) ──────────────── */
.cmd-icon-scraped {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
}

.cmd-item-scraped:hover {
  background: rgba(20, 184, 166, 0.04);
}

.cmd-scrape-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #0d9488;
}

.cmd-scrape-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.375rem;
  border-radius: 9999px;
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cmd-scraping-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: #64748b;
  font-size: 0.8125rem;
}

.cmd-scraping-overlay .material-symbols-outlined {
  font-size: 1.5rem;
  color: #0d9488;
}

/* Side panel toggle for mobile */
.side-panel-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.625rem;
  margin-top: 1rem;
  background: var(--apple-gray);
  border: 1px solid var(--apple-border);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: inherit;
}

.side-panel-toggle:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.side-panel-toggle .material-symbols-outlined {
  font-size: 1.125rem;
  transition: transform 0.2s;
}

.side-panel-toggle.expanded .material-symbols-outlined {
  transform: rotate(180deg);
}

/* ──────────────── MOBILE RESPONSIVE STYLES ──────────────── */
@media (max-width: 820px) {

  /* NavMenu Mobile */
  .app-nav {
    gap: 1rem;
  }

  .nav-label {
    display: none;
  }

  .nav-icon {
    display: inline-block;
  }

  /* 1. Tabular Lists Horizontal Scroll */
  .table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-head,
  .table-row {
    min-width: 600px;
  }

  /* 2. Side Panels / Workspace Stacking */
  .setlist-workspace {
    display: flex;
    flex-direction: column;
  }

  .setlist-main-panel {
    padding: 1rem;
    overflow-y: visible;
  }

  .setlist-side-panel {
    border-left: none;
    border-top: 1px solid var(--apple-border);
    padding: 1rem;
    margin-top: 0;
  }

  /* Collapsible side panel on mobile */
  .side-panel-toggle {
    display: flex;
  }

  .setlist-side-panel.collapsed-mobile {
    display: none;
  }

  .setlist-side-panel.expanded-mobile {
    display: flex;
  }

  /* 3. Song Editor Mobile Layout */
  .song-editor-body {
    display: flex;
    flex-direction: column;
  }

  /* 4. Tab Support via Conditional Classes */
  .song-editor-body.mobile-view-editor .song-preview-pane {
    display: none !important;
  }

  .song-editor-body.mobile-view-preview .song-source-pane {
    display: none !important;
  }

  .song-editor-body .song-source-pane,
  .song-editor-body .song-preview-pane {
    flex: 1;
    min-height: 0;
  }

  /* Set Editor: table no-wrap + horizontal scroll */
  .setlist-grid-head,
  .setlist-row {
    white-space: nowrap;
  }

  .setlist-grid-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .setlist-actions-cell .flex {
    opacity: 1 !important;
  }

  /* Set Editor: show quick action buttons inline at top on mobile */
  .set-mobile-quick-actions {
    display: flex !important;
    gap: 0.375rem;
    padding: 0.5rem 0;
    overflow-x: auto;
  }

  .set-mobile-quick-actions>a {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
  }

  /* 5. Mobile Tab Toggles */
  .mobile-tab-toggle {
    display: flex !important;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin: 1rem 1rem 0;
  }

  .mobile-tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
  }

  .mobile-tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  /* 6. Top Navigation Bar */
  .app-brand span {
    display: none;
  }

  .search-trigger-kbd {
    display: none;
  }

  .search-trigger {
    flex: 1;
    min-width: 60px;
    max-width: 180px;
  }

  .search-trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-search-trigger {
    margin-left: auto;
  }

  .app-nav {
    margin-left: 0.5rem;
  }
}

@media (max-width: 399px) {
  .search-trigger-text {
    display: none;
  }

  .search-trigger {
    flex: none;
    width: 2.25rem;
    padding: 0 0.5rem;
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .app-nav {
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
  }

  .app-nav::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar WebKit */
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0 0.25rem;
  }

  .app-topbar {
    padding: 0 0.75rem;
  }

  /* 7. Reading Mode */
  .reading-shell {
    padding-bottom: env(safe-area-inset-bottom);
    height: 100dvh;
    max-height: 100dvh;
  }

  .reading-main {
    flex: 1;
    height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .reading-font-sm {
    font-size: 0.785rem;
  }

  .reading-font-md {
    font-size: 0.95rem;
  }

  .reading-font-lg {
    font-size: 1.25rem;
  }

  .reading-toolbar-wrap {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .reading-toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.mobile-tab-toggle {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   SLIDE DESIGNER
═══════════════════════════════════════════════════════════════ */

.sd-shell {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 32px;
  display: flex;
  z-index: 50;
  background: #fff;
}

/* ── Sidebar ── */
.sd-sidebar {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid var(--border);
  background: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.25rem;
}

.sd-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sd-sidebar-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.sd-sidebar-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.sd-section {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sd-label {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sd-toggle-group {
  display: flex;
  background: #f1f5f9;
  border-radius: 0.5rem;
  padding: 3px;
}

.sd-toggle {
  flex: 1;
  text-align: center;
  padding: 0.375rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.sd-toggle.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sd-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.sd-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.sd-color-swatch:hover {
  transform: scale(1.15);
}

.sd-color-swatch.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.sd-color-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  position: relative;
  overflow: hidden;
  color: #94a3b8;
}

.sd-hidden-picker {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.sd-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.sd-field {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sd-field-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

.sd-field input[type="color"] {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  cursor: pointer;
  padding: 2px;
}

.sd-select {
  width: 100%;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #f8fafc;
  color: var(--text);
}

.sd-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sd-range {
  flex: 1;
  height: 4px;
  appearance: none;
  background: #e2e8f0;
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--primary);
}

.sd-range-value {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 32px;
  text-align: right;
}

.sd-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.sd-icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.sd-icon-btn.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

.sd-icon-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.sd-icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.sd-input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #f8fafc;
}

.sd-textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #f8fafc;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.sd-full {
  width: 100%;
  justify-content: center;
}

/* ── Main Area ── */
.sd-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  overflow: hidden;
}

.sd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.sd-toolbar-left,
.sd-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sd-slide-badge {
  font-size: 0.625rem;
  font-weight: 700;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  color: var(--text);
}

.sd-slide-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Preview ── */
.sd-preview-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: auto;
}

.sd-slide-card {
  aspect-ratio: 16 / 9;
  width: 800px;
  min-width: 800px;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  overflow: hidden;
  position: relative;
  transform-origin: center center;
  flex-shrink: 0;
}

.sd-slide-heading {
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  text-transform: uppercase;
  line-height: 1.2;
}

.sd-slide-body {
  line-height: 1.6;
}

.sd-slide-body p {
  margin: 0;
}

/* Corner text */
.sd-corner-bl,
.sd-corner-br {
  position: absolute;
  bottom: 12px;
  font-size: 10px;
  opacity: 0.6;
  letter-spacing: 0.04em;
}

.sd-corner-bl {
  left: 16px;
}

.sd-corner-br {
  right: 16px;
}

/* ── Filmstrip ── */
.sd-filmstrip {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid var(--border);
}

.sd-thumb {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 16 / 9;
  border-radius: 0.375rem;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, opacity 0.15s;
  opacity: 0.6;
  overflow: hidden;
}

.sd-thumb:hover {
  opacity: 1;
}

.sd-thumb.active {
  border-color: var(--primary);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.sd-thumb-num {
  font-size: 0.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}

.sd-thumb-heading {
  font-size: 0.5625rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
}

.sd-thumb-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

.sd-thumb:hover .sd-thumb-delete {
  display: flex;
}

.sd-thumb-add {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  opacity: 1;
  color: #94a3b8;
  gap: 0.25rem;
}

.sd-thumb-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sd-thumb-add .material-symbols-outlined {
  font-size: 20px;
}

.sd-thumb-add-label {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Filmstrip inner replica */
.sd-thumb-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: inherit;
  overflow: hidden;
}

.sd-thumb-slide-heading {
  font-size: 5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2px;
  line-height: 1.2;
  max-height: 16px;
  overflow: hidden;
}

.sd-thumb-slide-body {
  font-size: 4px;
  text-align: center;
  line-height: 1.4;
  overflow: hidden;
  max-height: 40px;
  white-space: pre-line;
}

/* Contenteditable focus */
.sd-slide-heading[contenteditable],
.sd-slide-body[contenteditable] {
  outline: none;
  cursor: text;
  border-radius: 0.25rem;
  transition: box-shadow 0.15s;
}

.sd-slide-heading[contenteditable]:focus,
.sd-slide-body[contenteditable]:focus {
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.sd-slide-heading[contenteditable]:hover,
.sd-slide-body[contenteditable]:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   SETLIST SLIDE STRIP
═══════════════════════════════════════════════════════════════ */

.ss-slide-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0;
}

.ss-slide-card {
  flex-shrink: 0;
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 0.375rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ss-slide-heading {
  font-size: 5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2px;
  line-height: 1.2;
}

.ss-slide-body {
  font-size: 4px;
  text-align: center;
  line-height: 1.4;
  overflow: hidden;
  max-height: 50px;
}

.ss-slide-body p {
  margin: 0;
}

/* ── Mobile-only helpers ── */
.sd-mobile-only {
  display: none;
}

.sd-sidebar-close {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   SLIDE DESIGNER — MOBILE (< 768px)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .sd-mobile-only {
    display: inline-flex;
  }

  .sd-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .sd-sidebar.sd-sidebar-open {
    transform: translateX(0);
  }

  .sd-sidebar-close {
    display: flex;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 10;
    padding: 0.25rem;
  }

  .sd-main {
    width: 100%;
  }

  .sd-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
  }

  .sd-toolbar-left,
  .sd-toolbar-right {
    gap: 0.25rem;
  }

  .sd-toolbar-left .btn-secondary span:last-child,
  .sd-toolbar-right .btn-primary span:last-child {
    display: none;
  }

  .sd-slide-badge {
    font-size: 0.55rem;
    padding: 0.125rem 0.375rem;
  }

  .sd-slide-name {
    display: none;
  }

  .sd-preview-wrap {
    padding: 0.5rem;
    overflow: hidden;
    /* Prevent scrolling if scale makes it wide */
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .sd-slide-card {
    /* Instead of making it 100% width, keep it at its original fixed aspect ratio (800x450)
       but use CSS transform to scale it down proportionally to the screen width. 
       This perfectly scales the actual font size down as well. 
       100vw for screen width. We subtract about 32px for padding. */
    transform: scale(calc((100vw - 32px) / 800)) !important;
    transform-origin: top center;
    margin-bottom: -150px;
    /* Offset the empty space left by the scaled down height */
  }

  .sd-filmstrip {
    padding: 0.375rem 0.5rem;
    gap: 0.375rem;
  }

  .sd-thumb {
    width: 60px;
    height: 34px;
    min-width: 60px;
  }

  .sd-thumb-delete {
    display: flex;
  }

  .sd-thumb-slide-heading {
    font-size: 3.5px;
  }

  .sd-thumb-slide-body {
    font-size: 3px;
  }
}