#photo-text-editor { margin-block: 1rem; }
#photo-text-editor summary { cursor: pointer; font-weight: 600; }
.photo-text-fields { display: grid; gap: .55rem; margin-top: .8rem; }
.photo-text-fields fieldset { border: 1px solid #d7e5ed; border-radius: .5rem; }
.photo-text-fields fieldset label { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .5rem; }
#photo-text-preview { width: 100%; height: auto; max-height: 8rem; object-fit: contain; }
#photo-text-feedback:empty { display: none; }
.photo-text-tabs { display:flex; flex-wrap:wrap; }
.photo-text-templates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.photo-text-letters { display:grid; grid-template-columns:repeat(auto-fit,minmax(48px,1fr)); gap:.35rem; }
.photo-text-templates button,.photo-text-letters button { position:relative; background:#f4f8fb; border:1px solid #dce8ef; border-radius:.5rem; color:#233948; font-weight:800; }
.photo-text-templates button { font-size:clamp(.9rem,2.7vw,1.3rem); }
.photo-text-letters button { min-width:0; min-height:48px; }
.photo-text-letters button[aria-pressed="true"] { outline:2px solid var(--studio-accent,#009ad1); }
.photo-text-letters img { position:absolute; inset:3px; width:calc(100% - 6px); height:calc(100% - 6px); object-fit:cover; border-radius:.3rem; }
.photo-text-letters span { position:relative; background:#fff; border-radius:.25rem; padding:0 .2rem; }
.photo-text-outline { display:flex; flex-wrap:wrap; gap:.65rem; }

#photo-text-outline-controls[hidden] { display:none; }

@font-face { font-family: TricouMaskTiles; src:url("/assets/studio-fonts/anton/font.ttf") format("truetype"); font-display:swap; }
#photo-text-editor { margin:.7rem 0; padding:.65rem 0; }
.photo-text-fields { gap:.4rem; margin-top:.55rem; }
.photo-text-inputs { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.35fr); gap:.4rem; }
.photo-text-inputs input,.photo-text-inputs select { width:100%; min-width:0; }
.photo-text-templates { grid-template-columns:repeat(auto-fit,minmax(4.35rem,1fr)); gap:.3rem; }
.photo-text-templates button { font:1.1rem TricouMaskTiles,sans-serif; padding:.18rem .22rem; }
.photo-text-letters { grid-template-columns:repeat(auto-fit,minmax(40px,1fr)); }
.photo-text-letters button { min-height:40px; }
.photo-text-fields fieldset:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.3rem .5rem; margin:0; }
.photo-text-fields fieldset label { display:flex; flex-direction:column; gap:.15rem; min-width:0; }
.photo-text-fields input[type=range] { width:100%; min-width:0; padding:0; }
.photo-text-outline label { display:flex; align-items:center; gap:.35rem; }
.photo-text-outline input[type=color] { width:2rem; padding:0; }
#photo-text-feedback { margin:.1rem 0; font-size:.8rem; }
#photo-text-editor[data-cropping] .photo-text-templates,#photo-text-editor[data-cropping] .photo-text-tabs { display:none; }

#panel-text:has(#photo-text-editor[data-cropping]) :is(.desktop-text-controls,.mobile-text-compose) { display:none; }
#upload-modal .atelier-check[hidden] { display:none !important; }

.photo-text-actions { display:flex; flex-wrap:wrap; gap:.35rem; }
#mask-upload-files li { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:.35rem; }
#mask-upload-files span { overflow-wrap:anywhere; }
#photo-text-batch[hidden],#mask-upload-order[hidden] { display:none !important; }

#photo-text-templates { grid-template-columns: repeat(3,minmax(0,1fr)); }
#photo-text-templates button { display:block; min-width:0; width:100%; white-space:nowrap; overflow:hidden; font-size:clamp(.72rem, 2.2vw, 1.05rem); letter-spacing:0; line-height:1.15; }
#photo-text-templates button span { display:inline; margin:0; padding:0; letter-spacing:0; }
#photo-text-panel-preview { display:block; width:100%; height:auto; max-height:5rem; object-fit:contain; background:#f7fafc; border-radius:.45rem; }
#photo-text-panel-preview[hidden],#photo-text-library[hidden],.photo-text-canvas-tools[hidden] { display:none !important; }
#photo-text-library-items { display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.25rem; }
#photo-text-library-items button { width:44px; height:44px; padding:2px; overflow:hidden; border:1px solid #dce8ef; border-radius:.4rem; }
#photo-text-library-items img { display:block; width:100%; height:100%; object-fit:cover; border-radius:.3rem; }
@media (max-width:370px) { #photo-text-templates { grid-template-columns:repeat(2,minmax(0,1fr)); } }

#photo-text-crop { background:#f4f9fb; padding:.45rem .55rem; }
#photo-text-crop :is(#photo-text-done,#photo-text-remove) { color:#173845; font-weight:600; }
#photo-text-crop #photo-text-done:not([hidden]) { background:#007a9e; color:white; }

@font-face {
    font-family: TricouRoundedMask;
    src: url("/assets/studio-fonts/nunito/font.ttf") format("truetype");
    font-weight: 400 800;
    font-display: swap;
}
#photo-text-editor { padding-block:.75rem; }
#photo-text-editor summary { font-size:1rem; }
#photo-text-editor .photo-text-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.45rem;
}
#photo-text-editor .photo-text-actions button {
    width:100%;
    min-width:0;
    padding:.45rem .28rem;
    margin:0;
    align-self:stretch;
    line-height:1.2;
    min-height:42px;
}
#photo-text-editor .photo-text-tabs {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:.25rem;
}
#photo-text-editor .photo-text-tabs button {
    min-width:0;
    padding:.3rem .1rem;
    font-weight:700;
    font-size:clamp(.72rem,2.8vw,.9rem);
}
#photo-text-editor .photo-text-tabs button[aria-pressed="true"] {
    background:linear-gradient(135deg,#09426d,#087988);
    color:#fff;
}
#photo-text-editor #photo-text-templates button {
    border-radius:.7rem;
    background:linear-gradient(155deg,#fff,#edf5fb);
    min-height:44px;
    padding:.3rem .12rem;
    font-family:TricouRoundedMask,system-ui,sans-serif;
    font-weight:800;
    font-size:clamp(.85rem,2.25vw,1.1rem);
    line-height:1.08;
}
#photo-text-editor #photo-text-templates button span {
    display:inline;
    font-weight:inherit;
}
@supports (background-clip:text) or (-webkit-background-clip:text) {
    #photo-text-editor #photo-text-templates button span {
        background-image:linear-gradient(162deg,#e95b80,#952752);
        background-clip:text;
        -webkit-background-clip:text;
        -webkit-text-fill-color:transparent;
    }
    #photo-text-editor #photo-text-templates button span:nth-child(4n+2) { background-image:linear-gradient(160deg,#2c9beb,#14378a); }
    #photo-text-editor #photo-text-templates button span:nth-child(4n+3) { background-image:linear-gradient(160deg,#3ab98b,#0c5b61); }
    #photo-text-editor #photo-text-templates button span:nth-child(4n+4) { background-image:linear-gradient(160deg,#b878eb,#513295); }
}
#photo-text-editor .photo-text-retention { margin:0; color:#486370; font-size:.75rem; }
#photo-text-editor[data-cropping] .photo-text-tabs { display:none; }

#photo-text-editor { padding:.8rem; border:1px solid #cfe5ef; border-radius:1rem; background:#f4f9fc; }
#photo-text-editor summary { color:#153e53; font-weight:800; }
#photo-text-editor .photo-text-tabs { background:#dfedf4; border-radius:.72rem; padding:.2rem; }
#photo-text-editor .photo-text-tabs button { border:none; border-radius:.55rem; min-height:34px; }
#photo-text-editor #photo-text-templates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.38rem; }
#photo-text-editor #photo-text-templates button {
    display:grid; place-items:center; padding:.15rem .3rem; min-height:48px;
    border:1px solid #cfdeed; border-radius:.85rem; background:#fff;
}
#photo-text-editor #photo-text-templates button[aria-pressed="true"] { border-color:#009dd2; background:#e1f5ff; box-shadow:inset 0 0 0 1px #009dd2; }
#photo-text-editor .photo-preset-word { display:block; width:100%; max-width:9rem; height:41px; overflow:visible; }
#photo-text-editor .photo-preset-symbol { color:#2366aa; font-size:1.85rem; line-height:1; }
#photo-text-editor .photo-text-actions #photo-text-batch { display:flex; align-items:center; justify-content:center; border-radius:2rem; font-weight:750; }
#photo-text-editor .photo-text-actions #photo-text-batch { color:#075579; background:#fff; border:1px solid #7db3ca; }
#photo-text-editor .photo-text-actions button:disabled { opacity:.54; }
#photo-text-editor[data-cropping] :is(#photo-text-templates,.photo-text-tabs) { display:none; }

#photo-text-editor #photo-text-templates[data-kind="icons"] {
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:.28rem;
}
#photo-text-editor #photo-text-templates[data-kind="icons"] button {
    aspect-ratio:1;
    min-height:36px;
    max-height:58px;
    padding:clamp(4px,1vw,8px);
    border-radius:.65rem;
}
#photo-text-templates .photo-preset-shape {
    display:block;
    width:100%;
    max-width:40px;
    height:auto;
    aspect-ratio:1;
}

#photo-text-editor #photo-text-templates[data-kind="icons"] { grid-template-columns:repeat(6,minmax(0,1fr)); }
#photo-text-editor #photo-text-templates[data-kind="icons"] button { min-height:30px; max-height:48px; padding:4px; }
#photo-text-editor .photo-text-tabs { grid-template-columns:2.65rem 2.65rem minmax(0,1fr) minmax(0,1fr); background:#fff; }
#photo-text-editor .photo-text-tabs :is([data-mask-tab=ro],[data-mask-tab=ru]) { background:#edf5f9; border:1px solid #cde2ec; display:grid; place-items:center; }
#photo-text-editor .photo-text-tabs :is([data-mask-tab=ro],[data-mask-tab=ru])[aria-pressed=true] { outline:2px solid #0684ba; outline-offset:-2px; }
#photo-text-editor .photo-text-tabs svg { border-radius:2px; box-shadow:0 0 0 1px #b6ccda; }
#photo-text-editor .photo-text-tabs :is([data-mask-tab=shapes],[data-mask-tab=symbols]) { border-radius:0; background:transparent; color:#263a47; border-bottom:2px solid #dce7ee; }
#photo-text-editor .photo-text-tabs :is([data-mask-tab=shapes],[data-mask-tab=symbols])[aria-pressed=true] { color:#006e9e; border-bottom-color:#009ed7; }
#photo-text-editor .photo-text-tabs button span { margin-right:.16rem; }
#photo-text-editor .photo-text-inputs { display:grid; grid-template-columns:minmax(0,1fr); }
#photo-text-editor .photo-text-mode-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.3rem; }
#photo-text-editor .photo-text-mode-buttons button { border:1px solid #b8d5e3; border-radius:.55rem; background:#fff; color:#173c50; padding:.35rem; line-height:1.12; font-weight:650; }
#photo-text-editor .photo-text-mode-buttons button[aria-pressed=true] { background:#d9f0fa; border-color:#008dbb; }
#photo-text-editor .photo-text-mode-buttons span { color:#007ca9; margin-right:.2rem; }
#photo-text-editor #photo-text-templates .photo-preset-custom-word { color:#1e5091; font:800 1rem TricouRoundedMask,system-ui,sans-serif; background:linear-gradient(140deg,#187fb9,#8739a0); background-clip:text; -webkit-text-fill-color:transparent; text-overflow:ellipsis; overflow:hidden; max-width:100%; }
#photo-text-shape-selection { margin:.1rem 0; color:#0a617d; font-weight:650; }

#photo-text-editor .photo-text-tabs { grid-template-columns:2.4rem 2.4rem minmax(0,1fr) minmax(0,1fr); gap:.3rem; background:none; padding:0; align-items:center; }
#photo-text-editor .photo-text-tabs :is([data-mask-tab=ro],[data-mask-tab=ru]) { min-height:34px; background:#fff; border:1px solid transparent; border-radius:.65rem; }
#photo-text-editor .photo-text-tabs :is([data-mask-tab=ro],[data-mask-tab=ru])[aria-pressed=true] { outline:0; border-color:#009cd3; background:#fff; }
#photo-text-editor :is(.photo-text-tabs :is([data-mask-tab=shapes],[data-mask-tab=symbols]),.photo-text-mode-buttons [data-photo-mode]) {
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.2rem;
    min-height:51px; padding:.3rem .15rem; border:1px solid #d1dce3; border-radius:.6rem;
    background:#fff; color:#253742; font-size:clamp(.7rem,2.6vw,.86rem); line-height:1.12; text-align:center;
}
#photo-text-editor :is(.photo-text-tabs :is([data-mask-tab=shapes],[data-mask-tab=symbols]),.photo-text-mode-buttons [data-photo-mode])[aria-pressed=true] { background:#eaf7fd; color:#005f87; border-color:#009bd1; }
#photo-text-editor .mask-button-icon { width:17px; height:17px; border-radius:0; box-shadow:none; flex:none; }
#photo-text-editor :is(.photo-text-tabs,.photo-text-mode-buttons) button:focus-visible { outline:2px solid #006f9c; outline-offset:2px; }

#photo-text-editor { background:#fff; }
#photo-text-editor summary { position:relative; min-height:36px; padding-inline-end:85px; }
#photo-text-editor .mask-header-languages { position:absolute; top:-4px; right:0; display:flex; align-items:center; gap:3px; margin:0; }
#photo-text-editor .mask-header-languages button { display:grid; place-items:center; width:37px; min-height:33px; padding:0; border:1px solid transparent; border-radius:9px; background:white; }
#photo-text-editor .mask-header-languages button[aria-pressed=true] { border-color:#049bd8; }
#photo-text-editor .mask-picker-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:.4rem; }
#photo-text-editor .mask-picker-row label { min-width:0; }
#photo-text-editor #photo-text-value { display:block; width:100%; min-width:0; }
#photo-text-editor .mask-picker-row .photo-text-tabs { display:flex; justify-content:flex-end; gap:.12rem; }
#photo-text-editor .mask-picker-row .photo-text-tabs button[data-mask-tab] {
    display:flex; flex-direction:row; align-items:center; gap:.2rem; width:auto;
    min-height:34px; border:0; border-radius:.45rem; background:transparent; padding:.22rem .28rem; color:#304959;
}
#photo-text-editor .mask-picker-row .photo-text-tabs button[data-mask-tab][aria-pressed=true] { background:#eaf7fd; color:#005c82; }
#photo-text-editor .mask-picker-row .photo-text-tabs .mask-button-icon { width:14px; height:14px; }

#photo-text-editor :is(.mask-picker-row .photo-text-tabs,.photo-text-mode-buttons) {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0;
    padding:0;
    border:1px solid var(--studio-line,#d9e1e6);
    border-radius:12px;
    overflow:hidden;
    background:#fff;
}
#photo-text-editor .mask-picker-row .photo-text-tabs { width:clamp(7.75rem,35vw,10rem); }
#photo-text-editor :is(.mask-picker-row .photo-text-tabs button[data-mask-tab],.photo-text-mode-buttons button[data-photo-mode]) {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-height:56px;
    padding:5px 3px;
    border:0;
    border-inline-end:1px solid var(--studio-line,#d9e1e6);
    border-radius:0;
    background:#fff;
    color:#25333d;
    font-size:clamp(.72rem,2.8vw,.89rem);
    font-weight:400;
    text-align:center;
}
#photo-text-editor :is(.mask-picker-row .photo-text-tabs button[data-mask-tab],.photo-text-mode-buttons button[data-photo-mode]):last-child { border-inline-end:0; }
#photo-text-editor :is(.mask-picker-row .photo-text-tabs button[data-mask-tab],.photo-text-mode-buttons button[data-photo-mode])[aria-pressed=true] {
    color:#049bd8;
    background:#f4f9fc;
}
#photo-text-editor :is(.mask-picker-row .photo-text-tabs button[data-mask-tab],.photo-text-mode-buttons button[data-photo-mode]) .mask-button-icon {
    width:23px;
    height:23px;
    border:0;
    border-radius:0;
    box-shadow:none;
}
#photo-text-editor :is(.mask-picker-row .photo-text-tabs button[data-mask-tab],.photo-text-mode-buttons button[data-photo-mode]):focus-visible {
    outline:2px solid #049bd8;
    outline-offset:-3px;
}

#photo-text-editor .mask-picker-row { align-items:stretch; row-gap:4px; }
#photo-text-editor .mask-picker-row label[for=photo-text-value] {
    grid-column:1 / -1;
    margin:0;
    font-size:.875rem;
    line-height:1.25;
    font-weight:600;
}
#photo-text-editor .mask-picker-row #photo-text-value {
    align-self:stretch;
    box-sizing:border-box;
    height:auto;
    min-height:58px;
    margin:0;
    font-size:1rem;
}
#photo-text-editor .mask-picker-row .photo-text-tabs { margin:0; }
#photo-text-editor .photo-text-mode-buttons .mask-letters-icon {
    display:grid;
    place-items:center;
    height:23px;
    margin:0;
    color:inherit;
    font-size:.825rem;
    font-weight:400;
    letter-spacing:.05em;
    line-height:1;
}

#photo-text-editor .mask-picker-row #photo-text-value { border-radius:12px; }
#photo-text-editor .photo-text-actions:has(#photo-text-batch[hidden]) { grid-template-columns:minmax(0,1fr); }
#photo-text-editor .photo-text-actions #photo-text-outline-controls:not([hidden]) {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:end;
    gap:.35rem;
}
#photo-text-editor .photo-text-outline label { display:grid; gap:.15rem; font-size:.75rem; }
#photo-text-editor .photo-text-letters .photo-text-add-icon {
    position:absolute;
    inset-inline-end:3px;
    bottom:3px;
    display:grid;
    place-items:center;
    width:19px;
    height:19px;
    padding:0;
    border-radius:50%;
    background:#006b90;
    color:#fff;
    font-size:16px;
    font-weight:750;
    line-height:1;
}

#photo-text-editor .photo-text-actions {
    grid-template-columns:minmax(0,1fr) minmax(0,9rem);
    align-items:center;
}
#photo-text-editor .photo-text-actions #photo-text-batch {
    align-self:center;
    min-height:38px;
    padding:.35rem .55rem;
    background:#006b90;
    border-color:#006b90;
    border-radius:12px;
    color:#fff;
    font-size:.84rem;
    line-height:1.15;
}
#photo-text-editor .photo-text-actions #photo-text-batch:not(:disabled):hover {
    background:#005574;
}
#photo-text-editor .photo-text-actions #photo-text-outline-controls:not([hidden]) {
    align-items:start;
}
#photo-text-editor .photo-text-outline label {
    grid-template-rows:auto 2rem;
    line-height:1.25;
}
#photo-text-editor .photo-text-outline input {
    height:2rem;
    min-height:0;
    margin:0;
}
@media (max-width:400px) {
    #photo-text-editor .photo-text-actions {
        grid-template-columns:minmax(0,1fr) minmax(0,7rem);
    }
}

#photo-text-editor .photo-text-slot-tile { position:relative; min-width:0; }
#photo-text-editor .photo-text-slot-select { display:block; width:100%; }
#photo-text-editor .photo-text-slot-delete,
#photo-text-editor .photo-text-letters .photo-text-add-icon {
    position:absolute;
    display:grid;
    place-items:center;
    min-width:0;
    min-height:0;
    margin:0;
    padding:0;
    border:0;
    border-radius:50%;
    color:#fff;
    line-height:1;
}
#photo-text-editor .photo-text-slot-delete {
    inset:3px auto auto 3px;
    width:24px;
    height:24px;
    background:#25333d;
}
#photo-text-editor .photo-text-slot-delete:hover { background:#b42318; }
#photo-text-editor .photo-text-slot-delete:focus-visible { outline:2px solid #009ad1; outline-offset:2px; }
#photo-text-editor .photo-text-letters .photo-text-add-icon {
    inset:auto 3px 3px auto;
    width:19px;
    height:19px;
    background:#006b90;
}
#photo-text-editor :is(.photo-text-slot-delete,.photo-text-add-icon) svg {
    display:block;
    width:14px;
    height:14px;
}

#photo-text-editor .photo-text-letters .photo-text-slot-select .photo-text-add-icon,
#photo-text-editor .photo-text-letters button.photo-text-slot-delete {
    box-sizing:border-box;
    width:24px;
    height:24px;
    min-width:0;
    min-height:0;
}
#photo-text-editor .photo-text-letters .photo-text-slot-select .photo-text-add-icon {
    inset:auto 3px 3px auto;
    background:#147344;
}
#photo-text-editor .photo-text-slot-delete { background:#b42318; }
#photo-text-editor .photo-text-slot-delete:hover { background:#8f1912; }
#photo-text-editor .photo-text-slot-select:hover:not(:disabled) .photo-text-add-icon { background:#0d5833; }
#photo-text-editor .photo-text-slot-select:disabled .photo-text-add-icon { opacity:.5; }
#photo-text-editor .photo-preset-word { object-fit:contain; }

#photo-text-editor .mask-picker-row .photo-text-tabs {
    display:grid;
    align-items:stretch;
    grid-template-columns:repeat(3,minmax(0,1fr));
    width:clamp(9rem,54vw,13rem);
}
#photo-text-editor .mask-picker-row .photo-text-tabs button[data-mask-tab] {
    overflow-wrap:anywhere;
}

#studio .mobile-text-compose #new-text-value {
    box-sizing:border-box;
    width:100%;
    min-width:0;
    height:45px;
    min-height:45px;
    padding:9px 10px;
    resize:vertical;
}
#photo-text-editor .photo-text-mode-buttons .mask-abc-icon {
    display:grid;
    place-items:center;
    height:23px;
    margin:0;
    color:inherit;
    font-size:16px;
    font-weight:600;
    line-height:1;
}
