:root {
  --bg: #0f1115;
  --card: #171a21;
  --border: #2a2e38;
  --text: #eef0f4;
  --muted: #8b92a3;
  --accent: #5b8dee;
  --accent-hover: #4a7bdc;
  --danger: #e05c5c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.wrap {
  width: 100%;
  max-width: 560px;
  padding: 32px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.brand h1 { margin: 0; font-size: 28px; letter-spacing: -0.5px; }

.muted { color: var(--muted); margin: 0; font-size: 14px; }
.error { color: var(--danger); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(91, 141, 238, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--border);
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.btn:hover { background: #343945; }

.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger { background: var(--danger); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label { font-size: 13px; color: var(--muted); }

select, input[type="text"], input[type="password"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.file-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.file-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 12px; color: var(--muted); flex-shrink: 0; }

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  display: flex;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.15s;
}

.file-status { font-size: 12px; color: var(--muted); }
.file-status.error { color: var(--danger); }
.file-status.done { color: #5fd68a; }

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-row input {
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
}

.meta dt { color: var(--muted); font-size: 12px; }
.meta dd { margin: 0; font-size: 14px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-tile .value { font-size: 22px; font-weight: 700; }
.stat-tile .label { font-size: 12px; color: var(--muted); }
