/**
 * Studio : outils de l'objet sélectionné sur mobile (assets/js/studio/mobile-tools.js).
 */

/* ---------- Mobile : outils d'un texte (mobile-tools.js, buildMobileText) ---------- */
:where(html.ptc-ui) .ptc-mtt,
:where(html.ptc-ui) .ptc-mtt-done {
    display: none;
}
/* Texte sélectionné : barre d'outils en haut, « Terminer » en bas ; la barre
   du studio, les vues et la barre de Lumise s'effacent */
html:where(.ptc-ui).ptc-mob.ptc-tsel .ptc-studio-mtop,
html:where(.ptc-ui).ptc-mob.ptc-tsel .ptc-studio-mbar,
html:where(.ptc-ui).ptc-mob.ptc-tsel .ptc-studio-dock,
html:where(.ptc-ui).ptc-mob.ptc-tsel .ptc-studio-tray {
    display: none;
}
html:where(.ptc-ui).ptc-mob.ptc-tsel body div#LumiseDesign div#lumise-top-tools {
    display: none !important;
}
html:where(.ptc-ui).ptc-mob.ptc-tsel .ptc-mtt {
    position: fixed;
    z-index: 100004;
    top: 8px;
    left: 8px;
    right: 8px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .1);
    font-family: var(--ptc-texte);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    animation: ptc-mtt-in .25s cubic-bezier(.2, .8, .2, 1);
}
html:where(.ptc-ui).ptc-mob .ptc-mtt::-webkit-scrollbar {
    display: none;
}
@keyframes ptc-mtt-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row {
    display: flex;
    width: max-content;
    padding: 0 6px;
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row > button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 15px;
    border: 0;
    border-right: 1px solid #ececec;
    border-radius: 0;
    background: none;
    color: var(--ptc-encre);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row > button:active {
    background: var(--ptc-gris);
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row > button:last-child {
    border-right: 0;
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row svg {
    width: 20px;
    height: 20px;
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row > button.ptc-mtt__icon {
    padding: 0 14px;
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__row > button.is-del {
    color: #d32f2f;
}
html:where(.ptc-ui).ptc-mob .ptc-mtt__dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #111;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
html:where(.ptc-ui).ptc-mob.ptc-tsel .ptc-mtt-done {
    position: fixed;
    z-index: 100004;
    left: 50%;
    bottom: calc(14px + var(--ptc-safe-b, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--ptc-encre);
    color: #fff;
    font-family: var(--ptc-texte);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    transform: translateX(-50%);
    cursor: pointer;
    animation: ptc-done-in .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes ptc-done-in {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
}
html:where(.ptc-ui).ptc-mob .ptc-mtt-done svg {
    width: 18px;
    height: 18px;
}
/* Panneau ouvert : la barre et « Terminer » laissent la place */
html:where(.ptc-ui).ptc-mob.ptc-tsel.ptc-tsheet .ptc-mtt,
html:where(.ptc-ui).ptc-mob.ptc-tsel.ptc-tsheet .ptc-mtt-done {
    display: none;
}

/* Panneau « Style de texte » : onglets Écrire, Police, Taille, Couleur, Format */
html:where(.ptc-ui).ptc-mob .ptc-tsheet-box {
    padding: 20px 16px calc(18px + var(--ptc-safe-b, 0px));
    max-height: 70vh;
    overflow-y: auto;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet-box .ptc-tsheet__head h2 {
    margin: 0;
    font-size: 24px;
    touch-action: none;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__ok {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ptc-gris);
    color: var(--ptc-encre);
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__ok svg {
    width: 20px;
    height: 20px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__tabs {
    display: flex;
    gap: 4px;
    margin: 0 -16px 16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__tabs::-webkit-scrollbar {
    display: none;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__tabs button {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--ptc-encre);
    font-family: var(--ptc-texte);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__tabs button.is-on {
    background: #efefef;
    font-weight: 700;
}
/* Même hauteur pour tous les onglets : le panneau ne saute pas d'un onglet à l'autre */
html:where(.ptc-ui).ptc-mob .ptc-tsheet__panel {
    height: 196px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__panel[data-tab="size"] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 6px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__write {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 14px;
    background: #fff;
    color: var(--ptc-encre);
    font-family: var(--ptc-texte);
    font-size: 16px; /* pas de zoom automatique sur iPhone */
    line-height: 1.4;
    resize: none;
    outline: none;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__write:focus {
    border-color: var(--ptc-encre);
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__fonts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__font {
    height: 54px;
    padding: 0 10px;
    overflow: hidden;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    background: #fff;
    color: var(--ptc-encre);
    font-size: 19px;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__font.is-on {
    border-color: var(--ptc-encre);
    box-shadow: inset 0 0 0 1px var(--ptc-encre);
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__value {
    margin: 4px 0 14px;
    font-family: var(--ptc-titre);
    font-size: 30px;
    text-align: center;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__range {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 6px;
    margin: 0;
    border-radius: 6px;
    background: linear-gradient(to right, var(--ptc-encre) var(--p, 0%), #e2e2e2 var(--p, 0%));
    outline: none;
}
html:where(.ptc-ui).ptc-mob body .ptc-tsheet__range::-webkit-slider-runnable-track {
    height: 6px !important;
    border: 0 !important;
    background: transparent !important;
}
html:where(.ptc-ui).ptc-mob body .ptc-tsheet__range::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 30px !important;
    height: 30px !important;
    margin-top: -12px !important;
    border: 2px solid var(--ptc-encre) !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15) !important;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__range::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border: 2px solid var(--ptc-encre);
    border-radius: 50%;
    background: #fff;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__ends {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--ptc-doux);
    font-size: 13px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 12px;
    justify-items: center;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__swatch {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__swatch.is-on {
    outline: 2px solid var(--ptc-encre);
    outline-offset: 3px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__styles {
    display: flex;
    gap: 8px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 50px;
    padding: 0;
    border: 1px solid #d5d5d5;
    border-radius: 12px;
    background: #fff;
    color: var(--ptc-encre);
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__toggle svg {
    width: 20px;
    height: 20px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__toggle.is-on {
    border-color: var(--ptc-encre);
    background: var(--ptc-encre);
    color: #fff;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__align {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    padding: 4px;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__alignbtn {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 10px 4px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ptc-encre);
    font-family: var(--ptc-texte);
    font-size: 12px;
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__alignbtn.is-on {
    background: #efefef;
    font-weight: 700;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__alignbtn svg {
    width: 20px;
    height: 20px;
}
@media (prefers-reduced-motion: reduce) {
    html:where(.ptc-ui).ptc-mob .ptc-mtt,
    html:where(.ptc-ui).ptc-mob .ptc-mtt-done {
        animation: none;
    }
}

/* Panneau d'une image (mobile) : Fond, Filtres */
html:where(.ptc-ui).ptc-mob .ptc-tsheet__value--small {
    margin: 16px 0 12px;
    font-size: 20px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__panel[data-tab="bg"] .ptc-tsheet__align {
    margin-top: 0;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__panel[data-tab="bg"] .ptc-tsheet__alignbtn {
    padding: 12px 4px;
    font-size: 14px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__fx {
    display: grid;
    grid-template-columns: repeat(auto-fill, 92px);
    justify-content: space-between;
    gap: 10px;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__fxbtn {
    position: relative;
    width: 92px;
    height: 92px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background-color: var(--ptc-gris);
    background-repeat: no-repeat;
    cursor: pointer;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__fxbtn span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 2px;
    background: rgba(255, 255, 255, .88);
    color: var(--ptc-encre);
    font-family: var(--ptc-texte);
    font-size: 12px;
    font-weight: 700;
}
html:where(.ptc-ui).ptc-mob .ptc-tsheet__fxbtn.is-on {
    outline: 2px solid var(--ptc-encre);
    outline-offset: 2px;
}
