:root{
  --ink:#0b1220;
  --text:#334155;
  --muted:#64748b;
  --line:#e3e8ef;
  --bg:#f5f7fb;
  --panel:#fff;
  --stage:#eef2f8;
  --brand:#2563eb;
  --brand-d:#1d4ed8;
  --soft:#eef4ff;
  --ok:#15803d;
  --radius:16px;
  --shadow:0 1px 2px rgba(11,18,32,.04),0 10px 32px rgba(11,18,32,.07);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--bg);color:var(--text);
  font:16px/1.65 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--brand)}
img,canvas{max-width:100%}
.wrap{max-width:1200px;margin:0 auto;padding:0 20px}
.hidden{display:none!important}
svg.i{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- header ---------- */
.site-header{background:rgba(255,255,255,.92);backdrop-filter:saturate(1.4) blur(8px);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-weight:800;font-size:19px;letter-spacing:-.3px}
.brand svg{width:32px;height:32px}
.brand b{color:var(--brand);font-weight:800}
.nav{display:flex;align-items:center;gap:6px}
.nav a{color:var(--text);text-decoration:none;font-weight:600;font-size:15px;padding:8px 12px;border-radius:8px}
.nav a:hover{background:var(--bg);color:var(--ink)}
.nav a.cta{background:var(--brand);color:#fff;margin-left:6px;white-space:nowrap}
.nav a.cta:hover{background:var(--brand-d)}

/* ---------- hero ---------- */
.hero{background:linear-gradient(180deg,#eaf1ff 0%,var(--bg) 100%);padding:34px 0 52px;text-align:center}
.hero h1{margin:0 auto 10px;font-size:clamp(28px,4.2vw,42px);line-height:1.15;color:var(--ink);letter-spacing:-.8px;font-weight:800;max-width:760px}
.hero p{margin:0 auto;max-width:620px;color:var(--muted);font-size:17px}
.trust{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 22px;margin-top:16px;font-size:14.5px;font-weight:600;color:var(--text)}
.trust span{display:inline-flex;align-items:center;gap:7px}
.trust svg{color:var(--ok);width:18px;height:18px}

/* ---------- settings bar ---------- */
main#tool{margin-top:-30px;position:relative}
.settings{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px 20px 14px}
.settings-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.f{display:block;font-size:12.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.f select,.f input[type=number]{
  display:block;width:100%;margin-top:6px;padding:0 12px;border:1px solid #cfd8e6;border-radius:10px;
  background:#fff;font:inherit;font-size:15px;font-weight:600;color:var(--ink);height:44px;text-transform:none;letter-spacing:0
}
.f select:focus,.f input:focus{outline:3px solid #c7d8ff;border-color:var(--brand)}
.three-col{display:grid;grid-template-columns:1fr 1fr .8fr;gap:14px;margin-top:14px;max-width:560px}
.settings-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px}
.spec{font-size:14px;color:var(--text)}
.spec b{color:var(--ink)}
.check{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:500;cursor:pointer;color:var(--text)}
.check input{width:17px;height:17px;accent-color:var(--brand)}
.linkbtn{appearance:none;border:0;background:none;color:var(--brand);font:inherit;font-weight:700;cursor:pointer;padding:0;font-size:14px}
.linkbtn:hover{text-decoration:underline}
.linkbtn[disabled]{opacity:.4;cursor:not-allowed;text-decoration:none}

/* ---------- app: stage + panel ---------- */
.app{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;margin-top:20px;align-items:start}
.stage{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;min-height:480px}
.stage>.warn{margin:16px 16px 0}
.tabs{display:flex;gap:4px;padding:10px 16px 0;border-bottom:1px solid var(--line);background:#fff}
.tab{appearance:none;border:0;background:none;font:inherit;font-weight:700;font-size:14.5px;color:var(--muted);padding:12px 14px;cursor:pointer;border-bottom:3px solid transparent;margin-bottom:-1px}
.tab:hover{color:var(--ink)}
.tab.on{color:var(--brand);border-bottom-color:var(--brand)}
.pane{padding:22px;background:var(--stage)}

/* empty state / dropzone */
.pane-empty{padding:18px}
.drop{
  border:2px dashed #b4c2d8;border-radius:18px;background:linear-gradient(180deg,#fbfcff,#f3f7fe);text-align:center;
  padding:38px 22px 30px;cursor:pointer;transition:.15s
}
.drop:hover,.drop.over{border-color:var(--brand);background:var(--soft)}
.drop .mock{width:150px;height:auto;margin:0 auto 8px;display:block}
.drop h2{margin:6px 0 4px;font-size:24px;color:var(--ink);letter-spacing:-.4px}
.drop .sub{margin:0;color:var(--muted);font-size:14.5px}
.drop-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:20px 0 6px}
.helper{max-width:520px;margin:14px auto 0;font-size:13.5px;color:var(--muted);line-height:1.55}
.helper b{color:var(--ink)}
.privacy-note{display:flex;gap:8px;align-items:center;justify-content:center;font-size:13.5px;color:var(--ok);font-weight:600;margin:14px 0 0}
.privacy-note svg{width:17px;height:17px}

.btn{
  appearance:none;border:1px solid transparent;border-radius:10px;padding:0 18px;height:44px;font:inherit;font-size:15px;font-weight:700;cursor:pointer;
  background:var(--brand);color:#fff;transition:.15s;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px
}
.btn:hover{background:var(--brand-d)}
.btn.ghost{background:#fff;color:var(--ink);border-color:#cfd8e6}
.btn.ghost:hover{background:var(--bg)}
.btn.lg{height:52px;font-size:16px;padding:0 26px;border-radius:12px}
.btn.sm{height:38px;font-size:14px;padding:0 12px}
.btn.block{width:100%}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.warn{background:#fef2f2;border:1px solid #fecaca;color:#991b1b;border-radius:10px;padding:9px 13px;font-size:14px}

/* sheet pane */
.sheet-pane{display:grid;justify-items:center;gap:14px}
.seg{display:inline-flex;background:#fff;border:1px solid #cfd8e6;border-radius:10px;padding:3px;gap:3px}
.seg button{appearance:none;border:0;background:none;font:inherit;font-size:14px;font-weight:700;color:var(--muted);padding:7px 14px;border-radius:8px;cursor:pointer}
.seg button.on{background:var(--brand);color:#fff}
#sheet{display:block;max-width:100%;height:auto;cursor:grab}
.fit-note{max-width:480px;background:#fffbeb;border:1px solid #fde68a;color:#78350f;border-radius:10px;padding:9px 13px;font-size:13.5px;text-align:center}
.hint{font-size:13px;color:var(--muted);margin:10px 0 0}
.hint.center{text-align:center;margin:0}

/* adjust pane */
.editor{display:grid;grid-template-columns:minmax(240px,340px) 1fr;gap:26px;align-items:start}
.crop-box{position:relative;background:
  conic-gradient(#e5e9f0 25%,#f6f8fb 0 50%,#e5e9f0 0 75%,#f6f8fb 0) 0 0/16px 16px;
  border-radius:8px;box-shadow:0 0 0 1px var(--line),0 10px 30px rgba(11,18,32,.14);overflow:hidden;touch-action:none;line-height:0;margin:0 auto;max-width:380px}
#crop{width:100%;display:block;cursor:grab;touch-action:none}
#crop:active{cursor:grabbing}
.controls{display:grid;gap:14px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px}
.ctrl{display:grid;grid-template-columns:92px 1fr 46px;align-items:center;gap:10px;font-size:14px;font-weight:700;color:var(--ink)}
.ctrl output{font-weight:500;color:var(--muted);text-align:right;font-size:13px}
.ctrl input[type=range]{width:100%;accent-color:var(--brand)}
.lbl{font-weight:700;font-size:14px;color:var(--ink);margin-bottom:8px}
.swatches{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.sw{width:30px;height:30px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #94a3b8;cursor:pointer;padding:0}
.sw.on{box-shadow:0 0 0 2px var(--brand)}
.swatches input[type=color]{width:34px;height:30px;padding:0;border:1px solid #94a3b8;border-radius:6px;background:#fff;cursor:pointer}
.ctrl-btns{display:flex;flex-wrap:wrap;gap:8px}

/* download panel */
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;position:sticky;top:80px}
.panel h2{margin:0 0 10px;font-size:18px;color:var(--ink);letter-spacing:-.2px}
.sheet-meta{font-size:14px;color:var(--text);line-height:1.55;margin-bottom:14px}
.sheet-meta b{color:var(--ink)}
.exact{color:var(--ok);font-weight:600}
.save{color:var(--brand);font-weight:600}
.panel-note{margin:8px 0 12px;text-align:center;font-size:13px;color:var(--muted)}
.btn-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.single{margin:14px 0 0;font-size:13.5px;color:var(--muted);text-align:center}
.photo-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px;padding:10px 12px;background:var(--bg);border-radius:10px}
.file-info{font-size:13px;color:var(--muted);word-break:break-all;line-height:1.35}
details.printguide{margin-top:16px;border-top:1px solid var(--line);padding-top:4px}
details.printguide summary{cursor:pointer;font-weight:700;font-size:14.5px;color:var(--ink);padding:10px 0;list-style:none;display:flex;justify-content:space-between}
details.printguide summary::-webkit-details-marker{display:none}
details.printguide summary::after{content:"+";color:var(--brand);font-size:20px;line-height:1}
details.printguide[open] summary::after{content:"–"}
.printguide ol{margin:0 0 6px;padding-left:20px;font-size:13.5px;line-height:1.55}
.printguide li{margin:6px 0}

/* ---------- feature strip ---------- */
.features{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:18px;margin:34px 0 0}
.feat{display:flex;gap:12px;align-items:flex-start}
.feat .ic{width:40px;height:40px;border-radius:10px;background:var(--soft);color:var(--brand);display:grid;place-items:center;flex:none}
.feat h3{margin:0;font-size:15px;color:var(--ink)}
.feat p{margin:2px 0 0;font-size:14px;color:var(--muted);line-height:1.5}

/* ---------- content ---------- */
.content{padding:54px 0 10px}
.content h2{font-size:28px;margin:0 0 8px;letter-spacing:-.4px;color:var(--ink)}
.content .lead{color:var(--muted);margin:0 0 24px;max-width:720px}
.how{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px;margin-bottom:54px}
.how .card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px}
.how .n{width:34px;height:34px;border-radius:10px;background:var(--soft);color:var(--brand);font-weight:800;display:grid;place-items:center;margin-bottom:10px}
.how h3{margin:0 0 4px;font-size:17px;color:var(--ink)}
.how p{margin:0;color:var(--muted);font-size:15px}
.table-wrap{overflow-x:auto;background:#fff;border:1px solid var(--line);border-radius:var(--radius);margin-bottom:54px}
table{border-collapse:collapse;width:100%;min-width:560px;font-size:15px}
th,td{padding:12px 16px;text-align:left;border-bottom:1px solid var(--line)}
th{background:#f8fafc;font-size:12.5px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted)}
tr:last-child td{border-bottom:0}
td:first-child{font-weight:600;color:var(--ink)}
.two{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:20px;margin-bottom:54px}
.two .card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:22px}
.two h3{margin:0 0 10px;color:var(--ink)}
.two ul{margin:0;padding-left:20px}
.two li{margin:6px 0}
.faq details{background:#fff;border:1px solid var(--line);border-radius:12px;padding:0 18px;margin-bottom:10px}
.faq summary{cursor:pointer;font-weight:700;color:var(--ink);padding:16px 26px 16px 0;list-style:none;position:relative}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";position:absolute;right:0;top:12px;font-size:24px;color:var(--brand);font-weight:500}
.faq details[open] summary::after{content:"–"}
.faq details p{margin:0 0 16px;color:var(--text)}
.disclaimer{font-size:13.5px;color:var(--muted);margin:18px 0 0}

/* ---------- footer / simple pages ---------- */
.site-footer{background:#fff;border-top:1px solid var(--line);margin-top:56px;padding:28px 0;font-size:14px;color:var(--muted)}
.site-footer a{color:var(--text);margin-left:20px;text-decoration:none;font-weight:600}
.site-footer a:hover{color:var(--brand)}
.site-footer .wrap{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between}
.page{max-width:780px;margin:0 auto;padding:44px 20px}
.page h1{margin-top:0;color:var(--ink);letter-spacing:-.5px}
.page h2{margin-top:30px;color:var(--ink)}

/* ---------- responsive ---------- */
@media(max-width:1060px){
  .settings-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:920px){
  .app{grid-template-columns:1fr}
  .panel{position:static}
}
@media(max-width:720px){
  .settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .editor{grid-template-columns:1fr}
  .pane{padding:16px}
  .nav a:not(.cta){display:none}
  .brand{font-size:17px}
  .nav a.cta{padding:8px 12px;font-size:14px}
  .ctrl{grid-template-columns:84px 1fr 42px}
  .drop{padding:28px 14px 22px}
  .drop h2{font-size:21px}
}
@media(max-width:420px){
  .settings-grid{grid-template-columns:1fr}
}

/* v7 */
.dig{padding:2px 0 8px}
.dig-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dig .f input,.dig .f select{height:40px}
.dig .hint{margin:8px 0}

/* v8: photoshop-style workspace */
.sheet-pane{justify-items:stretch}
.sheet-tools{display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap}
.ws{border:1px solid #7b818b;border-radius:6px;overflow:hidden;background:#aab1bb;line-height:0;box-shadow:0 6px 22px rgba(11,18,32,.18)}
.ws-status{line-height:1.3;background:#eceef1;border-top:1px solid #7b818b;padding:6px 12px;font-size:12.5px;color:#2f343b;font-variant-numeric:tabular-nums;min-height:28px}
.f input.hidden{display:none}

/* ================= v9: simple 4-step flow ================= */
.flow{max-width:none;margin:0;display:grid;gap:16px}
.step{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}
.step-h{display:flex;align-items:center;gap:12px;padding:20px 24px 2px}
.step-h .no{flex:none;width:30px;height:30px;border-radius:50%;background:var(--brand);color:#fff;font-weight:800;font-size:15px;display:grid;place-items:center}
.step-h h2{margin:0;font-size:21px;color:var(--ink);letter-spacing:-.3px}
.step-b{padding:14px 24px 24px}
.q{font-weight:700;color:var(--ink);font-size:15px;margin:20px 0 10px}
.q.first{margin-top:4px}
.q.inline{margin:0}
.muted{color:var(--muted);font-size:14px}
.muted.center{text-align:center;margin:10px 0 0}

/* chips */
.chips{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.chip{appearance:none;text-align:left;border:2px solid var(--line);background:#fff;border-radius:14px;padding:13px 14px;cursor:pointer;display:flex;align-items:center;gap:12px;font:inherit;color:var(--text);transition:.12s;min-height:64px}
.chip:hover{border-color:#b6c7ea;background:#fafcff}
.chip.on{border-color:var(--brand);background:var(--soft)}
.chip b{display:block;color:var(--ink);font-size:15px;line-height:1.3}
.chip small{display:block;color:var(--muted);font-size:13px;line-height:1.35}
.chip .cap{display:block;font-style:normal;font-size:12.5px;font-weight:700;color:var(--brand);margin-top:2px}
.chip .shape{flex:none;border:2px solid #8aa0c8;border-radius:3px;background:#e4ecfb;min-width:12px;min-height:12px}
.chip.on .shape{border-color:var(--brand);background:#fff}
.chip .shape.paper{width:26px;height:34px;background:#fff}
.chip.pill{min-height:46px;padding:0 18px;border-radius:12px;font-weight:700;color:var(--ink)}

/* count */
.count-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.stepper{display:inline-flex;align-items:center;border:2px solid #cfd8e6;border-radius:12px;overflow:hidden;background:#fff}
.stepper button{width:50px;height:46px;border:0;background:#fff;font-size:24px;line-height:1;cursor:pointer;color:var(--ink)}
.stepper button:hover{background:var(--bg)}
.stepper output,.stepper input{min-width:60px;text-align:center;font-weight:800;font-size:20px;color:var(--ink)}
.stepper input{width:76px;height:46px;border:0;border-left:1px solid #e3e8f0;border-right:1px solid #e3e8f0;border-radius:0;background:#fff;font-family:inherit;padding:0;-moz-appearance:textfield;appearance:textfield}
.stepper input::-webkit-outer-spin-button,.stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.stepper input:focus{outline:none;background:#eef4ff;box-shadow:inset 0 0 0 2px var(--brand)}

/* switch row */
.switch{display:flex;gap:12px;align-items:flex-start;margin-top:18px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:#fafcff;cursor:pointer}
.switch input{width:20px;height:20px;margin-top:2px;accent-color:var(--brand);flex:none}
.switch b{display:block;color:var(--ink);font-size:15px}
.switch small{display:block;color:var(--muted);font-size:13px}

/* collapsibles */
.more{margin-top:14px;border:1px solid var(--line);border-radius:12px;padding:0 16px;background:#fff}
.more>summary{cursor:pointer;font-weight:700;font-size:14.5px;color:var(--ink);padding:13px 0;list-style:none;display:flex;justify-content:space-between;align-items:center}
.more>summary::-webkit-details-marker{display:none}
.more>summary::after{content:"+";color:var(--brand);font-size:21px;line-height:1}
.more[open]>summary::after{content:"–"}
.more-body{padding:2px 0 16px}
.fields-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.three-col{max-width:none;margin-top:12px}
.spec{margin-top:14px;background:var(--soft);border-radius:10px;padding:11px 14px;font-size:14px;color:#1e3a8a;line-height:1.5}
.spec b{color:#172554}
.dl-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin-top:4px}
.steps-list{margin:0;padding-left:20px;font-size:14.5px;line-height:1.6}
.steps-list li{margin:6px 0}

/* upload */
#step1 .drop h3{margin:6px 0 4px;font-size:24px;color:var(--ink);letter-spacing:-.4px}
.done{display:flex;align-items:center;gap:14px;padding:14px 16px;border:1px solid #bfe3cb;background:#f1faf4;border-radius:14px}
.done .tick{width:36px;height:36px;border-radius:50%;background:var(--ok);color:#fff;display:grid;place-items:center;flex:none}
.done .tick svg{width:20px;height:20px;stroke-width:2.4}
.done-t{display:flex;flex-direction:column;flex:1;min-width:0}
.done-t b{color:var(--ink)}
.step>.step-b>.warn{margin-bottom:12px}

/* preview + actions */
.sheet-meta{font-size:14.5px;line-height:1.6;margin:0 0 12px}
.check.small{font-size:13.5px;margin-top:10px;color:var(--muted)}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.btn.xl{height:56px;font-size:17px;padding:0 30px;border-radius:14px;flex:1 1 auto}
.btn.xl:first-child{flex:2 1 260px}
.adjust{margin-top:18px;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--stage)}
.seg-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.ws{margin-bottom:0}

@media(max-width:720px){
  .step-h{padding:16px 16px 0}
  .step-b{padding:12px 16px 18px}
  .chips{grid-template-columns:1fr}
  .btn.xl{flex:1 1 100%}
  .btn.xl:first-child{flex:1 1 100%}
}

/* v10: crop popup + step-2 note */
.cropnote{margin-top:12px;padding:12px 14px;border-radius:10px;display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:14px;line-height:1.45;background:#fff8e6;border:1px solid #f3dca0;color:#6b4a00}
.cropnote.ok{background:#eefaf1;border-color:#bfe5c9;color:#14532d}
.cropnote .btn{flex:none}
body.modal-open{overflow:hidden}
.modal{position:fixed;inset:0;z-index:1000;background:rgba(15,23,42,.62);display:flex;align-items:center;justify-content:center;padding:16px}
.modal-box{background:#fff;border-radius:16px;width:min(720px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:18px 20px 20px;box-shadow:0 24px 60px rgba(0,0,0,.35)}
.modal-h{display:flex;align-items:center;justify-content:space-between;gap:12px}
.modal-h h3{margin:0;font-size:20px;color:var(--ink)}
.modal-x{border:0;background:#eef2f8;width:36px;height:36px;border-radius:50%;font-size:24px;line-height:1;cursor:pointer;color:var(--ink)}
.modal-x:hover{background:#dfe6f1}
.modal-sub{margin:6px 0 12px;color:var(--muted);font-size:14px;line-height:1.5}
.cm-stage{position:relative;display:flex;justify-content:center;align-items:center;background:#1e2430;border-radius:12px;padding:10px;min-height:200px}
#cmCanvas{display:block;touch-action:none;max-width:100%;border-radius:4px}
.cm-tools{display:flex;gap:18px;align-items:center;flex-wrap:wrap;margin-top:12px}
.cm-zoom{display:flex;align-items:center;gap:10px;flex:1 1 220px;font-size:14px;font-weight:600;color:var(--ink)}
.cm-zoom input{flex:1;accent-color:var(--brand)}
.cm-check{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--ink);cursor:pointer}
.cm-check input{width:18px;height:18px;accent-color:var(--brand)}
.cm-info{margin-top:8px;font-size:13px;color:var(--muted)}
.modal-f{display:flex;gap:10px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap}
.modal-f .btn{height:46px;padding:0 20px}
@media(max-width:560px){.modal-box{padding:14px}.modal-f .btn{flex:1 1 100%}}

/* v11: adjust popup */
.modal-box.wide{width:min(900px,100%)}
.adjust.flat{margin:0;padding:0;border:0;background:none}
.modal-box.wide .seg-row{margin-bottom:14px}
.modal-box.wide .editor{background:var(--stage);border:1px solid var(--line);border-radius:14px;padding:16px}
@media(max-width:700px){.modal-box.wide .editor{padding:12px}}

/* v13: zoom toolbar + full view */
.ws-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;line-height:1.2;background:#eceef1;border-bottom:1px solid #7b818b;padding:6px 8px}
.wb{height:32px;min-width:32px;padding:0 10px;border:1px solid #c3c9d3;background:#fff;border-radius:7px;font:600 13px/1 inherit;font-family:inherit;color:#1f2530;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.wb:hover{background:#f3f6fb;border-color:#9aa4b4}
.wb.ico{font-size:19px;padding:0;width:32px}
.wb.strong{background:var(--brand);border-color:var(--brand);color:#fff}
.wb.strong:hover{background:var(--brand-d)}
.wb .i{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.wb-lbl{min-width:52px;text-align:center;font:600 13px/1 inherit;font-family:inherit;color:#1f2530;font-variant-numeric:tabular-nums}
.wb-sp{flex:1}
.wb-chk{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:inherit;margin-left:8px;cursor:pointer}
.fv{position:fixed;inset:0;z-index:1100;background:#23272e;display:flex;flex-direction:column}
.fv-top{display:flex;align-items:center;gap:12px;padding:8px 12px;background:#2f343c;color:#fff;flex-wrap:wrap}
.fv-title{font-size:15px;margin-right:4px}
.ws-bar.dark{background:transparent;border:0;padding:0}
.fv .wb-lbl,.fv .wb-chk{color:#e8ecf2}
.fv-stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#aab1bb}
.fv-stage canvas{position:absolute;left:0;top:0;display:block;touch-action:none}
.ws canvas{touch-action:pan-y}
.fv-status{border-top:0;background:#2f343c;color:#dbe1ea;border-top:1px solid #000}
.fv-hint{background:#2f343c;color:#9aa4b4;font-size:12px;padding:0 12px 8px;line-height:1.3}
@media(max-width:560px){.fv-title{display:none}.wb{height:36px}.fv-hint{display:none}}

.cropnote.info{background:#eef4ff;border-color:#cddcf7;color:#1e3a8a}

/* v21: photo preview in the "Photo added" box */
.thumb{position:relative;flex:none;width:84px;height:105px}
.thumb canvas{display:block;width:100%;height:100%;border-radius:8px;border:1px solid #c9dccf;background:#eef2f7;box-shadow:0 2px 8px rgba(11,18,32,.12)}
.done .tick.sm{position:absolute;right:-8px;bottom:-8px;width:24px;height:24px;border:2px solid #f1faf4}
.done .tick.sm svg{width:13px;height:13px;stroke-width:3}
@media(max-width:560px){.thumb{width:68px;height:85px}}
@media(max-width:560px){
  .done{flex-wrap:wrap;gap:12px}
  .done-t{flex:1 1 130px}
  .done-t b{white-space:nowrap}
  .done .btn{flex:1 1 100%}
}

/* v23: custom size panel (mm, cm, px, inch) */
.custom-panel{margin-top:14px;padding:16px;border:1px solid #cddcf7;border-radius:14px;background:#f6f9ff}
.cp-title{font-weight:700;color:var(--ink);margin-bottom:10px}
.cp-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}
.custom-panel .hint{margin:10px 0 12px}
.custom-panel .hint.warn{color:#9a6700}
.chip.custom .shape{border-style:dashed;background:#fff}

.cm-outline-btn{position:absolute;top:12px;right:12px;z-index:3;display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(20,26,38,.82);color:#fff;font:700 13px/1 inherit;font-family:inherit;cursor:pointer;backdrop-filter:blur(4px)}
.cm-outline-btn:hover{background:rgba(20,26,38,.95)}
.cm-outline-btn .dot{width:10px;height:10px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.3)}
.cm-outline-btn[aria-pressed="false"] .dot{background:#94a3b8;box-shadow:none}
.cm-outline-btn:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}
.site-footer .linkbtn{margin-left:20px;color:var(--text);font-size:14px}

/* compact layout bar above the sheet preview */
.lay-bar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 16px;padding:10px 14px;margin:0 0 12px;border:1px solid var(--line);border-radius:12px;background:#fafcff}
.lay-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.lay-f .u{text-transform:none;font-weight:600;letter-spacing:0}
.lay-f select,.lay-f input{height:36px;padding:0 10px;border:1px solid #cfd8e6;border-radius:9px;background:#fff;font:inherit;font-size:14px;font-weight:600;color:var(--ink);text-transform:none;letter-spacing:0}
.lay-f input{width:78px}
.lay-f select{min-width:128px}
.lay-f select:focus,.lay-f input:focus{outline:3px solid #c7d8ff;border-color:var(--brand)}
.lay-chk{display:inline-flex;align-items:center;gap:8px;height:36px;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer}
.lay-chk input{width:18px;height:18px;accent-color:var(--brand);flex:none}
.lay-chk small{font-weight:500;color:var(--muted);font-size:12.5px}
@media (max-width:560px){.lay-bar{gap:10px 12px}.lay-f{flex:1 1 calc(50% - 12px)}.lay-f select,.lay-f input{width:100%}.lay-chk{flex:1 1 100%}}

/* editable numbers in the sheet summary */
.sheet-meta .mrow{line-height:2.1}
.sheet-meta .mrow.save{line-height:1.5}
.sheet-meta .mmsg{color:#b45309;font-weight:600;line-height:1.5}
.sheet-meta .mmsg:empty,.sheet-meta .mrow.save:empty{display:none}
.medit{width:66px;height:30px;padding:0 6px;margin:0 2px;border:1px solid #b9c6dc;border-bottom:2px solid var(--brand);border-radius:7px 7px 3px 3px;background:#fff;font:inherit;font-size:15px;font-weight:800;color:var(--ink);text-align:center;vertical-align:middle;-moz-appearance:textfield;appearance:textfield}
.medit::-webkit-outer-spin-button,.medit::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.medit:hover{background:#f4f8ff}
.medit:focus{outline:3px solid #c7d8ff;background:#fff;border-color:var(--brand)}
#mN{width:54px}
.sheet-meta .dotsep{margin:0 4px;color:var(--ok)}
.meta-hint{font-size:12.5px;color:var(--muted);margin-top:2px}

.sheet-meta .mu{font-weight:700}
.sheet-meta .munits{line-height:1.6;margin:2px 0 4px;color:var(--text);font-size:14px}
.munit{display:inline-flex;align-items:center;gap:8px;font-weight:600}
.munit select{height:32px;padding:0 8px;border:1px solid #b9c6dc;border-radius:8px;background:#fff;font:inherit;font-size:14px;font-weight:700;color:var(--ink)}
.munit select:focus{outline:3px solid #c7d8ff}
#mDpi{width:70px}

/* editable numbers read like normal text, just sitting in light-grey boxes */
.sheet-meta .mrow{line-height:1.75}
.medit{width:auto;height:auto;min-height:0;padding:1px 6px;margin:0 1px;border:0;border-radius:5px;background:#e9ecf1;font:inherit;font-weight:700;color:inherit;text-align:center;vertical-align:baseline;field-sizing:content;min-width:2.4ch}
.medit:hover{background:#dfe3ea}
.medit:focus{outline:2px solid #bcd0ff;background:#fff}
#mN{width:3.2ch;min-width:3.2ch}
.sheet-meta .mrow.exact .medit{width:5.4ch}
#mDpi{width:5ch}
.munit select{height:auto;padding:1px 6px;border:0;border-radius:5px;background:#e9ecf1;font:inherit;font-weight:700;color:inherit}
.munit select:hover{background:#dfe3ea}
.sheet-meta .munits{margin:0 0 4px;font-size:inherit;color:var(--text);line-height:1.75}

#sheet:active,#fvCanvas:active{cursor:grabbing}
#fvCanvas{cursor:grab}

/* toggle switches instead of tick boxes */
.check input[type=checkbox],.cm-check input[type=checkbox],.lay-chk input[type=checkbox],.wb-chk input[type=checkbox]{
  -webkit-appearance:none;appearance:none;position:relative;flex:none;width:40px;height:23px;margin:0;border:0;border-radius:999px;
  background:#c3cbd8;cursor:pointer;transition:background .15s;accent-color:initial}
.check input[type=checkbox]::before,.cm-check input[type=checkbox]::before,.lay-chk input[type=checkbox]::before,.wb-chk input[type=checkbox]::before{
  content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .15s}
.check input[type=checkbox]:checked,.cm-check input[type=checkbox]:checked,.lay-chk input[type=checkbox]:checked,.wb-chk input[type=checkbox]:checked{background:var(--brand)}
.check input[type=checkbox]:checked::before,.cm-check input[type=checkbox]:checked::before,.lay-chk input[type=checkbox]:checked::before,.wb-chk input[type=checkbox]:checked::before{transform:translateX(17px)}
.check input[type=checkbox]:focus-visible,.cm-check input[type=checkbox]:focus-visible,.lay-chk input[type=checkbox]:focus-visible,.wb-chk input[type=checkbox]:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}
.check input[type=checkbox]:disabled,.cm-check input[type=checkbox]:disabled{opacity:.45;cursor:not-allowed}
.cm-check,.check,.lay-chk{gap:10px}
.wb-chk{gap:8px}
.wb-chk input[type=checkbox]{width:34px;height:20px}
.wb-chk input[type=checkbox]::before{top:3px;left:3px;width:14px;height:14px}
.wb-chk input[type=checkbox]:checked::before{transform:translateX(14px)}

#cInfo.note{color:var(--brand);font-weight:600}
.sheet-meta .mmsg.note{color:var(--brand)}

/* editable numbers: black text in white boxes with a grey outline */
.medit{background:#fff;border:1px solid #c5ccd8;color:var(--ink,#0b1220);padding:0 6px}
.medit:hover{background:#fff;border-color:#9aa5b8}
.medit:focus{background:#fff;border-color:var(--brand);outline:2px solid #bcd0ff}
.munit select{background:#fff;border:1px solid #c5ccd8;color:var(--ink,#0b1220)}
.munit select:hover{background:#fff;border-color:#9aa5b8}

/* the "Each photo prints at exactly..." line in black */
.sheet-meta .mrow.exact,.sheet-meta .mrow.exact .dotsep,.sheet-meta .mrow.exact .mu{color:var(--ink)}

/* blue arrow cursor on the image canvases */
:root{--cur-arrow:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='gc' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2360a5fa'/%3E%3Cstop offset='1' stop-color='%231d4ed8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M7 5.5V23.5l4.6-4.2 3.6 7.6 2.3-1.1-3.5-7.5h6.4z' fill='%23fff' stroke='%23fff' stroke-width='5' stroke-linejoin='round'/%3E%3Cpath d='M7 5.5V23.5l4.6-4.2 3.6 7.6 2.3-1.1-3.5-7.5h6.4z' fill='url(%23gc)' stroke='url(%23gc)' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") 6 5,default}
#sheet,#fvCanvas,#crop,#cmCanvas{cursor:var(--cur-arrow)}
#sheet.is-drag,#fvCanvas.is-drag,#sheet:active,#fvCanvas:active,#crop:active{cursor:var(--cur-arrow)}

/* ---------- logo, hero image and do's & don'ts ---------- */
.site-header .wrap{height:74px}
.brand{padding:4px 0}
.brand-logo{display:block;height:58px;width:auto}
.hero{padding:30px 0 56px;text-align:left}
.hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:32px;align-items:center}
.hero h1{margin:0 0 12px;max-width:none}
.hero p{margin:0;max-width:560px}
.hero .trust{justify-content:flex-start;flex-direction:column;align-items:flex-start;gap:8px;margin-top:18px}
.hero-cta{margin-top:22px;display:inline-flex}
.hero-art img{display:block;width:100%;height:auto;border-radius:20px;box-shadow:0 18px 50px rgba(30,64,175,.18);background:#eaf1ff}
@media (max-width:860px){
  .hero-grid{grid-template-columns:1fr;gap:22px}
  .hero{text-align:center}
  .hero p{margin:0 auto}
  .hero .trust{align-items:center}
  .hero-art{max-width:560px;margin:0 auto}
  .brand-logo{height:44px}
  .site-header .wrap{height:62px}
}
.dd{margin:18px 0 8px}
.dd img{display:block;width:100%;height:auto;border-radius:18px;border:1px solid var(--line);box-shadow:0 8px 28px rgba(11,18,32,.08)}
.foot-brand{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.foot-brand img{height:40px;width:auto}

/* ---------- v25: tidy alignment ---------- */
#sizeChips,#paperChips{grid-template-columns:repeat(3,minmax(0,1fr))}
.actions{display:grid;grid-template-columns:1.8fr 1.2fr .8fr 1fr;gap:12px;margin-top:20px}
.actions .btn.xl{width:100%;min-width:0;flex:none;padding:0 14px;justify-content:center;text-align:center}
.features{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:start}
.how{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:960px){
  #sizeChips,#paperChips{grid-template-columns:repeat(2,minmax(0,1fr))}
  .actions{grid-template-columns:1fr 1fr}
  .actions .btn.xl:first-child{grid-column:1 / -1}
  .features,.how{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:620px){
  #sizeChips,#paperChips{grid-template-columns:1fr}
  .actions{grid-template-columns:1fr}
  .features,.how{grid-template-columns:1fr}
}

/* ---------- AdSense-friendly spacing (no ads are included) ----------
   Sections are separated by generous space. To add a unit later, wrap it in <div class="ad-zone">...</div>
   at one of the AD-READY comments in index.html. */
html{scroll-padding-top:90px}
.content{padding-top:64px}
.features{margin-bottom:8px}
.content h2{margin-top:0}
.ad-zone{display:block;clear:both;max-width:970px;margin:48px auto;text-align:center;overflow:hidden}
.ad-zone::before{content:"Advertisement";display:block;margin-bottom:6px;font-size:11px;letter-spacing:.6px;text-transform:uppercase;color:#8a94a6}
.ad-zone:empty,.ad-zone:has(ins[data-ad-status="unfilled"]){display:none}

/* v27: new logo (icon + wordmark, no tagline) */
.brand-logo{height:44px;width:auto}
.site-header .wrap{height:70px}
.foot-brand img{height:34px}
@media (max-width:860px){.brand-logo{height:36px}.site-header .wrap{height:60px}}

/* =====================  v28: landing page  ===================== */
html{scroll-behavior:smooth}
.hero-btns{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
.hero-btns .btn{display:inline-flex;align-items:center;justify-content:center}
@media (max-width:860px){.hero-btns{justify-content:center}}
.band{background:#fff;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:26px 0}
.band .features{margin:0}
.size-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:54px}
.size-card{display:flex;flex-direction:column;gap:4px;padding:20px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);text-decoration:none;color:var(--text);transition:border-color .15s,box-shadow .15s,transform .15s}
.size-card:hover,.size-card:focus-visible{border-color:var(--brand);box-shadow:0 10px 28px rgba(37,99,235,.12);transform:translateY(-2px);outline:none}
.sz-dims{font-size:24px;font-weight:800;letter-spacing:-.4px;color:var(--ink)}
.sz-name{font-size:16px;font-weight:700;color:var(--ink)}
.sz-note{font-size:14px;color:var(--muted);line-height:1.5;flex:1}
.sz-go{display:inline-flex;align-items:center;gap:6px;margin-top:10px;font-size:14px;font-weight:700;color:var(--brand)}
.sz-go .i{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.center-cta{text-align:center;margin:-22px 0 54px}
.center-cta .btn{display:inline-flex}
.cta-band{background:linear-gradient(135deg,#1d4ed8,#2563eb);color:#fff;margin-top:36px}
.cta-inner{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;padding-top:40px;padding-bottom:40px}
.cta-inner h2{margin:0 0 4px;font-size:28px;letter-spacing:-.4px;color:#fff}
.cta-inner p{margin:0;color:#dbe6ff}
.btn.light{background:#fff;color:#1d4ed8;border-color:#fff;display:inline-flex;align-items:center}
.btn.light:hover{background:#eef3ff}
.landing .site-footer{margin-top:0}
@media (max-width:960px){.size-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.size-grid{grid-template-columns:1fr}.cta-inner{text-align:center;justify-content:center}}

/* =====================  v28: editor with stepper  ===================== */
.editor-page .wrap{max-width:1200px}
main.editor#tool{display:block;max-width:none;margin:0;padding:8px 0 40px;grid-template-columns:none}
.ed-head{padding:26px 0 4px}
.ed-head h1{margin:0 0 4px;font-size:28px;letter-spacing:-.5px;color:var(--ink)}
.ed-head p{margin:0;color:var(--muted)}
.ed-steps{list-style:none;display:flex;margin:18px 0 12px;padding:0}
.ed-steps li{flex:1;position:relative;min-width:0}
.ed-steps li+li::before{content:"";position:absolute;top:21px;left:-50%;width:100%;height:3px;background:#d3dbe8;z-index:0}
.ed-steps li.is-done::before,.ed-steps li.is-current::before{background:var(--brand)}
.ed-steps button{position:relative;z-index:1;width:100%;display:flex;flex-direction:column;align-items:center;gap:7px;padding:4px 2px;border:0;background:none;font:inherit;font-size:13.5px;font-weight:700;color:var(--muted);cursor:pointer}
.ed-steps button:disabled{cursor:not-allowed;opacity:.6}
.ed-steps .dot{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#fff;border:3px solid #d3dbe8;color:var(--muted);font-size:15px;font-weight:800;transition:.15s}
.ed-steps li.is-done .dot{background:var(--brand);border-color:var(--brand);color:#fff;font-size:0}
.ed-steps li.is-done .dot::after{content:"";width:9px;height:16px;border:solid #fff;border-width:0 3px 3px 0;transform:translateY(-2px) rotate(45deg)}
.ed-steps li.is-current .dot{border-color:var(--brand);color:var(--brand);box-shadow:0 0 0 5px #dbe6ff}
.ed-steps li.is-current button{color:var(--ink)}
.ed-steps button:not(:disabled):hover .dot{border-color:var(--brand)}
.ed-steps button:focus-visible{outline:3px solid #93c5fd;outline-offset:2px;border-radius:10px}
.ed-summary{display:flex;flex-wrap:wrap;gap:6px 18px;justify-content:center;margin:2px 0 14px;padding:9px 14px;border-radius:10px;background:#eef3ff;color:#1e3a8a;font-size:14px}
.ed-summary b{color:#172554;margin-right:4px}
.editor .step{display:none}
.editor .step.is-active{display:block;animation:stepIn .22s ease}
.editor .step-h .no{display:none}
.editor .step-h{padding-top:22px}
@keyframes stepIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.ed-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}
.ed-nav .btn{display:inline-flex;align-items:center;justify-content:center;min-width:150px}
.ed-hint{flex:1;text-align:center;color:var(--muted);font-size:14px}
@media (max-width:620px){
  .ed-steps button{font-size:12px}.ed-steps .dot{width:32px;height:32px}.ed-steps li+li::before{top:18px}
  .ed-nav{flex-wrap:wrap}.ed-nav .btn{flex:1 1 auto;min-width:0}.ed-hint{order:3;flex-basis:100%}
}
@media (prefers-reduced-motion:reduce){.editor .step.is-active{animation:none}html{scroll-behavior:auto}}

.actions .btn.xl{white-space:nowrap}
@media (min-width:700px){main.editor .actions{grid-template-columns:1.7fr 1.6fr .8fr 1.3fr}}

/* =====================  v36: previews in steps 2 and 3  ===================== */
.editor .split{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:28px;align-items:start}
.editor .split-prev{position:sticky;top:90px;background:#f4f7fc;border:1px solid var(--line);border-radius:16px;padding:14px 14px 12px;text-align:center}
.pv-title{font-size:13px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.pv-stage{display:grid;place-items:center;min-height:120px;padding:12px;border-radius:12px;background:#aab1bb}
.pv-stage canvas{display:block;max-width:100%;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.35)}
#prevPhoto{border:1px solid rgba(0,0,0,.25)}
.pv-cap{margin-top:10px;font-size:14px;font-weight:700;color:var(--ink)}
@media (max-width:820px){
  .editor .split{grid-template-columns:1fr;gap:16px}
  .editor .split-prev{position:static;order:-1;padding:10px}
  .pv-stage{padding:8px}
  .pv-stage canvas{max-height:220px;width:auto !important;height:auto !important;max-width:100%}
}

.pv-crop{width:100%;margin-top:12px;justify-content:center;background:#2563eb;color:#fff;border-color:#2563eb;font-weight:800}
.pv-crop:hover{background:#1d4fd8}
.pv-crop .i{width:18px;height:18px;margin-right:6px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* v38: adjust settings inside step 2 */
.s2-adjust{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.s2-title{font-size:17px;font-weight:800;color:var(--ink);margin-bottom:12px}
.s2-adjust .controls{background:#f8fafd}
.s2-adjust .hint{margin:10px 2px 0}
@media (max-width:520px){.s2-adjust .ctrl{grid-template-columns:78px 1fr 42px}}

/* v40: retouch (clone skin) */
.s2-retouch{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:14px;padding:14px 16px;border:1px dashed #b6c6e3;border-radius:12px;background:#f3f7ff}
.s2-retouch>div{display:grid;gap:2px;flex:1 1 220px;font-size:14px;color:var(--ink)}
.s2-retouch span{color:var(--muted);font-size:13px}
.rt-grid{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:18px;align-items:start}
.rt-stage{display:flex;background:#1e2430;border-radius:12px;padding:10px;overflow:auto;max-height:calc(100vh - 250px);min-height:260px}
.rt-wrap{position:relative;margin:auto;line-height:0}
.rt-wrap canvas{display:block}
#rtOver{position:absolute;inset:0;cursor:crosshair}
#rtCanvas{background:#fff}
.rt-controls{align-content:start}
.rt-status{margin:0;min-height:38px;color:var(--ink);font-weight:600}
@media (max-width:820px){.rt-grid{grid-template-columns:1fr}.rt-stage{max-height:62vh}}

.rt-aligned{height:auto;display:flex;align-items:flex-start;gap:10px;font-size:14px;font-weight:700;color:var(--ink)}
.rt-aligned small{display:block;font-weight:500;color:var(--muted);font-size:12px;margin-top:2px}

.rt-tools{display:flex;width:100%}.rt-tools button{flex:1}
.rt-controls .seg{margin-bottom:0}

.rt-all{width:100%;justify-content:center}

/* v43: full-screen retouch workspace */
#rtModal.rt-full{padding:0;align-items:stretch;justify-content:stretch}
#rtModal.rt-full .modal-box{width:100vw;max-width:none;height:100vh;max-height:none;border-radius:0;display:flex;flex-direction:column;padding:12px 18px 14px;overflow:hidden}
#rtModal.rt-full .modal-sub{margin:4px 0 10px;font-size:13px}
#rtModal.rt-full .rt-grid{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) 320px;align-items:stretch}
#rtModal.rt-full .rt-stage{max-height:none;height:100%;min-height:0;padding:12px}
#rtModal.rt-full .rt-controls{max-height:100%;overflow:auto}
#rtModal.rt-full .modal-f{margin-top:10px}
@media (max-width:820px){
  #rtModal.rt-full .modal-box{overflow:auto}
  #rtModal.rt-full .rt-grid{flex:none;grid-template-columns:1fr;gap:12px}
  #rtModal.rt-full .rt-stage{height:62vh}
  #rtModal.rt-full .rt-controls{max-height:none;overflow:visible}
}

/* v44: Photoshop-style retouch workspace (dark, big canvas, tools in a right sidebar) */
#rtModal.rt-full{background:#16181b;padding:0;align-items:stretch;justify-content:stretch}
.rt-app{display:flex;flex-direction:column;width:100vw;height:100vh;background:#16181b;color:#e6e8eb}
.rt-top{display:flex;align-items:center;gap:16px;height:52px;flex:none;padding:0 14px 0 18px;background:#2b2f36;border-bottom:1px solid #3a3f47}
.rt-top h3{margin:0;font-size:16px;font-weight:800;color:#fff;white-space:nowrap}
.rt-keys{flex:1;min-width:0;font-size:12.5px;color:#9aa3af;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rt-top-r{display:flex;align-items:center;gap:10px;margin-left:auto}
.rt-zoombar{display:inline-flex;background:#1f2226;border:1px solid #3a3f47;border-radius:9px;padding:2px}
.rt-tb{appearance:none;border:0;background:none;color:#c7cdd6;font:700 13px/1 inherit;font-family:inherit;padding:8px 12px;border-radius:7px;cursor:pointer}
.rt-tb:hover{background:#363b44;color:#fff}
.rt-top .btn{height:36px;padding:0 20px}
.rt-x{background:#363b44;color:#e6e8eb;width:34px;height:34px}.rt-x:hover{background:#444b55}
.rt-body{display:flex;flex:1;min-height:0}
#rtModal .rt-stage{flex:1;min-width:0;height:auto;max-height:none;min-height:0;border-radius:0;padding:10px;background:#101215;display:flex;overflow:auto}
.rt-wrap canvas{box-shadow:0 6px 28px rgba(0,0,0,.6)}
.rt-side{width:320px;flex:none;overflow:auto;background:#2b2f36;border-left:1px solid #3a3f47}
.rt-sec{padding:14px 16px;border-bottom:1px solid #3a3f47;display:grid;gap:12px}
.rt-sec-t{font:800 11px/1 inherit;font-family:inherit;letter-spacing:.09em;text-transform:uppercase;color:#9aa3af}
.rt-side .ctrl{color:#e6e8eb;grid-template-columns:70px 1fr 42px}
.rt-side .ctrl output{color:#9aa3af}
.rt-side .seg{background:#1f2226;border-color:#3a3f47}
.rt-side .seg button{color:#aeb6c2}
.rt-side .seg button.on{background:#2563eb;color:#fff}
.rt-side .rt-tools button{flex:1;padding:8px 6px;font-size:13px}
.rt-side .hint,.rt-side .rt-status{color:#aab2be;font-size:12.5px;margin:0;min-height:0}
.rt-side .rt-status{color:#e6e8eb;font-weight:600;min-height:34px}
.rt-side .lay-chk,.rt-side .lay-chk small{color:#e6e8eb}
.rt-side .lay-chk small{color:#9aa3af}
.rt-side .btn.ghost{background:#363b44;color:#e6e8eb;border-color:#4a515c}
.rt-side .btn.ghost:disabled{opacity:.45}
.rt-side .rt-all{width:100%;justify-content:center}
@media (max-width:820px){
  .rt-keys{display:none}
  .rt-body{flex-direction:column}
  #rtModal .rt-stage{flex:none;height:58vh}
  .rt-side{width:auto;flex:1;border-left:0;border-top:1px solid #3a3f47}
}

/* v45: never squeeze the retouch canvas when zoomed (the site-wide canvas{max-width:100%} stretched it) */
.rt-wrap{flex:none}
.rt-wrap canvas{max-width:none !important;max-height:none !important}

/* v46: auto fairness */
.fair-row{display:grid;gap:8px;margin-top:2px}
.fair-row .lbl{margin:0}.fair-row .lbl small{font-weight:500;color:var(--muted);font-size:12.5px;margin-left:6px}
.fair-seg{display:flex;width:100%}
.fair-seg button{flex:1;padding:8px 0;text-align:center}
.fair-note{margin:0;min-height:18px}
.rt-side .fair-row .lbl{color:#e6e8eb}
.rt-detect{width:100%;justify-content:center}
.fair-sw{display:flex;align-items:center;gap:8px;font-size:12.5px;color:#9aa3af}
.sw-chip{width:30px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.35);display:inline-block}
.sw-arrow{color:#9aa3af}
.fair-note:empty{display:none}

/* v48: compare (eye) button + original badge */
.rt-eye{position:absolute;top:12px;right:12px;width:42px;height:42px;border-radius:50%;border:1px solid rgba(255,255,255,.35);background:rgba(16,18,21,.72);color:#fff;display:grid;place-items:center;cursor:pointer;line-height:0;padding:0;box-shadow:0 2px 10px rgba(0,0,0,.4);transition:background .15s,transform .15s}
.rt-eye:hover{background:rgba(16,18,21,.9);transform:scale(1.06)}
.rt-eye:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}
.rt-eye.on{background:#2563eb;border-color:#93c5fd}
.rt-eye .ic-off{display:none}.rt-eye.on .ic-on{display:none}.rt-eye.on .ic-off{display:block}
.rt-orig-badge{position:absolute;top:18px;left:14px;background:rgba(37,99,235,.92);color:#fff;font:700 12.5px/1 Inter,system-ui,sans-serif;padding:7px 11px;border-radius:999px;letter-spacing:.2px;pointer-events:none}
.rt-orig-badge.hidden{display:none}

/* v49: drag and drop anywhere, paste buttons */
.drop-overlay{position:fixed;inset:0;z-index:300;display:grid;place-items:center;background:rgba(37,99,235,.16);backdrop-filter:blur(2px);pointer-events:none}
.drop-overlay.hidden{display:none}
.drop-overlay-box{display:grid;justify-items:center;gap:6px;padding:34px 44px;border:3px dashed #2563eb;border-radius:20px;background:rgba(255,255,255,.96);color:#1d4ed8;text-align:center;box-shadow:0 18px 60px rgba(15,23,42,.25)}
.drop-overlay-box b{font-size:20px}.drop-overlay-box span{color:#64748b;font-size:14px}
@media (prefers-color-scheme:dark){.drop-overlay-box{background:rgba(17,24,39,.96);color:#93c5fd;border-color:#60a5fa}}
.btn.over,.btn:is(#chooseBtn,#replaceBtn).over{outline:3px solid #2563eb;outline-offset:2px;background:var(--soft,#eef4ff)}
.done-btns{display:flex;gap:8px;flex-wrap:wrap}
kbd{font:600 .85em/1 ui-monospace,SFMono-Regular,Menlo,monospace;padding:2px 6px;border:1px solid #cbd5e1;border-bottom-width:2px;border-radius:5px;background:#f8fafc;color:#334155}

/* v50: background remover + face enhance */
.bg-seg{display:flex;width:100%}.bg-seg button{flex:1;padding:9px 0;text-align:center}
.enh-ctl{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.enh-ctl input[type=range]{flex:1;min-width:120px}
.enh-btn[aria-pressed="true"]{background:var(--brand,#2563eb);border-color:var(--brand,#2563eb);color:#fff}
.lbl small{font-weight:500;color:var(--muted,#64748b);font-size:12.5px;margin-left:6px}
.bg-note-busy{color:#1d4ed8}

/* v51: refine background removal workspace (same look as Retouch) */
#bgModal.rt-full{background:#16181b;padding:0;align-items:stretch;justify-content:stretch}
#bgModal .rt-stage{flex:1;min-width:0;height:auto;max-height:none;min-height:0;border-radius:0;padding:10px;background:#101215;display:flex;overflow:auto}
@media (max-width:820px){#bgModal .rt-stage{flex:none;height:58vh}}
#bgWrap{position:relative;margin:auto;line-height:0;flex:none}
#bgWrap canvas{display:block;max-width:none !important;max-height:none !important;box-shadow:0 6px 28px rgba(0,0,0,.6)}
#bgOver{position:absolute;left:0;top:0;touch-action:none;cursor:crosshair}
#bgCanvas{background:#fff}
#bgRefineBtn{width:100%;justify-content:center}

/* v51: compact full-screen headers on phones so Done and the close button always fit */
@media (max-width:520px){
  .rt-top{gap:8px;padding:0 8px 0 12px}
  .rt-top h3{font-size:14px}
  .rt-top-r{gap:6px}
  .rt-tb{padding:8px 7px;font-size:12px}
  .rt-top .btn{padding:0 12px;height:34px}
  .rt-x{width:32px;height:32px;flex:none}
}

/* v52 – Pick colour tool in Refine */
.bg-pick{display:flex;align-items:center;gap:10px;font-size:12.5px;line-height:1.35;color:#c9d0da}
.bg-pick-sw{flex:none;width:30px;height:30px;border-radius:8px;border:2px solid #4b525c;background:repeating-conic-gradient(#d4d4d8 0 25%,#f4f4f5 0 50%) 0 0/10px 10px}
.rt-chk{display:flex;align-items:center;gap:8px;font-size:13px;color:#e5e7eb;cursor:pointer}
.rt-chk input{width:16px;height:16px;accent-color:#2f6df6}

/* v53/v54 – compact background + skin tone quick tools under the Crop photo button */
.pv-tools{margin-top:10px;padding-top:10px;border-top:1px solid var(--line);display:grid;gap:10px;text-align:left}
.pv-tools .fair-row{margin:0;display:grid;grid-template-columns:1fr auto;align-items:center;gap:6px 8px}
.pv-tools .lbl{font-size:13px;font-weight:800;color:var(--ink);margin:0}
.pv-tools .lbl small{display:none}
.pv-tools .seg{display:flex}
.pv-tools .seg button{padding:6px 0;flex:1;text-align:center;font-size:13px}
.pv-tools .bg-seg{width:150px}
.pv-tools .fair-seg{grid-column:1/-1;width:100%}
.pv-tools .btn.sm{padding:6px 10px;font-size:13px;justify-content:center}
.pv-tools #bgRefineBtn{grid-column:1/-1;width:100%}
.pv-tools .fair-note{grid-column:1/-1;margin:0;min-height:0;font-size:12px;line-height:1.35}
.pv-tools .enh-ctl{display:contents}
.pv-tools .enh-btn{grid-column:2;grid-row:1}
.pv-tools .enh-ctl input[type=range]{grid-column:1;grid-row:2;min-width:0;width:100%}
.pv-tools .enh-ctl output{grid-column:2;grid-row:2;text-align:right;font-size:12.5px}
.pv-tools .enh-row .fair-note{grid-row:3}
.editor .split-prev{max-height:calc(100vh - 106px);overflow-y:auto}
@media (max-width:820px){.editor .split-prev{max-height:none;overflow:visible}}
.pv-tools{gap:8px}
.pv-tools .fair-note{font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* v55 – background colour inside the quick tools, passport-friendly swatches, mobile-friendly sizes */
.pv-tools .bg-colour{display:grid;gap:8px}
.pv-tools .bg-colname{font-weight:600;color:var(--muted);font-size:12.5px;margin-left:6px}
.pv-tools .pv-sw{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;align-items:center}
.pv-tools .pv-sw .sw{width:100%;max-width:34px;aspect-ratio:1;height:auto;justify-self:center}
.pv-tools .pv-sw input[type=color]{width:100%;max-width:34px;height:auto;aspect-ratio:1;padding:0;justify-self:center;border-radius:50%}
@media (max-width:820px){
  .pv-tools{gap:14px;margin-top:12px;padding-top:12px}
  .pv-tools .lbl{font-size:14px}
  .pv-tools .seg button{padding:11px 0;font-size:14.5px;min-height:44px}
  .pv-tools .bg-seg{width:auto;min-width:200px}
  .pv-tools .bg-seg button{padding-left:16px;padding-right:16px;white-space:nowrap}
  .pv-tools .btn.sm{min-height:44px;font-size:14.5px}
  .pv-tools .fair-note{font-size:12.5px;white-space:normal}
  .pv-tools .pv-sw{gap:8px}
  .pv-tools .pv-sw .sw,.pv-tools .pv-sw input[type=color]{max-width:42px}
  .pv-crop{min-height:48px}
}

/* v56 – more colours (Material palette) + rainbow custom picker */
.sw-more{justify-self:start;margin-top:8px;background:none;border:0;padding:4px 0;font:700 13px/1 inherit;font-family:inherit;color:var(--brand,#2563eb);cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.sw-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:8px}
.sw-grid .sw{width:100%;height:auto;aspect-ratio:1;border-radius:10px;border:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.sw-grid .sw.on{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--brand,#2563eb)}
.swatches input[type=color]{-webkit-appearance:none;appearance:none;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #94a3b8;background:conic-gradient(#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);width:30px;height:30px;padding:0;position:relative}
.swatches input[type=color]::-webkit-color-swatch-wrapper{padding:0;opacity:0}
.swatches input[type=color]::-webkit-color-swatch{border:0}
.swatches input[type=color]::-moz-color-swatch{border:0;opacity:0}
.pv-tools .pv-sw input[type=color]{border-radius:50%}
@media (max-width:820px){.sw-grid{grid-template-columns:repeat(5,1fr);gap:10px}.sw-more{padding:10px 0;font-size:14.5px}}
