/**
 * Studio : contenu des tiroirs Texte, Image (téléchargements) et Modèles.
 */

html:where(.ptc-ui) body div#LumiseDesign div#lumise-left,
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left > div.lumise-left-nav-wrp,
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left > div.lumise-left-nav-wrp > ul.lumise-left-nav,
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp {
    background: #fff !important;
    color: var(--ptc-encre);
}

html:where(.ptc-ui) body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp p,
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp h3,
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp label,
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp header {
    color: var(--ptc-encre) !important;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp p.gray {
    color: var(--ptc-doux) !important;
}

/* Titre ajouté en tête de chaque tiroir (rail.js, buildRail) */
:where(html.ptc-ui) .ptc-studio-drawer-title {
    margin: 0;
    padding: 20px 20px 4px;
    text-align: left;
    font-family: var(--ptc-titre);
    font-size: 26px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--ptc-encre);
}

/* Onglet Texte : aperçus de police (dessinés en blanc par Lumise) */
:where(html.ptc-ui) #lumise-text-ext svg text {
    fill: var(--ptc-encre) !important;
}
:where(html.ptc-ui) #lumise-text .ptc-text-grid--shapes > span[data-act="add"] img {
    filter: invert(1);
}
:where(html.ptc-ui) #lumise-text .ptc-text-grid--shapes > span[data-act="add"],
:where(html.ptc-ui) #lumise-text-ext > span {
    background: var(--ptc-gris) !important;
    border-radius: 10px;
}
:where(html.ptc-ui) #lumise-text .ptc-text-grid--shapes > span[data-act="add"]:hover,
:where(html.ptc-ui) #lumise-text-ext > span:hover {
    background: var(--ptc-rose-pale) !important;
}
:where(html.ptc-ui) .ptc-studio-addtext {
    display: block;
    width: calc(100% - 40px);
    margin: 14px 20px 8px;
    padding: 14px 18px;
    font-size: 16px;
}

/* Onglets Téléchargements et Modèles */
:where(html.ptc-ui) #lumise-uploads header,
:where(html.ptc-ui) #lumise-uploads div[data-tab],
:where(html.ptc-ui) #lumise-templates header,
:where(html.ptc-ui) #lumise-x-thumbn-preview {
    background: #fff !important;
    color: var(--ptc-encre) !important;
}
:where(html.ptc-ui) #lumise-left #lumise-uploads header button.active,
:where(html.ptc-ui) #lumise-left #lumise-uploads header button:hover {
    background: var(--ptc-rose) !important;
    color: #fff !important;
}

/* Tiroir (Téléchargements, Texte, Modèles) : par-dessus le produit, dans la colonne centrale */
html:where(.ptc-ui).ptc-desk body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp {
    position: absolute !important;
    top: 0 !important;
    left: var(--ptc-centre-x) !important;
    box-sizing: border-box !important;
    width: var(--ptc-tiroir) !important;
    height: 100vh !important;
    border: 0 !important;
    border-radius: 12px 0 0 12px;
    background: #fff !important;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .08);
    overflow-y: auto;
}
html:where(.ptc-ui).ptc-desk body #lumise-left #lumise-x-thumbn-preview {
    left: calc(var(--ptc-centre-x) + var(--ptc-tiroir)) !important;
}

/* Languette pour replier le tiroir : collée au bord du tiroir, elle apparaît et
   disparaît avec lui (animée), chevron dessiné en CSS */
html:where(.ptc-ui).ptc-desk body div#LumiseDesign div#lumise-left #lumise-side-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute !important;
    top: 50% !important;
    left: calc(var(--ptc-centre-x) + var(--ptc-tiroir)) !important;
    width: 24px !important;
    height: 56px !important;
    margin: -28px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 12px 12px 0 !important;
    background: #fff !important;
    box-shadow: 6px 0 14px rgba(0, 0, 0, .08) !important;
    color: var(--ptc-encre) !important;
    font-size: 0 !important;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-16px);
    transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1), background-color .15s, visibility 0s linear .26s;
}
html:where(.ptc-ui).ptc-desk body div#LumiseDesign div#lumise-left:has(#lumise-text.active, #lumise-uploads.active, #lumise-templates.active) #lumise-side-close {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1), background-color .15s, visibility 0s;
}
html:where(.ptc-ui).ptc-desk body div#LumiseDesign div#lumise-left #lumise-side-close:hover {
    background: var(--ptc-gris) !important;
}
html:where(.ptc-ui).ptc-desk body div#LumiseDesign div#lumise-left #lumise-side-close:before {
    content: "" !important;
    display: block;
    width: 7px;
    height: 7px;
    margin-left: 3px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}
/* Le tiroir se replie avec la languette : pas de croix */
html:where(.ptc-ui).ptc-desk .ptc-studio-drawer-close {
    display: none;
}

html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left > div.lumise-left-nav-wrp,
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left #lumise-side-close {
    display: none !important;
}

/* Tiroirs Lumise en panneaux qui montent du bas */
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 88vh !important;
    max-height: none !important;
    padding-top: 0 !important;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .15);
    overflow-y: auto !important;
    z-index: 100004 !important;
}

html:where(.ptc-ui).ptc-mob body #lumise-left #lumise-x-thumbn-preview {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100vw !important;
    height: 88vh !important;
    z-index: 100005 !important;
    border-radius: 18px 18px 0 0;
}

html:where(.ptc-ui).ptc-mob #lumise-left #lumise-templates-list,
html:where(.ptc-ui).ptc-mob #lumise-left #lumise-uploads div[data-tab] {
    max-height: none !important;
    height: auto !important;
}

/* Poignée et fermeture des tiroirs Lumise devenus panneaux */
html:where(.ptc-ui).ptc-mob .ptc-studio-drawer-close {
    position: sticky;
    top: 0;
    float: right;
    margin: -4px 8px 0 0;
    z-index: 2;
}

/* Téléchargements : zone de dépôt (drawers.js, buildUploadZone) */
html:where(.ptc-ui) body div#LumiseDesign #lumise-upload-form {
    height: auto !important;
    margin: 4px 0 0 !important;
    padding: 28px 16px !important;
    border: 2px dashed #cfcfcf !important;
    border-radius: 12px !important;
    background: #fafafa !important;
    transition: border-color .15s, background .15s;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    float: none !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-upload-form:hover,
html:where(.ptc-ui) body div#LumiseDesign #lumise-upload-form.is-over {
    border-color: var(--ptc-rose) !important;
    background: #fff5f8 !important;
}
:where(html.ptc-ui) .ptc-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none; /* le clic et le dépôt vont au champ de Lumise */
    color: var(--ptc-encre);
    text-align: center;
}
:where(html.ptc-ui) .ptc-upload > svg {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
    color: var(--ptc-doux);
}
:where(html.ptc-ui) .ptc-upload strong {
    font-size: 15px;
    font-weight: 700;
}
:where(html.ptc-ui) .ptc-upload > span {
    color: var(--ptc-doux);
    font-size: 13px;
}
:where(html.ptc-ui) .ptc-upload .ptc-studio-btn {
    margin-top: 4px;
    font-style: normal;
    display: inline-block;
    padding: 11px 24px;
    font-size: 14px;
}
:where(html.ptc-ui) .ptc-upload-tips {
    margin: 10px 2px 14px;
    color: var(--ptc-doux);
    font-size: 12px;
    line-height: 1.45;
}

html:where(.ptc-ui) body div#LumiseDesign #lumise-upload-form > i,
html:where(.ptc-ui) body div#LumiseDesign #lumise-upload-form > span {
    display: none !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-uploads .ptc-upload-tips {
    display: block;
    box-sizing: border-box;
    width: auto;
    padding: 0;
    text-align: left;
    white-space: normal;
}

/* ---------- Tiroir Texte (drawers.js, buildTextButton) ---------- */
:where(html.ptc-ui) .ptc-text-draft {
    padding: 12px 20px 4px;
}
html:where(.ptc-ui) body div#LumiseDesign .ptc-text-draft textarea {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    min-height: 64px;
    margin: 0 0 10px !important;
    padding: 10px 12px !important;
    border: 1px solid #d5d5d5 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--ptc-encre) !important;
    font: inherit;
    font-size: 15px !important;
    line-height: 1.4 !important;
    resize: vertical;
    box-shadow: none !important;
}
html:where(.ptc-ui) body div#LumiseDesign .ptc-text-draft textarea:focus {
    border-color: var(--ptc-encre) !important;
    outline: 0;
}
html:where(.ptc-ui) body div#LumiseDesign .ptc-text-draft .ptc-studio-addtext {
    width: 100%;
    margin: 0;
}
html:where(.ptc-ui) body div#LumiseDesign .ptc-text-section {
    display: block;
    margin: 18px 20px 8px;
    padding: 0;
    color: var(--ptc-encre);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    text-transform: none;
}
:where(html.ptc-ui) .ptc-text-draft .ptc-text-section {
    margin: 4px 0 8px;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-text .ptc-text-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 0 !important;
    padding: 0 20px 16px !important;
    box-sizing: border-box;
    width: 100%;
    height: auto;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-text .ptc-text-grid > span {
    display: flex !important;
    align-items: center;
    justify-content: center;
    float: none !important;
    width: auto !important;
    height: 72px !important;
    margin: 0 !important;
    padding: 8px !important;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    transition: background-color .15s, transform .15s;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-text .ptc-text-grid > span:hover {
    transform: translateY(-1px);
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-text .ptc-text-grid > span img,
html:where(.ptc-ui) body div#LumiseDesign #lumise-text .ptc-text-grid > span svg {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto;
    height: auto;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-text #lumise-text-mask-guide[hidden] {
    display: none !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-text .ptc-text-draft label.ptc-text-section {
    margin: 4px 0 8px !important;
    padding: 0;
    text-indent: 0;
    width: auto;
}

/* Liste des polices : police active dans notre rose (Lumise : turquoise) */
html:where(.ptc-ui) body div#LumiseDesign #lumise-fonts font {
    border-radius: 8px;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-fonts font.selected,
html:where(.ptc-ui) body div#LumiseDesign #lumise-fonts font.selected::after {
    color: var(--ptc-rose) !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-fonts font:hover {
    background: var(--ptc-gris) !important;
}

/* ---------- Tiroir Modèles : cartes comme le tiroir Texte ---------- */
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates ul.lumise-list-items {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 4px 20px 16px !important;
    box-sizing: border-box;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates li.lumise-template {
    position: relative;
    float: none !important;
    width: auto !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 0 100% !important;
    border: 0 !important;
    border-radius: 10px !important;
    background-color: var(--ptc-gris) !important;
    background-size: 78% auto !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    cursor: pointer;
    transition: background-color .15s, transform .15s;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates li.lumise-template:hover {
    background-color: var(--ptc-rose-pale) !important;
    transform: translateY(-1px);
}
/* Prix du modèle : petite étiquette en haut à droite */
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates li.lumise-template i[data-tag] {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    bottom: auto !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--ptc-encre) !important;
    font-size: 11px !important;
    font-style: normal !important;
    font-weight: 700;
    line-height: 16px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates header {
    padding: 4px 20px 8px !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates .lumise-templates-search input {
    height: 40px !important;
    border: 1px solid #d5d5d5 !important;
    border-radius: 20px !important;
    padding: 0 14px 0 36px !important;
    font-size: 14px !important;
}
html:where(.ptc-ui) body div#LumiseDesign .lumise-template-categories {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
html:where(.ptc-ui) body div#LumiseDesign .lumise-template-categories button[data-func="show-categories"] {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 1px solid #d5d5d5 !important;
    border-radius: 20px !important;
    background: #fff !important;
    color: var(--ptc-encre) !important;
    font-size: 14px !important;
    font-weight: 500;
    text-transform: none !important;
    opacity: 1 !important;
    cursor: pointer;
}
html:where(.ptc-ui) body div#LumiseDesign .lumise-template-categories button[data-func="show-categories"]:hover {
    border-color: var(--ptc-encre) !important;
}

/* Attente de Lumise (« Préparation du panier »…) : comme notre chargement */
html:where(.ptc-ui) body div#LumiseDesign[data-processing="true"]::after {
    background: rgba(255, 255, 255, .55) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
html:where(.ptc-ui) body div#LumiseDesign[data-processing="true"]::before {
    padding: 15px 22px 15px 54px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke='%23fbd3df' stroke-width='2.5'/%3E%3Cpath d='M12 2.5a9.5 9.5 0 0 1 9.5 9.5' fill='none' stroke='%23e63c69' stroke-width='2.5' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") 20px center / 22px 22px no-repeat !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12) !important;
    color: var(--ptc-encre) !important;
    font-family: var(--ptc-texte) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* ---------- Tiroir Téléchargements : sans onglets, images en cartes grises ---------- */
/* « Ressources » (banques d'images de Lumise) ne nous sert pas : seul l'envoi reste */
:where(html.ptc-ui) body div#LumiseDesign #lumise-uploads header.images-from-socials,
:where(html.ptc-ui) body div#LumiseDesign #lumise-uploads #lumise-external-images {
    display: none !important;
}
:where(html.ptc-ui) body div#LumiseDesign #lumise-uploads > div[data-tab="internal"] {
    display: block !important;
    padding: 8px 20px 0 !important;
    box-sizing: border-box;
}
:where(html.ptc-ui) body div#LumiseDesign #lumise-upload-list ul.lumise-list-items {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 0 !important;
    padding: 0 0 16px !important;
}
:where(html.ptc-ui) body div#LumiseDesign #lumise-upload-list li.lumise-clipart {
    position: relative;
    float: none !important;
    width: auto !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 0 100% !important;
    border: 0 !important;
    border-radius: 10px !important;
    background-color: var(--ptc-gris) !important;
    background-size: 78% auto !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    cursor: pointer;
    transition: background-color .15s, transform .15s;
}
:where(html.ptc-ui) body div#LumiseDesign #lumise-upload-list li.lumise-clipart:hover {
    background-color: var(--ptc-rose-pale) !important;
    transform: translateY(-1px);
}
/* Pas de « i » d'information ; la croix de suppression en rond blanc */
:where(html.ptc-ui) body div#LumiseDesign #lumise-upload-list li.lumise-clipart i[data-info] {
    display: none !important;
}
:where(html.ptc-ui) body div#LumiseDesign #lumise-upload-list li.lumise-clipart i[data-delete] {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    bottom: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: var(--ptc-encre) !important;
    font-size: 12px !important;
    line-height: 1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    opacity: 1 !important;
}
:where(html.ptc-ui) body div#LumiseDesign #lumise-upload-list li.lumise-clipart i[data-delete]:hover {
    background: var(--ptc-rose) !important;
    color: #fff !important;
}

/* Tiroirs (Téléchargements, Texte, Modèles) : la poignée reste en haut au défilement */
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp > .ptc-studio-grip {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left .lumise-tab-body-wrp > .ptc-studio-drawer-title {
    padding-top: 6px;
    touch-action: none;
}

/* ---------- Mobile : Téléchargements ---------- */
/* Pas de glisser-déposer sur un téléphone : un simple bouton, comme Spreadshirt */
:where(html.ptc-ui) .ptc-upload .ptc-studio-btn svg,
:where(html.ptc-ui) .ptc-up-mob {
    display: none;
}
html:where(.ptc-ui).ptc-mob body div#LumiseDesign #lumise-upload-form {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
}
html:where(.ptc-ui).ptc-mob .ptc-upload > svg,
html:where(.ptc-ui).ptc-mob .ptc-upload > strong,
html:where(.ptc-ui).ptc-mob .ptc-upload > span,
html:where(.ptc-ui).ptc-mob .ptc-up-desk {
    display: none;
}
html:where(.ptc-ui).ptc-mob .ptc-up-mob {
    display: inline;
}
html:where(.ptc-ui).ptc-mob .ptc-upload .ptc-studio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin: 0;
    padding: 0 20px;
    border-radius: 14px;
    font-size: 16px;
}
html:where(.ptc-ui).ptc-mob .ptc-upload .ptc-studio-btn svg {
    display: block;
    width: 22px;
    height: 22px;
}
/* Images déjà envoyées : la liste suit le tiroir, sans cadre ni hauteur fixe */
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left #lumise-uploads > div[data-tab],
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left #lumise-uploads > div.active {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
}

/* ---------- Tiroir Texte : haut fixe, seules formes et polices défilent ---------- */
/* « Charger plus de 878 polices » de Lumise (visible pour un administrateur) : inutile */
html:where(.ptc-ui) body .lumise-more-fonts {
    display: none !important;
}
:where(html.ptc-ui) #lumise-text > .ptc-drawer-fixed {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0;
    padding-bottom: 14px;
    background: #fff;
    box-shadow: 0 1px 0 var(--ptc-trait);
}
:where(html.ptc-ui) #lumise-text > .ptc-drawer-fixed + * {
    margin-top: 14px;
}
/* Mobile : sous la poignée (elle-même fixe en haut) */
html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-fixed {
    /* Mobile : en-tête juste sous la poignée et titre à la même hauteur que dans
       les autres tiroirs (la croix reste à côté) */
    top: auto;
}

/* ---------- Tiroir Modèles : catégories en pastilles (drawers.js, buildTemplateCats) ---------- */
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates .lumise-template-categories {
    display: none !important;
}
:where(html.ptc-ui) .ptc-tcats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 4px;
}
:where(html.ptc-ui) .ptc-tcat {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    background: #fff;
    color: var(--ptc-encre);
    font-family: var(--ptc-texte);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
:where(html.ptc-ui) .ptc-tcat:hover {
    border-color: var(--ptc-encre);
}
:where(html.ptc-ui) .ptc-tcat.is-on {
    border-color: var(--ptc-encre);
    background: var(--ptc-encre);
    color: #fff;
}
:where(html.ptc-ui) .ptc-tcat--more {
    border-color: transparent;
    background: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}
:where(html.ptc-ui) .ptc-tcat--more:hover {
    border-color: transparent;
    color: var(--ptc-rose);
}
/* Vignettes recadrées sur le modèle (drawers.js, cropTemplates) */
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates-list li.lumise-template.ptc-cropped {
    background-repeat: no-repeat !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates > header {
    flex-wrap: wrap !important;
    height: auto !important;
}
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates > header > .ptc-tcats {
    flex: 1 1 100%;
    width: 100%;
}

/* Aperçus des polices : le nom entier, réduit si besoin (drawers.js, fitFontPreviews) */
html:where(.ptc-ui) body div#LumiseDesign #lumise-text-ext svg.ptc-fit {
    width: auto;
    max-width: 86%;
    height: auto;
    max-height: 40px;
}

/* ---------- Tiroir Modèles : un seul défilement, grille pleine largeur ----------
   Le titre, la recherche et les catégories restent en haut ; seule la liste
   défile (c'est elle que Lumise surveille pour charger la suite). */
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates > * {
    flex: 0 0 auto;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates > #lumise-templates-list {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 4px 14px 20px 20px !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 transparent;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates > #lumise-templates-list::-webkit-scrollbar {
    width: 6px;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates > #lumise-templates-list::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates ul.lumise-list-items {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
/* Le petit « i » de Lumise sur chaque modèle : inutile */
html:where(.ptc-ui) body div#LumiseDesign #lumise-templates li.lumise-template i[data-info] {
    display: none !important;
}
/* Catégories : chaque ligne remplie sur toute la largeur (la dernière ligne
   ouverte garde des pastilles à leur taille) ; deux lignes repliées, mesurées
   par drawers.js (buildTemplateCats) */
:where(html.ptc-ui) .ptc-tcats::after {
    content: '';
    flex: 999 1 0;
}
:where(html.ptc-ui) .ptc-tcats > .ptc-tcat {
    flex: 1 0 auto;
}
:where(html.ptc-ui) .ptc-tcats > .ptc-tcat.is-cut {
    display: none;
}
:where(html.ptc-ui) .ptc-tcats > .ptc-tcat--more {
    flex: 0 0 auto;
    padding: 0 8px;
}
:where(html.ptc-ui) .ptc-tcats.is-folded::after {
    display: none;
}
/* La croix reste à côté du titre (le tiroir est en colonne flexible) */
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-templates > .ptc-studio-drawer-close {
    position: absolute;
    top: 18px;
    right: 22px;
    margin: 0;
    z-index: 3;
}

/* Téléchargements : vignettes alignées sur la zone d'envoi (Lumise ajoutait
   20 px de chaque côté) */
html:where(.ptc-ui) body div#LumiseDesign #lumise-uploads #lumise-upload-list {
    padding: 10px 0 !important;
    overflow-x: hidden !important;
}

/* Tiroir ouvert : il prolonge le rail, sans coins arrondis côté rail */
html:where(.ptc-ui).ptc-desk body div#LumiseDesign div#lumise-left :is(#lumise-text, #lumise-uploads, #lumise-templates) {
    border-radius: 0 !important;
}

/* Tiroir Texte : comme Modèles, l'en-tête reste en place et seule la zone du
   dessous (formes, polices) défile (drawers.js, textHead) */
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > * {
    flex: 0 0 auto;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-fixed {
    position: relative;
    top: auto;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 14px;
    padding-bottom: 20px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 transparent;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-scroll::-webkit-scrollbar {
    width: 6px;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-scroll::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-scroll > :first-child {
    margin-top: 0 !important;
}
/* Croix (mobile) : à côté du titre, hors du flux de la colonne */
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-studio-drawer-close {
    position: absolute;
    top: 18px;
    right: 22px;
    margin: 0;
    z-index: 3;
}
/* La barre de défilement (10 px) prend la place de la marge de droite : les
   cartes restent centrées dans le tiroir */
html:where(.ptc-ui) body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-scroll > .ptc-text-grid {
    padding-right: 10px !important;
}

html:where(.ptc-ui).ptc-mob body div#LumiseDesign div#lumise-left #lumise-text > .ptc-drawer-fixed > .ptc-studio-drawer-title {
    padding-top: 6px;
}

/* Recherche sans résultat : message sur toute la largeur, lisible */
html:where(.ptc-ui) body div#LumiseDesign :is(#lumise-templates-list, #lumise-upload-list) .noitems {
    grid-column: 1 / -1;
    display: block;
    padding: 36px 12px;
    color: var(--ptc-doux);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: normal;
}
