@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root { --blue:#1f3c71; --blue-deep:#18305c; --bronze:#9a6b3f; --gold:#c9a96a; --ink:#1b2a4a; --muted:#5c6575; --faint:#8a93a3; --line:#ece7db; --wash:#fbf7ee; --paper:#ffffff; --accent:var(--bronze); --action:var(--blue); --soft:#f6f1e6; --white:#ffffff; --sans:'Inter', system-ui, -apple-system, sans-serif; --serif:'Spectral', Georgia, serif; }
* { box-sizing:border-box; }
html { min-height:100%; background:var(--paper); -webkit-text-size-adjust:100%; }
body { margin:0; min-height:100vh; min-height:100dvh; color:var(--ink); background-color:#fff; background-image:radial-gradient(110% 42% at 50% 0%, var(--wash) 0%, #ffffff 68%); font-family:var(--sans); -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent; touch-action:pan-y; }
::selection { background:rgba(154,107,63,.22); }
button, input { font:inherit; }
button { cursor:pointer; }
.app-header { position:sticky; top:0; z-index:10; display:flex; align-items:center; justify-content:space-between; min-height:64px; padding:env(safe-area-inset-top) 22px 0; height:calc(64px + env(safe-area-inset-top)); color:var(--ink); border-bottom:1px solid var(--line); background:var(--wash); }
.brand { display:flex; align-items:center; }
.brand img { display:block; width:auto; max-width:65vw; height:36px; }
.icon-button { display:grid; place-items:center; width:42px; height:42px; padding:0; color:inherit; border:1px solid var(--line); border-radius:50%; background:transparent; font-size:24px; line-height:1; }
.app-main { width:min(100%, 700px); margin:0 auto; padding:12px 22px 16px; }
.intro { max-width:420px; margin:0 auto; padding-top:clamp(8px, 3vh, 28px); text-align:center; }
.eyebrow { color:var(--bronze); font-family:var(--sans); font-size:10.5px; font-weight:700; letter-spacing:.24em; text-transform:uppercase; }
.intro .eyebrow { display:flex; align-items:center; justify-content:center; gap:12px; white-space:nowrap; margin-bottom:22px; }
.intro .eyebrow::before, .intro .eyebrow::after { content:''; flex:none; width:30px; height:1px; background:var(--gold); }
h1, h2, p { margin:0; }
h1, h2 { font-family:var(--serif); font-weight:500; color:var(--blue); }
h1 { font-size:clamp(2.9rem, 13.2vw, 3.375rem); letter-spacing:-.015em; line-height:1.08; }
h1 em { color:var(--bronze); font-style:italic; font-weight:500; }
h1::after { content:''; display:block; width:56px; height:2px; margin:26px auto 0; border-radius:1px; background:linear-gradient(90deg, var(--bronze), #d9bc82); }
h2 { margin-top:8px; font-size:30px; letter-spacing:-.01em; line-height:1.1; }
.intro > p { max-width:305px; margin:20px auto 0; color:var(--muted); font-size:17px; line-height:1.72; letter-spacing:-.005em; }
.primary-button, .secondary-button { min-height:54px; padding:0 34px; border-radius:999px; font-size:16px; font-weight:600; letter-spacing:.02em; transition:transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.primary-button:active, .secondary-button:active, .text-button:active { transform:translateY(1px); }
.primary-button { color:#fff; border:none; background:var(--blue); box-shadow:0 16px 34px -14px rgba(31,60,113,.55); }
.primary-button:hover { background:var(--blue-deep); transform:translateY(-1px); box-shadow:0 20px 38px -14px rgba(31,60,113,.6); }
.primary-button span { margin-right:10px; font-size:21px; font-weight:500; line-height:1; vertical-align:-1px; }
.secondary-button { color:var(--blue); border:1px solid var(--line); background:#fff; }
button:focus-visible, input:focus-visible { outline:2px solid var(--bronze); outline-offset:3px; }
.intro .primary-button { margin-top:30px; }
.privacy-note, .intro > p.privacy-note { display:flex; align-items:center; justify-content:center; gap:9px; max-width:none; margin:48px 0 0; color:var(--faint); font-size:13px; line-height:1.4; letter-spacing:.01em; }
.privacy-note svg { flex:none; width:15px; height:15px; fill:none; stroke:var(--bronze); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.workspace { padding-top:6px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:20px; }
.text-button { padding:8px 0; color:var(--accent); border:0; background:transparent; font-size:13px; font-weight:800; }
.helper { margin:14px 0 24px; color:var(--muted); font-size:13px; line-height:1.5; }
.duplicate-notice { margin:-10px 0 18px; padding:10px 12px; color:#76551b; border-left:3px solid #d9a441; background:#f8edcf; font-size:12px; line-height:1.45; }
.duplicate-notice .text-button { margin-left:6px; font-size:12px; }
.page-warning { margin:-10px 0 18px; padding:10px 12px; color:#7a4a25; border-left:3px solid var(--accent); background:#f7ece3; font-size:12px; line-height:1.45; }
.duplicate-modal { width:min(100%, 560px); max-height:calc(100dvh - 28px); margin:auto; overflow:auto; padding:20px; border-radius:18px 18px 12px 12px; background:var(--white); box-shadow:0 20px 70px rgba(0,0,0,.25); }
.duplicate-groups { display:grid; gap:14px; margin-top:18px; }
.duplicate-group { padding:10px; border:1px solid var(--line); border-radius:10px; background:var(--soft); }
.duplicate-group-title { margin-bottom:8px; color:var(--muted); font-family:var(--sans); font-size:10px; }
.duplicate-pair { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.duplicate-pair figure { margin:0; min-width:0; }
.duplicate-pair img { display:block; width:100%; height:150px; border-radius:6px; object-fit:cover; background:#fff; }
.duplicate-pair figcaption { overflow:hidden; margin-top:5px; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.photo-list { display:grid; gap:10px; }
.photo-card { position:relative; display:grid; grid-template-columns:28px 70px 1fr 38px; align-items:center; gap:12px; min-height:92px; padding:10px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 10px 26px -18px rgba(27,42,74,.35); user-select:none; touch-action:none; transition:box-shadow .16s ease, opacity .16s ease, transform .16s ease; }
.photo-card.dragging { opacity:.45; box-shadow:0 12px 28px rgba(9,41,155,.14); }
.drag-handle { color:#999286; font-size:20px; letter-spacing:-5px; }
.photo-number { position:absolute; left:48px; top:16px; z-index:1; box-shadow:0 0 0 2px #fff; display:grid; place-items:center; width:25px; height:25px; color:#fff; border-radius:50%; background:var(--action); font-family:var(--sans); font-size:11px; }
.thumb { width:70px; height:70px; border-radius:7px; object-fit:cover; background:var(--soft); }
.photo-meta { min-width:0; }
.photo-name { overflow:hidden; color:var(--ink); font-size:13px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.photo-status { margin-top:5px; color:var(--muted); font-family:var(--sans); font-size:10px; }
.remove-button { display:grid; place-items:center; width:36px; height:36px; color:var(--muted); border:0; border-radius:50%; background:transparent; font-size:25px; }
.actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:24px; }
.create-button { min-height:54px; padding:0 12px; font-size:14px; touch-action:manipulation; }
.processing, .result { max-width:500px; margin:0 auto; text-align:center; }
.processing-icon { margin:18px 0 28px; color:var(--accent); font-size:58px; line-height:1; animation:spin 1.6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.processing h2, .result h2 { margin-top:12px; }
.processing p, .result p { margin-top:12px; color:var(--muted); font-size:13px; line-height:1.6; }
.progress-track { height:8px; margin:28px 0 16px; overflow:hidden; border-radius:20px; background:var(--soft); }
.progress-bar { width:0; height:100%; border-radius:20px; background:var(--action); transition:width .25s ease; }
.processing-note { max-width:360px; margin:32px auto 0 !important; font-size:11px !important; }
.result-review { margin-top:24px; text-align:left; }
.result-review summary { color:var(--accent); cursor:pointer; font-size:14px; font-weight:800; }
.result-photos { display:grid; gap:10px; margin-top:12px; }
.result-photo { padding:10px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.result-photo-heading { display:flex; align-items:center; gap:12px; }
.result-photo-thumb { width:56px; height:56px; flex:none; border-radius:6px; object-fit:cover; }
.result-photo-info { flex:1; min-width:0; overflow-wrap:anywhere; font-size:12px; line-height:1.5; }
.result-photo-info strong { display:block; }
.result-photo button { flex:none; padding:8px; }
.result-crops { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.result-crops figure { min-width:0; margin:0; }
.result-crops figcaption { margin-bottom:5px; overflow-wrap:anywhere; color:var(--ink); font-size:12px; font-weight:700; line-height:1.4; }
.result-crop-image { display:grid; place-items:center; min-height:60px; overflow:hidden; border-radius:6px; background:var(--soft); }
.result-crop-image img { display:block; width:100%; height:auto; }
.result-crop-image span { padding:8px; color:var(--muted); font-size:11px; }
.review-actions { display:flex; justify-content:flex-end; gap:10px; }
.result-badge { display:grid; place-items:center; width:64px; height:64px; margin:8px auto 26px; color:#fff; border-radius:50%; background:var(--blue); font-size:31px; }
.pdf-results { display:grid; gap:10px; margin-top:28px; text-align:left; }
.pdf-card { padding:15px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 10px 26px -18px rgba(27,42,74,.35); }
.pdf-card-title { overflow:hidden; font-family:var(--sans); font-size:12px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.pdf-card-meta { margin-top:7px; color:var(--muted); font-size:11px; line-height:1.5; }
.pdf-card-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:13px; }
.pdf-action { min-height:42px; padding:0 10px; font-size:12px; }
.restart-button { margin-top:24px; }
.toast { position:fixed; z-index:30; right:18px; bottom:18px; left:18px; max-width:500px; margin:auto; padding:14px 16px; color:#fff; border-radius:10px; background:var(--ink); box-shadow:0 8px 25px rgba(0,0,0,.2); font-size:13px; opacity:0; pointer-events:none; transform:translateY(12px); transition:opacity .2s, transform .2s; }
.toast.visible { opacity:1; transform:translateY(0); }
.modal-backdrop { position:fixed; z-index:20; inset:0; display:grid; align-items:end; padding:14px; background:rgba(27,42,74,.5); }
.modal-backdrop:has(.review-modal:not([hidden])) { align-items:stretch; padding:0; background:var(--wash); }
.review-modal { width:min(100%, 540px); max-height:calc(100dvh - 28px); margin:auto; overflow:hidden; padding:20px; border-radius:18px 18px 12px 12px; background:var(--white); box-shadow:0 20px 70px rgba(0,0,0,.25); }
.modal-backdrop:has(.review-modal:not([hidden])) .review-modal { width:100%; max-width:760px; max-height:none; height:100dvh; overflow:auto; padding:calc(20px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom)); border-radius:0; box-shadow:none; }
.modal-heading { display:flex; align-items:start; justify-content:space-between; gap:16px; }
.modal-heading .icon-button { color:var(--ink); border-color:var(--line); }
.review-image { display:block; width:100%; max-height:42vh; margin:20px 0 14px; border-radius:8px; object-fit:contain; background:var(--soft); }
.zoom-previews { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:18px 0 16px; }
.zoom-preview { min-width:0; margin:0; padding:8px; border:1px solid var(--line); border-radius:9px; background:var(--soft); }
.zoom-preview figcaption { margin-bottom:6px; color:var(--muted); font-family:var(--sans); font-size:9px; line-height:1.2; text-transform:uppercase; }
.zoom-viewport { width:100%; max-height:360px; overflow:hidden; border-radius:5px; background:#fff; cursor:grab; touch-action:pan-y; }
.zoom-preview img { display:block; width:100%; height:100%; border-radius:5px; object-fit:contain; object-position:center; transform:translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1.8)); transform-origin:center; user-select:none; }
.zoom-preview img.panning { cursor:grabbing; }
.page-detection { margin:0 0 12px; color:var(--muted); font-family:var(--sans); font-size:10px; line-height:1.4; }
.modal-copy { margin:0 0 18px; color:var(--muted); font-size:13px; line-height:1.55; }
.review-modal label { display:block; margin:13px 0; color:var(--ink); font-size:12px; font-weight:800; }
.review-modal input { display:block; width:100%; min-height:48px; margin-top:7px; padding:0 12px; border:1px solid var(--line); border-radius:8px; outline:none; background:#fff; font-size:13px; }
.review-modal input:focus { border-color:var(--accent); }
.review-modal .primary-button { width:100%; margin-top:8px; }
[hidden] { display:none !important; }
@media (min-width:650px) { .app-main { padding-right:34px; padding-left:34px; } .actions { grid-template-columns:1fr 1.5fr; } .workspaceAddButton { order:0; } }
@media (max-width:600px) { .zoom-previews { grid-template-columns:1fr; gap:18px; } .zoom-preview figcaption { font-size:11px; } .review-field > label { margin:8px 0 0; } .result-crops { grid-template-columns:1fr; } }
@media (max-height:760px) { .review-modal { padding:14px; } .zoom-previews { gap:8px; margin:12px 0; } .zoom-preview { padding:6px; } .zoom-viewport { max-height:240px; } .review-modal label { margin:8px 0; } .review-modal input { min-height:42px; } }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; } }
.pdf-card-note { margin-top:10px; padding:9px 11px; color:#7a4a25; border-left:3px solid var(--accent); border-radius:4px; background:#f7ece3; font-size:12px; line-height:1.45; }
.access-form { grid-column:1 / -1; min-width:0; margin-bottom:10px; } .access-label { display:block; margin-bottom:8px; font-size:13px; font-weight:500; } .access-row { display:flex; min-width:0; gap:8px; } .access-input { flex:1 1 0; min-width:0; min-height:48px; padding:0 12px; font-size:16px; border:1px solid var(--line); border-radius:10px; background:var(--white); } .access-button { flex:0 0 auto; min-height:48px; padding:0 18px; }
.access-error { min-height:16px; margin-top:6px; color:#7a4a25; font-size:12px; }
