/* ============================================
   DESIGN SYSTEM MULTIMARCA
   
   Colors:
   Primary: #0D0D0D (Preto profundo - base logo MV)
   PrimaryLight: #1a1a1a (Preto suave)
   Accent: #f5c518 (Amarelo vitória)
   Text: #111111 (Texto principal)
   TextMuted: #6B7280 (Texto secundário)
   Background: #F7F7F7 (Fundo)
============================================ */

/* ============ DESIGN TOKENS ============ */
:root {
    --primary: #0D0D0D;
    --primary-light: #1a1a1a;
    --primary-dark: #000000;
    --secondary: #E5E7EB;
    --accent: #f5c518;
    --accent-dark: #c9a227;
    --accent-rgb: 245, 197, 24;
    --primary-rgb: 13, 13, 13;
    --on-accent: #111111;
    --nav-surface: #111111;
    --rose: #f5c518;
    --rose-light: #f9d96a;
    --rose-pale: #fdf6dc;
    --text: #111111;
    --text-muted: #6B7280;
    --background: #F7F7F7;
    --white: #FFFFFF;
    --error: #E74C3C;
    --success: #2ECC71;

    /* Glass & Surfaces */
    --surface-card: rgba(255, 255, 255, 0.97);
    --surface-glass: rgba(255, 255, 255, 0.85);
    --border-subtle: rgba(245, 197, 24, 0.25);

    /* Shadows */
    --card-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.16);
    --glow-gold: 0 0 30px rgba(245, 197, 24, 0.30);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0D0D0D 0%, #1a1a1a 100%);
    --gradient-accent: linear-gradient(135deg, #c9a227 0%, #f5c518 50%, #c9a227 100%);
    --gradient-hero: linear-gradient(135deg, #000000 0%, #0D0D0D 40%, #111111 100%);

    /* Brand glow */
    --rose-glow: 0 0 40px rgba(245, 197, 24, 0.25);

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Typography - Fluid */
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-sm: clamp(0.8rem, 0.75rem + 0.3vw, 0.95rem);
    --fs-base: clamp(0.9rem, 0.85rem + 0.3vw, 1.05rem);
    --fs-md: clamp(1.1rem, 0.9rem + 1vw, 1.5rem);
    --fs-lg: clamp(1.3rem, 1rem + 1.5vw, 2rem);
    --fs-xl: clamp(1.8rem, 1.2rem + 3vw, 3.2rem);

    /* Spacing - Fluid */
    --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --space-lg: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    --space-xl: clamp(2rem, 1.2rem + 3.5vw, 4rem);

    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: color 0.3s var(--ease-smooth), background-color 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth), opacity 0.3s var(--ease-smooth);
}

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* clip e nao hidden: com hidden no html E no body, o body vira um container
   de rolagem proprio, o position: sticky da .feed-top para de grudar no topo
   e o feed passa por baixo do relogio do iPhone (o iOS 26 borra esse
   conteudo, a "nuvem branca"). hidden fica so como fallback. */
html {
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============ ROSA DECORATIVA SVG ============ */
.rose-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.07;
    z-index: 0;
}

.rose-decoration--login-top {
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    opacity: 0.10;
}

.rose-decoration--login-bottom {
    bottom: -30px;
    left: -30px;
    width: 150px;
    height: 150px;
    opacity: 0.08;
    transform: rotate(180deg);
}

.rose-decoration--hero {
    top: 10px;
    right: 20px;
    width: 120px;
    height: 120px;
    opacity: 0.08;
}

/* Pétalas flutuantes (login) */
@keyframes petalFloat {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.petal {
    position: fixed;
    width: 12px;
    height: 12px;
    background: radial-gradient(ellipse, var(--rose-light) 0%, var(--rose) 100%);
    border-radius: 50% 0 50% 0;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.petal--1 { left: 10%; animation: petalFloat 8s 0s infinite ease-in; }
.petal--2 { left: 25%; animation: petalFloat 10s 2s infinite ease-in; width: 8px; height: 8px; }
.petal--3 { left: 50%; animation: petalFloat 9s 4s infinite ease-in; }
.petal--4 { left: 70%; animation: petalFloat 11s 1s infinite ease-in; width: 10px; height: 10px; }
.petal--5 { left: 85%; animation: petalFloat 8.5s 3s infinite ease-in; width: 14px; height: 14px; }
.petal--6 { left: 40%; animation: petalFloat 12s 5s infinite ease-in; width: 9px; height: 9px; }

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

/* ============ PRELOADER ============ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    width: min(100%, 420px);
    max-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader__rings {
    position: relative;
    width: 80px;
    height: 80px;
}

.ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
}

.ring--1 {
    inset: 0;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

.ring--2 {
    inset: 8px;
    border-right-color: var(--secondary);
    animation: spin 1.5s linear infinite reverse;
}

.ring--3 {
    inset: 16px;
    border-bottom-color: var(--accent);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.preloader__text {
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.preloader__logo {
    width: clamp(64px, 18vw, 104px);
    height: clamp(64px, 18vw, 104px);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    object-fit: cover;
    object-position: center;
}

body[data-brand="amem"] .preloader__logo {
    width: clamp(150px, 50vw, 210px);
    height: clamp(150px, 50vw, 210px);
    margin: 0 0 14px;
    border-radius: 0;
}

body[data-brand="amem"] .preloader__content { gap: 18px; }
body[data-brand="amem"] .preloader__rings { margin-top: 0; }

@media (max-height: 620px) {
    body[data-brand="amem"] .preloader__logo {
        width: 140px;
        height: 140px;
        margin-bottom: 4px;
    }
    .preloader__rings { transform: scale(.82); margin-block: -7px; }
}

/* ============ NAVBAR ============ */
#mainNav {
    background: var(--gradient-primary) !important;
    /* Sem backdrop-filter: em position:fixed o WebKit (Safari iOS) desloca a
       barra. O gradiente opaco ja basta. */
    box-shadow: 0 4px 30px rgba(27, 38, 59, 0.3);
    /* iPhone: o app ocupa a tela inteira (viewport-fit=cover). O fundo da
       barra cobre a area do relogio/bateria e o conteudo comeca abaixo dela;
       sem isso logo e botoes ficavam por baixo da barra de status, borrados. */
    padding: calc(0.4rem + env(safe-area-inset-top, 0px)) 0 0.4rem;
    border-bottom: 1px solid #000;
}

/* Offcanvas Menu Mobile */
.nav-offcanvas {
    background: #0b0b0b;
    width: min(78vw, 340px) !important;
    border: 0;
    color: #fff;
}
.nav-offcanvas-header {
    min-height: calc(88px + env(safe-area-inset-top, 0px));
    background: #111;
    padding: calc(17px + env(safe-area-inset-top, 0px)) 18px 17px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-offcanvas-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}
.nav-offcanvas-profile {
    min-width: 0;
    color: inherit;
    text-decoration: none;
    line-height: 1.2;
}
.nav-offcanvas-profile > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-offcanvas-profile small {
    color: var(--accent-dark);
    font-size: .82rem;
}
.nav-offcanvas-profile:hover small { text-decoration: underline; }
.nav-offcanvas-body {
    padding: 14px 11px calc(76px + env(safe-area-inset-bottom));
    background: #0b0b0b;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}
.nav-offcanvas-item {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 49px;
    padding: 12px 15px;
    border-radius: 11px;
    color: rgba(255,255,255,0.76);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.91rem;
    transition: var(--transition);
}
.nav-offcanvas-item-action {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.nav-offcanvas-item i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    color: var(--accent);
    opacity: 1;
}
/* Icones em SVG inline na navegacao (substituem a fonte Tabler) */
.nav-offcanvas-item .nav-svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
    opacity: 1;
    flex-shrink: 0;
}
.nav-offcanvas-item:hover,
.nav-offcanvas-item.active {
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--accent);
}
.nav-offcanvas-item:hover i,
.nav-offcanvas-item.active i {
    opacity: 1;
}
.nav-offcanvas-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-offcanvas .btn-close {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    opacity: 0.72;
    box-shadow: none;
}

.offcanvas-backdrop.show { opacity: 0.58; }

@media (max-width: 575.98px) {
    .nav-offcanvas-footer { display: none; }
}

/* Botão Sair em destaque no menu offcanvas */
.nav-offcanvas-item-sair {
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #ff6b6b !important;
}
.nav-offcanvas-item-sair i {
    color: #ff6b6b !important;
    opacity: 1 !important;
}
.nav-offcanvas-item-sair:hover {
    background: rgba(255,107,107,0.12) !important;
    color: #ff4444 !important;
}

/* Botão sino de notificação na navbar mobile */
.btn-notif-mobile {
    position: relative;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    padding: 4px 6px;
    margin-right: 4px;
    line-height: 1;
    cursor: pointer;
}
.btn-notif-mobile:hover { opacity: 0.8; }
.notif-badge-pill {
    font-size: 0.6rem;
    min-width: 18px;
}

/* Botão voltar elegante */
.input-codigo-unico {
    background: var(--secondary);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: default;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-subtle);
    background: var(--surface-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}
.btn-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
}

#mainNav .navbar-brand {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    font-weight: 700;
}

#mainNav .navbar-brand img {
    transition: transform 0.3s var(--ease-spring);
}

#mainNav .navbar-brand:hover img {
    transform: scale(1.1);
}

#mainNav .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-size: var(--fs-sm);
    position: relative;
    white-space: nowrap;
}

/* Navbar desktop em duas linhas, mas com altura estavel entre as rotas.
   As abas rolam horizontalmente quando nao cabem; deixar quebrar a linha fazia
   cada pagina comecar numa altura diferente e dava a impressao de zoom/salto. */
@media (min-width: 992px) {
    /* overflow-x: hidden no html/body cria um contexto de rolagem que quebra o
       sticky; clip corta igual sem esse efeito colateral. */
    html, body { overflow-x: clip; }

    #mainNav.fixed-top { position: sticky; }
    #mainNav { padding-bottom: 0; }
    #mainNav > .container-fluid { flex-wrap: wrap; }

    #mainNav .nav-abas {
        order: 3;
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 2px;
        margin-top: 6px;
        padding: 4px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        overscroll-behavior-inline: contain;
    }
    #mainNav .nav-abas::-webkit-scrollbar { display: none; }
    #mainNav .nav-abas .nav-link { padding: 0.45rem 0.8rem; }

    /* body + classe: vence as regras de .main-content definidas mais abaixo */
    body .main-content,
    body .main-content--sem-topo { padding-top: 24px; }
}

/* Neste intervalo ha espaco para o menu desktop, mas nao para 13 rotulos com
   icones e folgas grandes. A versao compacta mantem uma unica linha. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    #mainNav .nav-abas .nav-link {
        padding-inline: 0.58rem;
        font-size: 0.8rem;
    }
    #mainNav .nav-abas .nav-link i,
    #mainNav .nav-abas .nav-link .nav-svg,
    #mainNav .navbar-brand-sub,
    #mainNav .nav-usuario > span { display: none !important; }
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.1);
}

#mainNav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

.bg-accent {
    background-color: var(--accent) !important;
    color: var(--on-accent) !important;
    font-weight: 600;
}

.icon-3xl { font-size: 3rem; }

.evento-info-card { border-left: 4px solid var(--accent); }

/* ── Overlay de carregamento leve (só os anéis, sem fundo escuro) ── */
.att-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── Grid responsivo genérico (cards no mobile, tabela no desktop) ── */
.resp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.resp-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 12px;
    transition: var(--transition);
}

.resp-card:active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
}

.resp-card-title {
    font-size: 0.85rem;
    line-height: 1.3;
}

.resp-card-sub {
    font-size: 0.75rem;
}

/* ── Lista responsiva (1 coluna, separada por bordas) ── */
.resp-list { display: flex; flex-direction: column; }

.resp-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.resp-list-item:last-child { border-bottom: none; }

/* ============ MAIN CONTENT ============ */
.main-content {
    padding-top: calc(72px + env(safe-area-inset-top, 0px));
    padding-bottom: 90px;
    min-height: 100vh;
}

/* Pagina com barra superior propria (feed): sem o espaco da navbar fixa,
   mas mantendo o espaco do menu inferior. */
.main-content--sem-topo { padding-top: 0; }

/* A safe area superior fica sempre lisa e escura nas telas sem barra propria.
   No feed, a propria .feed-top cobre essa area. Fora do iPhone a altura e 0. */
body:not(:has(.feed-top))::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: #111;
    z-index: 1020;
    pointer-events: none;
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: 20px;
    }
}

/* ============ BOTTOM NAV MOBILE ============ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* Tab bar escura como a do Instagram: preta, sem sombra e com um fio de
       separacao discreto no topo. */
    background: var(--nav-surface, #0b0b0b);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px max(4px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
    z-index: 1050;
    border-top: 1px solid #262626;
    /* Sem backdrop-filter: em position:fixed o WebKit (Safari iOS) desloca a
       barra para o meio da tela. O fundo opaco ja basta. */
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #a8a8a8;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 4px 2px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    /* divide a largura por igual: com 6 itens o min-width fixo estourava
       a tela (6 x 64px > 390px) e cortava "Inicio" e "Relatorio" */
    flex: 1 1 0;
    min-width: 0;
    max-width: 5.5rem;
    min-height: 44px;
    justify-content: center;
}

.bottom-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
    transition: var(--transition);
}
.bottom-nav-item .nav-svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 2px;
}

/* Ativo em branco, como no Instagram — o dourado da marca fica para os
   elementos de conteudo, nao para a navegacao. */
.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #fff;
}

.bottom-nav-item.active i {
    transform: scale(1.15);
}

/* Ícone personalizado de Bíblia (SVG) */
/* SVG inline no bottom-nav: mesmo comportamento que Bootstrap Icons */
.bottom-nav-item .nav-svg {
    transition: var(--transition);
    line-height: 1;
}
.bottom-nav-item:hover .nav-svg,
.bottom-nav-item.active .nav-svg {
    transform: scale(1.15);
}
.nav-offcanvas-item:hover .nav-svg,
.nav-offcanvas-item.active .nav-svg {
    opacity: 1;
}

/* ============ LOGIN PAGE ============ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Efeito de pétalas de fundo no login */
.login-container::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}


.login-card {
    background: var(--surface-card);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: clamp(32px, 5vw, 48px) clamp(28px, 4vw, 40px);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), var(--glow-gold);
    text-align: center;
    animation: slideUp 0.6s var(--ease-spring);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.login-card--narrow { max-width: 440px; }

.login-title-sm { font-size: 1.5rem; }

.login-subtitle-sm {
    color: var(--text-muted);
    font-size: .9rem;
}

.login-separator { font-size: .8rem; }

.login-first-access {
    font-size: .82rem;
    color: var(--text-muted);
    text-decoration: none;
    opacity: .7;
    transition: opacity .2s;
}

.login-first-access:hover { opacity: 1; color: var(--accent); }

.push-banner-toast {
    background: rgba(30, 15, 40, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff;
}

/* PWA Install Modal */
.pwa-modal-content {
    background: var(--gradient-primary);
    border: 1.5px solid var(--accent) !important;
    border-radius: 20px;
    overflow: hidden;
}

.pwa-modal-logo {
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    object-fit: cover;
}

.pwa-modal-title {
    color: var(--accent);
}

img, svg, video, canvas { max-width: 100%; }
.table-responsive { max-width: 100%; }

@media (max-width: 575.98px) {
    .main-content { padding-top: calc(64px + env(safe-area-inset-top, 0px)); padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
    .content-card { border-radius: var(--radius-lg); }
    .content-card .card-body { padding: var(--space-sm); }
    .modal-dialog { margin: 12px; }
    .pwa-modal-content { max-height: calc(100dvh - 24px); overflow-y: auto; }
}

.dashboard-confession-card { background: var(--gradient-primary); }
.dashboard-confession-icon {
    background: var(--accent);
    color: var(--on-accent);
}

/* Barra do topo tem 56px: o logo precisa caber dentro dela, senao o
   circulo e o texto "A MAIOR EMPREENDEDORA DO MUNDO" ficam cortados. */
body[data-brand="amem"] .navbar-logo {
    width: 46px;
    height: 46px;
    margin: 0 6px 0 -6px;
    border-radius: 0;
    object-fit: contain;
}
body[data-brand="amem"] .nav-offcanvas-avatar {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 0;
    object-fit: contain;
}
body[data-brand="amem"] .pwa-modal-logo {
    width: 72px;
    height: 72px;
    margin: -10px -4px -10px -8px;
    border: 0;
    border-radius: 0;
    object-fit: contain;
}
body[data-brand="amem"] .pwa-modal-content {
    background: var(--gradient-primary);
    box-shadow: 0 22px 70px rgba(var(--primary-rgb), .5);
}
body[data-brand="amem"] .pwa-modal-content .text-muted {
    color: rgba(255,255,255,.66) !important;
}
body[data-brand="amem"] .pwa-modal-content .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255,255,255,.55);
}

/* Bootstrap também deve respeitar a identidade AMEM, inclusive componentes
   carregados dinamicamente e estados que antes apareciam em amarelo/preto. */
body[data-brand="amem"] .text-warning { color: var(--accent) !important; }
body[data-brand="amem"] .bg-warning,
body[data-brand="amem"] .text-bg-warning {
    background-color: var(--accent) !important;
    color: var(--on-accent) !important;
}
body[data-brand="amem"] .bg-dark,
body[data-brand="amem"] .text-bg-dark {
    background-color: var(--primary) !important;
    color: #fff !important;
}
body[data-brand="amem"] .btn-outline-warning {
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}
body[data-brand="amem"] .btn-outline-warning:hover {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
}

.notif-badge-fs { font-size: .65rem; }

.login-panel-cadastro { display: none; text-align: left; }

.input-readonly-code {
    background: rgba(255, 255, 255, .07);
    cursor: not-allowed;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card h1 {
    color: var(--primary);
    font-weight: 800;
    font-size: var(--fs-lg);
    margin-bottom: 8px;
    line-height: 1.15;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    font-size: var(--fs-sm);
}

.btn-login-admin {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--fs-sm);
    width: 100%;
    transition: var(--transition);
    letter-spacing: 0.5px;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

.btn-login-admin::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(var(--accent-rgb), 0.15) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-login-admin:hover::after {
    transform: translateX(100%);
}

.btn-login-admin:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(27, 38, 59, 0.35);
}

.btn-login-member {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--fs-sm);
    width: 100%;
    transition: var(--transition);
    letter-spacing: 0.5px;
    min-height: 50px;
}

.btn-login-member:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ============ DASHBOARD ============ */
.hero-card {
    background: var(--gradient-hero);
    border-radius: var(--radius-2xl);
    padding: var(--space-lg);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(27, 38, 59, 0.25);
    position: relative;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-card .hero-icon {
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 12px;
}

.hero-card h3 {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: var(--fs-md);
}

.hero-card p {
    /* Cor fixa: o cartao e escuro nos dois temas, e no escuro --secondary vira
       o accent a 16% (feito para fundos), o que apagava o texto */
    color: #E5E7EB;
    font-size: var(--fs-sm);
    opacity: 0.8;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-card);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: var(--space-md);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    width: 100%;
    height: 100%;
    min-height: 110px;
    box-sizing: border-box;
}

.navbar-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 8px;
}

/* O arquivo original da Missao MV e quadrado, embora o simbolo seja circular.
   Recorta os cantos em todas as apresentacoes de identidade da marca. */
body[data-brand="missaomv"] .navbar-logo,
body[data-brand="missaomv"] .preloader__logo,
body[data-brand="missaomv"] .nav-offcanvas-avatar,
body[data-brand="missaomv"] .pwa-modal-logo,
body[data-brand="missaomv"] .login-logo,
body[data-brand="missaomv"] .ring-logo,
body[data-brand="missaomv"] .confession-logo,
body[data-brand="missaomv"] .pub-brand img,
body[data-brand="missaomv"] .pub-rodape img {
    border-radius: 50%;
    object-fit: cover;
}

.text-accent {
    color: var(--accent);
}

.events-calendar-card {
    background: var(--surface-card);
    min-height: 500px;
}

.ev-periodo-switch {
    padding-bottom: 8px !important;
}

.ev-periodo-input {
    width: 2.5em;
    height: 1.2em;
    cursor: pointer;
}

.ev-periodo-label {
    font-weight: 600;
    cursor: pointer;
}

/* Dashboard - QR Print Section */
.qr-print-section {
    border: 2px solid var(--accent);
}

.qr-print-header {
    background: var(--gradient-accent);
}

.qr-print-title {
    color: var(--primary);
    margin: 0;
}

.qr-print-select {
    border-color: var(--accent);
}

.qr-print-btn {
    padding: 14px;
    font-size: 1rem;
}

.my-qr-subtitle {
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Login Page */
.login-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-bottom: 16px;
    background: #000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.30), 0 0 0 3px rgba(var(--accent-rgb), 0.6);
    object-fit: cover;
    object-position: center;
    padding: 0;
}

.login-subtitle {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Decoração de rosa no card de login */
.login-card .rose-svg-deco {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 130px;
    height: 130px;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

.login-card .rose-svg-deco--bottom {
    top: auto;
    right: auto;
    bottom: -15px;
    left: -15px;
    width: 100px;
    height: 100px;
    transform: rotate(180deg);
}

.login-alert {
    font-size: 0.9rem;
    font-weight: 600;
}

.login-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.login-submit-btn {
    padding: 12px;
    font-size: 1rem;
}

.login-test-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-test-title {
    color: var(--primary);
}

/* QR Code Print Page */
.qrpage-title {
    letter-spacing: 2px;
    color: var(--primary);
}

.qrpage-footer {
    font-size: 0.75rem;
    opacity: 0.5;
}

/* Hide admin-only nav items for non-admin users */
body:not([data-role="admin"]) .nav-admin-only {
    display: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover), var(--glow-gold);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.stat-card i {
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============ CARDS GERAIS ============ */
.content-card {
    background: var(--surface-card);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.card-link-nav {
    color: inherit;
}

.qr-reader-box {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.busca-membro-input {
    width: 100%;
    max-width: 100%;
    text-align: center;
}

.content-card .card-header-custom {
    padding: var(--space-md) var(--space-md);
    background: transparent;
    border-bottom: 1px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card .card-header-custom h5 {
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    font-size: var(--fs-base);
}

.content-card .card-body {
    padding: var(--space-md);
}

/* ============ BOTOES ============ */
.btn-primary-custom {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    padding: 11px 24px;
    font-weight: 700;
    transition: var(--transition);
    font-size: var(--fs-sm);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.btn-primary-custom:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 38, 59, 0.25);
}

.btn-primary-custom:active {
    transform: translateY(0) scale(0.97);
}

.btn-action-fixed {
    width: 140px;
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-full);
    padding: 11px 24px;
    font-weight: 700;
    transition: var(--transition);
    font-size: var(--fs-sm);
    min-height: 44px;
    box-shadow: var(--glow-gold);
}

.btn-accent:hover {
    opacity: 0.88;
    color: var(--on-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.35);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid rgba(0,0,0,0.5);
    border-radius: var(--radius-full);
    padding: 9px 20px;
    font-weight: 600;
    transition: var(--transition);
    font-size: var(--fs-sm);
    min-height: 44px;
}

.btn-outline-custom:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* ============ TABELAS ============ */
.table-custom {
    margin: 0;
}

.table-custom thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border: none;
}

.table-custom tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--secondary);
}

.table-custom tbody tr {
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.04);
}

/* ============ FORMULARIOS ============ */
.form-control,
.form-select {
    border: 1px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: var(--fs-sm);
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: var(--fs-xs);
    color: var(--primary);
    margin-bottom: 6px;
}

/* ============ BADGES ============ */
.badge-today {
    background: var(--success) !important;
    color: #fff;
    font-size: 0.6rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.badge-type {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* ============ EVENTO CARDS ============ */
.event-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: var(--transition);
    border: 1px solid transparent;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.event-card.today {
    border-color: var(--accent);
    border-width: 2px;
    box-shadow: var(--card-shadow), var(--glow-gold);
}

.event-date-box {
    min-width: 60px;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(27, 38, 59, 0.05);
    transition: var(--transition);
}

.event-date-box.today {
    background: rgba(var(--accent-rgb), 0.1);
}

.event-date-box .day {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.event-date-box.today .day {
    color: var(--accent);
}

.event-date-box .month {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.event-date-box .event-time {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 2px;
}

/* ============ PRESENCA SECTION ============ */
.scan-option {
    background: var(--surface-card);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    min-height: 44px;
}

.scan-option:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover), var(--glow-gold);
    border-color: var(--accent);
}

.scan-option i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.scan-option h5 {
    font-weight: 700;
    margin-bottom: 8px;
}

.scan-option p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

/* ============ QR CODE / MEU QR ============ */
.my-qr-card {
    background: var(--gradient-hero);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.my-qr-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.my-qr-card .qr-box {
    background: var(--white);
    display: inline-block;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin: 20px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.qr-print-page {
    background: white;
    text-align: center;
    padding: var(--space-xl);
}

.qr-print-page .qr-container {
    display: inline-block;
    padding: 24px;
    border: 3px solid var(--primary);
    border-radius: var(--radius-2xl);
    margin: 24px 0;
}

/* ============ MODAIS ============ */
/* Os modais do React renderizam o .modal-backdrop DENTRO do .modal, depois do
   .modal-dialog. Com o z-index do Bootstrap (1050) o fundo escuro ficava por
   cima do formulario e qualquer clique num campo caia nele e fechava o modal. */
.modal > .modal-backdrop { z-index: 0; }
.modal > .modal-dialog { z-index: 1; }

.modal-content {
    border-radius: var(--radius-2xl);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: #fff;
    padding: var(--space-md) var(--space-md);
    border: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: var(--space-md);
}

/* ============ TOAST ============ */
.toast-success {
    background: var(--success) !important;
    color: white !important;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.toast-error {
    background: var(--error) !important;
    color: white !important;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* ============ SCROLL REVEAL ANIMATIONS ============ */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
    opacity: 1;
    transform: translate(0);
}

/* Stagger children */

/* ============ BOOTSTRAP OVERRIDES — estilo botão login ============ */
.btn-primary,
.btn-warning {
    background: var(--gradient-accent) !important;
    color: var(--on-accent) !important;
    border: none !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25) !important;
    transition: opacity .2s, transform .2s !important;
}
.btn-primary:hover,
.btn-warning:hover {
    opacity: 0.88 !important;
    color: var(--on-accent) !important;
    transform: translateY(-1px) !important;
}
.btn-secondary,
.btn-outline-secondary {
    border-radius: 9999px !important;
    font-weight: 600 !important;
}
.btn-outline-primary {
    border-radius: 9999px !important;
    border-color: var(--accent) !important;
    color: var(--accent-dark) !important;
    font-weight: 600 !important;
}
.btn-outline-primary:hover {
    background: var(--gradient-accent) !important;
    color: var(--on-accent) !important;
    border-color: var(--accent) !important;
}
.btn-danger { border-radius: 9999px !important; font-weight: 600 !important; }
.btn-success { border-radius: 9999px !important; font-weight: 600 !important; }
.reveal-up:nth-child(2) {
    transition-delay: 0.1s;
}

.reveal-up:nth-child(3) {
    transition-delay: 0.2s;
}

.reveal-up:nth-child(4) {
    transition-delay: 0.3s;
}

/* ============ FADE-IN ============ */
.fade-in {
    animation: fadeIn 0.5s var(--ease-smooth);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: var(--radius-full);
    border: 2px solid var(--background);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

*::-webkit-scrollbar {
    width: 6px;
}

*::-webkit-scrollbar-track {
    background: var(--background);
}

*::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

@supports (scrollbar-width: thin) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--accent) var(--background);
    }
}

/* ============ FOCUS VISIBLE ============ */
*:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============ PRINT ============ */
@media print {

    #mainNav,
    .bottom-nav,
    .btn-print-action {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
    }

    .qr-print-page {
        box-shadow: none;
    }
}

/* ============ RESPONSIVE TWEAKS ============ */
@media (max-width: 767px) {
    .event-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .event-card .d-flex {
        justify-content: center;
    }
}

/* ============ UTILITY ============ */
.icon-accent { color: var(--accent); }
.icon-primary { color: var(--primary); }
.text-sm { font-size: 0.8rem; }

.navbar-brand-sub {
    font-size: 0.6em;
    color: var(--rose-light);
    opacity: 0.9;
}

.login-title-sub {
    color: var(--accent);
    font-size: 0.7em;
}

.login-footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.qr-reader-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

#gpsStatusCard {
    display: none;
}

.gps-location-hint {
    font-size: 0.82rem;
}

.select-auto { width: auto; }

.ev-location-status {
    font-size: 0.8rem;
}

#locaisSalvosWrap { display: none; }

/* ======= FORMULÁRIO DE CADASTRO ======= */
#painelCadastro {
    display: none;
    text-align: left;
}

#painelCadastro .input-readonly-code {
    background: #f7f7f7;
    color: #888;
    font-weight: 600;
    cursor: not-allowed;
}

.cadastro-btn {
    flex: 1 1 0;
    padding: 14px 10px;
    font-size: 1rem;
    font-weight: 700;
    min-height: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-cadastro-voltar {
    background: var(--secondary);
    color: var(--text);
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-cadastro-voltar:hover {
    background: #d1d5db;
    color: var(--text);
}

.btn-cadastro-ok {
    background: var(--gradient-primary);
    color: #fff;
}

.btn-cadastro-ok:hover {
    color: #fff;
    box-shadow: 0 8px 30px rgba(27, 38, 59, 0.35);
}

/* ============ AUTOCOMPLETE DE MEMBROS ============ */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    background: var(--white);
    border: 1px solid var(--secondary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--card-shadow-hover);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    margin-top: -2px;
}

.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--secondary);
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--background);
    color: var(--accent-dark);
}

.autocomplete-item .smaller {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============ PLANOS - DETALHE ============ */
.pd-page { max-width: 980px; margin: 0 auto; padding: 22px 16px 116px; }
.pd-hero { position:relative; min-height: 360px; border-radius:18px; overflow:hidden; background:#171717 center/cover no-repeat;
    color:#fff; display:flex; flex-direction:column; justify-content:space-between; padding:16px; box-shadow:var(--card-shadow-hover); }
.pd-hero-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; }
.pd-hero::after { content:""; position:absolute; inset:0; z-index:0; background:linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.86) 100%); }
.pd-hero > * { position:relative; z-index:1; }
.pd-hero-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pd-icon-link, .pd-edit-link { display:inline-flex; align-items:center; justify-content:center; min-height:38px; border-radius:999px;
    color:#fff; text-decoration:none; background:rgba(0,0,0,.44); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    border:1px solid rgba(255,255,255,.14); }
.pd-icon-link { width:38px; font-size:1.05rem; }
.pd-edit-link { gap:7px; padding:0 13px; font-weight:850; font-size:.84rem; }
.pd-icon-link:hover, .pd-edit-link:hover { color:#fff; background:rgba(0,0,0,.62); }
.pd-hero-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.pd-hero-pill { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:5px 10px;
    color:#fff; background:rgba(255,255,255,.16); font-size:.78rem; font-weight:850; }
.pd-hero-title { max-width:760px; font-size:clamp(1.75rem, 4vw, 3rem); font-weight:950; line-height:1.04; margin:0;
    text-shadow:0 3px 18px rgba(0,0,0,.56); }
.pd-hero-cats { display:flex; flex-wrap:wrap; gap:6px; margin-top:14px; }
.pd-hero-cat { background:rgba(var(--accent-rgb),.92); color:var(--on-accent); padding:3px 10px; border-radius:999px;
    font-size:.72rem; font-weight:900; text-transform:uppercase; letter-spacing:.04em; }
.pd-content { display:grid; grid-template-columns:minmax(0, 1fr) 320px; gap:18px; margin-top:18px; align-items:start; }
.pd-main, .pd-side { min-width:0; }
.pd-panel { background:var(--white); border:1px solid var(--border-subtle); border-radius:16px; box-shadow:var(--card-shadow); }
.pd-desc { padding:18px 20px; color:var(--text); line-height:1.68; white-space:pre-wrap; }
.pd-cta { padding:16px; position:sticky; top:86px; }
.pd-progress-label { color:var(--text); font-size:.95rem; font-weight:900; margin-bottom:8px; }
.pd-progress-sub { color:var(--text-muted); font-size:.82rem; font-weight:650; margin-bottom:12px; }
.pd-progress-bar { height:9px; background:rgba(0,0,0,.08); border-radius:999px; overflow:hidden; margin-bottom:14px; }
.pd-progress-fill { display:block; height:9px; width:100%; -webkit-appearance:none; appearance:none; border:0; background:rgba(0,0,0,.08); border-radius:999px; overflow:hidden; }
.pd-progress-fill::-webkit-progress-bar { background:rgba(0,0,0,.08); border-radius:999px; }
.pd-progress-fill::-webkit-progress-value { background:var(--accent); border-radius:999px; transition:width .3s; }
.pd-progress-fill::-moz-progress-bar { background:var(--accent); border-radius:999px; }
.pd-cta .btn { width:100%; border-radius:12px; padding:10px 14px; font-weight:900; }
.pd-days-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:18px 0 10px; }
.pd-days-head h2 { margin:0; color:var(--text); font-size:1.14rem; font-weight:950; }
.pd-days-count { color:var(--text-muted); font-size:.84rem; font-weight:800; }
.pd-days-list { display:grid; gap:9px; }
.pd-day-card { display:grid; grid-template-columns:42px minmax(0, 1fr) auto; align-items:center; gap:12px; padding:12px 14px;
    background:var(--white); border:1px solid var(--border-subtle); border-radius:14px; color:inherit; text-decoration:none;
    box-shadow:0 1px 4px rgba(0,0,0,.04); transition:var(--transition); }
.pd-day-card:hover { color:inherit; transform:translateY(-1px); box-shadow:var(--card-shadow); border-color:rgba(var(--accent-rgb),.35); }
.pd-day-number { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center;
    background:rgba(var(--accent-rgb),.16); color:var(--primary); font-weight:950; }
.pd-day-card.done .pd-day-number { background:var(--success); color:#fff; }
.pd-day-title { color:var(--text); font-weight:900; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pd-day-meta { color:var(--text-muted); font-size:.8rem; font-weight:650; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pd-day-card > .bi-chevron-right { color:var(--text-muted); }
.pd-empty-days { color:var(--text-muted); text-align:center; padding:24px; }

@media (max-width: 840px) {
    .pd-page { padding:14px 14px 112px; }
    .pd-hero { min-height:310px; border-radius:14px; }
    .pd-content { grid-template-columns:1fr; }
    .pd-side { order:-1; }
    .pd-cta { position:static; }
}

/* ============ PLANOS - DIA ============ */
.pdia-page { max-width: 760px; margin: 0 auto; padding: 14px 14px 140px; }
/* ── Estilos compartilhados das paginas de oracao (terco, sete pai nossos, etc.) ── */
.terco-back { width: 32px; height: 32px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; color: var(--text);
    background: transparent; border: 0; padding: 0; text-decoration: none;
    transition: var(--transition); font-size: 1rem; cursor: pointer; }
.terco-back:hover { background: rgba(0,0,0,.06); color: var(--accent); }
body.ig-dark .terco-back:hover { background: rgba(255,255,255,.08); }
.terco-section-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle); background: rgba(0,0,0,.02); }
[data-theme="dark"] .terco-section-header { background: rgba(255,255,255,.03); }
.terco-section-num { font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; padding: 3px 9px; border-radius: 999px; background: var(--accent);
    color: var(--bg); min-width: 38px; text-align: center;
    flex-shrink: 0; white-space: nowrap; }
.terco-prayer { border-bottom: 1px solid var(--border-subtle); padding: 10px 0; }
.terco-prayer:last-child { border-bottom: none; }
.terco-prayer summary { cursor: pointer; padding: 4px 0; list-style: none; font-size: .9rem;
    color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.terco-prayer summary::-webkit-details-marker { display: none; }
.terco-prayer summary::after { content: "+"; font-size: 1.2rem; color: var(--accent);
    font-weight: 300; transition: var(--transition); }
.terco-prayer[open] summary::after { content: "−"; }
.terco-text { font-size: .9rem; line-height: 1.75; color: var(--text); margin: 8px 0 0;
    padding: 8px 12px; background: rgba(0,0,0,.02); border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0; }
[data-theme="dark"] .terco-text { background: rgba(255,255,255,.03); }

.pdia-top { display:flex; align-items:center; gap:10px; margin-bottom: 12px; }
.pdia-top .back { color: var(--text); font-size: 1.2rem; background: transparent; border: 0; padding: 0; cursor: pointer; }
.pdia-top .crumb { font-size: .82rem; color: var(--text-muted); font-weight: 600;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.pdia-day-pill { display: inline-flex; align-items:center; gap:6px;
    background: var(--accent); color:#1B263B; padding: 5px 14px; border-radius:999px;
    font-weight: 800; font-size:.78rem; letter-spacing:.4px; margin-bottom: 10px; }
.pdia-title { font-size: 1.6rem; font-weight: 800; color: var(--text);
    line-height: 1.15; margin: 0 0 16px; letter-spacing: -.3px; }
/* Botao alto-falante no topo da pagina */
.pdia-audio-toggle { background: transparent; border: 1.5px solid var(--border-subtle);
    color: var(--text); width: 38px; height: 38px; border-radius: 50%;
    display:inline-flex; align-items:center; justify-content:center; font-size: 1rem;
    cursor: pointer; transition: var(--transition); flex-shrink: 0; }
.pdia-audio-toggle:hover { background: rgba(var(--accent-rgb),.10); border-color: var(--accent); }
.pdia-audio-toggle.is-playing { background: var(--accent); border-color: var(--accent); color:#1B263B; }
.pdia-audio-toggle.is-playing i { animation: pdia-audio-pulse 1.4s ease-in-out infinite;
    will-change: transform; }
@keyframes pdia-audio-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }

@media (prefers-reduced-motion: reduce) {
    .pdia-audio-toggle.is-playing i { animation: none; }
}

/* Backdrop escuro atras do drawer */
.pdia-audio-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 1040; opacity: 0; transition: opacity .25s ease; }
.pdia-audio-backdrop.is-open { opacity: 1; }

/* Bottom sheet com o player */
.pdia-audio-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
    background: var(--white); border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(0,0,0,.18);
    transform: translateY(100%); transition: transform .3s cubic-bezier(.22,.61,.36,1);
    padding-bottom: env(safe-area-inset-bottom, 0); max-height: 88vh; overflow: hidden; }
.pdia-audio-sheet.is-open { transform: translateY(0); }
.pdia-audio-sheet-handle { display: block; width: 100%; padding: 10px 0 4px;
    background: transparent; border: none; cursor: pointer; }
.pdia-audio-sheet-handle::before { content:""; display: block; width: 42px; height: 4px;
    border-radius: 999px; background: var(--border-subtle); margin: 0 auto; }
.pdia-audio-sheet-body { padding: 6px 22px 22px; display: flex; flex-direction: column;
    align-items: center; gap: 14px; }
.pdia-audio-cover { width: 96px; height: 96px; border-radius: 14px; object-fit: cover;
    box-shadow: 0 8px 22px rgba(0,0,0,.18); margin-top: 4px; }
.pdia-audio-meta { text-align: center; }
.pdia-audio-meta-title { font-weight: 800; font-size: 1.05rem; color: var(--text); margin: 0; line-height: 1.2; }
.pdia-audio-meta-sub { font-size: .78rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* Botoes de play / skip */
.pdia-audio-controls { display:flex; align-items: center; justify-content: center; gap: 28px; margin-top: 6px; }
.pdia-audio-skip { position: relative; background: transparent; border: none; color: var(--text);
    width: 52px; height: 52px; border-radius: 50%; cursor: pointer; font-size: 1.6rem;
    display:flex; align-items:center; justify-content:center; transition: var(--transition); }
.pdia-audio-skip:hover { background: rgba(0,0,0,.05); }
.pdia-audio-skip-num { position: absolute; font-size: .6rem; font-weight: 800; color: var(--text);
    bottom: 14px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.pdia-audio-play { background: var(--accent); color: #1B263B; border: none;
    width: 74px; height: 74px; border-radius: 50%; cursor: pointer; font-size: 2.4rem;
    display:flex; align-items:center; justify-content:center; box-shadow: 0 6px 18px rgba(var(--accent-rgb),.45);
    transition: var(--transition); }
.pdia-audio-play:hover { transform: scale(1.04); }
.pdia-audio-play:active { transform: scale(.97); }

/* Barra de progresso */
.pdia-audio-progress { display:flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; }
.pdia-audio-time { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
    font-weight: 600; min-width: 38px; text-align: center; }
.pdia-audio-seek { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px;
    background: var(--border-subtle); outline: none; cursor: pointer; }
.pdia-audio-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pdia-audio-seek::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%;
    background: var(--accent); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* Velocidade */
.pdia-audio-speed-row { width: 100%; display:flex; justify-content: center; }
.pdia-audio-speed { background: transparent; border: 1.5px solid var(--border-subtle);
    color: var(--text); padding: 5px 16px; border-radius: 999px; font-weight: 700; font-size: .82rem;
    cursor: pointer; transition: var(--transition); min-width: 64px; }
.pdia-audio-speed:hover { border-color: var(--accent); background: rgba(var(--accent-rgb),.08); }
.pdia-refs { display:flex; flex-direction:column; gap:8px; margin-bottom: 22px; }
.pdia-ref { display:flex; align-items:center; gap:10px; padding: 12px 14px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.10), rgba(var(--accent-rgb),.04));
    border: 1px solid var(--border-subtle); border-radius: 12px;
    color: var(--text); text-decoration: none; font-weight: 700; transition: var(--transition); }
.pdia-ref:hover { transform: translateY(-1px); box-shadow: var(--card-shadow); color: var(--text); }
.pdia-ref i.bi-book-half { color: var(--accent); font-size: 1.2rem; }
.pdia-ref-text { flex:1; }
.pdia-ref-cta { font-size:.78rem; color: var(--text-muted); font-weight:600; }
.pdia-section { background: var(--white); border:1px solid var(--border-subtle);
    border-radius: 14px; padding: 18px 18px 16px; margin-bottom: 14px;
    box-shadow: var(--card-shadow); }
.pdia-section-head { display:flex; align-items:center; gap:8px; margin-bottom: 10px; }
.pdia-section-head .ico { width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color:#1B263B; display:flex; align-items:center; justify-content:center;
    font-size: 1.1rem; flex-shrink:0; }
.pdia-section-head h2 { font-size: 1rem; font-weight: 800; color: var(--text); margin: 0; letter-spacing: .3px; text-transform: uppercase; }
.pdia-section-body { color: var(--text); font-size: 1rem; line-height: 1.7; white-space: pre-wrap; }
.pdia-section-body:empty::after { content: "Sem conteúdo para esta seção."; color: var(--text-muted); font-style: italic; }
.pdia-footer { position: sticky; bottom: 0; background: rgba(255,255,255,.96);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--border-subtle);
    padding: 12px 14px; margin: 18px -14px 0; display:flex; gap: 10px;
    justify-content: space-between; align-items: center; z-index: 5; }
.pdia-nav-btn { flex: 0 0 auto; }
.pdia-nav-placeholder { width: 44px; height: 38px; display: inline-block; }
.pdia-complete-btn { flex: 1; max-width: 320px; font-weight: 800; padding: 10px; }
.pdia-complete-btn.feito { background: var(--success); border-color: var(--success); }

@media (max-width: 480px) {
    .pdia-title { font-size: 1.35rem; }
}

/* ============================================
   FEED (home) — layout do Instagram, multimarca.

   Estrutura fiel a referencia: topbar propria, stories com anel
   gradiente, card EDGE-TO-EDGE (sem margem/borda/radius), acoes
   com contador colado no icone e legenda "autor + texto" na mesma
   linha. Todas as cores saem dos tokens :root, entao cada marca
   (missaomv, amem, homensdefe) mantem a identidade original.
============================================ */

/* Canvas do feed aprovado na etapa de fundo. A identidade de cada produto
   continua vindo dos tokens de marca; a superficie de leitura permanece branca. */
.main-content--sem-topo {
    padding-top: 0;
    background: #f1f1f1;
}

.feed-wrap {
    /* --white e o branco no tema claro e a superficie da marca no escuro
       (body.ig-dark); um #fff fixo deixava o feed branco no modo escuro */
    --feed-canvas: var(--white);
    /* Sai do --text: cinza claro no tema claro, linha discreta no escuro
       (um cinza fixo aparecia como faixa clara sobre o fundo escuro) */
    --feed-divider: color-mix(in srgb, var(--text) 12%, transparent);
    max-width: 470px;      /* largura do feed do Instagram no desktop */
    margin: 0 auto;
    padding: 0 0 20px;
    min-height: 100dvh;
    background: var(--feed-canvas);
}

@media (max-width: 991.98px) {
    .main-content--sem-topo {
        padding-top: 0;
        background: var(--white);
    }

    .feed-wrap {
        width: 100%;
        max-width: none;
    }
}

/* ---- Topbar do feed ---- */
.feed-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Mesma altura e a mesma faixa opaca da navbar das outras telas. O
       fundo solido evita que o topo fique translucido/embacado no Safari. */
    padding: calc(0.4rem + env(safe-area-inset-top, 0px)) 12px 0.4rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    isolation: isolate;
    background: var(--gradient-primary);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 4px 30px rgba(27, 38, 59, 0.3);
    border-bottom: 1px solid #000;
}
.feed-top__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    /* Sem isso o navegador sublinha o nome, como link comum */
    text-decoration: none;
}
.feed-top__logo img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.feed-top__nome {
    font-family: var(--font-display);
    font-weight: 700;
    /* Mesma medida da navbar das outras telas (#mainNav .navbar-brand) */
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feed-top__acoes { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.feed-top__btn {
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    position: relative;
}
.feed-top__btn:hover { color: var(--accent-dark); }
.feed-top__notif { margin-right: 0; }

/* ---- Avatares ---- */
.feed-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--secondary);
}
.feed-avatar--sm { width: 32px; height: 32px; font-size: 0.72rem; }
.feed-avatar--xs { width: 19px; height: 19px; font-size: 0.52rem; }
.feed-avatar--md { width: 64px; height: 64px; font-size: 1.2rem; }
.feed-avatar--foto { overflow: hidden; }
.feed-avatar--foto img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: inherit;
}
.feed-avatar--fallback {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
}

/* ---- Stories ---- */
.feed-stories {
    border-bottom: 1px solid var(--feed-divider);
    background: var(--white);
}
.feed-stories__track {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 9px 10px 10px;
    scrollbar-width: none;
}
.feed-stories__track::-webkit-scrollbar { display: none; }
.feed-stories__janela { position: relative; }
.feed-stories__seta { display: none; }
.feed-story {
    background: none;
    border: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    width: 72px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
/* O anel gradiente: p/ "ja visto" o anel some e vira contorno neutro */
.feed-story__ring {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--radius-full);
    aspect-ratio: 1 / 1;
    background: var(--gradient-accent);
    position: relative;
}
.feed-story__ring .feed-avatar {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    border: 3px solid var(--white);
}
.feed-story--eu .feed-story__ring,
.feed-lateral__anel { background: var(--gradient-accent); }
/* Story ja visto: o anel amarelo vira um contorno neutro, como no Instagram */
.feed-story__ring--visto { background: rgba(0, 0, 0, .16); }
.feed-story__mais {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 21px;
    height: 21px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent, #111);
    border: 2.5px solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}
.feed-story__nome {
    font-size: 0.7rem;
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Composer (admin) ---- */
.feed-composer {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: var(--white);
    border: 0;
    border-bottom: 1px solid var(--secondary);
    cursor: pointer;
    text-align: left;
}
.feed-composer__hint { flex: 1; color: var(--text-muted); font-size: var(--fs-sm); }
.feed-composer__icon { color: var(--accent); font-size: 1.2rem; }

/* ---- Agenda (eventos) ---- */
.feed-agenda { background: var(--white); border-bottom: 1px solid var(--secondary); padding-bottom: 4px; }
.feed-agenda__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px 6px;
}
.feed-agenda__title {
    font-size: 0.78rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
}
.feed-agenda__title i { color: var(--accent); }
.feed-agenda__all { font-size: 0.75rem; font-weight: 700; color: var(--accent-dark); text-decoration: none; }
.feed-agenda__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 14px 10px;
    scrollbar-width: none;
}
.feed-agenda__track::-webkit-scrollbar { display: none; }
.feed-ev {
    flex-shrink: 0;
    width: 172px;
    background: var(--white);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
}
.feed-ev:hover { border-color: var(--accent); color: var(--text); }
.feed-ev__img { width: 100%; height: 88px; object-fit: cover; display: block; }
.feed-ev__img--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--accent);
    font-size: 1.7rem;
}
.feed-ev__body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.feed-ev__data { font-size: 0.66rem; font-weight: 800; color: var(--accent-dark); text-transform: uppercase; }
.feed-ev__nome {
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.feed-ev__local {
    font-size: 0.68rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Card do post: EDGE-TO-EDGE, como no Instagram ---- */
.feed-lista { display: flex; flex-direction: column; }
.feed-card {
    background: var(--white);
    border: 0;
    border-radius: 0;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--feed-divider);
}
.feed-card__head { display: flex; align-items: center; gap: 9px; padding: 10px 11px 7px; }
.feed-card__meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.feed-card__autor { font-weight: 700; font-size: 0.78rem; line-height: 1.25; }
.feed-card__tempo { font-size: 0.62rem; color: var(--text-muted); }
.feed-card__menu {
    background: none;
    border: 0;
    color: var(--text);
    padding: 4px 2px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}
/* A midia recebe o pequeno recuo e raio vistos na referencia aprovada. */
.feed-card__img {
    width: calc(100% - 20px);
    margin: 0 10px;
    display: block;
    background: var(--secondary);
    max-height: 78vh;
    object-fit: cover;
    border-radius: 8px;
}

/* ---- Barra de acoes: contador colado no icone ---- */
.feed-card__acoes {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 12px 2px;
}
.feed-acao {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: 0;
    padding: 8px 6px;
    color: var(--text);
    cursor: pointer;
    line-height: 1;
}
.feed-acao:hover { opacity: 0.6; }
.feed-acao i { font-size: 1.45rem; }
.feed-acao svg.feed-acao__icone { width: 27px; height: 27px; display: block; }
.feed-acao__principal {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    min-height: 27px;
}
.feed-acao__principal > .feed-acao__n {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}
.feed-acao + .feed-acao { margin-left: 6px; }
.feed-acao__rotulo, .feed-acao__n { font-size: 0.72rem; font-weight: 600; }
.feed-acao--fim,
.feed-card__acoes .feed-acao--fim { margin-left: auto; }
.amem-icon {
    width: 1.62rem;
    height: 1.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.35rem;
    line-height: 1;
    /* O emoji sai colorido: antes um grayscale(1) o deixava cinza */
    opacity: 0.9;
    transform-origin: center bottom;
}
.amem-icon.is-on { opacity: 1; }
.feed-acao.is-liked { color: var(--accent-dark); font-weight: 700; }
.feed-acao.pulse .amem-icon { animation: amemPulse 0.45s var(--ease-spring); }
@keyframes amemPulse {
    0% { transform: scale(1); }
    42% { transform: scale(1.35) rotate(-9deg); }
    100% { transform: scale(1); }
}

/* ---- Legenda: autor em negrito + texto na MESMA linha ---- */
.feed-card__legenda {
    padding: 5px 11px 0;
    margin: 0;
    font-size: var(--fs-sm);
    line-height: 1.42;
}
.feed-card__legenda-autor { font-weight: 600; margin-right: 5px; }
.feed-card__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 9px 14px 2px;
    padding: 7px 15px;
    background: var(--gradient-accent);
    color: var(--on-accent, #111);
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: var(--radius-full);
    text-decoration: none;
}
.feed-card__vercom {
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 4px 11px 0;
    cursor: pointer;
    display: block;
    text-align: left;
}
.feed-card__comentarios {
    display: grid;
    gap: 3px;
    padding: 4px 11px 0;
}
.feed-card__comentario {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.68rem;
    line-height: 1.25;
}
.feed-card__comentario span { overflow-wrap: anywhere; }
.feed-card__publicado {
    display: block;
    padding: 4px 11px 0;
    color: var(--text-muted);
    font-size: 0.6rem;
}

.feed-card__evento-nome { display: block; font-weight: 800; }

/* ---- Comentarios ---- */
.feed-com { display: flex; gap: 10px; padding: 9px 2px; align-items: flex-start; }
.feed-com__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.feed-com__autor { font-weight: 600; font-size: 0.8rem; }
.feed-com__texto { font-size: var(--fs-sm); line-height: 1.4; word-break: break-word; }
.feed-com__tempo { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.feed-com__del {
    background: none; border: 0; color: var(--text-muted);
    font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.feed-coment-form { display: flex; gap: 8px; flex-wrap: nowrap; }
.feed-coment-form .form-control { flex: 1; border-radius: var(--radius-full); }

/* ---- Upload no modal de post ---- */
.feed-upload {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px;
    border: 1.5px dashed var(--secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.feed-upload:hover { border-color: var(--accent); color: var(--accent-dark); }
.feed-upload__preview {
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: 10px;
}

/* ---- Vazio / carregar mais / skeleton ---- */
.feed-vazio { text-align: center; padding: 48px 20px; color: var(--text-muted); background: var(--white); }
.feed-vazio i { font-size: 2.6rem; color: var(--secondary); display: block; margin-bottom: 10px; }
.feed-mais {
    display: block;
    margin: 16px auto 6px;
    padding: 9px 26px;
    background: none;
    border: 1.5px solid var(--secondary);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
}
.feed-mais:hover { border-color: var(--accent); color: var(--accent-dark); }
.feed-card--skeleton { padding: 12px 14px; }
.sk {
    background: linear-gradient(90deg, var(--secondary) 25%, #f0f0f0 50%, var(--secondary) 75%);
    background-size: 200% 100%;
    animation: skShine 1.3s infinite;
    border-radius: var(--radius-sm);
}
.sk--head { height: 32px; width: 55%; margin-bottom: 12px; border-radius: var(--radius-full); }
.sk--img { height: 300px; margin: 0 -14px 12px; border-radius: 0; }
.sk--line { height: 12px; width: 80%; }
@keyframes skShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Presenca/Painel seguem a mesma linguagem monocromatica dos demais itens:
   no Instagram nenhuma aba e colorida. O realce fica so no estado ativo. */
.bottom-nav-item--destaque i { color: inherit; }

/* No desktop o feed ganha respiro e volta a ter cartao delimitado */
@media (min-width: 992px) {
    .feed-wrap { padding-top: 18px; }
    .feed-top { border-radius: var(--radius-md) var(--radius-md) 0 0; }
    .feed-card { border: 1px solid var(--secondary); border-radius: var(--radius-md); margin-bottom: 18px; }
    .feed-card__img { border-radius: 8px; }
    .sk--img { margin: 0 -14px 12px; }
}

/* ---- Feed no desktop: layout web ----
   No celular o feed tem topbar propria + menu inferior. No desktop o menu
   inferior nao existe, entao a navbar padrao volta (base.html), a topbar do
   feed some para nao duplicar a marca e entra a coluna lateral. */
.feed-lateral { display: none; }

@media (min-width: 992px) {
    .feed-top { display: none; }

    .feed-layout {
        display: grid;
        grid-template-columns: minmax(0, 470px) 300px;
        justify-content: center;
        align-items: start;
        gap: 48px;
        padding: 0 24px;
    }
    .feed-layout .feed-wrap { width: 100%; margin: 0; }

    .feed-lateral {
        display: block;
        position: sticky;
        top: 112px;         /* altura estavel da navbar desktop em 2 linhas */
        padding-top: 18px;
        color: var(--text);
    }
}

.feed-lateral__perfil {
    display: flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    margin-bottom: 22px;
}
/* Mesmo anel da bolinha "Seu story" (.feed-story__ring), sem o "+": anel
   externo, folga na cor do fundo e a foto dentro. A cor do anel e definida
   junto com a do story (ver .feed-story--eu .feed-story__ring). */
.feed-lateral__anel {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 3px;
    border-radius: var(--radius-full);
    aspect-ratio: 1 / 1;
}
.feed-lateral__avatar {
    width: 50px;
    height: 50px;
    aspect-ratio: 1 / 1;
    border: 3px solid var(--white);
    font-size: .88rem;
}
.feed-lateral__nome { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.feed-lateral__nome strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; }
.feed-lateral__nome small { color: var(--text-muted); font-size: .82rem; }
.feed-lateral__acao,
.feed-lateral__cabecalho a,
.feed-lateral__atalhos b {
    margin-left: auto;
    color: #0095f6;
    border: 0;
    background: none;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
}
.feed-lateral__acao:hover,
.feed-lateral__cabecalho a:hover,
.feed-lateral__atalhos a:hover b,
.feed-lateral__atalhos button:hover b { color: var(--text); }

.feed-lateral__titulo {
    font-size: .86rem;
    font-weight: 700;
    color: var(--text-muted);
}
.feed-lateral__cabecalho { display: flex; align-items: center; margin-bottom: 12px; }
.feed-lateral__cabecalho a { color: var(--text); }
.feed-lateral__atalhos { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.feed-lateral__atalhos a,
.feed-lateral__atalhos button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
    text-align: left;
}
.feed-lateral__atalhos > :is(a, button) > span:nth-child(2) {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    line-height: 1.25;
}
.feed-lateral__atalhos strong { font-size: .86rem; }
.feed-lateral__atalhos small {
    color: var(--text-muted);
    font-size: .74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed-lateral__icone {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--secondary);
    border-radius: 50%;
    background: var(--white);
}
.feed-lateral__icone i { font-size: 1rem; }
.feed-lateral__rodape { color: var(--text-muted); font-size: .72rem; }

/* Feed desktop inspirado somente na ESTRUTURA do Instagram: trilho vertical
   fixo, coluna central e lateral. Cores continuam sendo as de cada marca. */
.feed-desktop-nav { display: none; }

@media (min-width: 992px) {
    body.feed-page {
        /* Somente a geometria vem da referencia do Instagram. Cores sempre
           saem dos tokens da marca carregados por brands/<slug>.json. */
        --feed-page-canvas: var(--white);
        --feed-page-surface: var(--white);
        --feed-page-line: var(--border-subtle);
        --feed-page-text: var(--text);
        --feed-page-muted: var(--text-muted);
        background: var(--feed-page-canvas);
        color: var(--feed-page-text);
    }
    body #mainNav { display: none !important; }
    body .main-content { margin-left: 74px; transition: margin-left .2s ease; }
    body.feed-page .main-content--sem-topo {
        margin-left: 74px;
        padding: 0;
        min-height: 100vh;
        background: var(--feed-page-canvas);
    }
    /* Com os nomes da lateral a mostra, o conteudo abre espaco para eles em
       vez de ficar por baixo do texto */
    body:has(.feed-desktop-nav:hover) .main-content,
    body:has(.feed-desktop-nav:focus-within) .main-content { margin-left: 236px; }
    body .feed-desktop-nav {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1080;
        width: 74px;
        display: block;
        /* Transparente e sem borda: os icones flutuam sobre o fundo da
           pagina, seja qual for a cor dela */
        background: transparent;
        --lateral-fundo: var(--background, #000);
        border-right: 0;
        /* A barra tem 74px; com o mouse em cima ela se alarga junto com a
           margem do conteudo e os nomes aparecem ao lado dos icones */
        overflow: hidden;
        transition: width .2s ease;
    }
    body .feed-desktop-nav:hover,
    body .feed-desktop-nav:focus-within { width: 236px; }
    .feed-desktop-nav__marca {
        display: grid;
        place-items: center;
        align-self: flex-start;
        width: 44px;
        height: 42px;
        margin-bottom: 18px;
        border-radius: 12px;
    }
    /* Contorno sutil: a logo redonda da AMEM e branca e sumia no tema claro */
    .feed-desktop-nav__marca img {
        width: 31px; height: 31px; object-fit: cover; border-radius: 50%;
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent);
    }
    .feed-desktop-nav nav,
    .feed-desktop-nav__fim { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; }
    /* A lateral inteira (logo, lista e rodape) rola junto, como no celular:
       nada fica preso embaixo fingindo ser o fim da lista. */
    .feed-desktop-nav__rolagem {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
        padding: 24px 15px 20px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
    }
    .feed-desktop-nav__rolagem::-webkit-scrollbar { display: none; }
    /* Os itens se distribuem pela altura da barra (margens automaticas, sem
       vao embaixo); quando nao cabem, a barra rola */
    .feed-desktop-nav nav { flex: 1 0 auto; }
    .feed-desktop-nav nav > * { margin-block: auto; }
    /* Seta "tem mais abaixo": esmaece o fim da lista e fica na coluna dos
       icones (aberta ou fechada). Some ao chegar no fim. */
    .feed-desktop-nav__mais {
        position: absolute;
        inset: auto 0 0 0;
        display: flex;
        align-items: flex-end;
        height: 72px;
        padding: 0 0 12px 21px;
        background: linear-gradient(to bottom, transparent, var(--lateral-fundo) 65%);
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s;
    }
    .feed-desktop-nav__mais.visivel { opacity: 1; visibility: visible; }
    .feed-desktop-nav .feed-desktop-nav__mais i {
        display: grid;
        place-items: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
        color: var(--text);
        background: var(--lateral-fundo);
        border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,.18);
        animation: lateral-mais 1.4s ease-in-out 3;
    }
    .feed-desktop-nav__mais:hover i { border-color: var(--accent); color: var(--accent); }
    @keyframes lateral-mais {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(4px); }
    }
    @media (prefers-reduced-motion: reduce) {
        .feed-desktop-nav .feed-desktop-nav__mais i { animation: none; }
    }
    .feed-desktop-nav__fim {
        flex: 0 0 auto;
        gap: 6px;
        padding-top: 10px;
        margin-top: 8px;
        border-top: 0;
    }
    .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca) {
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
        /* Mais baixos em telas baixas, para caber o maximo sem rolar */
        height: clamp(36px, 4.6vh, 46px);
        flex-shrink: 0;
        padding: 0 11px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: rgba(255,255,255,.9);
        text-decoration: none;
        white-space: nowrap;
        /* Fechada: so o icone e clicavel (o nome escondido nao ocupa area,
           senao o mouse sobre o conteudo perto da barra a abriria) */
        overflow: hidden;
        transition: background .2s ease;
    }
    .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca):hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }
    .feed-desktop-nav :is(a, button).active:not(.feed-desktop-nav__marca) {
        color: var(--accent);
        background: rgba(var(--accent-rgb), .14);
        font-weight: 700;
    }
    .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca):hover i { transform: scale(1.08); }
    .feed-desktop-nav i { flex: 0 0 22px; font-size: 1.35rem; text-align: center; transition: transform .2s ease; }
    .feed-desktop-nav .nav-svg { flex: 0 0 22px; width: 22px; height: 22px; }
    /* Nome ao lado do icone: invisivel com a lateral fechada, aparece quando
       ela abre (todos juntos, alinhados, como no Instagram) */
    .feed-desktop-nav span {
        font-size: .95rem;
        font-weight: 600;
        opacity: 0;
        transition: opacity .15s ease;
    }
    body .feed-desktop-nav:hover span,
    body .feed-desktop-nav:focus-within span { opacity: 1; }


    /* Proporcoes do feed web do Instagram: coluna de 630px onde a faixa de
       stories ocupa a largura toda e os posts (470px) ficam centralizados
       embaixo dela; a lateral vem depois de um respiro largo. */
    body.feed-page .feed-layout {
        grid-template-columns: minmax(0, 630px) 320px;
        gap: 96px;
        max-width: 1110px;
        margin: 0 auto;
        padding: 28px 24px 80px;
    }
    body.feed-page .feed-wrap {
        --feed-canvas: var(--feed-page-canvas);
        --feed-divider: var(--feed-page-line);
        max-width: none;
        padding-top: 0;
        color: var(--feed-page-text);
        background: var(--feed-page-canvas);
    }
    body.feed-page .feed-wrap > :not(.feed-stories) {
        max-width: 470px;
        margin-inline: auto;
    }
    body.feed-page .feed-stories {
        width: 100%;
        margin-bottom: 28px;
        border-bottom: 0;
        background: transparent;
    }
    body.feed-page .feed-stories__track {
        width: 100%;
        gap: 16px;
        padding: 0 0 8px;
        scroll-padding-inline: 0;
        background: transparent;
        /* Poucos stories: centralizados sobre o post. Muitos: comecam na
           esquerda e rolam (safe evita cortar o primeiro) */
        justify-content: safe center;
    }
    /* Janela com largura exata de 6 bolinhas inteiras (6x88 + 5x16) e
       rolagem que encaixa bolinha a bolinha: nenhuma aparece cortada na
       borda. As demais ficam atras das setas, como no Instagram. */
    body.feed-page .feed-stories__janela { max-width: 608px; margin-inline: auto; }
    body.feed-page .feed-stories__track { scroll-snap-type: x mandatory; scroll-behavior: smooth; }
    body.feed-page .feed-story { scroll-snap-align: start; }
    body.feed-page .feed-stories__seta {
        display: grid;
        place-items: center;
        position: absolute;
        top: 44px;              /* meio da bolinha */
        z-index: 2;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #fff;
        color: #111;
        font-size: .8rem;
        box-shadow: 0 2px 8px rgba(0,0,0,.25);
        transform: translateY(-50%);
        cursor: pointer;
        opacity: .92;
    }
    body.feed-page .feed-stories__seta:hover { opacity: 1; }
    body.feed-page .feed-stories__seta--esq { left: 6px; }
    body.feed-page .feed-stories__seta--dir { right: 6px; }
    body.feed-page .feed-story { width: 88px; flex-shrink: 0; color: var(--feed-page-text); }
    body.feed-page .feed-story__nome { color: var(--feed-page-text); font-size: .75rem; margin-top: 2px; }
    body.feed-page .feed-story__ring { width: 88px; height: 88px; }
    body.feed-page .feed-story .feed-avatar--md { width: 82px; height: 82px; font-size: 1.3rem; }
    body.feed-page .feed-story__mais { width: 24px; height: 24px; }

    /* Notebook: a lateral e o trilho ja ocupam boa parte da tela */
    @media (max-width: 1279.98px) {
        body.feed-page .feed-layout { gap: 48px; }
        body.feed-page .feed-story { width: 76px; }
        body.feed-page .feed-stories__janela { max-width: 536px; }   /* 6x76 + 5x16 */
        body.feed-page .feed-stories__seta { top: 38px; }
        body.feed-page .feed-story__ring { width: 76px; height: 76px; }
        body.feed-page .feed-story .feed-avatar--md { width: 70px; height: 70px; }
    }

    body.feed-page .feed-card {
        border: 0;
        border-bottom: 1px solid var(--feed-page-line);
        border-radius: var(--radius-sm);
        margin-bottom: 18px;
        padding-bottom: 18px;
        background: var(--feed-page-surface);
        color: var(--feed-page-text);
    }
    body.feed-page .feed-card__img { border-radius: 4px; }
    body.feed-page .feed-card :is(strong, p, span) { color: inherit; }
    body.feed-page .feed-card small,
    body.feed-page .feed-card__data { color: var(--feed-page-muted); }
    body.feed-page .feed-acao { color: var(--feed-page-text); }
    @media (max-width: 1099.98px) {
        body.feed-page .feed-stories__janela { max-width: 444px; }   /* 5x76 + 4x16 */
    }
    body.feed-page .feed-lateral {
        top: 24px;
        padding-top: 18px;
        color: var(--feed-page-text);
    }
    body.feed-page .feed-lateral__nome small,
    body.feed-page .feed-lateral__titulo,
    body.feed-page .feed-lateral__atalhos small,
    body.feed-page .feed-lateral__rodape { color: var(--feed-page-muted); }
    body.feed-page .feed-lateral__icone { background: var(--feed-page-surface); border-color: var(--feed-page-line); }
    body.feed-page .feed-lateral__cabecalho a { color: var(--feed-page-text); }
    body.feed-page .feed-lateral__acao,
    body.feed-page .feed-lateral__atalhos b { color: var(--accent-dark); }
}

/* O tema claro aplicava novamente o cinza de superficie somente na parte da
   faixa que ficava sobre o feed-wrap. No feed claro tudo deve ser continuo:
   todas as camadas usam o mesmo --feed-page-canvas (branco por padrao; os
   cartoes do LinkedIn em post-card.css deixam o fundo cinza claro). */
@media (min-width: 992px) {
    body.feed-page.ig-light,
    body.feed-page.ig-light .main-content--sem-topo,
    body.feed-page.ig-light .feed-wrap,
    body.feed-page.ig-light .feed-stories,
    body.feed-page.ig-light .feed-stories__track {
        background: var(--feed-page-canvas, #fff) !important;
    }
}


/* Foto de perfil (editar_perfil) — mesmo avatar usado no feed */
.perfil-foto {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}
.perfil-foto__moldura {
    width: 84px;
    height: 84px;
    display: block;
    overflow: hidden;
    flex: 0 0 84px;
    border-radius: var(--radius-full);
    border: 3px solid var(--accent);
    box-sizing: border-box;
}
.perfil-foto__img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: var(--radius-full);
    object-fit: contain;
}
.perfil-foto__img--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}
.perfil-foto__acoes {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.perfil-foto__acoes .btn { align-self: flex-start; }

/* Perfil social inspirado no Instagram, usando os dados e destinos do app. */
.ig-profile {
    width: min(100%, 470px);
    min-height: calc(100dvh - 70px);
    margin: 0 auto;
    padding-bottom: 18px;
    color: #f5f5f5;
    background: #080b0f;
}
/* Só no tema escuro: no claro a camada .ig-light pinta essa area de branco. */
body:not(.ig-light):has(.ig-profile) .main-content--sem-topo {
    background: #080b0f;
}
.ig-profile__top {
    min-height: 54px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    text-align: center;
}
.ig-profile__top strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}
.ig-profile__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    color: #f5f5f5;
    background: transparent;
    text-decoration: none;
    font-size: 1.25rem;
}
.ig-profile__summary {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
    align-items: center;
    padding: 8px 16px 10px;
}
.ig-profile__avatar-wrap { width: 88px; height: 88px; position: relative; overflow: hidden; border-radius: var(--radius-full); }
.ig-profile__avatar {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    object-fit: contain;
    border: 3px solid #080b0f;
    outline: 2px solid var(--accent);
    border-radius: var(--radius-full);
}
.ig-profile__avatar--fallback {
    color: var(--on-accent);
    background: var(--gradient-accent);
    font-weight: 800;
    font-size: 1.35rem;
}
.ig-profile__camera {
    position: absolute;
    right: 2px;
    bottom: 1px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 2px solid #080b0f;
    border-radius: 50%;
    color: var(--on-accent);
    background: var(--accent);
    cursor: pointer;
}
.ig-profile__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}
.ig-profile__stats div { display: flex; flex-direction: column; min-width: 0; }
.ig-profile__stats strong { font-size: 0.95rem; }
.ig-profile__stats span { font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; }
.ig-profile__bio { display: flex; flex-direction: column; padding: 4px 16px 10px; font-size: 0.78rem; line-height: 1.45; }
.ig-profile__bio span { color: rgba(255,255,255,.82); }
.ig-profile__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0 16px 16px; }
.ig-profile__actions button,
.ig-profile__actions a {
    min-height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: #252a2f;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
}
.ig-profile__highlights {
    display: flex;
    gap: 13px;
    overflow-x: auto;
    padding: 5px 16px 18px;
    scrollbar-width: none;
}
.ig-profile__highlights::-webkit-scrollbar { display: none; }
.ig-profile__highlights a { flex: 0 0 63px; color: #fff; text-align: center; text-decoration: none; }
.ig-profile__highlights a > span {
    width: 60px;
    height: 60px;
    display: block;
    padding: 3px;
    border: 1px solid #5c6268;
    border-radius: 50%;
}
.ig-profile__highlights img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ig-profile__highlights small { display: block; margin-top: 5px; font-size: 0.64rem; }
.ig-profile__tabs { height: 44px; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #272b30; }
.ig-profile__tabs a,
.ig-profile__tabs span { display: grid; place-items: center; color: #899098; text-decoration: none; font-size: 1.15rem; }
.ig-profile__tabs .active { color: #fff; border-bottom: 2px solid #fff; }
.ig-profile__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-profile__grid a { aspect-ratio: 1; overflow: hidden; background: #171a1e; }
.ig-profile__grid img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.ig-profile__grid a:hover img { transform: scale(1.04); }
#profileEditForm { background: var(--background); color: var(--text); }

@media (min-width: 992px) {
    .ig-profile { border-radius: 0 0 14px 14px; overflow: hidden; }
}

/* ============================================================
   TEMA ESCURO GLOBAL (estilo Instagram)

   O feed e o perfil ja nasceram escuros com fundo proprio. Em vez de
   reescrever as outras ~35 telas uma a uma, esta camada redefine os tokens
   dentro de `body.ig-dark`: como todo o CSS do app usa var(--...), as telas
   antigas passam a renderizar escuras sem tocar nos templates.

   A classe e aplicada no base.html a todas as paginas internas (logado).
   Telas publicas (login, evento publico, ingresso) ficam de fora.
   ============================================================ */
body.ig-dark {
    /* As superficies saem do preto do logo (--primary-dark/--primary) e as
       divisorias do dourado da marca em baixa opacidade, para o tema escuro
       ser o do app — nao um cinza generico do Instagram. */
    --background: var(--primary-dark, #000);
    --white: var(--primary-dark, #000);   /* superficie dos cards */
    --secondary: rgba(var(--accent-rgb), 0.16);
    --text: #f5f5f5;
    --text-muted: #a8a8a8;
    --surface-card: var(--primary, #0D0D0D);
    --surface-glass: rgba(var(--primary-rgb), 0.85);
    --border-subtle: rgba(var(--accent-rgb), 0.16);
    --feed-divider: rgba(var(--accent-rgb), 0.16);
    /* Sombras nao aparecem sobre preto: separamos por linha, nao por sombra */
    --card-shadow: none;
    --card-shadow-hover: none;

    /* Superficies elevadas (campos, hover, linhas zebradas). Saem do preto
       do logo clareado com um veu do dourado da marca, em vez de cinza puro. */
    --ig-surface-1: color-mix(in srgb, var(--primary-light) 92%, var(--accent));
    --ig-surface-2: color-mix(in srgb, var(--primary-light) 84%, var(--accent));
    --ig-line: rgba(var(--accent-rgb), 0.16);
    --ig-line-strong: rgba(var(--accent-rgb), 0.28);
}

body.ig-dark .content-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    box-shadow: none;
    /* backdrop-filter sobre fundo opaco so custa GPU */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.ig-dark .content-card .card-header-custom h5,
body.ig-dark .card-title,
body.ig-dark h1, body.ig-dark h2, body.ig-dark h3,
body.ig-dark h4, body.ig-dark h5, body.ig-dark h6 {
    color: var(--text);
}

/* Componentes do Bootstrap que trazem branco embutido */
body.ig-dark .card,
body.ig-dark .modal-content,
body.ig-dark .offcanvas,
body.ig-dark .dropdown-menu,
body.ig-dark .list-group-item,
body.ig-dark .accordion-item,
body.ig-dark .accordion-button {
    background-color: var(--surface-card);
    color: var(--text);
    border-color: var(--border-subtle);
}

body.ig-dark .modal-header,
body.ig-dark .modal-footer,
body.ig-dark .card-header,
body.ig-dark .card-footer {
    background-color: transparent;
    border-color: var(--border-subtle);
}

/* Campos de formulario: o IG usa caixa levemente mais clara que o fundo */
body.ig-dark .form-control,
body.ig-dark .form-select,
body.ig-dark .input-group-text {
    background-color: var(--ig-surface-1, #121212);
    border-color: var(--ig-line-strong, #363636);
    color: var(--text);
}
body.ig-dark .form-label,
body.ig-dark .form-check-label {
    color: var(--text);
}
body.ig-dark .form-text {
    color: var(--text-muted) !important;
}
body.ig-dark .form-control:disabled,
body.ig-dark .form-select:disabled {
    background-color: var(--ig-surface-2, #1a1a1a);
    color: var(--text-muted);
    opacity: 1;
}
body.ig-dark .form-control::placeholder { color: #737373; }
body.ig-dark .form-control:focus,
body.ig-dark .form-select:focus {
    background-color: var(--ig-surface-1, #121212);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 .18rem rgba(var(--accent-rgb), .2);
}

/* Tabelas (membros, relatorio) */
body.ig-dark .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border-subtle);
    --bs-table-striped-bg: var(--ig-surface-1, #0f0f0f);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: var(--ig-surface-2, #161616);
    --bs-table-hover-color: var(--text);
    color: var(--text);
}
body.ig-dark .table > thead { color: var(--text-muted); }

/* Utilitarios de fundo claro do Bootstrap usados nos templates */
body.ig-dark .bg-white,
body.ig-dark .bg-light {
    background-color: var(--surface-card) !important;
    color: var(--text);
}
body.ig-dark .text-dark { color: var(--text) !important; }
body.ig-dark .text-muted { color: var(--text-muted) !important; }
/* "Seu story": o anel neutro (--secondary) quase some sobre preto */
body.ig-dark .feed-story--eu .feed-story__ring,
body.ig-dark .feed-lateral__anel { background: rgba(255,255,255,.35); }
body.ig-dark .feed-story__ring--visto { background: rgba(255,255,255,.22); }
body.ig-dark .border,
body.ig-dark .border-top,
body.ig-dark .border-bottom,
body.ig-dark .border-start,
body.ig-dark .border-end { border-color: var(--border-subtle) !important; }

body.ig-dark hr { border-color: var(--border-subtle); opacity: 1; }

/* Botao secundario: contorno claro sobre preto, como os do IG */
body.ig-dark .btn-outline-secondary {
    color: var(--text);
    border-color: var(--ig-line-strong, #363636);
}
body.ig-dark .btn-outline-secondary:hover {
    background-color: var(--ig-surface-2, #262626);
    border-color: var(--ig-line-strong, #363636);
    color: var(--text);
}
/* Contorno do app: o token --primary e escuro por design, entao no tema
   escuro o texto e a borda sumiam no fundo preto (setas da liturgia, dias das
   novenas...). Vale para as tres marcas. */
body.ig-dark .btn-outline-custom,
body[data-theme="dark"] .btn-outline-custom {
    color: #f5f5f5 !important;
    border-color: rgba(var(--accent-rgb), .55) !important;
    background: transparent !important;
}
body.ig-dark .btn-outline-custom:hover:not(:disabled),
body[data-theme="dark"] .btn-outline-custom:hover:not(:disabled) {
    color: #fff !important;
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), .12) !important;
}
body.ig-dark .btn-outline-custom:disabled,
body[data-theme="dark"] .btn-outline-custom:disabled {
    color: var(--text-muted, #a8a8a8) !important;
    border-color: rgba(var(--accent-rgb), .3) !important;
}
body.ig-dark .btn-light {
    background-color: var(--ig-surface-2, #262626);
    border-color: var(--ig-line-strong, #363636);
    color: var(--text);
}

/* A navbar superior ja e escura; sobre fundo preto ela some sem esta linha */
body.ig-dark .navbar.fixed-top {
    border-bottom: 1px solid #000;
}

/* Imagens muito claras (logos em PNG branco) continuam legiveis */
body.ig-dark .content-card img { background: transparent; }

/* ---- Menu lateral no padrao Instagram --------------------------------
   No IG o menu e uma lista limpa: icone monocromatico do tamanho do texto,
   sem pilula colorida e sem cantos muito arredondados. O dourado da marca
   fica reservado ao item ativo, nao a todos os icones de uma vez. */
body.ig-dark .nav-offcanvas,
body.ig-dark .nav-offcanvas-body { background: var(--primary-dark, #000); }
body.ig-dark .nav-offcanvas-header {
    background: var(--primary-dark, #000);
    border-bottom: 1px solid var(--ig-line, #262626);
}

body.ig-dark .nav-offcanvas-item {
    gap: 16px;
    border-radius: 8px;
    color: #f5f5f5;
    font-weight: 400;
    font-size: 0.95rem;
}
/* Icone segue a cor do texto, como no IG */
body.ig-dark .nav-offcanvas-item:not([data-cor]) i,
body.ig-dark .nav-offcanvas-item:not([data-cor]) .nav-svg { color: inherit; }

body.ig-dark .nav-offcanvas-item:hover {
    background: var(--ig-surface-1, #121212);
    color: #f5f5f5;
}
/* Ativo: negrito + acento da marca, sem preencher o fundo */
body.ig-dark .nav-offcanvas-item.active {
    background: transparent;
    color: var(--accent);
    font-weight: 700;
}
body.ig-dark .nav-offcanvas-footer { border-top-color: var(--ig-line, #262626); }

/* ---- Tab bar ----
   O Instagram nao rotula as abas, mas aqui o nome fica: sao 5 destinos que o
   membro nao usa todo dia (Presenca, Biblia, Relatorio), e sem rotulo ele
   precisa adivinhar o icone. Mantemos o resto da linguagem do IG. */
body.ig-dark .bottom-nav-item {
    justify-content: center;
    min-height: 48px;
}
body.ig-dark .bottom-nav-item i { font-size: 1.35rem; margin-bottom: 2px; }
body.ig-dark .bottom-nav-item .nav-svg {
    width: 1.45rem;
    height: 1.45rem;
    margin-bottom: 2px;
}
body.ig-dark .bottom-nav-item span {
    font-size: 0.62rem;
    letter-spacing: -0.01em;
}
/* Ativo ganha o dourado da marca (no IG e branco; aqui e a cor do logo) */
body.ig-dark .bottom-nav-item.active:not([data-cor]) { color: var(--accent); }
body.ig-dark .bottom-nav {
    background: var(--nav-surface, #111);
    border-top: 1px solid rgba(var(--accent-rgb), 0.16);
}

/* ---- Par contorno/preenchido na tab bar (padrao Instagram) ----
   Inativo mostra o traco; ativo troca pelo solido. Como os dois ficam no
   HTML, a troca nao pisca nem baixa fonte de icone de novo. */
.bottom-nav-item .nav-ico--on { display: none; }
.bottom-nav-item.active .nav-ico--off { display: none; }
.bottom-nav-item.active .nav-ico--on { display: inline-block; }
/* O icone solido ja carrega o peso visual: dispensa o zoom do estado ativo */
.bottom-nav-item.active i,
.bottom-nav-item.active .nav-svg { transform: none; }

/* ============================================================
   TEMA CLARO (body.ig-light)

   Usado pelas marcas com `ui_theme: "light"` (hoje a Missao). A logo MV e
   branca sobre preto: no card escuro ela sumia. Aqui mantemos a mesma
   estrutura do Instagram, so que sobre branco, com o dourado da marca como
   acento. Os tokens :root ja sao claros — esta camada cuida das areas que
   tinham preto fixo (tab bar, menu e perfil).
   ============================================================ */
body.ig-light {
    --feed-divider: var(--secondary);
}

/* ---- Barra lateral desktop clara ----
   Fechada e aberta (hover) tem o fundo do tema: branco, icones e nomes
   escuros. O realce do ativo continua no dourado da marca. */
@media (min-width: 992px) {
    /* Telas de fundo branco (feed, perfil) pintam so a area do conteudo;
       o body tambem fica branco para a lateral transparente nao ficar cinza */
    body.ig-light:has(.main-content--sem-topo) { background-color: var(--white); }
    body.ig-light .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca) { color: var(--text); }
    body.ig-light .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca):hover {
        background: rgba(0,0,0,.05);
        color: var(--text);
    }
    body.ig-light .feed-desktop-nav :is(a, button).active:not(.feed-desktop-nav__marca) {
        color: var(--accent-dark);
        background: rgba(var(--accent-rgb), .14);
    }
    body.ig-light .feed-desktop-nav__fim { border-top: 0; }
}

/* ---- Tab bar clara ---- */
body.ig-light .bottom-nav {
    background: var(--white);
    border-top: 1px solid var(--secondary);
}
body.ig-light .bottom-nav-item { color: #737373; }
body.ig-light .bottom-nav-item:hover,
body.ig-light .bottom-nav-item.active:not([data-cor]) { color: var(--primary); }
/* O dourado sozinho tem pouco contraste sobre branco: o ativo usa o preto da
   marca e o icone solido, e o dourado vira o sublinhado da aba. */
body.ig-light .bottom-nav-item.active { position: relative; }
body.ig-light .bottom-nav-item.active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
body.ig-light .bottom-nav-item i { font-size: 1.35rem; margin-bottom: 2px; }
body.ig-light .bottom-nav-item .nav-svg {
    width: 1.45rem;
    height: 1.45rem;
    margin-bottom: 2px;
}
body.ig-light .bottom-nav-item span { font-size: 0.62rem; letter-spacing: -0.01em; }

/* A regra de tema acima redefinia o SVG da Bíblia para 1,45rem. Reforçamos
   especificamente esta aba para o ícone e o nome terem o mesmo peso visual
   das outras opções da barra. */
body.ig-dark .bottom-nav-item[data-cor="biblia"] .nav-svg,
body.ig-light .bottom-nav-item[data-cor="biblia"] .nav-svg {
    width: 1.7rem;
    height: 1.7rem;
}
body.ig-dark .bottom-nav-item[data-cor="biblia"] span,
body.ig-light .bottom-nav-item[data-cor="biblia"] span {
    font-size: 0.68rem;
    letter-spacing: 0;
}

/* ---- Menu lateral claro (a mesma lista limpa do IG) ---- */
body.ig-light .nav-offcanvas,
body.ig-light .nav-offcanvas-body { background: var(--white); color: var(--text); }
body.ig-light .nav-offcanvas-header {
    background: var(--white);
    border-bottom: 1px solid var(--secondary);
}
body.ig-light .nav-offcanvas-header .text-white { color: var(--text) !important; }
body.ig-light .nav-offcanvas-header .text-accent { color: var(--accent-dark) !important; }
body.ig-light .nav-offcanvas .btn-close { filter: none; }
body.ig-light .nav-offcanvas-item {
    gap: 16px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 400;
    font-size: 0.95rem;
}
body.ig-light .nav-offcanvas-item:not([data-cor]) i,
body.ig-light .nav-offcanvas-item:not([data-cor]) .nav-svg { color: inherit; }
body.ig-light .nav-offcanvas-item:hover {
    background: var(--background);
    color: var(--text);
}
body.ig-light .nav-offcanvas-item.active {
    background: transparent;
    color: var(--primary);
    font-weight: 700;
}
body.ig-light .nav-offcanvas-footer { border-top-color: var(--secondary); }

/* ---- Perfil claro: o .ig-profile nasceu com cores fixas escuras ---- */
body.ig-light .ig-profile {
    background: var(--white);
    color: var(--text);
}
body.ig-light .main-content--sem-topo,
body.ig-light .ig-profile__top { background: var(--white); }
body.ig-light .ig-profile__top { border-bottom: 1px solid var(--secondary); }
body.ig-light .ig-profile__icon { color: var(--text); }
body.ig-light .ig-profile__bio span { color: var(--text-muted); }
body.ig-light .ig-profile__actions button,
body.ig-light .ig-profile__actions a {
    background: var(--background);
    border: 1px solid var(--secondary);
    color: var(--text);
}
body.ig-light .ig-profile__highlights a { color: var(--text); }
body.ig-light .ig-profile__highlights a > span { border-color: var(--secondary); }
body.ig-light .ig-profile__tabs { border-bottom-color: var(--secondary); }
body.ig-light .ig-profile__tabs a,
body.ig-light .ig-profile__tabs span { color: var(--text-muted); }
body.ig-light .ig-profile__tabs .active {
    color: var(--text);
    border-bottom-color: var(--text);
}
body.ig-light .ig-profile__grid a { background: var(--background); }

/* ---- Visualizador de story (bolinhas do topo do feed) ----
   Tela cheia preta nas duas marcas: story e conteudo em foco, como no
   Instagram, independente do tema claro/escuro do resto do app. */
body.story-aberto { overflow: hidden; }
.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: calc(8px + env(safe-area-inset-top)) 0 env(safe-area-inset-bottom);
}
.story-viewer[hidden] { display: none; }
.story-viewer__barras { display: flex; gap: 3px; padding: 0 8px; }
.story-barra {
    flex: 1;
    height: 2.5px;
    border-radius: 2px;
    background: rgba(255,255,255,.3);
    overflow: hidden;
}
.story-barra.is-vista { background: #fff; }
.story-barra.is-atual { background: rgba(255,255,255,.3); position: relative; }
.story-barra.is-atual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    transform-origin: left;
    animation: storyProgresso 6s linear forwards;
}
@keyframes storyProgresso { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
    .story-barra.is-atual::after { animation: none; transform: scaleX(1); }
}

.story-viewer__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}
.story-viewer__autor { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; }
.story-viewer__autor small { color: rgba(255,255,255,.7); font-weight: 400; }
.story-viewer__botoes { display: flex; align-items: center; gap: 4px; }
/* "..." do story (autor/admin): mesmo lugar e peso do X, como no Instagram */
.story-viewer__mais {
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}
/* Menu aberto: a barra de progresso para junto com o timer */
.story-viewer.is-pausado .story-barra.is-atual::after { animation-play-state: paused; }
.story-viewer__x {
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.9rem;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
}
.story-viewer__palco {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 16px 24px;
    overflow-y: auto;
}
.story-viewer__palco img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
}
.story-viewer__marca {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 1;
    width: 48px;
    height: 48px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .32);
    box-shadow: 0 1px 8px rgba(0, 0, 0, .35);
    pointer-events: none;
}
.story-viewer__marca img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}
.story-viewer__texto { text-align: center; font-size: 1rem; line-height: 1.5; max-width: 30rem; }
.story-viewer__link {
    background: var(--accent);
    color: var(--on-accent, #111);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    text-decoration: none;
}
.story-viewer__load {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: storyGira .8s linear infinite;
}
@keyframes storyGira { to { transform: rotate(360deg); } }

/* Metades invisiveis: toque a esquerda volta, a direita avanca */
.story-viewer__nav {
    position: absolute;
    top: 64px;
    bottom: 0;
    width: 32%;
    background: none;
    border: 0;
    cursor: pointer;
}
.story-viewer__nav--ant { left: 0; }
.story-viewer__nav--prox { right: 0; }

/* Rodape: quem ve manda mensagem e diz amem; o autor ve a atividade.
   Fica acima das metades de navegacao para o toque nao passar o story. */
.story-viewer__rodape {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 8px 12px 12px;
}
.story-viewer__responder { flex: 1; display: flex; align-items: center; gap: 10px; }
.story-viewer__msg {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.55);
    background: transparent;
    color: #fff;
    font-size: 16px; /* 16px: o iOS nao da zoom na tela ao focar */
    outline: none;
}
.story-viewer__msg::placeholder { color: rgba(255,255,255,.85); }
.story-viewer__msg:focus { border-color: #fff; }
.story-viewer__amem,
.story-viewer__enviar {
    flex-shrink: 0;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
}
.story-viewer__amem {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-viewer__amem svg { width: 29px; height: 29px; }
.story-viewer__amem.is-on { color: #ff3040; } /* mesmo vermelho do amem do feed */
.story-viewer__amem.is-pulsando svg { animation: storyAmem .45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes storyAmem { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.story-viewer__enviar { font-weight: 700; font-size: .95rem; padding: 10px 6px; }
.story-viewer__atividade {
    display: flex;
    align-items: center;
    gap: 18px;
    background: none;
    border: 0;
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    padding: 10px 4px;
    cursor: pointer;
}
.story-viewer__atividade span { display: inline-flex; align-items: center; gap: 6px; }
.story-viewer__atividade svg { width: 20px; height: 20px; }
.story-viewer__atividade i { font-size: 1.1rem; }
.story-viewer__atividade span:first-child { color: #ff3040; }
.story-viewer__atividade span:nth-child(2) { color: #2563eb; }
.story-atividade__resumo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
}
.story-atividade__resumo svg { width: 22px; height: 22px; color: #ff3040; flex-shrink: 0; }

/* ============================================================
   ICONES COLORIDOS DA NAVEGACAO

   Cada destino tem a sua cor, na mesma paleta que `events.html` usa para os
   tipos de evento — assim o app fala uma lingua so. A cor vale para o icone;
   o texto continua neutro, senao a barra vira um arco-iris ilegivel.

   Como os tons sao escolhidos para o fundo claro, no tema escuro eles sao
   clareados (color-mix com branco) para manter contraste.
   ============================================================ */
/* `body` na frente para vencer as regras de tema (body.ig-light/.ig-dark),
   que tem a mesma especificidade e vem depois neste arquivo. */
body .bottom-nav-item[data-cor] i,
body .bottom-nav-item[data-cor] .nav-svg,
body .nav-offcanvas-item[data-cor] i,
body .nav-offcanvas-item[data-cor] .nav-svg {
    color: var(--ico-cor);
}

[data-cor="feed"]      { --ico-cor: #E1306C; }  /* rosa Instagram */
[data-cor="eventos"]   { --ico-cor: #2563EB; }  /* azul */
[data-cor="painel"]    { --ico-cor: #7C3AED; }  /* roxo */
[data-cor="membros"]   { --ico-cor: #0891B2; }  /* ciano */
[data-cor="frequencia"] { --ico-cor: #D97706; }  /* ambar */
[data-cor="relatorio"] { --ico-cor: #059669; }  /* verde */
[data-cor="presenca"]  { --ico-cor: #EA580C; }  /* laranja */
[data-cor="biblia"]    { --ico-cor: #CA8A04; }  /* dourado escuro */
[data-cor="perfil"]    { --ico-cor: #DB2777; }  /* rosa */
[data-cor="oracoes"]   { --ico-cor: #9333EA; }  /* violeta */
[data-cor="liturgia"]  { --ico-cor: #BE123C; }  /* vinho */
[data-cor="planos"]    { --ico-cor: #15803D; }  /* verde escuro */
[data-cor="grupos"]    { --ico-cor: #4F46E5; }  /* indigo */
[data-cor="confissao"] { --ico-cor: #0F766E; }  /* teal */
[data-cor="ingressos"] { --ico-cor: #EA580C; }  /* laranja */

/* No escuro os mesmos tons ficam pesados: versoes mais claras do mesmo matiz */
body.ig-dark [data-cor="feed"]      { --ico-cor: #FF6B9D; }
body.ig-dark [data-cor="eventos"]   { --ico-cor: #7BA9FF; }
body.ig-dark [data-cor="painel"]    { --ico-cor: #B794F6; }
body.ig-dark [data-cor="membros"]   { --ico-cor: #5FD3E8; }
body.ig-dark [data-cor="frequencia"] { --ico-cor: #FBBF24; }
body.ig-dark [data-cor="relatorio"] { --ico-cor: #4ADE9B; }
body.ig-dark [data-cor="presenca"]  { --ico-cor: #FF9B5C; }
body.ig-dark [data-cor="biblia"]    { --ico-cor: #F0C14B; }
body.ig-dark [data-cor="perfil"]    { --ico-cor: #FF7AB8; }
body.ig-dark [data-cor="oracoes"]   { --ico-cor: #C99BFF; }
body.ig-dark [data-cor="liturgia"]  { --ico-cor: #FF7A94; }
body.ig-dark [data-cor="planos"]    { --ico-cor: #5FD68A; }
body.ig-dark [data-cor="grupos"]    { --ico-cor: #8B8CF5; }
body.ig-dark [data-cor="confissao"] { --ico-cor: #4FC3B8; }
body.ig-dark [data-cor="ingressos"] { --ico-cor: #FF9B5C; }

/* Inativo fica dessaturado: so a aba atual mostra a cor cheia, para a barra
   nao competir com o conteudo (mesma ideia do icone vazado/preenchido). */
.bottom-nav-item[data-cor]:not(.active) i,
.bottom-nav-item[data-cor]:not(.active) .nav-svg {
    opacity: 0.55;
    filter: saturate(0.7);
}
.bottom-nav-item[data-cor].active i,
.bottom-nav-item[data-cor].active .nav-svg {
    opacity: 1;
    filter: none;
}
/* O rotulo da aba ativa acompanha a cor do icone */
.bottom-nav-item[data-cor].active { color: var(--ico-cor); }

/* O desenho da Bíblia usa um traço mais delicado e parece menor que os
   ícones Bootstrap mesmo ocupando a mesma caixa. Dá um pouco mais de área ao
   SVG para manter o equilíbrio visual da barra inferior. */
.bottom-nav-item[data-cor="biblia"] .nav-svg {
    width: 1.65rem;
    height: 1.65rem;
}

/* Botão global para retornar exatamente à tela anterior. Telas com cabeçalho
   próprio usam as mesmas regras visuais, mas controlam o botão no cabeçalho. */
.app-backbar {
    width: min(100%, 1440px);
    margin: 0 auto;
    min-height: 38px;
    padding: 3px 16px 0;
    box-sizing: border-box;
}
.app-backbar__button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.app-backbar__button:hover {
    background: color-mix(in srgb, var(--text) 7%, transparent);
    color: var(--accent);
}
.app-backbar__button i { font-size: 1.15rem; line-height: 1; }
.qr-voltar {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-grid;
    place-items: center;
    border: 0 !important;
    border-radius: 50%;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 0;
    vertical-align: middle;
}
.qr-voltar i { font-size: 1.15rem; margin: 0 !important; }
.ticket-public-icon.ticket-voltar {
    font-size: 0;
}
.ticket-public-icon.ticket-voltar i {
    font-size: 1.15rem;
}
.ticket-public-icon.ticket-voltar i::before {
    content: "\\f284";
}

@media (min-width: 992px) {
    .app-backbar { padding: 6px 24px 0; }
}

/* ============================================================
   COMPOSER (nova publicacao) — fluxo do Instagram

   Tela cheia em duas etapas: escolher a foto, depois a legenda. Herda o
   tema da marca (claro na Missao, escuro nas demais) em vez de cravar
   preto, como o visualizador de story faz.
   ============================================================ */
body.composer-aberto { overflow: hidden; }
.composer {
    position: fixed;
    inset: 0;
    z-index: 1900;
    background: var(--white);
    color: var(--text);
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
}
.composer[hidden] { display: none; }
.composer__etapa {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}
.composer__etapa[hidden] { display: none; }

/* Cabecalho: cancelar/voltar a esquerda, acao a direita */
.composer__top {
    display: grid;
    grid-template-columns: 60px 1fr 90px;
    align-items: center;
    min-height: 50px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--feed-divider, var(--secondary));
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 2;
}
.composer__top strong { text-align: center; font-size: 0.95rem; }
.composer__x,
.composer__voltar {
    background: none;
    border: 0;
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
    padding: 0;
    text-align: left;
    cursor: pointer;
}
.composer__voltar { font-size: 1.2rem; }
.composer__avancar {
    background: none;
    border: 0;
    color: #0095f6;            /* o azul de acao do Instagram */
    font-weight: 700;
    font-size: 0.92rem;
    text-align: right;
    cursor: pointer;
}
.composer__avancar:disabled { opacity: .35; cursor: default; }

/* ---- Etapa 1: area da foto ---- */
.composer__dropzone {
    flex: 1;
    min-height: 46vh;
    margin: 0;
    display: grid;
    place-items: center;
    background: var(--background);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.composer__dropzone img {
    width: 100%;
    height: 100%;
    max-height: 62vh;
    object-fit: contain;
    background: #000;
}
.composer__placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}
.composer__placeholder i { font-size: 3.2rem; opacity: .55; }
.composer__placeholder p { margin: 12px 0 16px; font-size: 1rem; color: var(--text); }
.composer__botao {
    display: inline-block;
    background: #0095f6;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
}
.composer__enviando {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.composer__spin {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(128,128,128,.3);
    border-top-color: #0095f6;
    border-radius: 50%;
    animation: storyGira .8s linear infinite;
}
.composer__dica {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 14px 16px 0;
}
.composer__so-texto {
    align-self: center;
    background: none;
    border: 0;
    color: #0095f6;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px 18px;
    cursor: pointer;
}

/* ---- Etapa 2: legenda ---- */
.composer__legenda {
    display: flex;
    gap: 12px;
    padding: 14px 14px 6px;
}
.composer__legenda img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.composer__legenda textarea {
    flex: 1;
    border: 0;
    background: none;
    color: var(--text);
    resize: none;
    font-size: 0.92rem;
    line-height: 1.45;
    outline: none;
    font-family: inherit;
}
.composer__legenda textarea::placeholder { color: var(--text-muted); }
.composer__contador {
    text-align: right;
    padding: 0 14px 10px;
    font-size: 0.68rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--feed-divider, var(--secondary));
}

/* Opcoes: lista tocavel, nao campos de formulario soltos */
.composer__opcoes { display: flex; flex-direction: column; }
.composer__linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--feed-divider, var(--secondary));
    color: var(--text);
    font-size: 0.9rem;
    padding: 15px 14px;
    text-align: left;
    cursor: pointer;
}
.composer__linha span { display: flex; align-items: center; gap: 10px; }
.composer__linha i { font-size: 1.15rem; color: var(--text-muted); }
.composer__linha small { color: var(--text-muted); font-size: 0.78rem; }
.composer__linha.is-aberta small { color: #0095f6; }
.composer__linha--switch { cursor: default; }
.composer__sub {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 12px 14px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--feed-divider, var(--secondary));
}
.composer__sub[hidden] { display: none; }
.composer__sub input[type="url"],
.composer__sub input[type="text"] {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.88rem;
}
.composer__grupos { display: flex; flex-direction: column; gap: 2px; }
.composer__grupo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 2px;
    font-size: 0.88rem;
    cursor: pointer;
}

/* No desktop o composer vira um cartao central, como o do IG na web */
@media (min-width: 992px) {
    .composer {
        inset: 50% auto auto 50%;
        transform: translate(-50%, -50%);
        width: min(92vw, 860px);
        height: min(88vh, 720px);
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: 0 24px 80px rgba(0,0,0,.4);
    }
}

/* Fundo escurecido atras do cartao no desktop (o ::before segue o composer,
   entao some junto quando ele e escondido) */
@media (min-width: 992px) {
    body.composer-aberto::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .65);
        z-index: 1890;
    }
}

/* ---- Icones coloridos nas acoes do card ----
   Cada acao com a sua cor, na mesma paleta da navegacao. O Amem (emoji) ja
   sai colorido do sistema; aqui cuidamos dos icones de traco. */
.feed-acao[data-acao="comentar"] { color: #2563EB; }   /* azul */
.feed-acao[data-acao="compartilhar"] { color: #0891B2; } /* ciano */
.feed-acao[data-acao="salvar"] i { color: #CA8A04; }     /* dourado */
.feed-acao[data-acao="like"] { color: #FF3040; }         /* rotulo Amem */

body.ig-dark .feed-acao[data-acao="comentar"] { color: #7BA9FF; }
body.ig-dark .feed-acao[data-acao="compartilhar"] { color: #5FD3E8; }
body.ig-dark .feed-acao[data-acao="salvar"] i { color: #F0C14B; }
body.ig-dark .feed-acao[data-acao="like"] { color: #FF3040; }

/* Salvo: icone cheio em destaque */
.feed-acao[data-acao="salvar"] .bi-bookmark-fill { color: #CA8A04; }
body.ig-dark .feed-acao[data-acao="salvar"] .bi-bookmark-fill { color: #F0C14B; }

/* ---- Topbar do feed: barra preta solida, sem gradiente nem desfoque ---- */
.feed-top {
    background: #111;
    background-image: none;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.feed-top__nome { color: #fff; }
.feed-top__nome .navbar-brand-sub { color: var(--rose-light); font-weight: 600; }
.feed-top__btn { color: #fff; }
.feed-top__btn:hover { color: var(--accent); }
.feed-top__logo img { border-color: rgba(var(--accent-rgb), 0.35); }

/* ============================================================
   FUNDO COLORIDO DO POST SO-TEXTO (estilo composer de texto do Instagram)
   ============================================================ */
.composer__legenda--fundo textarea {
    color: #fff;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
}
.composer__legenda--fundo textarea::placeholder { color: rgba(255,255,255,.75); }
.composer__legenda--fundo {
    border-radius: var(--radius-md);
    margin: 0 14px;
    padding: 40px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.composer__legenda--fundo img { display: none; }  /* sem foto neste modo */

.composer__legenda--roxo    { background: linear-gradient(135deg, #7C3AED, #4F46E5); }
.composer__legenda--rosa    { background: linear-gradient(135deg, #DB2777, #E1306C); }
.composer__legenda--azul    { background: linear-gradient(135deg, #2563EB, #0891B2); }
.composer__legenda--verde   { background: linear-gradient(135deg, #059669, #15803D); }
.composer__legenda--laranja { background: linear-gradient(135deg, #EA580C, #CA8A04); }
.composer__legenda--dourado { background: linear-gradient(135deg, #c9a227, #f5c518); }
.composer__legenda--vinho   { background: linear-gradient(135deg, #BE123C, #7C2D12); }

.composer__fundos { padding: 14px; border-top: 1px solid var(--feed-divider, var(--secondary)); }
.composer__fundos-titulo {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}
.composer__fundos-lista { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.composer__fundo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
}
.composer__fundo.is-ativo { border-color: var(--accent); transform: scale(1.08); }
.composer__fundo--nenhum {
    background: var(--white);
    border: 2px dashed var(--secondary);
    position: relative;
}
.composer__fundo--nenhum::after {
    content: "\2715";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.composer__fundo--roxo    { background: linear-gradient(135deg, #7C3AED, #4F46E5); }
.composer__fundo--rosa    { background: linear-gradient(135deg, #DB2777, #E1306C); }
.composer__fundo--azul    { background: linear-gradient(135deg, #2563EB, #0891B2); }
.composer__fundo--verde   { background: linear-gradient(135deg, #059669, #15803D); }
.composer__fundo--laranja { background: linear-gradient(135deg, #EA580C, #CA8A04); }
.composer__fundo--dourado { background: linear-gradient(135deg, #c9a227, #f5c518); }
.composer__fundo--vinho   { background: linear-gradient(135deg, #BE123C, #7C2D12); }

/* Cartao do post no feed, quando publicado sem foto */
.feed-card__bgtexto {
    margin: 0;
    padding: 48px 20px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.45;
}
.feed-card__bgtexto--roxo    { background: linear-gradient(135deg, #7C3AED, #4F46E5); }
.feed-card__bgtexto--rosa    { background: linear-gradient(135deg, #DB2777, #E1306C); }
.feed-card__bgtexto--azul    { background: linear-gradient(135deg, #2563EB, #0891B2); }
.feed-card__bgtexto--verde   { background: linear-gradient(135deg, #059669, #15803D); }
.feed-card__bgtexto--laranja { background: linear-gradient(135deg, #EA580C, #CA8A04); }
.feed-card__bgtexto--dourado { background: linear-gradient(135deg, #c9a227, #f5c518); }
.feed-card__bgtexto--vinho   { background: linear-gradient(135deg, #BE123C, #7C2D12); }

/* ============================================================
   FONTES DO POST SO-TEXTO ("Aa" do composer, estilo Instagram)
   Cada trilha mostra a propria fonte que representa: o botao E a previa.
   ============================================================ */
.composer__fontes-lista { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.composer__fonte {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    background: var(--background);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.composer__fonte.is-ativa { border-color: var(--accent); background: var(--white); }
.composer__fonte--classica  { font-family: var(--font-body); font-weight: 700; }
.composer__fonte--moderna   { font-family: var(--font-display); font-weight: 700; }
.composer__fonte--serifada  { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; }
.composer__fonte--manuscrita{ font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.4rem; }
.composer__fonte--maquina   { font-family: 'Courier Prime', monospace; font-weight: 700; }

/* A previa (textarea) e o cartao publicado usam a mesma familia escolhida */
.composer__legenda--font-classica textarea   { font-family: var(--font-body); }
.composer__legenda--font-moderna textarea    { font-family: var(--font-display); }
.composer__legenda--font-serifada textarea   { font-family: Georgia, 'Times New Roman', serif; }
.composer__legenda--font-manuscrita textarea { font-family: 'Caveat', cursive; font-size: 1.7rem; font-weight: 600; }
.composer__legenda--font-maquina textarea    { font-family: 'Courier Prime', monospace; }

.feed-card__bgtexto--font-classica   { font-family: var(--font-body); }
.feed-card__bgtexto--font-moderna    { font-family: var(--font-display); }
.feed-card__bgtexto--font-serifada   { font-family: Georgia, 'Times New Roman', serif; }
.feed-card__bgtexto--font-manuscrita { font-family: 'Caveat', cursive; font-size: 1.9rem; font-weight: 600; }
.feed-card__bgtexto--font-maquina    { font-family: 'Courier Prime', monospace; }

/* Navegacao padronizada conforme o menu do app: fundo branco, icones pretos
   e destaque amarelo-claro somente no item ativo. */
body.ig-light .feed-desktop-nav {
    background: #fff;
    border-right: 0;
    --lateral-fundo: #fff;
}

body.ig-light .bottom-nav,
body.ig-light .nav-offcanvas,
body.ig-light .nav-offcanvas-body {
    background: #fff;
    color: #111;
}

body.ig-light .bottom-nav { border-top-color: #e5e5e5; }

body.ig-light .bottom-nav-item[data-cor] i,
body.ig-light .bottom-nav-item[data-cor] .nav-svg,
body.ig-light .nav-offcanvas-item[data-cor] i,
body.ig-light .nav-offcanvas-item[data-cor] .nav-svg {
    color: #111 !important;
    opacity: 1;
    filter: none;
}

body.ig-light .bottom-nav-item[data-cor]:not(.active) i,
body.ig-light .bottom-nav-item[data-cor]:not(.active) .nav-svg {
    opacity: 1;
}

body.ig-light .bottom-nav-item[data-cor].active {
    color: var(--accent-dark, #b89000) !important;
    background: #fff4d6;
}

body.ig-light .bottom-nav-item[data-cor].active i,
body.ig-light .bottom-nav-item[data-cor].active .nav-svg {
    color: var(--accent-dark, #b89000) !important;
}

body.ig-light .nav-offcanvas-header {
    background: #fff;
    border-bottom-color: #e5e5e5;
}

body.ig-light .nav-offcanvas-header .text-white,
body.ig-light .nav-offcanvas-header .text-accent,
body.ig-light .nav-offcanvas-item,
body.ig-light .nav-offcanvas-item.active,
body.ig-light .nav-offcanvas-item:hover {
    color: #111 !important;
}

body.ig-light .nav-offcanvas-item.active,
body.ig-light .nav-offcanvas-item:hover {
    background: #f5f5f5;
}

body.ig-light .nav-offcanvas-item.active {
    background: #fff4d6;
    color: #111 !important;
}

body.ig-light .nav-offcanvas-item.active i,
body.ig-light .nav-offcanvas-item.active .nav-svg {
    color: var(--accent-dark, #b89000) !important;
}

body.ig-light .nav-offcanvas-item[data-cor] i,
body.ig-light .nav-offcanvas-item[data-cor] .nav-svg {
    color: #111 !important;
}

body.ig-light.feed-page .feed-lateral__icone {
    background: #fff;
    border-color: #111;
    color: #111;
}

body.ig-light.feed-page .feed-lateral__icone i,
body.ig-light.feed-page .feed-lateral__acao,
body.ig-light.feed-page .feed-lateral__atalhos b {
    color: #111;
}

/* O topo do feed precisa encostar na barra de status com uma cor lisa.
   A safe area continua reservada no padding do .feed-top, mas sem translucidez,
   gradiente ou linha que deixe a parte superior cinza/embacada. */
@media (max-width: 991.98px) {
    /* iOS 26: o desfoque atras do relogio e tingido com o fundo do documento
       (html, ou o body quando o html nao tem cor). Com o #F7F7F7 do body, ele
       virava a "nuvem" cinza-clara ate sobre telas escuras como o login. O
       body continua pintando o proprio fundo claro nas paginas. */
    html,
    body.feed-page {
        background: #111 !important;
    }

    /* iOS 26: a area do relogio copia a cor da barra fixa/sticky que encosta
       no topo, mas so se o fundo for uma cor lisa. Com degrade o iOS desiste
       e desenha o desfoque claro por cima. */
    #mainNav {
        background: #111 !important;
    }

    body.feed-page .feed-wrap.fade-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    body.feed-page .feed-top {
        /* Igual ao #mainNav: a safe area entra no mesmo padding e nao vira
           uma faixa extra que aumenta a barra do feed no celular. */
        padding: calc(0.4rem + env(safe-area-inset-top, 0px)) 12px 0.4rem !important;
        background: #111 !important;
        border-bottom: 1px solid #000 !important;
        box-shadow: 0 4px 30px rgba(27, 38, 59, 0.3) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
}

@media (min-width: 992px) {
    body.ig-light.feed-page .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca),
    body.ig-light.feed-page .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca) i,
    body.ig-light.feed-page .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca) .nav-svg {
        color: #111;
    }

    body.ig-light.feed-page .feed-desktop-nav :is(a, button).active:not(.feed-desktop-nav__marca),
    body.ig-light.feed-page .feed-desktop-nav :is(a, button):not(.feed-desktop-nav__marca):hover {
        color: #111;
        background: #f5f5f5;
    }

    body.ig-light .feed-desktop-nav :is(a, button).active:not(.feed-desktop-nav__marca) {
        color: #111;
        background: #fff4d6;
    }

    body.ig-light .feed-desktop-nav :is(a, button).active:not(.feed-desktop-nav__marca) i,
    body.ig-light .feed-desktop-nav :is(a, button).active:not(.feed-desktop-nav__marca) .nav-svg {
        color: var(--accent-dark, #b89000);
    }

    body.ig-light.feed-page .feed-desktop-nav__fim { border-top: 0; }
}

/* No tema escuro, as regras finais do menu claro nao podem pintar os icones
   de #111 sobre a tab bar preta. Mantemos o desenho monocromatico e deixamos
   somente a aba ativa usar o acento da marca. */
body.ig-dark .bottom-nav-item[data-cor] i,
body.ig-dark .bottom-nav-item[data-cor] .nav-svg {
    color: #e8e8e8 !important;
    opacity: 1;
    filter: none;
}

body.ig-dark .bottom-nav-item[data-cor].active i,
body.ig-dark .bottom-nav-item[data-cor].active .nav-svg {
    color: var(--accent) !important;
}

body.ig-dark .nav-offcanvas-item[data-cor] i,
body.ig-dark .nav-offcanvas-item[data-cor] .nav-svg {
    color: inherit !important;
    opacity: 1;
    filter: none;
}

body.ig-dark .nav-offcanvas-item[data-cor].active i,
body.ig-dark .nav-offcanvas-item[data-cor].active .nav-svg {
    color: var(--accent) !important;
}

body.ig-dark .nav-offcanvas-header .text-white,
body.ig-dark .nav-offcanvas-header .text-accent {
    color: #f5f5f5 !important;
}
