:root {
  color-scheme: dark;
  --bg: #0f1419;
  --card: #1a222d;
  --border: #2a3544;
  --text: #e7edf5;
  --muted: #9aa8b8;
  --accent: #3d8bfd;
  --accent-hover: #5a9dff;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121820;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 8rem;
}

.btn {
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #243041;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.error {
  color: var(--danger);
  min-height: 1.25rem;
  font-size: 0.9rem;
}

.hint,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.url-count {
  margin: 0.5rem 0 0;
}

.url-count.has-urls {
  color: var(--ok);
}

.jobs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.job-item {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
}

.job-item:first-child {
  border-top: none;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.9rem;
}

.job-title {
  font-weight: 600;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #2a3544;
}

.badge.pending {
  color: var(--warn);
}

.badge.downloading {
  color: var(--accent);
}

.badge.done {
  color: var(--ok);
}

.badge.failed {
  color: var(--danger);
}

.progress-bar {
  margin-top: 0.5rem;
  height: 8px;
  background: #121820;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar.thin {
  height: 5px;
  margin-top: 0.35rem;
}

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

.progress-label {
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.job-folder {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.job-error {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--danger);
}

.file-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.file-item {
  background: #121820;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.file-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-pct {
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

.file-path {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.file-empty {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.user-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.whoami {
  font-weight: 600;
  font-size: 1.05rem;
}

.today-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  font-size: 0.85rem;
}

.stat-date {
  color: var(--muted);
}

.stat-pill {
  background: #121820;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.stat-pill.ok strong {
  color: var(--ok);
}

.stat-pill.fail strong {
  color: var(--danger);
}

.stat-fail-hint {
  color: var(--danger);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-count.over-limit {
  color: var(--warn);
}

.file-error {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.dropzone {
  position: relative;
  border-radius: 8px;
}

.dropzone.dragover textarea {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.35);
  background: #152033;
}

.dropzone .drop-hint {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(15, 20, 25, 0.72);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--accent);
}

.dropzone.dragover .drop-hint {
  display: flex;
}

.drop-status {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  min-height: 1.2rem;
}
