:root {
  color-scheme: light;
  --ink: #202624; --muted: #626d67; --line: #dce3df; --green: #14745a;
  --paper: #fff; --soft: #f3f5f4; --amber: #965c16; --red: #a92f35;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #f5f7f6; color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .43; cursor: not-allowed; }
button, select, input { border-radius: 5px; }
button:focus-visible, select:focus-visible, input:focus-visible, .dropzone:focus-visible { outline: 3px solid #65b6a1; outline-offset: 2px; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 21px; font-weight: 650; line-height: 1.3; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
.topbar { padding: 18px 28px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); background: white; }
.brand-icon { color: var(--green); width: 30px; height: 30px; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; font-weight: 650; margin-bottom: 3px; }
.privacy { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.privacy svg { color: var(--green); }
main { max-width: 1510px; padding: 0 28px 18px; margin: auto; }
select, input { min-width: 0; width: 100%; border: 1px solid #cfd9d3; background: white; color: var(--ink); padding: 8px; height: 35px; font-size: 12px; }
.work-area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; padding-top: 22px; align-items: start; }
.processing-stack { display: grid; gap: 26px; min-width: 0; }
.intake { min-width: 0; border-top: 3px solid var(--green); }
.lane-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.lane-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.lane-head h2 svg { color: var(--green); width: 21px; height: 21px; }
.lane-head > span { font-size: 12px; color: var(--muted); }
.folio-lane { border-top-color: #a44851; }
.folio-lane .lane-head h2 svg, .folio-lane .dropzone svg { color: #a44851; }
.folio-lane .dropzone { border-color: #be9398; background: #fbf0f1; }
.folio-lane .dropzone.dragging { border-color: #a44851; background: #f7e0e3; }
.dropzone { border: 1px dashed #7dad99; background: #ecf5ef; min-height: 130px; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; flex-direction: column; border-radius: 6px; cursor: pointer; }
.dropzone svg { color: var(--green); width: 22px; height: 22px; }
.dropzone span { color: var(--muted); font-size: 12px; }
.dropzone.dragging { border: 2px solid var(--green); background: #dceee3; }
.dropzone[aria-disabled=true] { opacity: .5; cursor: wait; }
.download-lane { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; margin-top: 10px; border: 1px solid var(--line); background: white; color: var(--green); font-size: 13px; font-weight: 600; }
.download-lane:hover:not(:disabled) { border-color: var(--green); background: #ecf5ef; }
.folio-lane .download-lane { color: #a44851; }
.folio-lane .download-lane:hover:not(:disabled) { border-color: #a44851; background: #fbf0f1; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; border: 1px solid var(--line); background: white; color: #51615a; flex-shrink: 0; }
.icon-button:hover:not(:disabled) { border-color: #699b87; color: var(--green); }
.review-panel { padding: 0 12px 12px; min-width: 0; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-width: 0; }
.review-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; margin-top: 10px; }
.review-fields label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); min-width: 0; }
.item-status { font-size: 11px; color: #65726a; overflow-wrap: anywhere; }
.item-status.good { color: var(--green); }
.item-status.error { color: var(--red); }
.item-status.review { color: var(--amber); }
.progress { padding-top: 9px; font-size: 12px; color: var(--muted); }
.preview-tool { position: sticky; top: 16px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: white; overflow: hidden; }
.preview-mode { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 9px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; }
.view-tabs { display: flex; background: #f1f4f2; border-radius: 5px; padding: 3px; }
.view-tabs button { padding: 6px 8px; font-size: 11px; border: 0; background: none; color: var(--muted); }
.view-tabs .active { background: white; color: var(--green); }
.preview-document { display: flex; align-items: center; gap: 8px; padding: 0 12px 11px; }
.preview-name { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
#pendingCount { max-width: 70px; font-size: 11px; color: var(--muted); }
.paper-area { padding: 18px; background: #e5eae7; min-height: 300px; height: min(68vh, 690px); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#previewPages { display: grid; grid-template-rows: repeat(var(--preview-count, 2), minmax(0, 1fr)); gap: 12px; width: 100%; height: 100%; }
.preview-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin: 0; min-width: 0; min-height: 0; }
.preview-page canvas { display: block; max-width: 100%; max-height: calc(100% - 18px); width: auto; height: auto; box-shadow: 0 2px 8px #26362d22; background: white; }
.preview-page figcaption { flex: 0 0 14px; font-size: 11px; line-height: 14px; color: var(--muted); }
#previewEmpty { display: grid; gap: 12px; justify-items: center; color: #7e8e82; font-size: 13px; }
#previewEmpty svg { width: 46px; height: 46px; stroke-width: 1.1; }
.preview-footer { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 9px; }
#pageLabel { min-width: 60px; text-align: center; color: var(--muted); font-size: 12px; }
#downloadPreview { margin-left: auto; }
footer { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; color: #7c8680; font-size: 11px; display: flex; justify-content: space-between; gap: 12px; }
.toast { position: fixed; bottom: 20px; left: 20px; z-index: 5; background: #263e34; color: white; padding: 12px 16px; max-width: min(420px, calc(100% - 40px)); border-radius: 6px; font-size: 13px; box-shadow: 0 2px 12px #0003; overflow-wrap: anywhere; }
.alert { padding: 15px 28px; color: var(--red); background: #fff0ef; }
@media (max-width: 950px) {
  main { padding-inline: 18px; }
  .work-area { gap: 20px; }
}
@media (max-width: 760px) {
  .topbar { padding: 14px; gap: 9px; } h1 { font-size: 18px; }
  .privacy { font-size: 0; } .privacy svg { width: 20px; }
  main { padding-inline: 12px; }
  .work-area { grid-template-columns: 1fr; }
  .preview-tool { position: static; }
  .paper-area { min-height: 300px; height: 480px; }
  footer { flex-wrap: wrap; }
}
