:root{--bg:#f1f2f5;--panel:#fff;--ink:#1b2030;--muted:#6b7280;--line:#e6e8ee;--line2:#eef0f4;--brand1:#6d5efc;--brand2:#f5417f;--ok:#16a34a;--shadow:0 1px 2px rgba(16,24,40,.05),0 8px 24px rgba(16,24,40,.08)}
*{box-sizing:border-box}
/* Scrollbars follow each surface's own scheme: the thumb is a translucent mix of the
   surface's text colour, so themed panels, the stage and the modal all match. */
*{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,currentColor 32%,transparent) transparent}
*::-webkit-scrollbar{width:9px;height:9px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:color-mix(in srgb,currentColor 28%,transparent);border-radius:8px}
*::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,currentColor 42%,transparent)}
*::-webkit-scrollbar-corner{background:transparent}
html,body{margin:0;height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased;height:100vh;height:-webkit-fill-available;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.topbar{height:56px;flex:none;background:var(--panel);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:0 14px}
.brand{display:flex;align-items:center;gap:9px;font-weight:800;font-size:16px}
.brand .dot{width:24px;height:24px;border-radius:7px;background:conic-gradient(from 210deg,#f5417f,#ffb020,#16a34a,#3b82f6,#6d5efc,#f5417f)}
.vchip{display:flex;align-items:center;gap:9px;background:#f6f7fb;border:1px solid var(--line);border-radius:10px;padding:6px 11px;font-size:13px}
.vchip .cdot{width:16px;height:16px;border-radius:50%;box-shadow:0 0 0 1px var(--line)}
.vchip b{font-weight:700}
.vchip .sku{color:var(--muted);font-family:ui-monospace,Menlo,monospace;font-size:11.5px}
.spacer{flex:1}
.iconbtn{width:34px;height:34px;border:1px solid var(--line);background:#fff;border-radius:9px;cursor:pointer;font-size:15px;display:flex;align-items:center;justify-content:center;color:var(--ink)}
.iconbtn:hover{border-color:#cbd0d8}
.iconbtn:disabled{opacity:.4;cursor:not-allowed}
.price{font-size:13px;color:var(--muted);font-weight:600;white-space:nowrap}
.price b{color:var(--ink)}
.btn{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 14px;font-weight:700;font-size:13px;cursor:pointer}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.primary{background:linear-gradient(135deg,var(--brand1),var(--brand2));color:#fff;border:none;box-shadow:var(--shadow)}
.btn.sm{padding:7px 10px;font-size:12px}
.btn.primary.oos{background:linear-gradient(135deg,#f59e0b,#d97706)}
.stockpop{position:absolute;bottom:calc(100% + 10px);right:0;left:0;background:#fff;border:1px solid var(--line);border-left:3px solid #f59e0b;border-radius:12px;padding:11px 13px;box-shadow:0 10px 28px rgba(20,24,40,.16);z-index:40}
.stockpop b{font-size:12.5px;color:#b45309;display:block;margin-bottom:4px}
.stockpop p{margin:0;font-size:12px;line-height:1.5;color:var(--ink)}
.stockpop:after{content:"";position:absolute;top:100%;right:56px;border:7px solid transparent;border-top-color:#fff;filter:drop-shadow(0 1px 0 var(--line))}
/* Right-panel pricing footer, pinned to the bottom of the viewport */
.rfoot{flex:none;border-top:1px solid var(--line);background:var(--panel);padding:12px 14px}
.foot-head{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-bottom:9px}
.foot-head h4{margin:0}
.foot-actions{display:flex;gap:8px;margin-top:12px}
.foot-actions .btn{flex:1;text-align:center}
.pl-sec{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--brand1);margin:11px 0 1px}
.pl-sec:first-child{margin-top:6px}
.pl-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 0}
.pl-txt{min-width:0}
.pl-title{font-size:13px;font-weight:600;color:var(--ink);line-height:1.25}
.pl-sub{font-size:11px;color:var(--muted);line-height:1.3;margin-top:1px}
.pl-amt{font-size:13px;font-weight:700;color:var(--ink);white-space:nowrap;font-variant-numeric:tabular-nums}
.pl-row.warn .pl-title,.pl-row.warn .pl-amt{color:#dc2626}
.pl-row.sel{background:#f0efff;border-radius:8px;margin:0 -6px;padding-left:6px;padding-right:6px}
.pl-total{display:flex;align-items:center;justify-content:space-between;margin-top:8px;padding:11px 0 2px;border-top:1.5px solid #e4dfff}
.pl-total span{font-size:13px;font-weight:700;color:var(--ink)}
.pl-total b{font-size:20px;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
/* Toggle switch */
.switch-line{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ink);cursor:pointer;user-select:none}
.switch{position:relative;display:inline-block;width:34px;height:20px;flex:none}
.switch input{opacity:0;width:0;height:0}
.switch .slider{position:absolute;inset:0;background:var(--line);border-radius:20px;transition:.15s}
.switch .slider:before{content:"";position:absolute;height:16px;width:16px;left:2px;top:2px;background:#fff;border-radius:50%;transition:.15s;box-shadow:0 1px 2px rgba(16,24,40,.2)}
.switch input:checked + .slider{background:var(--brand1)}
.switch input:checked + .slider:before{transform:translateX(14px)}
.help{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:50%;background:var(--line2);color:var(--muted);font-size:10px;font-weight:700;cursor:help;border:1px solid var(--line);vertical-align:middle}
.help:hover{background:var(--brand1);color:#fff}
.tip{position:fixed;z-index:70;max-width:230px;background:#1b2030;color:#fff;font-size:12px;line-height:1.4;padding:9px 11px;border-radius:9px;box-shadow:var(--shadow);pointer-events:none}
.modalov{position:fixed;inset:0;z-index:60;background:rgba(16,24,40,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.modalbox{background:var(--panel);border-radius:16px;box-shadow:var(--shadow);padding:22px;max-width:380px;width:100%}
.modalbox h3{margin:0 0 6px;font-size:17px;color:var(--ink)}
.modalbox p{margin:0 0 14px;font-size:13px;color:var(--muted);line-height:1.45}
.modalbox input{width:100%;border:1px solid var(--line);border-radius:10px;padding:11px 12px;font-size:14px;box-sizing:border-box}
.modalerr{color:var(--brand2);font-size:12px;margin-top:6px}
.modalact{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.subbar{height:48px;flex:none;background:var(--panel);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 14px;overflow-x:auto}
.grp{display:flex;align-items:center;gap:8px}
.lbl{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.4px}
.sw{width:24px;height:24px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px var(--line);cursor:pointer}
.sw.active{box-shadow:0 0 0 2px var(--brand1)}
.swtip{position:fixed;transform:translateX(-50%);background:#1b2030;color:#fff;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;white-space:nowrap;z-index:120;pointer-events:none;display:none;box-shadow:0 3px 10px rgba(20,24,40,.25)}
select.mini{border:1px solid var(--line);border-radius:8px;padding:6px 8px;font-size:13px;background:#fff}
.place{display:flex;gap:5px}
.pltab{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 11px;font-size:12.5px;font-weight:600;cursor:pointer;position:relative}
.pltab.active{background:#111827;color:#fff;border-color:#111827}
.pltab .dot{position:absolute;top:3px;right:4px;width:6px;height:6px;border-radius:50%;background:var(--ok)}
.body{flex:1;display:flex;min-height:0}
.rail{width:76px;flex:none;background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 0}
.tool{width:60px;display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;border-radius:10px;cursor:pointer;font-size:11px;font-weight:600;color:var(--muted);border:1px solid transparent}
.tool:hover{background:var(--line2);color:var(--ink)}
.tool.active{background:#f0efff;color:var(--brand1);border-color:#ddd9ff}
.tool .e{font-size:21px}
.flyout{position:absolute;left:76px;top:0;bottom:0;width:250px;background:var(--panel);border-right:1px solid var(--line);box-shadow:var(--shadow);padding:14px;overflow:auto;display:none;z-index:20}
.flyout.open{display:block}
.flyout h4{margin:0 0 10px;font-size:13px}
/* Compact popout: a small sub-menu anchored beside its rail button (Options) rather
   than a full-height panel. */
.flyout.compact{top:auto;bottom:12px;height:auto;max-height:72%;border:1px solid var(--line);border-radius:12px;width:236px}
#flyAI{width:300px}
.aimsg{font-size:12px;line-height:1.45;padding:7px 10px;border-radius:10px;margin:0 0 6px;white-space:pre-wrap;max-width:86%}
.aimsg.user{background:var(--brand1);color:#fff;align-self:flex-end}
.aimsg.assistant{background:#eef0f5;color:var(--ink);align-self:flex-start}
.aimsg img{max-width:120px;max-height:90px;border-radius:6px;display:block}
.aichip{display:flex;align-items:center;gap:8px;margin-top:8px;padding:6px 8px;border:1px solid var(--line);border-radius:9px;font-size:11px;color:var(--muted);background:#f7f8fb}
.aichip img{width:28px;height:28px;object-fit:cover;border-radius:5px}
.aichip button{margin-left:auto;border:none;background:none;cursor:pointer;font-size:12px;color:var(--muted)}
/* The assistant's "hand": a soft cursor that performs each edit like a person would. */
.aihand{position:absolute;width:22px;height:22px;border-radius:50%;background:rgba(109,94,252,.22);border:2px solid var(--brand1);box-shadow:0 2px 8px rgba(109,94,252,.35);pointer-events:none;z-index:8;transform:translate(-50%,-50%);display:none}
.aihand.press{background:rgba(109,94,252,.5)}
/* Font picker: a custom dropdown so every option previews in its own face. */
.fontbtn{width:100%;text-align:left;border:1px solid var(--line);border-radius:8px;background:#fff;padding:8px 10px;font-size:15px;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.fontbtn:after{content:"▾";float:right;color:var(--muted);font-size:11px;margin-top:2px}
.fontmenu{position:absolute;left:0;right:0;top:100%;margin-top:4px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);max-height:280px;overflow:auto;z-index:40;padding:4px}
.fontgrp{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);padding:8px 8px 3px}
.fontopt{padding:6px 8px;border-radius:7px;font-size:17px;line-height:1.25;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fontopt:hover{background:var(--line2)}
.fontopt.sel{background:#f0efff;color:var(--brand1)}
.ggrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.gitem{aspect-ratio:1/1;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:24px}
.gitem:hover{border-color:var(--brand1)}
.gitem .gdel{position:absolute;top:3px;right:3px;width:18px;height:18px;border:none;border-radius:50%;background:rgba(27,32,48,.55);color:#fff;font-size:10px;line-height:1;cursor:pointer;display:none;align-items:center;justify-content:center;padding:0}
.gitem:hover .gdel{display:flex}
.gitem .gdel:hover{background:#dc2626}
.gitem.orig{border:2px solid #16a34a}
.gitem .gorig{position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#16a34a;color:#fff;font-size:10px;line-height:16px;text-align:center;font-weight:700}
.origlock{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:8px 10px;font-size:11.5px;color:#166534;line-height:1.45}
.gitem svg{width:30px;height:30px}
.up{border:2px dashed var(--line);border-radius:12px;padding:22px;text-align:center;color:var(--muted);font-size:13px;cursor:pointer}
.up:hover{border-color:var(--brand1);color:var(--brand1)}
/* margin:auto (not flex centring) keeps the stage centred when it fits and scrollable from the
   left edge when the side-by-side cards overflow at 100% zoom. The backdrop is a workshop
   cutting mat: a fine 10px grid with a stronger line every 50px (10cm at the stage's 5px/cm). */
.stagewrap{flex:1;position:relative;display:flex;overflow:auto;
  background:
    linear-gradient(rgba(59,77,115,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,77,115,.10) 1px, transparent 1px),
    linear-gradient(rgba(59,77,115,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,77,115,.045) 1px, transparent 1px),
    #e9ebf1;
  background-size:50px 50px, 50px 50px, 10px 10px, 10px 10px}
.canvasbox{background:#fff;border-radius:12px;box-shadow:var(--shadow);position:relative;margin:auto}
/* Multi-side: the per-garment cards drawn on the canvas are the boxes, so the wrapper is bare. */
.canvasbox.multi{background:transparent;box-shadow:none;border-radius:0}
/* Rotate-the-face button (magnets): a circle straddling the card's bottom-right
   corner. Positioned in canvas CSS px by positionRotateBtn(), zoom-aware. */
.rotbtn{position:absolute;width:42px;height:42px;transform:translate(-50%,-50%);z-index:7;border:1px solid var(--line);background:#fff;color:#1b2030;border-radius:50%;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 10px rgba(20,24,40,.14)}
.rotbtn:hover{border-color:var(--brand1);color:var(--brand1)}
.rotbtn svg{display:block}
.sizebadge{position:absolute;transform:translateX(-50%);background:#1b2030;color:#fff;font-size:11px;font-weight:600;padding:3px 8px;border-radius:6px;pointer-events:none;white-space:nowrap;z-index:6;font-variant-numeric:tabular-nums}
/* Garment sizing (from the size metafields), pinned top-left of the stage below the swatches. */
/* View-product card: mirrors the sizing widget but pinned top-RIGHT; shows the main
   product image, opens the product modal on click. */
.viewprod{position:absolute;top:12px;right:12px;z-index:6;border:1px solid #e2e5ec;border-radius:12px;background:rgba(255,255,255,.96);box-shadow:0 2px 10px rgba(20,24,40,.10);padding:6px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;width:104px}
.viewprod:hover{border-color:var(--brand1)}
.viewprod .vp-cap{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:var(--muted,#6b7280)}
.viewprod img{width:90px;height:90px;object-fit:contain;background:#fff;border-radius:8px;display:block}
/* Product modal: a compact product page. Image + thumbs + colours left, details right.
   The LEFT column sets the height; the description scrolls inside the remainder. */
.pmbox{position:relative;max-width:1120px;width:100%;max-height:90vh;overflow:hidden;padding:26px}
.pmclose{position:absolute;top:12px;right:12px;z-index:2}
/* The LEFT column is the only thing that sets the modal's height: the right column
   holds no in-flow content (its inner wrapper is absolute), so however long the
   description, it can only fill the left column's height and scroll. */
.pmgrid{display:flex;gap:28px;align-items:stretch}
.pmleft{flex:0 0 42%;min-width:0}
.pmright{flex:1;min-width:0;position:relative}
.pmrightin{position:absolute;top:0;right:0;bottom:0;left:0;inset:0;display:flex;flex-direction:column}
.pmmain{background:#fff;border:1px solid var(--pmline,var(--line));border-radius:14px;overflow:hidden}
.pmmain img{width:100%;height:auto;max-height:52vh;aspect-ratio:1/1;object-fit:contain;display:block;background:#fff}
.pmthumbs{display:flex;gap:8px;overflow-x:auto;margin-top:10px;padding-bottom:4px}
.pmthumbs img{width:64px;height:64px;object-fit:contain;background:#fff;border:1px solid var(--pmline,var(--line));border-radius:9px;flex:0 0 auto;cursor:pointer}
.pmthumbs img.on{border-color:var(--brand1);box-shadow:0 0 0 1px var(--brand1)}
.pmswatches{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.pmswatch{position:relative;width:24px;height:24px;border-radius:50%;border:1px solid rgba(20,24,40,.25);box-shadow:inset 0 0 0 2px rgba(255,255,255,.55)}
/* Instant colour-name tooltip (native titles are slow and easy to miss). */
.pmswatch:hover::after{content:attr(data-name);position:absolute;bottom:135%;left:50%;transform:translateX(-50%);background:#1b2030;color:#fff;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;white-space:nowrap;pointer-events:none;z-index:4;box-shadow:0 3px 10px rgba(20,24,40,.25)}
.pmright h3{margin:0 0 4px;font-size:20px;padding-right:26px}
.pmprice{font-weight:800;font-size:16px;margin:2px 0 12px}
.pmsizes{display:flex;flex-direction:column;gap:10px;margin:0 0 14px;flex:0 0 auto}
.pmoptname{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);display:block;margin-bottom:5px}
.pmopts{display:flex;gap:6px;flex-wrap:wrap}
.pmchip{border:1px solid var(--pmline,var(--line));border-radius:8px;padding:3px 10px;font-size:12.5px;font-weight:600}
.pm-desc{font-size:14px;line-height:1.55;flex:1 1 auto;min-height:0;overflow-y:auto;padding-right:8px}
.pm-desc img{max-width:100%;height:auto}
.pm-desc a{color:var(--brand1)}
/* The box itself never scrolls (a flush scrollbar squares off the rounded right
   corners); on small screens everything stacks and the grid scrolls INSIDE the
   padding, with the right column back in normal flow. */
@media (max-width:760px){
  .pmbox{display:flex}
  .pmgrid{flex-direction:column;overflow-y:auto;min-height:0}
  .pmleft{flex:none}
  .pmright{position:static;flex:none}
  .pmrightin{position:static;display:block}
  .pm-desc{max-height:38vh;overflow-y:auto}
}
.sizinginfo{position:absolute;top:12px;left:12px;background:rgba(255,255,255,.94);border:1px solid #e2e5ec;border-radius:10px;padding:8px 12px;font-size:12px;line-height:1.5;color:#3d4353;box-shadow:0 2px 10px rgba(20,24,40,.08);pointer-events:none;z-index:5;font-variant-numeric:tabular-nums}
.sizinginfo b{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:#6b7280;margin-bottom:2px}
.sizinginfo .szrow{display:flex;align-items:center;gap:12px;margin-top:4px}
.sizinginfo .szrow svg{flex:0 0 auto;display:block}
.sizinginfo .szlegend{display:flex;flex-direction:column;gap:7px}
.sizinginfo .szlegend span{font-weight:800}
.sizinginfo .szlegend strong{font-size:13px}
.stagehint{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);font-size:12px;color:var(--muted);background:rgba(255,255,255,.8);padding:5px 12px;border-radius:999px}
.right{width:284px;flex:none;background:var(--panel);border-left:1px solid var(--line);display:flex;flex-direction:column;min-height:0}
.rpad{padding:14px;overflow:auto;flex:1;min-height:0}
.sec{border-bottom:1px solid var(--line2);padding-bottom:12px;margin-bottom:12px}
.sec h4{margin:0 0 10px;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted)}
.field{margin-bottom:10px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px;font-weight:600}
.field input[type=text],.field select{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:14px;background:#fff}
.rowf{display:flex;gap:8px;align-items:center}
input[type=range]{width:100%}
.chipbtns{display:flex;gap:6px;flex-wrap:wrap}
.chip{border:1px solid var(--line);background:#fff;border-radius:8px;padding:7px 9px;font-size:13px;cursor:pointer;font-weight:600;min-width:34px;text-align:center}
.chip:hover{border-color:#cbd0d8}
.chip.on{background:#111827;color:#fff;border-color:#111827}
.colorin{width:38px;height:34px;border:1px solid var(--line);border-radius:8px;padding:0;background:#fff;cursor:pointer}
.empty{font-size:12.5px;color:var(--muted);line-height:1.5}
.layers{display:flex;flex-direction:column;gap:6px}
.layer{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;padding:7px 9px;font-size:13px;cursor:pointer;background:#fff}
.layer.sel{border-color:var(--brand1);background:#f7f6ff}
.layer .ic{width:22px;text-align:center}
.layer .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.layer button{border:none;background:none;cursor:pointer;color:var(--muted);font-size:13px;padding:2px}
.layer .grip{color:var(--muted);cursor:grab;letter-spacing:-2px;font-size:12px;user-select:none}
.layer.dragging{opacity:.45}
.layer.dragover{border-color:var(--brand1);box-shadow:inset 0 2px 0 var(--brand1)}
.pricebox{border:1px solid #eceaff;background:#faf9ff;border-radius:12px;padding:2px 12px}
.pricebox .r{display:flex;justify-content:space-between;padding:6px 0;color:var(--muted)}
/* picker overlay (Path B) */
.launcher{position:fixed;inset:0;color:var(--ink);z-index:70;overflow:auto;display:none;
  background:
    linear-gradient(rgba(59,77,115,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,77,115,.10) 1px, transparent 1px),
    linear-gradient(rgba(59,77,115,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,77,115,.045) 1px, transparent 1px),
    #e9ebf1;
  background-size:50px 50px, 50px 50px, 10px 10px, 10px 10px}
.launcher.open{display:block}
.lwrap{max-width:1000px;margin:0 auto;padding:36px 22px 60px}
.lhead{display:flex;align-items:center;gap:10px;font-weight:800;font-size:20px;margin-bottom:24px}
.lhead .dot{width:26px;height:26px;border-radius:8px;background:conic-gradient(from 210deg,#f5417f,#ffb020,#16a34a,#3b82f6,#6d5efc,#f5417f)}
.lsect{display:flex;align-items:baseline;gap:12px;font-weight:800;font-size:16px;margin:26px 0 12px}
.lsect a{font-weight:600;font-size:12.5px;color:var(--brand1);text-decoration:none}
.lsect a:hover{text-decoration:underline}
.lsub{color:var(--muted);font-size:13px;margin-bottom:14px}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.pcard{background:var(--panel);border:1px solid var(--line);border-radius:14px;overflow:hidden;cursor:pointer;text-align:left;padding:0;color:var(--ink);box-shadow:var(--shadow)}
.pcard:hover{border-color:var(--brand1)}
.pcard img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block;background:#fff}
.pcard .b{padding:10px 12px}
.pcard .t{font-weight:700;font-size:13.5px}
.pcard .m{color:var(--muted);font-size:12px;margin-top:2px}
.pcard .m .sw{display:inline-block;width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 1px var(--line);vertical-align:-1px;margin-right:4px}
.pcard.design img{object-fit:contain;background:#faf9ff;border-bottom:1px solid var(--line2)}
.pcard .pill{display:inline-block;padding:1px 8px;border-radius:999px;font-size:10.5px;background:#eef0f4;color:var(--muted);text-transform:capitalize;margin-left:6px}
.pcard .pill.ordered{background:#e3f5e9;color:#116b3a}
.modal{position:fixed;inset:0;background:rgba(17,24,39,.45);display:none;align-items:center;justify-content:center;z-index:80;padding:18px}
.modal.open{display:flex}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#111827;color:#fff;padding:10px 16px;border-radius:999px;font-size:13px;z-index:90;box-shadow:var(--shadow)}
.ctxmenu{position:fixed;z-index:85;min-width:150px;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 28px rgba(20,24,40,.18);padding:5px;display:flex;flex-direction:column}
.ctxmenu button{border:none;background:none;text-align:left;padding:8px 12px;border-radius:7px;font-size:13px;color:var(--ink);cursor:pointer}
.ctxmenu button:hover{background:#f0efff}
.ctxmenu button:disabled{opacity:.4;cursor:default;background:none}
.ctxmenu button.danger{color:#dc2626}

/* ---------- touch parity (coarse pointers: phones, tablets, kiosks) ----------
   Same layout as desktop; only sizes and touch behaviours adapt. Long-pressing the
   canvas must open OUR menu, not the iOS callout, and text-entry fields need 16px
   type or iOS Safari zooms the whole page on focus. */
.stagewrap, .canvasbox{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
@media (pointer:coarse){
  .iconbtn{min-width:42px;min-height:42px}
  .sw{width:30px;height:30px}
  .rotbtn{width:46px;height:46px}
  .ctxmenu button{padding:12px 16px;font-size:14.5px}
  .pltab{padding:9px 14px}
  .right input[type=text],.right input[type=email],.right textarea,
  .flyout input[type=text],.flyout input[type=email],.flyout textarea,
  #emailInput,#aiInput,select.mini{font-size:16px}
  input[type=range]{min-height:34px}
  input[type=range]::-webkit-slider-thumb{width:24px;height:24px}
}

/* ---------- old-WebKit compatibility (iOS 12-era iPads: prime kiosk hardware) ----------
   That Safari parses flex `gap` but never applies it (and lacks aspect-ratio/inset/dvh),
   so the editor detects it at boot (html.no-flexgap) and spacing falls back to margins. */
html.no-flexgap .topbar>*+*{margin-left:12px}
html.no-flexgap .subbar>*+*{margin-left:16px}
html.no-flexgap .brand>*+*,html.no-flexgap .vchip>*+*{margin-left:9px}
html.no-flexgap .grp>*+*,html.no-flexgap .foot-actions>*+*,html.no-flexgap .modalact>*+*,html.no-flexgap .rowf>*+*,html.no-flexgap .aichip>*+*,html.no-flexgap .switch-line>*+*{margin-left:8px}
html.no-flexgap .place>*+*{margin-left:5px}
html.no-flexgap #optGroups>*+*{margin-left:10px}
html.no-flexgap .rail>*+*{margin-top:6px}
html.no-flexgap .foot-head>*+*{margin-top:7px}
html.no-flexgap .viewprod>*+*{margin-top:4px}
html.no-flexgap .pmgrid>*+*{margin-left:28px}
html.no-flexgap .pmthumbs>*+*{margin-left:8px}
html.no-flexgap .pmsizes>*+*{margin-top:10px}
html.no-flexgap .szlegend>*+*{margin-top:7px}
html.no-flexgap .szrow>*+*{margin-left:12px}
html.no-flexgap .pmswatches>*,html.no-flexgap .pmopts>*,html.no-flexgap .chipbtns>*{margin:0 6px 6px 0}
html.no-flexgap .pl-row .pl-amt{margin-left:12px}
@media (max-width:760px){html.no-flexgap .pmgrid>*+*{margin-left:0;margin-top:16px}}

/* A freshly dropped element glows its Decoration method field briefly. */
#methodField.attn{border-radius:10px;animation:fieldattn 1.25s ease 2}
@keyframes fieldattn{0%,100%{box-shadow:none}42%{box-shadow:0 0 0 3px rgba(109,94,252,.5)}}

/* Touch-only context menu items (the phone adds Edit). */
.ctxmenu .mobonly{display:none}

/* Graphics category chips (admin-defined; hidden when the shop has none). */
.gcats{display:flex;gap:6px;flex-wrap:wrap;margin:2px 0 10px}
.gcats .gcat{cursor:pointer}
.gcats .gcat.on{background:var(--brand1);color:#fff;border-color:var(--brand1)}

/* Share dialog: social intent buttons */
.ssbtn{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none;text-decoration:none}
.ssbtn:hover{filter:brightness(1.08)}
.ssbtn svg{display:block}

/* Launcher columns: My designs beside Community designs when both are shown. */
#launcherCols.lsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
#launcherCols.lsplit .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 980px) { #launcherCols.lsplit { grid-template-columns: 1fr; } }
