:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #176b87;
  --accent-strong: #0f4f63;
  --danger: #a43b3b;
  --ok: #28724f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 28px auto;
}

.toolbar {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

p,
label,
.meta,
.message {
  color: var(--muted);
}

.api-key {
  width: min(320px, 100%);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 107, 135, 0.14);
}

button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.task-form {
  display: grid;
  gap: 12px;
}

.url-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.options {
  display: grid;
  grid-template-columns: 120px 120px auto;
  gap: 12px;
  align-items: end;
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 42px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

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

.tasks {
  display: grid;
  gap: 10px;
}

.task {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.task-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.url {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.file-name {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e9eef5;
  color: var(--text);
  white-space: nowrap;
}

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

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

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.task-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.download-button {
  width: fit-content;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.download-button:hover {
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
}

.error {
  color: var(--danger);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .toolbar,
  .task-top,
  .task-actions {
    display: grid;
  }

  .url-row,
  .options {
    grid-template-columns: 1fr;
  }
}
