        /* ================================================================
           EDIÇÃO 1930 — "A REDAÇÃO DA MEIA-NOITE"
           A redação de jornal dos anos 30 operando num ambiente de tecnologia:
           tinta de impressão e papel-jornal no lugar do cinza frio; latão de
           máquina de escrever como acento; o lápis vermelho do editor para
           alertas. Tipografia: Fraunces (manchetes — oldstyle com ink traps),
           Libre Franklin (UI — a grotesca dos jornais americanos) e
           IBM Plex Mono (dados — máquina de escrever → terminal).
           ================================================================ */

        /* 1. Tema Padrão: Baseado nas configurações de Sistema (Default) */
        @media (prefers-color-scheme: dark) {
            :root {
                --bg-dark: #141009;           /* tinta de impressão (preto quente) */
                --bg-card: #1C1710;           /* ferro da prensa */
                --border-muted: #382E1E;      /* latão oxidado */
                --text-main: #F0E6D2;         /* creme de papel-jornal */
                --text-muted: #9A8C6F;        /* papel envelhecido */
                --color-accent: #D9A441;      /* latão da máquina de escrever */
                --color-accent-dim: rgba(217, 164, 65, 0.10);
                --color-red: #E06052;         /* lápis vermelho do editor */
            }
        }

        @media (prefers-color-scheme: light) {
            :root {
                --bg-dark: #F2EBDB;           /* banca de jornal */
                --bg-card: #FAF5E9;           /* papel saído da prensa */
                --border-muted: #D9CDB0;      /* fio de impressão */
                --text-main: #221B10;         /* tinta */
                --text-muted: #7C6F55;        /* legenda esmaecida */
                --color-accent: #8A6410;      /* bronze de tinta (AA sobre papel) */
                --color-accent-dim: rgba(138, 100, 16, 0.10);
                --color-red: #AE3327;         /* lápis vermelho */
            }
        }

        /* 2. Forçar Tema via Classes (Modo Manual do Usuário) */
        html.theme-dark {
            --bg-dark: #141009;
            --bg-card: #1C1710;
            --border-muted: #382E1E;
            --text-main: #F0E6D2;
            --text-muted: #9A8C6F;
            --color-accent: #D9A441;
            --color-accent-dim: rgba(217, 164, 65, 0.10);
            --color-red: #E06052;
        }

        html.theme-light {
            --bg-dark: #F2EBDB;
            --bg-card: #FAF5E9;
            --border-muted: #D9CDB0;
            --text-main: #221B10;
            --text-muted: #7C6F55;
            --color-accent: #8A6410;
            --color-accent-dim: rgba(138, 100, 16, 0.10);
            --color-red: #AE3327;
        }

        /* ESTILOS CORE */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont, sans-serif;
            -webkit-font-smoothing: antialiased;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-main);
            height: 100vh;
            overflow: hidden;
            display: flex;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        /* 1. SIDEBAR LATERAL (MONOCROMÁTICA) */
        .sidebar {
            width: 240px;
            border-right: 1px solid var(--border-muted);
            display: flex;
            flex-direction: column;
            padding: 2rem 1.5rem;
            flex-shrink: 0;
            background-color: var(--bg-card);
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .brand {
            margin-bottom: 3rem;
        }

        .brand h1 {
            font-size: 1.1rem;
            font-weight: 700;
            letter-spacing: -0.03em;
            color: var(--text-main);
        }

        .brand span {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            display: block;
            margin-top: 0.25rem;
        }

        .nav-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            flex: 1;
        }

        .nav-item a {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 0.85rem;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            border-radius: 4px;
            transition: all 0.15s ease;
        }

        .nav-item a:hover {
            color: var(--text-main);
            background-color: rgba(0, 0, 0, 0.03);
        }

        html.theme-dark .nav-item a:hover {
            background-color: rgba(255, 255, 255, 0.02);
        }

        .nav-item.active a {
            color: var(--color-accent);
            background-color: var(--color-accent-dim);
            font-weight: 600;
        }

        .badge {
            font-size: 0.7rem;
            background-color: var(--border-muted);
            color: var(--text-muted);
            padding: 0.1rem 0.4rem;
            border-radius: 2px;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .nav-item.active .badge {
            background-color: var(--color-accent);
            color: var(--bg-dark);
        }

        .sidebar-footer {
            border-top: 1px solid var(--border-muted);
            padding-top: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .status-dot {
            width: 6px;
            height: 6px;
            background-color: var(--color-accent);
            border-radius: 50%;
            box-shadow: 0 0 8px var(--color-accent);
            transition: background-color 0.2s ease;
        }

        .status-text {
            font-size: 0.75rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* 2. CANVAS PRINCIPAL */
        .main-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .main-header {
            padding: 2rem 2.5rem 1.5rem 2.5rem;
            border-bottom: 1px solid var(--border-muted);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: border-color 0.2s ease;
        }

        .main-header h2 {
            font-size: 1.35rem;
            font-weight: 600;
            letter-spacing: -0.02em;
        }

        .main-header p {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }

        /* SELETOR DE TEMAS COM ÍCONES (MINIMALISMO ESTRUTURADO) */
        .header-actions {
            display: flex;
            align-items: center;
            gap: 1.25rem;
        }

        .theme-selector {
            display: flex;
            border: 1px solid var(--border-muted);
            border-radius: 4px;
            padding: 2px;
            background-color: rgba(0, 0, 0, 0.03);
            transition: border-color 0.2s ease;
        }

        html.theme-dark .theme-selector {
            background-color: rgba(255, 255, 255, 0.01);
        }

        .theme-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .theme-btn .material-icons {
            font-size: 16px;
            transition: color 0.15s ease;
        }

        .theme-btn:hover {
            color: var(--text-main);
        }

        .theme-btn.active {
            background-color: var(--color-accent-dim);
            color: var(--color-accent);
        }

        .ceo-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            border: 1px solid var(--border-muted);
            padding: 0.35rem 0.65rem;
            border-radius: 3px;
            font-weight: 500;
            transition: border-color 0.2s ease;
        }

        /* ÁREA DE CONTEÚDO */
        .content-area {
            flex: 1;
            padding: 2.5rem;
            overflow-y: auto;
        }

        .content-section {
            display: none;
        }

        .content-section.active {
            display: block;
        }

        /* SEÇÃO 1: PAUTAS PENDENTES (LINHAS DE 1PX) */
        .pautas-list {
            display: flex;
            flex-direction: column;
            border: 1px solid var(--border-muted);
            border-radius: 4px;
            background-color: var(--bg-card);
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .pauta-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-muted);
            transition: background-color 0.15s ease, border-color 0.2s ease;
        }

        .pauta-row:last-child {
            border-bottom: none;
        }

        .pauta-row:hover {
            background-color: rgba(0, 0, 0, 0.015);
        }

        html.theme-dark .pauta-row:hover {
            background-color: rgba(255, 255, 255, 0.01);
        }

        .pauta-info {
            max-width: 70%;
        }

        .pauta-meta {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.7rem;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .pauta-meta .pauta-tag {
            color: var(--color-accent);
            background-color: var(--color-accent-dim);
            padding: 0.1rem 0.35rem;
            border-radius: 2px;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .pauta-row h3 {
            font-size: 0.95rem;
            font-weight: 500;
            line-height: 1.4;
            color: var(--text-main);
            margin-bottom: 0.35rem;
        }

        .pauta-row p {
            font-size: 0.8rem;
            color: var(--text-muted);
            line-height: 1.5;
        }

        .pauta-actions {
            display: flex;
            gap: 0.75rem;
        }

        /* BOTÕES DE AÇÃO MINIMALISTAS */
        .btn {
            background: none;
            border: 1px solid var(--border-muted);
            color: var(--text-muted);
            padding: 0.45rem 0.85rem;
            font-size: 0.75rem;
            font-weight: 600;
            border-radius: 3px;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            transition: all 0.15s ease;
        }

        .btn:hover {
            border-color: var(--text-muted);
            color: var(--text-main);
        }

        .btn-accent {
            border-color: var(--color-accent);
            color: var(--color-accent);
        }

        .btn-accent:hover {
            background-color: var(--color-accent);
            color: var(--bg-dark);
            box-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
        }

        html.theme-light .btn-accent:hover {
            color: #ffffff;
            box-shadow: 0 0 10px rgba(5, 150, 105, 0.15);
        }

        .btn-danger-text {
            border-color: transparent;
            color: var(--text-muted);
        }

        .btn-danger-text:hover {
            color: var(--color-red);
            border-color: rgba(239, 68, 68, 0.2);
        }

        /* SEÇÃO 2: FILA DE PRODUÇÃO */
        .editor-layout {
            display: grid;
            grid-template-columns: 1fr 320px;
            gap: 2.5rem;
            height: calc(100vh - 180px);
        }

        .editor-container {
            border: 1px solid var(--border-muted);
            border-radius: 4px;
            background-color: var(--bg-card);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .editor-toolbar {
            height: 48px;
            border-bottom: 1px solid var(--border-muted);
            background-color: rgba(0, 0, 0, 0.02);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 1.25rem;
            transition: border-color 0.2s ease;
        }

        html.theme-dark .editor-toolbar {
            background-color: rgba(0, 0, 0, 0.15);
        }

        .toolbar-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .toolbar-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 0.75rem;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            border-radius: 2px;
        }

        .toolbar-btn:hover {
            color: var(--text-main);
            background-color: rgba(0, 0, 0, 0.03);
        }

        html.theme-dark .toolbar-btn:hover {
            background-color: rgba(255, 255, 255, 0.03);
        }

        .toolbar-btn.accent-tool {
            color: var(--color-accent);
        }

        .editor-content {
            flex: 1;
            overflow-y: auto;
            padding: 3rem;
            position: relative;
        }

        .editor-ai-line {
            position: absolute;
            left: 1.5rem;
            top: 3rem;
            bottom: 3rem;
            width: 1px;
            background-color: var(--color-accent);
            opacity: 0.4;
            display: none;
            transition: background-color 0.2s ease;
        }

        .editor-content h3 {
            font-size: 1.8rem;
            font-weight: 700;
            letter-spacing: -0.03em;
            line-height: 1.25;
            margin-bottom: 1.75rem;
            outline: none;
        }

        .editor-body {
            font-size: 0.9rem;
            line-height: 1.65;
            color: var(--text-main);
            outline: none;
        }

        .editor-body p {
            margin-bottom: 1.25rem;
        }

        .editor-body h2 {
            font-size: 1.15rem;
            font-weight: 600;
            margin-top: 1.75rem;
            margin-bottom: 0.75rem;
            color: var(--text-main);
            letter-spacing: -0.01em;
        }

        .editor-body a {
            color: var(--color-accent);
            text-decoration: underline;
            text-underline-offset: 3px;
            transition: color 0.2s ease;
        }

        /* BLOCO DE MONETIZAÇÃO TRANSPARENTE E CONTEXTUALIZADO */
        .partnership-callout {
            border: 1px solid var(--border-muted);
            padding: 1.25rem;
            margin: 1.5rem 0;
            border-radius: 4px;
            background-color: rgba(0, 0, 0, 0.02);
            transition: border-color 0.2s ease, background-color 0.2s ease;
        }

        html.theme-dark .partnership-callout {
            background-color: rgba(255, 255, 255, 0.02);
        }

        .partnership-callout .callout-title {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--color-accent);
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .partnership-callout .callout-text {
            font-size: 0.8rem;
            line-height: 1.5;
            color: var(--text-muted);
            margin: 0;
        }

        .partnership-callout .callout-text a {
            color: var(--color-accent);
            font-weight: 600;
            text-decoration: underline;
        }

        /* CONTAINER DE RESUMO EXECUTIVO (BLUF) PARA SEO/SGE */
        .bluf-container {
            border-left: 3px solid var(--color-accent);
            padding-left: 1rem;
            margin: 1.5rem 0;
            font-style: italic;
            color: var(--text-muted);
            font-size: 0.95rem;
            line-height: 1.6;
        }

        /* COLUNA LATERAL DE METADADOS */
        .editor-sidebar {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .sidebar-panel {
            border: 1px solid var(--border-muted);
            border-radius: 4px;
            background-color: var(--bg-card);
            padding: 1.25rem;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .sidebar-panel h4 {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            margin-bottom: 1rem;
            font-weight: 600;
        }

        .seo-metric {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            margin-bottom: 0.5rem;
        }

        .seo-score-text {
            font-size: 2.25rem;
            font-weight: 700;
            color: var(--text-main);
            letter-spacing: -0.03em;
        }

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

        .seo-label-tag {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--color-accent);
            background-color: var(--color-accent-dim);
            padding: 0.15rem 0.4rem;
            border-radius: 2px;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .seo-details-list {
            list-style: none;
            font-size: 0.75rem;
            color: var(--text-muted);
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin-top: 0.75rem;
            border-top: 1px solid var(--border-muted);
            padding-top: 0.75rem;
        }

        .seo-criterion-row {
            margin-bottom: 0.85rem;
            font-size: 0.75rem;
        }

        .criterion-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.35rem;
            color: var(--text-main);
            font-weight: 500;
        }

        .criterion-score {
            color: var(--text-muted);
            font-weight: 600;
            font-family: monospace;
        }

        .led-bar {
            display: flex;
            gap: 4px;
        }

        .led {
            flex: 1;
            height: 6px;
            background-color: var(--border-muted);
            border-radius: 1px;
            transition: background-color 0.2s ease, box-shadow 0.2s ease;
        }

        html.theme-light .led {
            background-color: #e4e4e7;
        }

        /* Faixa de avaliação dos LEDs entre vermelho (reprovado) e verde (aprovado) */
        .led.active:nth-child(1) {
            background-color: var(--color-red) !important;
            box-shadow: 0 0 5px var(--color-red);
        }
        .led.active:nth-child(2) {
            background-color: #f97316 !important; /* Laranja */
            box-shadow: 0 0 5px #f97316;
        }
        .led.active:nth-child(3) {
            background-color: #f59e0b !important; /* Amarelo */
            box-shadow: 0 0 5px #f59e0b;
        }
        .led.active:nth-child(4) {
            background-color: #84cc16 !important; /* Verde-claro */
            box-shadow: 0 0 5px #84cc16;
        }
        .led.active:nth-child(5) {
            background-color: var(--color-accent) !important; /* Verde-destaque */
            box-shadow: 0 0 5px var(--color-accent);
        }

        .copy-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .copy-group:last-child {
            margin-bottom: 0;
        }

        .copy-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            font-weight: 600;
            display: flex;
            justify-content: space-between;
        }

        .copy-link {
            color: var(--color-accent);
            text-decoration: none;
            font-size: 0.65rem;
            transition: color 0.2s ease;
        }

        .copy-link:hover {
            text-decoration: underline;
        }

        .copy-textarea {
            width: 100%;
            background-color: rgba(0, 0, 0, 0.02);
            border: 1px solid var(--border-muted);
            border-radius: 2px;
            color: var(--text-main);
            padding: 0.6rem;
            font-size: 0.75rem;
            line-height: 1.5;
            resize: none;
            outline: none;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        html.theme-dark .copy-textarea {
            background-color: rgba(0, 0, 0, 0.2);
        }

        .copy-textarea:focus {
            border-color: var(--color-accent);
        }

        .sidebar-actions {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin-top: auto;
        }

        .sidebar-actions .btn {
            width: 100%;
            padding: 0.75rem;
            font-size: 0.75rem;
        }

        /* SEÇÃO 3: LINKS DE AFILIADOS */
        .afiliados-panel {
            border: 1px solid var(--border-muted);
            border-radius: 4px;
            background-color: var(--bg-card);
            max-width: 800px;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .afiliados-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-muted);
        }

        .afiliados-header h3 {
            font-size: 1rem;
            font-weight: 600;
        }

        .afiliados-header p {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }

        .afiliados-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
        }

        .afiliados-table th, .afiliados-table td {
            padding: 1rem 1.5rem;
            text-align: left;
            border-bottom: 1px solid var(--border-muted);
        }

        .afiliados-table th {
            color: var(--text-muted);
            font-weight: 500;
            text-transform: uppercase;
            font-size: 0.7rem;
            letter-spacing: 0.05em;
        }

        .afiliados-table td input {
            background-color: rgba(0, 0, 0, 0.02);
            border: 1px solid var(--border-muted);
            border-radius: 2px;
            color: var(--text-main);
            padding: 0.35rem 0.5rem;
            width: 100%;
            outline: none;
            font-size: 0.75rem;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        html.theme-dark .afiliados-table td input {
            background-color: rgba(0, 0, 0, 0.2);
        }

        .afiliados-table td input:focus {
            border-color: var(--color-accent);
        }

        .afiliados-footer {
            padding: 1.5rem;
        }

        /* SEÇÃO 4: CONFIGURAÇÕES */
        .config-panel {
            border: 1px solid var(--border-muted);
            border-radius: 4px;
            background-color: var(--bg-card);
            max-width: 600px;
            padding: 1.75rem;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .config-panel h3 {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }

        .config-panel p {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 1.5rem;
        }

        .form-group {
            margin-bottom: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }

        .form-group label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            font-weight: 600;
        }

        .form-group input {
            background-color: rgba(0, 0, 0, 0.02);
            border: 1px solid var(--border-muted);
            border-radius: 2px;
            color: var(--text-main);
            padding: 0.6rem;
            font-family: monospace;
            font-size: 0.8rem;
            outline: none;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        html.theme-dark .form-group input {
            background-color: rgba(0, 0, 0, 0.2);
        }

        .form-group input:focus {
            border-color: var(--color-accent);
        }

        /* TOAST DE NOTIFICAÇÃO MINIMALISTA */
        .toast {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            background-color: var(--bg-card);
            border: 1px solid var(--color-accent);
            color: var(--text-main);
            padding: 0.85rem 1.25rem;
            font-size: 0.8rem;
            font-weight: 500;
            border-radius: 3px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            transform: translateY(150%);
            opacity: 0;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
            z-index: 9999;
        }

        html.theme-dark .toast {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
        }

        .toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        /* ANIMAÇÃO DE LOADER */
        .loader-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 6rem 0;
        }

        .loader-bar {
            width: 120px;
            height: 1px;
            background-color: var(--border-muted);
            position: relative;
            overflow: hidden;
            margin-bottom: 1.5rem;
        }

        .loader-progress {
            width: 40%;
            height: 100%;
            background-color: var(--color-accent);
            position: absolute;
            left: 0;
            top: 0;
            animation: loading 1.5s infinite ease-in-out;
        }

        @keyframes loading {
            0% { left: -40%; }
            100% { left: 100%; }
        }

        /* =========================================
           WIDGET DE CHAT (ONBOARDING AGENT)
           ========================================= */
        .chat-widget {
            position: fixed;
            bottom: 2rem;
            right: 2.5rem;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            font-family: 'Libre Franklin', sans-serif;
            pointer-events: none; /* Evita bloquear cliques na tela */
        }

        .chat-toggle-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: var(--color-accent);
            color: var(--bg-dark);
            border: none;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            pointer-events: auto; /* Permite o clique apenas no botão flutuante */
        }

        .chat-toggle-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        }

        html.theme-light .chat-toggle-btn {
            color: #ffffff;
        }

        .chat-toggle-btn .material-icons {
            font-size: 1.8rem;
        }

        .chat-window {
            width: 360px;
            height: 500px;
            max-height: calc(100vh - 120px);
            background-color: var(--bg-card);
            border: 1px solid var(--border-muted);
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
            display: flex;
            flex-direction: column;
            margin-bottom: 1rem;
            overflow: hidden;
            opacity: 0;
            pointer-events: none;
            transform: translateY(20px);
            transition: opacity 0.3s ease, transform 0.3s ease;
            transform-origin: bottom right;
        }

        .chat-widget.open .chat-window {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        .chat-header {
            padding: 1.2rem;
            background-color: rgba(0,0,0,0.02);
            border-bottom: 1px solid var(--border-muted);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        html.theme-dark .chat-header {
            background-color: rgba(255,255,255,0.02);
        }

        .chat-close-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
        }

        .chat-close-btn:hover {
            color: var(--text-main);
        }

        .chat-messages {
            flex: 1;
            padding: 1.2rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            font-size: 0.85rem;
            line-height: 1.5;
        }

        .chat-message {
            max-width: 85%;
            padding: 0.8rem 1rem;
            border-radius: 8px;
            word-wrap: break-word;
        }

        .message-ai {
            align-self: flex-start;
            background-color: var(--bg-dark);
            border: 1px solid var(--border-muted);
            color: var(--text-main);
            border-bottom-left-radius: 0;
        }

        .message-user {
            align-self: flex-end;
            background-color: var(--color-accent-dim);
            border: 1px solid rgba(0, 255, 136, 0.2);
            color: var(--text-main);
            border-bottom-right-radius: 0;
        }

        html.theme-light .message-user {
            border-color: rgba(5, 150, 105, 0.2);
        }

        .chat-input-area {
            padding: 1rem;
            border-top: 1px solid var(--border-muted);
            display: flex;
            gap: 0.5rem;
            background-color: var(--bg-card);
        }

        .chat-input-area input {
            flex: 1;
            background-color: var(--bg-dark);
            border: 1px solid var(--border-muted);
            color: var(--text-main);
            padding: 0.6rem 1rem;
            border-radius: 20px;
            font-size: 0.85rem;
            outline: none;
            transition: border-color 0.2s ease;
        }

        .chat-input-area input:focus {
            border-color: var(--color-accent);
        }

        .chat-send-btn {
            background-color: var(--color-accent);
            color: var(--bg-dark);
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        html.theme-light .chat-send-btn {
            color: #ffffff;
        }

        .chat-send-btn:hover {
            transform: scale(1.05);
        }

        .chat-send-btn .material-icons {
            font-size: 1.1rem;
            margin-left: 2px;
        }

        .loading .dot {
            display: inline-block;
            width: 4px;
            height: 4px;
            background-color: var(--text-muted);
            border-radius: 50%;
            margin: 0 2px;
            animation: bounce 1.4s infinite ease-in-out both;
        }

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

        @keyframes bounce {
            0%, 80%, 100% { transform: scale(0); }
        }

        /* =========================================
           NOVO LAYOUT: SPLIT SCREEN (DESIGN & IDENTIDADE)
           ========================================= */
        .split-screen-container {
            display: grid;
            grid-template-columns: 420px 1fr;
            gap: 2.5rem;
            min-height: calc(100vh - 200px);
            align-items: start;
        }

        @media (max-width: 1024px) {
            .split-screen-container {
                grid-template-columns: 1fr;
            }
        }

        .split-column-left {
            display: flex;
            flex-direction: column;
            gap: 2rem;
            height: calc(100vh - 120px);
            overflow-y: auto;
            padding-right: 1rem;
            padding-bottom: 2rem;
        }

        .split-column-right {
            position: sticky;
            top: 2rem;
            display: flex;
            flex-direction: column;
            height: calc(100vh - 150px);
            border-radius: 12px;
            overflow: hidden;
            border: 2px solid var(--border-muted);
            background: var(--bg-card);
        }

        /* Adaptar o chat para ser estático dentro do Grid quando necessário */
        .chat-widget.static-mode {
            position: relative;
            bottom: auto;
            right: auto;
            z-index: 10;
            width: 100%;
            height: auto;
        }

        .chat-widget.static-mode .chat-window {
            display: flex !important;
            opacity: 1 !important;
            transform: none !important;
            pointer-events: auto !important;
            position: relative;
            bottom: auto;
            right: auto;
            height: 400px;
            max-height: 60vh;
            width: 100%;
            box-shadow: none;
            border: 1px solid var(--border-muted);
            border-radius: 8px;
        }

        .chat-widget.static-mode .chat-toggle {
            display: none !important; /* Esconde o botão flutuante no modo estático */
        }
        
        .chat-widget.static-mode .chat-header {
            border-radius: 8px 8px 0 0;
            cursor: default;
        }
        
        .chat-widget.static-mode .chat-header .chat-close {
            display: none;
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* ===================================================================
           PREVIEW DE ARTIGO FIEL AO POST PUBLICADO (modal de revisão)
           As cores/fonte vêm do tema da persona via vars inline (--art-*).
           O espaçamento entre títulos e parágrafos é garantido por CSS aqui,
           não por estilo inline parágrafo a parágrafo.
           =================================================================== */
        .article-preview {
            --art-bg: #ffffff;
            --art-text: #2d2d2d;
            --art-heading: #111111;
            --art-accent: #10b981;
            --art-muted: #6b7280;
            --art-border: #e4e4e7;
            background: var(--art-bg);
            color: var(--art-text);
            font-family: var(--art-font, 'Inter'), -apple-system, BlinkMacSystemFont, sans-serif;
            font-size: 1.05rem;
            line-height: 1.7;
        }
        .article-preview h1 {
            font-size: 2.1rem; line-height: 1.2; font-weight: 800;
            color: var(--art-heading); margin: 0 0 1.25rem; letter-spacing: -0.02em;
        }
        .article-preview h2 {
            font-size: 1.5rem; line-height: 1.3; font-weight: 700;
            color: var(--art-heading); margin: 2.25rem 0 0.9rem; letter-spacing: -0.01em;
        }
        .article-preview h3 {
            font-size: 1.2rem; line-height: 1.35; font-weight: 700;
            color: var(--art-heading); margin: 1.75rem 0 0.7rem;
        }
        .article-preview p { margin: 0 0 1.25rem; }
        .article-preview ul, .article-preview ol { margin: 0 0 1.25rem 1.5rem; padding-left: 0.5rem; }
        .article-preview li { margin-bottom: 0.5rem; }
        .article-preview a {
            color: var(--art-accent); text-decoration: underline; text-underline-offset: 2px;
        }
        .article-preview strong { color: var(--art-heading); font-weight: 700; }
        .article-preview img { max-width: 100%; height: auto; border-radius: 6px; margin: 1.5rem 0; }
        .article-preview blockquote {
            border-left: 3px solid var(--art-accent); margin: 1.5rem 0;
            padding: 0.25rem 0 0.25rem 1.25rem; color: var(--art-muted); font-style: italic;
        }
        .article-preview .bluf-container {
            border-left: 4px solid var(--art-accent);
            background: var(--art-accent-dim, rgba(16, 185, 129, 0.08));
            padding: 1rem 1.25rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0;
            font-size: 1.05rem; font-style: normal; color: var(--art-text);
        }
        .article-preview .recommended-reads {
            border-top: 1px solid var(--art-border); margin-top: 2.5rem; padding-top: 1.25rem;
        }
        .article-preview .partnership-callout {
            border: 1px solid var(--art-border); padding: 1.25rem; margin: 1.5rem 0;
            border-radius: 8px; background: rgba(0, 0, 0, 0.03);
        }
        .article-preview .image-credit { font-size: 0.8rem; color: var(--art-muted); margin-top: 0.5rem; }


        /* ================================================================
           EDIÇÃO 1930 — COMPONENTES DA REDAÇÃO
           ================================================================ */

        /* Grain de papel sobre tudo (textura de impressão, sutilíssima) */
        body::after {
            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 9999;
            opacity: 0.035;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
        }

        /* Manchetes: Fraunces em todos os títulos (h4 = manchete de pauta no kanban) */
        h1, h2, h3, h4 {
            font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
            font-weight: 600;
            letter-spacing: 0.005em;
        }

        /* Masthead: o cabeçalho principal ganha o filete duplo de jornal */
        .main-header {
            border-bottom: 4px double var(--border-muted);
        }
        .main-header h2 {
            font-weight: 700;
            font-size: 1.45rem;
        }
        .main-header p {
            font-family: 'Fraunces', Georgia, serif;
            font-style: italic;   /* a "linha fina" sob a manchete */
            font-size: 0.85rem;
        }
        .ceo-label {
            font-family: 'IBM Plex Mono', monospace;
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.12em;
        }

        /* Sidebar como sumário de edição: seções numeradas a chumbo */
        .sidebar .brand span {
            border-top: 3px double var(--border-muted);
            padding-top: 0.5rem;
            margin-top: 0.5rem;
            letter-spacing: 0.14em;
        }
        .nav-list { counter-reset: secao; }
        .nav-item a {
            text-transform: uppercase;
            font-size: 0.72rem;
            letter-spacing: 0.09em;
            font-weight: 600;
            border-radius: 2px;
            border-left: 2px solid transparent;
        }
        .nav-item a::before {
            counter-increment: secao;
            content: counter(secao, decimal-leading-zero);
            font-family: 'IBM Plex Mono', monospace;
            font-size: 0.68rem;
            color: var(--text-muted);
            margin-right: 0.65rem;
            font-weight: 400;
        }
        .nav-item a { justify-content: flex-start; }
        .nav-item a .badge { margin-left: auto; }
        .nav-item.active a {
            border-left: 2px solid var(--color-accent);
            border-radius: 0 2px 2px 0;
        }
        .nav-item.active a::before { color: var(--color-accent); }

        /* Botões: tipos de metal — cantos de chumbo, versal espaçada */
        .btn {
            border-radius: 2px !important;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        /* Botão de destaque: placa de LATÃO sólida com texto de tinta (não outline) */
        .btn.btn-accent {
            background-color: var(--color-accent);
            border-color: var(--color-accent);
            color: #1C1710;
        }
        html.theme-light .btn.btn-accent { color: #FAF5E9; }
        .btn.btn-accent:hover {
            background-color: var(--text-main);
            border-color: var(--text-main);
            color: var(--bg-card);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
        }

        /* Dados em máquina de escrever (KPIs, contadores, timestamps) */
        [id^="kpi-"], .badge, .status-text {
            font-family: 'IBM Plex Mono', monospace;
            font-variant-numeric: tabular-nums;
        }

        /* O ponto de status vira o quadradinho de latão do linotipo */
        .status-dot {
            border-radius: 1px;
            box-shadow: none;
        }

        /* Cartões de seção: papel com fio de impressão */
        .content-section h3 {
            letter-spacing: 0.01em;
        }
        .material-icons.card-glyph {
            font-size: 1.05rem;
            vertical-align: text-bottom;
            color: var(--color-accent);
            margin-right: 0.15rem;
        }

        /* Barra de rolagem discreta (tinta sobre papel) */
        ::-webkit-scrollbar { width: 10px; height: 10px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb {
            background: var(--border-muted);
            border-radius: 0;
            border: 2px solid var(--bg-dark);
        }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

        /* Seleção de texto: marca de lápis do editor */
        ::selection { background: var(--color-accent-dim); color: var(--text-main); }


        /* ============ REFINAMENTO — A ELEGÂNCIA DA ÉPOCA ============ */
        /* Elegância anos 30 = sobriedade: mais respiro, menos ruído, acento contido. */

        .main-header { padding: 2.1rem 2.75rem 1.6rem; }
        .main-header h2 { font-size: 1.5rem; line-height: 1.15; }
        .main-header p { margin-top: 0.35rem; letter-spacing: 0.01em; }

        .sidebar { padding: 2.25rem 1.6rem; }
        .brand { margin-bottom: 3.25rem; }
        .nav-list { gap: 0.5rem; }
        .nav-item a { transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease; }

        /* Botões: aprumo de alfaiataria — peso médio, respiro, transição macia */
        .btn {
            font-weight: 600;
            transition: background-color 0.18s ease, color 0.18s ease,
                        border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
        }
        .btn:hover { transform: translateY(-1px); }
        .btn:active { transform: translateY(0); }

        /* Cartões do kanban: papel que se ergue de leve sob a mão */
        .kanban-card {
            transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
        }
        .kanban-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
            border-color: var(--text-muted) !important;
        }
        .kanban-card h4 { line-height: 1.3; font-weight: 600; }

        /* Campos de formulário: foco com anel discreto de latão */
        input:focus, select:focus, textarea:focus {
            border-color: var(--color-accent) !important;
            box-shadow: 0 0 0 3px var(--color-accent-dim);
            outline: none;
        }
        input, select, textarea { transition: border-color 0.18s ease, box-shadow 0.18s ease; }

        /* Títulos de card: versalete espaçado sob o glifo de latão */
        .content-section h3 {
            font-size: 1.02rem;
            font-weight: 600;
        }

        /* Ligaduras e refinamento tipográfico geral */
        body { font-variant-ligatures: common-ligatures; text-rendering: optimizeLegibility; }
        h1, h2, h3, h4 { font-variant-ligatures: common-ligatures; }

        /* Tabelas/listas respiram */
        .content-section p { line-height: 1.55; }


        /* ============ A MARCA — monograma déco no lugar do logo raster ============ */
        .brand-lockup {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            color: var(--text-main);
        }
        .brand-mark { width: 36px; height: 36px; flex-shrink: 0; }
        .brand-name {
            font-family: 'Fraunces', Georgia, serif;
            font-weight: 900;
            font-size: 1.45rem;
            letter-spacing: 0.02em;
            line-height: 1;
            color: var(--text-main);
        }
