.tlm-customizer{clear:both;margin:1.5rem 0;padding:1.3rem;border:1px solid #d6dadd;border-radius:12px;max-width:720px}
.tlm-customizer h4{margin:1.5rem 0 .7rem}.tlm-customizer input[type=search],.tlm-customizer input[type=text]{width:100%;max-width:100%;padding:10px;border:1px solid #aaa;border-radius:5px}.tlm-color-list{max-height:310px;overflow:auto;border:1px solid #ddd;border-radius:6px}.tlm-color-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 10px;border-bottom:1px solid #eee}.tlm-color-row[hidden],.tlm-upload[hidden],.tlm-onfile[hidden]{display:none!important}.tlm-color-name{display:flex;align-items:center;gap:7px;flex:1;margin:0}.tlm-qty-label{white-space:nowrap}.tlm-qty-label input{width:75px!important;margin-left:4px;padding:5px}.tlm-choice{display:flex;flex-wrap:wrap;gap:12px;border:0;padding:0}.tlm-choice legend{font-weight:600;margin-bottom:6px}.tlm-choice label{display:flex;align-items:center;gap:4px}.tlm-preview{max-width:460px;margin:1rem auto;padding:12px;background:#f7f7f7;text-align:center;border-radius:10px}.tlm-hat{position:relative;max-width:430px;margin:auto}.tlm-hat>img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:contain}.tlm-hat #tlm-logo-overlay{position:absolute;top:46%;left:50%;transform:translate(-50%,-50%);width:27%;aspect-ratio:2.1/1;background:rgba(255,255,255,.6);border:1px dashed #444;display:flex;align-items:center;justify-content:center;overflow:hidden;font-size:12px;color:#333}.tlm-hat #tlm-logo-overlay[data-position=left]{left:39%}.tlm-hat #tlm-logo-overlay[data-position=right]{left:61%}.tlm-hat #tlm-logo-overlay img{max-width:100%;max-height:100%;object-fit:contain}.tlm-ack{display:flex;align-items:flex-start;gap:10px;line-height:1.5}.tlm-ack input{margin-top:5px}.tlm-submit{margin:1rem 0!important;width:100%;padding:12px!important}.tlm-submit:disabled{opacity:.5;cursor:not-allowed}.tlm-note,.tlm-preview small{font-size:.85em;color:#555}.tlm-summary{font-weight:bold}

.tlm-pricing{margin:1.5rem 0}.tlm-pricing table{width:100%;border-collapse:collapse}.tlm-pricing th,.tlm-pricing td{padding:9px;border-bottom:1px solid #ddd;text-align:left}.tlm-pricing .tlm-active-tier{background:#e3f5f3;font-weight:700}.tlm-tier-status{font-weight:600;margin-top:12px}

.tlm-leather-choice{margin:14px 0;padding:12px;border:1px solid #ddd;border-radius:8px}.tlm-leather-choice[hidden]{display:none!important}.tlm-leather-choice select{display:block;width:100%;max-width:440px;margin:8px 0}.tlm-leather-choice small{display:block}

.tlm-shape-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:8px;margin:10px 0 14px}
.tlm-shape-button{border:1px solid #ccc;background:#fff;border-radius:8px;padding:8px 5px;cursor:pointer;display:flex;align-items:center;flex-direction:column;gap:5px}
.tlm-shape-button.is-selected{outline:2px solid #168d8b;border-color:#168d8b}
.tlm-shape-icon{display:block;width:65px;height:46px;background:#b58b5b}
.tlm-stitch-choice{display:flex;gap:14px;border:0;padding:5px 0}.tlm-stitch-choice legend{width:100%}
#tlm-logo-overlay.tlm-leather-preview{background:transparent;border:0;overflow:visible}
#tlm-patch-surface{display:none;position:absolute;inset:0;z-index:0;background:#b58b5b;box-shadow:inset 0 0 12px #0004;background-image:repeating-linear-gradient(35deg,transparent 0px,#fff1 1px,transparent 3px,transparent 7px)}
.tlm-leather-preview #tlm-patch-surface{display:block}
#tlm-patch-stitch{position:absolute;inset:0;transform:scale(.88);border:0;outline:2px dashed #2a201a;outline-offset:-5px;opacity:.85;pointer-events:none}
#tlm-patch-stitch[hidden]{display:none!important}
#tlm-logo-overlay #tlm-logo-photo,#tlm-logo-overlay #tlm-logo-placeholder{z-index:1;position:relative}

/* v1.0.5: use native SVG for exact cutout shapes instead of theme-sensitive CSS clipping. */
.tlm-shape-svg{display:block!important;width:76px!important;height:58px!important;overflow:visible!important;flex-shrink:0}
#tlm-patch-svg{display:none;position:absolute;inset:0;width:100%;height:100%;z-index:0;overflow:visible}
.tlm-leather-preview #tlm-patch-svg{display:block}
#tlm-patch-poly,#tlm-patch-stitch-poly{vector-effect:non-scaling-stroke}

/* v1.0.7: ensure the selected leather patch SVG actually appears over the hat image. */
.tlm-hat #tlm-logo-overlay.tlm-leather-preview {background:transparent!important;border:0!important;overflow:visible!important;isolation:isolate;}
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-patch-svg {display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;z-index:1!important;visibility:visible!important;opacity:1!important;}
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-logo-photo,
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-logo-placeholder {z-index:2!important;max-width:75%;max-height:70%;} 
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-logo-placeholder {background:transparent!important;border:0!important;font-size:10px;}
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-patch-stitch-poly {pointer-events:none;}

/* v1.0.8: authoritative SVG leather patch rendering, unaffected by theme styles */
.tlm-hat #tlm-logo-overlay.tlm-leather-preview{background:transparent!important;border:0!important;overflow:visible!important;isolation:isolate!important;aspect-ratio:1.5/1!important;min-height:54px!important;}
.tlm-hat #tlm-logo-overlay #tlm-patch-svg{display:none!important;}
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-patch-svg:not([hidden]){display:block!important;position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;max-width:100%!important;max-height:100%!important;z-index:1!important;visibility:visible!important;opacity:1!important;overflow:visible!important;}
.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-logo-photo,.tlm-hat #tlm-logo-overlay.tlm-leather-preview #tlm-logo-placeholder{position:relative!important;z-index:3!important;max-width:65%!important;max-height:65%!important;}

/* v1.1: One interactive preview in the original left-hand gallery column. */
.woocommerce-product-gallery.tlm-gallery-is-live{overflow:visible!important}
.tlm-gallery-is-live .tlm-live-gallery-preview{width:100%;max-width:100%;padding:8px 0 18px;box-sizing:border-box}
.tlm-gallery-is-live .tlm-live-gallery-preview h4{margin:0 0 12px;font-size:1.1rem}
.tlm-gallery-is-live .tlm-preview{max-width:none;width:100%;box-sizing:border-box;margin:12px 0}
.tlm-gallery-is-live .tlm-hat{max-width:100%}
.tlm-gallery-is-live .tlm-hat>img{width:100%;height:auto;aspect-ratio:1/1;object-fit:contain}
.tlm-gallery-is-live .tlm-placement{margin-bottom:12px}
.tlm-gallery-is-live #tlm-size{display:block;width:100%;margin:6px 0}

/* Offset logo preview: transparency in customer PNG determines the contour. */
.tlm-leather-preview.tlm-offset-logo #tlm-patch-svg{display:none!important}
.tlm-leather-preview.tlm-offset-logo #tlm-logo-photo:not([hidden]){filter:drop-shadow(2px 0 0 var(--tlm-offset-leather)) drop-shadow(-2px 0 0 var(--tlm-offset-leather)) drop-shadow(0 2px 0 var(--tlm-offset-leather)) drop-shadow(0 -2px 0 var(--tlm-offset-leather)) drop-shadow(0 0 2px #3c3026)}
.tlm-leather-preview.tlm-offset-logo #tlm-logo-placeholder{background:var(--tlm-offset-leather);border-radius:12px;padding:6px}

/* v1.1.2: Free-drag patch placement on large preview. */
.tlm-gallery-is-live #tlm-logo-overlay{touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;}
.tlm-gallery-is-live #tlm-logo-overlay:active{cursor:grabbing;}
.tlm-gallery-is-live #tlm-logo-overlay img{pointer-events:none;-webkit-user-drag:none;}
.tlm-gallery-is-live .tlm-drag-help{font-size:.9rem;margin:.25rem 0 .7rem;color:#555;}

/* v1.1.4: UV patch shares shape and drag controls, without leather color or stitching. */
#tlm-patch-shapes-choice[hidden],.tlm-stitch-choice[hidden],#tlm-leather-choice[hidden]{display:none!important}
.tlm-uv-preview #tlm-patch-poly{stroke:#777;stroke-width:1.5}
.tlm-uv-preview #tlm-patch-stitch-poly{display:none!important}
