/* MixtapeMonkey CMS
   One stylesheet for every admin screen. Colours and spacing come from the
   tokens below; light and dark follow the device setting.
   ────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b1c21;
  --muted: #686c78;
  --line: #e3e0d9;
  --line-strong: #cfcbc2;
  --accent: #f24c1a;
  --accent-hover: #d93f10;
  --accent-text: #c2390c;
  --accent-soft: #fdece5;
  --on-accent: #ffffff;
  --ok: #17794a;
  --ok-soft: #e3f4ea;
  --warn: #8a5a00;
  --warn-soft: #fbf0d3;
  --danger: #c0281f;
  --danger-soft: #fbe6e4;
  --info: #23527a;
  --info-soft: #e4eef7;
  --side: #16171c;
  --side-ink: #b9bcc7;
  --side-ink-strong: #ffffff;
  --side-line: #2a2c35;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 20, 25, .06), 0 4px 14px rgba(20, 20, 25, .05);
  --shadow-pop: 0 10px 34px rgba(20, 20, 25, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101115;
    --surface: #1a1b21;
    --surface-2: #20222a;
    --ink: #ececf1;
    --muted: #9da1ae;
    --line: #2c2e38;
    --line-strong: #3d404d;
    --accent: #f55a2b;
    --accent-hover: #ff6d40;
    --accent-text: #ff8a63;
    --accent-soft: #3a1d12;
    --ok: #5fd197;
    --ok-soft: #14301f;
    --warn: #f0c060;
    --warn-soft: #382b0c;
    --danger: #ff7b72;
    --danger-soft: #3b1614;
    --info: #8fc1ee;
    --info-soft: #14283a;
    --side: #0b0c0f;
    --side-line: #1f2128;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-pop: 0 12px 36px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font: 13px var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px !important; min-width: 0 !important; height: 1px !important; padding: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }

/* ── App frame ─────────────────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--side-ink-strong); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--side-ink); }

.nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7b7f8c; padding: 0 10px 4px; }
.nav a, .side-foot a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--side-ink); font-weight: 500; font-size: 14px;
}
.nav a:hover, .side-foot a:hover { background: var(--side-line); color: var(--side-ink-strong); text-decoration: none; }
.nav a.is-active { background: var(--accent); color: #fff; }
.side-foot { border-top: 1px solid var(--side-line); padding-top: 10px; margin-top: 14px; }
.side-scrim { display: none; }

.shell { min-width: 0; display: flex; flex-direction: column; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.btn.nav-toggle { display: none; }

.gsearch {
  position: relative; flex: 1; min-width: 0; max-width: 620px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0 12px; height: 40px; color: var(--muted);
}
.gsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; height: 100%; }
.gsearch input::-webkit-search-cancel-button { display: none; }
.gsearch kbd { font: 12px var(--mono); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; color: var(--muted); }
.gsearch:focus-within kbd { visibility: hidden; }

.gsearch-pop {
  position: absolute; left: 0; right: 0; top: 46px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 6px; max-height: 70vh; overflow-y: auto; color: var(--ink);
}
.gs-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink); }
.gs-item:hover, .gs-item.is-active { background: var(--accent-soft); text-decoration: none; }
.gs-item img, .gs-item .thumb-empty { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex: none; }
.gs-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.gs-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-text span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-all, .gs-none { display: block; padding: 9px 10px; font-size: 13.5px; }
.gs-none { color: var(--muted); }

.menu { position: relative; flex: none; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column;
}
.menu:not([open]) > .menu-pop { display: none; }
.menu-right { margin-left: auto; }
.menu-right .menu-pop { left: auto; right: 0; }
.menu-pop a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; }
.menu-pop a:hover { background: var(--accent-soft); text-decoration: none; }
.account { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.account-name { font-size: 13.5px; font-weight: 600; }

.main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 28px 96px; }

/* ── Page head ─────────────────────────────────────────────────────────── */

.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; overflow-wrap: anywhere; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title a { font-size: 13.5px; font-weight: 500; }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--font); white-space: nowrap; cursor: pointer; flex-shrink: 0;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { color: var(--danger); background: transparent; border-color: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.btn.is-current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.inline-form { display: inline-flex; margin: 0; }

/* ── Cards, flashes, badges ────────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.table-card { padding: 0; overflow: hidden; }

.flash { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; border: 1px solid transparent; }
.flash .icon { margin-top: 2px; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.badge-muted { color: var(--muted); font-weight: 500; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* ── Toolbar (search + filters) ────────────────────────────────────────── */

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); }
.toolbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; height: 100%; }

.input, .select {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 84px; font-family: var(--mono); font-size: 13px; }
.input:focus, .select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar .select { width: auto; max-width: 100%; }
.select.is-set { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.select-sm { height: 30px; width: auto; padding: 0 6px; font-size: 13px; }
.select.is-saved { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.select.is-failed { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ── Tables ────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions-col { width: 1%; }

.cell-main { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-text { min-width: 0; }
.cell-title { font-weight: 600; color: var(--ink); margin-right: 6px; overflow-wrap: anywhere; }
a.cell-title:hover { color: var(--accent-text); }
.cell-sub { font-size: 13px; color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; white-space: nowrap; }

.thumb { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.thumb-round { border-radius: 50%; }
.thumb-wide { width: 72px; height: 44px; }
.thumb-empty { display: grid; place-items: center; color: var(--line-strong); }

.pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; margin-top: 16px; }
.pager-gap { color: var(--muted); padding: 0 4px; }

.empty { text-align: center; padding: 48px 20px; display: grid; justify-items: center; gap: 10px; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; color: var(--line-strong); }
.empty h2 { font-size: 17px; color: var(--ink); }

/* ── Forms ─────────────────────────────────────────────────────────────── */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-grid > .card:only-child { grid-column: 1 / -1; max-width: 720px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; }
.req { color: var(--accent-text); }
.hint { font-size: 12.5px; color: var(--muted); }
.error { font-size: 13px; color: var(--danger); font-weight: 600; }
.has-error .input, .has-error .select { border-color: var(--danger); }

.img-field { display: flex; gap: 14px; align-items: center; }
.img-preview { flex: none; }
.img-current { width: 96px; height: 96px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); display: block; }
span.img-current { display: grid; place-items: center; color: var(--line-strong); }
.img-controls { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
input[type="file"] { font: inherit; font-size: 13.5px; color: var(--muted); width: 100%; min-width: 0; }
input[type="file"]::file-selector-button { font: 600 13px var(--font); height: 32px; padding: 0 12px; margin-right: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }

.yt-field { display: flex; gap: 10px; align-items: center; }
.yt-field .input { flex: 1; font-family: var(--mono); font-size: 13.5px; }
.banner-preview { border-radius: var(--radius-sm); border: 1px solid var(--line); max-height: 140px; object-fit: cover; }

.suggest-wrap { position: relative; }
.suggest-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 4px; max-height: 240px; overflow-y: auto; }
.suggest-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 7px 9px; border-radius: 5px; cursor: pointer; overflow-wrap: anywhere; }
.suggest-item small { color: var(--muted); margin-left: 6px; }
.suggest-item:hover, .suggest-item.is-active { background: var(--accent-soft); }

.savebar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 18px -28px -96px; padding: 12px 28px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.savebar-gap { flex: 1; }
.savebar-main { order: 5; }

/* ── Dashboard ─────────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }

.todo { display: flex; flex-wrap: wrap; gap: 8px; }
.todo a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13.5px; }
.todo a strong { font-variant-numeric: tabular-nums; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.recent { display: grid; gap: 2px; }
.recent a { display: flex; align-items: center; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: var(--ink); }
.recent a:hover { background: var(--surface-2); text-decoration: none; }
.recent .cell-title, .recent .cell-sub { display: block; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile img, .tile .thumb-empty { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.tile-meta span:last-child { color: var(--accent-text); display: inline-flex; gap: 4px; align-items: center; }

/* ── Small standalone forms (admins, upload, account) ──────────────────── */

.stack { display: grid; gap: 14px; }
.narrow { max-width: 460px; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-fields .field { flex: 1 1 200px; }

/* ── Confirm dialog + toasts ───────────────────────────────────────────── */

.confirm { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
.confirm::backdrop { background: rgba(10, 10, 14, .55); }
.confirm h2 { font-size: 18px; margin-bottom: 6px; }
.confirm p { color: var(--muted); overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-pop); }
.toast.is-error { background: var(--danger); color: #fff; }

/* ── Sign-in and error pages ───────────────────────────────────────────── */

body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: 14px; padding: 30px 28px; box-shadow: var(--shadow-pop); display: grid; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { border-radius: 10px; display: block; }
.auth-card h1 { font-size: 22px; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); font-size: 14px; }
.auth-card .btn-primary { width: 100%; height: 42px; }
.auth-card .flash { margin: 0; }

/* ── Small screens ─────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; z-index: 50; width: 264px; transform: translateX(-100%); transition: transform .18s ease; }
  .nav-open .side { transform: none; }
  .nav-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(10, 10, 14, .55); }
  .btn.nav-toggle { display: inline-flex; }
  .top { padding: 10px 16px; }
  .gsearch kbd, .account-name { display: none; }
  .menu-pop { left: auto; right: 0; }
  .account { padding: 4px; }
  .main { padding: 18px 16px 96px; }
  .savebar { margin: 18px -16px -96px; padding: 10px 16px; }
  .form-grid, .cols { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 22px; }
}

@media (max-width: 560px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .menu > .btn-primary span { display: none; }
  .img-field { align-items: flex-start; }
  .savebar .btn-ghost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Artist portal and review queue ────────────────────────────────────── */

.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.nav a.is-active .nav-count { background: #fff; color: var(--accent-text); }
.top-title { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500 !important; font-size: 13.5px !important; line-height: 1.45; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.review-note { display: block; margin-top: 6px; font-weight: 400; color: var(--ink); }
.link-like { color: var(--accent-text); font-weight: 600; cursor: pointer; text-decoration: underline; }
.card-head { display: grid; gap: 4px; margin-bottom: 12px; }
.card-head .card-title { margin-bottom: 0; }

.steps { display: grid; gap: 10px; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.step:hover { border-color: var(--accent); text-decoration: none; }
.step.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line-strong); }
.step.is-done .step-num { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step.is-next .step-num { background: var(--accent); color: #fff; border-color: transparent; }
.step-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.step-text span { color: var(--muted); font-size: 13.5px; }

.songs { margin-top: 16px; }
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.track { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.track.has-error { border-color: var(--danger); }
.track-num { width: 32px; height: 38px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.track-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.track-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.track-meta audio { height: 32px; max-width: 100%; }
.track-actions { display: flex; gap: 2px; }

.dropzone { margin-top: 12px; border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 24px 16px; text-align: center; display: grid; justify-items: center; gap: 6px; color: var(--muted); background: var(--surface); }
.dropzone .icon { width: 28px; height: 28px; color: var(--accent); }
.dropzone p { margin: 0; }
.dropzone strong { color: var(--ink); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-queue { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.upload-item { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.upload-item progress { width: 100%; accent-color: var(--accent); }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { color: var(--muted); white-space: nowrap; }
.upload-item.is-error { grid-template-columns: minmax(0, 1fr) auto; border-color: var(--danger); background: var(--danger-soft); }
.upload-item.is-error .upload-state { color: var(--danger); font-weight: 600; white-space: normal; grid-column: 1; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.detail { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.decision { display: grid; gap: 12px; }
.decision textarea.input { font-family: var(--font); font-size: 14px; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.radio-list input { accent-color: var(--accent); margin-top: 3px; }
.review-cover { width: 100%; max-width: 280px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); background: #000; }

@media (max-width: 720px) {
  .track { grid-template-columns: 26px minmax(0, 1fr); }
  .track-actions { grid-column: 2; }
  .track-fields { grid-template-columns: minmax(0, 1fr); }
  .upload-item { grid-template-columns: minmax(0, 1fr); }
  .detail { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .detail dd { margin-bottom: 8px; }
}
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.review-wide { aspect-ratio: 16 / 9; max-width: 480px; }
.input-inline { width: 110px; display: inline-block; height: 30px; }

/* ── Square image cropper ──────────────────────────────────────────────── */
.cropper { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 16px); overflow: hidden auto; }
.cropper .hint { margin-bottom: 12px; }
.crop-stage { position: relative; width: min(100%, max(200px, calc(100vh - 250px))); margin: 0 auto; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: #111; cursor: grab; touch-action: none; user-select: none; }
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-guide { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); border-radius: inherit; }
.crop-guide.is-round { border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .85); }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.cropper .error { margin-top: 10px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone .card-title { color: var(--danger); }
.side-foot { display: grid; gap: 2px; }
.side-foot a.side-danger { color: #f08b80; }
.side-foot a.side-danger:hover, .side-foot a.side-danger.is-active { background: rgba(240, 90, 80, .14); color: #ffb3ab; }
.cropper.is-wide { width: min(820px, calc(100vw - 32px)); }
.cropper.is-wide .crop-stage { width: 100%; }
.banner-current { display: block; width: 100%; max-width: 640px; aspect-ratio: 900 / 450; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
span.banner-current { display: grid; place-items: center; color: var(--line-strong); }
.img-field-wide { flex-direction: column; align-items: flex-start; }
.img-field-wide .img-preview { width: 100%; }

/* Dashboard: API feeds */
.api-feeds { display: grid; gap: 4px; }
.api-feed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.api-feed:first-of-type { border-top: 0; }
.api-feed-info { display: grid; gap: 1px; min-width: 0; }
.api-feed-info span { font-size: 13px; color: var(--muted); }
.api-feed-url { display: flex; gap: 6px; align-items: center; min-width: 0; }
.api-feed-url .input { flex: 1; min-width: 0; height: 32px; font: 12.5px var(--mono); }
@media (max-width: 760px) { .api-feed { grid-template-columns: minmax(0, 1fr); } }
