:root {
  --bg: #0b0d10;
  --panel: #12161c;
  --panel-2: #171c23;
  --panel-3: #1c232c;
  --line: #2a323d;
  --line-strong: #3a4654;
  --text: #eef2f7;
  --muted: #a7b0bd;
  --muted-2: #7d8795;
  --ok: #7ddc91;
  --warn: #e9c46a;
  --bad: #f08080;
  --accent: #74b3ce;
  --accent-strong: #91d2ea;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(116, 179, 206, .12), transparent 28rem),
    linear-gradient(180deg, #0b0d10 0%, #0f1318 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }

.shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
}

.brand-line { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #202832, #141920);
  color: var(--accent-strong);
  font-weight: 850;
  letter-spacing: -.05em;
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 12px; font-size: 15px; }

.eyebrow {
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin: 18px 0 10px;
  font-size: clamp(36px, 5.9vw, 66px);
  line-height: .98;
  letter-spacing: -.055em;
}
.hero p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ghost, .primary, .secondary {
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #151a21;
  min-height: 42px;
  padding: 10px 14px;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.ghost.compact { min-width: 52px; padding-inline: 12px; }
.primary {
  color: #071016;
  background: var(--accent-strong);
  border-color: transparent;
  font-weight: 800;
}
.secondary {
  background: var(--panel-3);
  border-color: var(--line-strong);
  font-weight: 700;
}
.ghost:hover, .primary:hover, .secondary:hover {
  transform: translateY(-1px);
  border-color: #536273;
}

.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 13, .88);
  backdrop-filter: blur(20px);
}
.login-overlay.active { display: flex; }
.login-card {
  width: min(410px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #11161d;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.login-card .brand-mark { margin: 0 auto 18px; }
.login-card h2 { margin: 0 0 18px; text-align: center; letter-spacing: -.03em; }
.login-card label { display: block; margin-bottom: 14px; }
.login-card label span { display: block; margin-bottom: 6px; color: var(--muted-2); font-size: 13px; }
.login-card label input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b0f14;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
.login-card label input:focus { border-color: var(--accent); }
.login-btn { width: 100%; margin-top: 8px; }
.login-error { color: var(--bad); font-size: 14px; min-height: 22px; margin: 0 0 8px; text-align: center; }

.dropzone, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.dropzone {
  position: relative;
  min-height: 292px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 36px;
  margin-bottom: 18px;
  outline: none;
}
.dropzone input { display: none; }
.drop-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: #10151b;
  color: var(--accent-strong);
  font-size: 42px;
  font-weight: 900;
  margin-bottom: 24px;
}
.dropzone h2 { margin: 0 0 8px; font-size: clamp(27px, 4vw, 42px); letter-spacing: -.04em; }
.dropzone p { color: var(--muted); margin-bottom: 8px; }
.dropzone small { color: var(--muted-2); }
.dropzone.dragging, .dropzone:focus-visible {
  border-color: var(--accent);
  background: linear-gradient(180deg, #18232b, #11161d);
}

.panel { border-radius: 26px; padding: 22px; margin-top: 18px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-copy { min-width: 0; }
.panel h2 { margin-bottom: 6px; letter-spacing: -.03em; }
.panel p { color: var(--muted-2); margin-bottom: 0; }
#queueStats { color: var(--muted-2); font-size: 13px; }

.queue-list, .history-list { display: grid; gap: 12px; }
.empty::before {
  content: attr(data-empty);
  display: block;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted-2);
  padding: 22px;
  text-align: center;
}
.empty > * { display: none; }

.file-row, .history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  background: #0d1117;
  border-radius: 18px;
  padding: 14px;
}
.file-row[data-status="hashing"], .file-row[data-status="checking"], .file-row[data-status="uploading"] {
  border-color: rgba(116, 179, 206, .58);
  background: #101821;
}
.file-main { display: flex; gap: 14px; min-width: 0; align-items: center; }
.file-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(180deg, #202832, #131922);
  border: 1px solid var(--line);
  position: relative;
}
.file-icon::before {
  content: "";
  position: absolute;
  inset: 10px 12px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  border-top-right-radius: 9px;
}
.file-meta, .history-main { min-width: 0; }
.file-name, .history-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-sub, .history-sub {
  display: block;
  color: var(--muted-2);
  font-size: 13px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-hash, .history-hash {
  display: inline-block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-side { display: grid; gap: 10px; min-width: 0; }
.file-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: #151a21;
  color: var(--muted);
}
.pill.ok { color: #07160c; background: var(--ok); border-color: transparent; }
.pill.warn { color: #201500; background: var(--warn); border-color: transparent; }
.pill.bad { color: #260606; background: var(--bad); border-color: transparent; }
.pill.cancelled { color: #201500; background: var(--warn); border-color: transparent; }
.cancel-btn { display: none; min-height: 34px; padding: 7px 12px; border-radius: 999px; font-size: 12px; }
.cancel-btn.visible { display: inline-flex; align-items: center; justify-content: center; }
.progress { width: 100%; height: 9px; border-radius: 999px; overflow: hidden; background: #202732; }
.progress span { display: block; height: 100%; width: 0%; border-radius: inherit; background: var(--accent-strong); transition: width .18s ease; }

.history-row { align-items: start; }
.history-hash { text-align: right; }

@media (max-width: 820px) {
  .shell { width: min(100% - 22px, 1120px); padding-top: 24px; }
  .hero { grid-template-columns: 1fr; }
  .top-actions { justify-content: flex-start; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .panel-head .secondary { align-self: flex-start; }
  .file-row, .history-row { grid-template-columns: 1fr; align-items: stretch; }
  .file-side { width: 100%; }
  .file-actions { justify-content: flex-start; }
  .history-hash { text-align: left; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 16px, 1120px); }
  .hero p { font-size: 15px; }
  h1 { font-size: clamp(32px, 12vw, 48px); }
  .dropzone { min-height: 250px; padding: 26px 18px; border-radius: 24px; }
  .panel { padding: 16px; border-radius: 22px; }
  .top-actions, .file-actions { width: 100%; }
  .ghost, .secondary, .primary { width: 100%; justify-content: center; }
  .ghost.compact { width: auto; min-width: 58px; }
  .pill, .cancel-btn { flex: 1 1 140px; }
}
