:root {
  --bg: #0f1115; --panel: #1a1a2e; --field: #0d1117; --border: #2a2d3a;
  --text: #e0e0e0; --muted: #8b90a0; --accent: #4f8cff; --ok: #3ddc84; --warn: #f5b942; --bad: #ff5c5c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100vh; }
header { padding: 14px 20px 6px; }
h1 { margin: 0; font-size: 22px; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
.tag { margin: 2px 0 0; color: var(--muted); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
a { color: var(--accent); }
.banner { margin: 10px 20px; padding: 12px 14px; border-radius: 8px; background: #2a2340; border: 1px solid #5a4a8a; }
.banner.warn { background: #3a2f1a; border-color: #8a6a2a; }
.banner.bad { background: #3a1a1a; border-color: #8a2a2a; }
.banner .bar { height: 6px; background: var(--field); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.banner .bar div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
main { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 8px 20px 16px; }
section { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.drop { border: 2px dashed var(--border); text-align: center; padding: 26px 12px; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: #1c2440; }
.drop .big { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.drop .row { margin-top: 12px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.opts { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.opts label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.opts label.check { color: var(--text); }
button, select, input[type=text] {
  background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; font: inherit;
}
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.small { padding: 2px 8px; font-size: 12px; }
.queue { flex: 1; display: flex; flex-direction: column; min-height: 200px; }
.queueHead { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.tableWrap { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: 8px; max-height: 60vh; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: #22243a; }
td.num { color: var(--muted); width: 1%; }
td.file { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
td.st { min-width: 150px; }
td.st .pb { display: inline-block; vertical-align: middle; width: 90px; height: 8px; background: var(--field); border-radius: 4px; overflow: hidden; margin-right: 6px; }
td.st .pb div { height: 100%; width: 0; background: var(--accent); }
tr.done td.st { color: var(--ok); }
tr.fail td.st { color: var(--bad); }
tr.skip td { color: var(--muted); }
#empty { padding: 14px 4px; }
#toasts { position: fixed; right: 16px; bottom: 50px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, 90vw); }
.toast { background: #22243a; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
.toast b { display: block; margin-bottom: 2px; }
.toast pre { margin: 6px 0 0; white-space: pre-wrap; font-size: 12px; color: var(--muted); max-height: 140px; overflow: auto; }
footer { padding: 6px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  header, main, footer { padding-left: 10px; padding-right: 10px; }
  .banner { margin-left: 10px; margin-right: 10px; }
  th:nth-child(3), td:nth-child(3), th:nth-child(6), td:nth-child(6) { display: none; }
}
