* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0d13;
  --panel: #13161f;
  --panel-2: #1a1e2a;
  --border: #242938;
  --text: #e6e8ef;
  --muted: #8a91a4;
  --accent: #6ea8ff;
  --accent-2: #4c8bf5;
  --success: #4ade80;
  --error: #f87171;
  --radius: 14px;
}

html,
body {
  height: 100%;
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  background: radial-gradient(circle at top left, #1a1f33, var(--bg));
}

body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(110, 168, 255, 0.12), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(74, 222, 128, 0.08), transparent 40%);
  pointer-events: none;
}

.shell {
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  text-align: center;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tagline {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}

.dropzone:hover,
.dropzone:focus {
  border-color: #3a4258;
  background: var(--panel-2);
  outline: none;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(110, 168, 255, 0.06);
  transform: translateY(1px);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(110, 168, 255, 0.25);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / 22px no-repeat;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 600;
}

.dropzone-hint {
  font-size: 13px;
  color: var(--muted);
}

.btn {
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(110, 168, 255, 0.2);
}

.btn-ghost {
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.queue {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.queue-head h2 {
  font-size: 16px;
}

.queue-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.queue-actions .btn {
  margin-top: 0;
}

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

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}

.file-item .progress {
  grid-column: 1 / -1;
  margin-top: 0;
}

.file-meta {
  min-width: 0;
}

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

.file-size {
  font-size: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.file-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: flex-end;
}

.speed {
  font-size: 12px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}

.eta {
  font-size: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}

.overall {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(110, 168, 255, 0.06);
}

.overall-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.overall-label {
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  color: var(--text);
}

.overall-pct {
  color: var(--text);
  font-weight: 600;
}

.overall-speed {
  color: var(--accent);
}

.overall-eta {
  color: var(--muted);
  margin-left: auto;
}

.overall-progress {
  margin-top: 0;
}

.status-pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
}

.status-pill.done {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(74, 222, 128, 0.08);
}

.status-pill.assembling {
  color: var(--accent);
  border-color: rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.1);
}

.status-pill.error {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
}

.status-pill.cancelled {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
}

.btn-cancel {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  cursor: pointer;
}

.btn-cancel:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.1);
}

.btn-cancel:disabled,
.btn-cancel[hidden] {
  display: none;
}

.progress {
  height: 6px;
  width: 100%;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #1f2333;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.15s ease;
}

.status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
