/* ==========================================================================
   A CHAMA — MODAIS, BÍBLIA, MENTOR IA, ÁUDIO & TOASTS (modals.css)
   ========================================================================== */

/* --- OVERLAY E MODAL BASE --- */
.overlay-modal {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Hierarquia de z-index dos Modais */
#modal-prayer-wall-popup { z-index: 215 !important; }
#modal-new-prayer { z-index: 230 !important; }
#modal-theology-ai { z-index: 260; }
#modal-custom-alert, #modal-custom-confirm { z-index: 265 !important; }
#modal-edit-user-name, #modal-rename, #modal-reward { z-index: 270; }
#modal-verse-studio { z-index: 268; }

.overlay-modal.active {
    display: flex !important;
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.modal-sheet {
    transform: translateY(24px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.overlay-modal.active .modal-sheet {
    transform: none;
}

/* Ajuste de viewport quando o teclado virtual abre (iOS Safari / PWA standalone / iPadOS / Android) */
.overlay-modal.active.vv-bounded {
    position: fixed !important;
    top: var(--vv-top, 0px) !important;
    left: var(--vv-left, 0px) !important;
    width: var(--vv-width, 100%) !important;
    height: var(--vv-height, 100%) !important;
    bottom: auto !important;
    right: auto !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
#modal-theology-ai.active.vv-bounded.keyboard-open {
    padding-top: max(env(safe-area-inset-top, 0px), 8px) !important;
    padding-bottom: 0 !important;
    align-items: flex-end !important;
}
.ios-standalone #modal-theology-ai.active.vv-bounded.keyboard-open {
    padding-top: max(calc(env(safe-area-inset-top, 20px) + 6px), 24px) !important;
}
#modal-theology-ai.active.vv-bounded.keyboard-open .modal-sheet {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    border-radius: 26px 26px 0 0 !important;
    transition: none !important;
}
@media (min-width: 768px) and (min-height: 500px) {
    #modal-theology-ai.active.vv-bounded.keyboard-open {
        padding: 12px 20px !important;
        align-items: center !important;
    }
    #modal-theology-ai.active.vv-bounded.keyboard-open .modal-sheet {
        height: 100% !important;
        max-height: calc(100% - 8px) !important;
        border-radius: 28px !important;
    }
}
#modal-theology-ai.active.vv-bounded.vv-kb-visible .modal-sheet > div:first-child {
    padding: 0.6rem 1rem !important;
}
#modal-theology-ai.active.vv-bounded.vv-kb-visible [data-i18n="ai_specialist_sub"] {
    display: none !important;
}
#modal-theology-ai.active.vv-bounded.vv-kb-visible #ai-quick-prompts {
    display: none !important;
}
#modal-theology-ai.active.vv-bounded.vv-tight-banner #ai-context-banner {
    margin-top: 0.45rem !important;
    padding: 0.45rem 0.75rem !important;
}
#modal-theology-ai.active.vv-bounded.vv-tight-banner #ai-context-text {
    display: none !important;
}
#modal-theology-ai.active.vv-bounded.vv-compact #ai-quick-prompts,
#modal-theology-ai.active.vv-bounded.vv-compact #ai-context-banner {
    display: none !important;
}
#modal-theology-ai.active.vv-bounded.keyboard-open .modal-sheet > div:last-child,
.ios-standalone #modal-theology-ai.active.vv-bounded.keyboard-open .modal-sheet > div:last-child {
    padding-top: 0.55rem !important;
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom, 0px)) !important;
}
#modal-theology-ai.active.vv-bounded.vv-kb-visible .modal-sheet > div:last-child,
.ios-standalone #modal-theology-ai.active.vv-bounded.vv-kb-visible .modal-sheet > div:last-child {
    padding: 0.5rem 0.75rem !important;
}
#modal-theology-ai.active.vv-bounded.vv-kb-visible #ai-input {
    max-height: 76px !important;
}
#modal-room-chat.active.vv-bounded.keyboard-open {
    padding: max(env(safe-area-inset-top, 0px), 8px) 8px 8px 8px !important;
    align-items: center !important;
}
.ios-standalone #modal-room-chat.active.vv-bounded.keyboard-open {
    padding-top: max(calc(env(safe-area-inset-top, 20px) + 6px), 24px) !important;
}
#modal-room-chat.active.vv-bounded.keyboard-open .modal-sheet {
    height: 100% !important;
    max-height: 100% !important;
    transition: none !important;
}
/* Estabilidade dedicada do leitor de Devocionais Temáticas (evita recorte parcial no WebKit/iOS e ambiguidade flex h-auto) */
#modal-devotional-reader.active {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(2, 6, 23, 0.80);
}
#modal-devotional-reader .modal-sheet {
    width: 100%;
    height: 94%;
    max-height: 94%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    transform: none;
    transition: none;
}
@media (min-width: 640px) {
    #modal-devotional-reader .modal-sheet {
        height: min(90vh, 860px);
        max-height: 90vh;
        max-width: 42rem;
    }
}
#devotional-reader-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#modal-devotional-reader.active.vv-bounded.keyboard-open .modal-sheet {
    height: calc(100% - 8px) !important;
    max-height: calc(100% - 8px) !important;
    overflow: hidden !important;
}
.overlay-modal.active.vv-bounded.keyboard-open:not(#modal-theology-ai):not(#modal-room-chat):not(#modal-lesson):not(#modal-onboarding):not(#modal-verse-studio):not(#modal-devotional-reader) .modal-sheet {
    max-height: calc(100% - 12px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

#ai-input {
    min-height: 46px;
    font-size: 16px !important;
    line-height: 1.35 !important;
}
#ai-input::placeholder {
    font-size: 13px !important;
    line-height: 1.35 !important;
}

/* --- ABA BÍBLIA & MARCA-TEXTO --- */
.bible-text, .bible-text * { user-select: text; -webkit-user-select: text; }
.bible-text { font-family: Georgia, 'Times New Roman', serif; color: var(--text-body); line-height: 1.85; font-size: var(--bible-font-size, 1.05rem); }
.bible-text * { font-family: inherit; font-size: inherit; }
.bible-verse {
    display: inline;
    border-radius: 6px;
    padding: 2px 3px;
    margin: 0 -1px;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.bible-verse:hover { background: rgba(255, 255, 255, 0.05); }
.light-theme .bible-verse:hover { background: rgba(0, 0, 0, 0.04); }
.bible-verse sup { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 0.62em; color: #fb8500; margin-right: 3px; user-select: none; }
.bible-verse.flash { background: rgba(255, 183, 3, 0.28); }
.bible-verse.verse-selected {
    background: rgba(33, 158, 188, 0.22);
    box-shadow: inset 0 -2px 0 #38bdf8;
}

/* Cores do Marca-Texto na Bíblia */
.bible-verse.hl-yellow { background: rgba(250, 204, 21, 0.26); color: #fef9c3; }
.bible-verse.hl-green  { background: rgba(74, 222, 128, 0.24); color: #dcfce7; }
.bible-verse.hl-blue   { background: rgba(56, 189, 248, 0.25); color: #e0f2fe; }
.bible-verse.hl-rose   { background: rgba(251, 113, 133, 0.26); color: #ffe4e6; }
.bible-verse.hl-purple { background: rgba(192, 132, 252, 0.26); color: #f3e8ff; }

.light-theme .bible-verse.hl-yellow { background: rgba(250, 204, 21, 0.42); color: #0f172a; }
.light-theme .bible-verse.hl-green  { background: rgba(74, 222, 128, 0.36); color: #0f172a; }
.light-theme .bible-verse.hl-blue   { background: rgba(56, 189, 248, 0.34); color: #0f172a; }
.light-theme .bible-verse.hl-rose   { background: rgba(251, 113, 133, 0.34); color: #0f172a; }
.light-theme .bible-verse.hl-purple { background: rgba(192, 132, 252, 0.34); color: #0f172a; }

.bible-verse.verse-selected.hl-yellow,
.bible-verse.verse-selected.hl-green,
.bible-verse.verse-selected.hl-blue,
.bible-verse.verse-selected.hl-rose,
.bible-verse.verse-selected.hl-purple {
    box-shadow: inset 0 -2.5px 0 #ffffff, 0 0 0 1px rgba(56, 189, 248, 0.65);
}
.light-theme .bible-verse.verse-selected {
    box-shadow: inset 0 -2.5px 0 #0284c7;
}

.hl-swatch {
    width: 28px; height: 28px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease, border-color 0.15s ease; flex-shrink: 0;
}
.hl-swatch:active { transform: scale(0.88); }
.hl-swatch.active { border-color: #ffffff; transform: scale(1.12); box-shadow: 0 0 12px rgba(255, 255, 255, 0.4); }

.bible-chip {
    padding: 9px 4px; border-radius: 14px; font-weight: 900; font-size: 12px; text-align: center;
    background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-title);
    transition: transform 0.1s;
}
.bible-chip:active { transform: scale(0.95); }
.bible-chip.current { background: rgba(255, 183, 3, 0.15); border-color: rgba(255, 183, 3, 0.45); color: #ffb703; }
.bible-chip.read { background: rgba(45, 198, 83, 0.12); border-color: rgba(45, 198, 83, 0.35); color: #2dc653; }
.bible-skeleton { height: 14px; border-radius: 8px; background: var(--input-bg); animation: bibleSkel 1.2s ease-in-out infinite alternate; }

/* --- BARRA FLUTUANTE DE AÇÃO DO VERSÍCULO (MARCA-TEXTO + IA) --- */
#bible-verse-toolbar {
    max-width: 620px;
    margin-inline: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 8px);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, bottom 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 85;
}
@media (min-width: 1024px) and (min-height: 600px), (min-width: 768px) and (min-height: 600px) and (orientation: landscape) {
    #bible-verse-toolbar {
        bottom: 16px;
    }
}
.ios-standalone #bible-verse-toolbar {
    bottom: max(calc(88px + env(safe-area-inset-bottom, 24px) + 8px), 100px);
}
#bible-verse-toolbar:not(.hidden) {
    animation: verseToolbarIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body:not(.bible-active) #bible-verse-toolbar {
    display: none !important;
}

/* Espaço de respiro para rolar o final do capítulo sem que versículos fiquem escondidos */
body.audio-dock-open #tab-bible {
    padding-bottom: max(calc(240px + env(safe-area-inset-bottom, 0px)), 240px) !important;
}
body.verse-toolbar-open #tab-bible {
    padding-bottom: max(calc(220px + env(safe-area-inset-bottom, 0px)), 220px) !important;
}
body.audio-dock-open.verse-toolbar-open #tab-bible {
    padding-bottom: max(calc(370px + env(safe-area-inset-bottom, 0px)), 370px) !important;
}

/* --- MODO FOCO DA BÍBLIA (LEITURA LIMPA E IMERSIVA) --- */
body.bible-focus-active #app-header { display: none !important; }
body.bible-focus-active .bottom-nav-bar { display: none !important; }
body.bible-focus-active .ai-fab-btn { display: none !important; }
body.bible-focus-active #bible-highlight-hint { display: none !important; }
body.bible-focus-active #bible-credit { display: none !important; }
body.bible-focus-active #bible-toolbar-row { display: none !important; }
body.bible-focus-active #bible-focus-bar { display: flex !important; }
body.bible-focus-active #tab-bible {
    padding-top: max(calc(12px + env(safe-area-inset-top, 0px)), 12px) !important;
    padding-bottom: max(calc(55px + env(safe-area-inset-bottom, 0px)), 55px) !important;
}
body.bible-focus-active.audio-dock-open #tab-bible {
    padding-bottom: max(calc(200px + env(safe-area-inset-bottom, 0px)), 200px) !important;
}
body.bible-focus-active #bible-content {
    padding: 24px 20px !important;
    border-radius: 24px !important;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4) !important;
}
body.bible-focus-active .bible-verse {
    line-height: 1.85 !important;
}

/* --- PLAYER DE ÁUDIO BÍBLICO (DOMÍNIO PÚBLICO / ALMEIDA) --- */
#bible-audio-dock {
    max-width: 620px;
    margin-inline: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 8px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    z-index: 70;
}
@media (min-width: 1024px) and (min-height: 600px), (min-width: 768px) and (min-height: 600px) and (orientation: landscape) {
    #bible-audio-dock {
        bottom: 16px;
    }
}
#bible-audio-dock.dock-hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
}

.audio-progress-slider {
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 70%, transparent);
}
.audio-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.audio-progress-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
.audio-progress-slider::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
    cursor: pointer; border: none;
}

.audio-equalizer {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}
.audio-equalizer span {
    width: 2.5px;
    background: #38bdf8;
    border-radius: 2px;
    animation: audioEqWave 0.8s ease-in-out infinite alternate;
}
.audio-equalizer span:nth-child(1) { height: 35%; animation-delay: 0.1s; }
.audio-equalizer span:nth-child(2) { height: 95%; animation-delay: 0.35s; }
.audio-equalizer span:nth-child(3) { height: 60%; animation-delay: 0.2s; }

.bible-verse.verse-speaking {
    background: rgba(56, 189, 248, 0.28) !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45), inset 0 -2px 0 #38bdf8 !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.light-theme .bible-verse.verse-speaking {
    background: rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.35), inset 0 -2px 0 #0284c7 !important;
}
#btn-bible-audio-toggle.audio-playing {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    box-shadow: none;
}
.light-theme #btn-bible-audio-toggle.audio-playing {
    background: rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.4);
    color: #0284c7;
    box-shadow: none;
}

/* Quando o player de áudio estiver aberto na Bíblia, a barra sobe graciosamente ficando logo acima dele */
body.audio-dock-open #bible-verse-toolbar {
    bottom: max(calc(234px + env(safe-area-inset-bottom, 0px)), 234px) !important;
}
@media (min-width: 1024px) and (min-height: 600px), (min-width: 768px) and (min-height: 600px) and (orientation: landscape) {
    body.audio-dock-open #bible-verse-toolbar {
        bottom: 172px !important;
    }
}
.ios-standalone body.audio-dock-open #bible-verse-toolbar,
body.audio-dock-open.ios-standalone #bible-verse-toolbar {
    bottom: max(calc(255px + env(safe-area-inset-bottom, 24px)), 270px) !important;
}

/* --- MENTOR TEOLÓGICO (IA COM GEMINI) --- */
.ai-fab-btn {
    position: absolute;
    right: 14px;
    bottom: max(calc(env(safe-area-inset-bottom, 0px) + 72px), 80px);
    height: 38px;
    padding: 0 14px 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1b3848 0%, #254d60 55%, #1a4f66 100%);
    border: 1px solid rgba(160, 203, 229, 0.45);
    box-shadow: 0 6px 20px rgba(18, 48, 66, 0.38), 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.35);
    color: #ffffff;
    display: none;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 800;
    z-index: 65;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, opacity 0.25s ease, bottom 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}
.light-theme .ai-fab-btn {
    background: linear-gradient(135deg, #254d60 0%, #1a3847 100%);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(35, 75, 94, 0.28), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}
.ai-fab-btn:hover {
    box-shadow: 0 8px 24px rgba(37, 77, 96, 0.5), inset 0 1.5px 3px rgba(255, 255, 255, 0.5);
    border-color: rgba(254, 240, 138, 0.85);
    transform: scale(1.02);
}
.ai-fab-btn:active { transform: scale(0.95) !important; }

/* Suavização da pílula do Mentor IA durante rolagem no leitor bíblico para não obstruir versículos */
body.bible-scrolling .ai-fab-btn {
    opacity: 0.28 !important;
    transform: scale(0.92);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#modal-onboarding {
    padding: 0 !important;
    background: rgba(5, 8, 18, 0.88) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
body:not(.light-theme) #modal-onboarding,
.dark-theme #modal-onboarding {
    background: rgba(5, 8, 18, 0.90) !important;
}

.ai-fab-halo {
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 1.5px solid rgba(160, 203, 229, 0.35);
    pointer-events: none;
    animation: aiFabHalo 2.4s ease-in-out infinite alternate;
}
.ai-fab-icon-box {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.1) 70%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}
.ai-fab-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}
.ai-fab-sparkle {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aiFabSparkle 2s ease-in-out infinite;
}

body.bible-active:not(.verse-toolbar-open):not(.app-booting) .ai-fab-btn {
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
@media (min-width: 1024px) {
    .ai-fab-btn {
        bottom: 32px !important;
        right: 32px !important;
    }
}
body.audio-dock-open .ai-fab-btn {
    bottom: max(calc(240px + env(safe-area-inset-bottom, 0px)), 240px) !important;
}
@media (min-width: 1024px) and (min-height: 600px), (min-width: 768px) and (min-height: 600px) and (orientation: landscape) {
    body.audio-dock-open .ai-fab-btn {
        bottom: 175px !important;
    }
}
@media (min-width: 1024px) {
    body.audio-dock-open .ai-fab-btn {
        bottom: 175px !important;
        right: 28px;
    }
}
.ios-standalone body.audio-dock-open .ai-fab-btn,
body.audio-dock-open.ios-standalone .ai-fab-btn {
    bottom: max(calc(255px + env(safe-area-inset-bottom, 24px)), 270px) !important;
}

.ai-msg-bubble { user-select: text; -webkit-user-select: text; line-height: 1.55; word-break: break-word; }
.ai-msg-bubble p + p { margin-top: 0.55rem; }
.ai-msg-bubble ul { list-style-type: disc; padding-left: 1.15rem; margin-top: 0.4rem; margin-bottom: 0.4rem; }
.ai-msg-bubble li + li { margin-top: 0.25rem; }
.ai-typing-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #38bdf8;
    display: inline-block; animation: aiDotPulse 1.2s infinite ease-in-out;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* --- TOASTS & FLOATING PILLS (Apple Dynamic Pill Minimalista) --- */
.floating-pill {
    position: fixed;
    top: max(16px, calc(env(safe-area-inset-top, 16px) + 10px));
    left: 50%;
    transform: translateX(-50%) translateY(-8px) scale(0.96);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 7px 16px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    z-index: 99999;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: min(90vw, 340px);
    text-align: center;
    line-height: 1.3;
    opacity: 0;
    box-sizing: border-box;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.floating-pill.pill-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
.floating-pill.pill-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.96);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .floating-pill,
body.light-theme .floating-pill {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(24, 62, 80, 0.18) !important;
    color: #0f172a !important;
    box-shadow: 0 16px 40px rgba(24, 62, 80, 0.20), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}
.light-theme .floating-pill span,
body.light-theme .floating-pill span,
.light-theme .floating-pill .theme-text-title,
body.light-theme .floating-pill .theme-text-title {
    color: #0f172a !important;
}
.light-theme .floating-pill .text-brand-yellow,
body.light-theme .floating-pill .text-brand-yellow {
    color: #d97706 !important;
}

/* --- LOUNGE DE AMIGOS --- */
.lounge-stage-card {
    background: radial-gradient(circle at 50% 80%, rgba(251, 133, 0, 0.16) 0%, rgba(19, 27, 46, 0.92) 60%, #090d16 100%);
    border: 1px solid rgba(255, 183, 3, 0.28);
    position: relative;
    flex-shrink: 0;
}
.light-theme .lounge-stage-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(24, 62, 80, 0.14) !important;
    box-shadow: 0 12px 36px rgba(24, 62, 80, 0.08) !important;
    color: #0f172a !important;
}
.light-theme .lounge-stage-card .theme-text-muted {
    color: #475569 !important;
}
.light-theme .visit-subtabs-track {
    background: rgba(24, 62, 80, 0.06) !important;
    border: 1px solid rgba(24, 62, 80, 0.12) !important;
}
.lounge-flame-wrap {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    transform: scale(0.76); transform-origin: bottom center; height: 122px; position: relative;
}
.lounge-flame-wrap .pedestal-base { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%) scale(0.92); z-index: 5; }
.lounge-flame-wrap .classic-flame-body { margin-bottom: 14px; position: relative; z-index: 10; }

#modal-consent .ob-card-sheet {
    border-radius: 24px;
    max-height: 92dvh;
    background: linear-gradient(180deg, rgba(19, 29, 49, 0.98) 0%, rgba(11, 17, 30, 0.99) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.28);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78), 0 0 40px rgba(251, 133, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.light-theme #modal-consent .ob-card-sheet {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1.5px solid rgba(24, 62, 80, 0.16) !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), inset 0 1px 0 #ffffff !important;
}

/* --- FULL-SCREEN VIBRANT STORIES ONBOARDING --- */
#modal-onboarding .ob-card-sheet {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    padding: max(calc(env(safe-area-inset-top, 12px) + 14px), 22px) 24px max(calc(env(safe-area-inset-bottom, 12px) + 20px), 26px) !important;
    box-shadow: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    color: #ffffff !important;
    transition: background 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 640px) {
    #modal-onboarding .ob-card-sheet {
        width: min(420px, 92vw) !important;
        max-width: 420px !important;
        height: min(820px, 92dvh) !important;
        max-height: 92dvh !important;
        border-radius: 24px !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        padding: 28px !important;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45) !important;
    }
}

/* 7 Paletas Vivas estilo Poster Stories + Card 0 Litúrgico (independente de light/dark theme) */
#modal-onboarding[data-ob-theme="intro"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="intro"] .ob-card-sheet {
    background: linear-gradient(175deg, #0b223d 0%, #07192f 52%, #041527 100%) !important;
}
#modal-onboarding[data-ob-theme="0"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="0"] .ob-card-sheet {
    background: linear-gradient(175deg, #311042 0%, #1E1B4B 55%, #0F172A 100%) !important;
}
#modal-onboarding[data-ob-theme="0"][data-ob-lit="true"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="0"][data-ob-lit="true"] .ob-card-sheet {
    background: linear-gradient(175deg, #FF542E 0%, #FF7B1C 55%, #FFB703 100%) !important;
}
#modal-onboarding[data-ob-theme="1"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="1"] .ob-card-sheet {
    background: linear-gradient(175deg, #38BDF8 0%, #0284C7 55%, #1D4ED8 100%) !important;
}
#modal-onboarding[data-ob-theme="2"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="2"] .ob-card-sheet {
    background: linear-gradient(175deg, #FB7185 0%, #E11D48 52%, #EA580C 100%) !important;
}
#modal-onboarding[data-ob-theme="3"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="3"] .ob-card-sheet {
    background: linear-gradient(175deg, #65A30D 0%, #15803D 52%, #064E3B 100%) !important;
}
#modal-onboarding[data-ob-theme="4"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="4"] .ob-card-sheet {
    background: linear-gradient(175deg, #06B6D4 0%, #0E7490 52%, #1E1B4B 100%) !important;
}
#modal-onboarding[data-ob-theme="5"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="5"] .ob-card-sheet {
    background: linear-gradient(175deg, #8B5CF6 0%, #6D28D9 52%, #3B0764 100%) !important;
}
#modal-onboarding[data-ob-theme="6"] .ob-card-sheet,
.light-theme #modal-onboarding[data-ob-theme="6"] .ob-card-sheet {
    background: linear-gradient(175deg, #F97316 0%, #EA580C 52%, #9A3412 100%) !important;
}

#modal-onboarding #ob-badge {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: #ffffff !important;
    padding: 4px 12px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#modal-onboarding #ob-title {
    color: #ffffff !important;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
}
#modal-onboarding #ob-text {
    color: rgba(255, 255, 255, 0.92) !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.16);
}
#modal-onboarding #ob-skip {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.30) !important;
    color: #ffffff !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
#modal-onboarding #ob-prev {
    background: rgba(255, 255, 255, 0.20) !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    color: #ffffff !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
#modal-onboarding #ob-next {
    background: #ffffff !important;
    color: #0f172a !important;
    font-weight: 900 !important;
    border-radius: 999px !important;
    border: none !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
    text-shadow: none !important;
}
#modal-onboarding #ob-next::before,
#modal-onboarding #ob-next::after {
    display: none !important;
}

#modal-onboarding .ob-stage-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 1 1 auto;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.light-theme #modal-onboarding .ob-stage-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#modal-onboarding .ob-dot {
    flex: 1;
    height: 5px;
    min-width: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    transition: all .32s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}
#modal-onboarding .ob-dot:hover {
    background: rgba(255, 255, 255, 0.65);
}
#modal-onboarding .ob-dot.done,
#modal-onboarding .ob-dot.on {
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.72);
    opacity: 1;
}

#modal-onboarding .ob-step-animate { animation: obStepFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes obStepFadeIn {
    from { opacity: 0.45; transform: translateY(6px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#modal-onboarding .ob-setup-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.92) !important;
    border-radius: 24px;
    padding: 14px 16px;
    text-align: left;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.20) !important;
    color: #0f172a !important;
}
.light-theme #modal-onboarding .ob-setup-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16) !important;
}
#modal-onboarding .ob-setup-card input {
    background: #f1f5f9 !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
}
#modal-onboarding .ob-setup-card input:focus {
    background: #ffffff !important;
    border-color: #f97316 !important;
}
#modal-onboarding .ob-setup-card .ob-handle-input-wrap {
    background: #f1f5f9 !important;
    border: 1.5px solid #cbd5e1 !important;
}
#modal-onboarding .ob-setup-card .ob-handle-input-wrap:focus-within {
    background: #ffffff !important;
    border-color: #ea580c !important;
}
#modal-onboarding .ob-setup-card .ob-handle-input-wrap input {
    background: transparent !important;
    border: none !important;
}

@keyframes obBreathRing {
    0%, 100% { transform: scale(0.90); opacity: 0.9; }
    50% { transform: scale(1.06); opacity: 1; }
}
.ob-anim-breath {
    animation: obBreathRing 3.6s ease-in-out infinite;
}
@keyframes obPulseWave {
    0% { transform: scale(0.85); opacity: 0.85; }
    100% { transform: scale(1.45); opacity: 0; }
}
.ob-anim-wave {
    animation: obPulseWave 1.9s ease-out infinite;
}
@keyframes obFloatSoft {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}
.ob-anim-float {
    animation: obFloatSoft 2.8s ease-in-out infinite;
}

/* Story 3: Cartão Interativo de Cuidado (Barras Quase Vazias + Botões) */
#modal-onboarding .ob-care-demo-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 2px solid #ffffff !important;
    border-radius: 26px;
    padding: 12px 13px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24) !important;
    color: #0f172a !important;
}
#modal-onboarding .ob-care-bar-track {
    height: 7px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
#modal-onboarding .ob-care-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.52s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.35s ease;
}
#modal-onboarding .ob-care-bar-fill.is-low {
    animation: obCareLowPulse 1.3s ease-in-out infinite;
}
@keyframes obCareLowPulse {
    0%, 100% { opacity: 1; filter: saturate(1); }
    50% { opacity: 0.68; filter: saturate(1.3); }
}
#modal-onboarding .ob-care-btn {
    border-radius: 16px;
    padding: 8px 4px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a !important;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
#modal-onboarding .ob-care-btn:hover {
    background: #fff7ed;
    border-color: #fb923c;
    transform: translateY(-1px);
}
#modal-onboarding .ob-care-btn.is-cured {
    background: #ecfdf5;
    border-color: #34d399;
    color: #065f46 !important;
}
