:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fbfc;
  --text: #101828;
  --muted: #667085;
  --line: #d9e1e8;
  --primary: #0b7a75;
  --primary-dark: #075e59;
  --primary-soft: #e7f6f4;
  --success: #087443;
  --success-soft: #e8f7ef;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #b54708;
  --warning-soft: #fff4e6;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef5f4 0, rgba(244, 246, 248, 0) 280px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.brand p,
.muted-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions a,
.icon-button,
.primary-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.header-actions a {
  padding: 0 14px;
  color: var(--primary-dark);
  border: 1px solid #addad5;
  background: #fff;
}

.icon-button {
  width: 40px;
  border: 1px solid #addad5;
  color: var(--primary-dark);
  background: #fff;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.status-strip div {
  min-height: 84px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.status-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}

.submit-card,
.queue-card,
.downloads-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.submit-card {
  padding: 20px;
}

.queue-card {
  min-height: 410px;
}

.downloads-card {
  margin-top: 16px;
}

.card-head {
  margin-bottom: 16px;
}

.card-head.inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 750;
}

textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.14);
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  gap: 8px;
  border: 0;
  color: #fff;
  background: var(--primary);
}

.primary-button:hover,
.icon-button:hover {
  background: var(--primary-dark);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.message.success {
  color: var(--success);
}

.tips {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.tips div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: var(--surface-soft);
}

.tips strong {
  font-size: 13px;
}

.tips span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.support-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #b9dfda;
  border-radius: 8px;
  background: var(--primary-soft);
}

.support-card div {
  display: grid;
  gap: 5px;
}

.support-card strong {
  font-size: 14px;
}

.support-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.support-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  background: #fff;
}

.polling-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 750;
}

.jobs-list {
  display: grid;
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f4;
}

.job:last-child {
  border-bottom: 0;
}

.job-main {
  min-width: 0;
}

.job-url,
.download-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-url {
  color: #23313f;
  font-size: 14px;
  font-weight: 650;
}

.job-meta,
.download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 30px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status.pending {
  color: #475467;
  background: #eef1f5;
}

.status.running {
  color: var(--warning);
  background: var(--warning-soft);
}

.status.success {
  color: var(--success);
  background: var(--success-soft);
}

.status.failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.error-text {
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.downloads-list {
  display: grid;
}

.download-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f4;
}

.download-item:last-child {
  border-bottom: 0;
}

.download-title {
  max-width: 100%;
  color: #23313f;
  font-size: 15px;
  font-weight: 750;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.download-link {
  min-height: 34px;
  padding: 0 12px;
  color: var(--primary-dark);
  border: 1px solid #addad5;
  background: #fff;
  font-size: 13px;
}

.download-link.primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.empty-state {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.pager {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #edf1f4;
}

.pager-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.pager-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  color: #344054;
  background: #fff;
  cursor: pointer;
}

.pager-button:hover:not(:disabled) {
  color: var(--primary-dark);
  border-color: #addad5;
  background: var(--primary-soft);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 16px 0 28px;
  }

  .app-header,
  .workspace,
  .download-item,
  .job {
    grid-template-columns: 1fr;
  }

  .app-header,
  .workspace {
    display: grid;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions a {
    flex: 1;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-head.inline {
    align-items: flex-start;
  }

  .file-actions {
    justify-content: flex-start;
  }

  .pager {
    justify-content: space-between;
  }

  .support-card {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .support-card img {
    width: 88px;
    height: 88px;
  }
}

@media (max-width: 520px) {
  .status-strip {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }
}
