:root {
  --bg: #0b0816;
  --card: #151029;
  --card-2: #1a1434;
  --border: #2a2148;
  --border-strong: #3b2f68;
  --text: #ece7fa;
  --muted: #9a92bd;
  --dim: #6f6894;
  --green: #00ff9d;
  --green-soft: rgba(0, 255, 157, 0.09);
  --green-border: rgba(0, 255, 157, 0.35);
  --danger: #ff5470;
  --radius: 14px;
  --glow: 0 0 24px rgba(0, 255, 157, 0.28);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 520px at 82% -12%, rgba(139, 92, 246, 0.18), transparent 62%),
    radial-gradient(760px 420px at 8% 112%, rgba(0, 255, 157, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: rgba(0, 255, 157, 0.25); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2c2450; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3b2f68; }

.hidden { display: none !important; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 8, 22, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
}

.brand .dot { color: var(--green); }

.storage-pill {
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px 48px;
  flex: 1;
}

.section { margin-top: 40px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
}

/* ---------- hero / dropzone ---------- */

.hero h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 8px;
}

.hero h1 .accent { color: var(--green); }

.hero-sub { margin: 0 0 26px; color: var(--muted); font-size: 15px; }
.hero-sub b { color: var(--green); }

.dropzone {
  background: var(--card);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 46px 20px 38px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dropzone:hover, .dropzone.drag {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 4px rgba(0, 255, 157, 0.05), var(--glow);
}

.dz-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
}

.dz-icon svg { width: 28px; height: 28px; }

.dz-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.dz-or { color: var(--dim); font-size: 13px; margin: 0 0 14px; }
.dz-limit { color: var(--dim); font-size: 12.5px; margin: 18px 0 0; }

/* ---------- buttons ---------- */

.btn {
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--green);
  color: #05130c;
  font-weight: 700;
}
.btn-primary:hover {
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 7px 15px;
  font-size: 13px;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--green-soft); color: var(--green); }
.icon-btn.danger:hover { background: rgba(255, 84, 112, 0.12); color: var(--danger); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- upload cards ---------- */

.upload-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.upload-card:hover { border-color: var(--border-strong); }

.uc-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.uc-name {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-size { color: var(--dim); font-size: 12.5px; white-space: nowrap; }

.progress {
  height: 8px;
  background: #241c42;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00e58a, #00ff9d);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.45);
  transition: width 0.3s ease;
}

.upload-card.error .progress-bar { background: var(--danger); box-shadow: 0 0 10px rgba(255, 84, 112, 0.4); }

.uc-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.uc-status { font-size: 12.5px; font-weight: 600; }
.uc-status.err { color: var(--danger); }
.uc-meta { color: var(--dim); font-size: 12.5px; flex: 1; }
.uc-actions { display: flex; gap: 2px; }

/* ---------- file list ---------- */

.files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.files-empty {
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  color: var(--dim);
}
.files-empty svg, .empty-icon { width: 40px; height: 40px; color: #3f3766; margin: 0 auto 10px; display: block; }
.files-empty p { margin: 0; font-size: 14px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.file-row:hover { background: var(--card-2); border-color: var(--border-strong); }

.file-row > svg { width: 22px; height: 22px; color: var(--green); flex-shrink: 0; }

.fr-info { flex: 1; min-width: 0; }

.fr-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.fr-meta { color: var(--dim); font-size: 12.5px; }

.fr-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ---------- footer / toasts ---------- */

.footer {
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
  padding: 22px;
}

#toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: var(--card-2);
  border: 1px solid var(--green-border);
  color: var(--text);
  font-size: 13.5px;
  padding: 11px 16px;
  border-radius: 11px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.2s ease;
  max-width: 340px;
}
.toast.err { border-color: rgba(255, 84, 112, 0.5); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 27px; }
  .uc-size { display: none; }
}
