/* Theme Colors */
:root {
  --brand-dark: #2C0011;
  --brand-light: #F0E4DC;
  --brand-accent: #FD3C02;
  --text: #2b2b2b;
  --muted: #6e6e6e;
  --card-bg: #ffffff;
  --shadow: 0 4px 16px rgba(44, 0, 17, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.theme { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; color: var(--text); background: var(--brand-light); }

.container { width: min(960px, 92%); margin-inline: auto; }

.header { background: var(--brand-dark); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand a { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand a:visited { color: inherit; }
.brand a:hover { text-decoration: none; }
.brand-title { margin: 0; font-size: 1.25rem; }
.brand-sub { margin: 0; font-size: .875rem; opacity: .8; }
.logo { width: 44px; height: 44px; object-fit: contain; display: block; }
.dj-link { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.35); padding: 8px 12px; border-radius: 8px; }
.dj-link:hover { background: rgba(255,255,255,.08); }

/* Make header buttons visible on dark background */
.header .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.header .btn.ghost:hover { background: rgba(255,255,255,.08); }

.hero { background: linear-gradient(180deg, rgba(44,0,17,.12), transparent); padding: 16px 0 8px; }
.cover { display: block; width: 100%; border-radius: 16px; border: 2px solid rgba(44,0,17,.12); box-shadow: var(--shadow); background: #fff; }

.card { background: var(--card-bg); border-radius: 16px; padding: 18px; margin: 18px 0; box-shadow: var(--shadow); border: 1px solid rgba(44,0,17,.08); }
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 12px 12px; border: 1.5px solid rgba(44,0,17,.25); border-radius: 10px; font-size: 1rem; background: #fff; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 4px rgba(253,60,2,.12); }

.actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.btn { appearance: none; border: none; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none; line-height: 1; font-size: 1rem; vertical-align: middle; }
.btn:visited { text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--brand-accent); color: #fff; }
.btn.primary:hover { filter: brightness(0.98); }
.btn.ghost { background: transparent; color: var(--brand-dark); border: 1.5px solid rgba(44,0,17,.35); }
.btn.ghost:hover { background: rgba(44,0,17,.06); }

.status { min-height: 1.2em; margin: 6px 0 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.list { display: grid; gap: 12px; }
.item { border: 1px solid rgba(44,0,17,.15); border-radius: 12px; padding: 12px; background: #fff; display: grid; gap: 6px; }
.item-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.title { font-weight: 700; }
.meta { color: var(--muted); font-size: .9rem; }
.badges { display: flex; align-items: center; gap: 6px; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: .75rem; background: rgba(44,0,17,.08); color: var(--brand-dark); }
.badge.played { background: rgba(44,0,17,.12); }
.item-actions { display: flex; gap: 8px; }

.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dash-controls { display: flex; align-items: center; gap: 10px; }

.footer { text-align: center; padding: 16px; }

/* Accessible toggle */
.switch { display: inline-flex; align-items: center; gap: 8px; }
.switch input { transform: scale(1.1); }

/* Modal */
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.modal { width: min(520px, 92%); background: #fff; color: var(--text); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid rgba(44,0,17,.12); }
.modal header { padding: 14px 16px; border-bottom: 1px solid rgba(44,0,17,.12); display: flex; align-items: center; justify-content: space-between; }
.modal header h3 { margin: 0; font-size: 1.1rem; }
.modal .modal-body { padding: 14px 16px; display: grid; gap: 10px; }
.modal .modal-actions { padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid rgba(44,0,17,.12); }
.modal .preview { width: 240px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(44,0,17,.15); justify-self: start; }
.modal .note { font-size: .9rem; color: var(--muted); }

/* Settings page layout */
.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } }
.subheading { margin: 6px 0 2px; font-weight: 700; font-size: .95rem; }
.hint { font-size: .9rem; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.row.stretch > * { flex: 1 1 0; }
.preview-chip { width: 240px; height: 96px; object-fit: cover; border: 1px solid rgba(44,0,17,.15); border-radius: 10px; background: #fff; }
.logo-chip { width: 88px; height: 88px; object-fit: contain; border: 1px solid rgba(44,0,17,.15); border-radius: 10px; background: #fff; }
.color-chip { display: inline-block; width: 28px; height: 24px; border-radius: 6px; border: 1px solid rgba(44,0,17,.2); vertical-align: middle; }
.hex-badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1.5px solid rgba(44,0,17,.25); border-radius: 8px; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; min-width: 96px; }

/* Theme demo preview */
.theme-demo { border: 1px solid rgba(44,0,17,.12); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--brand-light); }
.theme-demo .demo-header { background: var(--brand-dark); color: #fff; padding: 10px 12px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.theme-demo .demo-body { padding: 12px; display: flex; gap: 8px; align-items: center; }

/* Embed mode: hide header when used inside an iframe via ?embed=1 */
body.embed .header { display: none !important; }
