﻿/* digital_shared — estilos compartilhados da ferramenta digital (mobile + desktop) */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
    --template-scale: 0.158;
    --background-color: #F5F5F5;
    --fundo-app: #f7fcf9;
    --verde-escuro: #027B8B;
    --verde-texto: #027B8B;
    --verde: #41C982;
    --verde-hover: #35a86c;
    --texto-escuro: #000000;
    --texto-cinza: #778877;
    --borda-clara: rgba(29, 76, 67, 0.1);
    --sombra-verde: 0 4px 15px rgba(29, 76, 67, 0.15);
    --sombra-card: 0 4px 10px rgba(26, 60, 52, 0.15);
    --pill-radius: 10px;
    --pill-radius-btn: 20px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}


button *,
.btn-outline *,
.btn-solid *,
.btn-accent *,
.btn-crop-float *,
.menu-item *,
.menu-tab *,
.action-btn-circle *,
.btn-expand-template *,
.btn-close-fullscreen *,
.intro-btn *,
.custom-select-trigger *,
.custom-select-dialog-close *,
.custom-select-option *,
.btn-shape * {
    pointer-events: none !important;
}

.app-container,
.main-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#gabarito {
    background-color: unset;
}

.card {
    padding: 10px;
    background: #fff;
    border-radius: 10px;
}

.informative-text {
    font-size: 18px;
    color: #000;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* â”€â”€ Welcome screen â”€â”€ */
.criacopo-welcome {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100%;
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    /* background: linear-gradient(
        -45deg,
        var(--verde-escuro),
        var(--verde),
        color-mix(in srgb, var(--verde-escuro) 55%, var(--verde)),
        color-mix(in srgb, var(--verde) 70%, var(--verde-escuro))
    ); */
    background-size: 400% 400%;
    animation: gradientBackground 8s ease infinite;
    overflow: hidden;
}

.welcome-content {
    width: 90%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(29, 76, 67, 0.25);
    animation: fadeInWelcome 0.8s ease-out;
}

.welcome-logo {
    max-width: 180px;
    height: auto;
    animation: pulseLogo 2s infinite ease-in-out;
}

.welcome-text {
    font-size: 18px;
    color: var(--verde-escuro);
    line-height: 1.4;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(29, 76, 67, 0.15);
    border-top-color: var(--verde-escuro);
    border-radius: 50%;
    animation: spinLoader 1s linear infinite;
}

@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

/* â”€â”€ Intro onboarding â”€â”€ */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.intro-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.intro-overlay.is-closing {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-backdrop {
    position: absolute;
    inset: 0;
    background: #000000bd;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.35s ease, background 0.35s ease;
}

.intro-overlay.is-spotlight-mode .intro-backdrop {
    opacity: 0;
    pointer-events: none;
}

.intro-spotlight-ring {
    position: fixed;
    z-index: 1;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.74);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.92);
    transition: top 0.4s ease, left 0.4s ease, width 0.4s ease, height 0.4s ease,
        border-radius 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

.intro-overlay.is-spotlight-mode .intro-spotlight-ring.is-active {
    opacity: 1;
    transform: scale(1);
}

.intro-spotlight-ring.is-copo3d-target {
    border-radius: 28px;
}

.intro-spotlight-ring.is-zoom-target {
    border-radius: 50%;
}

.intro-spotlight-hand {
    position: fixed;
    z-index: 2;
    font-size: 42px;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease, top 0.4s ease, left 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    z-index: 11;
}

.intro-overlay.is-spotlight-mode .intro-spotlight-hand.is-active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    animation: introHandBounce 1.2s ease-in-out infinite;
}

@keyframes introHandBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

.intro-modal {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 360px;
    padding: 2px;
    border-radius: 22px;
    background: linear-gradient(135deg, #f472b6, #a78bfa, #60a5fa, #f9a8d4);
    box-shadow: 0 12px 40px rgba(29, 76, 67, 0.18);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.intro-overlay.is-visible:not(.is-closing) .intro-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.intro-overlay.is-spotlight-mode {
    /* align-items: flex-end; */
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.intro-overlay.is-spotlight-mode .intro-modal {
    max-width: 340px;
}

.intro-modal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 18px;
    border-radius: 20px;
    background: #fff;
}

.intro-nav {
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    gap: 0;
    width: 100%;
    background-color: unset;
    height: auto;
}

.intro-nav:hover {
    height: auto;
}

.intro-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    color: #8a9a8a;
    background: transparent;
    text-transform: none;
    opacity: 0.45;
    transform: scale(0.96);
    transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.intro-nav-item[data-intro-nav="ia"] {
    border: none !important;
    background: transparent !important;
}

.intro-nav-item.is-highlighted {
    color: var(--verde);
    opacity: 1;
    transform: scale(1);
    border: none;
    box-shadow: none;
}

.intro-nav-item[data-intro-nav="ia"].is-highlighted {
    box-shadow: none;
}

.intro-nav-item .menu-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: inherit;
}

.intro-nav-item .menu-tab-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.intro-nav-item[data-intro-nav="ia"] .menu-tab-icon,
.intro-nav-item[data-intro-nav="ia"] .menu-tab-icon svg {
    width: 27px;
    height: 27px;
}

.intro-nav-item .menu-tab-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.intro-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.intro-header[hidden] {
    display: none !important;
}

.intro-icon {
    font-size: 22px;
    line-height: 1;
}

.intro-title {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
    color: var(--verde-escuro);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.intro-step {
    display: none;
    width: 100%;
}

.intro-step.is-active {
    display: block;
    animation: introStepFadeIn 0.4s ease forwards;
}

@keyframes introStepFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-text {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.45;
    text-align: center;
    color: var(--verde-texto);
}

.intro-image-wrap,
.intro-media-wrap {
    width: 100%;
    aspect-ratio: 15 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #f3f8f5 0%, #e8f2ec 100%);
    border: 1px solid rgba(29, 76, 67, 0.12);
}

.intro-image-wrap--compact,
.intro-media-wrap--compact {
    aspect-ratio: 4 / 3;
    max-width: 155px;
    min-height: 275px;
    margin: 0 auto;
}

.intro-image-wrap--icon {
    aspect-ratio: auto;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: unset;
    background: transparent;
}

.intro-image-wrap--icon .intro-image {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--verde-texto);
    object-fit: contain;
    padding: 10px;
}

.intro-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-video {
    display: block;
    width: 100%;
    object-fit: cover;
    pointer-events: none;
    background: transparent;
    border: 0;
    outline: none;
}

.intro-video::-webkit-media-controls {
    display: none !important;
}

.intro-video::-webkit-media-controls-enclosure {
    display: none !important;
}

.intro-image:not([src]),
.intro-image[src=""] {
    visibility: hidden;
}

.intro-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.intro-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(29, 76, 67, 0.2);
    transition: background 0.25s ease, transform 0.25s ease;
}

.intro-dot.is-active {
    background: var(--verde-escuro);
    transform: scale(1.15);
}

.intro-btn {
    width: 75%;
    min-height: 36px;
    font-size: 14px;
    letter-spacing: 0.08em;
}

@keyframes gradientBackground {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulseLogo {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeInWelcome {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.btn-expand-template {
    /* position: absolute; */
    /* right: 3px;
    bottom: 3px; */
    z-index: 25;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(26, 60, 52, 0.15);
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    color: var(--verde-texto);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--verde-escuro);
}

.btn-expand-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.btn-expand-template img {
    width: 24px;
    height: 25px;
    pointer-events: none;
}

.template-events-disabled,
.template-events-disabled * {
    pointer-events: none !important;
}

.template-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: #000000bd;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.template-fullscreen-overlay.is-open {
    display: flex;
}

.btn-close-fullscreen {
    position: absolute;
    top: max(16px, env(safe-area-inset-top, 16px));
    left: max(30px, env(safe-area-inset-right, 16px));
    z-index: 3;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #000;
}

#preview-3d-fullscreen-overlay .btn-close-fullscreen {
    right: max(16px, env(safe-area-inset-right, 16px));
    left: unset;
}

.btn-close-fullscreen img {
    width: 18px;
    height: 18px;
    pointer-events: none;
    filter: invert(1);
}

.template-fullscreen-stage {
    width: 135vw;
    /* height: 100%; */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
    touch-action: none;
}

.template-fullscreen-preview {
    transform: translate(var(--fullscreen-pan-x, 0px), var(--fullscreen-pan-y, 0px));
    will-change: transform;
}

.template-fullscreen-preview .template {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    transform: scale(var(--fullscreen-template-scale, 1)) !important;
    transform-origin: center center;
}

.template-fullscreen-preview .ui-rotatable-handle,
.template-fullscreen-preview .ui-resizable-handle,
.template-fullscreen-preview .resizable-r,
.template-fullscreen-preview .selecionado {
    display: none !important;
    outline: none !important;
    box-shadow: none !important;
}

@media screen and (orientation: portrait) {
    .template-fullscreen-overlay.is-open {
        width: 100vh;
        height: 100vw;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%) rotate(90deg);
    }

    .template-fullscreen-overlay.is-open .template-fullscreen-preview {
        transform: rotate(-90deg) translate(var(--fullscreen-pan-x, 0px), var(--fullscreen-pan-y, 0px)) rotate(90deg);
    }

    .template-fullscreen-overlay.is-open .btn-close-fullscreen {
        transform: rotate(-90deg);
    }
}

.preview-3d-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: #000000bd;
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-3d-fullscreen-overlay.is-open {
    display: flex;
}

.preview-3d-fullscreen-stage {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.btn-share-3d-fullscreen {
    position: absolute;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    transform: translateX(-50%);
    z-index: 2;
    min-width: 200px;
    max-height: none;
    padding: 12px 28px;
    font-size: 14px;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#custom-3d-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#custom-3d-container canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

@media screen and (orientation: landscape) {
    .preview-3d-fullscreen-overlay.is-open {
        width: 100vh;
        height: 100vw;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%) rotate(90deg);
    }

    .preview-3d-fullscreen-overlay.is-open .btn-close-fullscreen {
        transform: rotate(-90deg);
    }
}

/* â”€â”€ Sidebar â”€â”€ */
#main-menu {
    background: transparent;
}

.menu-tab {
    flex: 1;
    padding: 3px 0;
    border-radius: var(--pill-radius-btn);
    color: #9aab9a;
    background: #fff;
    border: 1.5px solid rgba(29, 76, 67, 0.14);
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    text-transform: uppercase;
    box-shadow: none;
}

.menu-tab.active {
    color: var(--verde-escuro);
    background: #fff;
    border-color: var(--verde-escuro);
    box-shadow: 0 4px 15px rgba(29, 76, 67, 0.08);
}

/* Borda gradiente IA â€” tab ativa e card do painel */
:root {
    --ai-gradient-border: linear-gradient(
        120deg,
        #fe83a2 0%,
        #f19ab8 12%,
        #d9a8d4 28%,
        #b8a8ef 44%,
        #9293f8 58%,
        #a8a8f5 72%,
        #c49ad4 86%,
        #fe83a2 100%
    );
}

.menu-tab[data-target="panel-ai"] {
    border: 2px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        var(--ai-gradient-border) border-box;
}

.menu-tab[data-target="panel-ai"].active {
    box-shadow: none;
}

#panel-ai .ai-mode-card {
    /* border: 2px solid transparent; */
    /* background:
        linear-gradient(#fff, #fff) padding-box,
        var(--ai-gradient-border) border-box; */
}

.sidebar-panels-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0 20px;
}

.sidebar-panels-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-panels-container::-webkit-scrollbar-thumb {
    background: rgba(29, 76, 67, 0.2);
    border-radius: 4px;
}

.sidebar-footer {
    padding-top: 10px;
    background: var(--background-color);
    border-top: 1px solid var(--borda-clara);
}

/* â”€â”€ Cores e uploads â”€â”€ */
.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    justify-items: center;
    padding: 10px 0;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-circle:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(29, 76, 67, 0.15);
}

.color-scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.color-scroll-container::-webkit-scrollbar {
    display: none;
}

.color-picker-wrapper img {
    display: none;
}

.upload-dashed-box {
    padding: 25px;
    border: 1.5px dashed #000;
    border-radius: 10px;
    background: #fff;
    transition: background 0.3s;
}

.icon-upload i {
    color: var(--verde-escuro);
}

.green-color {
    color: var(--verde-escuro) !important;
}

.black-color {
    color: var(--texto-escuro) !important;
}

/* â”€â”€ FormulÃ¡rios / IA â”€â”€ */
.ai-mode-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 15px;
    /* box-shadow: var(--sombra-verde); */
    /* border-radius: var(--pill-radius-btn); */
    background: #fff;
}

.sidebar-controls.is-expanded .ai-mode-card {
    max-height: 72dvh;
    flex: 1 1 auto;
}

.ai-mode-card-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    padding: 10px;
    overflow-y: scroll;
    /* overscroll-behavior: contain; */
    margin-bottom: 12px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #c8c8c8 rgba(0, 0, 0, 0.08);
}

.ai-mode-card-scroll::-webkit-scrollbar {
    display: unset;
    width: 5px;
    -webkit-appearance: none;
}

.ai-mode-card-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
}

.ai-mode-card-scroll::-webkit-scrollbar-thumb {
    background-color: #c8c8c8;
    border-radius: 999px;
    min-height: 48px;
}

.ai-mode-card-scroll>*+* {
    margin-top: 12px;
}

.ai-simple-box,
.ai-help-form {
    gap: 0;
}

.ai-help-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tema-festa-hint {
    display: block;
    width: 100%;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

.ai-photo-upload-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 92px;
    padding: 12px 15px;
    border: 1.5px dashed var(--texto-escuro);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.ai-feliz-check {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    margin: 0;
    border-radius: 10px;
    background: #f2f4f3;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ai-feliz-check:hover {
    background: #ecefec;
}

.ai-feliz-check-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #111;
    text-align: left;
}

.ai-feliz-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.ai-feliz-check-box {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 2px solid var(--verde-escuro);
    background: #fff;
    box-sizing: border-box;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ai-feliz-check input[type="checkbox"]:checked + .ai-feliz-check-box {
    background-color: var(--verde-escuro);
    border-color: var(--verde-escuro);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-repeat: no-repeat;
    background-position: center;
}

.ai-feliz-check:focus-within {
    outline: 2px solid color-mix(in srgb, var(--verde-escuro) 35%, transparent);
    outline-offset: 2px;
}

.ai-photo-upload-box.is-filled {
    border-color: #b5c7c0;
    background: #fff;
}

.ai-photo-upload-icon {
    flex-shrink: 0;
    font-size: 28px;
    line-height: 1;
}

.ai-photo-upload-preview {
    display: none;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.ai-photo-upload-box.is-filled .ai-photo-upload-icon {
    display: none;
}

.ai-photo-upload-box.is-filled .ai-photo-upload-preview {
    display: block;
}

.ai-photo-upload-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.35;
    color: var(--texto-escuro);
}

.ai-photo-upload-box.is-filled .ai-photo-upload-text {
    text-decoration: underline;
    text-align: center;
}

.ai-textarea-simple {
    width: 100%;
    min-height: 140px;
    height: 100%;
    border: none;
    resize: none;
    outline: none;
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    color: var(--verde-texto);
    background: transparent;
}

.ai-textarea-simple::placeholder {
    color: var(--verde-texto);
    opacity: 0.5;
    font-style: italic;
}

.ai-panel-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
    background: #fff;
}

.ai-panel-actions .btn-accent {
    width: 100%;
    text-align: center;
}

.ai-gallery-container {
    margin-top: 0;
    margin-bottom: 12px;
}

.ai-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ai-gallery-title {
    font-size: 14px;
    color: var(--verde-escuro);
    margin-bottom: 0;
}

.ai-daily-quota {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #F1F1F1;
    border: 1px solid var(--borda-clara);
    font-size: 12px;
    font-weight: 600;
    color: var(--verde-escuro);
    white-space: nowrap;
}

.ai-daily-quota.is-empty {
    background: #fff5f5;
    border-color: rgba(219, 45, 45, 0.2);
    color: #b42318;
}

.ai-daily-quota-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.ai-daily-quota.is-empty .ai-daily-quota-dot {
    background: #ef4444;
}

.ai-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.custom-slider {
    -webkit-appearance: none;
    height: 4px;
    border-radius: 5px;
    outline: none;
    background: rgba(29, 76, 67, 0.2);
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--verde-escuro);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.stickers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sticker-placeholder {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--borda-clara);
    border-radius: 12px;
    background: #fff;
}

.form-group {
    position: relative;
    width: 100%;
}

.custom-input {
    width: 100%;
    height: 30px;
    padding: 8px 15px;
    border: 1px solid var(--verde-texto);
    border-radius: var(--pill-radius);
    outline: none;
    font: inherit;
    font-size: 14px;
    color: var(--verde-texto);
    transition: all 0.3s ease;
}

.custom-input:focus {
    box-shadow: 0 0 5px rgba(26, 60, 52, 0.3);
}

.custom-input::placeholder {
    color: var(--verde-texto);
    opacity: 0.5;
    font-style: italic;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 45px;
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="%231a3c34"/><path d="M7 10l5 5 5-5z" fill="%23ffffff"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 22px;
}

.custom-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.custom-select-field {
    position: relative;
    width: 100%;
}

.text-font-wrapper .custom-select-field {
    flex: 1;
    min-width: 0;
    height: 100%;
}

.custom-select-trigger {
    position: relative;
    width: 100%;
    height: 30px;
    padding: 8px 45px 8px 15px;
    border: 1px solid var(--verde-texto);
    border-radius: var(--pill-radius);
    outline: none;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    font: inherit;
    font-size: 16px;
    color: var(--verde-texto);
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    background-color: var(--verde-escuro);
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 10l5 5 5-5z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 10l5 5 5-5z"/></svg>');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    pointer-events: none;
}

.custom-select-trigger:focus-visible {
    box-shadow: 0 0 5px rgba(26, 60, 52, 0.3);
}

.custom-select-trigger.is-placeholder .custom-select-trigger-text {
    opacity: 0.5;
    font-style: italic;
    color: #000;
}

.text-font-wrapper .custom-select-trigger {
    min-height: 100%;
    padding: 0 45px 0 0;
    border: none;
    background-color: transparent;
    font-size: 16px;
    font-weight: 700;
    color: var(--verde-escuro);
}

.custom-select-trigger-media {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.custom-select-trigger-media:not([hidden]) {
    display: block;
}

.custom-select-trigger-text {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    font-size: 16px;
}

.custom-select-overlay {
    position: fixed;
    inset: 0;
    z-index: 999997;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #000000bd;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.custom-select-overlay.is-open {
    display: flex;
}

.custom-select-dialog {
    width: min(90vw, 420px);
    max-height: min(72vh, 560px);
    border-radius: var(--pill-radius);
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.custom-select-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(26, 60, 52, 0.12);
}

.custom-select-dialog-title {
    font-size: 18px;
    font-weight: 700;
}

#modo-formulario-ajuda .form-group>label[for] {
    font-size: 14px;
}

.custom-select-dialog-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.custom-select-dialog-close img {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.custom-select-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 8px;
}

.custom-select-option-group+.custom-select-option-group {
    margin-top: 6px;
}

.custom-select-option-group-label {
    padding: 10px 12px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #eef3f1;
    border-radius: calc(var(--pill-radius) - 4px);
    position: sticky;
    top: 0;
    z-index: 1;
}

.custom-select-option-group .custom-select-option {
    padding-left: 16px;
}

.custom-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: none;
    border-radius: calc(var(--pill-radius) - 2px);
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
    background: rgba(240, 255, 205, 0.65);
}

.custom-select-option.is-selected {
    background: rgba(217, 254, 131, 0.45);
    font-weight: 700;
}

.custom-select-option-media {
    position: relative;
    width: 100%;
    height: 108px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #eef3f1;
}

@media (max-width: 400px) {
    .custom-select-options[data-variant="media"] {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }

    .custom-select-option-media {
        width: 100%;
        height: 100%;
    }
}

.custom-select-option-label {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    font-size: 16px;
}

.custom-select-option-label.is-emphasis {
    font-weight: 700;
}

.custom-select-outro-section {
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-select-outro-section-label {
    padding: 10px 12px 8px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    background: #eef3f1;
    border-radius: calc(var(--pill-radius) - 4px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.72;
    pointer-events: none;
    user-select: none;
    margin-bottom: 8px;
}

.custom-select-outro-input-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 0px 12px 0px;
}

.custom-select-options[data-variant="media"] .custom-select-outro-section {
    grid-column: 1 / -1;
    margin-top: 0;
    margin-bottom: 10px;
    padding-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.custom-select-options[data-variant="media"] .custom-select-outro-section-label {
    padding: 0 4px 8px;
}

.custom-select-options[data-variant="media"] .custom-select-outro-input-wrap {
    grid-column: unset;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding: 0 4px 4px;
    margin-top: 0;
    border-top: none;
}

.custom-select-options[data-variant="media"] .custom-select-outro-section {
    display: none;
}

.custom-select-outro-input {
    flex: 1 1 auto;
    min-width: 0;
    max-height: 40px;
    width: 100%;
}

.custom-select-outro-confirm {
    flex: 0 0 auto;
    width: auto;
    min-width: 158px;
    max-height: 30px;
    white-space: nowrap;
    margin: 0 auto;
    margin-top: 10px;
}

.custom-select-options[data-variant="media"] .custom-select-outro-confirm {
    flex: 0 0 auto;
    width: auto;
    min-width: 108px;
    padding: 0 16px;
    white-space: nowrap;
}

.custom-select-options[data-variant="font"] .custom-select-option-label {
    font-size: 16px;
}

.custom-select-options[data-variant="media"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 5px;
    justify-content: center;
}

.custom-select-options[data-variant="media"] .custom-select-option::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    backdrop-filter: brightness(0.85);
    z-index: 1;
    border-radius: 10px;
}

.custom-select-options[data-variant="media"] .custom-select-option {
    padding: 0;
    position: relative;
    align-items: end;
}

.custom-select-options[data-variant="media"] .custom-select-option span.custom-select-option-label {
    max-width: 100%;
    position: absolute;
    font-size: 16px;
    padding: 6px;
    line-height: 110%;
    font-weight: bold;
    color: #fff;
    text-shadow: -1px -1px 0px #0000008c, 1px -1px 2px #0000008c, -1px 1px 2px #0000008c, 1px 1px 2px #0000008c;
    z-index: 2;
}

.input-with-button .custom-input {
    padding-right: 120px;
}

.btn-inside-input {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: var(--verde-texto);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-inside-input:hover {
    background: var(--verde-escuro);
    filter: brightness(0.95);
}

.form-actions,
.medidor-actions {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.medidor-checkbox-ui {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--verde);
    background: #fff;
}

.medidor-checkbox-label {
    position: relative;
    width: 24px;
    height: 24px;
}

.medidor-checkbox-label input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.medidor-checkbox-label input:checked + .medidor-checkbox-ui {
    background: var(--verde);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
}

.medidor-toggle-bar {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #edf1f0;
    gap: 12px;
    cursor: pointer;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* â”€â”€ BotÃµes â”€â”€ */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 16px;
    border: 1px solid var(--verde-escuro);
    border-radius: var(--pill-radius-btn);
    background: #fff;
    color: var(--verde-escuro);
    font-size: 16px;
    max-height: 30px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-outline:hover {
    background: #f0f5f3;
}

.btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    border-radius: var(--pill-radius-btn);
    background: var(--verde-escuro);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 16px;
    max-height: 30px;
    padding: 6px 16px;
}

.btn-solid:hover {
    opacity: 0.9;
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 16px;
    border-radius: var(--pill-radius-btn);
    background-color: var(--verde-escuro);
    border: unset;
    color: #ffffff;
    font-size: 16px;
    max-height: 30px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: filter 0.2s, opacity 0.2s;
}

.btn-accent:hover {
    filter: brightness(0.95);
}

.btn-accent:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-trigger-ia.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-accent-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #fff;
}

.btn-accent-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.btn-accent-icon svg path[fill="currentColor"] {
    fill: #fff;
}

.btn-sm {
    padding: 5px;
    font-size: 15px;
    letter-spacing: 1px;
    border-radius: var(--pill-radius-btn);
}

.btn-panel {
    padding: 10px 15px;
    font-size: 16px;
    border-radius: var(--pill-radius-btn);
    max-height: 30px;
}

.btn-grow-1 {
    flex: 1;
}

.btn-grow-2 {
    flex: 2;
}

.text-edit-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ── Controles Imagens / Texto (não aplica na aba IA) ── */
#panel-image-edit,
#panel-texts .text-edit-controls {
    --panel-control-border: #000;
    --panel-control-text: #000;
}

#panel-image-edit .image-edit-controls {
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

#panel-image-edit .btn-outline.btn-panel,
#panel-texts .text-edit-controls .btn-outline.btn-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    padding: 0 14px;
    border: 1px solid var(--panel-control-border);
    border-radius: 999px;
    background: #fff;
    color: var(--panel-control-text);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    gap: 8px;
    box-sizing: border-box;
}

#panel-image-edit .btn-outline.btn-panel:hover,
#panel-texts .text-edit-controls .btn-outline.btn-panel:hover {
    background: #f5f5f5;
}

#panel-image-edit .btn-panel-icon,
#panel-texts .text-edit-controls .btn-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

#panel-image-edit .btn-panel-icon:empty,
#panel-texts .text-edit-controls .btn-panel-icon:empty {
    display: none;
}

#panel-image-edit .btn-panel-icon img,
#panel-image-edit .btn-panel-icon svg,
#panel-texts .text-edit-controls .btn-panel-icon img,
#panel-texts .text-edit-controls .btn-panel-icon svg {
    /* width: 18px;
    height: 18px; */
    display: block;
}

#panel-image-edit .panel-control-label,
#panel-texts .text-edit-controls .panel-control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--panel-control-text);
}

#panel-texts .text-edit-controls .slider-side-label {
    min-width: 65px;
    margin-right: 15px;
    margin-bottom: 0;
    justify-content: flex-start;
}

#panel-image-edit .custom-slider,
#panel-texts .text-edit-controls .custom-slider {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: #d9d9d9;
}

#panel-image-edit .custom-slider::-webkit-slider-thumb,
#panel-texts .text-edit-controls .custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    border: none;
    box-shadow: none;
    cursor: pointer;
}

#panel-image-edit .custom-slider::-moz-range-thumb,
#panel-texts .text-edit-controls .custom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    border: none;
    box-shadow: none;
    cursor: pointer;
}

#panel-image-edit .custom-slider::-moz-range-track,
#panel-texts .text-edit-controls .custom-slider::-moz-range-track {
    height: 3px;
    border-radius: 999px;
    background: #d9d9d9;
}

#panel-texts .text-edit-controls .text-font-wrapper {
    height: 30px;
    min-height: 30px;
    padding-left: 14px;
    border: 1px solid #000;
    border-radius: 999px;
    background: #fff;
}

#panel-texts .text-edit-controls .text-font-label {
    margin-right: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: #000;
}

#panel-texts .text-edit-controls .text-font-wrapper .custom-select-trigger {
    color: #000;
    font-size: 14px;
    font-weight: 700;
}

#panel-texts .text-edit-controls .text-font-wrapper .custom-select-trigger::after {
    width: 18px;
    height: 18px;
    right: 10px;
    background-color: #000;
}

.text-font-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 42px;
    padding-left: 15px;
    border: 1px solid var(--verde-escuro);
    border-radius: var(--pill-radius);
    background: #fff;
    overflow: hidden;
}

.text-font-label {
    flex-shrink: 0;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--verde-escuro);
}

.text-font-select {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 45px 0 0;
    border: none;
    outline: none;
    background-color: #fff;
    font-size: 16px;
    font-weight: 700;
    color: var(--verde-escuro);
    cursor: pointer;
}

.btn-cart {
    padding: 5px;
    border: none;
    border-radius: var(--pill-radius-btn);
    background: var(--verde);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn-cart:hover {
    background: var(--verde-hover);
    transform: translateY(-2px);
}

/* â”€â”€ Canvas / template â”€â”€ */
.template {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    margin: 0 !important;
    padding: 90px 85px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    transform: translate(-50%, -50%) scale(var(--template-scale)) !important;
    transform-origin: center;
}

.template .print-area {
    width: 100%;
    height: 100%;
    outline: none !important;
}

div#html2canvas {
    width: 2026px !important;
    overflow: hidden;
}

div#html2canvas .template {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    transform-origin: top left !important;
    margin: 0 !important;
    width: 2026px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: #fff;
}

.measure-200ml,
.measure-300ml,
.measure-400ml,
.measure-550ml {
    width: 2026px;
    outline: none !important;
}

.measure-200ml {
    height: 932px;
}

.measure-300ml {
    height: 1187px;
}

.measure-400ml {
    height: 1385px;
}

.measure-550ml {
    height: 1412px;
}

#medidor {
    z-index: 99 !important;
    cursor: move;
}

/* â”€â”€ Elementos editÃ¡veis â”€â”€ */
.elemento {
    touch-action: none !important;
}

.elemento.text {
    width: max-content !important;
    height: max-content !important;
    white-space: nowrap !important;
    font-family: 'Roboto';
}

div.selecionado {
    outline: 3px solid var(--verde);
    box-shadow: 0 0 20px rgba(146, 147, 248, 0.4);
    border-radius: 10px;
}

.elemento:not(.selecionado) .ui-rotatable-handle,
.elemento:not(.selecionado) .ui-resizable-se {
    display: none !important;
}

.elemento-ia .ui-rotatable-handle,
.elemento-ia .ui-resizable-handle,
.elemento-ia .resizable-r {
    display: none !important;
}

.elemento-ia.selecionado {
    cursor: default;
}

.ui-rotatable-handle {
    position: absolute !important;
    bottom: -220px !important;
    left: 50% !important;
    width: 200px !important;
    height: 200px !important;
    border-radius: 50% !important;
    background: #E8ECEB url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231D4C43" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>') center/55% no-repeat !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    transform: translateX(-50%) !important;
    cursor: pointer !important;
    z-index: 9999 !important;
}

.ui-rotatable-handle:before {
    display: none;
}

.ui-resizable-handle.ui-resizable-se {
    display: block !important;
    position: absolute;
    bottom: -100px !important;
    right: -100px !important;
    width: 200px !important;
    height: 200px !important;
    border-radius: 50% !important;
    background: #E8ECEB url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231D4C43" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="15" y1="3" x2="21" y2="3"></line><line x1="21" y1="3" x2="21" y2="9"></line><line x1="9" y1="21" x2="3" y2="21"></line><line x1="3" y1="21" x2="3" y2="15"></line><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>') center/50% no-repeat !important;
    cursor: se-resize !important;
    z-index: 9999 !important;
    transform: rotate(90deg);
}

/* â”€â”€ BotÃ£o copo 3D e histÃ³rico â”€â”€ */
.canvas-workspace .cup-3d-generate {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    transform: translate(-100%, -100%);
    z-index: 120;
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    margin-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: var(--verde-escuro);
    box-shadow: var(--sombra-verde);
    white-space: nowrap;
    transition: box-shadow 0.4s ease;
}

.canvas-workspace .cup-3d-generate.is-ready:not(.is-dismissed) {
    background: linear-gradient(270deg, var(--verde-escuro), #D9FE83, #2d6b5f, #b8e86a, var(--verde-escuro));
    background-size: 400% 400%;
    animation: cup3dWave 4s ease infinite, cup3dGlow 2.5s ease-in-out infinite;
}

@keyframes cup3dWave {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes cup3dGlow {
    0%, 100% { box-shadow: 0 4px 16px rgba(217, 254, 131, 0.35); }
    50% { box-shadow: 0 4px 24px rgba(217, 254, 131, 0.65), 0 0 12px rgba(217, 254, 131, 0.35); }
}

@media (prefers-reduced-motion: reduce) {
    .canvas-workspace .cup-3d-generate.is-ready:not(.is-dismissed) {
        animation: none;
        background: var(--verde-escuro);
        box-shadow: 0 0 0 3px var(--verde), var(--sombra-verde);
    }
}

.btn-copo-3d {
    height: 44px;
    background-color: var(--verde-escuro);
    padding: 2px 11px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    line-height: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
    max-width: 125px;
    text-align: start;
}

.history-controls-container {
    position: absolute;
    right: 7px;
    bottom: 31px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn-circle {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(26, 60, 52, 0.15);
    border-radius: 50%;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--verde-escuro);
}

.action-btn-circle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.action-btn-circle:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* â”€â”€ Overlay de digitaÃ§Ã£o â”€â”€ */
.typing-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    background: rgba(29, 76, 67, 0.9);
    backdrop-filter: blur(5px);
}

.typing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.typing-header .btn-crop-float {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#typing-input {
    flex-grow: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: #fff;
    font: bold 32px 'Roboto', sans-serif;
    text-align: center;
}

#typing-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* â”€â”€ Elementos ocultos / terceiros â”€â”€ */
.drag-handle,
.bottom-sheet,
.floating-3d-btn-container {
    display: none !important;
}

.rdstation-popup-position-bottom_right.floating-button.floating-button--close,
.mobile-pop-up-session,
.nav-bar-mobile {
    display: none;
}

/* â”€â”€ Galeria IA â”€â”€ */
.ai-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ai-images .image {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #b5c7c0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-images .image:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-card);
}

.ai-images .ai-img {
    width: 100%;
    height: 110px;
    display: block;
    object-fit: cover;
}

.ai-images .excluir-ai {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s;
}

.ai-images .excluir-ai:hover {
    background: #ff4d4d;
}

.ai-images .excluir-ai svg {
    width: 12px;
    height: 12px;
    fill: var(--verde-texto);
    transition: fill 0.2s;
}

.ai-images .excluir-ai:hover svg {
    fill: #fff;
}

.ai-images .rmvbg {
    display: none;
    width: 100%;
    margin-top: auto;
    padding: 8px 0;
    background: var(--verde-texto);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.ai-images .rmvbg:hover {
    background: #c5ea83;
    color: var(--verde-texto);
}

/* â”€â”€ AprovaÃ§Ã£o â”€â”€ */
.sidebar-controls.approval-open .sidebar-panels-container {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0px;
}

.sidebar-controls.approval-open #approval-screen {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.approval-screen {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
}

.approval-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 20px 16px;
    overflow-y: auto;
    margin-bottom: 0;
    border-bottom: none;
    border-radius: 12px;
}

.approval-back-btn {
    position: sticky;
    top: 0px;
    left: 0px;
    z-index: 2;
    width: 38px;
    min-height: 38px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 4px 12px rgba(29, 76, 67, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.approval-back-btn:active {
    transform: scale(0.96);
}

.approval-scroll-content {
    flex: 1 1 auto;
    line-height: 1.4;
    padding-right: 4px;
}

.approval-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding: 15px;
    padding-bottom: 0px;
    border-top: 1px solid var(--borda-clara);
}

.approval-actions .btn-outline,
.approval-actions .btn-solid {
    width: 100%;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    padding: 0 16px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    gap: 8px;
    box-sizing: border-box;
}

.approval-actions .btn-solid {
    background-color: var(--verde);
    border: none;
    color: #fff;
}

.approval-actions .btn-outline {
    border-color: #1C1B1F;
    color: #1C1B1F;
}

.approval-action-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
    pointer-events: none;
}

/* .app-canvas-area.approval-mode-lock .history-controls-container,
.app-canvas-area.approval-mode-lock #btn-expand-template {
    pointer-events: none;
} */

.app-canvas-area.approval-mode-lock .elemento,
.app-canvas-area.approval-mode-lock .template,
.app-canvas-area.approval-mode-lock .template * {
    pointer-events: none !important;
    user-select: none;
}

.custom-chk {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    outline: none;
    background: #e2e5e4;
    cursor: pointer;
}

.custom-chk:checked {
    background: var(--verde-texto);
}

.custom-chk:checked::after {
    content: '\2714';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
}

#btn-aprovar-arte:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* â”€â”€ Crop modal â”€â”€ */
.crop-modal-container {
    display: none;
    position: fixed;
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    z-index: 999999;
    background: #000;
}

.crop-floating-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000000;
    display: flex;
    gap: 10px;
}

.btn-crop-float {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    padding: 0 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.btn-crop-float:disabled,
.btn-crop-float-action:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.btn-crop-cancel {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-crop-cancel:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.8);
}

.btn-crop-confirm {
    border: unset;
    background: var(--verde-escuro);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.crop-work-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.crop-target-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.crop-shape-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    right: auto;
    z-index: 100;
    width: auto;
    max-width: 220px;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    padding: 5px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
}

.btn-shape {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-shape-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
    fill: currentColor;
    overflow: visible;
}

.btn-shape-icon path {
    shape-rendering: geometricPrecision;
}

.btn-shape.active {
    background: #fff;
    color: var(--verde-escuro);
}

.cropper-view-box.is-circle,
.cropper-face.is-circle {
    border-radius: 50% !important;
}

.cropper-view-box.is-star,
.cropper-face.is-star {
    border-radius: 0 !important;
    clip-path: url(#crop-star-clip);
    -webkit-clip-path: url(#crop-star-clip);
}

.cropper-view-box.is-heart,
.cropper-face.is-heart {
    border-radius: 0 !important;
    clip-path: url(#crop-heart-clip);
    -webkit-clip-path: url(#crop-heart-clip);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#crop-heart-path {
    shape-rendering: geometricPrecision;
}

/* â”€â”€ Medidor â”€â”€ */
.medidor-info-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.btn-regua-outline:hover {
    background: rgba(29, 76, 67, 0.05);
}

/* â”€â”€ SweetAlert â”€â”€ */
.swal2-container {
    z-index: 99999 !important;
}

.swal-mobile-ajuste {
    max-height: 90dvh !important;
    overflow-y: auto !important;
    padding-bottom: 1em !important;
}

.swal-mobile-ajuste .swal2-icon {
    transform: scale(0.7);
    margin: 10px 0 5px !important;
}


/* â”€â”€ Jornada de ediÃ§Ã£o de imagem IA (tela cheia) â”€â”€ */
.ai-edit-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: #f7fcf9;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.ai-edit-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ai-edit-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.ai-edit-modal-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding:
        max(14px, env(safe-area-inset-top, 14px))
        max(18px, env(safe-area-inset-right, 18px))
        max(18px, env(safe-area-inset-bottom, 18px))
        max(18px, env(safe-area-inset-left, 18px));
    background: #f7fcf9;
}

.ai-edit-close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 14px));
    right: max(14px, env(safe-area-inset-right, 14px));
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255);
    border: 1px solid #000;
    cursor: pointer;
}

.ai-edit-close img {
    width: 14px;
    height: 14px;
    pointer-events: none;
    filter: invert(1);
}

.ai-edit-header {
    flex-shrink: 0;
    padding-top: 0px;
    padding-right: 42px;
}

.ai-edit-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--verde);
    color: var(--verde-escuro);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ai-edit-title {
    margin: 10px 0 6px;
    font-size: 18px;
    font-weight: bold;
    color: var(--verde-escuro);
}

.ai-edit-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--texto-cinza);
}

.ai-edit-quota {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #F1F1F1;
    border: 1px solid var(--borda-clara);
    font-size: 13px;
    font-weight: bold;
    color: var(--verde-escuro);
}

.ai-edit-quota.is-empty {
    background: #fff5f5;
    border-color: rgba(219, 45, 45, 0.2);
    color: #b42318;
}

.ai-edit-quota-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.ai-edit-quota.is-empty .ai-edit-quota-dot {
    background: #ef4444;
}

.ai-edit-step {
    display: none;
    width: 100%;
}

.ai-edit-step.is-active {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: 0;
}

.ai-edit-preview-wrap {
    width: 100%;
    min-height: 180px;
    margin-bottom: 14px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #f3f8f5 0%, #e8f2ec 100%);
    border: 1px solid rgba(29, 76, 67, 0.12);
}

.ai-edit-preview-wrap--compact {
    flex: 0 0 auto;
    min-height: 0;
    max-height: min(270px);
}

.ai-edit-preview {
    display: block;
    width: 100%;
    object-fit: cover;
}

.ai-edit-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 8px;
    padding: 16px 0;
    text-align: center;
}

.ai-edit-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(29, 76, 67, 0.12);
    border-top-color: var(--verde-escuro);
    border-radius: 50%;
    animation: aiEditSpin 0.8s linear infinite;
}

@keyframes aiEditSpin {
    to { transform: rotate(360deg); }
}

.ai-edit-loading-text {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--verde-escuro);
}

.ai-edit-loading-hint {
    margin: 0;
    font-size: 13px;
    color: var(--texto-cinza);
}

.ai-edit-label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--verde-escuro);
}

.ai-edit-textarea {
    width: 100%;
    min-height: 110px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(29, 76, 67, 0.18);
    border-radius: 14px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.45;
    color: var(--texto-escuro);
    background: #fff;
}

.ai-edit-textarea:focus {
    outline: none;
    border-color: var(--verde-escuro);
    box-shadow: 0 0 0 3px rgba(29, 76, 67, 0.1);
}

.ai-edit-textarea::placeholder {
    color: rgba(29, 76, 67, 0.55);
    font-style: italic;
}

.ai-edit-primary-btn,
.ai-edit-secondary-btn {
    width: 100%;
    min-height: 30px;
    font-weight: bold;
    margin: 0 auto;
}

.ai-edit-result-label {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: bold;
    color: var(--verde-escuro);
}

.ai-edit-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    max-width: 290px;
    margin: 0 auto;
}

body.ai-edit-open {
    overflow: hidden !important;
}

body.ai-edit-open .app-wrapper {
    visibility: hidden;
}
