:root{--brand:#f5a623;--orange:#d4881a;--ink:#172033;--muted:#59647a;--line:#e6e8ee;--cream:#fff8ed;--shadow:0 8px 35px rgba(31,40,62,.07)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f7f8fb;font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--ink);font-size:14px}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}a{color:#a56305}
.topbar{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:12px max(20px,calc((100vw - 1220px)/2));background:white;border-bottom:1px solid var(--line);min-height:68px}.brand{font-weight:850;color:#222;text-decoration:none;display:flex;align-items:center;gap:9px;font-size:21px}.brand img{width:35px;height:35px}.brand span{color:var(--orange)}.top-links{display:flex;align-items:center;gap:14px}.top-links a{font-size:13px;font-weight:650;text-decoration:none;color:#555}.new-pill{background:#fff0d2;color:#885007;font-size:11px;padding:6px 10px;border-radius:99px;font-weight:800}.top-links a:hover{color:var(--orange)}
main{max-width:1190px;margin:0 auto;padding:27px 20px 75px}.intro{display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:22px}.eyebrow{letter-spacing:.11em;color:#ae6e12;font-size:11px;font-weight:850;text-transform:uppercase}.intro h1{font-size:clamp(29px,3.7vw,42px);letter-spacing:-.04em;line-height:1.12;margin:8px 0 11px}.intro h1 em{font-style:normal;color:var(--orange)}.intro p{max-width:640px;color:var(--muted);font-size:14px;line-height:1.65;margin:0}.local-chip{background:#fff4db;padding:11px 15px;border-radius:13px;color:#674411;font-size:12px;font-weight:700;white-space:nowrap;align-self:flex-start;margin-top:12px}
.upload-card{background:white;border:2px dashed #edc47b;border-radius:20px;padding:31px 22px;text-align:center;box-shadow:var(--shadow);margin-bottom:18px;transition:border-color .15s,background .15s}.upload-card.drag-on{background:#fff6e4;border-color:#d68d12}.upload-icon{width:62px;height:62px;background:var(--cream);border-radius:18px;display:grid;place-items:center;font-size:28px;margin:0 auto 12px}.upload-card h2{margin:0 0 8px;font-size:19px}.upload-card p{color:var(--muted);margin:0 auto 17px;max-width:480px;line-height:1.6}.pill-button,.secondary-button{border-radius:999px;border:1px solid transparent;min-height:42px;padding:11px 20px;font-weight:750;display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none;transition:background .14s,box-shadow .14s}.pill-button{background:var(--brand);color:#1d1c20;box-shadow:0 4px 12px rgba(245,166,35,.16)}.pill-button:hover{background:#eb9811}.secondary-button{background:white;border-color:#e0e4eb;color:#283044}.secondary-button:hover{border-color:#dbaa5d;background:#fff8ed}.tiny-button{border:1px solid #e1e5ec;background:white;border-radius:9px;padding:8px 11px;font-weight:700;color:#3d4658;font-size:12px;min-height:36px}.tiny-button:hover{background:var(--cream);border-color:#e8ba68}.upload-card input{display:none}.upload-meta{font-size:11px!important;margin-top:12px!important}.hidden{display:none!important}
.workspace{display:grid;grid-template-columns:232px minmax(0,1fr);gap:16px;align-items:start}.workspace>*{min-width:0}.side-panel,.editor-card,.preview-card{border:1px solid var(--line);background:white;border-radius:17px;box-shadow:var(--shadow)}.side-panel{padding:14px;position:sticky;top:12px}.panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.panel-heading h2{margin:0;font-size:15px}.count{font-size:11px;padding:3px 8px;border-radius:12px;background:var(--cream);color:#895405}.page-list{display:flex;flex-direction:column;gap:9px;max-height:60vh;overflow:auto;padding:1px}.page-row{display:flex;align-items:center;gap:8px;padding:7px;border-radius:10px;border:1.5px solid #e6e7eb;background:white;text-align:left;min-width:0;width:100%;color:var(--ink)}.page-row.selected{border-color:var(--brand);background:#fff9ed}.page-row img{width:49px;height:62px;object-fit:contain;background:#eaecef;border-radius:5px}.page-row span{min-width:0}.page-row strong{font-size:12px;display:block}.page-row small{display:block;color:#737b8a;font-size:10px;line-height:1.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:14px}.sidebar-actions button{font-size:12px;min-height:36px;padding:8px 5px}.sidebar-actions .wide{grid-column:1/-1}.sidebar-note{color:#77808e;font-size:11px;line-height:1.6;margin:13px 1px 0}
.editor-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}.editor-card,.preview-card{padding:17px}.card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:13px}.card-heading h2{font-size:15px;margin:0 0 4px}.card-heading p{margin:0;font-size:11px;color:#7a8391}.stage{position:relative;margin:auto;background:#eae9e7;border-radius:12px;overflow:hidden;width:100%;min-height:230px;display:flex;justify-content:center;align-items:center}.stage canvas,.preview-stage canvas{display:block;width:100%;height:auto;max-height:550px;object-fit:contain}.stage .corner-layer{position:absolute;inset:0;touch-action:none}.corner-layer svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.corner-path{fill:rgba(245,166,35,.11);stroke:#f5a623;stroke-width:5;stroke-linejoin:round;vector-effect:non-scaling-stroke;stroke-dasharray:10 6}.corner{width:27px;height:27px;border:3px solid #fff;background:#f2a522;box-shadow:0 1px 8px #0006;position:absolute;border-radius:50%;transform:translate(-50%,-50%);touch-action:none;cursor:grab;z-index:3}.corner:focus-visible{outline:3px solid #1267c9}.corner:active{cursor:grabbing;background:#e48615}.stage-empty,.preview-empty{color:#8e97a7;font-size:12px;text-align:center;padding:38px 24px}.preview-stage{min-height:230px;max-height:570px;display:grid;place-items:center;background:repeating-conic-gradient(#f1f2f5 0 25%,#fafbfc 0 50%) 0/22px 22px;border-radius:12px;overflow:hidden}.preview-stage canvas{width:auto;height:auto;max-width:100%;max-height:550px;box-shadow:0 2px 15px #0001}.under-stage{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.help-tip{margin:9px 1px 0;font-size:11px;color:#6f798a;line-height:1.55}.status{margin:10px 0 0;min-height:22px;font-size:12px;color:#656e7d}.status.error{color:#b91c1c}.status.success{color:#167541}
.settings{border:1px solid var(--line);border-radius:17px;background:white;margin-top:15px;padding:17px;box-shadow:var(--shadow)}.settings h2{margin:0 0 15px;font-size:16px}.settings-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:14px}.setting>label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:750;color:#354056;font-size:12px;margin-bottom:10px}.setting output{font-size:11px;color:#b27514}.segmented{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.segmented button{border:1px solid #e2e6ed;background:#fff;color:#444e60;font-size:11px;line-height:1.25;border-radius:9px;padding:9px 4px;min-height:40px;font-weight:700}.segmented button.active{background:#fff2d8;border-color:var(--brand);color:#9b5f09}.setting input[type=range]{width:100%;accent-color:#e69b23;min-height:24px}.setting select,.export-settings select{border:1px solid #dfe3e9;border-radius:10px;padding:11px;width:100%;background:#fff;font-weight:650;color:#354056;min-height:43px}.setting-help{font-size:11px;color:#7c8595;line-height:1.5;margin-top:5px}.export-settings{display:flex;gap:12px;flex-wrap:wrap;align-items:end}.export-settings>label{display:grid;gap:6px;min-width:130px;font-size:11px;color:#697388;font-weight:750}.export-settings .export-format{min-width:160px}.export-settings .pill-button{min-width:170px}.export-card{margin-top:16px;padding:16px 18px;border:1px solid #f1daa8;background:#fff9ed;border-radius:16px}.export-card h2{font-size:15px;margin:0 0 12px}.export-card p{color:#6b7280;font-size:11px;margin:9px 0 0;line-height:1.55}.progress{background:#e8e9eb;border-radius:99px;height:6px;overflow:hidden;margin-top:9px;display:none}.progress>span{display:block;background:var(--brand);height:100%;width:0;transition:width .14s}.message{font-size:12px;margin:9px 0 0;font-weight:700;color:#7b571e;min-height:17px}.message.error{color:#b91c1c}.message.ok{color:#177346}.content-guide{margin-top:24px;border-radius:16px;background:white;border:1px solid var(--line);padding:25px;line-height:1.8}.content-guide h2{font-size:20px}.content-guide h3{font-size:16px;margin:24px 0 7px}.content-guide p,.content-guide li{color:#4c576b}.content-guide details{border-bottom:1px solid #edf0f2;padding:12px 0}.content-guide summary{cursor:pointer;font-weight:700}.warning{border-left:3px solid #dd8b1b;background:#fff9ee;padding:12px 14px;border-radius:8px;color:#71490f;font-size:12px;line-height:1.65}.site-footer{border-top:1px solid #ede3d3;background:var(--cream);padding:22px;text-align:center;color:#656a77;font-size:12px}.site-footer a{text-decoration:none;margin:0 9px}
@media(max-width:1000px){.workspace{grid-template-columns:188px minmax(0,1fr)}.editor-grid{grid-template-columns:1fr}.settings-grid{grid-template-columns:1fr 1fr}}
@media(max-width:720px){main{padding:19px 12px 48px}.intro{display:block}.local-chip{display:inline-block;margin-top:12px}.workspace{display:block}.side-panel{position:static;margin-bottom:12px}.page-list{flex-direction:row;overflow-x:auto;max-height:none;padding-bottom:5px}.page-row{width:130px;min-width:130px;flex-shrink:0}.page-row img{width:38px;height:50px}.sidebar-actions{display:flex;flex-wrap:wrap}.sidebar-actions button{flex:1 1 100px}.sidebar-actions .wide{flex:1 1 100px}.settings-grid{grid-template-columns:1fr}.upload-card{padding:22px 16px}.editor-card,.preview-card,.settings{padding:13px}.stage,.preview-stage{min-height:190px}.topbar{padding:10px 12px}.brand{font-size:18px}.new-pill{display:none}.top-links{gap:10px}.top-links a{font-size:11px}.card-heading h2{font-size:14px}.export-settings>*{flex:1}.export-settings .pill-button{width:100%}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}

/* Eight fully visible, equally usable orange round crop handles. */
.stage{overflow:visible}
.stage #originalCanvas{border-radius:12px}
.corner,.edge-handle{width:34px;height:34px;border:3px solid #fff;background:#f5a623;
  color:#4b2b08;font-size:14px;font-weight:850;line-height:1;border-radius:50%;
  box-shadow:0 2px 2px #0003,0 2px 10px #0008;position:absolute;
  transform:translate(-50%,-50%);touch-action:none;user-select:none;
  -webkit-user-select:none;-webkit-tap-highlight-color:transparent;cursor:grab;z-index:5;
  display:flex;align-items:center;justify-content:center;padding:0;}
.corner:active,.edge-handle:active{cursor:grabbing;background:#f0a22b;transform:translate(-50%,-50%) scale(1.12)}
.corner:focus-visible,.edge-handle:focus-visible{outline:3px solid #0e7994;outline-offset:2px}
.edge-handle{background:#ffd077;border-color:#fff;z-index:6}
@media(max-width:720px){.corner,.edge-handle{width:41px;height:41px;font-size:15px}}
.preview-stage{position:relative}
#foldLayer{position:absolute;inset:0;width:100%;height:100%;max-height:none;display:block;z-index:2;pointer-events:none;touch-action:auto;box-shadow:none!important}
#foldLayer.drawing{pointer-events:auto;touch-action:none;cursor:crosshair}
.fold-controls{margin-top:17px;padding-top:16px;border-top:1px solid #e9edf2;display:grid;grid-template-columns:1fr 1fr auto;align-items:center;gap:12px}
.fold-buttons{display:flex;gap:8px;flex-wrap:wrap}.fold-buttons .tiny-button.active{background:#fff3dd;border-color:#f5a623;color:#784405}
.fold-controls>.setting-help{grid-column:1/-1;max-width:780px}
@media(max-width:720px){.fold-controls{grid-template-columns:1fr 1fr}.fold-buttons{grid-column:1/-1}}
