/* Teaser.me — design tokens e polish global Radzen */

:root {
    /* Marca (cores existentes unificadas) */
    --rz-primary: #0ea47a;
    --rz-primary-light: #66cc99;
    --rz-primary-lighter: rgba(14, 164, 122, 0.12);
    --rz-primary-dark: #296e5a;
    --rz-primary-darker: #1f4036;
    --rz-secondary: #333333;
    --rz-secondary-light: #666666;
    --rz-secondary-lighter: rgba(51, 51, 51, 0.12);
    --rz-secondary-dark: #222222;
    --rz-secondary-darker: #111111;
    --rz-body-font-size: 0.88rem;
    --rz-input-height: 2.2rem;

    /* Aliases semânticos Teaser */
    --tme-brand: var(--rz-primary);
    --tme-brand-light: var(--rz-primary-light);
    --tme-brand-muted: var(--rz-primary-lighter);
    --tme-brand-dark: var(--rz-primary-dark);
    --tme-brand-darker: var(--rz-primary-darker);
    --tme-surface: var(--rz-base-100, #fff);
    --tme-surface-muted: var(--rz-base-200, #f4f6f9);
    --tme-border: var(--rz-base-300, #e8eaed);
    --tme-radius-sm: 6px;
    --tme-radius-md: 8px;
    --tme-radius-lg: 12px;
    --tme-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --tme-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.07);
    --tme-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --tme-transition: 0.15s ease;

    /* Form density (settings / dialogs / builder) */
    --tme-form-section-gap: 0.75rem;
    --tme-form-field-gap: 0.5rem;
    --tme-form-label-gap: 0.25rem;
    --tme-form-section-pad: 0.65rem 0.75rem 0.75rem;
    --tme-form-section-header-pad: 0.4rem 0;
    --tme-form-actions-gap: 0.5rem;
    --tme-form-row-gap: 0.5rem;
}

/* —— Tipografia e corpo —— */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* —— Sidebar / layout principal —— */
.tme-main-layout .rz-sidebar {
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
    border-right: 1px solid var(--tme-border);
}

.tme-main-layout .rz-panel-menu-item-link {
    position: relative;
    border-radius: var(--tme-radius-sm);
    margin: 0 0.35rem;
    transition: background-color var(--tme-transition), color var(--tme-transition);
}

.tme-main-layout .rz-panel-menu-item-link:hover {
    background-color: var(--tme-brand-muted);
}

.tme-main-layout .rz-panel-menu-item-link.rz-state-selected,
.tme-main-layout .rz-panel-menu-item-link.rz-state-active {
    background-color: var(--tme-brand-muted);
    color: var(--tme-brand-dark);
    font-weight: 600;
}

.tme-main-layout .rz-panel-menu-item-link.rz-state-selected::before,
.tme-main-layout .rz-panel-menu-item-link.rz-state-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--tme-brand);
}

.tme-main-layout .rz-panel-menu .rz-navigation-item-icon {
    font-size: 1.35rem;
}

.tme-login-footer {
    width: 100%;
    margin-top: 20px;
    opacity: 0.85;
}

.tme-main-layout {
    --tme-sidebar-width-full: clamp(120px, 16vw, 170px);
    --tme-sidebar-width-compact: 3.75rem;
}

/* Radzen v11: sem header/footer — sidebar + body em linha única (100dvh) */
.tme-main-layout.rz-layout {
    grid-template-areas: "rz-sidebar rz-body";
    grid-template-rows: 1fr;
    grid-template-columns: auto 1fr;
}

.tme-main-layout .rz-body {
    background: linear-gradient(180deg, var(--rz-base-50, #fafbfc) 0%, var(--rz-base-100, #fff) 120px);
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    --rz-layout-body-padding: 0;
    overflow-y: auto;
}

.tme-main-layout .tme-body-row {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

.tme-main-layout .tme-body-row > [class*="col-"] {
    width: 100%;
    min-height: 0;
    align-self: stretch;
}

.tme-main-layout .tme-sidebar {
    width: var(--tme-sidebar-width-full) !important;
    transition: width 0.2s ease;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tme-main-layout .tme-sidebar-inner {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tme-sidebar-brand-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.35rem 0.65rem;
    border-bottom: var(--rz-panel-menu-item-border);
}

.tme-main-layout--wide-content .tme-sidebar-brand-row--menu-expanded {
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.9rem 0.5rem 0.75rem;
}

.tme-main-layout--wide-content .tme-sidebar-brand-row--menu-expanded .tme-sidebar-brand-full {
    align-self: center;
    width: min(168px, calc(100% - 0.25rem));
}

.tme-main-layout--wide-content .tme-sidebar-brand-row--menu-expanded .tme-sidebar-brand-mini {
    display: none !important;
}

.tme-main-layout--wide-content .tme-sidebar-brand-row--menu-expanded .tme-sidebar-toggle-inline {
    align-self: stretch;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    margin-top: 0.1rem;
    position: relative;
    z-index: 2;
}

.tme-sidebar-brand-full {
    width: min(168px, 100%);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.tme-sidebar-brand-mini {
    display: none;
    width: 2.5rem;
    height: auto;
    max-height: 2.5rem;
    object-fit: contain;
}

.tme-sidebar-toggle-inline {
    flex-shrink: 0;
    min-width: 2.25rem !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0 !important;
    border: 1px solid var(--tme-border) !important;
    border-radius: 10px !important;
    background: var(--tme-surface, #fff) !important;
    box-shadow: none !important;
}

.tme-sidebar-toggle-inline--expanded {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    height: 2.5rem !important;
    border-radius: var(--rz-border-radius, 4px) !important;
    justify-content: center;
}

.tme-sidebar-toggle-inline--expanded .rz-button-icon,
.tme-sidebar-toggle-inline--expanded .rzi {
    font-size: 1.25rem !important;
}

.tme-main-layout .tme-app-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.tme-main-layout--sidebar-compact .tme-sidebar {
    width: var(--tme-sidebar-width-compact) !important;
}

.tme-main-layout--sidebar-compact .tme-sidebar-brand-full {
    display: none !important;
}

.tme-main-layout--sidebar-compact .tme-sidebar-brand-mini {
    display: block;
}

.tme-main-layout--sidebar-compact .tme-sidebar .rz-navigation-item-text {
    display: none !important;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-wrapper {
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
    overflow: visible;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link {
    width: 2.35rem;
    height: 2.35rem;
    min-height: 2.35rem;
    margin: 0.1rem auto;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-sizing: border-box;
    background: transparent !important;
    background-size: auto !important;
    overflow: hidden;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link:hover,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link:hover {
    background-color: var(--tme-brand-muted) !important;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link.rz-state-selected,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link.rz-state-active,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link.rz-state-selected,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link.rz-state-active {
    background-color: var(--tme-brand-muted) !important;
    color: var(--tme-brand-dark);
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link:active,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link:active {
    background: var(--tme-brand-muted) !important;
    background-size: 100% !important;
    transition: none;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link.rz-state-selected::before,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-panel-menu-item-link.rz-state-active::before,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link.rz-state-selected::before,
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-link.rz-state-active::before {
    display: none;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-icon {
    margin: 0 !important;
    font-size: 1.2rem;
}

.tme-main-layout--sidebar-compact .tme-sidebar-footer {
    display: none !important;
}

/* Submenus aninhados — sidebar expandido (texto visível) */
.tme-main-layout:not(.tme-main-layout--sidebar-compact) .tme-app-menu .rz-navigation-menu {
    padding-left: 0.35rem;
}

.tme-main-layout:not(.tme-main-layout--sidebar-compact) .tme-app-menu .rz-navigation-item-wrapper .rz-navigation-item-wrapper {
    margin-left: 0.25rem;
}

.tme-main-layout:not(.tme-main-layout--sidebar-compact) .tme-app-menu .rz-navigation-item-wrapper .rz-navigation-item-wrapper .rz-panel-menu-item-link,
.tme-main-layout:not(.tme-main-layout--sidebar-compact) .tme-app-menu .rz-navigation-item-wrapper .rz-navigation-item-wrapper .rz-navigation-item-link {
    font-size: 0.8125rem;
}

/* Sidebar compacto: submenus só no flyout lateral (hover), nunca expandindo para baixo */
.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-menu {
    display: none !important;
}

.tme-main-layout--sidebar-compact .tme-app-menu .rz-navigation-item-icon-children {
    display: none !important;
}

.tme-submenu-flyout {
    display: none;
    position: fixed;
    z-index: 10001;
    min-width: 12.5rem;
    max-width: 17rem;
    max-height: min(72vh, 34rem);
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--rz-base-100, #fff);
    border: 1px solid var(--rz-border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    padding: 0;
}

.tme-submenu-flyout-inner {
    display: flex;
    flex-direction: column;
}

.tme-submenu-flyout-heading {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rz-text-secondary-color, #616161);
    background: var(--rz-base-200, #f0f0f0);
    border-top: 1px solid var(--rz-border, rgba(0, 0, 0, 0.1));
}

.tme-submenu-flyout-heading:first-child {
    border-top: none;
    border-radius: 8px 8px 0 0;
}

.tme-submenu-flyout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--rz-text-color, inherit);
    text-decoration: none;
    font-size: 0.8125rem;
    line-height: 1.25;
    white-space: nowrap;
}

.tme-submenu-flyout-link + .tme-submenu-flyout-link {
    border-top: 1px solid var(--rz-border, rgba(0, 0, 0, 0.08));
}

.tme-submenu-flyout-heading + .tme-submenu-flyout-link {
    border-top: none;
}

.tme-submenu-flyout-link:hover {
    background: var(--tme-brand-muted, rgba(0, 0, 0, 0.06));
    color: var(--tme-brand-dark, inherit);
}

.tme-submenu-flyout-link .rz-navigation-item-icon {
    font-size: 1.05rem !important;
    margin: 0 !important;
    opacity: 0.85;
}

.tme-compact-menu-tooltip {
    display: none;
    position: fixed;
    z-index: 10000;
    max-width: 14rem;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    background: var(--rz-base-900, #212121);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.tme-main-layout--wide-content .rz-body {
    overflow: hidden;
}

/* Sidebar compacto mas scroll normal de página (ex: /insights) */
.tme-main-layout--compact-sidebar .rz-body {
    overflow-y: auto;
}

.tme-main-layout--wide-content .tme-body-row {
    height: 100%;
    min-height: 0;
    padding: 0.35rem;
    box-sizing: border-box;
}

.tme-main-layout--wide-content .tme-body-row > [class*="col-"] {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* —— Login —— */
.tme-login-card {
    border-radius: var(--tme-radius-lg) !important;
    box-shadow: var(--tme-shadow-lg) !important;
}

.tme-login-brand-col {
    background-image: radial-gradient(circle at 4rem 4rem, var(--rz-primary) 0%, var(--rz-primary-darker) 80%) !important;
}

/* —— Autenticação (login / criar conta) —— */
.tme-auth-panel {
    max-width: 380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tme-auth-title {
    margin-bottom: 0 !important;
}

.tme-auth-subtitle {
    color: var(--rz-text-secondary-color, #666);
    margin-bottom: 0.5rem !important;
}

.tme-auth-social {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tme-auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    height: 2.6rem;
    padding: 0 1rem;
    border: 1px solid var(--tme-border);
    border-radius: var(--tme-radius-sm);
    background: var(--tme-surface, #fff);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rz-text-color, #333);
    cursor: pointer;
    transition: background-color var(--tme-transition), box-shadow var(--tme-transition), border-color var(--tme-transition);
}

.tme-auth-social-btn:hover {
    background-color: var(--tme-surface-muted);
    border-color: var(--rz-base-400, #d5d9de);
    box-shadow: var(--tme-shadow-sm);
}

.tme-auth-social-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}

.tme-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--rz-text-secondary-color, #888);
    font-size: 0.8rem;
    text-transform: lowercase;
    margin: 0.25rem 0;
}

.tme-auth-divider::before,
.tme-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--tme-border);
}

.tme-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}

.tme-auth-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rz-text-color, #333);
}

.tme-auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tme-auth-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tme-brand);
    text-decoration: none;
    cursor: pointer;
}

.tme-auth-link:hover {
    color: var(--tme-brand-dark);
    text-decoration: underline;
}

.tme-auth-submit {
    width: 100%;
    height: 2.6rem;
}

.tme-phone-input {
    --tme-phone-height: var(--rz-input-height, 2.2rem);
    display: flex;
    align-items: center;
    width: 100%;
    height: var(--tme-phone-height);
    border: var(--rz-input-border, 1px solid #d5d9de) !important;
    border-radius: var(--rz-input-border-radius, var(--rz-border-radius, 4px));
    background: var(--rz-input-background-color, #fff);
    overflow: hidden;
    box-sizing: border-box;
}

.tme-phone-input:focus-within {
    border-color: var(--tme-brand, #0ea47a) !important;
    box-shadow: 0 0 0 1px var(--tme-brand, #0ea47a);
}

.tme-phone-input .tme-phone-ddi,
.tme-phone-input .tme-phone-ddi.rz-dropdown {
    width: 7.25rem;
    min-width: 7.25rem;
    height: 100% !important;
    min-height: 100% !important;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    border-right: var(--rz-input-border, 1px solid #d5d9de) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--tme-surface-muted, #f8faf9) !important;
}

.tme-phone-input .tme-phone-ddi .rz-dropdown-wrapper,
.tme-phone-input .tme-phone-ddi .rz-inputtext {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    width: 100%;
}

.tme-phone-input .tme-phone-ddi .rz-dropdown-label {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 0.2rem 0 0.45rem !important;
    margin: 0 !important;
    font-size: 0.9rem;
    line-height: 1 !important;
}

.tme-phone-input .tme-phone-ddi .rz-dropdown-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 1.5rem;
    padding: 0 !important;
    margin: 0 !important;
}

.tme-phone-input .tme-phone-ddi .rz-dropdown-trigger-icon {
    margin: 0 !important;
    line-height: 1 !important;
}

.tme-phone-ddi-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
    height: 100%;
}

.tme-phone-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    display: block;
}

.tme-phone-input .tme-phone-number,
.tme-phone-input .tme-phone-number.rz-textbox {
    flex: 1;
    min-width: 0;
    height: 100% !important;
    min-height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: var(--tme-phone-height) !important;
    display: flex !important;
    align-items: center !important;
}

.tme-auth-alt {
    text-align: center;
    font-size: 0.85rem;
    color: var(--rz-text-secondary-color, #666);
    margin-top: 0.5rem;
}

.tme-auth-email-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tme-border);
    border-radius: var(--tme-radius-sm);
    background: var(--tme-surface-muted);
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
}

.tme-auth-email-chip-value {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* —— Componentes Radzen (polish global) —— */
.rz-card {
    border-radius: var(--tme-radius-md);
    border: 1px solid var(--tme-border);
    box-shadow: var(--tme-shadow-sm);
}

/* Cards interativos de listagem — hover só fora de ferramentas full-screen */
.tme-page-shell .rz-card {
    transition: box-shadow var(--tme-transition);
}

.tme-page-shell .rz-card:hover {
    box-shadow: var(--tme-shadow-md);
}

.rz-fieldset {
    border-radius: var(--tme-radius-md);
    border-color: var(--tme-border);
}

.rz-button {
    border-radius: var(--tme-radius-sm);
    transition: filter var(--tme-transition), box-shadow var(--tme-transition);
}

.rz-button.rz-button-md:not(.rz-state-disabled):hover {
    filter: brightness(1.04);
}

.rz-textbox,
.rz-dropdown,
.rz-numeric,
.rz-datepicker,
.rz-multiselect,
.rz-textarea {
    border-radius: var(--tme-radius-sm) !important;
}

.rz-tabview-nav-link {
    border-radius: var(--tme-radius-sm) var(--tme-radius-sm) 0 0;
    transition: color var(--tme-transition), background-color var(--tme-transition);
}

.rz-dialog {
    border-radius: var(--tme-radius-lg) !important;
    box-shadow: var(--tme-shadow-lg) !important;
    overflow: hidden;
}

.rz-dialog .rz-dialog-content {
    overflow-y: auto;
    overflow-x: hidden;
}

.rz-dialog-titlebar {
    border-bottom: 1px solid var(--tme-border);
}

.rz-notification {
    border-radius: var(--tme-radius-md) !important;
    box-shadow: var(--tme-shadow-md) !important;
}

.rz-progressbar {
    border-radius: var(--tme-radius-sm);
}

.rz-badge {
    border-radius: 999px;
}

.rz-alert {
    border-radius: var(--tme-radius-md);
}

/* —— Splash / loading WASM —— */
.fsh-wasm-cont img {
    filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.15));
}

#blazor-error-ui {
    background: #fff8e6;
    border-top: 1px solid #f0d78c;
    font-family: Montserrat, var(--rz-text-font-family), sans-serif;
}

.loading-progress circle:last-child {
    stroke: var(--tme-brand);
}

/* Content Builder — cabeçalho (título + botões na mesma linha) */
.tme-builder-header {
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 10px 10px 10px 20px;
    background-color: #ffffff;
    border: 1px solid #aaaaaa;
}

.tme-builder-header-avatar {
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    align-self: center;
}

.tme-builder-header-title {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.tme-builder-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-bottom: 2px;
}

/* Content Builder — botões IA / Configurações no cabeçalho */
.tme-builder-toolbar-btn.rz-button {
    min-width: 2.5rem;
}

.tme-builder-toolbar-btn.rz-button:hover {
    background-color: var(--tme-brand-muted);
}

.tme-builder-toolbar-btn--ai.rz-button {
    color: var(--tme-brand);
}

.tme-builder-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: calc(100vh - 40px);
    overflow: hidden;
}

.tme-builder-main {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px;
}

.tme-builder-panel {
    background-color: var(--tme-surface, #ffffff);
    border: 1px solid var(--tme-border, #aaaaaa);
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Content Builder — área de trabalho: Estrutura (árvore) + Prévia (celular) */
.tme-builder-workspace {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-height: 0;
    border-top: 1px solid var(--tme-border, #e8eaed);
}

.tme-builder-structure {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--tme-border, #e8eaed);
}

.tme-builder-preview {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background-color: var(--tme-surface-muted, #f4f6f9);
}

.tme-builder-pane-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--tme-text-muted, #6b7280);
    border-bottom: 1px solid var(--tme-border, #e8eaed);
    background: var(--tme-surface, #fff);
}

.tme-builder-pane-title .rzi {
    font-size: 1rem;
}

.tme-builder-pane-title--sidebar {
    border: 0;
    padding-left: 0.25rem;
}

.tme-builder-pane-help {
    margin-left: auto;
    font-size: 1rem !important;
    cursor: help;
    opacity: 0.7;
}

.tme-builder-pane-help:hover {
    opacity: 1;
}

.tme-builder-pane-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.5rem;
}

.tme-builder-pane-body--preview {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem 0.75rem;
    background-color: #e5ddd5;
    background-size: 300px;
    background-repeat: repeat;
    background-image: url('/images/fundo.jpg');
}

.tme-builder-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 10px;
    min-height: 0;
    overflow: hidden;
}

.tme-builder-sidebar-top {
    min-height: 0;
    overflow-y: auto;
}

.tme-builder-sidebar-bottom {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--tme-border, #e8eaed);
}

/* Paleta de componentes (grade 2 colunas) */
.tme-palette {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.25rem;
}

.tme-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.55rem 0.3rem;
    border: 1px solid var(--tme-border, #e8eaed);
    border-radius: var(--tme-radius-sm, 6px);
    background: var(--tme-surface, #fff);
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: center;
    color: var(--tme-text, #1f2937);
    cursor: grab;
    user-select: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.tme-palette-item:hover {
    border-color: var(--tme-brand, var(--rz-primary));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tme-palette-item:active {
    cursor: grabbing;
}

.tme-palette-item .rzi {
    font-size: 1.25rem;
    color: var(--tme-brand, var(--rz-primary));
}

.tme-palette-item > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Árvore de estrutura */
.tme-tree {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.875rem;
}

/* Recuo por nível: --depth (inteiro) vem do componente; o cálculo fica no CSS. */
.tme-tree {
    --tme-tree-indent: 1.25rem;
}

.tme-tree-children {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Linha-guia ligando os filhos ao toggle do pai. */
.tme-tree-children::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.35rem;
    left: calc(0.5rem + var(--depth, 0) * var(--tme-tree-indent) + 0.6rem);
    border-left: 1px solid var(--tme-border, #e3e6ea);
    pointer-events: none;
}

.tme-tree-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.35rem;
    padding: 0.2rem 0.4rem 0.2rem calc(0.5rem + var(--depth, 0) * var(--tme-tree-indent));
    border-radius: var(--tme-radius-sm, 6px);
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
}

.tme-tree-row:hover {
    background: var(--tme-surface-muted, #f4f6f9);
}

.tme-tree-row--selected,
.tme-tree-row--selected:hover {
    background: var(--tme-brand-muted, rgba(0, 128, 96, 0.08));
    border-color: var(--tme-brand, var(--rz-primary));
}

.tme-tree-row--option {
    font-size: 0.82rem;
}

.tme-tree-row--option .tme-tree-icon {
    color: #5b6b7a;
}

.tme-tree-row--flowmenu {
    color: var(--tme-text-muted, #6b7280);
    font-style: italic;
}

.tme-tree-row--unreachable {
    margin-top: 0.75rem;
    color: var(--rz-danger-dark, #b42318);
    background: var(--rz-danger-lighter, #fdf1f1);
}

.tme-tree-row--unreachable .tme-tree-icon {
    color: var(--rz-danger-dark, #b42318);
}

.tme-tree-row--topic {
    font-size: 0.8rem;
    min-height: 1.9rem;
    color: var(--tme-text-muted, #6b7280);
}

.tme-tree-toggle {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--tme-text-muted, #6b7280);
    cursor: pointer;
}

.tme-tree-toggle .rzi {
    font-size: 1.1rem;
}

.tme-tree-icon {
    flex: 0 0 auto;
    font-size: 1.15rem;
    color: var(--tme-brand, var(--rz-primary));
}

.tme-tree-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.tme-tree-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tme-tree-subtitle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: var(--tme-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tme-tree-warn {
    font-size: 0.9rem;
    color: var(--rz-warning-dark, #c77700);
}

.tme-tree-badge {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--tme-surface-muted, #eef2f6);
    color: var(--tme-text-muted, #6b7280);
    border: 1px solid var(--tme-border, #e8eaed);
}

.tme-tree-badge--over {
    background: var(--rz-danger-lighter, #fde2e2);
    color: var(--rz-danger-dark, #b42318);
    border-color: transparent;
}

.tme-tree-actions {
    flex: 0 0 auto;
    display: none;
    align-items: center;
    gap: 0;
}

.tme-tree-row:hover .tme-tree-actions,
.tme-tree-row--selected .tme-tree-actions {
    display: inline-flex;
}

.tme-tree-actions .rz-button {
    min-width: 1.6rem;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
}

.tme-tree-actions .rz-button .rzi {
    font-size: 1rem;
}

/* Zona de soltura: linha fina que só "abre" com o cursor por cima */
.tme-tree-dropzone {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* Ocupa 6px no layout, mas o alvo tem 14px (sobrepõe as linhas vizinhas, que ficam sem pointer-events no arrasto). */
    height: 14px;
    margin: -4px 0.4rem -4px calc(0.5rem + var(--depth, 0) * var(--tme-tree-indent));
    border-radius: 3px;
    font-size: 0.7rem;
    color: var(--tme-brand, var(--rz-primary));
    transition: height 0.1s ease, background-color 0.1s ease;
}

.tme-tree-dropzone::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    height: 2px;
    border-radius: 1px;
    background: var(--tme-brand, var(--rz-primary));
    opacity: 0.25;
}

.tme-tree-dropzone--active {
    height: 1.5rem;
    margin-top: 0;
    margin-bottom: 0;
    border: 1px dashed var(--tme-brand, var(--rz-primary));
    background: var(--tme-brand-muted, rgba(0, 128, 96, 0.08));
}

.tme-tree-dropzone--active::before {
    display: none;
}

.tme-tree-dropzone--active::after {
    content: attr(data-label);
}

.tme-tree-dropzone--menu {
    color: var(--tme-text-muted, #6b7280);
}

.tme-tree-dropzone--menu::before {
    background: var(--tme-text-muted, #9aa4b2);
}

.tme-tree-dropzone--menu.tme-tree-dropzone--active {
    border-color: var(--tme-text-muted, #9aa4b2);
    background: transparent;
}

.tme-tree--dragging .tme-tree-row {
    pointer-events: none;
}

.tme-tree--dragging .tme-tree-dropzone {
    pointer-events: auto;
}

.tme-tree-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    margin: 0.5rem;
    border: 1px dashed var(--tme-border, #cbd2d9);
    border-radius: var(--tme-radius-md, 8px);
    text-align: center;
    color: var(--tme-text-muted, #6b7280);
}

.tme-tree-empty .rzi {
    font-size: 2rem;
    color: var(--tme-brand, var(--rz-primary));
}

/* Prévia — moldura de celular */
.tme-phone {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    background: #efe7dd;
    font-size: 0.85rem;
}

.tme-phone-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: #075e54;
    color: #fff;
}

.tme-phone-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.tme-phone-crumbs {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.1rem;
    font-size: 0.75rem;
}

.tme-phone-crumb {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    max-width: 9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tme-phone-crumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tme-phone-crumb--current {
    color: #fff;
    font-weight: 600;
}

.tme-phone-crumb-sep {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.tme-phone-screen {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.6rem 1rem;
    min-height: 320px;
    background-color: #e5ddd5;
    background-size: 300px;
    background-image: url('/images/fundo.jpg');
}

.tme-phone-hint {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--tme-text-muted, #6b7280);
    font-size: 0.78rem;
    text-align: center;
}

.tme-phone-hint--warn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--rz-warning-dark, #c77700);
    text-align: left;
}

.tme-bubble-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 92%;
    cursor: pointer;
}

/* Seleção: anel na própria bolha (sem moldura em volta do conjunto) */
.tme-bubble-wrap--selected > .tme-bubble {
    box-shadow: 0 0 0 2px var(--tme-brand, var(--rz-primary)), 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.tme-bubble {
    position: relative;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    word-break: break-word;
    line-height: 1.3;
}

.tme-bubble--in {
    align-self: flex-start;
    background: #fff;
    border-top-left-radius: 0;
}

.tme-bubble--out {
    align-self: flex-end;
    background: #d9fdd3;
    border-top-right-radius: 0;
    max-width: 85%;
}

.tme-bubble--typing {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--tme-text-muted, #6b7280);
    background: #f0f0f0;
}

/* Imagem "sangrando" até a borda da bolha (moldura de ~3px), como no WhatsApp — evita caixa dentro de caixa. */
.tme-bubble-media {
    display: block;
    width: calc(100% + 0.9rem);
    max-height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin: -0.25rem -0.45rem 0.4rem;
}

.tme-bubble--in > .tme-bubble-media:first-child {
    border-top-left-radius: 0;
}

.tme-bubble-attachment {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.3rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.78rem;
}

.tme-bubble-attachment .rzi {
    font-size: 1.1rem;
}

.tme-bubble-type {
    font-weight: 600;
}

.tme-bubble-header {
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.tme-bubble-text p {
    margin: 0 0 0.3rem;
}

.tme-bubble-text p:last-child {
    margin-bottom: 0;
}

.tme-bubble-text--empty {
    color: var(--tme-text-muted, #9aa4b2);
    font-style: italic;
}

.tme-bubble-note {
    margin-top: 0.25rem;
    text-align: right;
    font-size: 0.68rem;
    font-style: italic;
    color: var(--tme-text-muted, #6b7280);
}

.tme-bubble-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tme-bubble-button,
.tme-bubble-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 0;
    background: #fff;
    color: #027eb5;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.tme-bubble-button--selected {
    background: #027eb5;
    color: #fff;
}

.tme-sheet {
    margin-top: 0.25rem;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tme-sheet-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 0;
    border-bottom: 1px solid #eee;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.8rem;
}

.tme-sheet-item:last-child {
    border-bottom: 0;
}

.tme-sheet-item--selected {
    background: var(--tme-brand-muted, rgba(0, 128, 96, 0.08));
}

.tme-sheet-item > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tme-sheet-item-title {
    font-weight: 600;
}

.tme-sheet-item-desc {
    font-size: 0.72rem;
    color: var(--tme-text-muted, #6b7280);
}

/* Prévia — tela do Flow (HOME / bloco) */
.tme-flow {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tme-flow-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.tme-flow-back {
    border: 0;
    background: transparent;
    padding: 0;
    display: inline-flex;
    cursor: pointer;
}

.tme-flow-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.6rem;
    max-height: 360px;
    overflow: auto;
}

.tme-flow-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "title icon" "desc icon";
    align-items: center;
    gap: 0 0.4rem;
    width: 100%;
    padding: 0.5rem 0.4rem;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.tme-flow-item .rzi {
    grid-area: icon;
    color: var(--tme-text-muted, #9aa4b2);
}

.tme-flow-item--selected {
    background: var(--tme-brand-muted, rgba(0, 128, 96, 0.08));
    border-radius: 6px;
}

.tme-flow-item-title {
    grid-area: title;
    font-weight: 600;
    font-size: 0.82rem;
}

.tme-flow-item-desc {
    grid-area: desc;
    font-size: 0.72rem;
    color: var(--tme-text-muted, #6b7280);
}

.tme-flow-image {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 6px;
}

.tme-flow-text {
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: normal;
}

/* Conteúdo do tópico aberto em acordeão, colado ao item da lista. */
.tme-flow-topic {
    margin: -0.15rem 0 0.35rem;
    padding: 0.45rem 0.5rem 0.5rem 0.75rem;
    border-left: 3px solid var(--tme-brand, var(--rz-primary));
    border-radius: 0 0 8px 8px;
    background: var(--tme-surface-muted, #f4f6f9);
}

.tme-flow-topic-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tme-flow-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.5rem 0.6rem 0.65rem;
    border-top: 1px solid #eee;
}

.tme-flow-footer-btn {
    display: block;
    text-align: center;
    padding: 0.45rem;
    border-radius: 999px;
    background: #00a884;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
}

.tme-flow-footer-btn--ghost {
    background: #f0f0f0;
    color: #555;
}

.tme-flow-footer-fn {
    text-align: center;
    font-size: 0.68rem;
    color: var(--tme-text-muted, #6b7280);
    font-family: monospace;
}

.tme-tree-row:focus {
    outline: none;
}

.tme-tree-row:focus-visible {
    box-shadow: inset 0 0 0 2px var(--tme-brand, var(--rz-primary));
}

/* Edição inline (prévia) */
.tme-inline {
    display: block;
    min-width: 1.5rem;
    border-radius: 4px;
    cursor: text;
    transition: box-shadow 0.12s;
}

.tme-inline:hover {
    box-shadow: 0 0 0 2px rgba(0, 128, 96, 0.25);
}

/* Evita a seleção de palavra do browser no duplo clique que abre a edição. */
.tme-inline:not(.tme-inline--editing) {
    user-select: none;
}

.tme-inline--empty {
    color: var(--tme-text-muted, #9aa4b2);
    font-style: italic;
    font-weight: 400;
}

.tme-inline--editing {
    cursor: default;
    box-shadow: none;
    width: 100%;
}

.tme-inline--editing:hover {
    box-shadow: none;
}

.tme-inline-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--tme-brand, var(--rz-primary));
    border-radius: 6px;
    background: #fff;
    color: #111;
    font: inherit;
    line-height: 1.3;
    resize: vertical;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.15);
}

.tme-inline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.15rem;
    font-size: 0.65rem;
    font-weight: 400;
    font-style: normal;
    color: var(--tme-text-muted, #6b7280);
}

.tme-inline-counter {
    white-space: nowrap;
    cursor: help;
}

.tme-inline-counter--max {
    color: var(--rz-danger-dark, #b42318);
    font-weight: 600;
}

/* Barra de formatação/emoji da edição inline */
.tme-inline--editing {
    position: relative;
}

.tme-inline-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.tme-inline-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.3rem;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--tme-text, #1f2937);
    font: inherit;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.tme-inline-tool:hover,
.tme-inline-tool--on {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--tme-border, #e3e6ea);
}

.tme-inline-tool--mono {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.7rem;
}

.tme-emoji {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 5;
    margin-top: 0.25rem;
    border: 1px solid var(--tme-border, #e3e6ea);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-style: normal;
    font-weight: 400;
}

.tme-emoji-tabs {
    display: flex;
    gap: 0.1rem;
    padding: 0.25rem 0.3rem 0;
    border-bottom: 1px solid var(--tme-border, #e3e6ea);
}

.tme-emoji-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    padding: 0.2rem 0;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    filter: grayscale(1);
    opacity: 0.6;
}

.tme-emoji-tab:hover,
.tme-emoji-tab--on {
    filter: none;
    opacity: 1;
}

.tme-emoji-tab--on {
    border-bottom-color: var(--tme-brand, var(--rz-primary));
}

.tme-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(1.9rem, 1fr));
    gap: 1px;
    max-height: 11rem;
    overflow-y: auto;
    padding: 0.3rem;
}

.tme-emoji-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.9rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.tme-emoji-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Formatação do WhatsApp renderizada na prévia */
.tme-wa-mono,
.tme-wa-code {
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 0.92em;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    padding: 0 0.2em;
}

.tme-wa-mono {
    display: inline-block;
    padding: 0.1em 0.35em;
    white-space: pre-wrap;
}

.tme-wa-quote {
    margin: 0.15rem 0;
    padding: 0.2rem 0.5rem;
    border-left: 3px solid rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
}

.tme-wa-li {
    display: inline-block;
    min-width: 1.1em;
    margin-right: 0.1em;
}

.tme-bubble-button .tme-inline,
.tme-flow-footer-btn .tme-inline,
.tme-bubble-cta .tme-inline {
    display: inline-block;
    text-align: center;
}

.tme-flow-header .tme-inline {
    flex: 1 1 auto;
}

.tme-bubble-button--ghost,
.tme-sheet-item--ghost,
.tme-flow-item--ghost {
    border: 1px dashed rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.55);
    color: var(--tme-text-muted, #6b7280);
    font-weight: 500;
    font-size: 0.78rem;
    box-shadow: none;
    opacity: 0.85;
}

.tme-bubble-button--ghost:hover,
.tme-sheet-item--ghost:hover,
.tme-flow-item--ghost:hover {
    opacity: 1;
    border-color: var(--tme-brand, var(--rz-primary));
    color: var(--tme-brand, var(--rz-primary));
    background: #fff;
}

.tme-sheet-item--ghost,
.tme-flow-item--ghost {
    border-radius: 6px;
    margin-top: 0.15rem;
}

.tme-flow-item--ghost .tme-flow-item-title {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--tme-brand, var(--rz-primary));
}

@media (max-width: 1100px) {
    .tme-builder-preview {
        flex-basis: 320px;
    }
}

.tme-builder-sidebar-actions {
    display: flex;
    gap: 0.5rem;
}

.tme-builder-sidebar-status {
    display: block;
    min-height: 1em;
    color: var(--tme-text-muted, #6b7280);
}

.tme-builder-loading {
    height: 100%;
}

.tme-scheduling-scheduler .rz-event-content {
    padding: 0 0.35rem;
}

.tme-scheduling-appt {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.75rem;
    line-height: 1.35;
}
