:root {
  color-scheme: dark;
  --paper: #111a1c;
  --sheet: #1c292b;
  --ink: #f3f5f0;
  --muted: #c5d3d0;
  --quiet: #b6c7c2;
  --staff: #405557;
  --control-border: #819b99;
  --accent: #a8e1d8;
  --accent-hover: #ccf4eb;
  --on-accent: #102426;
  --focus: #ffc980;
  --error: #ffb8aa;
  --error-wash: #432b2b;
  --success-wash: #253c3b;
  --control: #142124;
}
html[data-theme="light"] {
  color-scheme: light;
  --paper: #f7f6f0;
  --sheet: #fffefa;
  --ink: #1a252a;
  --muted: #46545a;
  --quiet: #5b676b;
  --staff: #d8d9d1;
  --control-border: #849092;
  --accent: #164b50;
  --accent-hover: #103b3f;
  --on-accent: #fff;
  --focus: #a53d08;
  --error: #8e1f16;
  --error-wash: #fff1ed;
  --success-wash: #e8f2eb;
  --control: #fbfbf7;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.shell { width: min(100% - 40px, 1120px); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 10; padding: 12px 16px; background: var(--sheet); color: var(--ink); }
.skip-link:focus { top: 12px; }
.site-header { border-bottom: 1px solid var(--staff); background: var(--sheet); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.language-switch { min-width: 76px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 5px; background: var(--sheet); color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.language-switch:hover { background: var(--success-wash); }
.wordmark { color: var(--ink); font-size: 21px; font-weight: 800; letter-spacing: .1em; text-decoration: none; }
.brand-staff { display: inline-block; margin-right: 5px; color: var(--accent); font-size: 31px; line-height: .6; vertical-align: -3px; }
.header-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.intro { max-width: 860px; padding: 76px 0 56px; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font: 600 clamp(40px, 5.1vw, 66px)/1.1 Georgia, 'Times New Roman', serif; letter-spacing: -.035em; text-wrap: balance; }
h1 em { color: var(--accent); font-style: normal; }
.lead { max-width: 660px; margin: 0; color: var(--muted); font-size: 20px; line-height: 1.55; text-wrap: pretty; }
.work-area { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 22px; align-items: start; }
.upload-panel, .process-panel, .result-panel { background: var(--sheet); border: 1px solid var(--staff); border-radius: 12px; padding: 32px; }
.upload-panel { box-shadow: 0 8px 28px rgba(17, 37, 36, .05); }
.panel-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.panel-heading h2 { margin: 0; font: 600 26px/1.25 Georgia, 'Times New Roman', serif; letter-spacing: -.02em; }
.step-number { color: var(--accent); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.field + .field { margin-top: 30px; }
label { display: block; margin-bottom: 5px; font-weight: 700; }
.field-hint { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
input[type=file], input[type=password] { width: 100%; min-height: 48px; padding: 11px 12px; color: var(--ink); background: var(--control); border: 1.5px solid var(--control-border); border-radius: 6px; }
input[type=file] { cursor: pointer; }
input[type=file]::file-selector-button { margin-right: 14px; padding: 8px 12px; background: var(--sheet); border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font: 700 14px Arial, Helvetica, sans-serif; cursor: pointer; }
input[type=password]:disabled, input[type=file]:disabled { opacity: .65; cursor: not-allowed; }
.selection { min-height: 24px; margin: 10px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.primary-button, .download-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 52px; padding: 13px 22px; border: 0; border-radius: 5px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-button { margin-top: 31px; }
.primary-button:hover, .download-button:hover { background: var(--accent-hover); color: var(--on-accent); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.primary-button span[aria-hidden=true], .download-button span[aria-hidden=true] { font-size: 22px; line-height: 1; }
.error { margin-top: 23px; padding: 14px 16px; background: var(--error-wash); border-left: 4px solid var(--error); color: var(--error); font-weight: 700; }
.process-panel { background: transparent; }
.process-list { margin: 0; padding: 0; list-style: none; }
.process-list li { display: flex; gap: 17px; padding: 0 0 24px; }
.process-list li + li { padding-top: 20px; border-top: 1px solid var(--staff); }
.process-list li > span { min-width: 23px; color: var(--accent); font: 24px/1 Georgia, serif; }
.process-list strong { display: block; margin-bottom: 3px; }
.process-list p { margin: 0; color: var(--muted); font-size: 15px; }
.privacy-note { margin: 5px 0 0; padding-top: 24px; border-top: 1px solid var(--staff); color: var(--quiet); font-size: 14px; }
.result-panel { margin-top: 24px; margin-bottom: 80px; }
.result-panel .panel-heading { margin-bottom: 17px; }
#job-status { margin-bottom: 12px; font-weight: 600; }
progress { display: block; width: 100%; height: 13px; accent-color: var(--accent); }
.page-results { margin: 22px 0 0; padding-left: 25px; }
.page-results li { padding: 7px 0; overflow-wrap: anywhere; }
.page-results li[data-status=review] { color: var(--error); }
.page-results li[data-status=skipped] { color: var(--muted); }
.download-panel { margin-top: 30px; padding: 25px; border-radius: 7px; background: var(--success-wash); }
.download-panel h3 { margin-bottom: 8px; font: 600 24px Georgia, serif; }
.download-panel p { margin-bottom: 18px; }
.retry-button { min-height: 44px; margin-top: 20px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 5px; background: var(--sheet); color: var(--accent); font-weight: 700; cursor: pointer; }
.retry-button:hover { background: var(--success-wash); }
.site-footer { padding: 27px 0; border-top: 1px solid var(--staff); color: var(--muted); font-size: 14px; }
.noscript { margin: 24px 0; color: var(--error); }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 620px); }
  .intro { padding: 52px 0 36px; }
  h1 { font-size: clamp(37px, 10vw, 52px); }
  .lead { font-size: 18px; }
  .work-area { grid-template-columns: 1fr; }
  .upload-panel, .process-panel, .result-panel { padding: 23px; }
  .header-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
