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

        :root {
            /* CSBC blues — mantidos */
            --blue-900: #0a1240;
            --blue-700: #1530a0;
            --blue-600: #1e3fc2;
            --blue-500: #3d5fe8;
            --blue-400: #5b7fff;
            --blue-100: #e8edff;
            --blue-50:  #f0f4ff;

            --gray-900: #111827;
            --gray-700: #374151;
            --gray-600: #4b5563;
            --gray-500: #6b7280;
            --gray-400: #9ca3af;
            --gray-300: #d1d5db;
            --gray-200: #e5e7eb;
            --gray-100: #f3f4f6;
            --gray-50:  #f7f8fa;
            --white:    #ffffff;

            --t:  0.15s cubic-bezier(0.4,0,0.2,1);
            --ts: 0.22s cubic-bezier(0.34,1.56,0.64,1);

            /* bubble de bot igual à ref: cinza muito claro */
            --bot-bubble-bg: #f2f3f5;
            --bot-bubble-color: #111827;
        }

        html, body { height: 100%; }

        body {
            font-family: 'Inter', system-ui, sans-serif;
            background: #f0f2f5;
            color: var(--gray-900);
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
        }

        /* ── HEADER ── */
        .site-header {
            background: var(--white);
            border-bottom: 1px solid var(--gray-200);
            position: sticky; top: 0; z-index: 100;
            height: 58px;
            display: flex; align-items: center;
            padding: 0 24px;
        }
        .header-inner {
            width: 100%; max-width: 1200px; margin: 0 auto;
            display: flex; align-items: center; justify-content: space-between;
        }
        .header-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
        .header-logo-pill {
            width: 32px; height: 32px; border-radius: 8px;
            background: linear-gradient(135deg, var(--blue-700), var(--blue-400));
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .header-logo-pill svg { width: 16px; height: 16px; color: #fff; }
        .header-title-group { display: flex; flex-direction: column; }
        .header-title {
            font-size: 0.875rem; font-weight: 600; color: var(--gray-900);
            letter-spacing: -0.01em; line-height: 1.2;
        }
        .header-subtitle {
            font-size: 0.625rem; font-weight: 400;
            color: var(--gray-400);
        }
        .header-status {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.70rem; font-weight: 400; color: var(--gray-400);
        }
        .status-dot {
            width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
            animation: pulse-dot 2.5s ease-in-out infinite;
        }
        .status-dot.offline    { background: #ef4444; animation: none; }
        .status-dot.connecting { background: #f59e0b; animation: pulse-dot 1s infinite; }
        @keyframes pulse-dot {
            0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); }
            60%     { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
        }

        /* ── LAYOUT ── */
        .page-layout {
            max-width: 780px; margin: 0 auto;
            padding: 20px 16px 32px;
        }

        /* ── CHAT CARD ── */
        .chat-card {
            background: var(--white);
            border-radius: 18px;
            border: 1px solid var(--gray-200);
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            overflow: hidden;
            display: flex; flex-direction: column;
            height: min(86vh, 820px);
        }

        /* Chat header — clean flat, apenas a info do contato como na ref */
        .chat-header {
            background: var(--white);
            border-bottom: 1px solid var(--gray-200);
            padding: 12px 18px;
            flex-shrink: 0;
        }
        .chat-header-inner {
            display: flex; align-items: center; gap: 12px;
        }
        .bot-avatar {
            width: 40px; height: 40px; border-radius: 50%;
            background: linear-gradient(135deg, var(--blue-700), var(--blue-400));
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .bot-avatar svg { width: 18px; height: 18px; color: #fff; }
        .chat-header-info { flex: 1; min-width: 0; }
        .chat-header-name {
            font-size: 0.9rem; font-weight: 600; color: var(--gray-900);
            letter-spacing: -0.01em; line-height: 1.25;
        }
        .chat-header-desc {
            font-size: 0.68rem; color: #22c55e;
            font-weight: 500; margin-top: 1px;
        }
        /* actions no header — ícones leves como na ref */
        .chat-header-actions {
            display: flex; align-items: center; gap: 6px;
        }
        .chat-header-actions svg {
            width: 18px; height: 18px; color: var(--gray-400);
            cursor: pointer; transition: color var(--t);
        }
        .chat-header-actions svg:hover { color: var(--blue-500); }
        /* removido badge uid do header */
        .chat-uid-badge { display: none; }

        /* Botões de ícone do header (favoritos / tela cheia) */
        .header-icon-btn {
            width: 32px; height: 32px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            background: none; border: none; padding: 0; cursor: pointer;
            color: var(--gray-400); transition: background var(--t), color var(--t);
            flex-shrink: 0; -webkit-tap-highlight-color: transparent;
        }
        .header-icon-btn svg { width: 18px; height: 18px; pointer-events: none; }
        .header-icon-btn:hover { background: var(--gray-100); color: var(--blue-500); }
        .header-icon-btn:active { background: var(--blue-50); }
        .header-icon-btn.is-active { color: var(--blue-600); }

        /* Botão de tela cheia: troca o ícone de "expandir" pelo "X" quando ativo */
        #fullscreen-btn .icon-fs-exit { display: none; }
        #fullscreen-btn.is-active .icon-fs-expand { display: none; }
        #fullscreen-btn.is-active .icon-fs-exit  { display: block; }

        /* Botão de favoritos: estrela preenchida quando o item está marcado (uso futuro) */
        #favorites-btn.is-active svg { fill: #fbbf24; stroke: #f59e0b; color: #f59e0b; }

        /* ── MESSAGES ── */
        .messages-area {
            flex: 1; overflow-y: auto;
            padding: 18px 18px 10px;
            display: flex; flex-direction: column; gap: 2px;
            scroll-behavior: smooth;
            background: var(--white);
        }
        .messages-area::-webkit-scrollbar { width: 0; }

        .msg-row { display: flex; align-items: flex-end; gap: 8px; }
        .msg-row.bot  { justify-content: flex-start; }
        .msg-row.user { justify-content: flex-end; }

        .msg-row + .msg-row { margin-top: 2px; }
        .msg-row.bot  + .msg-row.user,
        .msg-row.user + .msg-row.bot { margin-top: 14px; }

        /* ── Avatar: apenas o robô tem avatar, usuário não ── */
        .msg-avatar {
            width: 30px; height: 30px; border-radius: 50%;
            flex-shrink: 0; font-size: 0.70rem; font-weight: 600;
            display: flex; align-items: center; justify-content: center;
        }
        .msg-avatar.bot-av {
            background: linear-gradient(135deg, var(--blue-700), var(--blue-400));
            color: #fff;
        }
        /* Avatar do usuário: nunca exibido */
        .msg-avatar.user-av { display: none; }
        .msg-row.hide-av .msg-avatar { visibility: hidden; }

        .bubble-wrap { max-width: 72%; display: flex; flex-direction: column; gap: 2px; }
        .msg-row.user .bubble-wrap { align-items: flex-end; max-width: 78%; }
        .msg-row.bot  .bubble-wrap { align-items: flex-start; }

        /* Linha do usuário: sem avatar, sem gap sobrando */
        .msg-row.user { gap: 0; }

        .bubble {
            padding: 10px 15px;
            border-radius: 18px;
            font-size: 0.875rem; line-height: 1.58;
            word-break: break-word;
            animation: bubbleIn var(--ts) both;
            max-width: 100%;
        }
        @keyframes bubbleIn {
            from { opacity:0; transform: translateY(5px) scale(0.97); }
            to   { opacity:1; transform: none; }
        }
        .bubble.bot-bubble {
            background: var(--bot-bubble-bg);
            color: var(--bot-bubble-color);
            border-bottom-left-radius: 6px;
        }
        .bubble.user-bubble {
            background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
            color: #fff;
            border-bottom-right-radius: 6px;
        }

        .msg-meta {
            font-size: 0.585rem; color: var(--gray-400); font-weight: 400;
            display: flex; align-items: center; gap: 3px;
            padding: 0 3px; margin-top: 2px;
        }
        .msg-row.user .msg-meta { flex-direction: row-reverse; }

        /* ── Status de entrega da mensagem (fila de envio) ──
           queued    = na fila, aguardando envio (relógio)
           sending   = enviando agora (relógio piscando)
           sent      = entregue ao servidor (✓)
           local     = sem servidor, resposta local apenas (○)
           failed    = falhou — toque para tentar novamente (!) */
        .msg-status-icon {
            font-size: 0.66rem; line-height: 1;
            color: var(--gray-400);
            display: inline-flex; align-items: center; justify-content: center;
            min-width: 11px;
        }
        .msg-status-icon.status-queued,
        .msg-status-icon.status-sending {
            animation: statusPulse 1.1s ease-in-out infinite;
            color: var(--gray-400);
        }
        @keyframes statusPulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }
        .msg-status-icon.status-sent      { color: var(--blue-400); }
        .msg-status-icon.status-delivered { color: var(--blue-400); }
        .msg-status-icon.status-local     { color: var(--gray-300); }
        .msg-status-icon.status-failed {
            color: #ef4444; font-weight: 700; cursor: pointer;
            text-decoration: underline; text-decoration-style: dotted;
        }
        .msg-status-icon.status-failed:hover { color: #b91c1c; }

        /* typing */
        .typing-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 14px; }
        .typing-bubble {
            background: var(--bot-bubble-bg);
            border-radius: 18px; border-bottom-left-radius: 6px;
            padding: 11px 15px; display: flex; align-items: center; gap: 4px;
        }
        .typing-dot {
            width: 5px; height: 5px; border-radius: 50%; background: var(--gray-400);
        }
        .typing-dot:nth-child(1) { animation: td 1.4s 0s infinite; }
        .typing-dot:nth-child(2) { animation: td 1.4s .15s infinite; }
        .typing-dot:nth-child(3) { animation: td 1.4s .30s infinite; }
        @keyframes td {
            0%,100% { transform: translateY(0); opacity:.35; }
            50%      { transform: translateY(-4px); opacity:1; }
        }

        /* date sep — mais suave, sem borda */
        .date-sep { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; }
        .date-sep-line { flex:1; height:1px; background: var(--gray-100); }
        .date-sep-label {
            font-size: 0.60rem; font-weight: 500; color: var(--gray-400);
            background: transparent; padding: 0 8px;
            letter-spacing: 0.02em;
        }

        /* ── INPUT — igual à referência: flat, borda sutil ── */
        .input-area {
            padding: 10px 14px 12px;
            border-top: 1px solid var(--gray-100);
            background: var(--white);
            flex-shrink: 0;
        }
        .input-row {
            display: flex; align-items: flex-end; gap: 10px;
            background: var(--gray-50);
            border: 1px solid var(--gray-200);
            border-radius: 24px;
            padding: 7px 8px 7px 16px;
            transition: border-color var(--t);
        }
        .input-row:focus-within {
            border-color: var(--blue-300, #93b4ff);
            background: var(--white);
        }
        .input-box {
            flex: 1; background: transparent; border: none; outline: none;
            font-family: 'Inter', sans-serif;
            font-size: 0.875rem; color: var(--gray-900);
            resize: none; max-height: 120px; overflow-y: auto;
            line-height: 1.5; padding: 3px 0;
        }
        .input-box::placeholder { color: var(--gray-400); font-weight: 400; }

        /* ícones de ação dentro do input */
        .input-actions { display: flex; align-items: center; gap: 6px; }
        .input-icon-btn {
            width: 34px; height: 34px; border-radius: 50%;
            border: none; background: transparent; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background var(--t);
        }
        .input-icon-btn:hover { background: var(--gray-100); }
        .input-icon-btn svg { width: 17px; height: 17px; color: var(--gray-400); }

        .send-btn {
            width: 34px; height: 34px; border-radius: 50%;
            background: linear-gradient(135deg, var(--blue-700), var(--blue-400));
            border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; position: relative;
            transition: all var(--t), background var(--ts);
            -webkit-user-select: none; user-select: none;
            touch-action: none;
        }
        .send-btn:hover:not(:disabled) { transform: scale(1.08); }
        .send-btn:active:not(:disabled) { transform: scale(0.94); }
        .send-btn:disabled { opacity: 0.30; pointer-events: none; }
        .send-btn svg { color: #fff; width: 15px; height: 15px; }

        /* ── Botão multi-estado: enviar / microfone / parar (gravando) ──
           O JS alterna a classe no <button id="send-btn">:
             (sem classe extra)      → modo texto, mostra .icon-send
             .send-btn--mic          → idle com texto vazio, mostra .icon-mic
             .send-btn--recording    → gravando, mostra .icon-stop + pulso vermelho
           Os três ícones SVG ficam empilhados via position:absolute e a
           visibilidade é controlada por opacity/scale (evita layout shift). */
        .send-btn-icon {
            position: absolute; width: 15px; height: 15px; color: #fff;
            opacity: 0; transform: scale(0.5);
            transition: opacity var(--t), transform var(--t);
            pointer-events: none;
        }
        .send-btn .icon-send { opacity: 1; transform: scale(1); }

        .send-btn.send-btn--mic .icon-send  { opacity: 0; transform: scale(0.5); }
        .send-btn.send-btn--mic .icon-mic   { opacity: 1; transform: scale(1); width: 16px; height: 16px; }

        .send-btn.send-btn--recording {
            background: linear-gradient(135deg, #c81e3a, #ef4444);
            animation: rec-btn-pulse 1.4s ease-in-out infinite;
        }
        .send-btn.send-btn--recording .icon-send,
        .send-btn.send-btn--recording .icon-mic { opacity: 0; transform: scale(0.5); }
        .send-btn.send-btn--recording .icon-stop { opacity: 1; transform: scale(1); width: 13px; height: 13px; }

        /* Cancelamento (arrastar para a esquerda): botão "esfria" para cinza */
        .send-btn.send-btn--cancel {
            background: linear-gradient(135deg, var(--gray-500), var(--gray-400));
            animation: none;
        }

        @keyframes rec-btn-pulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
            50%      { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
        }

        /* ── Barra de gravação — substitui o input-hint enquanto grava ── */
        .audio-rec-bar {
            display: none;
            align-items: center; gap: 8px;
            padding: 6px 10px 0; margin-top: 2px;
            font-size: 0.72rem; color: var(--gray-600);
        }
        .audio-rec-bar.is-active { display: flex; }
        .audio-rec-dot {
            width: 8px; height: 8px; border-radius: 50%;
            background: #ef4444; flex-shrink: 0;
            animation: rec-dot-blink 1s step-start infinite;
        }
        @keyframes rec-dot-blink { 50% { opacity: 0.25; } }
        .audio-rec-label { font-weight: 600; color: var(--gray-700); }
        .audio-rec-time {
            font-family: 'Barlow Condensed', sans-serif;
            font-weight: 700; color: #ef4444; min-width: 34px;
        }
        .audio-rec-max { color: var(--gray-300); }
        .audio-rec-hint {
            margin-left: auto; color: var(--gray-400);
            font-size: 0.65rem; text-align: right;
        }
        .audio-rec-bar.is-cancel-zone .audio-rec-hint { color: #ef4444; font-weight: 600; }
        .audio-rec-bar.is-cancel-zone .audio-rec-label { color: #ef4444; }
        .audio-rec-bar.is-cancel-zone .audio-rec-label::after { content: ' (soltar cancela)'; }

        /* Esconde o hint padrão enquanto a barra de gravação está visível */
        .input-hint.is-hidden-by-rec { display: none; }

        @media (max-width: 480px) {
            .audio-rec-hint { display: none; }
        }

        /* ── Bolha de mensagem de áudio do usuário ── */
        .audio-bubble {
            display: flex; flex-direction: column; gap: 6px;
            min-width: 220px; max-width: 280px;
        }
        .audio-bubble-player {
            width: 100%; height: 32px;
            /* Tenta herdar a paleta do tema nos navegadores que suportam */
            accent-color: var(--blue-400);
        }
        .audio-bubble-meta {
            display: flex; align-items: center; gap: 6px;
            font-size: 0.72rem; opacity: 0.85;
        }
        .audio-bubble-icon { width: 13px; height: 13px; flex-shrink: 0; }
        .audio-bubble-dur {
            font-family: 'Barlow Condensed', sans-serif;
            font-weight: 600; flex-shrink: 0;
        }
        .audio-bubble-status {
            font-style: italic; opacity: 0.85;
            overflow: hidden; text-overflow: ellipsis;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
        }

        .input-hint {
            font-size: 0.58rem; color: var(--gray-300);
            margin-top: 5px; padding: 0 4px;
        }

        /* ── QUICK CHIPS — mais claros, pill bordas finas ── */
        .quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
        .quick-chip {
            background: var(--white);
            border: 1px solid var(--gray-200);
            border-radius: 20px; padding: 5px 13px;
            font-size: 0.72rem; font-weight: 500; color: var(--gray-700);
            cursor: pointer; transition: all var(--t); white-space: nowrap;
        }
        .quick-chip:hover {
            background: var(--blue-600);
            color: #fff; border-color: var(--blue-600);
        }

        /* sidebar removida — CSS abaixo mantido para possível reuso futuro */

        .info-row {
            display: flex; align-items: flex-start; gap: 10px;
            padding: 5px 0; border-bottom: 1px solid var(--gray-100);
        }
        .info-row:last-child { border-bottom: none; padding-bottom: 0; }
        .info-label {
            font-size: 0.62rem; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.05em;
            color: var(--gray-400); width: 72px; flex-shrink: 0; padding-top: 2px;
        }
        .info-value { font-size: 0.78rem; color: var(--gray-900); font-weight: 500; word-break: break-all; }
        .info-value.mono {
            font-family: 'SF Mono', 'Fira Code', monospace;
            font-size: 0.72rem; color: var(--blue-700);
            background: var(--blue-50); padding: 2px 6px; border-radius: 5px;
        }
        .info-value.loading { color: var(--gray-400); font-style: italic; }

        .status-badge {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 2px 8px; border-radius: 20px;
            font-size: 0.64rem; font-weight: 600;
        }
        .status-badge.normal  { background: #dcfce7; color: #15803d; }
        .status-badge.banido  { background: #fee2e2; color: #b91c1c; }
        .status-dot-sm { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

        .counter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .counter-chip {
            background: var(--gray-50); border: 1px solid var(--gray-100);
            border-radius: 10px; padding: 10px 8px;
            display: flex; flex-direction: column; align-items: center; gap: 2px;
        }
        .counter-num {
            font-size: 1.5rem; font-weight: 700; line-height: 1;
            color: var(--blue-600); letter-spacing: -0.03em;
        }
        .counter-lbl { font-size: 0.60rem; font-weight: 500; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; }

        .tags-wrap { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
        .data-tag {
            display: inline-flex; align-items: center; gap: 3px;
            background: var(--blue-50); border: 1px solid rgba(61,95,232,0.15);
            border-radius: 20px; padding: 3px 8px;
            font-size: 0.65rem; font-weight: 500; color: var(--blue-700);
        }
        .data-tag svg { width: 9px; height: 9px; }

        .queue-entry {
            display: flex; align-items: center; gap: 8px; padding: 6px 0;
            border-bottom: 1px solid var(--gray-100); animation: fadeIn .3s ease;
        }
        .queue-entry:last-child { border-bottom: none; }
        .queue-dot {
            width: 6px; height: 6px; border-radius: 50%;
            background: var(--blue-400); flex-shrink: 0;
            animation: pulse-dot 2s ease-in-out infinite;
        }
        .queue-id {
            font-family: 'SF Mono', monospace; font-size: 0.68rem;
            color: var(--gray-500); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .queue-ts { font-size: 0.60rem; color: var(--gray-400); flex-shrink: 0; }
        .queue-empty { text-align: center; padding: 12px 0; font-size: 0.74rem; color: var(--gray-400); }

        /* ── WEATHER CARD — bolha grande e centralizada, inline no chat ── */
        .weather-card-wrap, .ranking-card-wrap, .papers-card-wrap {
            width: 100%;
            display: flex;
            justify-content: flex-start; /* alinha à esquerda como o avatar do bot */
        }
        .weather-card, .ranking-widget-card, .papers-widget-card {
            background: var(--white);
            border-radius: 20px;
            width: 100%;
            max-width: 420px;
            min-width: 0;
            overflow: hidden;
            display: flex; flex-direction: column;
            border: 1px solid var(--gray-200);
            box-shadow: 0 4px 16px rgba(10,18,64,0.08);
            animation: bubbleIn var(--ts) both;
        }

        .wm-header, .rk-header, .pp-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 18px 20px 20px;
            color: #fff;
            position: relative;
            flex-shrink: 0;
            overflow: hidden;
        }
        .wm-header::after, .rk-header::after, .pp-header::after {
            content: '';
            position: absolute;
            top: -45%; right: -18%;
            width: 220px; height: 220px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none; z-index: 0;
        }
        .wm-location, .rk-location, .pp-location {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.85);
            position: relative; z-index: 1;
        }
        .wm-location svg, .rk-location svg, .pp-location svg { width: 11px; height: 11px; flex-shrink: 0; }

        .wm-main, .rk-main, .pp-main {
            display: flex; align-items: center; justify-content: space-between;
            margin-top: 12px; position: relative; z-index: 1;
        }
        .wm-temp { font-size: 3.4rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
        .wm-temp sup { font-size: 1.2rem; font-weight: 500; vertical-align: super; }
        .wm-feels { font-size: 0.70rem; color: rgba(255,255,255,0.55); margin-top: 4px; font-weight: 400; }
        .wm-right { text-align: right; }
        .wm-icon-main { font-size: 2.8rem; line-height: 1; }
        .wm-desc { font-size: 0.74rem; font-weight: 500; color: rgba(255,255,255,0.75); margin-top: 2px; }

        /* Day tabs — sem bordas, underline no active */
        .wm-daytabs {
            display: flex; gap: 3px; margin-top: 16px; position: relative; z-index: 1;
            overflow-x: auto;
        }
        .wm-daytab {
            flex: 1; min-width: 60px;
            background: transparent;
            border-radius: 8px; padding: 6px 4px;
            text-align: center; cursor: pointer;
            transition: background var(--t);
        }
        .wm-daytab:hover { background: rgba(255,255,255,0.10); }
        .wm-daytab.active { background: rgba(255,255,255,0.12); }
        .wm-daytab.active::after {
            content: ''; display: block; height: 2px; border-radius: 1px;
            background: rgba(255,255,255,0.70); margin: 3px auto 0; width: 14px;
        }
        .wm-daytab-label {
            font-size: 0.63rem; font-weight: 600; letter-spacing: 0.02em;
            color: rgba(255,255,255,0.55); text-transform: uppercase;
        }
        .wm-daytab.active .wm-daytab-label { color: rgba(255,255,255,0.90); }
        .wm-daytab-icon { font-size: 1.05rem; margin: 2px 0; }
        .wm-daytab-temps { font-size: 0.62rem; font-weight: 500; color: rgba(255,255,255,0.50); }
        .wm-daytab.active .wm-daytab-temps { color: rgba(255,255,255,0.80); }

        .wm-body, .rk-body, .pp-body {
            padding: 16px 18px 18px;
        }

        .wm-section-title {
            font-size: 0.65rem; font-weight: 600; color: var(--gray-400);
            text-transform: uppercase; letter-spacing: 0.05em;
            margin-bottom: 9px;
        }

        .wm-accordion-toggle {
            display: flex; align-items: center; justify-content: center;
            gap: 6px;
            width: 100%;
            padding: 3px 0 1px;
            margin-top: 2px;
            background: none;
            border: none; cursor: pointer;
            font-size: 0.70rem; font-weight: 500; color: var(--gray-400);
            transition: color var(--t);
        }
        .wm-accordion-toggle:hover { color: var(--gray-600); }
        .wm-accordion-chevron {
            width: 12px; height: 12px;
            transition: transform var(--t);
            flex-shrink: 0;
        }
        .wm-accordion.open .wm-accordion-chevron { transform: rotate(180deg); }
        .wm-accordion-panel {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1);
        }

        .wm-accordion-panel-inner {
            padding-top: 12px;
            margin-top: 10px;
            border-top: 1px solid var(--gray-100);
        }
        .wm-accordion-panel-inner .wm-section-title:not(:first-child) {
            margin-top: 14px;
        }

        /* Hourly strip — menos borda, active mais suave */
        .wm-hours {
            display: flex; gap: 6px; overflow-x: auto;
            padding-bottom: 2px;
        }
        .wm-hours::-webkit-scrollbar { height: 0; }
        .wm-hour {
            flex-shrink: 0; min-width: 52px;
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            padding: 9px 5px;
            border-radius: 10px;
            border: 1px solid var(--gray-100);
            background: var(--white);
            cursor: pointer;
            transition: all var(--t);
        }
        .wm-hour:hover { border-color: var(--gray-200); background: var(--gray-50); }
        .wm-hour.active {
            background: var(--blue-900);
            border-color: transparent;
        }
        .wm-hour-time { font-size: 0.62rem; font-weight: 500; color: var(--gray-400); }
        .wm-hour.active .wm-hour-time { color: rgba(255,255,255,0.60); }
        .wm-hour-icon { font-size: 1.2rem; line-height: 1; }
        .wm-hour-temp { font-size: 0.74rem; font-weight: 700; color: var(--gray-900); }
        .wm-hour.active .wm-hour-temp { color: #fff; }

        /* Stats — sem borda, fundo mais suave */
        .wm-stats {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
        }
        .wm-stat {
            background: var(--gray-50);
            border-radius: 10px; padding: 11px 8px;
            display: flex; flex-direction: column; align-items: center; gap: 3px;
            text-align: center;
        }
        .wm-stat svg { width: 14px; height: 14px; color: var(--gray-400); }
        .wm-stat-val { font-size: 0.88rem; font-weight: 700; color: var(--gray-900); }
        .wm-stat-lbl { font-size: 0.58rem; color: var(--gray-400); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }

        /* ── RANKING WIDGET ── */
        .rk-tabs {
            display: flex; gap: 4px; position: relative; z-index: 1;
            margin-top: 14px;
        }
        .rk-tab {
            flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
            background: rgba(255,255,255,0.10);
            border-radius: 8px; padding: 6px 6px; cursor: pointer;
            font-size: 0.70rem; font-weight: 600; color: rgba(255,255,255,0.60);
            transition: background var(--t), color var(--t);
        }
        .rk-tab:hover { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.85); }
        .rk-tab.active { background: rgba(255,255,255,0.18); color: #fff; }

        .rk-leader-label { font-size: 0.70rem; color: rgba(255,255,255,0.50); font-weight: 400; }
        .rk-leader-name {
            font-size: 1.45rem; font-weight: 700; line-height: 1.15; margin-top: 2px;
            font-family: 'Barlow Condensed', sans-serif; letter-spacing: -0.01em;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px;
        }
        .rk-leader-uni { font-size: 0.70rem; color: rgba(255,255,255,0.50); margin-top: 3px; font-weight: 400; }
        .rk-leader-score {
            font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
            font-size: 2rem; line-height: 1; letter-spacing: -0.02em;
        }
        .rk-leader-score sup { font-size: 0.60rem; font-weight: 600; margin-left: 2px; text-transform: uppercase; opacity: 0.55; }
        .rk-leader-medal { font-size: 2.2rem; line-height: 1; }

        .rk-podium-row {
            display: flex; gap: 4px; margin-top: 12px; position: relative; z-index: 1;
        }
        .rk-podium-pill {
            flex: 1; min-width: 0;
            background: rgba(255,255,255,0.08);
            border-radius: 10px; padding: 7px 5px;
            text-align: center;
        }
        .rk-podium-pill.is-first { background: rgba(255,255,255,0.18); }
        .rk-podium-medal { font-size: 1rem; line-height: 1; }
        .rk-podium-name {
            font-size: 0.66rem; font-weight: 600; color: rgba(255,255,255,0.75);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            margin-top: 3px;
        }
        .rk-podium-pill.is-first .rk-podium-name { color: #fff; }
        .rk-podium-score {
            font-size: 0.62rem; font-weight: 500; color: rgba(255,255,255,0.45); margin-top: 1px;
            font-family: 'Barlow Condensed', sans-serif;
        }
        .rk-podium-pill.is-first .rk-podium-score { color: rgba(255,255,255,0.70); }

        /* Ranking rows — linha separadora em vez de card por item */
        .rk-rows { display: flex; flex-direction: column; }
        .rk-row {
            display: flex; align-items: center; gap: 10px;
            padding: 9px 0;
            border-bottom: 1px solid var(--gray-100);
        }
        .rk-row:last-child { border-bottom: none; }
        .rk-row-badge {
            width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
            background: var(--gray-100); color: var(--gray-500);
            display: flex; align-items: center; justify-content: center;
            font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.78rem;
        }
        .rk-row-info { flex: 1; min-width: 0; }
        .rk-row-name {
            font-size: 0.80rem; font-weight: 600; color: var(--gray-900);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .rk-row-uni { font-size: 0.64rem; color: var(--gray-400); font-weight: 400; }
        .rk-row-score {
            font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
            font-size: 0.95rem; color: var(--gray-700); flex-shrink: 0;
        }

        .rk-row.rk-uni-row { align-items: stretch; flex-wrap: wrap; gap: 4px 10px; }
        .rk-uni-row .rk-row-info { flex: 1 1 100%; order: 1; }
        .rk-uni-row .rk-row-badge { order: 0; }
        .rk-uni-row .rk-row-score { order: 2; margin-left: auto; }
        .rk-uni-full { font-size: 0.62rem; color: var(--gray-400); font-weight: 400; margin-top: 1px; }
        .rk-uni-bar-wrap {
            order: 3; flex: 1 1 100%; height: 3px; border-radius: 2px;
            background: var(--gray-100); overflow: hidden; margin-left: 32px;
        }
        .rk-uni-bar-fill {
            height: 100%; border-radius: 2px;
            background: var(--blue-400);
        }

        /* ── PAPERS WIDGET (estilo do card de previsão) ── */
        .pp-count-lbl { font-size: 0.70rem; color: rgba(255,255,255,0.55); font-weight: 400; }
        .pp-count {
            font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
            font-size: 2.4rem; line-height: 1; letter-spacing: -0.02em; margin-top: 2px;
        }
        .pp-count sup { font-size: 0.64rem; font-weight: 600; margin-left: 4px; text-transform: uppercase; opacity: 0.55; }
        .pp-query { font-size: 0.70rem; color: rgba(255,255,255,0.50); margin-top: 4px; font-weight: 400; }
        .pp-icon-main { font-size: 2.4rem; line-height: 1; text-align: right; }

        .pp-items {
            display: flex; flex-direction: column; gap: 0;
            max-height: 300px; overflow-y: auto;
            margin-right: -4px; padding-right: 4px;
        }
        .pp-items::-webkit-scrollbar { width: 4px; }
        .pp-items::-webkit-scrollbar-track { background: transparent; }
        .pp-items::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
        .pp-item {
            border-bottom: 1px solid var(--gray-100);
            padding: 11px 0 10px;
        }
        .pp-item:last-child { border-bottom: none; padding-bottom: 0; }
        .pp-item-title {
            font-size: 0.82rem; font-weight: 600; color: var(--gray-900); line-height: 1.3;
        }
        .pp-item-authors {
            font-size: 0.68rem; color: var(--gray-400); margin-top: 3px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400;
        }
        .pp-item-topics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
        .pp-tag {
            font-size: 0.60rem; font-weight: 500; color: var(--gray-500);
            background: var(--gray-100);
            border-radius: 5px; padding: 2px 6px;
        }
        .pp-item-footer {
            display: flex; align-items: center; justify-content: space-between;
            margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--gray-100);
        }
        .pp-download-btn {
            display: flex; align-items: center; gap: 4px;
            font-size: 0.70rem; font-weight: 600; color: var(--blue-700); text-decoration: none;
            background: var(--blue-50);
            border-radius: 6px; padding: 5px 10px;
            transition: background var(--t);
        }
        .pp-download-btn:hover { background: var(--blue-100); }
        .pp-download-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
        .pp-abstract-toggle {
            display: flex; align-items: center; gap: 4px;
            background: none; border: none; cursor: pointer;
            font-size: 0.70rem; font-weight: 500; color: var(--gray-400);
            padding: 5px 2px;
            transition: color var(--t);
        }
        .pp-abstract-toggle:hover { color: var(--gray-600); }
        .pp-abstract-toggle svg {
            width: 12px; height: 12px; flex-shrink: 0;
            transition: transform var(--t);
        }
        .pp-abstract-toggle.open svg { transform: rotate(180deg); }
        .pp-abstract-panel {
            max-height: 0; overflow: hidden;
            transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1);
        }
        .pp-abstract-inner {
            font-size: 0.72rem; color: var(--gray-500); line-height: 1.55;
            padding-top: 8px; margin-top: 1px; border-top: 1px solid var(--gray-100);
        }

        /* ── CLOCK WIDGET (horário atual) ── */
        .clock-card-wrap { width: 100%; display: flex; justify-content: flex-start; }
        .clock-widget-card {
            background: var(--white);
            border-radius: 20px;
            width: 100%;
            max-width: 380px;
            min-width: 0;
            overflow: hidden;
            display: flex; flex-direction: column;
            border: 1px solid var(--gray-200);
            box-shadow: 0 4px 16px rgba(10,18,64,0.08);
            animation: bubbleIn var(--ts) both;
        }
        .ck-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 18px 20px 20px;
            color: #fff;
            position: relative;
            flex-shrink: 0;
            overflow: hidden;
        }
        .ck-header::after {
            content: '';
            position: absolute;
            top: -45%; right: -18%;
            width: 220px; height: 220px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none; z-index: 0;
        }
        .ck-location {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.85);
            position: relative; z-index: 1;
        }
        .ck-location svg { width: 11px; height: 11px; flex-shrink: 0; }
        .ck-main {
            display: flex; align-items: center; justify-content: space-between;
            margin-top: 14px; position: relative; z-index: 1;
        }
        .ck-time {
            font-size: 3rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em;
            font-variant-numeric: tabular-nums;
        }
        .ck-time span { opacity: 0.55; animation: ckBlink 1s steps(1) infinite; }
        @keyframes ckBlink { 0%,49% { opacity: 0.85; } 50%,100% { opacity: 0.25; } }
        .ck-date { font-size: 0.74rem; color: rgba(255,255,255,0.65); margin-top: 4px; font-weight: 500; text-transform: capitalize; }
        .ck-tz-badge {
            text-align: right;
        }
        .ck-tz-icon { font-size: 1.8rem; line-height: 1; }
        .ck-tz-label { font-size: 0.66rem; font-weight: 600; color: rgba(255,255,255,0.75); margin-top: 2px; }
        .ck-body { padding: 14px 18px 16px; }
        .ck-now-row {
            display: flex; align-items: center; gap: 8px;
            background: var(--gray-50); border: 1px solid var(--gray-100);
            border-radius: 10px; padding: 10px 12px;
        }
        .ck-now-pulse {
            width: 6px; height: 6px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
            animation: pulse-dot 2.5s ease-in-out infinite;
        }
        .ck-now-text { font-size: 0.78rem; font-weight: 600; color: var(--gray-700); flex: 1; }
        .ck-now-sub { font-size: 0.66rem; color: var(--gray-400); font-weight: 400; }
        .ck-next-section { margin-top: 12px; }
        .ck-next-item {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 0;
            border-bottom: 1px solid var(--gray-100);
        }
        .ck-next-item:last-child { border-bottom: none; }
        .ck-next-time {
            font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
            font-size: 0.85rem; color: var(--blue-700); flex-shrink: 0; width: 44px;
        }
        .ck-next-name { font-size: 0.76rem; color: var(--gray-700); font-weight: 500; flex: 1; min-width: 0; }
        .ck-next-loc { font-size: 0.62rem; color: var(--gray-400); font-weight: 400; margin-top: 1px; }

        /* ── AGENDA WIDGET ────────────────────────────────────── */
        .agenda-card-wrap { width: 100%; display: flex; justify-content: flex-start; }
        .agenda-widget-card {
            background: var(--white); border-radius: 20px;
            width: 100%; max-width: 460px; min-width: 0; overflow: hidden;
            display: flex; flex-direction: column;
            border: 1px solid var(--gray-200);
            box-shadow: 0 4px 16px rgba(10,18,64,0.08);
            animation: bubbleIn var(--ts) both;
        }

        /* header */
        .ag-w-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 16px 16px 14px;
            color: #fff; position: relative; flex-shrink: 0; overflow: hidden;
        }
        .ag-w-header::after {
            content: '';
            position: absolute;
            top: -45%; right: -18%;
            width: 200px; height: 200px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none; z-index: 0;
        }

        .ag-w-loc {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.85);
            position: relative; z-index: 1; margin-bottom: 12px;
        }
        .ag-w-loc svg { width: 11px; height: 11px; flex-shrink: 0; }

        /* Live indicator — linha sutil em vez de pill */
        .ag-w-live-pill {
            display: inline-flex; align-items: center; gap: 6px;
            color: #86efac; font-size: 0.65rem; font-weight: 600;
            letter-spacing: 0.06em; text-transform: uppercase;
            position: relative; z-index: 1; margin-bottom: 10px;
        }
        .ag-w-live-dot {
            width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
            animation: agwPulse 1.5s ease-in-out infinite;
        }
        @keyframes agwPulse {
            0%,100% { opacity: 1; }
            50%      { opacity: 0.45; }
        }

        /* Day tabs — mais limpos, sem bordas duplas */
        .ag-w-day-tabs {
            display: flex; gap: 3px; position: relative; z-index: 1;
        }
        .ag-w-day-tab {
            flex: 1; min-width: 0;
            background: transparent;
            border-radius: 8px; padding: 6px 4px;
            text-align: center; cursor: pointer;
            transition: background var(--t);
        }
        .ag-w-day-tab:hover { background: rgba(255,255,255,0.10); }
        .ag-w-day-tab.active { background: rgba(255,255,255,0.15); }

        .ag-w-day-num {
            font-family: 'Barlow Condensed', sans-serif;
            font-size: 1.1rem; font-weight: 700; line-height: 1;
            color: rgba(255,255,255,0.70);
        }
        .ag-w-day-tab.active .ag-w-day-num { color: #fff; }
        .ag-w-day-wd {
            font-size: 0.56rem; font-weight: 600; letter-spacing: 0.04em;
            text-transform: uppercase; color: rgba(255,255,255,0.40); margin-top: 2px;
        }
        .ag-w-day-tab.active .ag-w-day-wd { color: rgba(255,255,255,0.70); }

        /* dots de evento — só 1 dot de presença, sem row de dots */
        .ag-w-day-ev-dots { display: none; }
        .ag-w-ev-dot { display: none; }

        /* indicador de seleção — underline embaixo da tab ativa */
        .ag-w-day-tab.active::after {
            content: ''; display: block;
            height: 2px; border-radius: 1px; background: #fff;
            margin: 4px auto 0; width: 16px;
        }

        /* Body */
        .ag-w-body { padding: 12px 14px 14px; }

        .ag-w-day-info {
            display: flex; align-items: center; gap: 8px;
            margin-bottom: 10px;
        }
        .ag-w-day-full {
            font-size: 0.76rem; font-weight: 600; color: var(--gray-700);
            flex: 1; min-width: 0;
        }
        .ag-w-ev-count {
            font-size: 0.65rem; font-weight: 600; color: var(--gray-400);
            flex-shrink: 0;
        }
        .ag-w-today-tag {
            font-size: 0.62rem; font-weight: 700; color: #16a34a;
            flex-shrink: 0;
        }

        /* Timeline — vertical line mais discreta */
        .ag-w-timeline {
            display: flex; flex-direction: column; gap: 0; position: relative;
        }
        .ag-w-timeline::before {
            content: ''; position: absolute;
            left: 30px; top: 8px; bottom: 8px; width: 1px;
            background: var(--gray-100);
            pointer-events: none;
        }
        .ag-w-event-row { display: flex; gap: 0; padding: 3px 0; }

        .ag-w-time-col {
            width: 30px; flex-shrink: 0;
            display: flex; flex-direction: column;
            align-items: flex-end; padding-right: 8px; padding-top: 10px; gap: 1px;
        }
        .ag-w-t-start {
            font-size: 0.66rem; font-weight: 600; color: var(--gray-400); line-height: 1;
        }
        /* horário de fim removido — ruído desnecessário */
        .ag-w-t-end { display: none; }

        .ag-w-node-col {
            width: 13px; flex-shrink: 0;
            display: flex; flex-direction: column; align-items: center; padding-top: 12px;
        }
        .ag-w-node {
            width: 8px; height: 8px; border-radius: 50%;
            background: var(--gray-200);
            position: relative; z-index: 2; flex-shrink: 0; transition: all var(--t);
        }
        .ag-w-node.s-ocorrendo {
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
            animation: agwNodeGlow 2s ease-in-out infinite;
        }
        @keyframes agwNodeGlow {
            0%,100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.20); }
            50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0.06); }
        }
        .ag-w-node.s-finalizado { background: var(--gray-200); }
        .ag-w-node.s-programado { background: var(--blue-300, #93b4ff); }

        .ag-w-card-col { flex: 1; min-width: 0; padding-left: 8px; }

        /* Event card — sem sombra individual, borda leve */
        .ag-w-event-card {
            border-radius: 10px; border: 1px solid var(--gray-100);
            background: var(--white); overflow: hidden; cursor: pointer;
            transition: border-color var(--t), background var(--t);
            margin-bottom: 3px;
        }
        .ag-w-event-card:hover { border-color: var(--gray-200); background: var(--gray-50); }
        .ag-w-event-card.s-ocorrendo { border-color: rgba(34,197,94,0.20); }
        .ag-w-event-card.s-finalizado { opacity: 0.60; }
        .ag-w-event-card.is-expanded { border-color: var(--gray-200); }

        /* stripe lateral removida — substituída pelo nó colorido na timeline */
        .ag-w-card-stripe { display: none; }

        .ag-w-card-inner { padding: 8px 10px 8px 10px; }
        .ag-w-card-top { display: flex; align-items: center; gap: 6px; }
        .ag-w-card-info { flex: 1; min-width: 0; }
        .ag-w-card-name {
            font-size: 0.80rem; font-weight: 600; color: var(--gray-900);
            line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        /* chips de local/contagem/status — apenas 1 chip de local, simplificado */
        .ag-w-card-chips { display: flex; gap: 4px; align-items: center; margin-top: 3px; }

        .ag-w-chip {
            display: inline-flex; align-items: center; gap: 2px;
            font-size: 0.62rem; font-weight: 500; white-space: nowrap;
        }
        .ag-w-chip svg { display: none; } /* ícones removidos nos chips — texto basta */
        .ag-w-chip-loc   { color: var(--gray-400); }
        .ag-w-chip-count { color: var(--gray-400); }
        /* separador entre chips */
        .ag-w-chip-loc + .ag-w-chip-count::before  { content: '·'; margin-right: 3px; color: var(--gray-300); }
        .ag-w-chip-count + .ag-w-chip-status::before { content: '·'; margin-right: 3px; color: var(--gray-300); }
        .ag-w-chip-status { font-weight: 600; }
        .ag-w-chip-status.s-ocorrendo  { color: #16a34a; }
        .ag-w-chip-status.s-programado { color: var(--blue-500); }
        .ag-w-chip-status.s-finalizado { color: var(--gray-400); }
        .ag-w-live-chip-dot { display: none; } /* live dot removido — o status text já basta */

        /* toggle — mais discreto */
        .ag-w-card-toggle {
            flex-shrink: 0; color: var(--gray-300);
            display: flex; align-items: center; justify-content: center;
            transition: color var(--t), transform var(--t);
        }
        .ag-w-card-toggle svg { width: 14px; height: 14px; }
        .ag-w-event-card.is-expanded .ag-w-card-toggle {
            color: var(--gray-500); transform: rotate(180deg);
        }

        /* Expanded body */
        .ag-w-card-body {
            display: none; border-top: 1px solid var(--gray-100);
            padding: 8px 10px 10px;
            animation: fadeIn 0.15s ease;
        }
        .ag-w-event-card.is-expanded .ag-w-card-body { display: block; }

        /* label de atividades */
        .ag-w-atv-header { display: none; } /* removido — redundante */
        .ag-w-atv-list { display: flex; flex-direction: column; gap: 4px; }
        .ag-w-atv-item {
            display: flex; align-items: baseline; gap: 8px;
            padding: 5px 0;
            border-bottom: 1px solid var(--gray-100);
        }
        .ag-w-atv-item:last-child { border-bottom: none; padding-bottom: 0; }
        .ag-w-atv-time {
            font-size: 0.65rem; font-weight: 600; color: var(--gray-400);
            flex-shrink: 0; width: 38px;
        }
        .ag-w-atv-name {
            font-size: 0.76rem; font-weight: 500; color: var(--gray-700);
            flex: 1; min-width: 0; line-height: 1.3;
        }
        /* pontos — só o número, sem chip elaborado */
        .ag-w-atv-pts { display: none; }
        .ag-w-pts-chip { display: none; }
        /* sala — texto simples */
        .ag-w-atv-sala {
            font-size: 0.62rem; color: var(--gray-400);
            flex-shrink: 0; background: none; border: none; padding: 0;
        }
        .ag-w-atv-sala svg { display: none; }

        .ag-w-empty {
            text-align: center; padding: 1.4rem 1rem;
            font-size: 0.78rem; color: var(--gray-400);
        }

        /* Extra events accordion */
        .ag-w-body .wm-accordion { margin-top: 6px; }
        .ag-w-body .wm-accordion-panel-inner { padding-top: 6px; margin-top: 6px; border-top: 1px solid var(--gray-100); }
        .ag-w-timeline-extra::before { display: none; }

        @media (max-width: 480px) {
            /* Layout geral */
            .page-layout { padding: 0 0 0; }
            .chat-card { border-radius: 0; border-left: none; border-right: none; height: calc(100dvh - 58px - 40px); }

            /* Header */
            .site-header { padding: 0 14px; }
            .header-subtitle { display: none; }

            /* Mensagens */
            .messages-area { padding: 12px 10px 8px; }
            .bubble-wrap { max-width: 82%; }
            .msg-row.user .bubble-wrap { max-width: 88%; }
            .bubble { padding: 8px 12px; font-size: 0.84rem; }

            /* Input */
            .input-area { padding: 8px 10px 10px; }
            .input-hint { display: none; }
            .quick-replies { gap: 5px; }
            .quick-chip { font-size: 0.68rem; padding: 4px 10px; }

            /* Widgets — ocupam largura total disponível */
            .weather-card, .ranking-widget-card, .papers-widget-card,
            .clock-widget-card, .agenda-widget-card {
                max-width: 100%;
                border-radius: 14px;
            }
            .weather-card-wrap, .ranking-card-wrap, .papers-card-wrap,
            .clock-card-wrap, .agenda-card-wrap {
                width: 100%;
            }

            /* Headers dos widgets — fontes menores */
            .wm-temp { font-size: 2.6rem; }
            .wm-icon-main { font-size: 2.2rem; }
            .wm-header, .rk-header, .pp-header,
            .ck-header, .ag-w-header { padding: 14px 14px 16px; }
            .wm-body, .rk-body, .pp-body { padding: 12px 14px 14px; }
            .ck-body { padding: 10px 14px 14px; }
            .ag-w-body { padding: 10px 12px 12px; }

            /* Ranking */
            .rk-leader-name { max-width: 100%; font-size: 1.2rem; }
            .rk-leader-score { font-size: 1.7rem; }

            /* Papers */
            .pp-count { font-size: 2rem; }

            /* Clock */
            .ck-time { font-size: 2.4rem; }

            /* Day tabs do weather */
            .wm-daytab { min-width: 46px; }
            .wm-daytab-label { font-size: 0.58rem; }
            .wm-daytab-temps { font-size: 0.57rem; }

            /* Terms */
            .terms-card { border-radius: 14px; }
            .terms-header { padding: 14px 14px 12px; }
            .terms-body { padding: 12px 12px 2px; }
            .terms-footer { padding: 0 12px 14px; }

            /* Question / Rating */
            .question-card, .rating-card { border-radius: 14px; }
            .outage-card { border-radius: 14px; }

            /* Typing / Searching rows */
            .typing-row, .searching-row, .thinking-row { gap: 6px; }

            /* Chat header */
            .chat-header { padding: 10px 14px; }
            .chat-header-actions { gap: 10px; }
        }

        /* Telas muito pequenas */
        @media (max-width: 360px) {
            .bubble-wrap { max-width: 88%; }
            .msg-row.user .bubble-wrap { max-width: 94%; }
            .bubble { font-size: 0.82rem; padding: 7px 10px; }
            .wm-temp { font-size: 2.2rem; }
            .ck-time { font-size: 2rem; }
            .rk-leader-score { font-size: 1.5rem; }
        }

        /* ── BUSCANDO WIDGET ── */
        .searching-row {
            display: flex; align-items: flex-end; gap: 8px; margin-top: 14px;
            animation: bubbleIn var(--ts) both;
        }
        .searching-bubble {
            background: var(--bot-bubble-bg);
            border-radius: 18px; border-bottom-left-radius: 6px;
            padding: 10px 16px;
            display: flex; align-items: center; gap: 10px;
            min-width: 160px; max-width: 260px;
        }
        .searching-icon {
            width: 18px; height: 18px; flex-shrink: 0; color: var(--blue-500);
            animation: searchSpin 1.4s linear infinite;
        }
        @keyframes searchSpin {
            0%   { transform: rotate(0deg) scale(1); }
            50%  { transform: rotate(180deg) scale(0.85); }
            100% { transform: rotate(360deg) scale(1); }
        }
        .searching-text-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .searching-label {
            font-size: 0.78rem; font-weight: 600; color: var(--gray-700); line-height: 1.2;
        }
        .searching-bar {
            height: 3px; border-radius: 2px;
            background: var(--gray-200); overflow: hidden;
        }
        .searching-bar-fill {
            height: 100%; border-radius: 2px; width: 40%;
            background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
            animation: searchBar 1.6s ease-in-out infinite;
        }
        @keyframes searchBar {
            0%   { width: 10%; margin-left: 0%; }
            50%  { width: 55%; margin-left: 20%; }
            100% { width: 10%; margin-left: 90%; }
        }

        /* ── PENSANDO WIDGET ── */
        .thinking-row {
            display: flex; align-items: flex-end; gap: 8px; margin-top: 14px;
            animation: bubbleIn var(--ts) both;
        }
        .thinking-bubble {
            background: var(--bot-bubble-bg);
            border-radius: 18px; border-bottom-left-radius: 6px;
            padding: 10px 16px;
            display: flex; align-items: center; gap: 10px;
            min-width: 160px; max-width: 260px;
        }
        .thinking-dots-wrap {
            display: flex; align-items: center; gap: 4px; flex-shrink: 0;
        }
        .thinking-dot {
            width: 6px; height: 6px; border-radius: 50%;
            background: var(--blue-400);
        }
        .thinking-dot:nth-child(1) { animation: thinkDot 1.6s 0s ease-in-out infinite; }
        .thinking-dot:nth-child(2) { animation: thinkDot 1.6s .2s ease-in-out infinite; }
        .thinking-dot:nth-child(3) { animation: thinkDot 1.6s .4s ease-in-out infinite; }
        @keyframes thinkDot {
            0%,60%,100% { transform: scale(1); opacity: .4; background: var(--blue-400); }
            30%          { transform: scale(1.45); opacity: 1; background: var(--blue-600); }
        }
        .thinking-text-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .thinking-label {
            font-size: 0.78rem; font-weight: 600; color: var(--gray-700); line-height: 1.2;
        }
        .thinking-sub {
            font-size: 0.64rem; color: var(--gray-400); font-weight: 400;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            animation: thinkSubFade 2.4s ease-in-out infinite;
        }
        @keyframes thinkSubFade {
            0%,100% { opacity: .5; }
            50%      { opacity: 1; }
        }

        /* ── QUESTAO WIDGET ── */
        .question-wrap {
            width: 100%; animation: bubbleIn var(--ts) both;
        }
        .question-card {
            background: var(--white);
            border: 1px solid var(--gray-200);
            border-radius: 16px;
            overflow: hidden;
        }
        .question-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 14px 16px 13px;
            position: relative; overflow: hidden;
        }
        .question-header::after {
            content: '';
            position: absolute;
            top: -45%; right: -18%;
            width: 190px; height: 190px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none; z-index: 0;
        }
        .question-eyebrow {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.60rem; font-weight: 700; letter-spacing: 0.07em;
            text-transform: uppercase; color: rgba(255,255,255,0.85);
            margin-bottom: 5px;
            position: relative; z-index: 1;
        }
        .question-eyebrow svg { width: 10px; height: 10px; flex-shrink: 0; }
        .question-text {
            font-size: 0.88rem; font-weight: 600; color: #fff;
            line-height: 1.4;
            position: relative; z-index: 1;
        }
        .question-options {
            display: flex; flex-direction: column; gap: 0;
        }
        .question-option {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 14px;
            border: none; background: transparent; cursor: pointer; text-align: left; width: 100%;
            border-top: 1px solid var(--gray-100);
            transition: background var(--t);
            position: relative; overflow: hidden;
        }
        .question-option:hover { background: var(--gray-50); }
        .question-option:active { background: var(--blue-50); }
        .question-option.selected { background: var(--blue-50); pointer-events: none; }
        .question-option.selected .q-opt-letter {
            background: var(--blue-600); border-color: var(--blue-600); color: #fff;
        }
        .question-option.selected .q-opt-text { color: var(--blue-700); font-weight: 600; }
        .question-option.correct { background: #f0fdf4; pointer-events: none; }
        .question-option.correct .q-opt-letter { background: #22c55e; border-color: #22c55e; color: #fff; }
        .question-option.correct .q-opt-text { color: #15803d; font-weight: 600; }
        .question-option.wrong { background: #fff1f2; pointer-events: none; }
        .question-option.wrong .q-opt-letter { background: #ef4444; border-color: #ef4444; color: #fff; }
        .question-option.wrong .q-opt-text { color: #b91c1c; }
        .q-opt-letter {
            width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
            border: 1px solid var(--gray-200); background: var(--gray-50);
            display: flex; align-items: center; justify-content: center;
            font-size: 0.64rem; font-weight: 700; color: var(--gray-500);
            transition: all var(--t);
            font-family: 'Barlow Condensed', sans-serif;
        }
        .q-opt-text {
            font-size: 0.80rem; color: var(--gray-700); line-height: 1.35;
            font-weight: 400; transition: color var(--t); text-align: left;
        }
        .q-opt-check {
            margin-left: auto; flex-shrink: 0;
            width: 14px; height: 14px; opacity: 0;
            transition: opacity var(--t);
        }
        .question-option.selected .q-opt-check,
        .question-option.correct  .q-opt-check,
        .question-option.wrong    .q-opt-check { opacity: 1; }
        .question-footer {
            padding: 9px 14px;
            border-top: 1px solid var(--gray-100);
            display: flex; align-items: center; justify-content: space-between;
        }
        .question-hint {
            font-size: 0.61rem; color: var(--gray-400); font-weight: 400;
        }
        .question-count {
            font-size: 0.61rem; color: var(--gray-400); font-weight: 500;
        }

        /* ── INDISPONIBILIDADE WIDGET ── */
        .outage-wrap { width: 100%; animation: bubbleIn var(--ts) both; }
        .outage-card {
            background: var(--white);
            border: 1px solid var(--gray-200);
            border-radius: 16px; overflow: hidden;
        }
        .outage-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 16px 18px 14px;
            position: relative; overflow: hidden; color: #fff;
        }
        .outage-header::after {
            content: '';
            position: absolute;
            top: -45%; right: -18%;
            width: 200px; height: 200px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none; z-index: 0;
        }
        .outage-eyebrow {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.60rem; font-weight: 700; letter-spacing: 0.07em;
            text-transform: uppercase; color: rgba(255,255,255,0.85);
            margin-bottom: 8px;
            position: relative; z-index: 1;
        }
        .outage-eyebrow svg { width: 10px; height: 10px; flex-shrink: 0; }
        .outage-main {
            display: flex; align-items: center; justify-content: space-between;
            gap: 12px;
            position: relative; z-index: 1;
        }
        .outage-sad-face { flex-shrink: 0; width: 46px; height: 46px; opacity: 0.80; }
        .outage-title {
            font-size: 1rem; font-weight: 700; line-height: 1.25;
        }
        .outage-subtitle {
            font-size: 0.70rem; color: rgba(255,255,255,0.50); margin-top: 3px; font-weight: 400;
        }
        .outage-body { padding: 13px 18px 15px; }
        .outage-msg {
            font-size: 0.80rem; color: var(--gray-600); line-height: 1.55; margin-bottom: 12px;
        }
        .outage-status-row {
            display: flex; align-items: center; gap: 8px;
            background: var(--gray-50); border: 1px solid var(--gray-100);
            border-radius: 10px; padding: 9px 12px;
            margin-bottom: 0;
        }
        .outage-status-row.has-actions { margin-bottom: 10px; }
        .outage-pulse {
            width: 6px; height: 6px; border-radius: 50%; background: var(--blue-400); flex-shrink: 0;
            animation: outagePulse 1.8s ease-in-out infinite;
        }
        @keyframes outagePulse {
            0%,100% { opacity: 1; }
            50%      { opacity: 0.35; }
        }
        .outage-status-text { font-size: 0.74rem; font-weight: 500; color: var(--gray-700); flex: 1; }
        .outage-eta { font-size: 0.66rem; color: var(--gray-400); font-weight: 400; flex-shrink: 0; }
        .outage-actions { display: flex; gap: 7px; }
        .outage-btn {
            flex: 1; padding: 8px 10px; border-radius: 8px; border: none; cursor: pointer;
            font-size: 0.74rem; font-weight: 600; transition: all var(--t);
            font-family: 'Inter', sans-serif;
        }
        .outage-btn.primary { background: var(--blue-700); color: #fff; }
        .outage-btn.primary:hover { background: var(--blue-600); }
        .outage-btn.secondary { background: var(--gray-100); color: var(--gray-700); }
        .outage-btn.secondary:hover { background: var(--gray-200); }
        .outage-btn:active { transform: scale(0.97); }

        /* ── AVALIACAO WIDGET ── */
        .rating-wrap { width: 100%; animation: bubbleIn var(--ts) both; }
        .rating-card {
            background: var(--white);
            border: 1px solid var(--gray-200);
            border-radius: 16px; overflow: hidden;
        }
        .rating-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 14px 18px 13px;
            position: relative; overflow: hidden;
        }
        .rating-header::after {
            content: '';
            position: absolute;
            top: -45%; right: -18%;
            width: 190px; height: 190px;
            border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none; z-index: 0;
        }
        .rating-eyebrow {
            display: flex; align-items: center; gap: 5px;
            font-size: 0.60rem; font-weight: 700; letter-spacing: 0.07em;
            text-transform: uppercase; color: rgba(255,255,255,0.85);
            margin-bottom: 5px;
            position: relative; z-index: 1;
        }
        .rating-eyebrow svg { width: 10px; height: 10px; flex-shrink: 0; }
        .rating-question {
            font-size: 0.90rem; font-weight: 600; color: #fff; line-height: 1.4;
            position: relative; z-index: 1;
        }
        .rating-body { padding: 16px 18px 18px; }
        .rating-stars {
            display: flex; justify-content: center; gap: 6px; margin-bottom: 10px;
        }
        .rating-star {
            font-size: 1.85rem; cursor: pointer; line-height: 1;
            transition: transform var(--ts), filter var(--t);
            filter: grayscale(1) opacity(.30);
            user-select: none;
        }
        .rating-star:hover,
        .rating-star.hovered { filter: grayscale(0) opacity(1); transform: scale(1.15); }
        .rating-star.active   { filter: grayscale(0) opacity(1); }
        .rating-star.active:not(.hovered) { transform: scale(1); }
        .rating-label {
            text-align: center; font-size: 0.76rem; font-weight: 500;
            color: var(--gray-400); min-height: 1.2em; margin-bottom: 14px;
            transition: color var(--t);
        }
        .rating-label.has-val { color: var(--gray-700); }
        .rating-submit {
            width: 100%; padding: 9px; border-radius: 10px; border: none; cursor: pointer;
            background: var(--blue-700);
            color: #fff; font-size: 0.80rem; font-weight: 600;
            font-family: 'Inter', sans-serif;
            transition: all var(--t); opacity: 0.30; pointer-events: none;
        }
        .rating-submit.ready { opacity: 1; pointer-events: auto; }
        .rating-submit.ready:hover { background: var(--blue-600); }
        .rating-submit.ready:active { transform: scale(0.98); }
        .rating-done { text-align: center; padding: 8px 0 4px; }
        .rating-done-icon { font-size: 1.8rem; }
        .rating-done-text { font-size: 0.80rem; font-weight: 600; color: var(--gray-800); margin-top: 4px; }
        .rating-done-sub { font-size: 0.68rem; color: var(--gray-400); margin-top: 2px; }
        .rating-bar-row { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
        .rating-bar-item { display: flex; align-items: center; gap: 8px; }
        .rating-bar-lbl {
            font-size: 0.62rem; color: var(--gray-400); font-weight: 500;
            width: 14px; text-align: right; flex-shrink: 0;
        }
        .rating-bar-track {
            flex: 1; height: 4px; border-radius: 2px; background: var(--gray-100); overflow: hidden;
        }
        .rating-bar-fill {
            height: 100%; border-radius: 2px; background: var(--blue-400);
            transition: width 0.55s cubic-bezier(0.34,1.56,0.64,1);
        }
        .rating-bar-pct {
            font-size: 0.58rem; color: var(--gray-400); font-weight: 500;
            width: 28px; text-align: right; flex-shrink: 0;
        }

        /* ── WIDGET ROW — sem avatar, centralizado ── */
        .msg-row.widget-row {
            justify-content: center;
            gap: 0;
            margin-top: 6px;
        }
        /* Quando o balão de texto vem logo antes do widget, reduz o gap */
        .msg-row.before-widget {
            margin-bottom: 2px;
        }
        .msg-row.before-widget + .msg-row.widget-row {
            margin-top: 4px;
        }

        /* Container interno do widget-row: ocupa largura máxima disponível */
        .widget-row-inner {
            width: 100%;
            max-width: 370px; /* máximo igual ao maior widget (agenda) */
            display: flex;
            flex-direction: column;
            gap: 2px;
            align-items: flex-start;
        }
        /* meta-timestamp abaixo do widget */
        .msg-meta.widget-meta {
            padding-left: 4px;
        }

        /* Cada wrap de widget dentro do widget-row-inner ocupa 100% */
        .widget-row-inner .weather-card-wrap,
        .widget-row-inner .ranking-card-wrap,
        .widget-row-inner .papers-card-wrap,
        .widget-row-inner .clock-card-wrap,
        .widget-row-inner .agenda-card-wrap,
        .widget-row-inner .question-wrap,
        .widget-row-inner .outage-wrap,
        .widget-row-inner .rating-wrap {
            width: 100%;
        }

        @media (max-width: 480px) {
            .widget-row-inner { max-width: 100%; }
        }
        .bot-image-wrap {
            max-width: 100%;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .bot-image {
            max-width: 320px;
            width: 100%;
            border-radius: 14px;
            border: 1px solid var(--gray-200);
            display: block;
            cursor: zoom-in;
            transition: opacity var(--t);
        }
        .bot-image:hover { opacity: 0.92; }
        .bot-image-caption {
            font-size: 0.68rem;
            color: var(--gray-400);
            font-weight: 400;
            padding: 0 2px;
        }

        /* Lightbox overlay */
        #img-lightbox {
            display: none;
            position: fixed; inset: 0; z-index: 9995;
            background: rgba(0,0,0,0.82);
            align-items: center; justify-content: center;
            cursor: zoom-out;
            animation: fadeIn 0.18s ease;
        }
        #img-lightbox.open { display: flex; }
        #img-lightbox img {
            max-width: 92vw; max-height: 88vh;
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
            object-fit: contain;
        }
        #img-lightbox-close {
            position: absolute; top: 18px; right: 22px;
            color: rgba(255,255,255,0.75); font-size: 1.6rem;
            cursor: pointer; line-height: 1;
            background: none; border: none; padding: 4px 8px;
            transition: color var(--t);
        }
        #img-lightbox-close:hover { color: #fff; }

        /* ── TOAST ── */
        #toast {
            position: fixed; bottom: 20px; right: 20px; z-index: 9999;
            display: flex; flex-direction: column; gap: 7px; pointer-events: none;
        }
        .toast-item {
            background: var(--gray-900); color: rgba(255,255,255,0.90);
            font-size: 0.78rem; font-weight: 500;
            padding: 10px 14px; border-radius: 10px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.20);
            display: flex; align-items: center; gap: 8px;
            animation: toastIn .25s ease both;
        }
        .toast-item.success { border-left: 3px solid #22c55e; }
        .toast-item.error   { border-left: 3px solid #ef4444; }
        .toast-item.info    { border-left: 3px solid var(--blue-400); }
        @keyframes toastIn  { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }
        @keyframes toastOut { from { opacity:1; transform: none; } to { opacity:0; transform: translateY(8px); } }

        /* ── FOOTER ── */
        .site-footer {
            text-align: center; padding: 16px;
            font-size: 0.70rem; color: var(--gray-400);
            border-top: 1px solid var(--gray-200);
        }

        @keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

        /* ── OVERLAY ── */
        #init-overlay {
            position: fixed; inset: 0; z-index: 9990;
            background: linear-gradient(150deg, #060d3a 0%, #0b1960 40%, #1230a8 75%, #1e42d0 100%);
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 18px; transition: opacity 0.45s ease;
        }
        #init-overlay.hidden { opacity:0; pointer-events:none; }
        .init-spinner {
            width: 52px; height: 52px; border-radius: 16px;
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
            display: flex; align-items: center; justify-content: center;
            animation: spinnerPulse 1.8s ease-in-out infinite;
        }
        @keyframes spinnerPulse {
            0%,100% { transform: scale(1); opacity:.8; }
            50%     { transform: scale(1.06); opacity:1; }
        }
        .init-spinner svg { width: 24px; height: 24px; color: rgba(255,255,255,0.85); }
        .init-label {
            font-size: 0.85rem; font-weight: 600; letter-spacing: 0.15em;
            text-transform: uppercase; color: rgba(255,255,255,0.70);
        }
        .init-sublabel {
            font-size: 0.68rem; color: rgba(255,255,255,0.35);
            margin-top: -10px; text-align: center;
        }

        /* ── TERMOS DE USO WIDGET (inline no chat) ── */
        .terms-widget-wrap {
            width: 100%;
            animation: bubbleIn var(--ts) both;
        }

        .terms-card {
            background: var(--white);
            border-radius: 16px;
            width: 100%;
            overflow: hidden;
            border: 1px solid var(--gray-200);
            box-shadow: 0 4px 16px rgba(10,18,64,0.08);
        }

        .terms-header {
            background: linear-gradient(150deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue-500) 100%);
            padding: 16px 18px 14px;
            position: relative; overflow: hidden;
            color: #fff;
        }
        .terms-header::after {
            content: '';
            position: absolute; top: -50%; right: -14%;
            width: 220px; height: 220px; border-radius: 50%;
            background: rgba(255,255,255,0.07);
            pointer-events: none;
        }
        .terms-beta-badge {
            display: inline-flex; align-items: center; gap: 5px;
            background: rgba(251,191,36,0.18); border: 1px solid rgba(251,191,36,0.40);
            border-radius: 20px; padding: 3px 10px;
            font-size: 0.60rem; font-weight: 700; letter-spacing: 0.08em;
            text-transform: uppercase; color: #fbbf24;
            margin-bottom: 10px;
            position: relative; z-index: 1;
        }
        .terms-beta-badge::before {
            content: '';
            width: 5px; height: 5px; border-radius: 50%;
            background: #fbbf24;
            animation: pulse-dot 2s ease-in-out infinite;
            box-shadow: 0 0 0 0 rgba(251,191,36,0.4);
        }
        @keyframes terms-pulse {
            0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.35); }
            60%     { box-shadow: 0 0 0 4px rgba(251,191,36,0); }
        }
        .terms-header-title {
            font-size: 1.0rem; font-weight: 700; line-height: 1.25;
            position: relative; z-index: 1;
        }
        .terms-header-sub {
            font-size: 0.70rem; color: rgba(255,255,255,0.55);
            margin-top: 4px; font-weight: 400;
            position: relative; z-index: 1;
        }

        .terms-body { padding: 14px 16px 4px; }

        .terms-warning-box {
            display: flex; gap: 10px; align-items: flex-start;
            background: #fffbeb; border: 1px solid #fde68a;
            border-radius: 10px; padding: 11px 13px;
            margin-bottom: 14px;
        }
        .terms-warning-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
        .terms-warning-text {
            font-size: 0.74rem; color: #92400e; line-height: 1.5; font-weight: 500;
        }
        .terms-warning-text strong { color: #78350f; }

        .terms-scroll {
            max-height: 160px; overflow-y: auto;
            border: 1px solid var(--gray-200); border-radius: 10px;
            padding: 12px 14px; margin-bottom: 14px;
            background: var(--gray-50);
        }
        .terms-scroll::-webkit-scrollbar { width: 4px; }
        .terms-scroll::-webkit-scrollbar-track { background: transparent; }
        .terms-scroll::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

        .terms-section-title {
            font-size: 0.62rem; font-weight: 700; color: var(--blue-700);
            text-transform: uppercase; letter-spacing: 0.06em;
            margin-bottom: 4px; margin-top: 10px;
        }
        .terms-section-title:first-child { margin-top: 0; }
        .terms-text {
            font-size: 0.72rem; color: var(--gray-600); line-height: 1.58;
        }

        .terms-check-row {
            display: flex; align-items: flex-start; gap: 10px;
            padding: 8px 2px 14px; cursor: pointer;
            -webkit-user-select: none; user-select: none;
        }
        .terms-check-row input[type="checkbox"] { display: none; }
        .terms-checkbox {
            width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; margin-top: 1px;
            border: 2px solid var(--gray-300);
            background: var(--white);
            display: flex; align-items: center; justify-content: center;
            transition: all var(--t);
        }
        .terms-checkbox svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity var(--t); }
        .terms-check-row:hover .terms-checkbox { border-color: var(--blue-400); }
        .terms-check-row.checked .terms-checkbox {
            background: var(--blue-600); border-color: var(--blue-600);
        }
        .terms-check-row.checked .terms-checkbox svg { opacity: 1; }
        .terms-check-label {
            font-size: 0.74rem; color: var(--gray-700); line-height: 1.5; font-weight: 500;
        }
        .terms-check-label a { color: var(--blue-600); text-decoration: none; }

        .terms-footer {
            padding: 0 16px 16px;
            display: flex; flex-direction: column; gap: 8px;
        }
        .terms-accept-btn {
            width: 100%; padding: 11px;
            border-radius: 10px; border: none; cursor: pointer;
            background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
            color: #fff; font-size: 0.84rem; font-weight: 600;
            font-family: 'Inter', sans-serif;
            transition: all var(--t);
            opacity: 0.35; pointer-events: none;
        }
        .terms-accept-btn.ready {
            opacity: 1; pointer-events: auto;
        }
        .terms-accept-btn.ready:hover {
            filter: brightness(1.08);
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(21,48,160,0.30);
        }
        .terms-accept-btn.ready:active { transform: none; }
        .terms-decline-link {
            text-align: center; font-size: 0.70rem; color: var(--gray-400);
            cursor: pointer; transition: color var(--t);
        }
        .terms-decline-link:hover { color: var(--gray-600); }

        /* ══════════════════════════════════════════════
           MODO IFRAME — embutido no website.html
           Esconde o site-header, site-footer e
           remove padding do page-layout para o chat
           preencher 100% da área disponível.
        ══════════════════════════════════════════════ */
        html.in-iframe,
        html.in-iframe body {
            height: 100%;
            overflow: hidden;
        }
        html.in-iframe body {
            background: var(--white);
        }
        html.in-iframe .site-header,
        html.in-iframe .site-footer {
            display: none;
        }
        html.in-iframe .page-layout {
            padding: 0;
            max-width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        html.in-iframe .chat-card {
            border-radius: 0;
            border: none;
            box-shadow: none;
            height: 100%;
            flex: 1;
        }


/* ── TTS: botão play, spinner, player de áudio ─────────────────────────── */

/* Linha de meta (icones abaixo da bolha do bot) */
.bot-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-left: 2px;
}

/* Botão ▶ que dispara a síntese TTS */
.tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--white, #fff);
    color: var(--primary, #4f46e5);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1;
    padding: 0;
}
.tts-btn:hover {
    background: var(--primary, #4f46e5);
    border-color: var(--primary, #4f46e5);
    color: #fff;
}
.tts-btn--loading {
    pointer-events: none;
    opacity: 0.7;
}
.tts-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}

/* Spinner CSS animado (substitui o ícone enquanto processa) */
.tts-spinner {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: tts-spin 0.7s linear infinite;
}
@keyframes tts-spin {
    to { transform: rotate(360deg); }
}

/* Container do player inline (oculto até o áudio estar pronto) */
.tts-player {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 8px 10px;
    max-width: 340px;
}

/* Barra de controles: play/pause + progress + tempo */
.tts-audio-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tts-play-pause-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--primary, #4f46e5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s;
}
.tts-play-pause-btn:hover {
    background: var(--primary-dark, #3730a3);
}

/* Barra de progresso clicável (scrubbing) */
.tts-progress-wrap {
    flex: 1;
    height: 4px;
    background: var(--border, #e2e8f0);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.tts-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary, #4f46e5);
    border-radius: 2px;
    transition: width 0.15s linear;
}

.tts-time {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}

/* ══════════════════════════════════════════════════════
   AVISO DE CONEXÃO PERDIDA (offline banner)
   Barra fixa no topo da área de mensagens — some quando
   a conexão volta. Sempre visível enquanto offline,
   diferente do toast (que desaparece sozinho).
══════════════════════════════════════════════════════ */
.offline-banner {
    display: none;
    align-items: center; gap: 8px;
    background: #fef2f2; border-bottom: 1px solid #fecaca;
    color: #b91c1c; font-size: 0.72rem; font-weight: 500;
    padding: 8px 14px;
    flex-shrink: 0;
    animation: offlineSlide 0.25s ease both;
}
.offline-banner.visible { display: flex; }
@keyframes offlineSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.offline-banner-icon { width: 15px; height: 15px; flex-shrink: 0; color: #ef4444; }
.offline-banner-text { flex: 1; line-height: 1.4; }
.offline-banner-count {
    font-size: 0.64rem; font-weight: 700;
    background: #fee2e2; color: #b91c1c;
    border-radius: 20px; padding: 2px 8px; flex-shrink: 0;
}
.offline-banner-count:empty { display: none; }

/* ══════════════════════════════════════════════════════
   PAINEL DE FAVORITOS
   Painel lateral (desktop) / tela cheia (mobile).
   Por enquanto só a aba "Geral", vazia — uso futuro.
══════════════════════════════════════════════════════ */
#favorites-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9970;
    background: rgba(10,18,64,0.32);
    animation: fadeIn 0.18s ease;
}
#favorites-overlay.open { display: block; }

#favorites-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(360px, 100vw);
    background: var(--white);
    z-index: 9971;
    display: flex; flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
#favorites-panel.open { transform: translateX(0); }

.favorites-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.favorites-panel-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.95rem; font-weight: 700; color: var(--gray-900);
}
.favorites-panel-title svg { width: 18px; height: 18px; color: #f59e0b; fill: #fbbf24; }
#favorites-close {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: var(--gray-100); color: var(--gray-600);
    cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--t);
}
#favorites-close:hover { background: var(--gray-200); }

.favorites-panel-tabs {
    display: flex; gap: 4px; padding: 10px 16px 0;
    border-bottom: 1px solid var(--gray-100); flex-shrink: 0;
}
.favorites-tab {
    border: none; background: none; cursor: pointer;
    font-size: 0.76rem; font-weight: 600; color: var(--gray-400);
    padding: 8px 4px 10px; position: relative;
}
.favorites-tab.active { color: var(--blue-600); }
.favorites-tab.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: var(--blue-600); border-radius: 2px 2px 0 0;
}

.favorites-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.favorites-empty {
    height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    gap: 8px; padding: 24px 12px; color: var(--gray-400);
}
.favorites-empty svg { width: 38px; height: 38px; color: var(--gray-200); margin-bottom: 4px; }
.favorites-empty-title { font-size: 0.85rem; font-weight: 600; color: var(--gray-600); }
.favorites-empty-sub { font-size: 0.72rem; line-height: 1.5; max-width: 220px; }

@media (max-width: 600px) {
    #favorites-panel { width: 100vw; }
}

/* ══════════════════════════════════════════════════════
   RF-11 (Fase C3, PLANO_WORKSPACE_USUARIO.md) — PAINEL "MEUS ARQUIVOS"
   Reaproveita .favorites-panel-header/title/tabs/tab/body/empty (já
   class-based, definidas acima) — só precisa das regras específicas de ID
   equivalentes a #favorites-overlay/#favorites-panel/#favorites-close.
══════════════════════════════════════════════════════ */
#workspace-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9970;
    background: rgba(10,18,64,0.32);
    animation: fadeIn 0.18s ease;
}
#workspace-overlay.open { display: block; }

#workspace-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(360px, 100vw);
    background: var(--white);
    z-index: 9971;
    display: flex; flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
#workspace-panel.open { transform: translateX(0); }

#workspace-close {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: var(--gray-100); color: var(--gray-600);
    cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--t);
}
#workspace-close:hover { background: var(--gray-200); }

@media (max-width: 600px) {
    #workspace-panel { width: 100vw; }
}

/* ── Conteúdo do painel: barra de ferramentas, árvore, itens ── */

.ws-loading {
    text-align: center; padding: 32px 12px; color: var(--gray-400); font-size: 0.8rem;
}

.ws-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}

.ws-breadcrumb {
    font-size: 0.75rem; color: var(--gray-500); line-height: 1.5;
    overflow-wrap: anywhere;
}
.ws-crumb {
    cursor: pointer; color: var(--blue-600); font-weight: 600;
}
.ws-crumb:hover { text-decoration: underline; }

.ws-upload-btn {
    font-size: 0.72rem; font-weight: 600; color: #fff;
    background: var(--blue-600); border-radius: 6px;
    padding: 6px 10px; cursor: pointer; white-space: nowrap;
    transition: background var(--t);
}
.ws-upload-btn:hover { background: var(--blue-700, var(--blue-600)); }

.ws-empty-trash-btn {
    font-size: 0.72rem; font-weight: 600; color: #dc2626;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px;
    padding: 6px 10px; cursor: pointer;
}
.ws-empty-trash-btn:hover:not(:disabled) { background: #fee2e2; }
.ws-empty-trash-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ws-list { display: flex; flex-direction: column; gap: 4px; }

.ws-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 6px; border-radius: 8px;
    transition: background var(--t);
}
.ws-item:hover { background: var(--gray-50, var(--gray-100)); }
.ws-item-icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--gray-400); }
.ws-item-icon svg { width: 100%; height: 100%; }
.ws-item-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.8rem; color: var(--gray-800, var(--gray-900));
}
.ws-item-size { font-size: 0.68rem; color: var(--gray-400); flex-shrink: 0; }
.ws-item-abrir, .ws-item-baixar, .ws-item-restaurar {
    flex-shrink: 0; font-size: 0.7rem; font-weight: 600; color: var(--blue-600);
    background: none; border: 1px solid var(--blue-600); border-radius: 6px;
    padding: 4px 8px; cursor: pointer; transition: background var(--t), color var(--t);
}
.ws-item-abrir:hover, .ws-item-baixar:hover:not(:disabled), .ws-item-restaurar:hover:not(:disabled) {
    background: var(--blue-600); color: #fff;
}
.ws-item-baixar:disabled, .ws-item-restaurar:disabled { opacity: 0.5; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════
   RF-11 (Fase C3) — Widget de confirmação de operação em massa no chat
   (WorkspaceConfirmWidget / .ws-confirm-*). Estilo de alerta — vermelho
   sutil, distinto dos demais cards de widget (que usam azul/neutro).
══════════════════════════════════════════════════════ */

.ws-confirm-wrap { display: flex; justify-content: flex-start; }
.ws-confirm-card {
    max-width: 320px; background: #fff7ed; border: 1px solid #fdba74;
    border-radius: 12px; overflow: hidden;
}
.ws-confirm-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: #fed7aa; color: #9a3412;
    font-size: 0.78rem; font-weight: 700;
}
.ws-confirm-header svg { width: 16px; height: 16px; flex-shrink: 0; }
.ws-confirm-body { padding: 12px 14px 14px; }
.ws-confirm-resumo { font-size: 0.82rem; color: var(--gray-800, var(--gray-900)); line-height: 1.45; margin-bottom: 8px; }
.ws-confirm-detail { font-size: 0.72rem; color: var(--gray-500); margin-bottom: 4px; }
.ws-confirm-unavailable { font-style: italic; }
.ws-confirm-status {
    font-size: 0.74rem; font-weight: 600; padding: 6px 8px; border-radius: 6px; margin: 8px 0;
}
.ws-confirm-status.success { background: #dcfce7; color: #166534; }
.ws-confirm-status.neutral { background: var(--gray-100); color: var(--gray-600); }
.ws-confirm-status.error   { background: #fee2e2; color: #991b1b; }
.ws-confirm-actions { display: flex; gap: 8px; margin-top: 10px; }
.ws-confirm-btn {
    flex: 1; font-size: 0.76rem; font-weight: 700; border-radius: 8px;
    padding: 8px 10px; cursor: pointer; border: 1px solid transparent;
    transition: opacity var(--t);
}
.ws-confirm-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ws-confirm-btn.secondary { background: #fff; border-color: var(--gray-200); color: var(--gray-700, var(--gray-600)); }
.ws-confirm-btn.secondary:hover:not(:disabled) { background: var(--gray-50, var(--gray-100)); }
.ws-confirm-btn.danger { background: #dc2626; color: #fff; }
.ws-confirm-btn.danger:hover:not(:disabled) { background: #b91c1c; }

/* ══════════════════════════════════════════════════════
   MODO TELA CHEIA (mobile)
   Ativado via botão no header. Faz o chat-card ocupar
   100% da viewport, escondendo header/footer do site.
   O botão de tela cheia só aparece em telas estreitas;
   em modo iframe o chat já preenche o espaço do widget,
   então isto cobre o caso de uso em página própria.
══════════════════════════════════════════════════════ */
html.chat-fullscreen,
html.chat-fullscreen body {
    overflow: hidden;
    height: 100%;
}
html.chat-fullscreen .site-header,
html.chat-fullscreen .site-footer {
    display: none;
}
html.chat-fullscreen .page-layout {
    padding: 0; max-width: 100%; height: 100dvh;
    display: flex; flex-direction: column;
}
html.chat-fullscreen .chat-card {
    position: fixed; inset: 0; z-index: 9960;
    width: 100vw; height: 100dvh; max-height: none;
    border-radius: 0; border: none; box-shadow: none;
}
/* Respeita áreas seguras (notch / home indicator) em tela cheia */
html.chat-fullscreen .chat-header {
    padding-top: max(12px, env(safe-area-inset-top));
}
html.chat-fullscreen .input-area {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
}

/* O botão de tela cheia só faz sentido em telas pequenas/médias */
@media (min-width: 769px) {
    #fullscreen-btn { display: none; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVIDADE — breakpoint intermediário (tablets /
   celulares grandes em paisagem). Preenche a lacuna entre
   o layout desktop e as regras específicas de ≤480px.
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .page-layout { max-width: 100%; padding: 14px 10px 24px; }
    .chat-card { height: min(92vh, 760px); border-radius: 16px; }
    .header-subtitle { display: none; }
    .site-header { padding: 0 16px; }
    .bubble-wrap { max-width: 80%; }
    .msg-row.user .bubble-wrap { max-width: 85%; }
}

/* Telas muito baixas (paisagem em celular) — reduz alturas fixas
   para não cobrir a área de digitação com o teclado virtual. */
@media (max-width: 900px) and (max-height: 420px) and (orientation: landscape) {
    .chat-header { padding: 6px 14px; }
    .bot-avatar { width: 30px; height: 30px; }
    .messages-area { padding: 8px 10px 6px; }
    .input-area { padding: 6px 10px 8px; }
    .input-hint { display: none; }
}

/* Telas muito pequenas em largura (≤340px) */
@media (max-width: 340px) {
    .header-icon-btn { width: 28px; height: 28px; }
    .header-icon-btn svg { width: 16px; height: 16px; }
    .bot-avatar { width: 34px; height: 34px; }
    .chat-header-name { font-size: 0.84rem; }
}

/* Garante que inputs em iOS não disparem zoom automático no foco
   (campos com font-size < 16px causam zoom) */
@media (max-width: 480px) {
    .input-box { font-size: 16px; }
}


/* ══════════════════════════════════════════════════════
   FASE 1 (C3 / C9) — selo de proveniência de widget
   (mock / dry_run / degradado). Ver renderOrigemBadgeHTML()
   em chatbot-script.js.
══════════════════════════════════════════════════════ */
.origem-badge-host {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}
.origem-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: default;
    font-weight: 600;
}
.origem-badge--teste {
    background: #fff3cd;
    color: #8a6d00;
    border: 1px solid #ffe08a;
}
.origem-badge--degradado {
    background: #fdeaea;
    color: #9a3b3b;
    border: 1px solid #f3b8b8;
}

/* ══════════════════════════════════════════════════════
   FASE 2 (C7) — cartão genérico de fallback para tipos de
   widget não reconhecidos (skills agênticas sem widget
   dedicado). Apenas campos estruturados, sem HTML livre.
══════════════════════════════════════════════════════ */
.generic-fallback-card {
    background: var(--bubble-bot-bg, #f2f2f5);
    border-radius: 14px;
    padding: 12px 14px;
    max-width: 320px;
}
.generic-fallback-title {
    font-weight: 700;
    margin-bottom: 6px;
}
.generic-fallback-body {
    font-size: 0.92rem;
    line-height: 1.4;
}
.generic-fallback-list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 0.92rem;
}
.generic-fallback-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════
   FASE 2 (C8) — texto de progresso nomeado ao lado do
   indicador de digitação, para execuções multi-passo de
   skills agênticas.
══════════════════════════════════════════════════════ */
.typing-progress-text {
    margin-left: 8px;
    align-self: center;
    font-size: 0.78rem;
    color: var(--text-muted, #777);
    font-style: italic;
}
