:root {
  --ink: #20151a;
  --ink-muted: #62565b;
  --paper: #fffdfb;
  --surface: #f5f0ed;
  --line: #d8cbc8;
  --brand-950: #25080f;
  --brand-800: #561525;
  --brand-700: #741d31;
  --brand-600: #8d2940;
  --focus: #126c78;
  --success: #176947;
  --success-bg: #e5f4eb;
  --warning: #825000;
  --warning-bg: #fff1ce;
  --danger: #9e2632;
  --danger-bg: #fdebed;
  --info: #0d5964;
  --info-bg: #e2f2f4;
  --shadow: 0 16px 38px rgb(37 8 15 / 0.1);
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface); }
body { display: flex; flex-direction: column; min-width: 320px; min-height: 100vh; margin: 0; background: var(--surface); line-height: 1.5; }
button, input, textarea { font: inherit; }
button, input[type="file"] { cursor: pointer; }
a { color: var(--brand-700); }
a:hover { color: var(--brand-950); }
svg { display: block; }

.skip-link { position: fixed; z-index: 10; top: 0.75rem; left: 50%; padding: 0.65rem 1rem; color: #fff; background: var(--brand-950); border-radius: 0.4rem; transform: translate(-50%, -180%); transition: transform 160ms ease; }
.skip-link:focus { transform: translate(-50%, 0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.shell { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.site-header { color: #fff; background: var(--brand-950); border-bottom: 4px solid var(--brand-700); }
.header-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; width: 2.55rem; height: 2.55rem; place-items: center; color: #fff; background: var(--brand-700); border-radius: 0.65rem; }
.brand-mark svg { width: 1.45rem; height: 1.45rem; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: 0.01em; }
.brand small { margin-top: 0.05rem; color: #dfcfd1; font-size: 0.75rem; }
.section-tag { padding: 0.35rem 0.65rem; color: #f8e9ea; border: 1px solid #9b5362; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }

.page-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; padding-block: clamp(3rem, 9vw, 7rem); }
.intro { max-width: 31rem; animation: rise-in 450ms ease-out both; }
.eyebrow { margin: 0 0 0.65rem; color: var(--brand-700); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
h1, h2, p { overflow-wrap: break-word; }
h1, h2 { color: var(--brand-950); line-height: 1.12; }
h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 4.3rem); letter-spacing: -0.045em; }
h2 { margin: 0; font-size: clamp(1.3rem, 2.5vw, 1.75rem); letter-spacing: -0.025em; }
.lead { margin: 1.35rem 0 2.1rem; color: var(--ink-muted); font-size: 1.075rem; }
.steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 0.85rem; align-items: center; }
.step-number { display: grid; flex: 0 0 auto; width: 2rem; height: 2rem; place-items: center; color: #fff; background: var(--brand-700); border-radius: 50%; font-size: 0.825rem; font-weight: 800; }
.steps strong, .steps small { display: block; }
.steps strong { font-size: 0.925rem; }
.steps small { color: var(--ink-muted); font-size: 0.84rem; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); }
.upload-card { padding: clamp(1.25rem, 4vw, 2.5rem); animation: rise-in 450ms 100ms ease-out both; }
.card-heading, .job-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.required-note { color: var(--ink-muted); font-size: 0.8rem; white-space: nowrap; }
.required-note span, label span[aria-hidden="true"] { color: var(--danger); }
.form-fields { display: grid; gap: 1.3rem; padding-block: 1.6rem; }
.section-choice { display: grid; gap: 0.55rem; margin: 0; padding: 1.6rem 0 0; border: 0; }
.section-choice legend { margin-bottom: 0.15rem; color: var(--ink); font-size: 0.9rem; font-weight: 750; }
.section-choice label { display: flex; align-items: center; gap: 0.65rem; min-height: 2.85rem; padding: 0.65rem 0.75rem; background: var(--paper); border: 1px solid var(--line); border-radius: 0.5rem; font-weight: 650; transition: background-color 140ms ease, border-color 140ms ease; }
.section-choice label:hover { border-color: var(--brand-700); }
.section-choice label:has(input:checked) { background: var(--surface); border-color: var(--brand-700); }
.section-choice label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.section-choice input[type="radio"] { flex: 0 0 auto; width: 1rem; height: 1rem; accent-color: var(--brand-700); }
.field label, .review-panel label { display: block; color: var(--ink); font-size: 0.9rem; font-weight: 750; }
.field-hint { margin: 0.2rem 0 0.45rem; color: var(--ink-muted); font-size: 0.8rem; }
input[type="file"], input[type="text"], textarea { display: block; width: 100%; color: var(--ink); background: #fff; border: 1px solid #b8a9a8; border-radius: 0.5rem; transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease; }
input[type="text"] { min-height: 2.85rem; padding: 0.65rem 0.75rem; }
input[type="file"] { min-height: 3.2rem; padding: 0.42rem; }
input[type="file"]::file-selector-button { margin-right: 0.7rem; padding: 0.44rem 0.7rem; color: var(--brand-800); background: #f4e8e9; border: 0; border-radius: 0.3rem; font-weight: 750; transition: background-color 140ms ease; }
input[type="file"]:hover::file-selector-button { background: #ecd7da; }
input:hover, textarea:hover { border-color: var(--brand-700); }
input:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(18 108 120 / 0.18); outline: 0; }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgb(158 38 50 / 0.13); }
.field-feedback { min-height: 1.1rem; margin: 0.35rem 0 0; color: var(--success); font-size: 0.8rem; font-weight: 650; }
.field-feedback.is-error { color: var(--danger); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.privacy-note { display: flex; gap: 0.45rem; align-items: flex-start; max-width: 17rem; margin: 0; color: var(--ink-muted); font-size: 0.76rem; }
.privacy-note svg { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; color: var(--success); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 2.85rem; padding: 0.68rem 1rem; border: 1px solid transparent; border-radius: 0.5rem; font-weight: 750; line-height: 1.2; text-align: center; text-decoration: none; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button svg { width: 1.05rem; height: 1.05rem; }
.button-primary { color: #fff; background: var(--brand-700); }
.button-primary:hover { color: #fff; background: var(--brand-800); }
.button-secondary { color: var(--brand-800); background: #fff; border-color: var(--brand-700); }
.button-secondary:hover { color: #fff; background: var(--brand-700); }
.button[disabled] { cursor: not-allowed; opacity: 0.65; transform: none; }
.notice { margin: 1.25rem 0 0; padding: 1rem; border-left: 4px solid; border-radius: 0.5rem; }
.notice p { margin: 0.45rem 0 0; }
.notice h2 { font-size: 1.05rem; }
.notice-info { color: var(--info); background: var(--info-bg); border-color: var(--info); }
.notice-warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning); }
.notice-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.notice .button { margin-top: 1rem; }

.job-page { padding-block: clamp(2rem, 6vw, 4.5rem); }
.back-link { display: inline-flex; gap: 0.4rem; align-items: center; margin-bottom: 1.2rem; font-size: 0.9rem; font-weight: 700; text-underline-offset: 0.2em; }
.back-link svg { width: 1rem; height: 1rem; }
.job-card { max-width: 850px; margin-inline: auto; padding: clamp(1.25rem, 4vw, 2.5rem); animation: rise-in 350ms ease-out both; }
.job-id { margin: 0.45rem 0 0; color: var(--ink-muted); font-size: 0.8rem; }
.job-id code { overflow-wrap: anywhere; }
.status-wrap { display: grid; justify-items: end; gap: 0.35rem; margin: 0; color: var(--ink-muted); font-size: 0.8rem; text-align: right; }
.status-chip { padding: 0.35rem 0.65rem; color: var(--info); background: var(--info-bg); border-radius: 999px; font-size: 0.82rem; white-space: nowrap; }
.job-page[data-job-status="completed"] .status-chip { color: var(--success); background: var(--success-bg); }
.job-page[data-job-status="failed"] .status-chip { color: var(--danger); background: var(--danger-bg); }
.job-page[data-job-status="awaiting_review"] .status-chip,
.job-page[data-job-status="manual_review"] .status-chip { color: var(--warning); background: var(--warning-bg); }
.processing-panel, .result-panel { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; padding: 1.25rem; border-radius: 0.7rem; }
.processing-panel { color: var(--brand-800); background: #f8eded; }
.processing-panel h2, .result-panel h2 { font-size: 1.1rem; }
.processing-panel p, .result-panel p { margin: 0.25rem 0 0; }
.loader { flex: 0 0 auto; width: 2.2rem; height: 2.2rem; border: 3px solid #d8adb6; border-top-color: var(--brand-700); border-radius: 50%; animation: spin 850ms linear infinite; }
.result-panel { flex-wrap: wrap; color: var(--success); background: var(--success-bg); }
.result-panel h2 { color: var(--success); }
.result-icon { display: grid; flex: 0 0 auto; width: 2.3rem; height: 2.3rem; place-items: center; background: #fff; border-radius: 50%; }
.result-icon svg { width: 1.35rem; height: 1.35rem; }
.result-panel .button { margin-left: auto; }
.warnings, .review-panel { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.warnings h2 { font-size: 1.1rem; }
.warnings ul { margin: 0.75rem 0 0; padding-left: 1.25rem; color: var(--ink-muted); }
.review-panel p { color: var(--ink-muted); }
.review-panel textarea { min-height: 20rem; margin: 0.5rem 0 1rem; padding: 0.8rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.45; resize: vertical; }

.site-footer { margin-top: auto; color: #d9c7c9; background: var(--brand-950); }
.site-footer .shell { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.15rem; font-size: 0.78rem; }
.site-footer span:first-child { color: #fff; font-weight: 750; }

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 800px) { .page-grid { grid-template-columns: 1fr; gap: 2.5rem; } .intro { max-width: 40rem; } }
@media (max-width: 560px) { .shell { width: min(100% - 2rem, 1120px); } .header-content { min-height: 4.7rem; } .brand small { display: none; } .brand-mark { width: 2.3rem; height: 2.3rem; } .section-tag { min-width: 0; white-space: normal; text-align: right; line-height: 1.25; } .page-grid { padding-block: 2.5rem; } h1 { font-size: clamp(2.15rem, 12vw, 3.2rem); } .card-heading, .job-heading { display: block; } .required-note { display: inline-block; margin-top: 0.75rem; white-space: normal; } .status-wrap { justify-items: start; margin-top: 1rem; text-align: left; } .form-footer { display: grid; } .privacy-note { max-width: none; } .button { width: 100%; } .result-panel { align-items: flex-start; } .result-panel .button { margin-left: 0; } .site-footer .shell { display: grid; gap: 0.25rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
