:root {
  --bg: #0f1418;
  --panel: #161d23;
  --panel-2: #1c252c;
  --line: #27333c;
  --text: #e6edf3;
  --muted: #8b9aa7;
  --accent: #e0a64b;
  --accent-ink: #1a1206;
  --ok: #4ec98a;
  --warn: #e0a64b;
  --bad: #e26d6d;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: 96px; }

h1, h2 { font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.error { color: var(--bad); }

/* --- top bar --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }

.mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand h1 { margin: 0; font-size: 17px; }
.brand p { margin: 0; font-size: 13px; color: var(--muted); }

.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

/* --- layout --- */

main { max-width: 880px; margin: 0 auto; padding: 28px 24px 40px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.centered { text-align: center; }
.centered h2 { margin: 0 0 6px; font-size: 19px; }
.centered p { margin: 0 auto 20px; max-width: 42ch; }

/* --- buttons --- */

button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 16px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

button:hover:not(:disabled) { background: #26313a; border-color: #3a4a56; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 11px 22px;
}

button.primary:hover:not(:disabled) { background: #eeb75d; border-color: #eeb75d; }

button:disabled { opacity: 0.42; cursor: not-allowed; }

button.link {
  background: none;
  border: none;
  color: var(--muted);
  padding: 4px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.link:hover { color: var(--text); background: none; }

/* --- dropzone --- */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 44px 24px;
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease;
}

.dropzone.over { border-color: var(--accent); background: rgba(224, 166, 75, 0.06); }

.dz-title { margin: 0; font-size: 17px; font-weight: 600; }
.dz-sub { margin: 8px 0; font-size: 13px; }
.dz-buttons { display: flex; gap: 10px; justify-content: center; }
.dz-hint { margin: 18px 0 0; font-size: 12.5px; }

/* --- queue --- */

.queue { margin-top: 28px; }

.queue-head { display: flex; align-items: baseline; justify-content: space-between; }
.queue-head h2 { margin: 0 0 12px; font-size: 15px; }

#rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: 1fr 150px 24px;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.row-main { min-width: 0; }

.row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.row-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-note { margin: 3px 0 0; font-size: 12.5px; }

.badge {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid;
}

.badge.expected { color: var(--ok); border-color: rgba(78, 201, 138, 0.4); background: rgba(78, 201, 138, 0.1); }
.badge.wanted   { color: var(--warn); border-color: rgba(224, 166, 75, 0.4); background: rgba(224, 166, 75, 0.1); }
.badge.new      { color: #7fb8e0; border-color: rgba(127, 184, 224, 0.4); background: rgba(127, 184, 224, 0.1); }
.badge.rejected { color: var(--bad); border-color: rgba(226, 109, 109, 0.4); background: rgba(226, 109, 109, 0.1); }

/* Per-row progress, right-aligned: the point of a bar per file is answering
   "which one is stuck?", which a single aggregate bar cannot. */
.row-status { text-align: right; font-size: 12.5px; color: var(--muted); }

.bar {
  height: 5px;
  border-radius: 3px;
  background: var(--panel-2);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
  transition: width 120ms linear;
}

.row.done .bar > span { background: var(--ok); }
.row.error .bar > span, .row.rejected .bar > span { background: var(--bad); }
.row.rejected, .row.error { border-color: rgba(226, 109, 109, 0.35); }

.row-status .verdict { font-weight: 600; }
.row.done .verdict { color: var(--ok); }
.row.error .verdict, .row.rejected .verdict { color: var(--bad); }

.row-remove {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  padding: 2px 4px;
}

.row-remove:hover { color: var(--bad); background: none; }

/* --- builds --- */

.builds { margin-top: 28px; }
.builds h2 { margin: 0 0 12px; font-size: 15px; }

#build-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.build {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.build p { margin: 3px 0 0; font-size: 12.5px; }
.build a { color: var(--accent); font-size: 12.5px; white-space: nowrap; }
.build.running { border-color: rgba(224, 166, 75, 0.35); }
.build.ok { border-color: rgba(78, 201, 138, 0.35); }
.build.bad { border-color: rgba(226, 109, 109, 0.35); }

/* --- reference --- */

.reference { margin-top: 32px; font-size: 13.5px; }
.reference summary { cursor: pointer; color: var(--muted); }
.reference summary:hover { color: var(--text); }
.reference h3 { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.reference ul { margin: 0; padding-left: 18px; color: var(--muted); }
.reference code { color: var(--text); font-size: 12.5px; }

/* --- action bar --- */

.actionbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 24px;
  background: rgba(15, 20, 24, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.progress-summary { flex: 1; min-width: 0; }
.progress-summary .bar { margin-bottom: 7px; }
.progress-summary p { margin: 0; font-size: 12.5px; }

/* --- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  max-width: 90vw;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.toast.bad { border-color: rgba(226, 109, 109, 0.5); color: #f0b4b4; }
.toast.good { border-color: rgba(78, 201, 138, 0.5); color: #a8e6c6; }

@media (max-width: 620px) {
  .row { grid-template-columns: 1fr 100px 24px; gap: 10px; }
  .actionbar { flex-direction: column; align-items: stretch; gap: 12px; }
}
