:root {
  --bg: #07110f;
  --bg-raise: #10211c;
  --ink: #f4f7f2;
  --muted: #9aada6;
  --line: rgba(232, 196, 122, 0.22);
  --teal: #5dffc4;
  --teal-deep: #128f68;
  --gold: #e8c47a;
  --danger: #ff8d7a;
  --ok: #b6ffcf;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(93, 255, 196, 0.16), transparent 55%),
    radial-gradient(700px 420px at 110% 0%, rgba(232, 196, 122, 0.14), transparent 50%),
    var(--bg);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.boot, .loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.login-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(16, 33, 28, 0.96), rgba(8, 18, 16, 0.96));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}
.login-card img {
  width: 210px;
  margin: 0 auto 8px;
}
.login-card h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 34px;
  line-height: 1.05;
  margin: 8px 0 8px;
  text-align: center;
}
.lede {
  margin: 0 0 22px;
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
}
label { display: block; margin: 12px 0; }
label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
input[type="text"], input[type="password"] {
  width: 100%;
  background: #071410;
  border: 1px solid rgba(244, 247, 242, 0.12);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
input:focus { border-color: var(--teal); }
.form-error, .banner {
  background: rgba(255, 141, 122, 0.12);
  color: #ffd0c8;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 0;
}
.banner { margin-bottom: 14px; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--teal);
  color: #062119;
  font-weight: 700;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.block { width: 100%; margin-top: 8px; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(244, 247, 242, 0.16);
}
.btn.small { padding: 8px 12px; font-size: 14px; }

.shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 48px; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar img { height: 62px; width: auto; }
.topbar h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 560;
  margin: 0;
  line-height: 1;
}
.topbar p { margin: 6px 0 0; color: var(--muted); }
.spacer { flex: 1; }
.who { color: var(--gold); font-size: 14px; margin-right: 8px; }

.layout { display: grid; gap: 18px; }
.panel {
  background: rgba(16, 33, 28, 0.78);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.drop {
  border: 1.5px dashed rgba(93, 255, 196, 0.45);
  border-radius: 20px;
  padding: 22px 16px;
  text-align: center;
  background: rgba(93, 255, 196, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.drop.over {
  background: rgba(93, 255, 196, 0.12);
  border-color: var(--teal);
}
.drop strong { display: block; font-size: 18px; margin-bottom: 4px; }
.drop p { margin: 0 0 12px; color: var(--muted); }
.drop .actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}
.stats { color: var(--muted); font-size: 14px; }
.stats b { color: var(--ink); font-weight: 650; }
.eta { color: var(--gold); }

.track {
  height: 8px;
  background: #0b1a16;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}
.track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-deep), var(--teal));
  width: 0;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 460px;
  overflow: auto;
  display: grid;
  gap: 8px;
}
.queue-list li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0c1b17;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.uploading, .dot.reading { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
.dot.done { background: var(--teal); }
.dot.failed { background: var(--danger); }
.file-name { font-weight: 600; word-break: break-word; }
.file-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.file-side { text-align: right; font-size: 13px; color: var(--ok); }
.file-side.bad { color: var(--danger); }
.mini {
  margin-top: 6px;
  height: 4px;
  background: #163029;
  border-radius: 99px;
  overflow: hidden;
}
.mini span { display: block; height: 100%; background: var(--gold); }

.results { display: flex; flex-direction: column; min-height: 420px; }
.results header { display: flex; justify-content: space-between; gap: 12px; align-items: end; }
.kicker {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.count {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 0.9;
  margin: 4px 0;
}
.results .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.numbers {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  overflow: auto;
  max-height: 520px;
  display: grid;
  gap: 6px;
}
.numbers li {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  background: #0c1b17;
  border-radius: 12px;
  padding: 10px 12px;
}
.empty {
  margin-top: 24px;
  color: var(--muted);
  line-height: 1.5;
}
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

@media (min-width: 980px) {
  .layout { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .results { position: sticky; top: 16px; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 26px; }
  .who { display: none; }
  .count { font-size: 52px; }
  .shell { width: min(1180px, calc(100% - 18px)); }
}

@keyframes pulse {
  50% { transform: scale(0.7); opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.uploading, .dot.reading { animation: none; }
}
