/* FONTES SOHNE - CARREGAMENTO LOCAL */
@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Extraleicht-BF663d89cd3f5c5.otf') format('opentype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Leicht-BF663d89cd4952e.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Buch-BF663d89cd32e6a.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-BuchKursiv-BF663d89cd3e887.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Halbfett-BF663d89cd2d67b.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-HalbfettKursiv-BF663d89cd41624.otf') format('opentype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Kraftig-BF663d89cd37e26.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-KraftigKursiv-BF663d89cd2bd4b.otf') format('opentype');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Fett-BF663d89cca89ff.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-FettKursiv-BF663d89cc64878.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-Extrafett-BF663d89cc9f2c0.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/sohne-font-family-1768268478-0/TestSohne-ExtrafettKursiv-BF663d89ccb8000.otf') format('opentype');
    font-weight: 800;
    font-style: italic;
    font-display: swap;
}

/* TEMA GENIUX - NOVO DESIGN BASEADO NO LAYOUT */
:root {
    /* Paleta */
    --primary: #460448;
    --primary-hover: #5a0a5c;
    --accent: #ffa2ff;
    --electric: #6dddff;
    --black: #000000;
    --white: #ffffff;
    --bg-app: #ffffff;
    --bg-panel: #ffffff;
    --bg-panel-strong: #f4f2fa;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(70, 4, 72, 0.28);
    
    /* Cores do novo design */
    --color-greeting: #0E4C73;
    --gradient-header-btn: linear-gradient(90deg, #90D4FD 0%, #DB58FE 100%);
    --gradient-input-border: linear-gradient(90deg, #F292FF 0%, #700D8C 50%, #8FD5FC 100%);
    --gradient-send-btn: linear-gradient(180deg, #DB58FE 0%, #58A0CE 100%);

    /* Tipografia */
    --font-ui: 'Lato', sans-serif;
    --font-display: 'Lato', sans-serif;

    /* Textos */
    --text-main: #1b0f24;
    --text-muted: #4b4454;
    --text-light: #7b7483;

    /* Layout */
    --sidebar-width: 320px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-input: 30px;
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 18px 50px rgba(70, 4, 72, 0.18);
    --gradient-primary: linear-gradient(135deg, #460448 0%, #6dddff 100%);
    --gradient-surface: linear-gradient(140deg, rgba(109, 221, 255, 0.14), rgba(255, 162, 255, 0.14));
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

.eugenia-messages, 
.register-modal-content,
.chat-viewport {
    overflow-y: auto !important; /* Força a barra de rolagem */
    -webkit-overflow-scrolling: touch; /* Habilita o scroll suave "de inércia" no iOS */
    touch-action: pan-y; /* Diz ao navegador que toques verticais são para scroll */
}

/* --- CORREÇÃO 1: TRAVAMENTO DO SCROLL GERAL --- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: 100%; /* Fixa altura */
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Impede scroll do documento */
    position: fixed; /* Trava no iOS */
    overscroll-behavior: none; /* Remove efeito elástico */
}

/* Remove scrollbars padrão de toda a aplicação */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE e Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body {
    font-family: 'Sohne', sans-serif;
    background: #ffffff;
    color: var(--text-main);
    height: 100%; /* Fixa altura */
    width: 100%;
    overflow: hidden; /* Impede scroll do body */
    position: fixed; /* Trava no iOS */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

/* Garante que todos os elementos usem Sohne, exceto código */
html, body, input, textarea, select, button, a, p, h1, h2, h3, h4, h5, h6, span, div, li, ul, ol, td, th, label {
    font-family: 'Sohne', sans-serif;
}

/* --- CORREÇÃO 2: APP WRAPPER FIXO --- */
.app-wrapper {
    position: fixed; /* Muda de relative/flex para fixed */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%; /* Ocupa 100% da viewport travada */
    height: 100dvh; /* Garante altura dinâmica correta */
    display: flex;
    flex-direction: row;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    max-width: none;
    background: #ffffff;
    border: none;
    border-radius: 0;
    overflow: hidden; /* Garante que nada vaze */
    z-index: 1;
}

/* HEADER */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: #ffffff;
    border: none;
    box-shadow: none;
    z-index: 100;
    flex-shrink: 0; /* Impede header de encolher */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #58A0CE;
    transition: opacity 0.2s;
}

.menu-toggle:hover {
    opacity: 0.7;
}

/* Esconde botão de menu e logo quando sidebar está aberta (padrão) */
.app-wrapper:has(.sidebar:not(.closed)) .menu-toggle {
    display: none;
}

.app-wrapper:has(.sidebar:not(.closed)) .header-logo {
    display: none;
}

/* Mostra botão de menu quando sidebar está fechada */
.app-wrapper:has(.sidebar.closed) .menu-toggle {
    display: flex;
}

.header-logo {
    width: auto;
    height: 64px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.onboarding-anchor {
    width: 1px;
    height: 1px;
    opacity: 0;
}

.header-settings {
    position: relative;
}

.settings-btn {
    background: rgba(88, 160, 206, 0.08);
    border: 1px solid rgba(88, 160, 206, 0.35);
    color: #58A0CE;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.settings-btn:hover {
    opacity: 0.85;
}

.settings-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(90vw, 260px);
    background: #ffffff;
    border: 1px solid rgba(88, 160, 206, 0.35);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 20;
}

.header-settings.open .settings-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-help-btn {
    background: rgba(88, 160, 206, 0.12);
    border: 1px solid rgba(88, 160, 206, 0.35);
    color: #0b0713;
    border-radius: 10px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-title {
    font-size: 12px;
    color: rgba(15, 18, 32, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.settings-languages {
    display: grid;
    gap: 6px;
}

.settings-language-option {
    background: transparent;
    border: 1px solid rgba(88, 160, 206, 0.2);
    border-radius: 10px;
    color: #0b0713;
    padding: 6px 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

.settings-language-option[aria-selected="true"],
.settings-language-option:hover {
    background: rgba(88, 160, 206, 0.2);
    border-color: rgba(88, 160, 206, 0.5);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(88, 160, 206, 0.35);
    border-radius: 999px;
    color: #58A0CE;
    background: rgba(88, 160, 206, 0.08);
    position: relative;
}

.language-select-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.language-label-short {
    display: none;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.language-options {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #0f1220;
    border: 1px solid rgba(88, 160, 206, 0.35);
    border-radius: 12px;
    min-width: 180px;
    padding: 6px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    display: none;
    z-index: 10;
}

.language-selector.open .language-options {
    display: grid;
    gap: 4px;
}

.language-option {
    background: transparent;
    border: none;
    color: #f3f4f6;
    padding: 8px 10px;
    text-align: left;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.language-option[aria-selected="true"],
.language-option:hover {
    background: rgba(88, 160, 206, 0.2);
    color: #ffffff;
}

.language-select-native {
    display: none;
}

.help-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #58A0CE;
    transition: all 0.2s;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.help-btn:hover {
    background: rgba(88, 160, 206, 0.1);
    color: #2372A3;
    transform: scale(1.1);
}

.help-btn:active {
    transform: scale(0.95);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.status-dot-header {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot-header.premium {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot-header.free {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.time-remaining {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-register {
    padding: 10px 20px;
    background: #90D4FD;
    border: 1px solid #58A0CE;
    color: #ffffff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-register:hover {
    transform: translateY(-1px);
    background: #58A0CE;
    box-shadow: 0 4px 12px rgba(144, 212, 253, 0.4);
}

.btn-logout {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-ui);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* SIDEBAR (Aberto por padrão, expansível) */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #58A0CE 0%, #DB58FE 100%);
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 200;
    position: relative;
    height: 100vh;
    height: 100dvh;
    transition: width 0.3s ease, padding 0s ease 0s; /* Padding aparece imediatamente */
    overflow-y: auto; /* Permite scroll no sidebar */
    overflow-x: visible; /* Permite popups saírem dos limites */
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

/* Sidebar fechada (quando usuário fecha manualmente) */
.sidebar.closed {
    width: 0;
    padding: 0;
    transition: width 0.3s ease, padding 0s ease 0.3s; /* Padding só muda depois que width termina */
    overflow: hidden; /* Esconde conteúdo quando fechado */
}

/* Esconde elementos internos quando sidebar está fechado */
.sidebar.closed > * {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0s ease 0.15s;
}

/* Mostra elementos internos quando sidebar está aberto (padrão) */
.sidebar:not(.closed) > * {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s ease 0.1s, visibility 0s ease 0s; /* Aparece após um pequeno delay */
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 250;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mostra overlay quando sidebar está aberto (não fechado) */
.app-wrapper:has(.sidebar:not(.closed)) .sidebar-overlay {
    display: block;
    opacity: 1;
}

/* No desktop, overlay não bloqueia interação */
@media (min-width: 769px) {
    .sidebar-overlay {
        pointer-events: none;
        background: transparent;
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.sidebar-logo {
    height: 48px;
    width: auto;
}

.sidebar-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: opacity 0.2s;
    border-radius: 8px;
}

.sidebar-close-btn:hover {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-search {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #F292FF;
    border-radius: 50px;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.sidebar-search:focus {
    border-color: #DB58FE;
}

.sidebar-search::placeholder {
    color: var(--text-muted);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.1);
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border-color: rgba(255,255,255,0.3);
}

.nav-item.active {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
}

.user-profile-mini {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.3);
}

.user-profile-mini span {
    color: #ffffff;
}

/* Seção de Chats */
.chats-section {
    margin-top: 24px;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0; /* Permite que o flex funcione corretamente */
    overflow-y: auto; /* Permite scroll nos chats */
}

.btn-new-chat {
    width: auto;
    padding: 10px 20px;
    background: #E774F6;
    border: 2px solid #90D4FD;
    border-radius: 50px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
}

.btn-new-chat:hover {
    background: #DB58FE;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 116, 246, 0.4);
}

.chats-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    gap: 4px;
    padding-right: 4px;
}

.chat-item {
    padding: 10px 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-item.active {
    color: #ffffff;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.15);
}

.chat-item a {
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-item-icon {
    flex-shrink: 0;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
}

.chat-item.active .chat-item-icon {
    color: #ffffff;
}

.chat-item-menu-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.chat-item:hover .chat-item-menu-btn {
    opacity: 1;
}

.chat-item-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.chat-item-menu-popup {
    position: fixed; /* Fixed para não ser cortado pelo overflow */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 8px;
    min-width: 180px;
    z-index: 99999; /* Z-index muito alto para ficar acima de tudo */
    display: none;
}

.chat-item-menu-popup.show {
    display: block;
}

.chat-item-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.chat-item-menu-item:hover {
    background: #f3f4f6;
}

.chat-item-menu-item i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.chat-item-menu-item.delete-item {
    color: #ef4444;
}

.chat-item-menu-item.delete-item i {
    color: #ef4444;
}

.chat-item-menu-item.delete-item:hover {
    background: #fee2e2;
}

/* Botão de Apagar Todos (Danger) */
.btn-danger-reset {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #d92c2c;
    border-radius: 10px;
    color: #b32626;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-danger-reset:hover {
    background: rgba(217, 44, 44, 0.08);
    border-color: #d92c2c;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(217, 44, 44, 0.2);
}

.btn-danger-reset:active {
    transform: translateY(0);
}

/* ÁREA PRINCIPAL DO CHAT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #ffffff;
    overflow: hidden; /* Remove scroll do container principal */
    align-items: center;
    justify-content: flex-start;
    transition: margin-left 0.3s ease;
    min-width: 0;
    /* Remove alturas conflitantes */
    height: 100%;
    width: 100%;
}

/* Header do Chat */
.chat-header-simple {
    padding: 20px 32px;
    background: linear-gradient(90deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.chat-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.chat-status {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--electric);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(109, 221, 255, 0.8);
}

/* Área inicial centralizada - Fora do chat */
.chat-initial-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    min-height: 0; /* Permite que o flex funcione corretamente */
    overflow-y: auto; /* Permite scroll se necessário */
    -webkit-overflow-scrolling: touch;
}

.logo-text-img {
    height: 60px;
    width: auto;
    margin-bottom: 24px;
}

.brain-logo-img {
    height: 120px;
    width: auto;
    margin-bottom: 24px;
}

.greeting-text {
    color: #27272a;
    font-size: 16px;
    text-align: center;
    margin: 16px 0;
    line-height: 1.7;
    max-width: 672px;
    margin-left: auto;
    margin-right: auto;
}

.input-security-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    letter-spacing: 0.01em;
}

.input-security-note i {
    color: #9ca3af;
}

/* Container das Mensagens - Layout Centralizado */
.chat-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px 24px;
    display: none; /* Escondido inicialmente, aparece quando há mensagens */
    flex-direction: column;
    align-items: center;
    gap: 32px;
    scroll-behavior: smooth;
    background: #ffffff;
    width: 100%;
    max-width: 1024px;
    min-height: 0; /* Permite que o flex funcione corretamente */
    overflow-x: hidden; /* Previne scroll horizontal */
    -webkit-overflow-scrolling: touch;
    /* Esconde a barra de scroll mas mantém funcionalidade */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE e Edge */
}

.chat-viewport::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.chat-viewport.has-messages {
    display: flex;
    align-items: flex-start;
}

/* Balões de Mensagem */
.message-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeIn 0.4s forwards;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
}

.message-row.user {
    flex-direction: row;
    justify-content: flex-end;
}

.message-row.genius {
    flex-direction: row;
    justify-content: flex-start;
}

.msg-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: none;
    border: none;
    box-shadow: none;
    padding-top: 15px;
}

.msg-avatar i {
    width: 20px;
    height: 20px;
}

.genio-avatar { 
    color: #0E4C73; 
}

.user-avatar { 
    color: #2372A3; 
}

.bubble {
    max-width: 600px;
    padding: 16px 24px;
    border-radius: 18px;
    font-size: 17px;
    line-height: 1.6;
    position: relative;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    background: #ffffff;
}

.message-row.genius .bubble {
    background: transparent;
    border-bottom-left-radius: 6px;
    color: var(--text-main);
    border: none;
    box-shadow: none;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
}

.message-row.genius .bubble.loading {
    background: #DFDFDF;
}

.message-row.user .bubble {
    background: #E3F5FF;
    color: #000000;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 0;
    box-shadow: var(--shadow-soft);
    border-color: var(--border-color);
    font-weight: normal;
    position: relative;
}

.message-row.user .bubble:hover .edit-message-btn {
    opacity: 1;
}

.edit-message-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

.edit-message-input {
    width: 100%;
    min-height: 40px;
    max-height: 200px;
    padding: 8px 12px;
    border: 2px solid #DB58FE;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-ui);
    resize: none;
    outline: none;
    background: #ffffff;
    color: var(--text-main);
}

.edit-message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.edit-save-btn {
    padding: 6px 16px;
    background: #DB58FE;
    border: 1px solid #700D8C;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s;
}

.edit-save-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.edit-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.edit-cancel-btn {
    padding: 6px 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.edit-cancel-btn:hover {
    background: var(--bg-panel-strong);
}

/* Formatação Markdown dentro do balão do Gênio */
.bubble p { margin-bottom: 10px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble strong { color: var(--primary); font-weight: 600; }
.message-row.user .bubble strong { color: #000000; }
.bubble ul,
.bubble ol {
    margin: 8px 0 12px 20px;
    padding: 0;
}
.bubble li {
    margin: 4px 0;
}

/* Input Area - Centralizado com Gradiente */
.input-area-wrapper {
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: #ffffff;
    display: flex;
    justify-content: center;
    width: 100%;
    flex-shrink: 0; /* Não encolhe */
    position: relative;
    z-index: 10;
}

.input-container {
    background: var(--gradient-input-border);
    border-radius: var(--radius-input);
    padding: 2px;
    display: flex;
    align-items: center;
    max-width: 1024px;
    width: 100%;
    position: relative;
    transition: all 0.3s;
}

.input-container:focus-within {
    box-shadow: 0 8px 24px rgba(242, 146, 255, 0.3);
}

.input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 12px 12px 12px 16px;
    gap: 12px;
    background: #ffffff;
    border-radius: calc(var(--radius-input) - 2px);
    width: 100%;
}

.input-icon {
    color: var(--text-muted);
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

textarea.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-ui);
    font-size: 15px;
    resize: none;
    max-height: 100px;
    padding: 0;
    color: var(--text-main);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #58A0CE;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.send-btn:hover { 
    background: #4a8bb8;
    transform: scale(1.05); 
    box-shadow: 0 4px 16px rgba(88, 160, 206, 0.4); 
}

.send-btn:disabled { 
    background: #d1d5db; 
    color: #9ca3af; 
    cursor: not-allowed; 
    box-shadow: none;
    transform: none;
}

/* Animações */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.typing-dot { background-color: var(--text-muted); }

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-indicator .typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    background: var(--electric);
    box-shadow: 0 0 8px rgba(109,221,255,0.5);
}
.typing-indicator .typing-dot:nth-child(2) { animation-delay: -0.2s; }
.typing-indicator .typing-dot:nth-child(3) { animation-delay: -0.4s; }

/* Paywall Card Integrado ao Chat (Barra do Paywall) */
.paywall-card-inline {
    background: linear-gradient(135deg, rgba(109,221,255,0.12), rgba(255,162,255,0.1));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    margin-top: 20px;
    align-self: center;
    max-width: 420px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    color: var(--text-main);
}

.paywall-inline-headline {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-main);
    line-height: 1.3;
}

.paywall-inline-subheadline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.45;
}

.paywall-inline-body {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 20px;
    line-height: 1.5;
    white-space: normal;
}

.paywall-inline-body br {
    display: block;
    content: "";
    margin-top: 0.35em;
}

.paywall-inline-btn {
    margin: 0 0 14px;
}

.paywall-inline-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    opacity: 0.9;
}

.btn-gold {
    background: #90D4FD;
    border: 1px solid #58A0CE;
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    margin-top: 16px;
    transition: all 0.3s;
    box-shadow: 0 14px 40px rgba(144, 212, 253, 0.25);
}

.btn-gold:hover { 
    transform: translateY(-2px); 
    background: #58A0CE;
    box-shadow: 0 18px 50px rgba(144, 212, 253, 0.35); 
}


/* --- CORREÇÃO 3: MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    /* Layout Principal */
    .app-wrapper {
        border-radius: 0;
        border: none;
        box-shadow: none;
        /* Height já é controlado globalmente pelo position: fixed */
    }
    
    .main-content {
        width: 100%;
        height: 100%;
        overflow: hidden; /* Remove scroll do container principal */
    }
    
    /* Header Fixo */
    .app-header {
        flex: 0 0 auto; /* Não encolhe */
        padding: 12px 16px;
        position: relative; /* Não precisa ser sticky pois o pai é fixed */
        z-index: 150;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    /* Chat Viewport com Scroll Isolado */
    .chat-viewport,
    .chat-initial-area {
        flex: 1 1 auto; /* Cresce e encolhe */
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        height: auto;
        min-height: 0;
        overscroll-behavior-y: contain; /* Mantém o scroll preso aqui */
        -webkit-overflow-scrolling: touch; /* Suavidade no iOS */
    }
    
    /* Input Area Fixa no Rodapé */
    .input-area-wrapper {
        flex: 0 0 auto; /* Não encolhe */
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        position: relative;
        bottom: auto;
        background: #ffffff;
        z-index: 100;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
        width: 100%;
    }
    
    /* ... (restante dos estilos mobile mantidos) ... */
    
    .header-left {
        gap: 12px;
    }
    
    .header-logo {
        display: none;
        height: 48px;
    }
    
    .header-right {
        gap: 8px;
        flex-wrap: nowrap;
    }

    .auth-actions {
        display: inline-flex !important;
        gap: 8px;
    }
    
    .help-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .help-btn i {
        width: 18px;
        height: 18px;
    }
    
    .time-remaining {
        font-size: 11px;
        display: none; /* Esconde em telas muito pequenas */
    }
    
    .btn-register {
        padding: 8px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    .auth-actions .btn-register {
        padding: 10px 16px;
        font-size: 13px;
    }

    .settings-btn {
        width: 34px;
        height: 34px;
    }
    
    /* Sidebar - Overlay no mobile */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 300;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar.open {
        width: 85vw;
        max-width: 320px;
    }
    
    /* Overlay para fechar sidebar no mobile - já definido acima, apenas ajustes */
    .sidebar-overlay {
        pointer-events: auto; /* Permite clicar no mobile */
        background: rgba(0, 0, 0, 0.5);
    }
    
    /* Chat Viewport */
    .chat-viewport {
        padding: 20px 12px;
        gap: 24px;
    }
    
    .chat-header-simple {
        padding: 16px 20px;
    }
    
    .chat-title h2 {
        font-size: 16px;
    }
    
    .chat-status {
        font-size: 11px;
    }
    
    /* Área Inicial */
    .chat-initial-area {
        padding: 40px 20px 30px;
        gap: 0;
    }
    
    .logo-text-img {
        height: 48px;
        margin-bottom: 20px;
    }
    
    .brain-logo-img {
        height: 100px;
        margin-bottom: 20px;
    }
    
    .greeting-text {
        font-size: 14px;
        margin: 12px 0;
        padding: 0 8px;
    }
    
    /* Bubbles */
    .bubble {
        max-width: 85%;
        padding: 14px 18px;
        font-size: 16px;
        line-height: 1.5;
    }
    
    .bubble.user {
        align-self: flex-end;
    }
    
    .bubble.assistant {
        align-self: flex-start;
    }
    
    input,
    select,
    textarea {
        font-size: 16px;
    }
    
    .input-area {
        gap: 8px;
    }
    
    .chat-input {
        font-size: 14px;
        padding: 12px 16px;
        min-height: 44px; /* Tamanho mínimo para touch */
    }
    
    .send-button {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }
    
    /* Modais */
    .modal-overlay {
        padding: 20px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        margin: 0;
        padding: 20px;
        border-radius: 16px;
        overflow-y: auto;
    }
    
    .register-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        margin: 0;
        padding: 20px;
        border-radius: 16px;
        overflow-y: auto;
    }
    
    .register-modal-header {
        margin-bottom: 20px;
    }
    
    .register-modal-header h2 {
        font-size: 20px;
    }
    
    .register-form-group {
        margin-bottom: 16px;
    }
    
    .register-form-input,
    .register-form-select {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .register-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .register-form-submit {
        padding: 14px;
        font-size: 15px;
        min-height: 48px;
    }
    
    /* Genius Modal */
    .genius-modal-content {
        max-width: 100%;
        margin: 10px;
        max-height: 95vh;
        max-height: 95dvh;
        border-radius: 16px;
    }
    
    .genius-cards-container {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }
    
    .genius-card {
        padding: 16px;
    }
    
    .genius-card-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .genius-card-title {
        font-size: 16px;
    }
    
    .genius-card-description {
        font-size: 13px;
    }
    
    /* Sidebar Elements */
    .sidebar-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .sidebar-logo {
        height: 40px;
    }
    
    .sidebar-search {
        padding: 10px 14px;
        font-size: 14px;
        margin-bottom: 16px;
        min-height: 44px;
    }
    
    .btn-new-chat {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .chat-item {
        padding: 12px;
        font-size: 14px;
    }
    
    .user-profile-mini {
        padding: 12px;
        font-size: 13px;
    }
    
    /* Chat Item Menu Popup */
    .chat-item-menu-popup {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .chat-item-menu-item {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Status Messages */
    .status-message {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    /* Typing Indicator */
    .typing-indicator {
        gap: 4px;
    }
    
    .typing-dot {
        width: 6px;
        height: 6px;
    }
    
    /* Scroll Indicator */
    .scroll-indicator {
        width: 40px;
        height: 40px;
        bottom: 80px;
    }
    
    .scroll-indicator i {
        font-size: 18px;
    }
    
    /* Payment Modal */
    .modal-content {
        max-width: 100%;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-description {
        font-size: 13px;
    }
    
    /* Scroll to bottom button */
    .scroll-to-bottom-btn {
        width: 44px;
        height: 44px;
        bottom: 100px; /* Acima do input no mobile */
    }
    
    .scroll-to-bottom-btn i {
        font-size: 18px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar.open {
        width: 280px;
    }
    
    .chat-viewport {
        padding: 32px 20px;
    }
    
    .bubble {
        max-width: 75%;
    }
    
    .input-area-wrapper {
        padding: 16px 20px;
    }
}

/* Small Mobile (menos de 480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 10px 12px;
    }
    
    .header-logo {
        height: 40px;
    }
    
    .time-remaining {
        display: none;
    }
    
    .btn-register {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .sidebar.open {
        width: 90vw;
    }
    
    .chat-viewport {
        padding: 16px 10px;
        gap: 20px;
    }
    
    .bubble {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .input-area-wrapper {
        padding: 10px;
    }
    
    .chat-input {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .modal-content,
    .register-modal-content {
        padding: 16px;
        border-radius: 12px;
    }
    
    .register-modal-header h2 {
        font-size: 18px;
    }
    
    .genius-modal-content {
        margin: 5px;
        border-radius: 12px;
    }
    
    .genius-cards-container {
        padding: 8px;
        gap: 10px;
    }
    
    .genius-card {
        padding: 12px;
    }
}

/* ADMIN PAINEL - LOOK & FEEL GENIUX */
.admin-shell {
    min-height: 100vh;
    background: var(--bg-app);
}

.admin-header {
    background: rgba(19, 12, 31, 0.92);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.admin-header__content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    transition: all 0.2s;
}

.admin-link:hover { background: rgba(255,255,255,0.05); border-color: var(--border-strong); }

.admin-primary-btn {
    padding: 10px 16px;
    background: #90D4FD;
    border: 1px solid #58A0CE;
    color: #ffffff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(144, 212, 253, 0.25);
}

.admin-body {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-card {
    background: linear-gradient(150deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.admin-card + .admin-card { margin-top: 20px; }

.admin-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 20px;
    margin-bottom: 10px;
}

.admin-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: rgba(109,221,255,0.08);
    color: var(--text-main);
}

.admin-alert {
    background: linear-gradient(135deg, rgba(109,221,255,0.08), rgba(255,162,255,0.08));
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
}

.admin-pill-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-pill-btn:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.05); }

.admin-modal {
    background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.admin-modal__card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.admin-input, .admin-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    color: var(--text-main);
    font-size: 14px;
}

.admin-textarea { font-family: monospace; resize: vertical; }

.admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
}

/* Modal de Seleção de Gênio */
.genius-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.genius-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.genius-modal-content {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.genius-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.genius-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.genius-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.genius-modal-close:hover {
    background: var(--bg-panel-strong);
    color: var(--text-main);
}

.genius-cards-container {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-height: calc(90vh - 100px);
}

@media (min-width: 1024px) {
    .genius-cards-container {
        grid-template-columns: 1fr;
    }
}

.genius-card {
    background: linear-gradient(140deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.genius-card-premium {
    background: linear-gradient(140deg, rgba(109, 221, 255, 0.08), rgba(255, 162, 255, 0.06));
    border: 1.5px solid rgba(109, 221, 255, 0.3);
}

.genius-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(109, 221, 255, 0.1), rgba(255, 162, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.genius-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

.genius-card:hover::before {
    opacity: 1;
}

.genius-card:hover .genius-card-action {
    opacity: 1;
}

.genius-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(109, 221, 255, 0.2), rgba(255, 162, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.genius-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.genius-card-avatar i {
    color: var(--primary);
}

.genius-card-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.genius-card-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
}

.genius-card-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.genius-card-action {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--text-muted);
    z-index: 1;
}

.genius-card-locked {
    opacity: 0.7;
    cursor: pointer;
    position: relative;
}

.genius-card-locked:hover {
    opacity: 0.9;
}

.genius-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #ffffff;
}

.genius-price {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(219, 88, 254, 0.1);
    border: 1px solid rgba(219, 88, 254, 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #DB58FE;
}

.genius-purchase-content {
    padding: 24px;
    text-align: center;
}

.genius-purchase-price {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.genius-purchase-price .price-label {
    font-size: 14px;
    color: var(--text-muted);
}

.genius-purchase-price .price-value {
    font-size: 24px;
    font-weight: 700;
    color: #DB58FE;
}

.btn-purchase-genius {
    width: 100%;
    padding: 14px 24px;
    background: #DB58FE;
    border: 1px solid #700D8C;
    color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
}

.btn-purchase-genius:hover {
    transform: translateY(-2px);
    background: #700D8C;
    box-shadow: 0 8px 20px rgba(219, 88, 254, 0.4);
}

.genius-card:hover .genius-card-action {
    opacity: 1;
    color: var(--primary);
}

.genius-loading,
.genius-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 16px;
}

.genius-loading .typing-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.genius-loading .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.4s infinite ease-in-out both;
}

.genius-loading .typing-dot:nth-child(1) { animation-delay: -0.32s; }
.genius-loading .typing-dot:nth-child(2) { animation-delay: -0.16s; }

.genius-empty i {
    color: var(--text-light);
}

.genius-empty p {
    font-size: 14px;
    margin: 0;
}

@media (max-width: 768px) {
    .genius-cards-container {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .genius-card-premium {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .genius-card-premium .genius-card-content {
        text-align: center;
    }
    
    .genius-modal-content {
        max-width: 100%;
        margin: 20px;
    }
}

/* Suporte Eugênia */
.eugenia-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10020;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.eugenia-tooltip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #140a22;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    position: relative;
    margin-right: 6px;
}

.eugenia-tooltip-arrow {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #ffffff;
}

.eugenia-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #DB58FE;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(219, 88, 254, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eugenia-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(219, 88, 254, 0.5);
}

.eugenia-panel {
    width: 340px;
    max-height: 520px;
    background: #f0f1f3;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.eugenia-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    display: flex;
}

.eugenia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #e8e9ec;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.eugenia-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eugenia-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.eugenia-subtitle {
    font-size: 12px;
    color: #5a5a5a;
}

.eugenia-close {
    background: transparent;
    border: none;
    color: #3a3a3a;
    font-size: 22px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eugenia-messages {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
}

.eugenia-message {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.eugenia-message--assistant {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.06);
    align-self: flex-start;
}

.eugenia-message--user {
    background: rgba(219, 88, 254, 0.25);
    color: #1a1a1a;
    border: 1px solid rgba(219, 88, 254, 0.2);
    align-self: flex-end;
}

.eugenia-typing {
    font-size: 12px;
    color: #5a5a5a;
}

.eugenia-actions {
    padding: 0 16px 12px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.eugenia-action-btn {
    background: #25D366;
    color: #0b0713;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
}

.eugenia-ticket {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.eugenia-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.eugenia-input textarea {
    flex: 1;
    resize: none;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #1a1a1a;
    padding: 8px 10px;
    font-size: 14px;
    font-family: var(--font-ui);
    outline: none;
}

.eugenia-input button {
    background: #DB58FE;
    border: none;
    color: #ffffff;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}

.eugenia-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .eugenia-widget {
        display: none;
        right: 16px;
        bottom: 16px;
    }

    .eugenia-tooltip {
        font-size: 12px;
        padding: 6px 10px;
    }

    .eugenia-panel {
        width: min(92vw, 360px);
    }
}

.eugenia-mobile-backdrop {
    align-items: center;
    justify-content: center;
}