:root {
  --bg: #121212; --panel: #1c1c1c; --panel2: #262626; --line: #333; --text: #f2f2f2; --muted: #a7a7a7;
  --accent: #1ed760; --accent-ink: #0b0b0b; --keep: #1ed760; --maybe: #f5c542; --cut: #ff5c5c; --warn: #f5a742;
  --radius: 14px; --bar-h: 76px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f6f4; --panel: #fff; --panel2: #efefec; --line: #ddd; --text: #151515; --muted: #666;
  --accent: #128a3e; --accent-ink: #fff; --keep: #128a3e; --maybe: #a87800; --cut: #c62828; --warn: #a85d00;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6f4; --panel: #fff; --panel2: #efefec; --line: #ddd; --text: #151515; --muted: #666;
    --accent: #128a3e; --accent-ink: #fff; --keep: #128a3e; --maybe: #a87800; --cut: #c62828; --warn: #a85d00;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 16px); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.who { color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.who button { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 4px; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }

.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 10px 16px; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); }
.err { color: var(--cut); }
.center { text-align: center; padding: 48px 16px; }

/* list */
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plist a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); text-decoration: none; }
.plist a:active { background: var(--panel2); }
.plist .name { font-weight: 650; font-size: 18px; }
.plist .meta { color: var(--muted); font-size: 14px; }

/* playlist */
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.phead h1 { font-size: 22px; margin: 0; flex: 1 1 220px; }
.progress { font-size: 14px; color: var(--muted); }
.layout { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .now { position: sticky; top: 72px; max-height: calc(100vh - 160px); overflow: auto; }
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.now .sec { color: var(--accent); font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.now .track { display: flex; gap: 14px; align-items: center; margin: 8px 0 10px; }
.now img.art { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; background: var(--panel2); flex: none; }
.now .title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.now .artist { color: var(--muted); }
.why { background: var(--panel2); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.why b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 2px; }
.flag { border: 1px solid var(--warn); border-radius: 10px; padding: 10px 12px; margin: 10px 0; color: var(--text); }
.flag .t { color: var(--warn); font-weight: 650; }
.flag .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.flag input { flex: 1 1 200px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 6px 10px; }

.player { margin: 12px 0; }
.player .modes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.player .modes button { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 5px 11px; min-height: 34px; }
.player .modes button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.player .hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.player select { min-height: 38px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); padding: 4px 8px; max-width: 100%; }
.seek { width: 100%; accent-color: var(--accent); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.embed iframe { width: 100%; border: 0; border-radius: 12px; }

.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.verdicts button { min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); font-weight: 700; font-size: 17px; }
.verdicts button kbd, .bar kbd { font: 11px ui-monospace, monospace; opacity: .6; margin-left: 4px; border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; }
.verdicts .keep[aria-pressed="true"] { background: var(--keep); border-color: var(--keep); color: #0b0b0b; }
.verdicts .maybe[aria-pressed="true"] { background: var(--maybe); border-color: var(--maybe); color: #0b0b0b; }
.verdicts .cut[aria-pressed="true"] { background: var(--cut); border-color: var(--cut); color: #0b0b0b; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tags button { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 7px 12px; min-height: 38px; font-size: 14px; }
.tags button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
textarea { width: 100%; min-height: 84px; resize: vertical; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; font-size: 16px; }
label.lbl { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }
.save { font-size: 13px; color: var(--muted); min-height: 1.4em; margin-top: 4px; }
.save.bad { color: var(--warn); }
.hist { font-size: 14px; color: var(--muted); margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.hist div { margin: 2px 0; }

.queue h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 18px 0 6px; }
.queue h3:first-child { margin-top: 0; }
.queue ol { list-style: none; margin: 0; padding: 0; }
.queue li button { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 8px; min-height: 48px; }
.queue li button:hover { background: var(--panel2); }
.queue li.cur button { background: var(--panel2); outline: 1px solid var(--accent); }
.queue .n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.queue .tt { overflow: hidden; }
.queue .tt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .tt .a { color: var(--muted); font-size: 14px; }
.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.pill.keep { background: var(--keep); color: #0b0b0b; }
.pill.maybe { background: var(--maybe); color: #0b0b0b; }
.pill.cut { background: var(--cut); color: #0b0b0b; }
.pill.warn { border: 1px solid var(--warn); color: var(--warn); }
.overall { margin-top: 16px; }
.overall h2 { font-size: 17px; margin: 0 0 8px; }
.overall .prev { font-size: 14px; color: var(--muted); white-space: pre-wrap; border-left: 3px solid var(--line); padding-left: 10px; margin: 8px 0; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; justify-content: center; align-items: center; }
.bar button { min-width: 48px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-size: 18px; }
.bar .play { background: var(--accent); color: var(--accent-ink); border-color: transparent; min-width: 60px; }
.bar .v { font-size: 15px; font-weight: 700; padding: 0 10px; }
.bar .v.on.keep { background: var(--keep); color: #0b0b0b; }
.bar .v.on.maybe { background: var(--maybe); color: #0b0b0b; }
.bar .v.on.cut { background: var(--cut); color: #0b0b0b; }
.bar .sep { width: 1px; height: 32px; background: var(--line); margin: 0 2px; }
@media (max-width: 380px) { .bar kbd { display: none; } .bar button { min-width: 44px; } }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; display: grid; place-items: center; padding: 16px; }
.modal .card { width: min(460px, 100%); }
.modal h2 { margin: 0 0 8px; font-size: 19px; }
.modal input[type=text] { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 8px 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.check input { width: 20px; height: 20px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 20px + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 30; max-width: calc(100% - 32px); font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
