:root {
  --bg: #0b0e14;
  --panel: #12161f;
  --panel-2: #171c28;
  --border: #232a3a;
  --text: #e6eaf2;
  --muted: #8b93a7;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(167, 139, 250, .08), transparent 60%),
    radial-gradient(900px 400px at 10% -10%, rgba(34, 211, 238, .07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11, 14, 20, .85);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 28px; height: 28px; color: var(--accent); }
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.brand h1 span { color: var(--accent); font-weight: 400; }

.pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 50% { opacity: .4; } }

main { flex: 1; width: min(860px, 100% - 32px); margin: 28px auto; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 44px 24px;
  text-align: center;
  background: var(--panel);
  transition: border-color .15s, background .15s, transform .1s;
  cursor: pointer;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); }
.dropzone.dragover {
  border-color: var(--accent-2);
  background: var(--panel-2);
  transform: scale(1.005);
}
.dropzone .up-icon { width: 34px; height: 34px; color: var(--accent); opacity: .9; }
.dropzone h2 { margin: 10px 0 4px; font-size: 19px; font-weight: 600; }
.dropzone h2 b { color: var(--accent); }
.dropzone p { margin: 2px 0; color: var(--muted); font-size: 13.5px; }
.dropzone .limits { font-size: 12px; opacity: .75; margin-top: 10px; }

.error {
  color: var(--err);
  font-size: 13.5px;
  background: rgba(248, 113, 113, .07);
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 10px;
  padding: 8px 14px;
}

#jobs { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.file-ico { width: 22px; height: 22px; color: var(--muted); flex: none; }
.fname { font-weight: 600; font-size: 14.5px; word-break: break-all; }
.fsize { color: var(--muted); font-size: 12.5px; margin-left: auto; flex: none; }

.chip {
  margin-left: auto; flex: none;
  font-size: 11.5px; font-weight: 600; letter-spacing: .4px;
  padding: 3px 10px; border-radius: 999px;
  text-transform: uppercase;
}
.chip.queued { background: rgba(251, 191, 36, .12); color: var(--warn); }
.chip.active { background: rgba(34, 211, 238, .12); color: var(--accent); }
.chip.completed { background: rgba(52, 211, 153, .12); color: var(--ok); }
.chip.failed { background: rgba(248, 113, 113, .12); color: var(--err); }
.chip.expired { background: rgba(139, 147, 167, .12); color: var(--muted); }

.bar-track {
  height: 8px; border-radius: 6px; overflow: hidden;
  background: #0d1119; border: 1px solid var(--border);
}
.bar-fill {
  height: 100%; width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .35s ease;
}
.bar-fill.striped {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 8px, transparent 8px 16px),
                    linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: auto, 100% 100%;
  animation: slide .7s linear infinite;
}
@keyframes slide { to { background-position: 16px 0, 0 0; } }

.row-between { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 6px; gap: 10px; }
.stage { color: var(--muted); font-size: 13px; }
.pct { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.queue-pos { font-size: 14px; }
.queue-pos b { color: var(--warn); font-size: 17px; }

.elapsed { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #06131a; font-weight: 700; font-size: 14px;
  border: 0; border-radius: 10px;
  padding: 10px 18px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled, .btn.disabled {
  background: var(--panel-2); color: var(--muted); cursor: not-allowed; filter: none;
}
.btn svg { width: 16px; height: 16px; }

.countdown {
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.countdown b { color: var(--text); }

.errbox {
  color: var(--err); font-size: 13.5px;
  background: rgba(248, 113, 113, .07);
  border: 1px solid rgba(248, 113, 113, .25);
  padding: 10px 12px; border-radius: 10px;
  font-family: var(--mono);
  word-break: break-word;
}

details.console { margin-top: 12px; }
details.console summary {
  cursor: pointer; color: var(--muted); font-size: 12.5px; user-select: none;
  list-style: none;
}
details.console summary::before { content: "▸ "; }
details.console[open] summary::before { content: "▾ "; }
.console-box {
  margin-top: 8px; padding: 10px 12px;
  background: #0a0d13; border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  color: #9aa5bd; max-height: 180px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}

.result-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.out-size { color: var(--muted); font-size: 13px; }

footer {
  text-align: center; padding: 18px;
  color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  header { padding: 14px 16px; }
  .fsize { display: none; }
  main { margin: 16px auto; }
}
