:root {
  --bg: #0f1117;
  --bg-soft: #161922;
  --surface: #1c2030;
  --surface-hover: #242a3d;
  --text: #f3f4f8;
  --text-soft: #a8afc4;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --accent-glow: rgba(110, 231, 183, 0.25);
  --danger: #fca5a5;
  --warn: #fcd34d;
  --radius: 16px;
  --radius-sm: 10px;
  font-family: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(52, 211, 153, 0.18), transparent),
    var(--bg);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-dim), #22d3ee);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.brand-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--text-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-soft);
}

.status-pill.is-ready .status-dot {
  background: var(--accent-dim);
  box-shadow: 0 0 10px var(--accent-glow);
}

.status-pill.is-ready .status-label {
  color: var(--text);
}

.status-pill.is-wait .status-dot {
  background: var(--warn);
  animation: pulse 1.2s ease infinite;
}

.status-pill.is-error .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.content {
  display: grid;
  gap: 1rem;
}

.panel {
  background: rgba(28, 32, 48, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.panel-upload {
  padding: 1.35rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.panel-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 168px;
  padding: 1.25rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: rgba(110, 231, 183, 0.45);
  background: #12151f;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.25rem;
  color: var(--accent);
}

.dropzone-title {
  font-weight: 600;
  font-size: 1rem;
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.dropzone-file {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--accent-dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.options {
  margin: 1rem 0;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.options summary {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-soft);
  list-style: none;
}

.options summary::-webkit-details-marker {
  display: none;
}

.options-body {
  padding: 0 0.85rem 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.upload-limits {
  margin: 0.65rem 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-soft);
  cursor: pointer;
}

.toggle input {
  margin-top: 0.2rem;
  accent-color: var(--accent-dim);
}

.btn-main {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #052e1f;
  background: linear-gradient(135deg, var(--accent), #5eead4);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-main:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.message {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
}

.message-error {
  color: var(--danger);
}

.progress {
  margin-top: 1rem;
}

.progress-track {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), #22d3ee);
  transition: width 0.35s ease;
}

.progress-label {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.placeholder {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.jobs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

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

.job-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.job-actions button {
  border: none;
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.job-actions button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.job-actions .job-btn-primary {
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent-dim), #22d3ee);
  font-weight: 600;
}

.job-actions .job-btn-primary:hover {
  color: var(--bg);
  filter: brightness(1.05);
}

.job-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
}

.job-badge-queued,
.job-badge-processing {
  background: rgba(252, 211, 77, 0.15);
  color: var(--warn);
}

.job-badge-completed {
  background: rgba(110, 231, 183, 0.15);
  color: var(--accent);
}

.job-badge-failed {
  background: rgba(252, 165, 165, 0.15);
  color: var(--danger);
}

@media (max-width: 520px) {
  .page {
    padding-inline: 1rem;
  }

  .job-item {
    flex-direction: column;
    align-items: stretch;
  }

  .job-actions {
    justify-content: flex-end;
  }
}
