:root {
  --bg: #f6f6f4; --surface: #fff; --border: #e3e2de; --text: #1d1d1b; --muted: #74736e;
  --accent: #e0561b; --accent-text: #fff; --ok: #2f7d4f; --warn: #a86b00; --bad: #b3261e;
  --chip: #efeeea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1d1d1b; --border: #2f2e2b; --text: #ecebe6; --muted: #9a9892;
    --accent: #f0743a; --accent-text: #141413; --ok: #6cc08b; --warn: #e0a640; --bad: #f08a80;
    --chip: #2a2927;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
a { color: inherit; }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.login { width: 100%; max-width: 340px; display: grid; gap: 10px; }
.login p { margin: 0; }
input, button { font: inherit; color: inherit; }
input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); }
button:disabled { opacity: .5; cursor: default; }

.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
header .stats { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.stat b { font-variant-numeric: tabular-nums; }
.warnbar { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
nav button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 8px 10px; }
nav button.on { color: var(--text); border-bottom-color: var(--accent); }

.searchrow { display: flex; gap: 8px; }
.results { display: grid; gap: 6px; margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.row + .row { border-top: 1px solid var(--border); border-radius: 0; }
.results .row { border: 1px solid var(--border); border-radius: 10px; }
.cover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--chip); flex: none; }
.cover.round { border-radius: 50%; }
.grow { flex: 1; min-width: 0; }
.grow .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--chip); color: var(--muted); }
.st-done { color: var(--ok); } .st-failed, .st-nospace { color: var(--bad); }
.st-queued, .st-downloading, .st-waiting { color: var(--warn); }
.list { padding: 4px 6px; }
.releases { padding: 0 0 8px 54px; }
.releases .row { padding: 6px 4px; }
.releases .cover { width: 34px; height: 34px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
label.inline input { width: auto; }
pre.log { white-space: pre-wrap; font-size: 12px; background: var(--bg); padding: 8px; border-radius: 8px; max-height: 240px; overflow: auto; margin: 4px 0 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
@media (max-width: 600px) {
  .row { flex-wrap: wrap; }
  .actions { width: 100%; justify-content: flex-start; padding-left: 54px; }
  .releases { padding-left: 0; }
}
