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

    /* =====================================================
       SISTEMA DE 5 TEMAS CLAROS
       ===================================================== */
    
    /* TEMA 1: Light (Padrão) - Lavanda Claro */
    [data-theme="light"] {
      --primary: #6366f1; --primary-hover: #4f46e5; --primary-light: #818cf8;
      --secondary: #8b5cf6; --accent: #f59e0b;
      --bg-body: #f8f9fc; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #f0f1f5;
      --text: #1f2937; --text-muted: #6b7280; --text-dim: #9ca3af;
      --border: #e5e7eb;
      --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    }

    /* TEMA 2: Sky - Azul Céu Claro */
    [data-theme="sky"] {
      --primary: #0ea5e9; --primary-hover: #0284c7; --primary-light: #38bdf8;
      --secondary: #06b6d4; --accent: #14b8a6;
      --bg-body: #f0f9ff; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #e0f2fe;
      --text: #0c4a6e; --text-muted: #0369a1; --text-dim: #7dd3fc;
      --border: #bae6fd;
      --gradient: linear-gradient(135deg, #0ea5e9, #06b6d4);
    }

    /* TEMA 3: Mint - Verde Menta Claro */
    [data-theme="mint"] {
      --primary: #10b981; --primary-hover: #059669; --primary-light: #34d399;
      --secondary: #22c55e; --accent: #84cc16;
      --bg-body: #f0fdf4; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #dcfce7;
      --text: #14532d; --text-muted: #166534; --text-dim: #86efac;
      --border: #bbf7d0;
      --gradient: linear-gradient(135deg, #10b981, #22c55e);
    }

    /* TEMA 4: Peach - Pêssego/Coral Claro */
    [data-theme="peach"] {
      --primary: #f97316; --primary-hover: #ea580c; --primary-light: #fb923c;
      --secondary: #ef4444; --accent: #eab308;
      --bg-body: #fff7ed; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #ffedd5;
      --text: #7c2d12; --text-muted: #c2410c; --text-dim: #fdba74;
      --border: #fed7aa;
      --gradient: linear-gradient(135deg, #f97316, #ef4444);
    }

    /* TEMA 5: Blossom - Rosa Floral Claro */
    [data-theme="blossom"] {
      --primary: #ec4899; --primary-hover: #db2777; --primary-light: #f472b6;
      --secondary: #a855f7; --accent: #f43f5e;
      --bg-body: #fdf2f8; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #fce7f3;
      --text: #831843; --text-muted: #be185d; --text-dim: #f9a8d4;
      --border: #fbcfe8;
      --gradient: linear-gradient(135deg, #ec4899, #a855f7);
    }

    /* =====================================================
       SISTEMA DE 5 TEMAS ESCUROS
       ===================================================== */
    
    /* TEMA 6: Midnight - Roxo Noturno */
    [data-theme="midnight"] {
      --primary: #6366f1; --primary-hover: #4f46e5; --primary-light: #818cf8;
      --secondary: #8b5cf6; --accent: #f59e0b;
      --bg-body: #0f0f1a; --bg-sidebar: #13131f; --bg-card: #1a1a2e; --bg-hover: #252540;
      --text: #f1f1f1; --text-muted: #9ca3af; --text-dim: #6b7280;
      --border: #2e2e4d;
      --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    }

    /* TEMA 7: Ocean - Azul Oceano Escuro */
    [data-theme="ocean"] {
      --primary: #0ea5e9; --primary-hover: #0284c7; --primary-light: #38bdf8;
      --secondary: #06b6d4; --accent: #14b8a6;
      --bg-body: #0c1929; --bg-sidebar: #0f2137; --bg-card: #132f4c; --bg-hover: #1a4165;
      --text: #e6f4ff; --text-muted: #94c4e8; --text-dim: #5a9bcf;
      --border: #1e4976;
      --gradient: linear-gradient(135deg, #0ea5e9, #06b6d4);
    }

    /* TEMA 8: Forest - Verde Floresta Escuro */
    [data-theme="forest"] {
      --primary: #22c55e; --primary-hover: #16a34a; --primary-light: #4ade80;
      --secondary: #10b981; --accent: #84cc16;
      --bg-body: #0f1a14; --bg-sidebar: #142118; --bg-card: #1a2f22; --bg-hover: #254033;
      --text: #e8f5e9; --text-muted: #a5d6a7; --text-dim: #66bb6a;
      --border: #2d5a3d;
      --gradient: linear-gradient(135deg, #22c55e, #10b981);
    }

    /* TEMA 9: Sunset - Pôr do Sol Escuro */
    [data-theme="sunset"] {
      --primary: #f97316; --primary-hover: #ea580c; --primary-light: #fb923c;
      --secondary: #ef4444; --accent: #eab308;
      --bg-body: #1a1310; --bg-sidebar: #211915; --bg-card: #2f211a; --bg-hover: #402d22;
      --text: #fff5eb; --text-muted: #e0c4a8; --text-dim: #b8956c;
      --border: #5a3d2b;
      --gradient: linear-gradient(135deg, #f97316, #ef4444);
    }

    /* TEMA 10: Rose - Rosa Escuro */
    [data-theme="rose"] {
      --primary: #ec4899; --primary-hover: #db2777; --primary-light: #f472b6;
      --secondary: #a855f7; --accent: #f43f5e;
      --bg-body: #1a0f14; --bg-sidebar: #21131a; --bg-card: #2f1a24; --bg-hover: #402333;
      --text: #fdf2f8; --text-muted: #f9a8d4; --text-dim: #ec4899;
      --border: #5a2d43;
      --gradient: linear-gradient(135deg, #ec4899, #a855f7);
    }

    /* =====================================================
       TEMAS ADICIONAIS — CLAROS
       ===================================================== */

    /* TEMA 11: Sand - Dourado Areia */
    [data-theme="sand"] {
      --primary: #ca8a04; --primary-hover: #a16207; --primary-light: #fbbf24;
      --secondary: #d97706; --accent: #b45309;
      --bg-body: #fefce8; --bg-sidebar: #fffbeb; --bg-card: #ffffff; --bg-hover: #fef9c3;
      --text: #713f12; --text-muted: #92400e; --text-dim: #fbbf24;
      --border: #fde68a;
      --gradient: linear-gradient(135deg, #ca8a04, #d97706);
    }

    /* TEMA 12: Lavender - Lavanda */
    [data-theme="lavender"] {
      --primary: #7c3aed; --primary-hover: #6d28d9; --primary-light: #a78bfa;
      --secondary: #8b5cf6; --accent: #c084fc;
      --bg-body: #f5f3ff; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #ede9fe;
      --text: #4c1d95; --text-muted: #6d28d9; --text-dim: #a78bfa;
      --border: #ddd6fe;
      --gradient: linear-gradient(135deg, #7c3aed, #c084fc);
    }

    /* TEMA 13: Aqua - Água Cristal */
    [data-theme="aqua"] {
      --primary: #0d9488; --primary-hover: #0f766e; --primary-light: #2dd4bf;
      --secondary: #06b6d4; --accent: #14b8a6;
      --bg-body: #f0fdfa; --bg-sidebar: #ffffff; --bg-card: #ffffff; --bg-hover: #ccfbf1;
      --text: #134e4a; --text-muted: #0f766e; --text-dim: #5eead4;
      --border: #99f6e4;
      --gradient: linear-gradient(135deg, #0d9488, #06b6d4);
    }

    /* =====================================================
       TEMAS ADICIONAIS — ESCUROS
       ===================================================== */

    /* TEMA 14: Carbon - Carbono */
    [data-theme="carbon"] {
      --primary: #e2e8f0; --primary-hover: #cbd5e1; --primary-light: #f1f5f9;
      --secondary: #94a3b8; --accent: #60a5fa;
      --bg-body: #0a0a0f; --bg-sidebar: #111118; --bg-card: #18181f; --bg-hover: #22222c;
      --text: #e2e8f0; --text-muted: #94a3b8; --text-dim: #64748b;
      --border: #2a2a35;
      --gradient: linear-gradient(135deg, #334155, #475569);
    }

    /* TEMA 15: Aurora - Aurora Boreal */
    [data-theme="aurora"] {
      --primary: #34d399; --primary-hover: #10b981; --primary-light: #6ee7b7;
      --secondary: #22d3ee; --accent: #a78bfa;
      --bg-body: #030d1a; --bg-sidebar: #051525; --bg-card: #0a1e33; --bg-hover: #0f2c48;
      --text: #e0fff8; --text-muted: #7eddd5; --text-dim: #4fb6aa;
      --border: #0e3a4a;
      --gradient: linear-gradient(135deg, #34d399, #22d3ee);
    }

    /* TEMA 16: Burgundy - Bordô */
    [data-theme="burgundy"] {
      --primary: #f59e0b; --primary-hover: #d97706; --primary-light: #fcd34d;
      --secondary: #e11d48; --accent: #fb7185;
      --bg-body: #12060a; --bg-sidebar: #1c0c12; --bg-card: #26101a; --bg-hover: #35172a;
      --text: #fef2f2; --text-muted: #fca5a5; --text-dim: #f87171;
      --border: #4c1029;
      --gradient: linear-gradient(135deg, #f59e0b, #e11d48);
    }

    :root { --col1-width: 260px; --col3-width: 300px; --navbar-height: 56px; }

    /* iOS: força height correto em Safari (antes de html,body) */
    html { min-height: -webkit-fill-available; }

    html, body {
      height: 100%;
      min-height: -webkit-fill-available; /* iOS Safari */
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--bg-body);
      color: var(--text);
      overflow: hidden;
      -webkit-text-size-adjust: 100%; /* evita zoom de fonte no iOS */
    }

    /* iOS: remove highlight cinza no tap e delay de 300ms */
    button, a, input, select, textarea, [role="button"] {
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }

    /* =====================================================
       LAYOUT 3 COLUNAS
       ===================================================== */
    .container { display: flex; height: 100vh; height: 100dvh; width: 100%; /* 100dvh: exclui barra do browser no iOS */ }

    .col-menu {
      width: var(--col1-width); min-width: var(--col1-width);
      background: var(--bg-sidebar); border-right: 1px solid var(--border);
      display: flex; flex-direction: column; overflow: hidden;
    }

    .col-content {
      flex: 1; background: var(--bg-body);
      overflow-y: auto; overflow-x: hidden;
      -webkit-overflow-scrolling: touch; /* inércia de scroll no iOS */
    }

    .col-rankings {
      width: var(--col3-width); min-width: var(--col3-width);
      background: var(--bg-sidebar); border-left: 1px solid var(--border);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    /* Scrollbar */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--primary); }

    /* =====================================================
       COLUNA 1 - MENU
       ===================================================== */
    .menu-logo {
      padding: 14px 20px; display: flex; align-items: center;
      border-bottom: 1px solid var(--border);
    }
    .menu-logo-img { max-height: 65px; width: auto; max-width: 100%; object-fit: contain; }

    .menu-user {
      padding: 14px 20px; display: flex; align-items: center; gap: 12px;
      border-bottom: 1px solid var(--border);
    }
    .menu-user-avatar {
      width: 38px; height: 38px; border-radius: 50%; background: var(--bg-card);
      display: flex; align-items: center; justify-content: center; font-size: 16px;
      overflow: hidden; flex-shrink: 0;
    }
    .menu-user-avatar img {
      width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    }
    .menu-user-info { flex: 1; min-width: 0; }
    .menu-user-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .menu-user-link { font-size: 0.75rem; color: var(--primary-light); text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; }
    .menu-user-link:hover { text-decoration: underline; }

    /* Visitor state */
    .menu-user-visitor-actions { display: flex; gap: 6px; margin-top: 6px; }
    .menu-user-visitor-actions a {
      font-size: 0.72rem; padding: 4px 10px; border-radius: 50px;
      text-decoration: none; font-weight: 500; transition: all 0.2s;
    }
    .btn-entrar-menu { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
    .btn-entrar-menu:hover { background: var(--primary); color: #fff; }
    .btn-cadastrar-menu { background: var(--gradient); color: #fff; border: 1px solid transparent; }
    .btn-cadastrar-menu:hover { opacity: 0.9; }

    /* Skeleton user */
    .menu-user.loading .menu-user-content { display: none; }
    .menu-user:not(.loading) .menu-user-skeleton { display: none; }
    .menu-user-skeleton { display: flex; align-items: center; gap: 12px; width: 100%; }
    .skel-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-hover); animation: skelPulse 1.5s infinite; }
    .skel-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
    .skel-line { height: 10px; border-radius: 4px; background: var(--bg-hover); animation: skelPulse 1.5s infinite; }
    .skel-line:first-child { width: 80%; }
    .skel-line:last-child { width: 50%; }
    @keyframes skelPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

    .menu-nav { flex: 1; overflow-y: auto; padding: 10px 0; }

    .menu-item {
      display: flex; align-items: center; gap: 12px; padding: 11px 20px;
      color: var(--text-muted); cursor: pointer; transition: all 0.2s;
      border-left: 3px solid transparent; font-size: 0.88rem;
    }
    .menu-item:hover { background: var(--bg-hover); color: var(--text); }
    .menu-item.active {
      background: rgba(99, 102, 241, 0.1); color: var(--primary-light);
      border-left-color: var(--primary);
    }
    .menu-item i { font-size: 1.2rem; width: 22px; }

    .menu-accordion { border-bottom: 1px solid var(--border); margin-bottom: 6px; }
    .menu-accordion-header {
      display: flex; align-items: center; gap: 12px; padding: 11px 20px;
      color: var(--text-muted); cursor: pointer; transition: all 0.2s; font-size: 0.88rem;
    }
    .menu-accordion-header:hover { background: var(--bg-hover); color: var(--text); }
    .menu-accordion-header i:first-child { font-size: 1.2rem; width: 22px; }
    .menu-accordion-header span { flex: 1; }
    .menu-accordion-arrow { transition: transform 0.2s; }
    .menu-accordion.open .menu-accordion-arrow { transform: rotate(180deg); }
    .menu-accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
    .menu-accordion.open .menu-accordion-content { max-height: 400px; }

    .menu-subitem {
      display: flex; align-items: center; gap: 10px; padding: 9px 20px 9px 54px;
      color: var(--text-dim); cursor: pointer; transition: all 0.2s; font-size: 0.82rem;
    }
    .menu-subitem:hover { background: var(--bg-hover); color: var(--text); }
    .menu-subitem i { font-size: 0.95rem; }

    /* Seletor de Tema */
    .theme-selector {
      padding: 12px 16px; border-top: 1px solid var(--border);
      background: var(--bg-card);
    }
    .theme-selector-label { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 6px; }
    .theme-row-label { font-size: 0.65rem; color: var(--text-dim); margin-bottom: 4px; margin-top: 6px; }
    .theme-options { display: flex; gap: 5px; flex-wrap: wrap; }
    .theme-btn {
      width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
      cursor: pointer; transition: all 0.2s; position: relative;
    }
    .theme-btn:hover { transform: scale(1.1); }
    .theme-btn.active { border-color: var(--text); }
    /* Temas Claros */
    .theme-btn[data-theme="light"] { background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: inset 0 0 0 2px #fff; }
    .theme-btn[data-theme="sky"] { background: linear-gradient(135deg, #0ea5e9, #06b6d4); box-shadow: inset 0 0 0 2px #fff; }
    .theme-btn[data-theme="mint"] { background: linear-gradient(135deg, #10b981, #22c55e); box-shadow: inset 0 0 0 2px #fff; }
    .theme-btn[data-theme="peach"] { background: linear-gradient(135deg, #f97316, #ef4444); box-shadow: inset 0 0 0 2px #fff; }
    .theme-btn[data-theme="blossom"] { background: linear-gradient(135deg, #ec4899, #a855f7); box-shadow: inset 0 0 0 2px #fff; }
    /* Temas Escuros */
    .theme-btn[data-theme="midnight"] { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
    .theme-btn[data-theme="ocean"] { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
    .theme-btn[data-theme="forest"] { background: linear-gradient(135deg, #22c55e, #10b981); }
    .theme-btn[data-theme="sunset"] { background: linear-gradient(135deg, #f97316, #ef4444); }
    .theme-btn[data-theme="rose"] { background: linear-gradient(135deg, #ec4899, #a855f7); }

    /* =====================================================
       COLUNA 2 - CONTEÚDO
       ===================================================== */

    /* Tabs de navegação principal */
    .content-tabs {
      display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border);
      overflow-x: auto; overflow-y: hidden; background: var(--bg-body);
      scrollbar-width: none; -ms-overflow-style: none;
      position: sticky; top: 0; z-index: 10;
    }
    .feed-toolbar-actions {
      margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0;
    }
    .feed-toolbar-btn {
      position: relative; background: none; border: none; cursor: pointer;
      color: var(--text-muted); font-size: 1.15rem; padding: 8px 10px;
      border-radius: 8px; transition: color .2s, background .2s;
      display: flex; align-items: center;
    }
    .feed-toolbar-btn:hover { color: var(--primary-light); background: rgba(167,139,250,.1); }
    .feed-filtro-badge {
      position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
      border-radius: 50%; background: var(--primary); pointer-events: none;
    }
    .feed-filtro-wrap { position: relative; }
    .feed-filtro-dropdown {
      display: none; position: fixed;
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
      padding: 6px; min-width: 210px; z-index: 2000;
      box-shadow: 0 8px 30px rgba(0,0,0,.4);
    }
    .feed-filtro-dropdown.aberto { display: block; }
    .feed-filtro-titulo {
      font-size: .72rem; font-weight: 600; letter-spacing: .06em;
      color: var(--text-dim); padding: 6px 10px 4px; text-transform: uppercase;
    }
    .feed-filtro-op {
      display: flex; align-items: center; gap: 9px; width: 100%;
      background: none; border: none; cursor: pointer; color: var(--text-muted);
      font-size: .88rem; padding: 9px 10px; border-radius: 8px; transition: all .15s;
      text-align: left;
    }
    .feed-filtro-op i { font-size: 1rem; flex-shrink: 0; }
    .feed-filtro-op:hover { color: var(--text); background: rgba(255,255,255,.05); }
    .feed-filtro-op.active { color: var(--primary-light); background: rgba(167,139,250,.12); }
    .content-tabs::-webkit-scrollbar { display: none; }
    .content-tab {
      padding: 12px 16px; background: none; border: none; color: var(--text-muted);
      cursor: pointer; font-size: 0.88rem; border-bottom: 2px solid transparent;
      margin-bottom: -1px; white-space: nowrap; transition: all 0.2s;
      display: flex; align-items: center; gap: 6px;
    }
    .content-tab:hover { color: var(--text); }
    .content-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }
    .content-tab i { font-size: 1.1rem; }

    /* Seções de conteúdo */
    .content-section { padding: 20px 24px; display: none; }
    .content-section.active { display: block; }

    /* Área social (Feed) com largura limitada */
    #section-feed { max-width: 680px; margin: 0 auto; }

    .section-header {
      display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
    }
    .section-title {
      font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
    }
    .section-link { font-size: 0.8rem; color: var(--primary-light); text-decoration: none; }
    .section-link:hover { text-decoration: underline; }

    /* =====================================================
       STORIES
       ===================================================== */
    /* Carousel wrapper para stories */
    .stories-carousel {
      position: relative;
    }
    .stories-container {
      display: flex; gap: 14px; padding: 4px 0 16px;
      overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
    }
    .stories-container::-webkit-scrollbar { display: none; }
    .stories-nav {
      position: absolute; top: 50%; transform: translateY(-60%);
      width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
      background: var(--bg-card); color: var(--text); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 1rem; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
      transition: opacity 0.2s, background 0.2s;
    }
    .stories-nav:hover { background: var(--bg-hover); }
    .stories-nav.left { left: -6px; }
    .stories-nav.right { right: -6px; }
    .stories-nav.hidden { opacity: 0; pointer-events: none; }

    .story-item {
      display: flex; flex-direction: column; align-items: center; gap: 6px;
      cursor: pointer; flex-shrink: 0;
    }
    .story-avatar {
      width: 64px; height: 64px; border-radius: 50%; padding: 3px;
      background: var(--border);
    }
    .story-avatar img {
      width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
      border: 3px solid var(--bg-body);
    }
    .story-add {
      width: 64px; height: 64px; border-radius: 50%; background: var(--bg-card);
      border: 2px dashed var(--primary); display: flex; align-items: center;
      justify-content: center; font-size: 1.5rem; color: var(--primary);
    }
    .story-name { font-size: 0.72rem; color: var(--text-muted); max-width: 64px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

    /* =====================================================
       FEED DE POSTAGENS
       ===================================================== */
    .post-composer {
      background: var(--bg-card); border-radius: 12px; padding: 14px;
      margin-bottom: 16px; border: 1px solid var(--border);
    }
    .post-composer-top { display: flex; gap: 12px; align-items: flex-start; }
    /* Área colapsada (clicável para expandir) */
    .post-composer-collapsed {
      flex: 1; background: var(--bg-hover); border: none; border-radius: 20px;
      padding: 10px 16px; color: var(--text-dim); font-size: 0.9rem;
      cursor: pointer; user-select: none; transition: background 0.2s;
    }
    .post-composer-collapsed:hover { background: var(--bg-body); }

    /* Área expandida (editor completo) */
    .post-composer-expanded { display: none; flex: 1; flex-direction: column; gap: 0; }
    .post-composer.expanded .post-composer-collapsed { display: none; }
    .post-composer.expanded .post-composer-expanded { display: flex; }

    /* Input de título */
    .composer-titulo-input {
      width: 100%; border: none; background: transparent; color: var(--text);
      font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.1rem;
      padding: 8px 0; outline: none; border-bottom: 1px solid var(--border);
      margin-bottom: 8px;
    }
    .composer-titulo-input::placeholder { color: var(--text-dim); font-weight: 400; }

    /* Toolbar do editor */
    .composer-toolbar {
      display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
      padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 6px;
    }
    .composer-toolbar button {
      width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
      background: none; border: 1px solid transparent; border-radius: 4px;
      color: var(--text-muted); cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
    }
    .composer-toolbar button:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
    .composer-toolbar button.active { background: var(--primary); color: white; border-color: var(--primary); }
    .composer-toolbar .toolbar-divider {
      width: 1px; height: 20px; background: var(--border); margin: 0 4px;
    }
    .composer-toolbar select {
      padding: 3px 6px; background: var(--bg-hover); color: var(--text);
      border: 1px solid var(--border); border-radius: 4px; font-size: 0.75rem;
      cursor: pointer; outline: none;
    }

    /* Área editável contenteditable */
    .composer-editor {
      min-height: 80px; max-height: 300px; overflow-y: auto;
      padding: 10px 2px; color: var(--text); font-size: 0.9rem; line-height: 1.6;
      outline: none; word-wrap: break-word; overflow-wrap: break-word;
    }
    .composer-editor:empty::before {
      content: attr(data-placeholder); color: var(--text-dim); pointer-events: none;
    }
    .composer-editor h1, .composer-editor h2, .composer-editor h3 { font-family: 'Cinzel', serif; margin: 8px 0 4px; }
    .composer-editor h1 { font-size: 1.2rem; }
    .composer-editor h2 { font-size: 1.1rem; }
    .composer-editor h3 { font-size: 1rem; }
    .composer-editor blockquote {
      border-left: 3px solid var(--primary-light); padding: 6px 12px;
      margin: 8px 0; background: var(--bg-hover); border-radius: 0 4px 4px 0;
      font-style: italic; color: var(--text-muted);
    }

    /* Preview de imagem anexada */
    .composer-image-preview {
      position: relative; display: inline-block; margin-top: 8px;
    }
    .composer-image-preview img {
      max-width: 100%; max-height: 200px; border-radius: 8px; object-fit: cover;
    }
    .composer-image-preview .remove-img {
      position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
      background: rgba(0,0,0,0.7); color: white; border: none; border-radius: 50%;
      cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px;
    }

    .post-composer-actions {
      display: flex; gap: 8px; margin-top: 12px; padding-top: 12px;
      border-top: 1px solid var(--border); justify-content: space-between;
    }
    .post-action-btn {
      display: flex; align-items: center; gap: 6px; padding: 8px 12px;
      background: none; border: none; color: var(--text-muted);
      cursor: pointer; border-radius: 8px; font-size: 0.85rem; transition: all 0.2s;
    }
    .post-action-btn:hover { background: var(--bg-hover); color: var(--primary-light); }
    .post-action-btn i { font-size: 1.1rem; }
    .post-publish-btn {
      padding: 8px 20px; background: var(--gradient); border: none;
      border-radius: 20px; color: white; font-weight: 500; cursor: pointer;
      font-size: 0.85rem; transition: opacity 0.2s;
    }
    .post-publish-btn:hover { opacity: 0.9; }
    .post-publish-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    .feed-post {
      background: var(--bg-card); border-radius: 12px; padding: 16px;
      margin-bottom: 16px; border: 1px solid var(--border);
      transition: box-shadow 0.4s ease, border-color 0.4s ease;
    }
    .feed-post--highlight {
      border-color: var(--primary-light, #818cf8);
      box-shadow: 0 0 0 3px rgba(129,140,248,0.25), 0 4px 24px rgba(99,102,241,0.18);
      animation: post-highlight-pulse 1s ease 2;
    }
    @keyframes post-highlight-pulse {
      0%, 100% { box-shadow: 0 0 0 3px rgba(129,140,248,0.25), 0 4px 24px rgba(99,102,241,0.18); }
      50%       { box-shadow: 0 0 0 6px rgba(129,140,248,0.40), 0 8px 32px rgba(99,102,241,0.30); }
    }
    .post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
    .post-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
    .post-user-info { flex: 1; min-width: 0; }
    .post-user-name { font-weight: 600; font-size: 0.9rem; }
    .post-user-meta { font-size: 0.75rem; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }
    .post-menu { color: var(--text-dim); cursor: pointer; padding: 4px; }

    /* Botão seguir / seguindo */
    .post-btn-seguir {
      flex-shrink: 0; display: flex; align-items: center; gap: 5px;
      background: transparent; border: 1px solid var(--primary);
      color: var(--primary-light); font-size: 0.78rem; font-weight: 600;
      padding: 4px 11px; border-radius: 20px; cursor: pointer;
      transition: all .2s; white-space: nowrap;
    }
    .post-btn-seguir:hover { background: rgba(167,139,250,.15); }
    .post-btn-seguir.seguindo {
      background: rgba(167,139,250,.12); border-color: transparent;
      color: var(--text-muted);
    }
    .post-btn-seguir.seguindo:hover {
      background: rgba(239,68,68,.1); border-color: #ef4444; color: #ef4444;
    }
    .post-btn-seguir.seguindo:hover::after { content: 'Deixar de seguir'; }
    .post-btn-seguir.seguindo:hover i,
    .post-btn-seguir.seguindo:hover span { display: none; }

    .post-content { margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; }
    .post-content .book-mention {
      color: var(--primary-light); cursor: pointer;
    }
    .post-content .book-mention:hover { text-decoration: underline; }

    .post-book-card {
      display: flex; gap: 12px; padding: 12px; background: var(--bg-hover);
      border-radius: 8px; margin-bottom: 12px; cursor: pointer;
    }
    .post-book-card:hover { background: var(--bg-body); }
    .post-book-cover { width: 60px; height: 90px; border-radius: 4px; object-fit: cover; }
    .post-book-info { flex: 1; }
    .post-book-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
    .post-book-author { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
    .post-book-rating { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--accent); }

    .post-actions { display: flex; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
    .post-action {
      flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
      padding: 8px; background: none; border: none; color: var(--text-muted);
      cursor: pointer; border-radius: 8px; font-size: 0.85rem; transition: all 0.2s;
    }
    .post-action:hover { background: var(--bg-hover); color: var(--primary-light); }
    .post-action.liked { color: #ef4444; }
    .post-action i { font-size: 1.1rem; }
    .post-action-count { font-size: 0.8rem; font-weight: 600; line-height: 1; }

    /* Curtir — ativo = coração vermelho */
    .post-btn-curtir.ativo { color: #ef4444; }
    .post-btn-curtir.ativo:hover { color: #dc2626; background: rgba(239,68,68,0.08); }
    .post-btn-curtir.ativo i { animation: pulse-heart 0.35s ease; }
    @keyframes pulse-heart {
      0%   { transform: scale(1); }
      50%  { transform: scale(1.4); }
      100% { transform: scale(1); }
    }

    /* Favoritar — ativo = marcador roxo */
    .post-btn-favoritar.ativo { color: var(--primary-light, #a78bfa); }
    .post-btn-favoritar.ativo:hover { color: var(--primary, #7c3aed); background: rgba(167,139,250,0.1); }

    /* Compartilhar */
    .post-btn-compartilhar:hover { color: #3b82f6; background: rgba(59,130,246,0.08); }

    /* Responder — ativo = azul claro */
    .post-btn-responder.ativo { color: #60a5fa; }
    .post-btn-responder:hover { color: #60a5fa; background: rgba(96,165,250,0.08); }

    /* ── Área de respostas ─────────────────────────────────────────── */
    .post-respostas-area {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }

    /* Loading / vazio */
    .resp-loading, .resp-vazio, .resp-login-hint {
      padding: 12px 0;
      font-size: 0.8rem;
      color: var(--text-dim);
      text-align: center;
    }

    /* Form de resposta */
    .resp-form {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      margin-bottom: 14px;
    }
    .resp-form-body { flex: 1; min-width: 0; }

    /* Editor contenteditable */
    .resp-editor {
      width: 100%;
      min-height: 38px;
      max-height: 180px;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg-secondary, rgba(255,255,255,0.04));
      color: var(--text);
      font-size: 0.85rem;
      line-height: 1.5;
      outline: none;
      overflow-y: auto;
      word-break: break-word;
      transition: border-color 0.2s;
      font-family: inherit;
      box-sizing: border-box;
    }
    .resp-editor:focus { border-color: var(--primary-light, #a78bfa); }
    .resp-editor:empty::before {
      content: attr(data-placeholder);
      color: var(--text-dim);
      pointer-events: none;
    }
    .resp-editor .noto-emoji {
      width: 22px; height: 22px;
      vertical-align: middle;
      margin: 0 1px;
      pointer-events: none;
    }

    /* Toolbar do form */
    .resp-form-toolbar {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-top: 6px;
      flex-wrap: wrap;
    }
    .resp-tool-btn {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-dim);
      font-size: 1rem;
      padding: 4px 6px;
      border-radius: 6px;
      line-height: 1;
      transition: color 0.15s, background 0.15s;
    }
    .resp-tool-btn:hover { color: var(--primary-light, #a78bfa); background: rgba(167,139,250,0.1); }
    .resp-char-count { font-size: 0.72rem; color: var(--text-dim); margin-left: 2px; }
    .resp-form-btns { display: flex; gap: 7px; margin-left: auto; }
    .resp-btn-cancelar {
      padding: 5px 12px;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: none;
      color: var(--text-dim);
      font-size: 0.8rem;
      cursor: pointer;
    }
    .resp-btn-cancelar:hover { background: var(--bg-hover); color: var(--text); }
    .resp-btn-enviar {
      padding: 5px 14px;
      border: none;
      border-radius: 7px;
      background: var(--primary-light, #a78bfa);
      color: #fff;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: opacity 0.15s;
    }
    .resp-btn-enviar:disabled { opacity: 0.4; cursor: not-allowed; }
    .resp-btn-enviar:not(:disabled):hover { opacity: 0.85; }

    /* Preview de mídia no form */
    .resp-media-preview {
      position: relative;
      margin-top: 6px;
    }
    .resp-preview-remove {
      position: absolute;
      top: 4px; right: 4px;
      background: rgba(0,0,0,0.6);
      border: none;
      border-radius: 50%;
      color: #fff;
      width: 22px; height: 22px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      font-size: 0.9rem;
      line-height: 1;
      padding: 0;
    }
    .resp-livro-preview {
      display: flex;
      align-items: center;
      gap: 10px;
      background: linear-gradient(135deg, #1a1a2e, #2d2b55);
      border-radius: 8px;
      padding: 8px 10px;
      color: #fff;
      position: relative;
    }
    .resp-livro-capa {
      width: 40px; height: 60px; border-radius: 4px;
      object-fit: cover; flex-shrink: 0; display: block;
    }
    .resp-livro-capa-placeholder {
      width: 40px; height: 60px; border-radius: 4px;
      background: rgba(255,255,255,.08);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.2rem; opacity: .5; flex-shrink: 0;
    }
    .resp-livro-info { flex: 1; min-width: 0; }
    .resp-livro-titulo { font-size: 0.78rem; font-weight: 700; display: block; line-height: 1.3; }
    .resp-livro-subtit { font-size: 0.7rem; opacity: .7; display: block; margin-top: 2px; }

    /* Picker de emoji dentro do form */
    .resp-emoji-picker {
      position: relative;
      background: var(--bg-card, #1e1e2e);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 6px;
      margin-bottom: 6px;
      box-shadow: 0 8px 30px rgba(0,0,0,.4);
      z-index: 20;
    }

    /* Avatares */
    .resp-avatar {
      width: 34px; height: 34px; border-radius: 50%;
      object-fit: cover; flex-shrink: 0;
    }
    .resp-avatar-sm { width: 28px; height: 28px; }
    .resp-avatar-fallback {
      display: flex; align-items: center; justify-content: center;
      background: var(--bg-hover); color: var(--text-dim);
      font-size: 0.9rem;
    }
    .resp-avatar-sm.resp-avatar-fallback { font-size: 0.75rem; }

    /* Card de resposta */
    .resp-lista { display: flex; flex-direction: column; gap: 2px; }
    .resp-card {
      border-radius: 10px;
      padding: 10px 0;
    }
    .resp-card + .resp-card { border-top: 1px solid var(--border); }
    .resp-card-replica {
      padding: 8px 0 8px 14px;
      border-left: 2px solid var(--border);
      margin-left: 34px;
    }
    .resp-card-linha { display: flex; gap: 10px; align-items: flex-start; }
    .resp-card-corpo { flex: 1; min-width: 0; }
    .resp-card-header {
      display: flex; align-items: center; gap: 6px;
      margin-bottom: 4px; flex-wrap: wrap;
    }
    .resp-autor-nome { font-size: 0.82rem; font-weight: 700; }
    .resp-autor-user { font-size: 0.75rem; color: var(--primary-light, #a78bfa); }
    .resp-tempo { font-size: 0.72rem; color: var(--text-dim); margin-left: auto; }
    .resp-texto { font-size: 0.85rem; line-height: 1.5; word-break: break-word; }

    /* Ações inline das respostas */
    .resp-acoes {
      display: flex; gap: 12px; margin-top: 6px; align-items: center;
    }
    .resp-action {
      background: none; border: none; cursor: pointer;
      color: var(--text-dim); font-size: 0.78rem;
      display: flex; align-items: center; gap: 4px;
      padding: 2px 4px; border-radius: 5px;
      transition: color 0.15s, background 0.15s;
    }
    .resp-action:hover { color: var(--primary-light, #a78bfa); background: rgba(167,139,250,0.08); }
    .resp-btn-curtir.ativo { color: #ef4444; }
    .resp-btn-curtir.ativo:hover { color: #dc2626; }
    .resp-btn-del:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
    .resp-btn-replica:hover { color: #60a5fa; background: rgba(96,165,250,0.08); }

    /* Réplicas aninhadas */
    .resp-replicas-list { margin-top: 4px; }

    /* Slot do form de réplica */
    .resp-form-replica-slot { margin-top: 8px; }

    /* ── Modal de compartilhamento ── */
    #share-modal-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
      padding: 16px;
      opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
    }
    #share-modal-overlay.aberto { opacity: 1; pointer-events: all; }
    .share-modal-box {
      background: #1c1c2e;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,0.1);
      width: 100%; max-width: 400px; padding: 24px 20px 28px;
      transform: scale(0.93) translateY(12px); transition: transform 0.25s ease;
      box-shadow: 0 12px 50px rgba(0,0,0,0.6);
    }
    #share-modal-overlay.aberto .share-modal-box { transform: scale(1) translateY(0); }
    .share-modal-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 20px; font-weight: 700; font-size: 1.05rem; color: #e5e7eb;
    }
    .share-modal-fechar {
      background: none; border: none; color: #9ca3af;
      font-size: 1.5rem; cursor: pointer; padding: 0 4px; line-height: 1;
      transition: color 0.15s;
    }
    .share-modal-fechar:hover { color: #e5e7eb; }
    .share-modal-redes {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
      margin-bottom: 20px;
    }
    .share-modal-rede {
      display: flex; flex-direction: column; align-items: center; gap: 7px;
      padding: 14px 8px; border: 1px solid rgba(255,255,255,0.1);
      border-radius: 12px; background: rgba(255,255,255,0.05);
      color: var(--cor-rede, #e5e7eb); cursor: pointer;
      transition: all 0.18s; font-size: 0.78rem; font-weight: 500;
    }
    .share-modal-rede i { font-size: 1.5rem; }
    .share-modal-rede:hover { background: rgba(255,255,255,0.09); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
    .share-modal-link {
      display: flex; gap: 8px; align-items: center;
    }
    .share-modal-link input {
      flex: 1; padding: 10px 12px; border-radius: 9px;
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.06);
      color: #9ca3af; font-size: 0.8rem; outline: none;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    #share-copy-btn {
      padding: 10px 16px; border-radius: 9px; border: none; cursor: pointer;
      background: var(--primary-light, #a78bfa); color: #fff;
      font-size: 0.85rem; font-weight: 600; transition: all 0.18s;
      display: flex; align-items: center; gap: 6px; white-space: nowrap;
    }
    #share-copy-btn:hover { background: var(--primary, #7c3aed); transform: translateY(-1px); }

    /* Post content com "ver mais" */
    .post-content.collapsed { max-height: 220px; overflow: hidden; position: relative; }
    .post-content.collapsed::after {
      content: ''; position: absolute; bottom: 0; left: 0; right: 0;
      height: 50px; background: linear-gradient(transparent, var(--bg-card));
    }
    .post-ver-mais {
      display: inline-block; color: var(--primary-light); cursor: pointer;
      font-size: 0.85rem; font-weight: 500; margin-top: 4px;
    }
    .post-ver-mais:hover { text-decoration: underline; }

    /* Título principal do post (Cinzel épico) */
    .post-titulo {
      font-family: 'Cinzel', serif;
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--text);
      line-height: 1.3;
      margin-top: calc(1.1rem * 2);
      margin-bottom: calc(1.1rem * 1);
      letter-spacing: 0.02em;
    }
    .post-titulo:first-child, .post-header + .post-titulo { margin-top: 0; }

    /* Rich text dentro dos posts */
    .post-content h1, .post-content h2, .post-content h3,
    .post-content h4, .post-content h5, .post-content h6 {
      font-family: 'Cinzel', serif;
      line-height: 1.3; color: var(--text);
    }
    .post-content h1 { font-size: 1.3rem; margin: calc(1.3rem * 2) 0 calc(1.3rem * 1); }
    .post-content h2 { font-size: 1.15rem; margin: calc(1.15rem * 2) 0 calc(1.15rem * 1); }
    .post-content h3 { font-size: 1.05rem; margin: calc(1.05rem * 2) 0 calc(1.05rem * 1); }
    .post-content h4, .post-content h5, .post-content h6 { font-size: 0.95rem; margin: calc(0.95rem * 2) 0 calc(0.95rem * 1); }

    /* Capitular épica no primeiro parágrafo após h1 */
    .post-content h1 + p::first-letter {
      font-family: 'Cinzel', serif;
      font-weight: 700;
      font-size: 3.2em;
      float: left;
      line-height: 0.8;
      margin-right: 8px;
      margin-top: 4px;
      color: var(--primary-light);
    }
    .post-content p { margin-bottom: 10px; }
    .post-content ul, .post-content ol { margin: 8px 0; padding-left: 24px; }
    .post-content li { margin-bottom: 4px; }
    .post-content strong, .post-content b { font-weight: 700; color: var(--text); }
    .post-content em, .post-content i:not([class]) { font-style: italic; }
    .post-content u { text-decoration: underline; }
    .post-content blockquote {
      margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--primary-light);
      background: var(--bg-hover); border-radius: 0 6px 6px 0;
      font-style: italic; color: var(--text-muted);
    }
    .post-content a { color: var(--primary-light); text-decoration: underline; }
    .post-content img {
      max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0;
    }
    .post-content table {
      width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.85rem;
    }
    .post-content th, .post-content td {
      padding: 6px 10px; border: 1px solid var(--border); text-align: left;
    }
    .post-content th { background: var(--bg-hover); font-weight: 600; }
    .post-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
    .post-content pre { background: var(--bg-hover); padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 0.85rem; }
    .post-content code { background: var(--bg-hover); padding: 2px 5px; border-radius: 3px; font-size: 0.85rem; }

    /* Post image landscape */
    .post-image {
      width: 100%; border-radius: 8px; margin-bottom: 12px;
      max-height: 300px; object-fit: cover; aspect-ratio: 16/9;
    }

    /* Story avatar fallback icon */
    .story-avatar-icon {
      width: 100%; height: 100%; border-radius: 50%; display: flex;
      align-items: center; justify-content: center;
      background: var(--bg-hover); border: 3px solid var(--bg-body);
      color: var(--text-dim); font-size: 1.4rem;
    }

    /* Post avatar fallback */
    .post-avatar-fallback {
      width: 44px; height: 44px; border-radius: 50%; display: flex;
      align-items: center; justify-content: center;
      background: var(--bg-hover); color: var(--text-dim); font-size: 1.2rem;
      flex-shrink: 0;
    }

    /* Composer avatar image */
    .post-composer-avatar { 
      width: 40px; height: 40px; border-radius: 50%; background: var(--bg-hover);
      display: flex; align-items: center; justify-content: center;
      overflow: hidden; flex-shrink: 0;
    }
    .post-composer-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

    /* Post badge tipo notícia/evento/análise */
    .post-badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 0.7rem; padding: 2px 8px; border-radius: 10px;
      background: var(--bg-hover); color: var(--primary-light);
    }
    .post-badge.analise { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

    /* ─── Overlay bloqueador de publicação ─── */
    #pub-overlay {
      position: fixed; inset: 0; z-index: 99999;
      background: rgba(0,0,0,0.72); backdrop-filter: blur(5px);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
    }
    #pub-overlay.active { opacity: 1; pointer-events: all; }
    .pub-overlay-box {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 16px; padding: 32px 40px; width: 90%; max-width: 360px;
      text-align: center; transition: all 0.3s;
    }
    .pub-overlay-icon {
      font-size: 2.6rem; display: block; margin-bottom: 12px;
      color: var(--primary-light); animation: pub-spin 1.1s linear infinite;
    }
    @keyframes pub-spin { to { transform: rotate(360deg); } }
    .pub-overlay-title {
      font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 4px;
    }
    .pub-overlay-status {
      font-size: 0.82rem; color: var(--text-dim); margin-bottom: 20px; min-height: 1.1em;
    }
    .pub-progress-track {
      width: 100%; height: 6px; background: var(--bg-hover);
      border-radius: 99px; overflow: hidden;
    }
    .pub-progress-fill {
      height: 100%; border-radius: 99px; width: 0%;
      background: var(--gradient, linear-gradient(135deg,#2980b9,#1abc9c));
      transition: width 0.35s ease;
    }
    .pub-progress-pct {
      margin-top: 8px; font-size: 0.82rem; font-weight: 700;
      color: var(--primary-light); letter-spacing: 0.04em;
    }
    .pub-overlay-box.error .pub-overlay-icon {
      animation: none; color: #ef4444;
    }
    .pub-overlay-box.error .pub-progress-fill { background: #ef4444; }
    .pub-overlay-box.error .pub-overlay-title { color: #ef4444; }
    .pub-overlay-btn-fechar {
      margin-top: 18px; padding: 8px 28px;
      background: var(--bg-hover); border: 1px solid var(--border);
      border-radius: 8px; color: var(--text); font-size: 0.85rem;
      cursor: pointer; display: none; transition: background 0.2s;
    }
    .pub-overlay-btn-fechar:hover { background: var(--border); }
    .pub-overlay-box.error .pub-overlay-btn-fechar { display: inline-block; }

    /* ─── Botão deletar post (apenas para o autor) ─── */
    .post-delete-btn {
      background: none; border: none; padding: 5px 8px;
      color: var(--text-dim); cursor: pointer; border-radius: 6px;
      font-size: 0.82rem; transition: all 0.2s;
      display: flex; align-items: center; gap: 4px; margin-left: auto;
    }
    .post-delete-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

    /* =====================================================
       LEIA ASTION
       ===================================================== */
    .leia-astion-banner {
      background: var(--gradient); border-radius: 16px; padding: 24px;
      margin-bottom: 20px; position: relative; overflow: hidden;
    }
    .leia-astion-banner::before {
      content: ''; position: absolute; top: -50%; right: -20%;
      width: 300px; height: 300px; background: rgba(255,255,255,0.1);
      border-radius: 50%;
    }
    .leia-astion-badge {
      display: inline-flex; align-items: center; gap: 6px;
      background: rgba(255,255,255,0.2); padding: 6px 12px; border-radius: 20px;
      font-size: 0.75rem; font-weight: 600; margin-bottom: 12px;
    }
    .leia-astion-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
    .leia-astion-desc { font-size: 0.9rem; opacity: 0.9; margin-bottom: 16px; max-width: 400px; }
    .leia-astion-btn {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 10px 20px; background: white; color: var(--primary);
      border: none; border-radius: 8px; font-weight: 600; cursor: pointer;
      font-size: 0.9rem; transition: transform 0.2s;
    }
    .leia-astion-btn:hover { transform: scale(1.02); }

    /* ─── Carrossel Hero - Leia Astion ─── */
    .hero-carousel-leia {
      position: relative; width: 100%; height: 340px;
      overflow: hidden; margin-bottom: 18px;
      border-radius: 14px;
      box-shadow: 0 6px 24px rgba(0,0,0,0.18);
      border: 1px solid var(--border);
    }
    .carousel-track-leia {
      display: flex; height: 100%;
      transition: transform 0.6s ease-in-out;
    }
    .carousel-slide-leia {
      min-width: 100%; height: 100%; position: relative;
    }
    .carousel-slide-leia img {
      width: 100%; height: 100%; object-fit: cover; object-position: center;
    }
    .carousel-slide-leia::after {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(to bottom, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.55) 100%);
    }
    .carousel-logo-leia {
      position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
      z-index: 15; max-width: 200px; height: auto;
      filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
    }
    .carousel-nav-leia {
      position: absolute; top: 50%; transform: translateY(-50%);
      background: rgba(0,0,0,0.45); color: #fff; border: none;
      width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
      font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
      transition: background 0.2s; z-index: 10;
    }
    .carousel-nav-leia:hover { background: var(--primary); }
    .carousel-nav-leia.prev-leia { left: 14px; }
    .carousel-nav-leia.next-leia { right: 14px; }
    .carousel-indicators-leia {
      position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%);
      display: flex; gap: 8px; z-index: 15;
    }
    .carousel-indicator-leia {
      width: 10px; height: 10px; border-radius: 50%;
      background: rgba(255,255,255,0.45); border: 2px solid rgba(255,255,255,0.8);
      cursor: pointer; transition: all 0.3s; padding: 0;
    }
    .carousel-indicator-leia.active {
      background: var(--primary); border-color: var(--primary); transform: scale(1.25);
    }
    .carousel-cta-leia {
      position: absolute; bottom: 0; left: 0; right: 0;
      background: rgba(0,0,0,0.55); padding: 12px 20px;
      display: flex; align-items: center; justify-content: space-between;
      z-index: 20; gap: 14px; border-radius: 0 0 14px 14px;
    }
    .carousel-cta-text-leia { display: flex; flex-direction: column; gap: 2px; }
    .carousel-cta-title-leia { font-size: 1.1rem; font-weight: 700; color: #f1c40f; margin: 0; }
    .carousel-cta-subtitle-leia { font-size: 0.82rem; color: #d3e8ed; margin: 0; }
    .carousel-cta-btn-leia {
      background: transparent; color: #f1c40f; border: 2px solid #f1c40f;
      padding: 8px 20px; border-radius: 8px; font-size: 0.88rem; font-weight: 600;
      cursor: pointer; transition: all 0.25s;
      display: flex; align-items: center; gap: 6px; white-space: nowrap;
    }
    .carousel-cta-btn-leia:hover { background: #f1c40f; color: #000; }
    @media (max-width: 600px) {
      .hero-carousel-leia { height: 220px; }
      .carousel-logo-leia { max-width: 130px; top: 10px; }
      .carousel-cta-title-leia { font-size: 0.9rem; }
      .carousel-cta-subtitle-leia { display: none; }
      .carousel-cta-btn-leia { padding: 6px 12px; font-size: 0.78rem; }
    }

    /* Container de duas colunas */
    .leia-astion-container {
      display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px;
    }
    @media (max-width: 900px) {
      .leia-astion-container { grid-template-columns: 1fr; }
    }

    /* Coluna Coleção */
    .coluna-colecao-leia {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
      padding: 20px; max-height: 650px; overflow-y: auto;
    }
    .coluna-colecao-leia::-webkit-scrollbar { width: 6px; }
    .coluna-colecao-leia::-webkit-scrollbar-track { background: var(--bg-hover); border-radius: 10px; }
    .coluna-colecao-leia::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
    .coluna-colecao-leia::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
    .coluna-colecao-leia-header {
      display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
      padding-bottom: 12px; border-bottom: 2px solid var(--border);
    }
    .coluna-colecao-leia-header i { font-size: 1.5rem; color: var(--primary); }
    .coluna-colecao-leia-header h3 { font-size: 1.15rem; font-weight: 600; margin: 0; color: var(--text); }

    /* Grid de livros da coleção */
    .colecao-livros-grid-leia {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px;
    }
    /* Leia Astion: cards agora herdam .book-card — apenas sobreposições específicas */
    .livro-card-colecao-leia {
      /* alias de .book-card — sobreposições mantidas para retrocompatibilidade */
    }
    .livro-card-colecao-leia:hover {
      transform: translateY(-3px); border-color: var(--primary);
      box-shadow: 0 6px 20px rgba(99,102,241,0.15);
    }
    /* Mantidos para fallback de capa */
    .livro-capa-colecao-leia { position: relative; aspect-ratio: 2/3; background: var(--bg-hover); }
    .livro-capa-colecao-leia img { width: 100%; height: 100%; object-fit: cover; }
    .livro-capa-colecao-leia-placeholder,
    .book-cover-placeholder {
      width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
      color: var(--text-muted); font-size: 2rem; background: var(--bg-hover);
    }
    /* Info e tipografia legada (não usados nos novos cards) */
    .livro-info-colecao-leia {
      padding: 10px; display: flex; flex-direction: column; gap: 3px; flex: 1;
    }
    .livro-titulo-colecao-leia {
      font-size: 0.92rem; font-weight: 600; color: var(--text);
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .livro-autor-colecao-leia { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
    .livro-subtitulo-colecao-leia { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 3px; }
    .livro-volume-colecao-leia { font-size: 0.7rem; color: var(--text-muted); }
    .livro-genero-colecao-leia {
      display: inline-block; font-size: 0.68rem; padding: 2px 8px; border-radius: 10px;
      background: var(--primary); color: white; font-weight: 500; align-self: flex-start;
      margin-bottom: 2px;
    }
    .livro-preco-colecao-leia { font-size: 1rem; font-weight: 700; color: var(--primary); margin-top: 4px; }
    .livro-avaliacoes-colecao-leia { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; }
    .livro-avaliacoes-colecao-leia .estrelas { color: var(--accent); }
    .livro-avaliacoes-colecao-leia .avaliacao-texto { color: var(--text-muted); }
    .livro-acoes-colecao-leia {
      display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border);
    }
    .btn-comprar-leia, .btn-info-leia, .btn-pagina-leia {
      flex: 1; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 0.78rem;
      display: flex; align-items: center; justify-content: center; gap: 4px;
      transition: all 0.2s ease; border: 1px solid var(--border); background: var(--bg-card);
      color: var(--text);
    }
    .btn-comprar-leia {
      background: var(--gradient); color: white; border: none; font-weight: 600;
    }
    .btn-comprar-leia:hover { opacity: 0.9; transform: translateY(-1px); }
    .btn-comprar-leia:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
    .btn-info-leia:hover, .btn-pagina-leia:hover {
      border-color: var(--primary); color: var(--primary); background: var(--bg-hover);
    }
    .btn-comprar-leia.ja-adquirido {
      background: #22c55e; border: none; cursor: default;
    }

    /* Badge externo Volume 1 */
    .badge-externo-leia {
      position: absolute; top: 8px; right: 8px;
      background: linear-gradient(135deg, #ff6b35, #f7931e); color: white;
      padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600;
      box-shadow: 0 2px 8px rgba(255,107,53,0.4); z-index: 5;
    }

    /* Coluna Chat */
    .coluna-chat-leia {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
      padding: 20px; display: flex; flex-direction: column; max-height: 650px;
    }
    .coluna-chat-leia-header {
      display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
      padding-bottom: 12px; border-bottom: 2px solid var(--border);
    }
    .coluna-chat-leia-header i { font-size: 1.5rem; color: var(--accent); }
    .coluna-chat-leia-header h3 { font-size: 1.15rem; font-weight: 600; margin: 0; color: var(--text); }

    .chat-container-leia {
      flex: 1; display: flex; flex-direction: column-reverse; gap: 10px;
      overflow-y: auto; margin-bottom: 12px; padding-right: 6px;
    }
    .chat-container-leia::-webkit-scrollbar { width: 5px; }
    .chat-container-leia::-webkit-scrollbar-track { background: var(--bg-hover); border-radius: 10px; }
    .chat-container-leia::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

    .chat-msg-leia {
      background: var(--bg-hover); border-left: 3px solid var(--text-muted);
      padding: 10px 12px; border-radius: 8px;
    }
    .chat-msg-leia.sistema { border-left-color: var(--primary); background: rgba(99,102,241,0.08); }
    .chat-msg-leia.usuario-atual { border-left-color: #22c55e; background: rgba(34,197,94,0.08); }
    .chat-msg-leia.fixada { border: 2px solid var(--accent); background: rgba(234,179,8,0.08); }
    .chat-msg-leia.deletada { opacity: 0.5; font-style: italic; }
    .chat-fixada-badge-leia {
      display: inline-flex; align-items: center; gap: 4px;
      background: var(--accent); color: #000; padding: 2px 8px;
      border-radius: 4px; font-size: 0.72rem; font-weight: 600; margin-bottom: 4px;
    }
    .chat-autor-leia { font-size: 0.8rem; font-weight: 600; margin-bottom: 3px; }
    .chat-texto-leia { font-size: 0.88rem; color: var(--text); line-height: 1.5; margin-bottom: 3px; }
    .chat-hora-leia { font-size: 0.72rem; color: var(--text-muted); }
    .chat-status-leia { text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.9rem; }
    .chat-status-leia i { font-size: 2rem; color: var(--text-muted); margin-bottom: 8px; display: block; }

    .chat-input-area-leia {
      display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: auto;
    }
    .chat-input-leia {
      flex: 1; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text);
      padding: 9px 14px; border-radius: 8px; font-size: 0.88rem; outline: none; transition: all 0.2s;
    }
    .chat-input-leia::placeholder { color: var(--text-muted); }
    .chat-input-leia:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
    .chat-send-btn-leia {
      background: var(--gradient); color: white; border: none; padding: 9px 16px;
      border-radius: 8px; cursor: pointer; font-size: 1rem; transition: all 0.2s;
      display: flex; align-items: center; justify-content: center;
    }
    .chat-send-btn-leia:hover { opacity: 0.9; transform: translateY(-1px); }
    .chat-send-btn-leia:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

    /* =====================================================
       COMUNIDADES (LEITOR DESBRAVADOR)
       ===================================================== */
    .menu-subitem[data-section] { cursor: pointer; }
    .menu-subitem[data-section].active {
      background: var(--bg-hover);
      color: var(--primary);
      border-left: 2px solid var(--primary);
    }


    .btn-criar-comunidade {
      border: 1px solid var(--primary);
      background: var(--gradient);
      color: #fff;
      border-radius: 999px;
      padding: 8px 14px;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .btn-criar-comunidade:hover { transform: translateY(-1px); opacity: 0.95; }

    .comunidades-filtros {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }
    .comunidades-filtros .btn-criar-comunidade {
      margin-left: auto;
    }
    .comunidades-search-input {
      flex: 1;
      min-width: 240px;
      max-width: 420px;
      padding: 8px 14px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 999px;
      color: var(--text);
      font-size: 0.8rem;
      outline: none;
    }
    .comunidades-search-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
    }

    .comunidades-bloco { margin-bottom: 16px; }
    .comunidades-bloco-titulo {
      margin: 0 0 10px;
      font-size: 0.88rem;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .comunidades-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 14px;
    }

    /* ---- Card Autor ---- */
    .comunidade-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 16px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: transform 0.22s ease, box-shadow 0.22s ease;
      position: relative;
    }
    .comunidade-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    }
    /* Tarja colorida no topo — altura proporcional para a foto grande */
    .cc-banner {
      height: 90px;
      width: 100%;
      flex-shrink: 0;
    }
    /* Foto do autor — destaque visual 60% da largura */
    .cc-avatar-wrap {
      display: flex;
      justify-content: center;
      margin-top: -40px;
      position: relative;
      z-index: 2;
    }
    .cc-avatar {
      width: 60%;
      aspect-ratio: 1 / 1;
      border-radius: 50%;
      border: 4px solid var(--bg-card);
      object-fit: cover;
      object-position: center top;
      background: var(--bg-hover);
      box-shadow: 0 6px 20px rgba(0,0,0,0.22);
    }
    .cc-avatar-placeholder {
      width: 60%;
      aspect-ratio: 1 / 1;
      border-radius: 50%;
      border: 4px solid var(--bg-card);
      background: var(--bg-hover);
      box-shadow: 0 6px 20px rgba(0,0,0,0.22);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.4rem;
      color: var(--text-muted);
    }
    /* Corpo do card */
    .cc-body {
      padding: 8px 14px 14px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      text-align: center;
      flex: 1;
    }
    .cc-nome {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text);
      line-height: 1.3;
    }
    .cc-badge-autor {
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      border-radius: 999px;
      padding: 2px 9px;
      color: #fff;
      border: none;
    }
    .cc-livros {
      font-size: 0.74rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .cc-descricao {
      font-size: 0.77rem;
      color: var(--text-muted);
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .cc-actions {
      display: flex;
      gap: 6px;
      width: 100%;
      margin-top: auto;
      padding-top: 8px;
    }
    .comunidade-card-btn {
      flex: 1;
      border: 1px solid var(--border);
      background: var(--bg-hover);
      color: var(--text);
      border-radius: 8px;
      padding: 6px 8px;
      font-size: 0.74rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      transition: all 0.2s ease;
    }
    .comunidade-card-btn:hover {
      border-color: var(--primary);
      color: var(--primary);
    }
    .comunidade-seguir-btn.seguindo {
      background: rgba(99,102,241,0.12);
      border-color: rgba(99,102,241,0.4);
      color: var(--primary);
    }
    .comunidade-seguir-btn.seguindo:hover {
      background: rgba(239,68,68,0.1);
      border-color: rgba(239,68,68,0.4);
      color: #ef4444;
    }
    /* Card literária (estilo diferente, mais simples) */
    .comunidade-card.literaria-card .cc-banner {
      height: 48px;
    }
    .comunidade-vazio {
      text-align: center;
      border: 1px dashed var(--border);
      border-radius: 12px;
      color: var(--text-muted);
      padding: 24px;
      margin-top: 8px;
      display: none;
    }

    .comunidade-autor-panel {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 16px;
      display: block;
    }
    .comunidade-autor-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 12px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 10px;
    }
    .comunidade-autor-header h4 {
      margin: 0;
      font-size: 1rem;
      color: var(--text);
    }
    .comunidade-autor-header p {
      margin: 4px 0 0;
      font-size: 0.78rem;
      color: var(--text-muted);
    }
    .comunidade-autor-close {
      border: 1px solid var(--border);
      background: var(--bg-hover);
      color: var(--text-muted);
      border-radius: 8px;
      width: 30px;
      height: 30px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .comunidade-autor-layout {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }
    .comunidade-autor-col {
      background: var(--bg-hover);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px;
    }
    .comunidade-autor-col h5 {
      margin: 0 0 10px;
      font-size: 0.86rem;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .comunidade-autor-lista {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .comunidade-autor-lista li {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px;
      font-size: 0.78rem;
      color: var(--text-muted);
    }
    .comunidade-autor-lista strong {
      display: block;
      color: var(--text);
      margin-bottom: 2px;
      font-size: 0.8rem;
    }

    @media (max-width: 920px) {
      .comunidade-autor-layout { grid-template-columns: 1fr; }
    }

    .content-tab.dynamic-author-tab {
      display: none;
      align-items: center;
      gap: 6px;
      border-style: dashed;
    }
    .dynamic-tab-close {
      font-size: 0.92rem;
      opacity: 0.75;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 50%;
    }
    .dynamic-tab-close:hover {
      background: rgba(0,0,0,0.08);
      opacity: 1;
    }

    .comunidade-autor-leia .coluna-colecao-leia,
    .comunidade-autor-leia .coluna-chat-leia {
      max-height: 620px;
    }

    /* =====================================================
       CLUBES DE LEITURA (ANALISTAS)
       ===================================================== */
    .search-bar-container {
      margin-bottom: 14px;
    }
    .search-bar-row {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .search-input-wrapper {
      flex: 1;
      min-width: 240px;
      position: relative;
    }
    .search-input-wrapper i {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-dim);
      font-size: 0.95rem;
      pointer-events: none;
    }
    .search-input {
      width: 100%;
      padding: 9px 12px 9px 34px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg-card);
      color: var(--text);
      font-size: 0.84rem;
      outline: none;
    }
    .search-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
    }
    .feature-btn.primary {
      border: 1px solid var(--primary);
      background: var(--gradient);
      color: #fff;
      border-radius: 10px;
      padding: 9px 14px;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .feature-btn.primary:hover {
      opacity: 0.92;
    }
    .loading-spinner {
      width: 28px;
      height: 28px;
      border: 3px solid var(--border);
      border-top-color: var(--primary);
      border-radius: 50%;
      margin: 30px auto;
      animation: spin 0.9s linear infinite;
    }
    .analyst-sections {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .analyst-group {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
    }
    .analyst-group-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }
    .analyst-group-title {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .analyst-group-count {
      font-size: 0.76rem;
      color: var(--text-muted);
    }
    .analyst-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 12px;
    }
    .analyst-card {
      background: var(--bg-body);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: all 0.2s;
    }
    .analyst-card:hover {
      border-color: var(--primary);
      transform: translateY(-2px);
    }
    .analyst-header {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .analyst-avatar {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--bg-hover);
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-dim);
      flex-shrink: 0;
    }
    .analyst-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .analyst-name {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text);
      line-height: 1.25;
    }
    .analyst-club {
      font-size: 0.76rem;
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 2px;
    }
    .analyst-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 2px;
    }
    .analyst-stat {
      text-align: center;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 5px;
    }
    .analyst-stat-value {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text);
    }
    .analyst-stat-label {
      font-size: 0.68rem;
      color: var(--text-muted);
      margin-top: 2px;
    }
    .analyst-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: auto;
    }
    .analyst-btn {
      border: 1px solid var(--border);
      background: var(--bg-hover);
      color: var(--text);
      border-radius: 8px;
      padding: 7px 8px;
      font-size: 0.76rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      text-decoration: none;
      transition: all 0.2s;
    }
    .analyst-btn:hover {
      border-color: var(--primary);
      color: var(--primary);
    }
    .analyst-btn.following {
      border-color: rgba(99,102,241,0.4);
      background: rgba(99,102,241,0.12);
      color: var(--primary);
    }
    .club-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 16px;
      overflow: visible;
      display: flex;
      flex-direction: column;
      transition: transform 0.22s ease, box-shadow 0.22s ease;
      position: relative;
    }
    .club-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    }
    .club-card-banner {
      height: 90px;
      width: 100%;
      flex-shrink: 0;
      border-radius: 16px 16px 0 0;
      overflow: hidden;
    }
    .club-card-avatar-wrap {
      display: flex;
      justify-content: center;
      margin-top: -40px;
      position: relative;
      z-index: 2;
    }
    .club-card-avatar {
      width: 60%;
      aspect-ratio: 1 / 1;
      border-radius: 50%;
      border: 4px solid var(--bg-card);
      background: var(--bg-hover);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-dim);
      overflow: hidden;
      box-shadow: 0 6px 20px rgba(0,0,0,0.22);
    }
    .club-card-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .club-card-logo {
      position: absolute;
      top: 8px;
      right: -10px;
      width: 96px;
      height: 96px;
      z-index: 10;
      border-radius: 12px;
      border: 2px solid var(--bg-card);
      background: rgba(15,23,42,0.82);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 6px;
      font-size: 0.66rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      box-shadow: 0 5px 14px rgba(0,0,0,0.25);
      overflow: hidden;
    }
    .club-card-logo img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
    .club-card-body {
      padding: 8px 14px 14px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 6px;
      flex: 1;
    }
    .club-card-title {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text);
      line-height: 1.3;
    }
    .club-card-curator {
      font-size: 0.74rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 4px;
      justify-content: center;
      text-align: center;
      min-height: 28px;
      line-height: 1.35;
    }
    .club-card-badge {
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      border-radius: 999px;
      padding: 2px 9px;
      color: #fff;
      border: none;
      background: var(--primary);
    }
    .club-card .analyst-stats {
      width: 100%;
      margin-top: 2px;
    }
    .club-card .analyst-actions {
      width: 100%;
      margin-top: auto;
      padding-top: 8px;
    }
    .club-card .analyst-btn {
      font-size: 0.74rem;
    }
    .club-detail-layout {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .club-hero {
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      background: var(--bg-card);
    }
    .club-hero-stage {
      position: relative;
      min-height: 240px;
      background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
      display: flex;
      align-items: stretch;
      justify-content: stretch;
    }
    .club-hero-slide {
      position: absolute;
      inset: 0;
      opacity: 0;
      transition: opacity 0.45s ease;
      background-size: cover;
      background-position: center;
    }
    .club-hero-slide.active {
      opacity: 1;
    }
    .club-hero-stage::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%);
      pointer-events: none;
    }
    .club-hero-content {
      position: relative;
      z-index: 2;
      margin-top: auto;
      padding: 18px;
      color: #fff;
      width: 100%;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
    }
    .club-hero-logo {
      max-height: 72px;
      max-width: 160px;
      object-fit: contain;
      border-radius: 10px;
      background: rgba(0,0,0,0.35);
      padding: 6px;
    }
    .club-hero-title {
      font-size: 1.12rem;
      font-weight: 700;
      margin-bottom: 4px;
    }
    .club-hero-meta {
      font-size: 0.82rem;
      opacity: 0.92;
    }
    .club-hero-controls {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 3;
      display: flex;
      gap: 6px;
    }
    .club-hero-btn {
      border: 1px solid rgba(255,255,255,0.35);
      background: rgba(0,0,0,0.35);
      color: #fff;
      border-radius: 8px;
      width: 30px;
      height: 30px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .club-hero-dots {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 10px;
      border-top: 1px solid var(--border);
      background: var(--bg-body);
    }
    .club-hero-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--border);
      border: none;
      cursor: pointer;
    }
    .club-hero-dot.active {
      background: var(--primary);
      transform: scale(1.1);
    }
    .club-posts-wrap {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-width: 680px;
      margin: 0 auto;
      width: 100%;
    }
    .club-post-empty {
      border: 1px dashed var(--border);
      border-radius: 10px;
      padding: 16px;
      text-align: center;
      color: var(--text-muted);
      background: var(--bg-card);
    }

    /* =====================================================
       GRID DE LIVROS (BIBLIOTECA)
       ===================================================== */
    .books-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px;
    }

    .book-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 10px; overflow: hidden; cursor: pointer; transition: all 0.2s;
      display: flex; flex-direction: column;
    }
    .book-card:hover {
      transform: translateY(-3px); border-color: var(--primary);
      box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
    }

    /* Capa sempre proporção 2:3 sem distorção */
    .book-cover {
      position: relative;
      width: 100%;
      aspect-ratio: 2 / 3;
      background: var(--bg-hover);
      overflow: hidden;
      flex-shrink: 0;
    }
    .book-cover img {
      position: absolute; inset: 0;
      width: 100%; height: 100%;
      object-fit: cover;
    }
    .book-cover-canvas {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
    }
    .book-cover-canvas canvas,
    .book-cover-canvas .book-cover-fallback {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      border: 0;
      display: block;
    }
    .book-progress {
      position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
      background: rgba(0,0,0,0.5);
    }
    .book-progress-bar { height: 100%; background: var(--gradient); }

    /* Info: flex-grow para empurrar o preço ao fundo */
    .book-info {
      padding: 10px;
      display: flex; flex-direction: column; flex: 1;
    }
    .book-title {
      font-size: 0.92rem; font-weight: 600; line-height: 1.3;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 6px;
    }
    .book-subtitle {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-bottom: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .book-volume {
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-bottom: 4px;
    }
    .book-author {
      font-size: 0.75rem; color: var(--text-muted);
      /* separador horizontal */
      margin-top: auto;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .badge-em-breve {
      display: inline-block; margin-top: 6px;
      background: var(--text-dim, #888); color: #fff;
      font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
      padding: 2px 8px; border-radius: 20px; text-transform: uppercase;
    }
    .book-cover .badge-em-breve {
      position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
      margin-top: 0; white-space: nowrap; z-index: 2;
      background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    }
    .book-rating {
      display: flex; align-items: center; gap: 4px; margin-top: 6px;
      font-size: 0.75rem; color: var(--accent);
    }
    .book-meta-date {
      font-size: 0.7rem; color: var(--text-dim); margin-top: 4px;
    }
    .book-preco {
      font-size: 1rem;
      font-weight: 700;
      color: var(--primary, #6366f1);
      margin-top: 8px;
      letter-spacing: 0.01em;
    }
    .book-preco-gratis {
      color: #22c55e !important;
    }
    /* Desconto no card de descobrir */
    .book-preco.preco-com-desc { margin-top: 8px; }
    .book-preco .preco-orig-riscado { font-size: 0.75rem; }
    .book-preco .preco-desc-valor { font-size: 1rem; font-weight: 700; }
    .book-preco .desconto-badge-card { font-size: 0.68rem; }
    .book-age-badge {
      position: absolute;
      top: 6px;
      left: 6px;
      width: 24px;
      height: 24px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.62rem;
      font-weight: 800;
      color: #fff;
      border: 1px solid rgba(255,255,255,0.35);
      box-shadow: 0 4px 10px rgba(0,0,0,0.18);
      z-index: 3;
      letter-spacing: 0.2px;
    }
    .book-age-badge.livre { background: #2e7d32; }
    .book-age-badge.c10 { background: #1976d2; }
    .book-age-badge.c12 { background: #f9a825; }
    .book-age-badge.c14 { background: #ef6c00; }
    .book-age-badge.c16 { background: #c62828; }
    .book-age-badge.c18 { background: #6a1b9a; }

    /* Filtros dentro da biblioteca */
    .library-filters {
      display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
    }
    .filter-btn {
      padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 20px; color: var(--text-muted); cursor: pointer;
      font-size: 0.8rem; transition: all 0.2s;
    }
    .filter-btn:hover { border-color: var(--primary); color: var(--text); }
    .filter-btn.active {
      background: var(--primary); border-color: var(--primary); color: white;
    }

    /* =====================================================
       COLUNA 3 - RANKINGS
       ===================================================== */
    .ranking-section { padding: 14px; border-bottom: 1px solid var(--border); }

    .ranking-header {
      display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
      padding-bottom: 8px; border-bottom: 1px solid var(--border);
    }
    .ranking-icon { font-size: 1.15rem; }
    .ranking-title { font-size: 0.95rem; font-weight: 600; }

    .ranking-list { display: flex; flex-direction: column; gap: 6px; }

    .ranking-item {
      display: flex; align-items: center; gap: 8px; padding: 6px;
      border-radius: 8px; cursor: pointer; transition: background 0.2s;
    }
    .ranking-item:hover { background: var(--bg-hover); }

    .ranking-position {
      width: 22px; height: 22px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
    }
    .ranking-position.gold { background: linear-gradient(135deg, #ffd700, #ffb700); color: #1a1a2e; }
    .ranking-position.silver { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #1a1a2e; }
    .ranking-position.bronze { background: linear-gradient(135deg, #cd7f32, #b8690d); color: white; }
    .ranking-position.default { background: var(--border); color: var(--text-muted); }

    .ranking-cover {
      width: 32px; height: 46px; border-radius: 3px; background: var(--bg-hover); flex-shrink: 0;
    }
    .ranking-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }

    .ranking-info { flex: 1; min-width: 0; }
    .ranking-book-title {
      font-size: 0.8rem; font-weight: 500; white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis;
    }
    .ranking-book-author { font-size: 0.7rem; color: var(--text-muted); }

    /* Sugestões de usuários */
    .suggestions-section { padding: 14px; }
    .suggestions-title {
      font-size: 0.85rem; font-weight: 600; margin-bottom: 12px;
      display: flex; align-items: center; gap: 6px;
    }
    .suggestion-item {
      display: flex; align-items: center; gap: 10px; padding: 8px 0;
    }
    .suggestion-avatar {
      width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    }
    .suggestion-info { flex: 1; }
    .suggestion-name { font-size: 0.85rem; font-weight: 500; }
    .suggestion-meta { font-size: 0.72rem; color: var(--text-muted); }
    .suggestion-btn {
      padding: 6px 14px; background: var(--gradient); border: none;
      border-radius: 20px; color: #fff; font-size: 0.75rem; cursor: pointer;
      font-weight: 500; transition: opacity 0.2s; white-space: nowrap;
    }
    .suggestion-btn:hover { opacity: 0.85; }
    .suggestion-btn.seguindo {
      background: transparent; border: 1px solid var(--text-dim);
      color: var(--text-muted);
    }
    .suggestion-btn.seguindo:hover { border-color: #ef4444; color: #ef4444; }
    .suggestion-avatar-placeholder {
      width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
      background: var(--gradient); display: flex; align-items: center;
      justify-content: center; font-size: 1rem; color: #fff; font-weight: 600;
    }
    .suggestions-ver-mais {
      display: block; width: 100%; margin-top: 8px; padding: 7px;
      background: transparent; border: 1px solid var(--border); border-radius: 20px;
      color: var(--text-muted); font-size: 0.75rem; cursor: pointer; text-align: center;
    }
    .suggestions-ver-mais:hover { border-color: var(--primary); color: var(--primary); }
    .suggestions-loading { text-align: center; padding: 16px 0; color: var(--text-muted); font-size: 0.85rem; }

    /* =====================================================
       RANKINGS API - COLUNA 3
       ===================================================== */
    .rank-bloco {
      padding: 14px; border-bottom: 1px solid var(--border);
    }
    .rank-titulo {
      font-size: 0.95rem; font-weight: 600; margin-bottom: 12px;
      padding-bottom: 8px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 8px;
    }
    .rank-loading {
      text-align: center; padding: 20px; color: var(--text-dim);
    }
    .rank-loading i { font-size: 1.5rem; animation: spin 1s linear infinite; }
    @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

    /* Destaque 1º lugar */
    .rank-destaque {
      display: flex; flex-direction: column; align-items: center;
      padding: 12px; background: var(--bg-hover); border-radius: 10px;
      margin-bottom: 10px; cursor: pointer; transition: all 0.2s; position: relative;
    }
    .rank-destaque:hover { background: var(--bg-card); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    .rank-destaque-medal {
      position: absolute; top: 8px; left: 8px; font-size: 1.2rem;
    }
    .rank-destaque-capa {
      width: 80px; height: 115px; border-radius: 6px; object-fit: cover;
      box-shadow: 0 3px 10px rgba(0,0,0,0.2); margin-bottom: 8px;
    }
    .rank-destaque-titulo {
      font-size: 0.82rem; font-weight: 600; text-align: center;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .rank-destaque-meta {
      font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;
    }

    /* Lista de itens do ranking */
    .rank-lista {
      list-style: none; display: flex; flex-direction: column; gap: 4px;
    }
    .rank-lista-item {
      display: flex; align-items: center; gap: 8px; padding: 6px 4px;
      border-radius: 6px; cursor: pointer; transition: background 0.2s; font-size: 0.82rem;
    }
    .rank-lista-item:hover { background: var(--bg-hover); }
    .rank-posicao {
      width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.7rem; font-weight: 700; background: var(--border); color: var(--text-muted);
    }
    .rank-posicao.gold { background: linear-gradient(135deg, #ffd700, #ffb700); color: #1a1a2e; }
    .rank-posicao.silver { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #1a1a2e; }
    .rank-posicao.bronze { background: linear-gradient(135deg, #cd7f32, #b8690d); color: white; }
    .rank-item-mini-capa {
      width: 28px; height: 40px; border-radius: 3px; object-fit: cover; flex-shrink: 0;
      box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    }
    .rank-item-info { flex: 1; min-width: 0; }
    .rank-item-titulo {
      font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .rank-item-meta { font-size: 0.7rem; color: var(--text-muted); }

    /* Link ver 100 */
    .rank-ver-mais {
      display: block; text-align: center; padding: 10px; margin-top: 8px;
      font-size: 0.78rem; color: var(--primary-light); text-decoration: none;
      border-radius: 8px; transition: all 0.2s;
    }
    .rank-ver-mais:hover { background: var(--bg-hover); text-decoration: underline; }

    /* Erro */
    .rank-erro {
      text-align: center; padding: 16px; color: var(--text-dim); font-size: 0.82rem;
    }
    .rank-erro i { font-size: 1.3rem; margin-bottom: 6px; display: block; }

    /* =====================================================
       NAVBAR MOBILE
       ===================================================== */
    .navbar-mobile {
      display: none; position: fixed; top: 0; left: 0; right: 0;
      /* notch iOS: safe-area-inset-top garante conteúdo abaixo do notch/Dynamic Island */
      height: calc(var(--navbar-height) + env(safe-area-inset-top, 0px));
      background: var(--bg-sidebar);
      border-bottom: 1px solid var(--border); z-index: 100;
      padding: env(safe-area-inset-top, 0px) 16px 0;
      align-items: center; justify-content: space-between;
    }
    .navbar-btn {
      width: 40px; height: 40px; background: none; border: none;
      color: var(--text); font-size: 1.4rem; cursor: pointer;
      border-radius: 8px; display: flex; align-items: center; justify-content: center;
    }
    .navbar-btn:hover { background: var(--bg-hover); }
    .navbar-logo { display: flex; align-items: center; justify-content: center; }
    .navbar-logo-img { height: 36px; width: auto; object-fit: contain; display: block; }

    .menu-overlay {
      display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.5); z-index: 90;
    }
    .menu-overlay.active { display: block; }

    /* =====================================================
       RESPONSIVE
       ===================================================== */
    @media (max-width: 1100px) {
      .navbar-mobile { display: flex; }
      /* padding-top inclui notch para não cobrir conteúdo atrás do navbar */
      .container { padding-top: calc(var(--navbar-height) + env(safe-area-inset-top, 0px)); }

      .col-menu {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 95;
        transform: translateX(-100%); transition: transform 0.3s ease;
      }
      .col-menu.open { transform: translateX(0); }

      .col-rankings {
        /* top abaixo da navbar (inclui notch) para não sobrepor cabeçalho */
        position: fixed; top: calc(var(--navbar-height) + env(safe-area-inset-top, 0px)); right: 0; bottom: 0; z-index: 95;
        transform: translateX(100%); transition: transform 0.3s ease;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
      }
      .col-rankings.open { transform: translateX(0); }

      /* Margem inferior — safe-area-inset-bottom cobre barra do home indicator no iOS */
      .content-section {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
      }
      .col-content {
        padding-bottom: env(safe-area-inset-bottom, 20px);
      }
      .col-menu .menu-nav {
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
      }
    }

    @media (max-width: 768px) {
      .books-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
      .feed-filtro-dropdown { right: -4px; }
    }

    /* =====================================================
       DESCOBRIR — SELETORES EM CASCATA + LINHAS POR GÊNERO
       ===================================================== */
    .descobrir-select {
      padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 20px; color: var(--text); font-size: 0.8rem; cursor: pointer;
      transition: border-color 0.2s; flex-shrink: 0;
    }
    .descobrir-select:focus { outline: none; border-color: var(--primary); }
    .layout-toggle { display: flex; gap: 3px; flex-shrink: 0; }
    .layout-toggle .filter-btn { padding: 6px 10px; margin: 0; }
    .layout-toggle .filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

    /* Linhas horizontais por gênero */
    .genero-row-section { margin-bottom: 24px; }
    .genero-row-header {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 10px; padding: 0 2px;
    }
    .genero-row-icon { font-size: 1.15rem; }
    .genero-row-title { font-size: 0.95rem; font-weight: 600; color: var(--text); flex: 1; }
    .genero-row-count { font-size: 0.72rem; color: var(--text-muted); margin-right: 6px; }
    .genero-row-link {
      font-size: 0.75rem; color: var(--primary-light); cursor: pointer;
      text-decoration: none; white-space: nowrap;
    }
    .genero-row-link:hover { text-decoration: underline; }
    .genero-row-scroll {
      display: flex; gap: 10px; overflow-x: auto;
      padding-bottom: 8px; scroll-snap-type: x mandatory;
    }
    .genero-row-scroll::-webkit-scrollbar { height: 3px; }
    .genero-row-scroll::-webkit-scrollbar-track { background: transparent; }
    .genero-row-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
    .genero-row-scroll .book-card {
      scroll-snap-align: start; flex: 0 0 128px; min-width: 128px; max-width: 128px;
    }
    .genero-row-skel { flex: 0 0 128px; min-width: 128px; border-radius: 8px; overflow: hidden; }
    .genero-row-skel-inner {
      background: var(--bg-hover); animation: skelPulse 1.5s infinite;
      height: 192px; border-radius: 8px; margin-bottom: 6px;
    }
    .genero-row-skel-line {
      height: 9px; background: var(--bg-hover); animation: skelPulse 1.5s infinite;
      border-radius: 4px; margin-bottom: 4px;
    }
    .genero-row-empty {
      padding: 16px 20px; color: var(--text-muted); font-size: 0.82rem;
      text-align: center; font-style: italic;
    }
    .genero-row-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0 20px; }

    /* =====================================================
       NOTO ANIMATED EMOJI PICKER
       ===================================================== */
    #noto-emoji-picker {
      background: var(--bg-card, #fff);
      border: 1px solid var(--border, rgba(0,0,0,.12));
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0,0,0,.18);
      overflow: hidden;
      margin-bottom: 8px;
      animation: noto-ep-in 0.15s ease;
    }
    @keyframes noto-ep-in {
      from { opacity:0; transform:translateY(6px); }
      to   { opacity:1; transform:translateY(0); }
    }
    .noto-ep-tabs {
      display: flex;
      border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
      overflow-x: auto;
      scrollbar-width: none;
    }
    .noto-ep-tabs::-webkit-scrollbar { display: none; }
    .noto-ep-tab {
      flex: 1;
      min-width: 48px;
      padding: 8px 6px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 1.35rem;
      border-bottom: 2px solid transparent;
      transition: border-color 0.15s, background 0.15s;
    }
    .noto-ep-tab:hover { background: var(--bg-hover, rgba(0,0,0,.04)); }
    .noto-ep-tab.active {
      border-bottom-color: var(--primary-light, #a78bfa);
      background: var(--bg-hover, rgba(0,0,0,.03));
    }
    .noto-ep-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
      gap: 2px;
      padding: 8px;
      max-height: 230px;
      overflow-y: auto;
      scrollbar-width: thin;
    }
    .noto-ep-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      background: none;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      padding: 5px;
      transition: background 0.1s, transform 0.12s;
      width: 50px;
      height: 50px;
      flex-shrink: 0;
    }
    .noto-ep-btn:hover {
      background: var(--bg-hover, rgba(0,0,0,.06));
      transform: scale(1.15);
    }
    .noto-ep-btn img { display: block; border-radius: 4px; width: 36px; height: 36px; }

    /* Noto emoji inline no editor e nos posts — grande e com sombra suave */
    .composer-editor .noto-emoji,
    .post-content .noto-emoji {
      width: 2.2rem;
      height: 2.2rem;
      vertical-align: -0.55rem;
      display: inline-block;
      margin: 0 1px;
      filter: drop-shadow(0 2px 5px rgba(0,0,0,.22));
    }
    /* Garante que linhas com emoji não cortam verticalmente */
    .composer-editor p:has(.noto-emoji),
    .composer-editor div:has(.noto-emoji),
    .post-content p:has(.noto-emoji) {
      line-height: 2.8rem;
    }
