:root{--nav:#071d3a;--blue:#0b72e7;--bg:#f4f7fb;--text:#122a52;--muted:#66768f;--line:#dce6f0;--green:#16a566}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 "Segoe UI",Arial,sans-serif}.top{height:70px;background:#eaf4ff;border-bottom:1px solid #c9ddf3;display:flex;align-items:center;justify-content:space-between;padding:8px max(calc((100vw - 980px)/2),18px)}.top img{width:180px;height:54px;object-fit:contain}.secure{font-size:10px;font-weight:800;color:#0b5db7;letter-spacing:.7px}.wrap{max-width:700px;padding:28px 16px 55px;margin:auto}.intro{margin:0 0 18px}.intro h1{font-size:25px;color:#092453;margin:2px 0}.eyebrow{font-size:10px;font-weight:800;letter-spacing:1px;color:#0b72e7;margin:0}.muted,.hint{color:var(--muted)}.panel{background:#fff;border:1px solid var(--line);border-radius:13px;padding:22px;box-shadow:0 8px 26px #0b2a5009;margin-bottom:16px}.panel h2{margin:0 0 4px;font-size:19px;color:#092453}.hint{font-size:12px;margin:0 0 18px}label{display:block;font-weight:650;font-size:12px;margin:14px 0;color:#34495e}label small{display:block;font-weight:400;color:var(--muted);margin:3px 0 6px}input:not([type=radio]),select{display:block;width:100%;margin-top:6px;border:1px solid var(--line);border-radius:8px;padding:11px;background:#fff;color:var(--text);font:inherit}input[type=file]{padding:10px;font-size:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}fieldset{border:1px solid var(--line);border-radius:8px;margin:13px 0;padding:9px 12px}legend{font-size:12px;font-weight:700;color:#34495e}.radio{display:inline-flex;gap:7px;align-items:center;margin:3px 14px 5px 0}.radio input{accent-color:var(--blue)}fieldset small{display:block;color:var(--muted);font-size:11px}.hidden{display:none!important}button,.button{display:inline-flex;justify-content:center;border:0;border-radius:8px;background:var(--blue);color:white;padding:12px 16px;font-weight:750;text-decoration:none;cursor:pointer}button:disabled{opacity:.55;cursor:wait}#submitButton{width:100%;margin-top:6px}.message{font-size:12px;color:#bd3440;margin:10px 0 0}.message.ok{color:var(--green)}footer{text-align:center;font-size:11px;color:var(--muted);padding:12px}@media(max-width:520px){.top{height:58px;padding:6px 13px}.top img{width:155px}.wrap{padding:20px 12px 45px}.panel{padding:17px}.grid{grid-template-columns:1fr;gap:0}.intro h1{font-size:22px}}

.page-preview{border:1px solid #d6e4f3;border-radius:12px;background:#f7faff;padding:12px;margin:10px 0 16px}.preview-heading,.preview-footer{display:flex;align-items:center;justify-content:space-between;gap:10px}.preview-heading{font-size:13px;color:#092453}.preview-heading span,.preview-help{font-size:11px;color:var(--muted)}.preview-stage{display:flex;align-items:center;justify-content:center;gap:8px;margin:10px 0}.preview-stage #previewContent{flex:1;min-width:0;display:flex;justify-content:center;align-items:center;min-height:180px;background:#e8eef6;border-radius:8px;padding:8px;overflow:hidden}.preview-stage canvas,.preview-stage img{display:block;max-width:100%;max-height:390px;object-fit:contain;background:white;box-shadow:0 2px 10px #09245318}.preview-nav{flex:0 0 36px;width:36px;height:42px;padding:0;font-size:26px;line-height:1;background:#e0edfc;color:#0b5db7}.preview-footer{font-size:12px;font-weight:700;color:#34495e}.select-page{padding:9px 12px;font-size:11px;background:#0b72e7}.select-page.selected{background:#15925d}.preview-help{margin:8px 0 0}@media(max-width:520px){.page-preview{padding:9px}.preview-stage{gap:5px}.preview-stage #previewContent{padding:4px;min-height:140px}.preview-stage canvas,.preview-stage img{max-height:300px}.preview-nav{flex-basis:30px;width:30px}}

/* v0.3.6 customer order-page polish */
:root{--nav:#071d3a;--blue:#0878e8;--blue-dark:#075ec0;--bg:#f2f6fc;--text:#10284d;--muted:#62748c;--line:#d8e3f0;--green:#13885c}
body{background:linear-gradient(180deg,#eaf3ff 0,#f4f7fc 340px,#f4f7fc 100%);font-size:15px}
.top{position:sticky;top:0;z-index:5;backdrop-filter:blur(12px);box-shadow:0 4px 18px #0924530b}
.wrap{max-width:760px;padding-top:30px}
.intro{padding:4px 4px 8px}
.intro h1{font-size:clamp(27px,5vw,36px);letter-spacing:-.6px;font-weight:800}
.intro #shopDetails{font-size:15px;line-height:1.65}
.panel{border-radius:22px;border-color:#e0e8f2;padding:clamp(18px,4vw,30px);box-shadow:0 14px 40px #0b2a500c}
.panel h2{font-size:25px;letter-spacing:-.35px;margin-bottom:7px}
.privacy-note{padding:12px 14px;border-radius:12px;background:#f0f8f5;border:1px solid #d5eee3;color:#23664f;font-size:13px;line-height:1.6}
label{font-size:14px;font-weight:700;margin:19px 0;color:#2c405a}
label small{font-size:12px;line-height:1.5}
input:not([type=radio]):not([type=checkbox]),select{border:1px solid #d6e1ed;border-radius:12px;padding:14px 15px;min-height:50px;box-shadow:0 1px 2px #09245306;transition:border-color .15s,box-shadow .15s}
input:not([type=radio]):not([type=checkbox]):focus,select:focus{outline:none;border-color:#4d9af0;box-shadow:0 0 0 4px #0b72e71a}
input[type=file]{min-height:54px;background:#fbfdff}
button,.button{border-radius:12px;background:linear-gradient(135deg,#0b80ef,#075fc5);box-shadow:0 5px 12px #0b72e71f;transition:transform .15s,filter .15s}
button:hover,.button:hover{filter:brightness(1.04);transform:translateY(-1px)}
button:active,.button:active{transform:translateY(0)}
button:disabled{transform:none;box-shadow:none}
fieldset{border:1px solid #dce6f1;border-radius:14px;padding:14px 15px;margin:20px 0}
legend{padding:0 7px;font-size:14px}
fieldset .radio{font-size:13px;font-weight:600}
fieldset small,.settings-note{font-size:12px;line-height:1.6;color:var(--muted)}
.settings-fieldset>label{margin:12px 0}
.check-option{display:flex;align-items:flex-start;gap:10px;font-size:13px;font-weight:650;line-height:1.5}
.check-option input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;accent-color:var(--blue)}
.settings-note{margin:6px 0 0}
.page-preview{border:1px solid #d8e6f5;border-radius:16px;background:linear-gradient(180deg,#f7fbff,#eef5fd);padding:14px;margin:16px 0}
.preview-heading{font-size:14px}
.preview-heading strong{font-weight:800}
.preview-stage #previewContent{border:1px solid #dce6f1;background:#e7eff8;border-radius:12px;min-height:200px}
.preview-nav{border-radius:10px;box-shadow:none;flex:0 0 36px}
.preview-footer{margin-top:8px;align-items:center}
.select-page{font-size:12px;padding:10px 14px;box-shadow:none}
.select-page.selected{background:linear-gradient(135deg,#159b68,#0b7c51)}
#pageRangeWrap input{font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:.3px}
#submitButton{min-height:54px;font-size:15px;letter-spacing:.1px;margin-top:12px}
.message{font-size:13px;line-height:1.5}
#result{border-color:#cce9dc;background:#fbfffd}
footer{padding:20px 12px 28px}
@media(max-width:520px){.wrap{padding:18px 12px 40px}.panel{border-radius:18px;padding:18px}.panel h2{font-size:22px}.intro #shopDetails{font-size:14px}.top img{width:148px}.secure{font-size:9px}.preview-stage #previewContent{min-height:155px}}

/* v0.3.8: keep preview stage stable while navigating pages with different aspect ratios. */
.preview-stage #previewContent{height:420px;min-height:420px;max-height:420px;position:relative;flex:1 1 auto}
.preview-stage canvas,.preview-stage img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.preview-stage #previewContent canvas,.preview-stage #previewContent img{flex:0 0 auto}
@media(max-width:520px){.preview-stage #previewContent{height:330px;min-height:330px;max-height:330px}}

/* v0.5.0: service state and document preflight */
.preflight{border:1px solid #cfe3f7;background:#f3f9ff;border-radius:12px;padding:12px 14px;margin:12px 0;color:#18395f;font-size:12px;line-height:1.6}.preflight p{margin:4px 0 0;color:#536a84}#serviceClosed{border-color:#f0d5a8;background:#fffaf0}#serviceClosed h2{color:#8a5400}#serviceClosed p{margin-bottom:0;color:#705a38}


/* Price estimate: keep hidden until document/page selection is valid. */
.price-estimate { margin-top: 18px; }
.price-estimate-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.price-total { margin-left:auto; font-size:clamp(1.6rem, 4vw, 2.15rem); line-height:1.2; font-weight:800; color:#0759b5; text-align:right; white-space:nowrap; }
.price-estimate .muted { margin-bottom:0; }

/* Compact print properties and a paper-based preview. */
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.settings-grid.hidden{display:none}.settings-fieldset label{margin:10px 0}.preview-button{background:#e8f2fb;color:#12528b;border:1px solid #bed2e6;width:100%;margin:8px 0 0}.compact-preflight{font-size:12px;padding:10px}.compact-preflight strong{display:none}.compact-preflight p{margin:0}.privacy-note{font-size:12px;line-height:1.5}#uploadProgress{width:100%;height:12px;margin-top:15px;accent-color:#0967ab}#printPreviewDialog{width:min(650px,94vw);max-height:94dvh;overflow:auto;border:0;border-radius:16px;padding:18px;color:#172b3a;background:#f5f7fa;box-shadow:0 12px 50px #0004}#printPreviewDialog::backdrop{background:#10253999}.print-preview-head,.print-preview-nav{display:flex;align-items:center;justify-content:space-between;gap:12px}.print-preview-head h2{font-size:19px;margin:0}.print-preview-head button{padding:3px 12px;font-size:25px;background:transparent;color:#172b3a}.print-paper-stage{display:flex;justify-content:center;align-items:center;min-height:180px;padding:12px;background:#dfe5eb;border-radius:9px}.print-paper-stage canvas{max-width:100%;height:auto;background:white;box-shadow:0 2px 8px #23344630}.print-preview-nav{margin-top:14px}.print-preview-nav button{font-size:12px;padding:8px 11px}#printLayoutSummary,#printLayoutNote,#printPreviewPosition{font-size:12px;line-height:1.5}#printLayoutNote{color:#586b7c}#printPaperCanvas.monochrome{filter:grayscale(1)}@media(max-width:420px){.settings-grid{grid-template-columns:1fr;gap:0}#printPreviewDialog{padding:12px}.print-paper-stage{padding:7px}}
