@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #123b38;
  --muted: #586b70;
  --paper: #fafaf7;
  --surface: #ffffff;
  --aside: #f6f5f2;
  --line: #dee4e1;
  --control-line: #84958f;
  --green: #13706a;
  --green-dark: #0b5650;
  --green-soft: #ebf5f4;
  --red: #ad3029;
  --red-soft: #fff0ee;
  --radius: 12px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, summary, .option, .download { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
svg { max-width: 100%; }
a { color: var(--green-dark); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
::selection { color: var(--ink); background: #c8e5df; }
input { caret-color: var(--green); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
[hidden] { display: none !important; }

.sr-only, .option input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 2; padding: 12px; color: var(--surface); background: var(--green-dark); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.shell { width: min(1408px, calc(100% - 40px)); margin: 0 auto; }
.nav { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); font-size: 17px; font-weight: 750; letter-spacing: -0.025em; text-decoration: none; min-width: 0; }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; }
.brand-mark svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.nav-note { display: inline-flex; align-items: center; min-height: 44px; flex: 0 0 auto; color: var(--muted); font-size: 13px; text-decoration: none; }
.hero { padding: 36px 0 24px; }
h1 { margin: 0; font-size: 32px; font-weight: 750; line-height: 1.2; letter-spacing: -0.035em; text-wrap: balance; }
.lede { max-width: 72ch; margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.workspace { display: grid; gap: 16px; align-items: stretch; }
.form-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-picker { display: flex; width: 100%; gap: 0; margin-bottom: 28px; border-radius: 8px; background: #f3f5f6; }
.source-choice { min-width: 0; flex: 1; min-height: 54px; padding: 10px 8px; justify-content: center; gap: 8px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; font-size: 14px; font-weight: 600; }
.source-choice.active { color: var(--ink); background: var(--green-soft); border-bottom-color: var(--green); font-weight: 750; }
.source-choice:hover { color: var(--ink); background: #e5edeb; }
.source-choice.active:hover { background: #e1f0ed; }
.field-label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.url-row { position: relative; min-width: 0; }
.url-row > svg { position: absolute; width: 24px; height: 24px; left: 16px; top: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
input, select { width: 100%; min-width: 0; border: 1px solid var(--control-line); border-radius: 8px; color: var(--ink); background: var(--surface); transition: border-color 160ms ease; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus { border-color: var(--green); }
.url-row input { height: 54px; padding: 0 16px 0 52px; font-size: 16px; }
.upload-field { position: relative; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 8px; min-height: 154px; padding: 20px; border: 1px dashed var(--control-line); border-radius: 8px; background: #f8fbfa; cursor: pointer; text-align: center; }
.upload-field:hover { background: var(--green-soft); border-color: var(--green); }
.upload-field:focus-within { outline: 3px solid var(--green); outline-offset: 4px; }
.upload-field > svg { width: 28px; height: 28px; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.upload-field > span { font-weight: 650; }
.upload-field > small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.upload-field input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-name { margin: 12px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: 8px; color: var(--surface); background: var(--green); cursor: pointer; font-size: 15px; font-weight: 700; transition: background 160ms ease; }
button:hover { background: var(--green-dark); }
button:active { filter: brightness(0.92); }
button:disabled { opacity: 0.6; cursor: wait; }
button svg, summary svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.source-choice .play-icon { width: 26px; height: 26px; }
.play-icon circle { fill: currentColor; stroke: none; }
.play-icon path { fill: var(--surface); stroke: none; }
.action-play { fill: currentColor; stroke: none; }
.form-actions { margin-top: 22px; }
.submit-action { width: 100%; min-height: 60px; font-size: 18px; }
.permission-note { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }

.options { display: grid; gap: 14px; }
.primary-options { margin-top: 20px; }
.option { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 4px 0; cursor: pointer; }
.option > span:last-child { min-width: 0; }
.option:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 4px; border-radius: 4px; }
.check { width: 21px; height: 21px; flex: 0 0 auto; margin-top: 1px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--surface); }
.option input:checked + .check { border-color: var(--green); background: var(--green); }
.option input:checked + .check::after { content: ""; display: block; width: 6px; height: 11px; margin: 2px 0 0 6px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.option:hover .check { border-color: var(--green); }
.option strong { display: block; font-size: 14px; font-weight: 650; }
.option small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.advanced { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced summary { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 4px; cursor: pointer; font-size: 14px; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.disclosure-arrow { margin-left: auto; }
.advanced[open] .disclosure-arrow { transform: rotate(180deg); }
.advanced[open] { padding-bottom: 20px; }
.advanced-options { padding-top: 8px; }
.advanced-grid { display: grid; gap: 16px; padding-top: 18px; }
.advanced-grid label, .challenge-field label, .mode-row label { color: var(--ink); font-size: 13px; font-weight: 600; }
.advanced-grid input, .advanced-grid select, .challenge-field input { min-height: 46px; margin-top: 8px; padding: 10px 12px; font-size: 16px; }
.mode-row { display: grid; gap: 10px; margin-top: 18px; }
.mode-row select { min-height: 46px; padding: 10px 12px; font-size: 16px; }
.mode-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.challenge-field { margin-bottom: 20px; }
.form-error, .job-error { color: var(--red); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.form-error { margin: 16px 0 0; padding: 12px 16px; border: 1px solid #edc2bb; border-radius: 8px; background: var(--red-soft); }

.document-panel { min-width: 0; padding: 24px; border-radius: var(--radius); background: var(--aside); }
.document-panel h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.3; text-wrap: balance; }
.document-preview { margin: 20px 0; }
.preview-pages { display: flex; gap: 10px; }
.preview-pages > svg { display: block; flex: 1 1 0; width: 0; min-width: 0; height: auto; max-height: 180px; aspect-ratio: 120 / 168; }
.preview-pages text { fill: var(--ink); font: 600 9px var(--font); }
.page-paper { fill: var(--surface); stroke: var(--line); }
.page-lines { stroke: #d5dcde; stroke-width: 4; stroke-linecap: round; }
.preview-pages .page-number { fill: var(--muted); font-size: 8px; }
.page-dot { fill: var(--muted); }
.diagram-ground { fill: #edf2f2; }
.diagram-teal { fill: #79a9aa; fill-opacity: 0.85; }
.diagram-orange { fill: #eca36c; fill-opacity: 0.85; }
.chart-light { fill: #9bc7c6; }
.chart-teal { fill: var(--green); }
.chart-orange { fill: #e4a074; }
.document-preview figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: right; }
.document-features { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.document-features li { display: flex; gap: 16px; align-items: flex-start; }
.document-features li > svg { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: #e9eeee; flex: 0 0 auto; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.document-features strong { font-size: 15px; font-weight: 700; }
.document-features p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.jobs-panel { margin-top: 32px; }
.jobs-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.jobs-heading h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.025em; }
.jobs-count { color: var(--muted); font-size: 13px; }
.job-list { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.job-card { min-width: 0; padding: 22px 20px; border-bottom: 1px solid var(--line); }
.job-card:last-child { border-bottom: 0; }
.job-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.job-topline > div:first-child { min-width: 0; }
.job-topline h3 { margin: 8px 0 0; font-size: 16px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; color: var(--muted); background: #eef1f1; font-size: 12px; font-weight: 650; }
.status-pill::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.status-pill.queued { color: #865009; background: #fff0dd; }
.status-pill.running { color: #145ca3; background: #e8f1ff; }
.status-pill.completed { color: #15633f; background: #e6f4eb; }
.status-pill.failed { color: var(--red); background: var(--red-soft); }
.status-pill.expired { color: #586471; background: #edf0f3; }
.status-pill.deleting { color: #705a42; background: #f3eee7; }
.progress-meta { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; min-height: 28px; }
.progress-percent { color: var(--muted); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; overflow: hidden; margin-top: 16px; border-radius: 6px; background: #e7ecea; }
.progress-track > div { width: 0; height: 100%; background: var(--green); border-radius: inherit; }
.job-source { margin: 8px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.job-source a { font-weight: 650; }
.job-message { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.job-error { margin: 10px 0 0; }
.download-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.download { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--control-line); border-radius: 8px; color: var(--green-dark); font-size: 13px; font-weight: 650; text-decoration: none; }
.download:hover { color: var(--green-dark); background: var(--green-soft); }
.download.primary { border-color: var(--green); color: var(--surface); background: var(--green); }
.download.primary:hover { background: var(--green-dark); }
.remove-job { display: inline-grid; width: 28px; min-height: 28px; padding: 0; place-items: center; color: var(--red); background: transparent; }
.remove-job svg { width: 18px; height: 18px; }
.remove-job:hover { color: var(--red); background: var(--red-soft); }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 28px 0 40px; color: var(--muted); font-size: 12px; }
footer p { margin: 0; }
footer a { color: var(--muted); }

@media (min-width: 600px) {
  .shell { width: min(1408px, calc(100% - 64px)); }
  .brand { font-size: 20px; }
  .hero { padding-top: 40px; }
  h1 { font-size: 40px; }
  .lede { font-size: 18px; }
  .form-panel { padding: 28px; }
  .source-choice { gap: 12px; font-size: 16px; }
  .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .document-panel { padding: 28px; }
  .document-preview { max-width: 440px; }
  .job-card { padding: 22px 28px; }
}
@media (min-width: 1000px) {
  .shell { width: min(1408px, calc(100% - 96px)); }
  .hero { padding: 36px 0 16px; }
  h1 { font-size: 48px; }
  .lede { margin-top: 4px; font-size: 24px; }
  .workspace { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .form-panel { padding: 24px; }
  .field-label, .advanced summary, .option strong { font-size: 16px; }
  .option small, .permission-note { font-size: 14px; }
  .document-panel h2 { font-size: 26px; }
  .document-features strong { font-size: 16px; }
  .document-features p { font-size: 14px; }
  .job-card { display: grid; grid-template-columns: minmax(280px, 1fr) auto minmax(250px, 1fr) auto; column-gap: 28px; row-gap: 8px; align-items: center; }
  .job-topline, .job-topline > div:first-child { display: contents; }
  .job-topline h3 { grid-column: 1; grid-row: 1; margin: 0; }
  .job-source { grid-column: 1; grid-row: 2; margin: 0; }
  .status-pill { grid-column: 2; grid-row: 1 / span 2; justify-self: start; }
  .progress-meta { grid-column: 4; grid-row: 1 / span 2; }
  .job-message { grid-column: 3; grid-row: 1; margin: 0; }
  .progress-track { grid-column: 3; grid-row: 2; margin: 0; }
  .download-row { grid-column: 3; grid-row: 2; margin: 0; }
  .job-error { grid-column: 3; grid-row: 2; margin: 0; }
  .job-card:is([data-status="completed"], [data-status="expired"], [data-status="failed"]) .progress-track { display: none; }
}
@media (max-width: 599px) {
  .nav { align-items: flex-start; flex-wrap: wrap; gap: 0 16px; }
  .brand { min-height: 44px; }
  .nav-note { font-size: 12px; }
  .document-panel { margin-top: 4px; }
  .permission-note { font-size: 12px; }
  .download-row .download { flex: 1 1 auto; }
}
@media (pointer: coarse) {
  .remove-job { width: 44px; min-height: 44px; }
  .nav-note, footer a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
