/* TM Product Designer — Studio frontend */

.tmpd-noscroll { overflow: hidden; }

.tmpd-open-wrap { margin: 12px 0; }
.tmpd-open-btn {
    display: inline-flex; align-items: center; gap: 8px;
    color: #fff !important; border: 0; border-radius: 8px;
    padding: 13px 22px; font-weight: 700; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.tmpd-open-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.18); }

.tmpd-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px; background: #f6f8f6; border: 1px solid #d8e5d8; border-radius: 8px; font-size: .92em; }
.tmpd-summary img { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid #e3e3e3; border-radius: 6px; }

/* ---------- Modal ---------- */
.tmpd-modal {
    position: fixed; inset: 0; z-index: 999999;
    background: rgba(20,20,24,.55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 2vh 2vw;
}
.tmpd-modal[hidden] { display: none; }

.tmpd-studio {
    width: min(1360px, 97vw); height: min(880px, 96vh);
    background: #fff; border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    position: relative;
    font-size: 15px;
}

/* ---------- Header ---------- */
.tmpd-head {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 18px; border-bottom: 1px solid #ececf0; background: #fff;
}
.tmpd-vtabs { display: flex; gap: 6px; }
.tmpd-vtab {
    border: 1.5px solid #d9d9e0; background: #fff; border-radius: 999px;
    padding: 7px 18px; cursor: pointer; font-weight: 600; color: #444;
}
.tmpd-vtab.active { background: var(--tmpd-accent, #111); border-color: var(--tmpd-accent, #111); color: #fff; }

.tmpd-price { margin-left: auto; text-align: right; line-height: 1.15; }
.tmpd-price span { display: block; font-size: .74em; color: #888; text-transform: uppercase; letter-spacing: .04em; }
.tmpd-price strong { font-size: 1.3em; }

.tmpd-close { border: 0; background: #f1f1f4; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 15px; }
.tmpd-close:hover { background: #e4e4e9; }

/* ---------- Corps ---------- */
.tmpd-body { flex: 1; display: flex; min-height: 0; }

.tmpd-tools {
    width: 330px; min-width: 330px; border-right: 1px solid #ececf0;
    display: flex; flex-direction: column; background: #fafafc;
}
.tmpd-ttabs { display: flex; border-bottom: 1px solid #ececf0; }
.tmpd-ttab {
    flex: 1; border: 0; background: transparent; padding: 10px 4px 8px; cursor: pointer;
    font-size: 17px; color: #666; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tmpd-ttab span { font-size: 11px; }
.tmpd-ttab.active { color: var(--tmpd-accent, #111); box-shadow: inset 0 -2px 0 var(--tmpd-accent, #111); background: #fff; }

.tmpd-panels { flex: 1; overflow-y: auto; overflow-x: hidden; }
.tmpd-panel { display: none; padding: 16px; }
.tmpd-panel.active { display: block; }

.tmpd-btn-primary {
    width: 100%; border: 0; background: var(--tmpd-accent, #111); color: #fff;
    padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer;
}

/* ---- Panneau Texte (design type Monsieur T-shirt) ---- */
.tmpd-text-opts textarea {
    width: 100%; margin-top: 14px; border: 1px solid #e2e2e8; border-radius: 12px;
    padding: 14px; font-size: 15px; resize: none; box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.tmpd-text-opts textarea:focus { outline: none; border-color: var(--tmpd-accent, #111); }

.tmpd-font-row {
    width: 100%; margin-top: 12px; border: 0; background: transparent;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px 8px; cursor: pointer; border-bottom: 1px solid #ececf0;
}
.tmpd-font-row #tmpd-font-name { font-size: 24px; line-height: 1; }
.tmpd-font-row .tmpd-chev { margin-left: auto; font-size: 26px; color: #444; line-height: 1; }

.tmpd-font-list {
    max-height: 240px; overflow-y: auto; border: 1px solid #ececf0; border-radius: 10px;
    margin-top: 6px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.tmpd-font-list[hidden] { display: none; }
.tmpd-font-item {
    display: block; width: 100%; border: 0; background: transparent; text-align: center;
    padding: 12px 8px; font-size: 21px; cursor: pointer; border-bottom: 1px solid #f3f3f6;
}
.tmpd-font-item:hover { background: #f6f6f9; }

.tmpd-aligns {
    display: flex; justify-content: space-around; align-items: center;
    padding: 14px 8px; border-bottom: 1px solid #ececf0;
}
.tmpd-align-btn { border: 0; background: transparent; cursor: pointer; color: #555; padding: 4px 14px; }
.tmpd-align-btn.active { color: #1a56db; }
.tmpd-align-btn:hover { color: var(--tmpd-accent, #111); }

.tmpd-size-style { display: flex; align-items: center; gap: 10px; padding: 14px 4px 4px; }
.tmpd-size-style input[type=range] { flex: 1; }
.tmpd-size-style button { width: 36px; height: 36px; border: 1px solid #d9d9e0; background: #fff; border-radius: 8px; cursor: pointer; flex: 0 0 36px; }

.tmpd-opt-label {
    margin: 20px 0 10px; font-size: .78em; text-transform: uppercase;
    letter-spacing: .07em; color: #666; font-weight: 700;
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 14px; border-top: 1px solid #f0f0f4;
}
.tmpd-opt-val {
    background: #f1f1f5; border-radius: 999px; padding: 2px 10px;
    color: #333; font-weight: 800; letter-spacing: 0; font-size: 1.05em; text-transform: none;
}

/* Pastilles : rondes quoi qu'il arrive (Flatsome ne passera pas) */
.tmpd-colors { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; }
.tmpd-studio .tmpd-color {
    width: 28px !important; height: 28px !important;
    min-width: 28px !important; max-width: 28px !important;
    min-height: 28px !important; max-height: 28px !important;
    flex: 0 0 28px !important; box-sizing: border-box !important;
    line-height: 1 !important; aspect-ratio: 1 / 1;
    border-radius: 50% !important; border: 1px solid rgba(0,0,0,.15) !important;
    cursor: pointer; transition: transform .1s ease; position: relative; padding: 0 !important;
}
.tmpd-color:hover { transform: scale(1.1); }
.tmpd-color.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a56db; }
.tmpd-color-custom {
    background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    display: block; overflow: hidden;
}
.tmpd-color-custom input[type=color] { opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }

/* Sliders façon Monsieur T-shirt */
.tmpd-range, .tmpd-size-style input[type=range] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px; border-radius: 4px;
    background: linear-gradient(90deg, #1d2b45 0%, #e6e8ee 0%);
    background: #e6e8ee; outline: none;
}
.tmpd-range::-webkit-slider-thumb, .tmpd-size-style input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: #1d2b45; cursor: pointer; border: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.tmpd-range::-moz-range-thumb, .tmpd-size-style input[type=range]::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #1d2b45; cursor: pointer; border: 0;
}
#tmpd-stroke-colors { margin-top: 10px; }
#tmpd-stroke-colors[hidden] { display: none; }

/* Upload */
.tmpd-drop {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    border: 2px dashed #c9c9d4; border-radius: 10px; padding: 26px 12px;
    cursor: pointer; text-align: center; background: #fff; transition: border-color .15s;
}
.tmpd-drop.over, .tmpd-drop:hover { border-color: var(--tmpd-accent, #111); }
.tmpd-drop-ico { font-size: 24px; }
.tmpd-drop small { color: #888; }
.tmpd-msg { margin-top: 10px; padding: 8px 10px; border-radius: 6px; font-size: .85em; }
.tmpd-msg.ok { background: #eaf7ea; color: #1d6b1d; }
.tmpd-msg.err { background: #fdeaea; color: #a12020; }

.tmpd-btn-sec {
    display: block; width: 100%; margin-top: 10px;
    border: 1.5px solid var(--tmpd-accent, #111) !important; background: #fff !important;
    color: var(--tmpd-accent, #111) !important; padding: 11px 12px !important;
    border-radius: 10px !important; font-weight: 700 !important; cursor: pointer;
    transition: background .12s, color .12s;
}
.tmpd-btn-sec:hover { background: var(--tmpd-accent, #111) !important; color: #fff !important; }
.tmpd-btn-sec[hidden] { display: none; }

/* Attestation droits d'auteur */
.tmpd-rights {
    display: flex; gap: 9px; align-items: flex-start;
    font-size: .78em; line-height: 1.45; color: #666;
    margin: 12px 0 12px; cursor: pointer;
    padding: 10px; border-radius: 10px; transition: background .3s, box-shadow .3s;
}
.tmpd-rights input { margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--tmpd-accent, #111); }
.tmpd-rights-flash { background: #fdeaea; box-shadow: 0 0 0 2px #e8b3b3; }

/* Panneau Sauvegarder & partager */
#tmpd-share-panel input[type=text], #tmpd-share-panel input[type=email] {
    display: block; width: 100%; margin: 0 0 10px; padding: 12px 13px;
    border: 1.5px solid #e2e2e8; border-radius: 10px; font-size: 1em; box-sizing: border-box;
}
#tmpd-share-panel input:focus { outline: none; border-color: var(--tmpd-accent, #111); }
.tmpd-share-note { color: #777; font-size: .86em; line-height: 1.5; margin: 4px 0 14px; }
.tmpd-share-links { line-height: 2; font-size: 1.02em; }
.tmpd-share-links a { font-weight: 700; }
#tmpd-share-btn { margin-top: 10px; }

/* Cadran retrait express / livraison */
.tmpd-fulfil { display: flex; flex-direction: column; gap: 10px; }
.tmpd-ful-row {
    display: flex; gap: 10px; align-items: flex-start;
    background: #f8f8fa; border: 1px solid #ececf2; border-radius: 12px; padding: 10px 12px;
}
.tmpd-ful-ico { font-size: 1.25em; line-height: 1.2; }
.tmpd-ful-row strong { display: block; font-size: .9em; line-height: 1.3; }
.tmpd-ful-row strong em { font-style: normal; color: var(--tmpd-accent, #111); }
.tmpd-ful-row small { color: #888; font-size: .78em; line-height: 1.35; display: block; margin-top: 2px; }
.tmpd-ful-row small b { color: #b25b00; font-weight: 800; }
.tmpd-side-fulfil { border-top: 0; padding-top: 0; margin-top: 14px; }

.tmpd-h5-flex { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tmpd-h5-flex .tmpd-guide-link { margin-top: 0; white-space: nowrap; }

/* Descriptif produit dans la colonne */
.tmpd-side-desc { color: #777; font-size: .84em; line-height: 1.5; margin: -4px 0 8px; }
.tmpd-side-desc p { margin: 0 0 6px; }

/* Guide des tailles */
.tmpd-guide-link {
    display: inline-block; margin-top: 10px; font-size: .86em; font-weight: 700;
    color: var(--tmpd-accent, #111); text-decoration: underline; text-underline-offset: 3px;
}
.tmpd-guide-card { width: min(560px, 94%); }
.tmpd-guide-img { width: 100%; height: auto; border-radius: 10px; margin: 8px 0 12px; }
.tmpd-guide-txt { font-size: .92em; line-height: 1.55; color: #444; }
.tmpd-guide-txt table { border-collapse: collapse; width: 100%; }
.tmpd-guide-txt td, .tmpd-guide-txt th { border: 1px solid #eee; padding: 6px 9px; text-align: center; }

/* Cliparts */
.tmpd-panel[data-panel="clipart"] h4 { margin: 12px 0 6px; }
.tmpd-clip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tmpd-clip { border: 1px solid #e3e3e9; background: #fff; border-radius: 8px; padding: 6px; cursor: pointer; }
.tmpd-clip:hover { border-color: var(--tmpd-accent, #111); }
.tmpd-clip img { width: 100%; height: 56px; object-fit: contain; display: block; }

/* Calques */
.tmpd-layers { list-style: none; margin: 0 0 12px; padding: 0; }
.tmpd-layers li { padding: 8px 10px; border: 1px solid #e3e3e9; border-radius: 6px; margin-bottom: 6px; background: #fff; cursor: pointer; font-size: .9em; }
.tmpd-layers li.active { border-color: var(--tmpd-accent, #111); box-shadow: 0 0 0 1px var(--tmpd-accent, #111); }
.tmpd-layers li.tmpd-empty { color: #999; cursor: default; border-style: dashed; }
.tmpd-layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tmpd-layer-actions button { border: 1px solid #d9d9e0; background: #fff; border-radius: 6px; padding: 8px 0; cursor: pointer; font-size: .85em; }
.tmpd-layer-actions .tmpd-wide { grid-column: 1 / -1; font-weight: 700; }
.tmpd-layer-actions .tmpd-danger { grid-column: 1 / -1; color: #a12020; border-color: #eec7c7; }

/* Panneau détourage */
.tmpd-bgr-preview {
    border-radius: 12px; overflow: hidden; margin: 6px 0 4px;
    background: repeating-conic-gradient(#ececf0 0% 25%, #fff 0% 50%) 0 0 / 22px 22px;
    display: flex; align-items: center; justify-content: center; min-height: 180px;
}
.tmpd-bgr-preview img { max-width: 100%; max-height: 300px; display: block; transition: opacity .15s; }
.tmpd-bgr-hint { color: #888; font-size: .82em; line-height: 1.45; margin: 10px 0 14px; }

/* Studio Effets */
.tmpd-fx-card { width: min(520px, 94%); }
.tmpd-fx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 6px 0 12px; }
.tmpd-fxbtn {
    border: 1.5px solid #e2e2e8 !important; background: #fff !important; color: #333 !important;
    border-radius: 9px !important; padding: 9px 4px !important; font-size: .8em !important;
    font-weight: 700 !important; cursor: pointer; line-height: 1.2 !important;
    transition: border-color .12s, background .12s, color .12s;
}
.tmpd-fxbtn:hover { border-color: var(--tmpd-accent, #111) !important; }
.tmpd-fxbtn.active { background: var(--tmpd-accent, #111) !important; color: #fff !important; border-color: var(--tmpd-accent, #111) !important; }
.tmpd-fx-row { display: flex; gap: 16px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.tmpd-fx-row label { display: flex; gap: 8px; align-items: center; font-size: .86em; font-weight: 700; color: #555; }
.tmpd-fx-row input[type=color] { width: 40px; height: 32px; border: 1px solid #ddd; border-radius: 8px; padding: 2px; cursor: pointer; }
.tmpd-fx-shapes { gap: 7px; }
.tmpd-fxshape {
    border: 1.5px solid #e2e2e8 !important; background: #fff !important; color: #333 !important;
    border-radius: 999px !important; padding: 7px 13px !important; font-size: .82em !important;
    font-weight: 700 !important; cursor: pointer;
}
.tmpd-fxshape.active { background: var(--tmpd-accent, #111) !important; color: #fff !important; border-color: var(--tmpd-accent, #111) !important; }
.tmpd-fx-note { color: #888; font-size: .84em; line-height: 1.5; margin: 8px 0; }
#tmpd-fx-apply { margin-top: 12px; }

/* Panneau QR */
.tmpd-qr-input {
    display: block; width: 100%; box-sizing: border-box; margin: 4px 0 8px;
    padding: 12px 13px; border: 1.5px solid #e2e2e8; border-radius: 10px; font-size: 1em;
}
.tmpd-qr-input:focus { outline: none; border-color: var(--tmpd-accent, #111); }

/* Historique + copie de face (bandeau) */
.tmpd-hist { display: flex; gap: 6px; margin-left: 14px; align-items: center; }
.tmpd-hist button {
    border: 1.5px solid #e2e2e8 !important; background: #fff !important; color: #333 !important;
    border-radius: 999px !important; padding: 6px 12px !important; cursor: pointer;
    font-size: .95em !important; line-height: 1 !important; font-weight: 700 !important;
}
.tmpd-hist button:hover:not(:disabled) { border-color: var(--tmpd-accent, #111) !important; }
.tmpd-hist button:disabled { opacity: .35; cursor: default; }
#tmpd-copyside { font-size: .8em !important; }

/* Dimensions réelles */
.tmpd-side-dims { margin-top: 8px; font-size: .84em; color: #555; }
.tmpd-side-dims b { color: #111; }

/* Styles rapides de texte */
.tmpd-presets { display: flex; gap: 6px; align-items: center; margin: 10px 0 4px; flex-wrap: wrap; font-size: 1.05em; }
.tmpd-presets button {
    border: 1.5px solid #e2e2e8 !important; background: #fff !important; color: #333 !important;
    border-radius: 999px !important; padding: 6px 12px !important; font-size: .78em !important;
    font-weight: 700 !important; cursor: pointer;
}
.tmpd-presets button:hover { background: var(--tmpd-accent, #111) !important; color: #fff !important; border-color: var(--tmpd-accent, #111) !important; }

/* Modèles */
.tmpd-tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tmpd-tpl {
    border: 1.5px solid #e2e2e8 !important; background: #fff !important; border-radius: 10px !important;
    padding: 4px !important; cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden;
}
.tmpd-tpl:hover { border-color: var(--tmpd-accent, #111) !important; }
.tmpd-tpl img { width: 100%; height: 100%; object-fit: contain; }

/* Mode équipe */
.tmpd-team-toggle { display: flex; gap: 8px; align-items: center; font-size: .9em; margin: 4px 0 10px; cursor: pointer; }
.tmpd-team-toggle input { accent-color: var(--tmpd-accent, #111); width: 16px; height: 16px; }
.tmpd-team-row { display: flex; gap: 6px; margin-bottom: 7px; align-items: center; }
.tmpd-team-row select { flex: 0 0 76px; padding: 9px 6px; border: 1.5px solid #e2e2e8; border-radius: 9px; }
.tmpd-team-row input { min-width: 0; padding: 9px 10px; border: 1.5px solid #e2e2e8; border-radius: 9px; }
.tmpd-team-name { flex: 1; }
.tmpd-team-num { flex: 0 0 58px; text-align: center; }
.tmpd-team-del {
    flex: 0 0 28px; width: 28px !important; height: 28px !important; border-radius: 50% !important;
    border: 0 !important; background: #f0f0f3 !important; color: #a12020 !important; cursor: pointer; padding: 0 !important;
}
#tmpd-team-add { margin: 4px 0 8px; }

/* Brouillon */
.tmpd-draft-bar {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    background: #fff; border: 1px solid #eee; box-shadow: 0 8px 30px rgba(0,0,0,.14);
    border-radius: 999px; padding: 9px 16px; z-index: 30; font-size: .88em;
    display: flex; gap: 10px; align-items: center; white-space: nowrap;
}
.tmpd-draft-bar button {
    border: 0 !important; border-radius: 999px !important; padding: 6px 13px !important;
    cursor: pointer; font-weight: 700 !important; font-size: .92em !important;
}
#tmpd-draft-yes { background: var(--tmpd-accent, #111) !important; color: #fff !important; }
#tmpd-draft-no { background: #f0f0f3 !important; color: #555 !important; }

/* ---------- Scène ---------- */
.tmpd-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; min-width: 0; }
.tmpd-cwrap { position: relative; }
.tmpd-cwrap[hidden] { display: none; }
.tmpd-cwrap canvas { border-radius: 8px; }
.tmpd-stage-hint { position: absolute; bottom: 10px; font-size: .78em; color: #999; }

/* ---------- Résets anti-thème (Flatsome & co écrasent les <button>) ---------- */
.tmpd-studio button {
    margin: 0; text-transform: none; letter-spacing: normal;
    min-width: 0; font-family: inherit; box-shadow: none;
}
.tmpd-studio input[type=number], .tmpd-studio input[type=text], .tmpd-studio textarea {
    margin: 0; box-shadow: none;
}

/* ---------- Colonne droite ---------- */
.tmpd-side {
    width: 300px; min-width: 300px; border-left: 1px solid #ececf0;
    background: #fff; padding: 20px 18px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
}
.tmpd-side-name { font-weight: 800; font-size: 1.08em; line-height: 1.3; margin-bottom: 10px; }
.tmpd-side-sec { padding: 14px 0; border-top: 1px solid #f0f0f4; }
.tmpd-side-sec h5 {
    margin: 0 0 10px; font-size: .78em; text-transform: uppercase;
    letter-spacing: .06em; color: #777; font-weight: 700;
}
.tmpd-side-sec h5 #tmpd-color-name { color: #111; text-transform: none; letter-spacing: 0; font-size: 1.15em; margin-left: 2px; }

/* Pastilles couleurs produit — rondes, quoi qu'en dise le thème */
.tmpd-prodcolors { display: flex; gap: 10px; flex-wrap: wrap; }
.tmpd-studio .tmpd-pcolor {
    width: 34px !important; height: 34px !important;
    min-width: 34px !important; max-width: 34px !important;
    min-height: 34px !important; max-height: 34px !important;
    flex: 0 0 34px !important; box-sizing: border-box !important; aspect-ratio: 1 / 1;
    padding: 0 !important; line-height: 1 !important;
    border-radius: 50% !important; border: 1px solid rgba(0,0,0,.18) !important;
    cursor: pointer; background-clip: padding-box;
    transition: transform .1s ease; box-shadow: 0 1px 3px rgba(0,0,0,.12);
    background-color: #eee;
}
.tmpd-pcolor:hover { transform: scale(1.1); }
.tmpd-pcolor.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tmpd-accent, #111) !important; }
.tmpd-pcolor-txt { font-size: 12px; font-weight: 700; color: #444; }

/* Tags tailles disponibles (informatif) */
.tmpd-size-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tmpd-size-tag {
    background: #f3f3f6; border-radius: 999px; padding: 4px 11px;
    font-size: .8em; font-weight: 700; color: #555;
}

/* Prix */
.tmpd-side-price-row { display: flex; align-items: baseline; justify-content: space-between; }
.tmpd-side-price-row span { font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: #777; font-weight: 700; }
.tmpd-side-price-row strong { font-size: 1.5em; }
.tmpd-side-detail { margin-top: 6px; color: #888; font-size: .82em; line-height: 1.4; }

/* CTA */
.tmpd-cta {
    display: block; width: 100%; margin-top: auto; border: 0 !important;
    background: var(--tmpd-accent, #111) !important; color: #fff !important;
    padding: 16px 18px !important; border-radius: 12px !important;
    font-weight: 800 !important; font-size: 1em !important; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.tmpd-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.22); filter: brightness(1.08); }
.tmpd-cta:disabled { opacity: .65; cursor: wait; transform: none; }

/* ---------- Panneau Tailles & quantités ---------- */
.tmpd-sizes-panel {
    position: absolute; inset: 0; z-index: 45;
    background: rgba(18,18,24,.45); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
}
.tmpd-sizes-panel[hidden] { display: none; }
.tmpd-sizes-card {
    width: min(420px, 92%); max-height: 88%; overflow-y: auto;
    background: #fff; border-radius: 18px; padding: 22px 24px 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,.3);
    animation: tmpd-pop .18s ease;
}
@keyframes tmpd-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tmpd-sizes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tmpd-sizes-head h3 { margin: 0; font-size: 1.2em; }
.tmpd-sizes-rows { margin-bottom: 6px; }
.tmpd-size-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 2px; border-bottom: 1px solid #f2f2f5;
}
.tmpd-size-lab { font-weight: 800; font-size: 1.02em; }
.tmpd-stepper { display: inline-flex; align-items: center; gap: 6px; }
.tmpd-stepper button {
    width: 32px !important; height: 32px !important; min-width: 32px !important;
    padding: 0 !important; border-radius: 50% !important; line-height: 1 !important;
    border: 1.5px solid #e0e0e6 !important; background: #fff !important; color: #333 !important;
    cursor: pointer; font-size: 17px !important; font-weight: 600;
    transition: background .12s, border-color .12s, color .12s;
}
.tmpd-stepper button:hover { background: var(--tmpd-accent, #111) !important; border-color: var(--tmpd-accent, #111) !important; color: #fff !important; }
.tmpd-stepper input {
    width: 44px !important; text-align: center; border: 0 !important; background: transparent !important;
    font-weight: 800; font-size: 1.05em; padding: 0 !important; -moz-appearance: textfield;
}
.tmpd-stepper input::-webkit-outer-spin-button, .tmpd-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tmpd-sizes-total { text-align: center; margin: 14px 0 16px; color: #444; line-height: 1.5; }
.tmpd-sizes-total strong { font-size: 1.2em; }

/* Loader */
.tmpd-loader {
    position: absolute; inset: 0; z-index: 20;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: rgba(255,255,255,.75); backdrop-filter: blur(2px); border-radius: 8px;
}
.tmpd-loader[hidden] { display: none; }
.tmpd-loader em { font-style: normal; color: #555; font-size: .9em; font-weight: 600; }
.tmpd-spin {
    width: 38px; height: 38px; border-radius: 50%;
    border: 4px solid #e3e3e9; border-top-color: var(--tmpd-accent, #111);
    animation: tmpd-rot .8s linear infinite;
}
@keyframes tmpd-rot { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.tmpd-foot {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 18px; border-top: 1px solid #ececf0; background: #fff;
}
.tmpd-foot-detail { color: #666; font-size: .88em; }
.tmpd-validate {
    margin-left: auto; border: 0; background: var(--tmpd-accent, #111); color: #fff;
    padding: 13px 26px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1em;
}
.tmpd-validate:hover { filter: brightness(1.15); }

/* ---------- Mobile ---------- */


@media (prefers-reduced-motion: reduce) {
    .tmpd-open-btn, .tmpd-color { transition: none; transform: none !important; }
}

/* Style des marquages équipe */
.tmpd-team-style { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.tmpd-team-style label { display: flex; gap: 8px; align-items: center; font-size: .85em; font-weight: 700; color: #555; }
.tmpd-team-style select { max-width: 190px; padding: 7px 8px; border: 1.5px solid #e2e2e8; border-radius: 8px; }
.tmpd-team-style input[type=color] { width: 38px; height: 32px; border: 1px solid #ddd; border-radius: 8px; padding: 2px; cursor: pointer; }
.tmpd-team-preview {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    text-align: center; padding: 10px 10px 6px; margin-bottom: 10px;
    background: #f7f7f9; border-radius: 10px; letter-spacing: .05em; line-height: 1.05;
}
.tmpd-tp-name { font-size: 1.35em; }
.tmpd-tp-num { font-size: 2.6em; }

/* Barre sous la scène : zoom + hint */
.tmpd-stage-bar {
    position: absolute; bottom: 8px; left: 0; right: 0;
    display: flex; align-items: center; justify-content: center; gap: 16px;
}
.tmpd-stage-bar .tmpd-stage-hint { position: static; }
.tmpd-zoom { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #e4e4ea; border-radius: 999px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.tmpd-zoom button {
    border: 0 !important; background: transparent !important; color: #333 !important;
    cursor: pointer; padding: 4px 9px !important; border-radius: 999px !important;
    font-size: 14px !important; font-weight: 700 !important; line-height: 1 !important; min-width: 0 !important;
}
.tmpd-zoom button:hover { background: #f0f0f4 !important; }
#tmpd-zoom-val { font-size: 12px !important; color: #666 !important; min-width: 44px !important; }

/* Barre mobile collante (cachée sur PC) */
.tmpd-mobilebar { display: none; }

/* ============================================================
   MOBILE — placé en fin de fichier : priorité garantie sur tout
   ============================================================ */
@media (max-width: 980px) {
    .tmpd-modal { padding: 0; }
    .tmpd-studio { width: 100%; height: 100%; border-radius: 0; font-size: 14px; }
    .tmpd-body { flex-direction: column; overflow-y: auto; padding-bottom: 76px; }

    /* Bandeau compact, défilable, tout sur une ligne */
    .tmpd-head { gap: 6px; padding: 8px 10px; overflow-x: auto; flex-wrap: nowrap; }
    .tmpd-vtabs { flex: 0 0 auto; }
    .tmpd-vtab { padding: 8px 14px !important; font-size: .9em !important; }
    .tmpd-histbtns button { width: 34px !important; padding: 0 !important; }
    #tmpd-copyside { font-size: 0 !important; width: 38px !important; padding: 0 !important; }
    #tmpd-copyside::before { content: '⧉'; font-size: 17px; }

    /* Scène : t-shirt centré, plein cadre, sans espace mort */
    .tmpd-stage { order: 1; min-height: 0; padding: 8px 0 44px; }
    #tmpd-canvases { width: 100%; display: flex; justify-content: center; }
    .tmpd-cwrap { display: flex; justify-content: center; width: 100%; }
    .tmpd-cwrap .canvas-container {
        width: min(94vw, 480px) !important;
        height: min(94vw, 480px) !important;
        margin: 0 auto;
    }
    .tmpd-cwrap canvas, .tmpd-cwrap .upper-canvas {
        width: 100% !important; height: 100% !important;
        max-width: none;
    }
    .tmpd-stage-bar { bottom: 6px; gap: 10px; padding: 0 10px; }
    .tmpd-stage-hint { font-size: .7em; }

    /* Outils juste sous le t-shirt : on édite sans chercher */
    .tmpd-tools { order: 2; width: 100%; min-width: 0; border-right: 0; border-top: 1px solid #ececf0; }
    .tmpd-ttabs { position: sticky; top: 0; background: #fff; z-index: 5; }
    .tmpd-ttab { padding: 10px 4px !important; }
    .tmpd-panels { padding: 12px 14px; }
    .tmpd-btn-primary, .tmpd-btn-sec { padding: 13px 12px !important; }
    .tmpd-font-list { max-height: 40vh; }
    .tmpd-presets { font-size: 1em; }
    .tmpd-clip-grid, .tmpd-tpl-grid { grid-template-columns: repeat(4, 1fr); }

    /* Infos produit ensuite (prix/CTA doublés dans la barre du bas) */
    .tmpd-side { order: 3; width: 100%; min-width: 0; border-left: 0; border-top: 8px solid #f2f2f5; padding: 14px 16px 18px; }
    .tmpd-side-name { font-size: 1em; }
    .tmpd-pcolor { width: 38px !important; height: 38px !important; min-width: 38px !important; max-width: 38px !important; min-height: 38px !important; max-height: 38px !important; flex-basis: 38px !important; }

    /* Barre collante : prix + action toujours sous le pouce */
    .tmpd-mobilebar {
        display: flex; align-items: center; gap: 12px;
        position: absolute; left: 0; right: 0; bottom: 0; z-index: 60;
        background: #fff; border-top: 1px solid #e8e8ee;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 20px rgba(0,0,0,.08);
    }
    .tmpd-mb-price { line-height: 1.1; }
    .tmpd-mb-price small { display: block; font-size: .68em; text-transform: uppercase; letter-spacing: .05em; color: #888; font-weight: 700; }
    .tmpd-mb-price strong { font-size: 1.25em; }
    .tmpd-mobilebar .tmpd-cta { flex: 1; margin: 0; padding: 13px 12px !important; }

    /* Panneaux (tailles, effets, partage…) en plein écran confortable */
    .tmpd-sizes-card { width: 94%; max-height: 92%; padding: 18px 16px 20px; }
    .tmpd-stepper button { width: 38px !important; height: 38px !important; min-width: 38px !important; font-size: 19px !important; }
    .tmpd-team-row { flex-wrap: nowrap; }
    .tmpd-team-row .tmpd-team-name { min-width: 0; flex: 1; }
    .tmpd-team-row .tmpd-team-num { width: 54px; flex: 0 0 54px; }
    .tmpd-fx-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Badge version (diagnostic cache) */
.tmpd-ver { font-size: 9px; color: #c0c0c8; align-self: flex-end; padding-bottom: 2px; }


/* Icônes SVG des onglets outils */
.tmpd-ttab svg { width: 22px; height: 22px; display: block; margin: 0 auto 4px; }
.tmpd-ttab span { display: block; }
