/* L808S — one stylesheet for the admin and the artist pages. Light / dark follow the device. */
:root {
  --bg: #f6f6f4; --card: #ffffff; --text: #16161a; --muted: #6b6b76; --line: #e4e4e0;
  --accent: #ff5a1f; --accent-ink: #ffffff; --accent-soft: #ffeee6;
  --good: #1f8a4c; --good-soft: #e3f4ea; --warn: #b36b00; --warn-soft: #fff3dc; --bad: #c0352b; --bad-soft: #fde8e6;
  --blue: #2457d6; --blue-soft: #e7eeff; --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f12; --card: #18181d; --text: #ececf1; --muted: #9a9aa6; --line: #2a2a31;
          --accent-soft: #3a1c10; --good-soft: #10291b; --warn-soft: #2e2208; --bad-soft: #321311; --blue-soft: #131d38; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Admin frame */
.topbar { display: flex; align-items: center; gap: 18px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .04em; color: var(--text); font-size: 18px; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a.on, .nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav .badge { margin-left: 4px; }
.topbar .right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
main.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text); font: inherit; }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 14px; }
.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Chips + statuses */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--text); white-space: nowrap; }
.chip.tag { background: var(--blue-soft); color: var(--blue); }
.s-draft { background: var(--line); color: var(--muted); }
.s-sent { background: var(--blue-soft); color: var(--blue); }
.s-opened { background: #efe7ff; color: #6a3fd1; }
.s-listening { background: var(--warn-soft); color: var(--warn); }
.s-interested { background: var(--accent-soft); color: var(--accent); }
.s-placement { background: var(--good-soft); color: var(--good); }
.s-passed { background: var(--bad-soft); color: var(--bad); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }

.pipeline { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.pipeline a { display: block; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); }
.pipeline a:hover { border-color: var(--accent); text-decoration: none; }
.pipeline .n { font-size: 28px; font-weight: 800; }
.notice { padding: 10px 14px; border-radius: 9px; background: var(--good-soft); color: var(--good); margin-bottom: 14px; }
.notice.err { background: var(--bad-soft); color: var(--bad); }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, monospace; font-size: 13px; }
.feed li { padding: 7px 0; border-bottom: 1px solid var(--line); list-style: none; }
.feed { padding: 0; margin: 0; }
.empty { color: var(--muted); padding: 10px 0; }

/* Artist-facing pages */
.public { max-width: 720px; margin: 0 auto; padding: 28px 18px 60px; }
.public .hero { margin-bottom: 22px; }
.public .from { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.public .msg { white-space: pre-line; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.beat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.beat .meta { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.beat iframe { border-radius: 8px; margin-top: 6px; }
.endpage { text-align: center; padding: 80px 20px; }
.login { max-width: 360px; margin: 10vh auto; }

/* Waveform player (player.js) */
.player { margin: 12px 0 6px; }
.pl-row { display: flex; align-items: center; gap: 12px; }
.pl-play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 16px; cursor: pointer; }
.pl-wave { position: relative; flex: 1; min-width: 0; cursor: pointer; touch-action: none; }
.pl-wave canvas { display: block; width: 100%; height: 64px; }
.pl-pins { position: absolute; left: 0; right: 0; top: -4px; height: 0; }
.pl-pin { position: absolute; width: 12px; height: 12px; margin-left: -6px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--blue); border: 2px solid var(--card); padding: 0; cursor: pointer; }
.pl-time { flex: none; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 78px; text-align: right; }
.pl-note { margin-top: 2px; }
.pl-pinbody { margin: 6px 0; padding: 8px 10px; background: var(--blue-soft); color: var(--blue); border-radius: 8px; }
.fb { margin-top: 8px; }
.fb .react.on { border-color: var(--accent); background: var(--accent-soft); }
.pl-msg.ok { color: var(--good); } .pl-msg.err { color: var(--bad); }
.stars label { display: inline; margin: 0; cursor: pointer; }
.stars input { position: absolute; opacity: 0; width: 0; }
.stars span { font-size: 18px; color: var(--line); }
.stars label:has(input:checked) span, .stars label:has(~ label input:checked) span { color: var(--warn); }
section.beat.liked { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 520px) { .pl-time { min-width: 0; } .pl-wave canvas { height: 52px; } }

/* Swipe mode (swipe.js) */
.swipe-entry { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.sw-overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; padding: 16px; }
.sw-top { display: flex; align-items: center; gap: 12px; }
.sw-dots { flex: 1; display: flex; gap: 4px; }
.sw-dots span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.sw-dots span.done { background: var(--accent); opacity: .5; } .sw-dots span.now { background: var(--accent); }
.sw-close { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.sw-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sw-card { position: relative; width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); touch-action: pan-y; user-select: none; }
.sw-card h2 { font-size: 26px; margin: 8px 0 4px; }
.sw-meta { color: var(--muted); margin-bottom: 18px; }
.sw-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.sw-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.sw-hint { position: absolute; top: 16px; padding: 4px 10px; border: 3px solid; border-radius: 8px; font-weight: 800; opacity: 0; }
.sw-hint-yes { right: 16px; color: var(--good); } .sw-hint-no { left: 16px; color: var(--bad); }
.sw-count { color: var(--muted); }
.sw-embed iframe { width: 100%; }
.sw-actions { display: flex; justify-content: center; gap: 28px; padding: 12px 0 8px; }
.sw-actions button { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 26px; cursor: pointer; box-shadow: var(--shadow); }
.sw-no { color: var(--bad); } .sw-yes { color: var(--accent); }

/* Admin: engagement + taste */
.link-controls label.row { margin: 0; font-weight: 500; gap: 4px; }
.taste { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.taste-row { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 8px; font-size: 13px; margin-top: 4px; }
.taste-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taste-track { position: relative; height: 8px; background: var(--line); border-radius: 4px; }
.taste-track::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.taste-track i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.taste-track i.neg { background: var(--bad); }
.taste-n { text-align: right; }
.feed li.unread { background: var(--accent-soft); padding-left: 8px; border-radius: 6px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.board-col.over { border-color: var(--accent); background: var(--accent-soft); }
.board-col h2 { font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.board-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: grab; font-size: 13px; }
.board-card.dragging { opacity: .4; }
.board-card select { margin-top: 6px; font-size: 12px; padding: 4px 6px; }
.snip-editor { position: relative; height: 34px; background: var(--line); border-radius: 6px; cursor: crosshair; touch-action: none; margin: 8px 0; }
.snip-editor .win { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: .45; border-radius: 6px; }

/* Threads (Phase 4) */
.msgs { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; }
.msgline { max-width: 85%; }
.msgline.me { align-self: flex-end; text-align: right; }
.msgline .bubble { display: inline-block; text-align: left; padding: 9px 13px; border-radius: 14px; background: var(--line); white-space: normal; }
.msgline.me .bubble { background: var(--accent); color: var(--accent-ink); }
.label { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.label i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.picker label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 500; cursor: pointer; }
.splits .split-row { display: grid; grid-template-columns: 2fr 1.4fr 90px; gap: 8px; margin-bottom: 8px; }
@media (max-width: 520px) { .splits .split-row { grid-template-columns: 1fr 1fr; } .splits .split-row input[type=number] { grid-column: span 2; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sc-heat { display: flex; height: 14px; margin-top: 6px; border-radius: 4px; overflow: hidden; background: var(--line); }
.sc-heat i { flex: 1; background: #e0242b; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.pct { display: inline-block; min-width: 34px; padding: 0 5px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; text-align: center; }

/* The L808S wordmark (img/logo.png, white on transparent) used as a mask: it takes the text colour, light or dark mode */
.logo { display: inline-block; vertical-align: middle; height: 16px; width: 71px; background: currentColor;
  -webkit-mask: url(/img/logo.png) center / contain no-repeat; mask: url(/img/logo.png) center / contain no-repeat; }
.brand .logo { height: 20px; width: 88px; color: var(--text); }
.from .logo { height: 13px; width: 58px; margin-top: -2px; }
