/* TG-ST-1117: Studio polish layer (see tg-studio-st.js). Everything is scoped to #tees-studio.tgst (desktop + dd only). */
/* 1. dot-grid workspace: dots sit on the stage's own colour, so the product photo reads as a clean artboard */
#tees-studio.tgdx.tgdd.tgst .ts-stage{background-image:radial-gradient(circle,rgba(20,30,50,.17) 1.1px,transparent 1.5px)!important;background-size:20px 20px!important;background-position:10px 10px!important}

/* 5. logo left, Close in the top-right corner */
#tees-studio.tgst .ts-top .tgst-logo{display:inline-flex;align-items:center;gap:7px;flex:none;margin:0 6px 0 14px;height:100%;color:#16243E;user-select:none;-webkit-user-select:none}
#tees-studio.tgst .ts-top .tgst-logo svg{height:19px;width:auto;fill:#E30613;display:block}
#tees-studio.tgst .ts-top .tgst-logo b{font:800 21px/1 'League Spartan','Poppins',Arial,sans-serif;font-style:normal;letter-spacing:-.2px;transform:skewX(-10deg) translateY(1px);display:block}
#tees-studio.tgdx.tgdd.tgst .ts-top .ts-close{order:99;margin:0 8px 0 10px!important}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdd-adm{margin-right:0}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdd-hdr{margin-left:auto}

/* 2. selection toolbar in the header row */
#tees-studio.tgst .ts-stage > .tgdk-bar{display:none!important} /* one frame before it is moved up */
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar{position:static!important;transform:none!important;top:auto!important;left:auto!important;flex:0 1 auto;min-width:0;max-width:none!important;margin:0 12px!important;padding:2px 5px!important;border-radius:11px!important;box-shadow:none!important;overflow-x:auto;scrollbar-width:none}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar::-webkit-scrollbar{display:none}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib{height:40px!important;min-width:46px;padding:3px 5px!important;flex:none}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sws{flex:none}
#tees-studio.tgdx.tgdd.tgst.has-dx-bar2 .ts-stage{padding-top:92px!important}
@media (max-width:1599px){
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib{min-width:34px}
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib .tgdd-lb{display:none}
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdd-admbadge span{display:none}
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdd-admbadge{padding:0 9px}
}
@media (max-width:1279px){
  #tees-studio.tgst .ts-top .tgst-logo b{display:none}
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar{margin:0 6px!important}
}

/* 3. size chip (bottom, next to the legend) + live label under the item */
#tees-studio.tgst .ts-stage .tgst-size{position:absolute;bottom:16px;left:12px;z-index:6;display:flex;align-items:baseline;gap:8px;height:26px;padding:0 10px;border-radius:8px;background:rgba(255,255,255,.92);border:1px solid #d9dde5;font-size:12px;line-height:24px;color:#16243E;white-space:pre;pointer-events:none}
#tees-studio.tgst .ts-stage .tgst-size small{font-size:10.5px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:#6b7588}
#tees-studio.tgst .ts-stage .tgst-size b{font-weight:700;font-variant-numeric:tabular-nums}
#tees-studio.tgst .ts-stage .tgst-size.is-sel{background:#16243E;border-color:#16243E;color:#fff}
#tees-studio.tgst .ts-stage .tgst-size.is-sel small{color:#b9c3d6}
#tees-studio.tgst .ts-stage .tgst-dim{position:absolute;z-index:9;transform:translateX(-50%);padding:3px 8px;border-radius:6px;background:#E30613;color:#fff;font-size:11.5px;font-weight:700;line-height:16px;white-space:pre;font-variant-numeric:tabular-nums;pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,.2)}
#tees-studio.tgst .ts-stage .tgst-dim[hidden]{display:none}
#tees-studio.tgst.tg-aop .tgst-size{display:none}

/* 4. snapping: magenta smart-guide lines + 1 cm dot grid inside the print area while dragging */
#tees-studio.tgst .ts-board .tgst-ov{position:absolute;pointer-events:none;z-index:5}
#tees-studio.tgst .ts-board .tgst-ov.is-drag{background-image:radial-gradient(circle,rgba(227,6,19,.24) .8px,transparent 1.2px);background-position:0 0}
#tees-studio.tgst .ts-board .tgst-ov i{position:absolute;display:block;background:#ff2bd1}
#tees-studio.tgst .ts-board .tgst-ov i[hidden]{display:none}
#tees-studio.tgst .ts-board .tgst-ov .tgst-gx{top:-14px;bottom:-14px;width:1px;margin-left:-.5px}
#tees-studio.tgst .ts-board .tgst-ov .tgst-gy{left:-14px;right:-14px;height:1px;margin-top:-.5px}
#tees-studio.tgst .tgdk-glob .tgst-snap svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* 2b (1117b). header toolbar in the same tile style as the right-hand Edit panel: white tiles, thin border, navy ink */
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar{background:transparent!important;color:var(--dd-ink)!important;gap:5px!important;padding:0!important;border-radius:0!important;align-items:center!important}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib{height:42px!important;min-width:52px;padding:4px 7px!important;gap:3px!important;border:1px solid var(--dd-line)!important;border-radius:10px!important;background:#fff!important;color:var(--dd-ink)!important;box-sizing:border-box;transition:background .12s,border-color .12s}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib:hover{background:var(--dd-soft)!important;border-color:#c9ccd3!important}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib:active{background:var(--dd-ink)!important;border-color:var(--dd-ink)!important;color:#fff!important}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib.is-dis{opacity:.42;background:var(--dd-soft)!important}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib .tgdd-i{stroke:currentColor}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib .tgdd-lb{font-size:9.5px;font-weight:600;letter-spacing:-.1px}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sep{background:var(--dd-line)!important;height:26px;margin:0 3px}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sws{height:42px;padding:0 8px;gap:5px;border:1px solid var(--dd-line);border-radius:10px;background:#fff;box-sizing:border-box}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sw{width:20px;height:20px;border:1px solid rgba(22,36,62,.28)!important;box-shadow:none}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sw.is-cur{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--dd-ink)!important}
@media (max-width:1599px){
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.tgdd-ib{min-width:40px;height:40px!important}
  #tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sws{height:40px}
}

/* 6 (1117c). selection frame: thin dotted outline, every handle centred exactly on that outline
   (corners: More / Delete / Duplicate / Resize, top-centre: Rotate, left-centre: low-resolution warning). --so = gap between item and frame. */
#tees-studio.tgst .ts-pa .ts-l.is-sel{--so:calc(5px / var(--z));outline:calc(1.2px / var(--z)) dotted var(--ts-sel,#16243E)!important;outline-offset:var(--so)!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel.tgdd-lk{outline-style:dashed!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h{width:calc(26px / var(--z))!important;height:calc(26px / var(--z))!important;padding:0!important;margin:0!important;inset:auto;display:flex!important;align-items:center;justify-content:center}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h svg{width:58%!important;height:58%!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .tgdk-h,
#tees-studio.tgst .ts-pa .ts-l.is-sel .tgdd-h{left:calc(0px - var(--so))!important;top:calc(0px - var(--so))!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h-del{right:calc(0px - var(--so))!important;top:calc(0px - var(--so))!important;left:auto!important;bottom:auto!important;transform:translate(50%,-50%)!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h-sc{right:calc(0px - var(--so))!important;bottom:calc(0px - var(--so))!important;left:auto!important;top:auto!important;transform:translate(50%,50%)!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h-dup{left:calc(0px - var(--so))!important;bottom:calc(0px - var(--so))!important;right:auto!important;top:auto!important;transform:translate(-50%,50%)!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h-rot{left:50%!important;top:calc(0px - var(--so))!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel .ts-h-q{left:calc(0px - var(--so))!important;top:50%!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important}
/* very small items: no room for three handles on the top edge, so Rotate steps up above the frame (still centred) */
#tees-studio.tgst .ts-pa .ts-l.is-sel.tgst-tiny .ts-h-rot{transform:translate(-50%,calc(-50% - 30px / var(--z)))!important}
#tees-studio.tgst .ts-pa .ts-l.is-sel.tgst-tiny .ts-h-q{transform:translate(calc(-50% - 30px / var(--z)),-50%)!important}

/* 7 (1117d). toolbar: tools that do not apply to the selected item are not shown (no dummy buttons) */
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-bb.is-dis,
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sws.is-dis,
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar .tgdk-sep{display:none!important}
/* Eraser opens the image editor with only the eraser tools */
#tees-studio.tgst.tgst-m-er .ts-modal .ts-rbg,
#tees-studio.tgst.tgst-m-er .ts-modal .ts-tol,
#tees-studio.tgst.tgst-m-er .ts-modal .ts-tolrow,
#tees-studio.tgst.tgst-m-er .ts-modal .ts-cropt{display:none!important}

/* 8. safe-area warning: frame turns red + note in the size chip */
#tees-studio.tgst .ts-pa .ts-l.is-sel.tgst-warn{outline:calc(1.6px / var(--z)) dashed #E30613!important}
#tees-studio.tgst .ts-stage .tgst-size em{font-style:normal;font-weight:700;color:#FFD9A8;padding-left:10px;margin-left:2px;border-left:1px solid rgba(255,255,255,.3)}
#tees-studio.tgst .ts-stage .tgst-size em[hidden]{display:none}
#tees-studio.tgst .ts-stage .tgst-size.is-warn{background:#B3261E;border-color:#B3261E}
#tees-studio.tgst .ts-stage .tgst-size.is-warn small{color:#ffd5d0}

/* 9. Sides: print size in cm + inch */
#tees-studio.tgdx.tgdd.tgst .tgdd-views .tgdd-h .tgdd-size{display:none!important}
#tees-studio.tgdx.tgdd.tgst .tgdd-views .tgdd-h .tgst-psize{font-size:11px;color:var(--dd-mute);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}

/* 10. legend fix: the print-area edge is drawn as the thin red line the legend promises (a reset elsewhere had removed it) */
#tees-studio.tgst.tgdk-gd .ts-board .tgdk-guide{outline:calc(1.2px / var(--z,1)) solid rgba(227,6,19,.8)!important;outline-offset:0!important}

/* 11. Preview panel = stage look: transparent garment on the dot grid */
#tees-studio.tgst .tgf-live .tgst-live{display:none}
#tees-studio.tgdx.tgdd.tgst .tgdd-pslot .tgf-live.tgst-pv{background:#d9d9d9 radial-gradient(circle,rgba(20,30,50,.17) 1px,transparent 1.4px) 7px 7px/14px 14px!important}
#tees-studio.tgdx.tgdd.tgst .tgdd-pslot .tgf-live.tgst-pv > img:not(.tgst-live){display:none!important}
#tees-studio.tgdx.tgdd.tgst .tgdd-pslot .tgf-live.tgst-pv > img.tgst-live{display:block!important;width:100%;height:100%;object-fit:contain;background:transparent!important}
#tgf-livebig.tgst-big img{background:#d9d9d9 radial-gradient(circle,rgba(20,30,50,.17) 1.1px,transparent 1.5px) 10px 10px/20px 20px!important}

/* 12. popovers from the header toolbar in the light tile style; Align menu = two columns with icons */
#tees-studio.tgst .tgdk-pop{background:#fff!important;color:#16243E!important;border:1px solid #e7e8ec;border-radius:14px!important;box-shadow:0 10px 32px rgba(22,36,62,.16)!important;padding:10px!important}
#tees-studio.tgst .tgdk-pop .tgdk-opl{color:#16243E}
#tees-studio.tgst .tgdk-pop.tgst-alpop{min-width:250px}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st]{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st] p{grid-column:1/-1;margin:2px 2px 0;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#16243E}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st] p + button ~ p{margin-top:8px}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st] button{display:flex;align-items:center;gap:9px;height:38px;padding:0 12px;border:1px solid #e7e8ec!important;border-radius:10px;background:#fff!important;color:#16243E!important;font:600 12.5px/1 inherit;font-family:inherit;cursor:pointer;text-align:left}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st] button:hover{background:#f5f6f8!important;border-color:#c9ccd3!important}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st] button:active{background:#16243E!important;border-color:#16243E!important;color:#fff!important}
#tees-studio.tgst .tgdk-pop .tgdk-posg[data-st] svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* 13. text tools in the header toolbar (same tile look) */
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tx{display:flex;align-items:center;gap:5px;flex:none}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-font{height:42px;width:132px;padding:0 26px 0 10px;border:1px solid var(--dd-line);border-radius:10px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316243E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center/14px no-repeat;color:var(--dd-ink);font-size:13px;font-weight:600;appearance:none;-webkit-appearance:none;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-font:hover{border-color:#c9ccd3;background-color:var(--dd-soft)}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-font option{font-family:inherit;font-size:14px}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-sz{display:flex;align-items:center;height:42px;border:1px solid var(--dd-line);border-radius:10px;background:#fff;overflow:hidden;box-sizing:border-box}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-sz button{width:30px;height:100%;border:0;background:transparent;color:var(--dd-ink);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-sz button:hover{background:var(--dd-soft)}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-pt{width:44px;height:100%;border:0;border-left:1px solid var(--dd-line);border-right:1px solid var(--dd-line);border-radius:0;background:#fff;color:var(--dd-ink);text-align:center;font:700 13px/1 inherit;font-family:inherit;padding:0;margin:0;-moz-appearance:textfield;appearance:textfield;box-shadow:none;outline:0}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-pt::-webkit-outer-spin-button,#tees-studio.tgst .ts-top .tgdk-bar .tgst-pt::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tb{width:42px;height:42px;border:1px solid var(--dd-line);border-radius:10px;background:#fff;color:var(--dd-ink);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;font-size:17px;line-height:1;box-sizing:border-box}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tb b{font-weight:800}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tb i{font-style:italic;font-weight:600;font-family:Georgia,'Times New Roman',serif}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tb:hover{background:var(--dd-soft);border-color:#c9ccd3}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tb.is-on{background:var(--dd-ink);border-color:var(--dd-ink);color:#fff}
#tees-studio.tgst .ts-top .tgdk-bar .tgst-tx svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:1599px){
  #tees-studio.tgst .ts-top .tgdk-bar .tgst-font{width:104px;height:40px}
  #tees-studio.tgst .ts-top .tgdk-bar .tgst-sz,#tees-studio.tgst .ts-top .tgdk-bar .tgst-tb{height:40px}
  #tees-studio.tgst .ts-top .tgdk-bar .tgst-tb{width:36px}
}

/* 14. the toolbar must shrink (and scroll sideways inside itself) instead of pushing the header wider than the window */
#tees-studio.tgdx.tgdd.tgst .ts-top{min-width:0!important;max-width:100vw!important;box-sizing:border-box}
#tees-studio.tgdx.tgdd.tgst .ts-top .tgdk-bar{flex:0 1 auto!important;min-width:0!important}
#tees-studio.tgdx.tgdd.tgst .ts-top > :not(.tgdk-bar){flex-shrink:0}
/* admin only: while a toolbar is showing, the badge shrinks to its icon to leave room */
#tees-studio.tgdx.tgdd.tgst.tgst-hasbar .ts-top .tgdd-admbadge span{display:none}
#tees-studio.tgdx.tgdd.tgst.tgst-hasbar .ts-top .tgdd-admbadge{padding:0 9px}

/* 15. one home per function: what the header toolbar now does is not repeated in the right-hand Edit panel.
   text  : header = colour, font, size, bold, italic, line alignment, outline, curve, opacity, align, copy
           panel  = Text, Styles, Effects (shadow / gradient / presets), Spacing (letter + line), More
   image : header = replace, remove BG, eraser, outline, crop, flip, opacity, align, copy
           panel  = Filters, Adjust, Corners, Colour, More */
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-tab[data-tab="font"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-tab[data-tab="ink"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-tab[data-tab="ol"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-tab[data-tab="arch"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-tab[data-tab="iol"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-tab[data-tab="lay"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .tgdd-re2,
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-chip[data-tg="b"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-chip[data-tg="it"],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-chip[data-al],
#tees-studio.tgdx.tgdd.tgst .tgdd-edit .ts-sl:has(> input[data-k="size"]){display:none!important}
