:root{
  --bg:#f6f7fb; --card:#fff; --text:#1a2333; --muted:#5b6577; --soft-muted:#7a8296;
  --border:#e4e7ef; --line:#eef0f6; --input-bg:#fff; --input-border:#d4d9e6;
  --chip:#e8ebf4; --soft:#fbfcff; --shadow:rgba(20,30,60,.05); --footer:#9aa2b4;
}
body.dark{
  --bg:#10141f; --card:#1a2130; --text:#e8ecf5; --muted:#9aa4b8; --soft-muted:#8590a6;
  --border:#2a3245; --line:#232b3d; --input-bg:#121826; --input-border:#39425a;
  --chip:#262f44; --soft:#151b2a; --shadow:rgba(0,0,0,.3); --footer:#5d6880;
}
body.warm{
  --bg:#faf7f1; --card:#fdfbf7; --text:#23303a; --muted:#7a7264; --soft-muted:#8a8275;
  --border:#e7e0d3; --line:#efe9dd; --input-bg:#fdfbf7; --input-border:#d8d1c4;
  --chip:#efe9dd; --soft:#f5f1e8; --shadow:rgba(60,50,30,.06); --footer:#a39a89;
}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.5}
h1,h2,h3{line-height:1.2}
a{color:var(--accent)}
main{max-width:980px;margin:0 auto;padding:24px 20px 60px}

.store-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 24px;background:var(--card);border-bottom:3px solid var(--accent);flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:14px}
.brand h1{margin:0;font-size:22px}
.tagline{margin:2px 0 0;color:var(--muted);font-size:13px}
.logo{width:52px;height:52px;border-radius:10px;object-fit:contain}
.logo-fallback{display:flex;align-items:center;justify-content:center;background:var(--accent);color:#fff;font-size:26px;font-weight:700}
.store-header nav a{margin-left:14px;text-decoration:none;color:var(--muted);font-weight:600;font-size:14px}
.store-header nav a.active{color:var(--accent)}

.card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:22px;margin:18px 0;box-shadow:0 1px 3px var(--shadow)}
/* The step in play. A page of identical panels gives no sense of where you are,
   and every step past the first only appears once the one before it is done. */
.card.step-now{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}
/* One pulse when a step arrives, or when a button points at one already on
   screen — which is what made "Start your card" look like a dead button. */
@keyframes step-flash{
  0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 55%,transparent)}
  100%{box-shadow:0 0 0 14px transparent}
}
.step-flash{animation:step-flash .9s ease-out 2}
@media (prefers-reduced-motion:reduce){.step-flash{animation:none}}
.card h2{margin-top:0;font-size:19px}
.muted{color:var(--muted);font-size:14px}
.small{font-size:12.5px;color:var(--soft-muted)}

.btn{display:inline-block;background:var(--accent);color:#fff;border:none;border-radius:9px;padding:11px 22px;font-size:15px;font-weight:650;cursor:pointer;text-decoration:none}
.pop-badge{display:inline-block;background:var(--accent);color:#fff;font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:2px 9px;border-radius:999px;vertical-align:middle;margin-left:6px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.fld input:disabled{opacity:.45;cursor:not-allowed}
.btn.secondary{background:var(--chip);color:var(--text)}
.btn.sm{padding:6px 12px;font-size:13px}
.btn.danger{background:#c2410c}

.fix-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin:14px 0}
.fix{display:flex;gap:10px;align-items:flex-start;border:1.5px solid var(--border);border-radius:10px;padding:12px;cursor:pointer;background:var(--card)}
.fix input{margin-top:3px}
.fix.on{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--card))}
.fix b{display:block;font-size:14.5px}
.fix span{font-size:12.5px;color:var(--muted)}
.fix.included{cursor:default;border-color:color-mix(in srgb,var(--accent) 35%,var(--border));background:color-mix(in srgb,var(--accent) 5%,var(--card))}
.fix-check{color:var(--accent);font-weight:700;margin-top:1px}

.drop{border:2px dashed var(--input-border);border-radius:12px;padding:26px;text-align:center;color:var(--muted);background:var(--soft)}
.drop img{max-width:100%;max-height:300px;border-radius:8px}

.ba-slider{position:relative;overflow:hidden;border-radius:10px;max-width:720px;margin:0 auto;touch-action:none;cursor:ew-resize;user-select:none;-webkit-user-select:none}
.ba-slider img{width:100%;display:block;pointer-events:none}
.ba-slider .ba-after{position:absolute;inset:0;height:100%;object-fit:cover;clip-path:inset(0 0 0 50%)}
.ba-handle{position:absolute;top:0;bottom:0;left:50%;width:3px;background:#fff;box-shadow:0 0 6px rgba(0,0,0,.45);transform:translateX(-50%)}
.ba-grip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:38px;height:38px;border-radius:50%;background:#fff;color:#1a2333;display:flex;align-items:center;justify-content:center;font-size:19px;font-weight:700;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.ba-tag{position:absolute;top:10px;padding:3px 10px;border-radius:999px;background:rgba(15,20,35,.6);color:#fff;font-size:11.5px;font-weight:700;letter-spacing:.06em;pointer-events:none}
/* Original not decodable in this browser (HEIC on Chrome/Firefox): show the
   restored image alone instead of a broken before/after slider. */
.ba-slider.no-before .ba-after{position:static;clip-path:none;height:auto}
.ba-slider.no-before img:not(.ba-after),.ba-slider.no-before .ba-handle,.ba-slider.no-before .ba-tag{display:none}

.spinner{width:34px;height:34px;border:4px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 12px}
@keyframes spin{to{transform:rotate(360deg)}}
.center{text-align:center}

table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;color:var(--muted);font-size:12.5px;text-transform:uppercase;letter-spacing:.04em;padding:8px 10px;border-bottom:2px solid var(--border)}
td{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
td.num,th.num{text-align:right}
.scroll-box{max-height:420px;overflow-y:auto;border:1px solid var(--line);border-radius:10px}
.scroll-box table{margin:0}
.scroll-box th{position:sticky;top:0;background:var(--card);z-index:1}

.order-row{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.order-row:last-child{border-bottom:none}
.row-move{display:flex;flex-direction:column;gap:4px;flex:none}
.row-move .btn{padding:1px 9px;font-size:14px;line-height:1.5;border:1px solid var(--input-border)}
select,input[type=text],input[type=number],input[type=color],input[type=email],input[type=tel]{padding:8px 10px;border:1.5px solid var(--input-border);border-radius:8px;font-size:14px;background:var(--input-bg);color:var(--text)}
/* Color pickers need real dimensions or the swatch collapses to a sliver. */
input[type=color]{padding:3px;height:44px;width:72px;cursor:pointer}
label.fld input[type=color]{width:72px}
input[type=number].price{width:96px}
label.fld{display:block;margin:10px 0;font-size:14px;font-weight:600}
label.fld input,label.fld select{display:block;margin-top:4px;font-weight:400;width:100%;max-width:340px}
/* Checkbox fields: the box sits inline before its label text, not on its own line */
label.fld.check input[type=checkbox]{display:inline-block;width:auto;margin:0 7px 0 0;vertical-align:-2px}
form.inline{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
form.inline label{font-size:12.5px;font-weight:650;color:var(--muted);display:block}
form.inline label input{display:block;margin-top:3px}

.total-line{display:flex;justify-content:space-between;font-size:15px;padding:6px 0}
.total-line.grand{font-weight:750;font-size:18px;border-top:2px solid var(--border);margin-top:8px;padding-top:12px}

.badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700}
.badge.ok{background:#dcfce7;color:#15803d}
.badge.pending{background:#fef3c7;color:#b45309}
.badge.sim{background:#e0e7ff;color:#4338ca}

.frame-swatch{width:64px;height:44px;object-fit:cover;border-radius:6px;border:1px solid var(--input-border)}
.mat-wrap{display:inline-flex;align-items:center;gap:6px}
.mat-dot{width:16px;height:16px;border-radius:50%;border:1px solid var(--input-border);flex:none}
.mat-swatch{width:34px;height:34px;border-radius:8px;border:1px solid var(--input-border);flex:none}
#framed-preview{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:8px 28px;margin:18px 0 6px}
.fp-item{text-align:center}
.fp-stage{text-align:center;margin:0 0 6px}
.fp-frame{display:inline-block;background:#7a5230;box-shadow:0 6px 22px rgba(0,0,0,.35),inset 0 2px 5px rgba(255,255,255,.28),inset 0 -2px 5px rgba(0,0,0,.4),inset 2px 0 5px rgba(255,255,255,.12),inset -2px 0 5px rgba(0,0,0,.25)}
.fp-mat{display:block;box-shadow:inset 0 1px 5px rgba(0,0,0,.3)}
.fp-img{display:block}
.fp-chip{width:38px;height:16px;object-fit:cover;border-radius:3px;vertical-align:-3px;margin-right:4px}
.store-card{display:flex;justify-content:space-between;align-items:center;gap:12px}
.site-footer{text-align:center;color:var(--footer);font-size:12.5px;padding:26px 0 34px}
.notice{background:#eef4ff;border:1px solid #c9dbff;border-radius:10px;padding:12px 16px;font-size:13.5px;color:#274b8f}
/* Advisory, not an error: choosing a shape the photo isn't is allowed. */
.shape-warn{background:#fffaeb;border:1px solid #fde68a;border-radius:10px;padding:10px 14px;font-size:13px;color:#92400e;max-width:640px}
.shape-warn a{color:inherit;font-weight:650}
body.dark .shape-warn{background:#3b2f14;border-color:#7c5e16;color:#fcd9a0}
.hero{padding:34px 0 6px}
.hero h2{font-size:30px;margin:0 0 8px}
.hero-grid{display:grid;grid-template-columns:5fr 6fr;gap:34px;align-items:center;padding-bottom:18px}
.hero-grid .ba-slider{max-width:560px}
.ba-caption{text-align:center;margin-top:8px}
@media(max-width:840px){.hero-grid{grid-template-columns:1fr;gap:18px}}
.step-num{display:inline-flex;width:26px;height:26px;border-radius:50%;background:var(--accent);color:#fff;font-size:14px;font-weight:700;align-items:center;justify-content:center;margin-right:8px}
.ok-text{color:#15803d;font-weight:650}
.err-text{color:#b91c1c;font-weight:650}
body.dark .ok-text{color:#4ade80}
body.dark .err-text{color:#f87171}

/* order-line thumbnails (customer order page, summary) */
.total-line.item{align-items:center;gap:12px}
.total-line.item .lbl{flex:1;min-width:0}
.line-thumb{flex:none;display:block;object-fit:cover;border-radius:6px;border:1px solid var(--input-border);background:var(--chip);box-shadow:0 1px 3px rgba(0,0,0,.12)}
/* admin order-line thumbnails */
.mini-thumb{width:34px;height:34px;object-fit:cover;border-radius:5px;border:1px solid var(--input-border);background:var(--chip);flex:none}
/* admin orders (like Prints): the photo's thumbnail beside one block per product */
.oitems{display:flex;gap:10px;align-items:flex-start;min-width:280px;max-width:460px}
.oitems-list{flex:1;min-width:0}
.othumb{position:relative;display:block;flex:none;width:56px;height:56px;border-radius:6px;overflow:hidden;border:1px solid var(--input-border);background:var(--chip)}
.othumb img{width:100%;height:100%;object-fit:cover;display:block}
a.othumb:hover{outline:2px solid var(--accent);outline-offset:1px}
.othumb .tq{position:absolute;right:2px;bottom:2px;background:rgba(15,20,35,.75);color:#fff;font-size:10px;font-weight:700;line-height:1;padding:2px 3px;border-radius:3px}
.pgroup{padding:6px 0;border-bottom:1px solid var(--line)}
.pgroup:first-child{padding-top:0}
.pgroup-head{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.pgroup-head .btn{margin-left:auto;align-self:center}
/* order page: a heading row per product in the work list */
.print-list tr.pgroup-row td{background:var(--soft);border-top:2px solid var(--line);padding-top:10px;padding-bottom:10px}
.print-list tr.pgroup-row .pgroup-head{margin:0}

/* ---- admin order summary / work list (shared with prints) ---- */
.osum-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px 28px;margin:14px 0 4px}
.osum-grid .k{font-size:12.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:3px}
.osum-grid .v{font-size:15px;line-height:1.45;white-space:pre-line}
.print-list td.qty{font-size:20px;font-weight:750;text-align:center;width:72px}
.print-list td.thumb-cell{width:1%;padding-right:14px}
.print-list .line-thumb{height:80px}
.print-list .file{font-weight:600;word-break:break-all}
@media print{
  .store-header,.no-print,footer{display:none!important}
  body{background:#fff;color:#000}
  main{max-width:none;padding:0}
  .card{border:none;box-shadow:none;padding:0;margin:0 0 18px}
  .print-list .line-thumb{height:64px;border-color:#999}
  a{color:inherit;text-decoration:none}
  tr{break-inside:avoid}
}

/* ---- poster style picker ---- */
.style-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.fix.style{align-items:center}
.fix.style input{position:absolute;opacity:0;pointer-events:none}
.fix.style{position:relative}
.style-swatch{flex:none;width:44px;height:58px;border-radius:5px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),0 1px 3px rgba(0,0,0,.2)}

/* Compare box with a FIXED shape (the poster's): both images fill it, the photo
   cover-cropped, so the reveal slider works whatever shape the upload was. */
.ba-slider.ba-fixed{width:100%}
.ba-slider.ba-fixed img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ba-slider.ba-fixed.no-before .ba-after{position:absolute;clip-path:none;height:100%}

/* ---- Gifts ---- */
.hero-sample{display:block;width:100%;max-width:440px;height:auto;aspect-ratio:1;margin:0 auto;border-radius:14px;background:#eef0f3}
.gift-grid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
.fix.gift{position:relative;flex-direction:column;align-items:stretch;padding:10px}
.fix.gift input{position:absolute;opacity:0;pointer-events:none}
.fix.gift:focus-within,.fix.layout:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.fix.gift img{display:block;width:100%;height:auto;aspect-ratio:1;border-radius:8px;background:#eef0f3}
.fix.gift div{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.fix.gift span{font-size:14px;color:var(--text);font-weight:650}
.fix.layout{position:relative}
.fix.layout input{position:absolute;opacity:0;pointer-events:none}
.layout-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.gift-about h3{margin:6px 0 4px}
.gift-about p{margin:0 0 10px}
table.specs{width:auto;border-collapse:collapse;font-size:13.5px}
table.specs th,table.specs td{text-align:left;padding:3px 18px 3px 0;border:none;font-weight:400}
table.specs th{color:var(--muted)}

.photo-strip{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 4px}
.photo-strip:empty{display:none}
.photo-thumb{position:relative;flex:none;width:76px;height:76px;padding:0;border:2px solid var(--border);border-radius:8px;overflow:hidden;background:var(--chip);cursor:pointer}
.photo-thumb.on{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 30%,transparent)}
.photo-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.photo-thumb .in-use{position:absolute;left:0;right:0;bottom:0;background:rgba(15,20,35,.72);color:#fff;font-size:10.5px;font-weight:700;line-height:1.5;text-align:center}

.editor{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px;align-items:start;margin-top:6px}
.editor-stage{position:relative;border-radius:8px;overflow:hidden;background:#eef0f3;box-shadow:0 1px 4px rgba(0,0,0,.18);line-height:0}
.editor-stage canvas{display:block;width:100%;height:auto}
#art{touch-action:none;cursor:grab}
#art:active{cursor:grabbing}
#art:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
#overlay{position:absolute;inset:0;height:100%;pointer-events:none}
.editor-tools{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:12px 0 4px}
.editor-tools .tool{display:flex;gap:8px;align-items:center;font-weight:650;flex:1;min-width:170px}
.editor-tools .tool input{flex:1;min-width:0}
.slot-tabs{display:flex;gap:6px}
.editor-key{display:flex;gap:4px 16px;flex-wrap:wrap;align-items:center}
.editor-key > span{white-space:nowrap}
.key{display:inline-block;width:18px;height:11px;margin-right:5px;border-radius:2px;vertical-align:-1px}
.key-safe{border:1.5px dashed #1d4ed8;background:#fff}
.key-bleed{background:rgba(20,28,45,.34)}
.key-hidden{background:repeating-linear-gradient(45deg,rgba(180,35,24,.75) 0 2px,rgba(180,35,24,.2) 2px 6px)}
.dpi:empty{display:none}
.warn-text{color:#9a5b00}
body.dark .warn-text{color:#f0b456}
.editor-views{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.editor-views figure{margin:0;border-radius:10px;overflow:hidden;background:#eef0f3;border:1px solid var(--border)}
.editor-views canvas,.editor-views img{display:block;width:100%;height:auto;aspect-ratio:1}
.editor-views figure:only-child{grid-column:1 / -1}
.editor [hidden],.editor-views [hidden]{display:none!important}
.editor-views figcaption{padding:6px 10px;font-size:12.5px;color:var(--muted);background:var(--card)}
.add-row{align-items:flex-end;margin-top:14px}

.basket-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--line)}
.basket-row img{flex:none;display:block;width:84px;height:84px;border-radius:8px;background:#eef0f3;object-fit:cover}
.basket-what{flex:1;min-width:150px;display:flex;flex-direction:column;gap:1px}
.basket-price{min-width:70px;text-align:right;font-weight:650}
.basket-opts:empty{display:none}

.press-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 16px;align-items:start}
.press-grid label,.blank-form > div > div > label{display:flex;flex-direction:column;gap:3px;font-size:12.5px;font-weight:650;color:var(--muted)}
.press-grid label input,.press-grid label select{width:100%;max-width:220px;font-weight:400}
.press-grid label input.price{width:100%}
.press-grid label.check,.product-form label.check{display:block;font-size:13.5px;font-weight:600;color:var(--text)}
.press-grid label.check input,.product-form label.check input{display:inline-block;width:auto;margin:0 7px 0 0;vertical-align:-2px}
.product-form label.check select{display:inline-block;width:auto;font-weight:400}
.product-form h4{font-size:14px}
.blank-preview:not([src]){visibility:hidden}
.blank-preview{display:block;width:100%;max-width:300px;height:auto;aspect-ratio:1;border-radius:10px;background:#eef0f3;border:1px solid var(--border)}
.product-card{border:1px solid var(--border);border-radius:10px;padding:14px;margin:12px 0}
.product-head{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.product-head img{flex:none;width:64px;height:64px;border-radius:8px;background:#eef0f3}
.product-head .grow{flex:1;min-width:160px}
details.blank > summary{cursor:pointer;font-weight:650;margin:10px 0 6px}
.gift-item{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap;padding:14px 0;border-bottom:1px solid var(--line)}
.gift-item:last-child{border-bottom:none}
.gift-item .pics{display:flex;gap:8px;flex:none}
.gift-item .pics img{display:block;width:150px;height:150px;border-radius:8px;background:#eef0f3;border:1px solid var(--border)}
.gift-item .what{flex:1;min-width:220px}
@media (max-width:760px){
  .editor{grid-template-columns:minmax(0,1fr)}
  .gift-item .pics img{width:110px;height:110px}
}
@media print{.gift-item .pics img{width:120px;height:120px}}

/* The decorating editor (Pintura): the whole window while it is open. */
.decorate-modal{position:fixed;inset:0;z-index:1000;background:#fff}
.decorate-modal[hidden]{display:none}
#decorate-host{width:100%;height:100%}
body.decorating{overflow:hidden}
.gift-family{margin:18px 0 8px;font-size:14px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.gift-family:first-of-type{margin-top:6px}
