/* ===================================================================
   BRANDUM GANG SHEET BUILDER  (v5 — three-pane editor)
   Paste everything between <!--BGS-START--> and <!--BGS-END--> into an
   Elementor HTML widget on the 1m gang sheet product page.
   ► Set your brand colour in --bgs-accent. Set price in CONFIG (JS).
   =================================================================== */
:root{
  --bgs-accent:#1f7a8c; --bgs-accent-dark:#176170; --bgs-accent-ink:#fff;
  --bgs-bg:#fff; --bgs-surface:#e9edf1; --bgs-panel:#fff; --bgs-soft:#f6f7f9;
  --bgs-line:#e4e7ec; --bgs-line2:#d3d8e0;
  --bgs-ink:#15181d; --bgs-ink2:#3b4150; --bgs-mute:#727a89;
  --bgs-good:#1f9d63; --bgs-warn:#c8841a; --bgs-bad:#d8453a;
  --bgs-r:12px; --bgs-r2:9px; --bgs-shadow:0 1px 2px rgba(16,24,40,.06),0 8px 28px rgba(16,24,40,.07);
}
/* the selector was `#bgs-app *`, which skips #bgs-app itself — so its own 1px
   border sat outside a width:100%, pushing 2px of horizontal scroll onto every
   desktop page it was embedded in */
#bgs-app,#bgs-app *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
#bgs-app{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--bgs-ink); background:var(--bgs-bg); border:1px solid var(--bgs-line);
  border-radius:16px; overflow:hidden; max-width:100%; width:100%; margin:0 auto; position:relative; box-shadow:var(--bgs-shadow);
  display:flex; flex-direction:column; height:clamp(560px,86vh,960px);}
#bgs-app button{font:inherit; cursor:pointer; border:1px solid var(--bgs-line2); background:var(--bgs-panel); color:var(--bgs-ink2);
  padding:9px 12px; border-radius:var(--bgs-r2); font-weight:600; font-size:13.5px; line-height:1; display:inline-flex; align-items:center; gap:7px;
  min-height:40px; transition:background .14s,border-color .14s,color .14s,box-shadow .14s,transform .04s}
#bgs-app button:hover{background:var(--bgs-soft)} #bgs-app button:active{transform:translateY(1px)}
#bgs-app button:focus-visible{outline:none; box-shadow:0 0 0 3px color-mix(in srgb,var(--bgs-accent) 35%,transparent)}
#bgs-app button:disabled{opacity:.45; cursor:not-allowed; transform:none}
#bgs-app button.primary{background:var(--bgs-accent); border-color:var(--bgs-accent); color:var(--bgs-accent-ink)}
#bgs-app button.primary:hover{background:var(--bgs-accent-dark); border-color:var(--bgs-accent-dark)}
#bgs-app button.ghost{background:transparent; border-color:transparent; color:var(--bgs-mute)}
#bgs-app button.ghost:hover{background:var(--bgs-soft); color:var(--bgs-ink2)}
#bgs-app button.danger{color:var(--bgs-bad)} #bgs-app button.danger:hover{background:#fdf1f0}
#bgs-app button.icon{padding:9px; min-width:40px; justify-content:center; font-size:16px}
#bgs-app button.toggle.on{background:color-mix(in srgb,var(--bgs-accent) 14%,transparent); border-color:var(--bgs-accent); color:var(--bgs-accent-dark)}
#bgs-app button.block{width:100%; justify-content:center}

/* topbar */
#bgs-app .topbar{display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 14px; border-bottom:1px solid var(--bgs-line); background:var(--bgs-panel)}
#bgs-app .topbar h2{margin:0; font-size:16px; font-weight:800; letter-spacing:-.01em; margin-right:4px}
/* the price + Add to cart block, pinned in the top bar */
#bgs-app .topbuy{display:flex; align-items:center; gap:12px; padding:5px 6px 5px 14px;
  border:1px solid var(--bgs-line2); border-radius:14px; background:var(--bgs-bg);
  box-shadow:inset 0 1px 0 #fff}
#bgs-app .topbuy .tprice{display:flex; flex-direction:column; line-height:1.12; text-align:right}
#bgs-app .topbuy .tp-sub{font-size:11px; color:var(--bgs-mute); white-space:nowrap}
#bgs-app .topbuy .tp-val{font-size:21px; font-weight:800; letter-spacing:-.02em; white-space:nowrap}
#bgs-app .topbuy .buy{min-height:42px; padding:11px 20px; font-size:14.5px; white-space:nowrap}
#bgs-app .topbuy.blocked .tp-val{color:var(--bgs-bad)}
#bgs-app .tp-nudge{font-size:10.5px; font-weight:700; color:var(--bgs-good); white-space:nowrap;
  background:color-mix(in srgb,var(--bgs-good) 12%,transparent); border-radius:999px; padding:1px 7px; margin-top:2px; align-self:flex-end}
#bgs-app .mfoot .mp .n{font-size:11px; font-weight:700; color:var(--bgs-good)}
/* print check */
#bgs-app .card.preflight{max-width:520px}
#bgs-app .pf-list{display:flex; flex-direction:column; gap:7px; margin:12px 0}
#bgs-app .pf-row{display:flex; gap:10px; align-items:flex-start; padding:9px 11px; border-radius:10px; background:var(--bgs-soft); font-size:12.5px; line-height:1.45}
#bgs-app .pf-row .pf-i{flex:0 0 auto; width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; color:#fff; margin-top:1px}
#bgs-app .pf-row.ok .pf-i{background:var(--bgs-good)}
#bgs-app .pf-row.warn{background:#fbf2e3; color:#7a5408} #bgs-app .pf-row.warn .pf-i{background:var(--bgs-warn)}
#bgs-app .pf-row.bad{background:#fdecea; color:#8a2820} #bgs-app .pf-row.bad .pf-i{background:var(--bgs-bad)}
#bgs-app .pf-row b{display:block; font-size:13px; margin-bottom:1px}
#bgs-app .pf-sum{display:flex; justify-content:space-between; align-items:baseline; padding:10px 2px 4px; font-size:13px; color:var(--bgs-ink2)}
#bgs-app .pf-sum .tot{font-size:20px; font-weight:800; color:var(--bgs-ink)}
#bgs-app .pf-skip{display:flex; align-items:center; gap:7px; font-size:12px; color:var(--bgs-mute); margin:4px 0 12px; cursor:pointer}
#bgs-app .pf-row .pf-act{display:inline-flex; margin-top:7px; padding:6px 11px; font-size:12px; min-height:30px; border-color:var(--bgs-warn); color:#7a5408; background:#fff}
#bgs-app .pf-row .pf-act:disabled{opacity:.6}
#bgs-app .pf-row .pf-prog{display:block; margin-top:6px; font-size:12px; color:var(--bgs-mute)}

/* ---- Look closer: the design at print size ---- */
#bgs-app .card.inspector{max-width:640px}
#bgs-app .insp-name{font-weight:500; color:var(--bgs-mute); font-size:13px; margin-left:6px}
#bgs-app .insp-wrap{position:relative; border-radius:12px; overflow:hidden; border:1px solid var(--bgs-line); background:#111418}
#bgs-app #bgs-insp-canvas{display:block; width:100%; height:360px; touch-action:none; cursor:grab}
#bgs-app #bgs-insp-canvas.dragging{cursor:grabbing}
#bgs-app .insp-scale{position:absolute; left:12px; bottom:10px; display:flex; align-items:center; gap:8px; font-size:11px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.7); pointer-events:none}
#bgs-app .insp-scale i{display:block; height:4px; width:76px; background:#fff; border-radius:2px; box-shadow:0 0 0 1px rgba(0,0,0,.5)}
#bgs-app .insp-ctl{display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:12px}
#bgs-app .insp-mag,#bgs-app .insp-cmp{display:flex; align-items:center; gap:6px}
#bgs-app .insp-ctl .lab{font-size:12px; color:var(--bgs-mute); margin-right:2px}
#bgs-app .insp-ctl button{padding:6px 11px; font-size:12.5px; min-height:32px}
#bgs-app .insp-ctl button.on{border-color:var(--bgs-accent); color:var(--bgs-accent-dark); background:color-mix(in srgb,var(--bgs-accent) 10%,#fff)}
#bgs-app .insp-verdict{margin-top:12px; padding:9px 11px; border-radius:10px; font-size:12.5px; line-height:1.45; background:var(--bgs-soft); color:var(--bgs-ink2)}
#bgs-app .insp-verdict.good{background:#e8f6ee; color:#1c6b3a}
#bgs-app .insp-verdict.warn{background:#fbf2e3; color:#7a5408}
#bgs-app .insp-verdict.bad{background:#fdecea; color:#8a2820}
#bgs-app .inspbtn{margin-top:8px; width:100%; justify-content:center}
#bgs-app .modal .card{max-height:100%; overflow:auto}
@media(max-width:600px){
  #bgs-app #bgs-insp-canvas{height:240px}
  #bgs-app .card.inspector{padding:14px}
}
/* a phone on its side: keep the verdict and Close in view without scrolling */
@media(max-height:520px){
  #bgs-app #bgs-insp-canvas{height:130px}
  #bgs-app .card.inspector{padding:12px 14px}
  #bgs-app .card.inspector .csub{display:none}
}
/* the low-res acknowledgement, directly under the bar it now gates */
#bgs-app .ackbar{padding:0 14px 10px; background:var(--bgs-panel); border-bottom:1px solid var(--bgs-line)}
#bgs-app .sheetgrip{display:none}
#bgs-app .tools{display:contents}
#bgs-app .moretools{display:none}
#bgs-app .grp{display:inline-flex; border:1px solid var(--bgs-line2); border-radius:var(--bgs-r2); overflow:hidden}
#bgs-app .grp button{border:none; border-radius:0; border-right:1px solid var(--bgs-line); background:transparent}
#bgs-app .grp button:last-child{border-right:none}
#bgs-app .sep{width:1px; height:24px; background:var(--bgs-line); margin:0 2px}
#bgs-app .spacer{flex:1 1 auto}
#bgs-app .field{display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--bgs-mute)}
#bgs-app .field b{color:var(--bgs-ink2); font-weight:600}
#bgs-app .field input{width:58px; font:inherit; font-size:14px; color:var(--bgs-ink); background:#fff; border:1px solid var(--bgs-line2); border-radius:8px; padding:8px; text-align:right}
#bgs-app .field input:focus-visible{outline:none; border-color:var(--bgs-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--bgs-accent) 22%,transparent)}
#bgs-app input[type=number]::-webkit-outer-spin-button,#bgs-app input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* body grid */
#bgs-app .bgs-body{display:grid; grid-template-columns:76px 288px minmax(0,1fr) 300px; flex:1 1 auto; min-height:0}
#bgs-app .rail{display:flex; flex-direction:column; min-height:0; background:var(--bgs-panel)}
#bgs-app .rail.left{border-right:1px solid var(--bgs-line)}
#bgs-app .rail.right{border-left:1px solid var(--bgs-line)}
#bgs-app .zone{display:flex; flex-direction:column; min-height:0; position:relative}

/* left: upload + designs */
#bgs-app .uploads{padding:14px 14px 12px; border-bottom:1px solid var(--bgs-line)}
#bgs-app .dropzone{border:2px dashed var(--bgs-line2); border-radius:12px; padding:16px 12px; text-align:center; cursor:pointer; transition:border-color .14s,background .14s}
#bgs-app .dropzone:hover{border-color:var(--bgs-accent); background:var(--bgs-soft)}
#bgs-app .dropzone .ico{width:38px;height:38px;margin:0 auto 6px;border-radius:10px;background:color-mix(in srgb,var(--bgs-accent) 12%,transparent);color:var(--bgs-accent);display:flex;align-items:center;justify-content:center;font-size:20px}
#bgs-app .dropzone b{display:block; font-size:14px; color:var(--bgs-ink)}
#bgs-app .dropzone span{display:block; font-size:11.5px; color:var(--bgs-mute); margin-top:3px}
#bgs-app .uploads .addtext{margin-top:10px}
#bgs-app .dlist{flex:1 1 auto; min-height:0; overflow:auto; padding:12px 14px; display:flex; flex-direction:column; gap:9px}
#bgs-app .dlist h4{margin:0 0 1px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--bgs-mute)}
#bgs-app .d-empty{color:var(--bgs-mute); font-size:13px; text-align:center; padding:20px 8px; line-height:1.5}
#bgs-app .d-row{display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid var(--bgs-line); border-radius:12px}
#bgs-app .d-head{display:flex; gap:10px; align-items:center}
#bgs-app .d-rm{flex:0 0 auto; border:none; background:transparent; color:var(--bgs-mute); font-size:17px; line-height:1; padding:2px 4px; min-height:0; min-width:0}
#bgs-app .d-rm:hover{color:var(--bgs-bad); background:transparent}
#bgs-app .d-qtyrow{display:flex; align-items:center; justify-content:space-between; gap:8px}
#bgs-app .d-qtyrow .lbl{font-size:12px; color:var(--bgs-mute); font-weight:600}
#bgs-app .d-row.active{border-color:var(--bgs-accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--bgs-accent) 22%,transparent)}
#bgs-app .d-thumb{flex:0 0 auto; width:44px; height:44px; border-radius:8px; overflow:hidden; cursor:pointer; position:relative; border:1px solid var(--bgs-line);
  background-color:#fff; background-image:linear-gradient(45deg,#eef0f3 25%,transparent 25%),linear-gradient(-45deg,#eef0f3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eef0f3 75%),linear-gradient(-45deg,transparent 75%,#eef0f3 75%);
  background-size:10px 10px; background-position:0 0,0 5px,5px -5px,-5px 0}
#bgs-app .d-thumb img{width:100%; height:100%; object-fit:contain; padding:4px; display:block}
#bgs-app .d-thumb .tdot{position:absolute; top:3px; left:3px; width:8px; height:8px; border-radius:50%; box-shadow:0 0 0 1.5px #fff}
#bgs-app .d-mid{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:3px}
#bgs-app .d-name{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer}
#bgs-app .d-sub{font-size:11.5px; color:var(--bgs-mute)}
#bgs-app .d-sub .pr{color:var(--bgs-good)} #bgs-app .d-sub .pa{color:var(--bgs-warn)} #bgs-app .d-sub .pb{color:var(--bgs-bad)}
#bgs-app .qty{display:inline-flex; align-items:center; border:1px solid var(--bgs-line2); border-radius:8px; overflow:hidden}
#bgs-app .qty button{border:none; border-radius:0; min-height:32px; padding:0 12px; font-size:16px; background:var(--bgs-soft); color:var(--bgs-ink2)}
#bgs-app .qty input{width:46px; border:none; text-align:center; font:inherit; font-size:14px; font-weight:600; color:var(--bgs-ink); background:#fff; padding:6px 0}
#bgs-app .qty input::-webkit-outer-spin-button,#bgs-app .qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* canvas zone */
#bgs-app .swbar{display:flex; align-items:center; gap:9px; flex-wrap:wrap; padding:8px 14px; border-bottom:1px solid var(--bgs-line); background:var(--bgs-panel)}
#bgs-app .swbar .lab{font-size:12px; color:var(--bgs-mute); font-weight:600}
#bgs-app .swatches{display:inline-flex; gap:6px; flex-wrap:wrap}
#bgs-app .swatch{width:24px; height:24px; border-radius:6px; border:1px solid var(--bgs-line2); cursor:pointer; padding:0; min-height:0}
#bgs-app .swatch:hover{transform:none}
#bgs-app .swatch.active{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--bgs-accent)}
#bgs-app .swatch.checker{background-color:#fff; background-image:linear-gradient(45deg,#cfd5dd 25%,transparent 25%),linear-gradient(-45deg,#cfd5dd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#cfd5dd 75%),linear-gradient(-45deg,transparent 75%,#cfd5dd 75%); background-size:10px 10px; background-position:0 0,0 5px,5px -5px,-5px 0}
/* the top padding clears the floating zoom control, which is a real button and
   so cannot be click-through: without the gap it sat on the top-right of the
   film and made designs under it unreachable */
#bgs-app .stage{flex:1 1 auto; min-height:0; overflow:auto; background:var(--bgs-surface); padding:60px 18px 18px; position:relative; touch-action:none}
#bgs-app .stage.drop{box-shadow:inset 0 0 0 3px var(--bgs-accent)}
#bgs-app .stage.panning{cursor:grabbing}
#bgs-app .stage.panmode{cursor:grab}
#bgs-app .filmwrap{margin:0 auto; position:relative}
/* The canvas must claim the touch gesture, otherwise dragging a design also
   scrolls the page and the design barely moves. Panning around the sheet is
   still available through the ✥ pan toggle in the toolbar. */
#bgs-app canvas#bgs-canvas{display:block; background:#fff; border-radius:4px; touch-action:none;
  box-shadow:0 0 0 1px var(--bgs-line2), 0 10px 30px rgba(16,24,40,.12)}
#bgs-app .wm{position:absolute; bottom:7px; left:9px; font-size:11px; font-weight:600; color:var(--bgs-mute); background:rgba(255,255,255,.85); padding:2px 7px; border-radius:6px; pointer-events:none; user-select:none}
#bgs-app .zoombar{position:absolute; top:12px; right:12px; z-index:4; display:inline-flex; align-items:center; gap:0; background:var(--bgs-panel); border:1px solid var(--bgs-line2); border-radius:10px; box-shadow:var(--bgs-shadow); overflow:hidden}
#bgs-app .zoombar button{border:none; border-radius:0; border-right:1px solid var(--bgs-line); min-height:36px; padding:0 11px; font-size:16px; background:transparent}
#bgs-app .zoombar button:last-child{border-right:none}
#bgs-app .zoombar .zpct{font-size:12px; font-weight:700; color:var(--bgs-ink2); padding:0 10px; min-width:50px; text-align:center}
#bgs-app .stage-empty{position:absolute; inset:18px; display:flex; flex-direction:column; cursor:pointer; align-items:center; justify-content:center; gap:8px; text-align:center; padding:24px;
  border:2px dashed var(--bgs-line2); border-radius:14px; background:rgba(255,255,255,.6); color:var(--bgs-mute)}
#bgs-app .stage-empty:hover{border-color:var(--bgs-accent); color:var(--bgs-ink2); background:rgba(255,255,255,.85)}
#bgs-app .stage-empty .eico{width:46px;height:46px;border-radius:12px;background:color-mix(in srgb,var(--bgs-accent) 12%,transparent);color:var(--bgs-accent);display:flex;align-items:center;justify-content:center;font-size:24px}
#bgs-app .stage-empty b{color:var(--bgs-ink); font-size:16px}
#bgs-app .stage-empty span{max-width:320px; font-size:13px}

/* right: properties + price */
#bgs-app .props{flex:1 1 auto; min-height:0; overflow:auto; padding:16px}
#bgs-app .props h4{margin:0 0 12px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--bgs-mute)}
#bgs-app .props .placeholder{color:var(--bgs-mute); font-size:13px; line-height:1.55; text-align:center; padding:30px 6px; border:1px dashed var(--bgs-line2); border-radius:12px}
#bgs-app .props .edit{display:none}
#bgs-app .props.has .edit{display:block}
#bgs-app .props.has .placeholder{display:none}
#bgs-app .pe-head{display:flex; gap:10px; align-items:center; margin-bottom:12px}
#bgs-app .pe-head .d-thumb{width:48px;height:48px}
#bgs-app .pe-name{font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
#bgs-app .chip{font-size:12px; font-weight:700; padding:6px 10px; border-radius:999px; white-space:nowrap; display:inline-flex; align-items:center; gap:6px}
#bgs-app .chip .dot{width:8px;height:8px;border-radius:50%}
#bgs-app .chip.good{background:#e9f7ef; color:var(--bgs-good)} #bgs-app .chip.good .dot{background:var(--bgs-good)}
#bgs-app .chip.warn{background:#fbf2e3; color:var(--bgs-warn)} #bgs-app .chip.warn .dot{background:var(--bgs-warn)}
#bgs-app .chip.bad{background:#fdecea; color:var(--bgs-bad)} #bgs-app .chip.bad .dot{background:var(--bgs-bad)}
#bgs-app .pe-row{display:flex; align-items:center; gap:8px; margin-top:12px; flex-wrap:wrap}
#bgs-app .pe-row .field input{width:70px}
#bgs-app .pe-actions{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px}
#bgs-app .pe-actions button{justify-content:center}
#bgs-app .pe-actions .full{grid-column:1/3}
#bgs-app .pe-section{margin-top:14px; padding-top:12px; border-top:1px solid var(--bgs-line)}
#bgs-app .pe-sec-h{font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--bgs-mute); margin-bottom:8px}
#bgs-app .lookchips{gap:6px}
#bgs-app .lookchips .chip{padding:6px 10px; font-size:12px; min-height:32px}
#bgs-app .lookchips .chip.on{border-color:var(--bgs-accent); color:var(--bgs-accent-dark); background:color-mix(in srgb,var(--bgs-accent) 10%,#fff)}
#bgs-app .sliders{flex-direction:column; align-items:stretch; gap:6px}
#bgs-app .sliders label{display:grid; grid-template-columns:72px 1fr 36px; align-items:center; gap:8px; font-size:12px; color:var(--bgs-ink2)}
#bgs-app .sliders input[type=range]{width:100%; accent-color:var(--bgs-accent); min-height:28px}
#bgs-app .sliders b{text-align:right; font-variant-numeric:tabular-nums; font-size:12px}
#bgs-app .strokerow label{display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--bgs-ink2)}
#bgs-app .strokerow input[type=number]{width:62px; font:inherit; font-size:13px; padding:6px 7px; border:1px solid var(--bgs-line2); border-radius:8px}
#bgs-app .looknote{font-size:11.5px; color:var(--bgs-mute); margin-top:6px; line-height:1.4}
/* garment sizing */
#bgs-app .garm-h{display:flex; align-items:center; justify-content:space-between; gap:8px}
#bgs-app .agebtns{display:inline-flex; border:1px solid var(--bgs-line2); border-radius:999px; overflow:hidden}
#bgs-app .agebtns button{border:none; border-radius:0; min-height:26px; padding:4px 10px; font-size:11px; letter-spacing:0; text-transform:none; background:transparent}
#bgs-app .agebtns button.on{background:var(--bgs-accent); color:var(--bgs-accent-ink)}
#bgs-app .zonechips{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px}
#bgs-app .zonechips button{min-height:32px; padding:6px 11px; font-size:12px; border-radius:999px}
#bgs-app .zonechips button.on{background:color-mix(in srgb,var(--bgs-accent) 14%,transparent); border-color:var(--bgs-accent); color:var(--bgs-accent-dark)}
#bgs-app .zonechips button small{font-weight:500; color:var(--bgs-mute); margin-left:4px}
#bgs-app .mockwrap{border:1px solid var(--bgs-line); border-radius:12px; padding:8px; background:var(--bgs-soft)}
#bgs-app #bgs-mock{display:block; width:100%; height:auto; border-radius:8px}
#bgs-app .mocknote{font-size:11.5px; color:var(--bgs-mute); text-align:center; margin-top:6px; line-height:1.4}
#bgs-app .setrow{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid var(--bgs-line); font-size:14px; color:var(--bgs-ink2); cursor:pointer}
#bgs-app .setrow input{width:20px; height:20px; flex:0 0 auto; accent-color:var(--bgs-accent); cursor:pointer}
#bgs-app .setrow span{display:flex; flex-direction:column; gap:2px}
#bgs-app .setrow em{font-style:normal; font-size:11.5px; color:var(--bgs-mute); line-height:1.35}

/* --- 1.6.0: trim badge, align bar, mode bar --- */
#bgs-app .d-trim{font-size:11px; font-weight:600; color:var(--bgs-good); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
#bgs-app .d-trim.warn{color:var(--bgs-warn)}
#bgs-app .pe-note{font-size:11.5px; line-height:1.45; color:var(--bgs-mute); margin-top:7px; padding:7px 9px; background:var(--bgs-soft); border-radius:8px; display:none}
/* --- 1.7.0: quality meter, snap-to-size, low-res acknowledgement --- */
#bgs-app .qmeter{height:6px; border-radius:99px; background:var(--bgs-line); overflow:hidden; margin-top:2px}
#bgs-app .qmeter span{display:block; height:100%; border-radius:99px; background:var(--bgs-good); transition:width .18s}
#bgs-app .qmeter.warn span{background:var(--bgs-warn)}
#bgs-app .qmeter.bad span{background:var(--bgs-bad)}
#bgs-app .qnote{font-size:11.5px; line-height:1.45; color:var(--bgs-mute); margin-top:6px}
#bgs-app .snapbtn{margin-top:8px; width:100%; justify-content:center; border-color:var(--bgs-accent); color:var(--bgs-accent-dark)}
#bgs-app .upbtn{margin-top:6px; width:100%; justify-content:center}
#bgs-app .upbtn.on{border-color:var(--bgs-good); color:var(--bgs-good)}
#bgs-app .upbtn.rec{border-color:var(--bgs-accent); color:var(--bgs-accent-dark); background:color-mix(in srgb,var(--bgs-accent) 8%,#fff)}
#bgs-app .upnote{margin-top:5px; font-size:11.5px; line-height:1.45; color:var(--bgs-mute)}
#bgs-app .upnote.ok{color:var(--bgs-good)}
#bgs-app .upnote.err{color:var(--bgs-bad)}
#bgs-app .ackrow{display:flex; align-items:flex-start; gap:9px; margin:0 0 10px; padding:10px 11px; border-radius:10px;
  background:#fdecea; border:1px solid #f3c7c2; font-size:12px; line-height:1.45; color:#8a2820; cursor:pointer}
#bgs-app .ackrow input{width:18px; height:18px; flex:0 0 auto; margin-top:1px; accent-color:var(--bgs-bad); cursor:pointer}

#bgs-app .alignbar{display:grid; grid-template-columns:repeat(6,1fr); gap:5px}
#bgs-app .alignbar button{justify-content:center; padding:8px 0; min-height:36px; font-size:15px}
#bgs-app .modebar{display:flex; gap:6px; margin-bottom:10px}
#bgs-app .modebar button{flex:1 1 0; justify-content:center}
#bgs-app .pe-row .field input{width:70px}
#bgs-app #bgs-lock{min-width:38px; padding:9px 8px; font-size:14px}
#bgs-app .sheets{padding:14px; border-bottom:1px solid var(--bgs-line); max-height:200px; overflow:auto; flex:0 0 auto}
#bgs-app .sheets h4{margin:0 0 10px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--bgs-mute)}
#bgs-app .sheet-list{display:flex; flex-direction:column; gap:8px; margin-bottom:10px}
#bgs-app .sheet-row{border:1px solid var(--bgs-line); border-radius:10px; padding:9px; cursor:pointer}
#bgs-app .sheet-row.active{border-color:var(--bgs-accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--bgs-accent) 22%,transparent)}
#bgs-app .sheet-main{min-width:0}
#bgs-app .sheet-name{font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
#bgs-app .sheet-sub{font-size:11.5px; color:var(--bgs-mute); margin-top:1px}
#bgs-app .sheet-foot{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:9px}
#bgs-app .sheet-foot .lbl{font-size:11.5px; color:var(--bgs-mute); font-weight:600}
#bgs-app .sheet-acts{display:flex; gap:4px}
#bgs-app .sheet-acts button{padding:7px 9px; min-height:0; font-size:12px}
#bgs-app .price{border-top:1px solid var(--bgs-line); padding:14px; background:var(--bgs-soft)}
#bgs-app .price .row{display:flex; justify-content:space-between; font-size:13px; color:var(--bgs-ink2); margin-bottom:5px}
#bgs-app .price .row.total{align-items:baseline; margin:8px 0 12px; padding-top:9px; border-top:1px dashed var(--bgs-line2)}
#bgs-app .price .row.total .lbl{font-weight:700; color:var(--bgs-ink); font-size:14px}
#bgs-app .price .row.total .val{font-size:24px; font-weight:800; letter-spacing:-.01em}
#bgs-app .price .util{font-size:11.5px; color:var(--bgs-mute); margin-bottom:8px}
#bgs-app .price .reassure{display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:10px; font-size:11.5px; color:var(--bgs-mute)}
#bgs-app .price .reassure b{color:var(--bgs-good)}
#bgs-app .price .save{margin-top:8px}

/* warnings */
#bgs-app .warns{display:none; flex-direction:column; gap:7px; padding:10px 14px; border-top:1px solid var(--bgs-line); background:var(--bgs-panel)}
#bgs-app .warns.show{display:flex}
#bgs-app .warn-row{display:flex; gap:8px; font-size:12.5px; line-height:1.4; padding:9px 11px; border-radius:10px; background:#fbf2e3; color:#7a5408}
#bgs-app .warn-row.bad{background:#fdecea; color:#8a2820}

#bgs-app .mfoot{display:none}
#bgs-app input[type=file]{display:none}

/* modal */
#bgs-app .modal{position:absolute; inset:0; background:rgba(16,24,40,.45); display:none; align-items:center; justify-content:center; z-index:20; padding:18px}
#bgs-app .modal.show{display:flex}
#bgs-app .card{background:#fff; border:1px solid var(--bgs-line); border-radius:16px; padding:20px; width:100%; max-width:440px; box-shadow:0 24px 70px rgba(16,24,40,.25)}
#bgs-app .card h3{margin:0 0 4px; font-size:17px; font-weight:800}
#bgs-app .card .csub{margin:0 0 14px; font-size:13px; color:var(--bgs-mute)}
#bgs-app .card textarea{width:100%; min-height:88px; font:inherit; font-size:15px; color:var(--bgs-ink); background:#fff; border:1px solid var(--bgs-line2); border-radius:10px; padding:11px; resize:vertical}
#bgs-app .card textarea:focus-visible{outline:none; border-color:var(--bgs-accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--bgs-accent) 22%,transparent)}
#bgs-app .card select{font:inherit; font-size:14px; color:var(--bgs-ink); background:#fff; border:1px solid var(--bgs-line2); border-radius:9px; padding:10px}
#bgs-app .card .row{display:flex; align-items:center; gap:10px; margin-top:12px; flex-wrap:wrap}
#bgs-app .card .row.end{justify-content:flex-end; margin-top:18px}
#bgs-app input[type=color]{width:38px;height:38px;border:1px solid var(--bgs-line2);border-radius:8px;background:#fff;padding:2px;cursor:pointer}
#bgs-app .hint{font-size:12px; color:var(--bgs-mute); margin-top:10px; line-height:1.45}
#bgs-app .busy{position:absolute; inset:0; background:rgba(255,255,255,.7); display:none; align-items:center; justify-content:center; z-index:30; color:var(--bgs-ink); font-weight:700}
#bgs-app .busy.show{display:flex}

@media(min-width:981px) and (max-width:1320px){
  #bgs-app .bgs-body{grid-template-columns:64px 250px minmax(0,1fr) 270px}
  #bgs-app .sheets{max-height:210px}
  #bgs-app .railbtn .rl{font-size:9.5px}
}
@media(max-width:980px){
  #bgs-app{height:auto}
  /* The builder is taller than the screen here, so a dialog centred in the
     builder could sit a whole screen below what the customer is looking at —
     the print check, the welcome, "Look closer", all of them. Pin dialogs
     and the busy overlay to the viewport instead. */
  #bgs-app .modal,#bgs-app .busy{position:fixed; z-index:9990}
  #bgs-app .modal .card{max-height:calc(100vh - 36px); max-height:calc(100dvh - 36px); overflow:auto}
  #bgs-app .bgs-body{display:flex; flex-direction:column; height:auto}
  #bgs-app .rail.left,#bgs-app .rail.right{border:none; border-bottom:1px solid var(--bgs-line)}
  #bgs-app .dlist{flex-direction:row; overflow-x:auto; overflow-y:hidden}
  #bgs-app .dlist h4{display:none}
  #bgs-app .d-row{flex:0 0 auto; width:188px}
  #bgs-app .d-empty{flex:0 0 auto; width:100%}
  #bgs-app .stage{height:48vh}
  #bgs-app .props{max-height:none}
  #bgs-app .price{display:none}
  #bgs-app .rail.right{order:5}
  /* position:sticky pins an element inside its SCROLLING ANCESTOR. On mobile
     #bgs-app is height:auto and the page itself scrolls, so the footer stuck
     to the bottom of the app box — 1154px down a 667px phone, i.e. nowhere.
     The price and Add to cart were off screen until you scrolled the whole
     page to the very end. Fixed to the viewport is the only thing that
     actually pins it; the body gets bottom padding so nothing hides under it. */
  #bgs-app .mfoot{display:flex; position:fixed; left:0; right:0; bottom:0; z-index:60;
    align-items:center; gap:12px; padding:11px 14px;
    padding-bottom:calc(11px + env(safe-area-inset-bottom,0px));
    background:var(--bgs-panel); border-top:1px solid var(--bgs-line);
    box-shadow:0 -6px 18px rgba(16,24,40,.10)}
  body.bgs-hasfoot{padding-bottom:96px}
  #bgs-app .mfoot .mp{display:flex; flex-direction:column; line-height:1.15}
  #bgs-app .mfoot .mp .l{font-size:11px; color:var(--bgs-mute)}
  #bgs-app .mfoot .mp .v{font-size:19px; font-weight:800}
  #bgs-app .mfoot .spacer{flex:1}
  #bgs-app .mfoot .primary{min-height:46px; padding:12px 18px; font-size:15px}

  /* --- 1.10.0 mobile pass --- */
  /* iOS zooms the whole page when a field under 16px takes focus, and never
     zooms back out. Every input has to be at least 16px on touch layouts. */
  #bgs-app input,#bgs-app select,#bgs-app textarea{font-size:16px}
  #bgs-app .field input{width:76px; padding:10px 8px; font-size:16px}
  #bgs-app .qty input{width:56px; font-size:16px}
  #bgs-app .card select,#bgs-app .card textarea{font-size:16px}
  #bgs-app .topbar .field input{width:76px}

  /* thumb-sized tap targets */
  #bgs-app .qty button{min-height:42px; padding:0 16px; font-size:19px}
  #bgs-app .d-rm{min-width:40px; min-height:40px; font-size:22px; padding:0}
  #bgs-app .swatch{width:36px; height:36px; border-radius:8px}
  #bgs-app .sheet-acts button{min-height:40px; padding:9px 13px; font-size:13px}
  #bgs-app .alignbar button{min-height:44px; font-size:17px}
  #bgs-app .zoombar button{min-height:44px; padding:0 15px}
  #bgs-app button.icon{min-width:44px; min-height:44px}
  #bgs-app .d-row{width:212px}
  #bgs-app .d-trim{white-space:normal}   /* let the trim/quality badge wrap rather than clip */

  /* the low-res acknowledgement rides in the sticky footer on mobile,
     because the price panel it normally lives in is hidden here */
  #bgs-app .mfoot{flex-wrap:wrap}
  #bgs-app .mfoot .ackrow{flex:1 0 100%; margin:0 0 9px}
  #bgs-app .mfoot .ackbar{flex:1 0 100%; padding:0 0 9px; background:transparent; border:none}

  /* On a phone the sticky footer already carries the price and the button,
     so the top-bar copy would be a second one competing for the same job.
     Keep the bar for tools only and let the footer do the selling. */
  #bgs-app .topbuy{display:none}

  /* --- the phone toolbar ---
     The full desktop bar (undo, redo, pan, grid, spacing, cutting, clear)
     wrapped onto four rows and ate 380 px of a 667 px screen, so the sheet
     the customer came to look at started below the fold. Those tools now sit
     behind one "…" button; the bar keeps only the title and Auto-arrange. */
  #bgs-app .topbar{gap:6px; padding:8px 10px; flex-wrap:nowrap; overflow:hidden}
  #bgs-app .topbar h2{font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0}
  #bgs-app .topbar .sheetinfo{display:none}
  #bgs-app .topbar .sep{display:none}
  #bgs-app .topbar .selcount{display:none}
  #bgs-app .moretools{display:inline-flex; flex:0 0 auto}
  #bgs-app .tools{display:none}
  #bgs-app .tools.open{display:flex; order:99; flex:1 0 100%; flex-wrap:wrap; gap:7px;
    margin-top:8px; padding-top:9px; border-top:1px solid var(--bgs-line)}
  #bgs-app .topbar.expanded{flex-wrap:wrap; overflow:visible}
  #bgs-app #bgs-arrange{flex:0 0 auto; padding:10px 13px; font-size:13px}

  /* the sheet comes first. Tools sit under it, where they belong on a phone. */
  #bgs-app .zone{order:1}
  #bgs-app .iconrail{order:2}
  #bgs-app .panelcol{order:3}
  #bgs-app .rail.right{order:4}
  /* the zoom control floats over the stage, so the film needs headroom or it
     sits underneath the buttons and you cannot see the top of your own sheet */
  #bgs-app .stage{height:52vh; min-height:280px; padding:64px 12px 14px}
}
/* Tablets: the rail collapses but there is still plenty of width, so the
   top-bar price stays — it is the widest layout that has no sticky footer. */
@media(min-width:981px) and (max-width:1180px){
  #bgs-app .topbuy{gap:9px; padding-left:11px}
  #bgs-app .topbuy .tp-val{font-size:18px}
  #bgs-app .topbar h2{font-size:14.5px}
  #bgs-app .topbar .sheetinfo{display:none}
}
@media (prefers-reduced-motion:reduce){ #bgs-app *{transition:none!important} }
/* ---- launch button + modal (plugin wrapper) ---- */
.brandum-gs-open{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#1f7a8c;color:#fff;border:none;border-radius:10px;padding:15px 26px;font-size:16px;font-weight:700;cursor:pointer;width:100%;max-width:440px}
.brandum-gs-open:hover{background:#176170}
/* Above everything the theme can throw at it: a sticky-header search field
   on brandum.com sat at z-index 999999 and floated over the builder. */
.brandum-gs-modal{position:fixed;inset:0;background:#fff;z-index:2147483001;display:none}
.brandum-gs-modal.open{display:block}
.brandum-gs-inner{position:relative;width:100%;height:100vh;height:100dvh;max-width:none;max-height:none;overflow:auto;background:#fff;border-radius:0;box-shadow:none}
/* the theme's global button colour made the × white on white — every
   property that could leak in from a theme is set here */
.brandum-gs-x{position:absolute;top:10px;right:12px;z-index:40;background:#fff;color:#1b2430;border:1px solid #d3d8e0;border-radius:50%;width:36px;height:36px;min-height:36px;padding:0;margin:0;font:400 22px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:34px;text-align:center;cursor:pointer;box-sizing:border-box;box-shadow:none;text-shadow:none}
.brandum-gs-x:hover{background:#f3f4f6;color:#000}
.brandum-gs-inner #bgs-app{max-width:none;border:0;border-radius:0;box-shadow:none}
.brandum-gs-inner #bgs-app .topbar{padding-right:56px}
@media(min-width:981px){
  .brandum-gs-inner{overflow:hidden}
  .brandum-gs-inner #bgs-app{height:100vh;height:100dvh}
}

/* --- 1.12: sheet-fit advisor --- */
#bgs-app .fitpanel{display:none; margin:0 0 12px; padding:12px; border-radius:12px;
  background:#fff6ed; border:1px solid #f0d2b0}
#bgs-app .fitpanel.show{display:block}
#bgs-app .fitpanel .fit-h{font-size:13px; font-weight:800; color:#8a4b12; margin-bottom:5px}
#bgs-app .fitpanel .fit-b{font-size:12px; line-height:1.5; color:#7a5433}
#bgs-app .fitpanel .fit-b b{color:#5d3c22}
#bgs-app .fitpanel .fit-acts{display:flex; flex-direction:column; gap:6px; margin-top:10px}
#bgs-app .fitpanel .fit-acts button{justify-content:flex-start; font-size:12.5px; text-align:left}
#bgs-app .fitpanel .fit-acts button.rec{border-color:var(--bgs-accent); color:var(--bgs-accent-dark); font-weight:700}
#bgs-app .fitpanel .fit-acts button[hidden]{display:none}


/* ===================================================================
   1.14 — icon rail, contextual panels, quality key, start screen
   =================================================================== */
#bgs-app .iconrail{display:flex; flex-direction:column; align-items:stretch; gap:4px;
  padding:10px 6px; background:var(--bgs-soft); border-right:1px solid var(--bgs-line)}
#bgs-app .railbtn{position:relative; flex-direction:column; gap:4px; padding:9px 4px; min-height:58px;
  border:1px solid transparent; background:transparent; color:var(--bgs-mute); border-radius:10px; width:100%}
#bgs-app .railbtn:hover{background:#fff; color:var(--bgs-ink2)}
#bgs-app .railbtn.on{background:#fff; border-color:var(--bgs-line2); color:var(--bgs-accent-dark);
  box-shadow:0 1px 2px rgba(16,24,40,.06)}
#bgs-app .railbtn .ri{font-size:19px; line-height:1; font-weight:700}
#bgs-app .railbtn .rl{font-size:10.5px; font-weight:700; letter-spacing:.02em}
#bgs-app .railbtn .rbadge{position:absolute; top:5px; right:8px; min-width:17px; height:17px; padding:0 4px;
  border-radius:9px; background:var(--bgs-accent); color:#fff; font-size:10px; font-weight:800;
  display:flex; align-items:center; justify-content:center}
#bgs-app .railspace{flex:1 1 auto}

#bgs-app .panelcol{display:flex; flex-direction:column; min-height:0; background:var(--bgs-panel);
  border-right:1px solid var(--bgs-line)}
#bgs-app .panel{display:none; flex-direction:column; min-height:0; flex:1 1 auto}
#bgs-app .panel.on{display:flex}
#bgs-app .panel .sheets{max-height:none; border-bottom:none; overflow:auto}

#bgs-app .helpwrap{padding:16px; overflow:auto; font-size:13px; color:var(--bgs-ink2); line-height:1.55}
#bgs-app .helpwrap h4{margin:0 0 8px; font-size:11px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--bgs-mute)}
#bgs-app .helpsteps{margin:0; padding-left:18px} #bgs-app .helpsteps li{margin-bottom:7px}
#bgs-app .helptips{margin:0; padding-left:18px; color:var(--bgs-mute)} #bgs-app .helptips li{margin-bottom:6px}
#bgs-app .legendlist{display:flex; flex-direction:column; gap:6px; font-size:12.5px}
#bgs-app .legendlist span{display:flex; align-items:center; gap:8px}
#bgs-app .lg{width:12px; height:12px; border-radius:3px; flex:0 0 auto; display:inline-block}
#bgs-app .lg.good{background:var(--bgs-good)} #bgs-app .lg.warn{background:var(--bgs-warn)}
#bgs-app .lg.bad{background:var(--bgs-bad)}  #bgs-app .lg.over{background:#3b6fd8}

#bgs-app .sheetinfo{font-size:12.5px; color:var(--bgs-mute)}
#bgs-app .selcount{font-size:12.5px; font-weight:700; color:var(--bgs-accent-dark);
  background:color-mix(in srgb,var(--bgs-accent) 12%,transparent); padding:6px 10px; border-radius:999px; display:none}
#bgs-app .selcount.show{display:inline-flex}
#bgs-app .tinybtn{min-height:32px; padding:6px 10px; font-size:12px}

/* pointer-events:none matters more than it looks. The key floats over the
   top-left of the film, and without it every click in that corner landed on
   the key instead of the canvas — so any design sitting there could not be
   selected, moved or deleted at all. It is a label; it should never take a
   click. */
#bgs-app .legend{position:absolute; bottom:12px; left:12px; z-index:4; display:flex; flex-wrap:wrap; gap:4px 12px;
  pointer-events:none;
  background:rgba(255,255,255,.93); border:1px solid var(--bgs-line2); border-radius:10px;
  padding:8px 11px; font-size:11.5px; color:var(--bgs-ink2); box-shadow:var(--bgs-shadow); max-width:260px}
#bgs-app .legend span{display:flex; align-items:center; gap:6px}
#bgs-app .legend.off{display:none}

#bgs-app .keylist{display:grid; grid-template-columns:auto 1fr; gap:6px 11px; margin:0; font-size:12px}
#bgs-app .keylist dt{font-weight:700; color:var(--bgs-ink2); white-space:nowrap;
  background:var(--bgs-soft); border:1px solid var(--bgs-line2); border-radius:6px; padding:2px 7px; font-size:11px}
#bgs-app .keylist dd{margin:0; color:var(--bgs-mute); line-height:1.5; align-self:center}

/* right-click / long-press menu */
#bgs-app .ctxmenu{position:fixed; z-index:200; display:none; min-width:212px; padding:5px;
  background:var(--bgs-panel); border:1px solid var(--bgs-line2); border-radius:12px;
  box-shadow:0 12px 34px rgba(16,24,40,.20)}
#bgs-app .ctxmenu.show{display:block}
#bgs-app .ctxmenu button{width:100%; justify-content:space-between; border:none; background:transparent;
  padding:9px 11px; min-height:38px; font-size:13px; border-radius:8px; text-align:left}
#bgs-app .ctxmenu button:hover:not(:disabled){background:var(--bgs-soft)}
#bgs-app .ctxmenu button span{font-size:11px; color:var(--bgs-mute); font-weight:600}
#bgs-app .ctxmenu button:disabled{opacity:.4}
#bgs-app .ctxsep{height:1px; margin:4px 6px; background:var(--bgs-line)}
/* the undo button that rides in a notice row */
#bgs-app .undobtn{margin-left:auto; flex:0 0 auto; min-height:30px; padding:5px 11px; font-size:12px;
  border-color:currentColor; background:transparent; color:inherit; font-weight:700}
#bgs-app .undobtn:hover{background:rgba(255,255,255,.55)}
/* on a narrow phone the action drops under the text instead of squeezing
   the sentence into a three-word column beside it */
@media(max-width:480px){
  #bgs-app .warn-row{flex-wrap:wrap}
  #bgs-app .warn-row .undobtn{margin-left:28px; width:auto}
}
/* alignment guides drawn while dragging */
#bgs-app .guide{position:absolute; z-index:5; pointer-events:none; background:var(--bgs-accent); opacity:.85}
#bgs-app .guide.v{width:1px} #bgs-app .guide.h{height:1px}

#bgs-app .startbtn{width:100%; flex-direction:column; align-items:flex-start; gap:3px; text-align:left;
  padding:14px 16px; margin-bottom:9px; border-radius:12px; min-height:0}
#bgs-app .startbtn b{font-size:14.5px; color:var(--bgs-ink)}
#bgs-app .startbtn span{font-size:12.5px; color:var(--bgs-mute); font-weight:500; line-height:1.45}
#bgs-app .startbtn:hover{border-color:var(--bgs-accent); background:var(--bgs-soft)}

#bgs-app .pm-result{margin-top:12px; font-size:13px; line-height:1.55; color:var(--bgs-ink2)}
#bgs-app .pm-result .pm-ok{padding:11px 13px; border-radius:10px; background:#e9f7ef; border:1px solid #bfe6cf; color:#14603c}
#bgs-app .pm-result .pm-bad{padding:11px 13px; border-radius:10px; background:#fdecea; border:1px solid #f3c7c2; color:#8a2820}
#bgs-app .pm-result .pm-info{padding:11px 13px; border-radius:10px; background:var(--bgs-soft); border:1px solid var(--bgs-line)}
#bgs-app .pm-result b{color:inherit}
#bgs-app #bgs-pm-file{display:none}
#bgs-app .marquee{position:absolute; border:1.5px dashed var(--bgs-accent);
  background:color-mix(in srgb,var(--bgs-accent) 10%,transparent); pointer-events:none; z-index:5; border-radius:3px}

@media(max-width:980px){
  /* the rail becomes a horizontal tab strip above the panel */
  #bgs-app .bgs-body{display:flex; flex-direction:column}
  /* `flex:1 0 auto` inside an overflow-x:auto strip let every tab GROW to the
     full container width and never shrink — each rail button came out 812 px
     wide, so exactly one tab was ever on screen and the other four sat off to
     the right with nothing to suggest they existed. This is what "hard to
     navigate, can't find stuff" actually was. They now share the row. */
  #bgs-app .iconrail{flex-direction:row; gap:5px; padding:8px 10px; overflow-x:visible;
    border-right:none; border-bottom:1px solid var(--bgs-line)}
  #bgs-app .railbtn{flex:1 1 0; min-width:0; min-height:54px; padding:7px 4px}
  #bgs-app .railbtn .rl{font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%}
  #bgs-app .railbtn .ri{font-size:15px}
  #bgs-app .railspace{display:none}
  #bgs-app .panelcol{border-right:none; border-bottom:1px solid var(--bgs-line)}
  #bgs-app .panel.on{max-height:44vh; overflow:auto}
  /* the quality key used to sit top-left, directly on top of the zoom
     controls on a narrow screen — you could not zoom without dismissing it.
     Down at the bottom of the stage it explains the colours without covering
     anything you need to press. */
  #bgs-app .legend{max-width:none; left:10px; right:10px; top:auto; bottom:10px; font-size:11px}

  /* one scrolling row of garment colours, not three wrapped rows: the swatch
     bar was taking 300 px off the top of a 667 px phone */
  #bgs-app .swbar{flex-wrap:nowrap; gap:8px; padding:7px 10px; overflow-x:auto; -webkit-overflow-scrolling:touch}
  #bgs-app .swbar .lab{display:none}
  #bgs-app .swatches{flex-wrap:nowrap}
  #bgs-app .swbar .spacer{display:none}
  #bgs-app .swbar .tinybtn{flex:0 0 auto; margin-left:4px}
  /* thumbs, not mouse pointers — nothing on a phone gets under 38px */
  #bgs-app .tinybtn{min-height:38px; padding:8px 12px}
}

/* ---------------------------------------------------------------
   TOUCH SIZING, independent of width.

   An iPad Pro in landscape is 1194 px wide — past every mobile breakpoint —
   so it was getting desktop-sized controls: 32px buttons and 14px inputs,
   driven by a finger. Width tells you how much room there is; it does not
   tell you what is doing the pointing. `pointer:coarse` does, and it catches
   every tablet, touchscreen laptop and phone regardless of how wide it is.
   --------------------------------------------------------------- */
@media (pointer:coarse){
  #bgs-app input,#bgs-app select,#bgs-app textarea{font-size:16px}
  /* .field input and .pe-row .field input are more specific than a bare
     `#bgs-app input`, so the 16px floor has to be restated at their weight or
     iOS still zooms the page on focus and never zooms back */
  #bgs-app .field input,#bgs-app .qty input,#bgs-app .card textarea,#bgs-app .card select,
  #bgs-app .pe-row .field input{font-size:16px; padding:10px 8px}
  #bgs-app button{min-height:40px}
  #bgs-app button.icon{min-width:44px; min-height:44px}
  #bgs-app .tinybtn{min-height:40px}
  #bgs-app .insp-ctl button,#bgs-app .pf-row .pf-act,#bgs-app .undobtn{min-height:40px; padding:8px 14px}
  #bgs-app .lookchips .chip,#bgs-app .lookchips button{min-height:40px}
  #bgs-app .sliders input[type=range]{min-height:40px}
  #bgs-app .strokerow input[type=number]{min-height:40px; font-size:16px}
  /* six align buttons in a 1fr grid came out 35 px wide in the iPad
     landscape rail — let them wrap to two rows of three instead */
  #bgs-app .alignbar{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))}
  #bgs-app .qty button{min-height:42px; padding:0 16px; font-size:19px}
  #bgs-app .qty input{font-size:16px}
  #bgs-app .d-rm{min-width:40px; min-height:40px; font-size:22px; padding:0}
  #bgs-app .swatch{width:36px; height:36px; border-radius:8px}
  #bgs-app .alignbar button{min-height:44px; font-size:17px}
  #bgs-app .zoombar button{min-height:44px; padding:0 15px}
  #bgs-app .sheet-acts button{min-height:40px; padding:9px 13px}
  #bgs-app .railbtn{min-height:56px}
  #bgs-app .zonechips button{min-height:40px; padding:8px 13px}
  #bgs-app .agebtns button{min-height:38px; padding:6px 13px; font-size:12.5px}
  #bgs-app .ctxmenu button{min-height:44px}
  #bgs-app input[type=checkbox]{width:22px; height:22px}
  /* a finger needs a bigger grab area on the resize handle than a mouse does */
  #bgs-app .stage{touch-action:none}
}
/* tablet portrait: three columns is too many for 834px, so the properties
   rail drops under the canvas rather than squeezing everything */
@media (min-width:981px) and (max-width:1100px){
  #bgs-app .bgs-body{grid-template-columns:60px 228px minmax(0,1fr) 252px}
}

/* ---------------------------------------------------------------
   TABLET PORTRAIT (roughly 700–980 px)

   Wide enough that stacking everything in one column wastes half the
   screen, but not wide enough for the four-column desktop layout. Two
   columns: tools and designs on the left, the sheet on the right, at full
   height. An iPad in portrait was previously getting the phone layout and
   scrolling like one.
   --------------------------------------------------------------- */
@media (min-width:700px) and (max-width:980px){
  #bgs-app{height:clamp(620px,88vh,1100px)}
  #bgs-app .bgs-body{display:grid; grid-template-columns:78px 268px minmax(0,1fr);
    grid-template-rows:minmax(0,1fr); height:auto; min-height:0}
  #bgs-app .iconrail{flex-direction:column; gap:6px; padding:10px 8px; order:0;
    border-right:1px solid var(--bgs-line); border-bottom:none}
  #bgs-app .railbtn{flex:0 0 auto; min-height:58px}
  #bgs-app .railspace{display:block; flex:1 1 auto}
  #bgs-app .panelcol{order:0; border-right:1px solid var(--bgs-line); border-bottom:none; min-height:0}
  #bgs-app .panel.on{max-height:none; height:100%}
  #bgs-app .zone{order:0; min-height:0}
  #bgs-app .stage{height:auto; flex:1 1 auto; padding:60px 14px 14px}
  #bgs-app .dlist{flex-direction:column; overflow-y:auto; overflow-x:hidden}
  #bgs-app .dlist h4{display:block}
  #bgs-app .d-row{width:auto}
  /* the properties panel becomes a sheet that slides up over the canvas when
     a design is selected, rather than a fourth column there is no room for */
  #bgs-app .rail.right{position:absolute; left:0; right:0; bottom:0; z-index:20;
    max-height:50%; overflow:auto; border-top:1px solid var(--bgs-line2);
    box-shadow:0 -10px 28px rgba(16,24,40,.14); border-left:none;
    border-radius:16px 16px 0 0;
    transform:translateY(101%); transition:transform .2s ease; background:var(--bgs-panel)}
  #bgs-app .rail.right.open{transform:translateY(0)}
  #bgs-app .price{display:none}
  /* the grip is the whole width and a thumb has to be able to hit it, so the
     target is 40px tall even though the visible bar is 5px */
  #bgs-app .sheetgrip{display:flex; position:sticky; top:0; z-index:2; width:100%;
    justify-content:center; align-items:center; min-height:40px; padding:12px 0 10px;
    border:none; background:var(--bgs-panel); border-radius:16px 16px 0 0}
  #bgs-app .sheetgrip span{display:block; width:44px; height:5px; border-radius:3px; background:var(--bgs-line2)}
  #bgs-app .sheetgrip:hover span{background:var(--bgs-mute)}
}

/* ---- My designs library ---- */
#bgs-app .lib-h{display:flex; align-items:baseline; justify-content:space-between; padding:0 2px}
#bgs-app .lib-h h4{margin:0; font-size:13px; font-weight:800}
#bgs-app .lib-count{font-size:11.5px; color:var(--bgs-mute)}
#bgs-app .lib-note,#bgs-app .lib-empty{font-size:12px; color:var(--bgs-mute); line-height:1.45; margin:6px 2px 10px}
#bgs-app .lib-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:8px}
#bgs-app .lib-item{position:relative; border:1px solid var(--bgs-line); border-radius:10px; background:#fff; padding:6px; cursor:pointer; text-align:left; display:flex; flex-direction:column; gap:4px; min-height:44px}
#bgs-app .lib-item:hover{border-color:var(--bgs-accent); box-shadow:0 2px 10px rgba(16,24,40,.08)}
#bgs-app .lib-item .lt{width:100%; aspect-ratio:1; border-radius:6px; background:
  repeating-conic-gradient(#e6e8ec 0 25%, #f7f8fa 0 50%) 0 0/12px 12px; display:flex; align-items:center; justify-content:center; overflow:hidden}
#bgs-app .lib-item .lt img{max-width:100%; max-height:100%; object-fit:contain}
#bgs-app .lib-item .ln{font-size:11px; font-weight:600; color:var(--bgs-ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
#bgs-app .lib-item .ls{font-size:10.5px; color:var(--bgs-mute)}
#bgs-app .lib-item .lx{position:absolute; top:4px; right:4px; width:24px; height:24px; min-height:24px; padding:0; border-radius:50%; background:rgba(255,255,255,.92); border:1px solid var(--bgs-line); color:var(--bgs-mute); font-size:14px; line-height:1; display:none; align-items:center; justify-content:center}
#bgs-app .lib-item:hover .lx,#bgs-app .lib-item:focus-within .lx{display:inline-flex}
@media (pointer:coarse){ #bgs-app .lib-item .lx{display:inline-flex; width:32px; height:32px; min-height:32px} }

/* ---- Copies of this sheet: always in view next to the price ---- */
#bgs-app .copies{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; margin-bottom:10px; border:1px solid var(--bgs-line2); border-radius:12px; background:#fff}
#bgs-app .copies .cl{display:flex; flex-direction:column; gap:2px; min-width:0}
#bgs-app .copies .cl b{font-size:13px; color:var(--bgs-ink)}
#bgs-app .copies .cl small{font-size:11px; color:var(--bgs-mute); line-height:1.3}
#bgs-app .copies.on{border-color:var(--bgs-accent); background:color-mix(in srgb,var(--bgs-accent) 7%,#fff)}
#bgs-app .copies.on .cl small{color:var(--bgs-accent-dark); font-weight:600}
#bgs-app .mfoot .mcopies{display:inline-flex; align-items:center; gap:4px; margin:0 8px; font-size:12px; color:var(--bgs-ink2)}
#bgs-app .mfoot .mcopies span{margin-right:2px}
#bgs-app .mfoot .mcopies button{min-height:36px; min-width:36px; padding:0; border-radius:8px; font-size:17px}
#bgs-app .mfoot .mcopies b{min-width:18px; text-align:center; font-size:14px}

/* ---- the four steps, always in view above the designs ---- */
#bgs-app .steps{display:flex; gap:0; margin:0 0 12px; padding:0; list-style:none; counter-reset:none}
#bgs-app .steps li{flex:1 1 0; display:flex; flex-direction:column; align-items:center; gap:4px; font-size:10.5px; color:var(--bgs-mute); text-align:center; position:relative; padding:0 2px}
#bgs-app .steps li i{font-style:normal; width:22px; height:22px; border-radius:50%; border:1.5px solid var(--bgs-line2); background:#fff; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; color:var(--bgs-mute); position:relative; z-index:1}
#bgs-app .steps li+li::before{content:""; position:absolute; left:-50%; right:50%; top:11px; height:1.5px; background:var(--bgs-line2)}
#bgs-app .steps li.done i{background:var(--bgs-good); border-color:var(--bgs-good); color:#fff}
#bgs-app .steps li.done+li::before{background:var(--bgs-good)}
#bgs-app .steps li.on i{background:var(--bgs-accent); border-color:var(--bgs-accent); color:var(--bgs-accent-ink); box-shadow:0 0 0 4px color-mix(in srgb,var(--bgs-accent) 18%,transparent)}
#bgs-app .steps li.on{color:var(--bgs-ink); font-weight:700}

/* ---- welcome: how it works ---- */
#bgs-app .howto{margin:0 0 14px; padding:0 0 0 20px; font-size:12.5px; color:var(--bgs-ink2); line-height:1.5}
#bgs-app .howto li{margin-bottom:4px}
#bgs-app .howto b{color:var(--bgs-ink)}
#bgs-app .tourbtn{font-size:12.5px; padding:8px 12px}
#bgs-app .faq{margin:0; font-size:12.5px; line-height:1.45}
#bgs-app .faq dt{font-weight:700; color:var(--bgs-ink); margin-top:8px}
#bgs-app .faq dd{margin:2px 0 0; color:var(--bgs-ink2)}

/* ---- guided tour ---- */
#bgs-app .tour{display:none; position:absolute; inset:0; z-index:9000}
#bgs-app .tour.show{display:block}
#bgs-app .tour-dim{position:absolute; inset:0}
#bgs-app .tour-spot{position:absolute; border-radius:12px; box-shadow:0 0 0 9999px rgba(16,24,40,.55), 0 0 0 3px var(--bgs-accent); pointer-events:none; transition:all .25s ease}
#bgs-app .tour-card{position:absolute; width:300px; max-width:calc(100vw - 32px); background:#fff; border-radius:14px; padding:14px 16px; box-shadow:0 20px 60px rgba(16,24,40,.35); transition:all .25s ease}
#bgs-app .tour-step{font-size:11px; color:var(--bgs-mute); font-weight:700; letter-spacing:.04em; text-transform:uppercase}
#bgs-app .tour-card h4{margin:4px 0 4px; font-size:15px; font-weight:800}
#bgs-app .tour-card p{margin:0 0 12px; font-size:13px; line-height:1.45; color:var(--bgs-ink2)}
#bgs-app .tour-btns{display:flex; justify-content:flex-end; gap:8px}
@media(max-width:980px){
  #bgs-app .tour,#bgs-app .tour-dim{position:fixed}
  #bgs-app .tour-spot,#bgs-app .tour-card{position:fixed}
  #bgs-app .steps li span{font-size:10px}
}
@media(max-width:480px){
  /* no room for a label beside the stepper, so a caption above it: an
     unlabelled "− 2 +" in a price bar reads as a mystery number */
  /* the acknowledgement bar takes a full row of its own; the price, the
     copies stepper and the button share the next one */
  #bgs-app .mfoot{flex-wrap:wrap; gap:6px}
  #bgs-app .mfoot .ackbar{flex:0 0 100%}
  #bgs-app .mfoot .mp{flex:0 1 auto; min-width:0}
  #bgs-app .mfoot .mp .n{display:none !important}     /* the tier nudge needs the room on a small phone */
  #bgs-app .mfoot .mp .v{font-size:18px}
  #bgs-app .mfoot .mcopies{display:grid; grid-template-columns:36px 26px 36px; grid-template-rows:auto 36px; gap:0; margin:0 4px; align-items:center; justify-items:center; flex:0 0 auto}
  #bgs-app .mfoot .mcopies span{grid-column:1 / span 3; font-size:9.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--bgs-mute); text-align:center; margin:0}
  #bgs-app .mfoot .mcopies button{min-height:36px; min-width:36px; width:36px; font-size:15px; padding:0}
  #bgs-app .mfoot .spacer{display:none}
  #bgs-app .mfoot .primary{min-height:44px; padding:10px 14px; font-size:14px; flex:1 1 auto}
}
