:root {
  --bg: #121110;
  --panel: #1a1917;
  --panel-2: #211f1c;
  --line: #2e2b27;
  --text: #ebe6dc;
  --muted: #8c867a;
  --accent: #e8501c;
  --accent-soft: rgba(232, 80, 28, .14);
  --ok: #7fb069;
  --warn: #e0a83a;
  --bad: #d8584b;
  --radius: 6px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #fff; }
code { font: 13px var(--mono); background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 30px; letter-spacing: -.01em; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
h3 { font-size: 15px; margin-top: 1.4em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.mark { font: 600 15px var(--mono); text-decoration: none; display: flex; align-items: center; gap: 9px; letter-spacing: .02em; }
.mark .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar nav { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }

.foot { margin-top: auto; display: flex; justify-content: space-between; padding: 18px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }

/* buttons + inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--radius); padding: 9px 16px; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.link.danger:hover { color: var(--bad); }

input, select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 8px 10px; font: 14px var(--sans); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[readonly] { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.field { display: block; font-size: 13px; color: var(--muted); margin: 10px 0; }
.field input, .field select { margin-top: 4px; color: var(--text); }
.field.inline { display: flex; align-items: center; gap: 6px; }
.field.inline input { margin: 0; }
.prefix { font-family: var(--mono); color: var(--text); margin-left: 6px; }
.short { width: 120px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.copyrow { display: flex; gap: 6px; margin-top: 4px; }
.copyrow input { margin: 0; }

/* home */
.home { max-width: 1040px; margin: 0 auto; padding: 56px 28px; width: 100%; }
.hero { max-width: 660px; margin-bottom: 56px; }
.hero h1 { font-size: 46px; margin-bottom: 16px; }
.kicker { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 10px; }
.lede { font-size: 17px; color: #cfc9bd; }
.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; border-top: 1px solid var(--line); padding-top: 28px; }
.cols h3 { margin-top: 0; }
ul.plain { padding-left: 18px; margin: 0; color: #cfc9bd; font-size: 14px; }
ul.plain li { margin-bottom: 6px; }
.notice { background: var(--accent-soft); border: 1px solid rgba(232, 80, 28, .4); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 32px; }

.narrow { max-width: 760px; margin: 0 auto; padding: 48px 28px; width: 100%; }
.docs h2 { margin-top: 2em; }
.docs p { color: #cfc9bd; }
table.cmds { border-collapse: collapse; width: 100%; font-size: 14px; }
table.cmds td { border-top: 1px solid var(--line); padding: 10px 12px 10px 0; vertical-align: top; color: #cfc9bd; }
table.cmds td:first-child { white-space: nowrap; width: 1%; }

/* dashboard */
.dash { max-width: 1240px; margin: 0 auto; padding: 28px; width: 100%; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.who { display: flex; gap: 14px; align-items: center; }
.who img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); }
.who h1 { margin: 0; font-size: 24px; }
.who select { width: auto; padding: 2px 6px; font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 10px; }

.switch { display: inline-flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 9px 14px; font: 600 14px var(--sans); cursor: pointer; }
.switch .lamp { width: 10px; height: 10px; border-radius: 50%; background: #4a463f; }
.switch[aria-pressed="true"] { border-color: rgba(127, 176, 105, .5); }
.switch[aria-pressed="true"] .lamp { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.count { font-family: var(--mono); color: var(--accent); margin-left: 4px; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0 2px; }

.flash { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--ok); padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90vw; font-size: 14px; }
.flash.error { border-left-color: var(--bad); }

.note { font-size: 14px; border-left: 4px solid var(--warn); }
.note.error { border-left-color: var(--bad); }

.now { display: flex; gap: 16px; align-items: center; padding: 14px; }
.now .art { width: 84px; height: 84px; border-radius: 4px; object-fit: cover; background: var(--panel-2); flex: none; }
.np-text { flex: 1; min-width: 0; }
.now .label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.np-title { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s linear; }
.now.paused .bar span { background: var(--muted); }

.add { display: flex; gap: 8px; margin-bottom: 16px; }

ol.queue { list-style: none; padding: 0; margin: 4px 0 0; }
ol.queue li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
ol.queue li:first-child { border-top: 0; }
ol.queue .num { font: 500 13px var(--mono); color: var(--muted); width: 22px; text-align: right; flex: none; }
ol.queue img, ol.queue .noart { width: 42px; height: 42px; border-radius: 3px; object-fit: cover; flex: none; background: var(--panel-2); }
ol.queue .meta { flex: 1; min-width: 0; }
ol.queue .t { font-weight: 600; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ol.queue a.t:hover { text-decoration: underline; }
ol.queue .a, ol.queue .w { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ol.queue .w { font-size: 12px; }
.history .num { display: none; }

.acts { display: flex; gap: 4px; align-items: center; flex: none; }
.acts > button:not(.btn) { background: transparent; border: 1px solid transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.acts > button:not(.btn):hover { border-color: var(--line); color: var(--text); }
.acts > button[data-act="remove"]:hover { color: var(--bad); }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; color: var(--muted); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { color: var(--text); background: var(--panel-2); }
.more > div { position: absolute; right: 0; top: 30px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; z-index: 5; min-width: 150px; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.more > div button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 7px 10px; font: 13px var(--sans); cursor: pointer; border-radius: 4px; }
.more > div button:hover { background: var(--accent-soft); }

.pill { display: inline-block; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line); color: var(--muted); border-radius: 3px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.pill.hot { border-color: rgba(232, 80, 28, .5); color: var(--accent); }
.status { font-family: var(--mono); }
.s-played { color: var(--ok); }
.s-removed, .s-rejected, .s-missed { color: var(--bad); }

.checklist { list-style: none; padding: 0; margin: 0 0 10px; font-size: 14px; }
.checklist li { padding: 5px 0 5px 24px; position: relative; }
.checklist li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 10px; height: 10px; border-radius: 50%; }
.checklist li.ok::before { background: var(--ok); }
.checklist li.no::before { background: transparent; border: 2px solid var(--warn); width: 6px; height: 6px; }

.blockform { display: flex; gap: 6px; margin-bottom: 10px; }
.blockform select { width: 110px; flex: none; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 4px 3px 8px; font-size: 13px; max-width: 100%; }
.tags .k { font: 500 10px var(--mono); text-transform: uppercase; color: var(--muted); }
.tags button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 4px; }
.tags button:hover { color: var(--bad); }

.ownapp { margin-top: 12px; font-size: 14px; }
.ownapp summary { cursor: pointer; color: var(--muted); }
.ownapp form { display: grid; gap: 6px; }

.pubq h1 { font-size: 34px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .topbar, .foot { padding-left: 16px; padding-right: 16px; }
  .dash { padding: 16px; }
}
