/* ================================================================
   LLM CHAT — AI Assistant Styles
   ================================================================

   Estilos dedicados do painel de chat e configuracao do assistente
   de IA. Migrado de styles.css e aprimorado com engine selector,
   progress bar, streaming animation, e benchmark display.

   ================================================================ */

/* ----------------------------------------------------------------
   ENGINE COLORS — cores por tipo de engine
   ---------------------------------------------------------------- */

:root {
    /* Y11: LLM engine colors mapped to global accents where possible */
    --engine-cloud: var(--primary-500);              /* teal — main brand */
    --engine-browser: var(--accent-green, #10b981);  /* green — local/fast */
    --engine-webllm: var(--accent-orange, #f59e0b);  /* amber — experimental */
    --engine-local: #8b5cf6;                         /* violet — LLM-specific */
}

/* ================================================================
   AI WIDGET FAB — floating action button (sempre visivel)
   ================================================================ */

.ai-widget-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-600);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: var(--z-chat, 250);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ai-widget-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.ai-widget-fab:hover svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.ai-widget-fab.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Notification badge */
.ai-widget-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--error, #ef4444);
    border: 2px solid white;
}

[data-theme="dark"] .ai-widget-fab {
    background: var(--primary-500);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Pulse animation — bot has pending insights */
@keyframes fab-pulse {
    0%   { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 0 0 rgba(45,130,130,0.5); }
    70%  { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 0 12px rgba(45,130,130,0); }
    100% { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 0 0 rgba(45,130,130,0); }
}

.ai-widget-fab.has-insights {
    animation: fab-pulse 1.5s ease-out 1;
}

.ai-widget-fab.has-insights .ai-widget-badge {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
    background: var(--error, #ef4444);
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    border: 2px solid white;
}

/* ================================================================
   CHAT PANEL — widget flutuante (bottom-right, compacto)
   ================================================================ */

.llm-chat-panel {
    --chat-w: 380px;
    --chat-h: 520px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--chat-w);
    max-height: var(--chat-h);
    min-width: 300px;
    min-height: 300px;
    background: var(--neutral-0);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: var(--z-chat, 250);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease,
                visibility 0.25s ease;
}

.llm-chat-panel.open {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

[data-theme="dark"] .llm-chat-panel {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ----------------------------------------------------------------
   HEADER — titulo, engine badge, acoes
   ---------------------------------------------------------------- */

.llm-chat-header {
    padding: var(--space-3) var(--space-4);
    background: var(--primary-600);
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    border-radius: 16px 16px 0 0;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.llm-chat-header:active {
    cursor: grabbing;
}

/* Quando arrastado, desativar transição de posição */
.llm-chat-panel.dragged {
    transition: none;
}

.llm-chat-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.llm-chat-header-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.llm-chat-header .panel-header-btn {
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.llm-chat-header .panel-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Engine badge — pill colorida no header */
.engine-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.engine-badge.engine-cloud {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.engine-badge.engine-browser {
    background: var(--engine-browser);
    color: white;
}

.engine-badge.engine-web-llm {
    background: var(--engine-webllm);
    color: #1a1a2e;
}

.engine-badge.engine-local {
    background: var(--engine-local);
    color: white;
}

/* Agent badge */
.agent-active-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* ----------------------------------------------------------------
   PROGRESS BAR — download de modelo / loading
   ---------------------------------------------------------------- */

.llm-progress-bar {
    height: 3px;
    background: var(--neutral-200);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.llm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--engine-browser), #34d399);
    transition: width 0.3s ease;
    width: 0%;
}

/* Indeterminate shimmer animation */
.llm-progress-bar.indeterminate .llm-progress-fill {
    width: 30%;
    animation: progress-shimmer 1.5s infinite ease-in-out;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ================================================================
   MESSAGES — area de mensagens do chat
   ================================================================ */

.llm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-300) transparent;
}

.llm-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.llm-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.llm-chat-messages::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 3px;
}

.llm-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

.llm-message {
    position: relative;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    max-width: 90%;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.llm-message.user {
    background: var(--primary-100);
    color: var(--primary-900);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.llm-message.assistant {
    background: var(--neutral-100);
    color: var(--neutral-800);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.llm-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.llm-message.confirmation {
    background: var(--warning-50, #fffbeb);
    border: 1px solid var(--warning, #f59e0b);
}

.llm-message.success {
    background: rgba(33, 192, 139, 0.1);
    border: 1px solid var(--accent-500);
    color: var(--accent-600);
}

/* Streaming message — cursor piscante no final */
.llm-message.streaming::after {
    content: '▌';
    animation: blink-cursor 0.8s step-end infinite;
    color: var(--primary-500);
    font-weight: 700;
}

@keyframes blink-cursor {
    50% { opacity: 0; }
}

.llm-message-actions {
    margin-top: var(--space-3);
    display: flex;
    gap: var(--space-2);
}

.llm-message-actions .btn {
    font-size: 11px;
    padding: 4px 12px;
}

/* ================================================================
   INPUT — campo de entrada de mensagem
   ================================================================ */

.llm-chat-input {
    padding: var(--space-3);
    border-top: 1px solid var(--neutral-200);
    display: flex;
    gap: var(--space-2);
    background: var(--neutral-50);
}

.llm-chat-input .form-input {
    flex: 1;
    font-size: 13px;
}

.llm-chat-input .btn {
    white-space: nowrap;
}

/* ================================================================
   TOOLS BAR — barra de ferramentas do chat
   ================================================================ */

.llm-chat-tools-bar {
    position: relative;
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.llm-tools-toggle {
    flex-shrink: 0;
}

.llm-tools-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--neutral-300);
    border-radius: 16px;
    background: var(--neutral-0);
    color: var(--neutral-600);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.llm-tools-btn:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-400);
    color: var(--neutral-800);
}

.llm-tools-btn .icon {
    font-size: 12px;
}

/* Tools dropdown */
.llm-tools-dropdown {
    position: absolute;
    bottom: 100%;
    left: var(--space-3);
    right: var(--space-3);
    background: var(--neutral-0);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    z-index: calc(var(--z-chat, 250) + 1);
    margin-bottom: 4px;
    overflow: hidden;
}

.llm-tool-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--neutral-100);
}

.llm-tool-option:last-child {
    border-bottom: none;
}

.llm-tool-option:hover {
    background: var(--neutral-50);
}

.llm-tool-option > .icon {
    font-size: 16px;
    color: var(--primary-500);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.llm-tool-info {
    flex: 1;
    min-width: 0;
}

.llm-tool-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--neutral-800);
}

.llm-tool-desc {
    display: block;
    font-size: 10px;
    color: var(--neutral-500);
    line-height: 1.3;
    margin-top: 1px;
}

.llm-tool-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--neutral-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    color: transparent;
}

.llm-tool-check.active {
    border-color: var(--primary-500);
    background: var(--primary-500);
    color: white;
}

/* Tool chips — ferramentas ativas */
.llm-tools-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.llm-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: 12px;
    font-size: 10px;
    color: var(--primary-text-muted);
    white-space: nowrap;
}

.llm-tool-chip .icon {
    font-size: 10px;
}

.llm-tool-chip-remove {
    background: none;
    border: none;
    color: var(--primary-text);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    line-height: 1;
    margin-left: 2px;
}

.llm-tool-chip-remove:hover {
    color: var(--error);
}

.llm-tool-chip-upload {
    background: var(--primary-100);
    border: 1px solid var(--primary-300);
    color: var(--primary-text);
    cursor: pointer;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: var(--radius-lg);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.llm-tool-chip-upload:hover {
    background: var(--primary-100);
    color: var(--primary-text-muted);
}

/* Tool separator */
.llm-tool-separator {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs, 10px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-400);
    background: var(--neutral-100);
    border-bottom: 1px solid var(--neutral-200);
    border-top: 1px solid var(--neutral-200);
}

/* Edit button on user custom tools */
.llm-tool-edit-btn {
    background: none;
    border: none;
    color: var(--neutral-400);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.llm-tool-edit-btn:hover {
    background: var(--neutral-200);
    color: var(--primary-text);
}

/* Create tool option */
.llm-tool-create {
    border-top: 1px dashed var(--neutral-300);
    background: var(--neutral-50);
}

.llm-tool-create:hover {
    background: var(--primary-50);
}

.llm-tool-create .llm-tool-name {
    color: var(--primary-text);
}

/* ================================================================
   TYPING INDICATOR — indicador de digitacao
   ================================================================ */

.llm-typing {
    display: flex;
    gap: 4px;
    padding: var(--space-2) var(--space-3);
    align-self: flex-start;
}

.llm-typing span {
    width: 8px;
    height: 8px;
    background: var(--neutral-400);
    border-radius: 50%;
    animation: llm-typing 1.4s infinite ease-in-out both;
}

.llm-typing span:nth-child(1) { animation-delay: 0s; }
.llm-typing span:nth-child(2) { animation-delay: 0.2s; }
.llm-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes llm-typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ================================================================
   STATUS — status do LLM
   ================================================================ */

.llm-status {
    font-size: 10px;
    color: var(--neutral-500);
    padding: var(--space-1) var(--space-3);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
}

.llm-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--space-1);
}

.llm-status-indicator.connected {
    background: var(--accent-500);
}

.llm-status-indicator.disconnected {
    background: var(--error);
}

/* ================================================================
   ENGINE SELECTOR — cards de selecao de engine no modal
   ================================================================ */

.engine-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.engine-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--neutral-0);
}

.engine-card:hover {
    border-color: var(--neutral-400);
    background: var(--neutral-50);
}

.engine-card.active {
    border-color: var(--primary-500);
    background: var(--primary-50);
    box-shadow: 0 0 0 1px var(--primary-500);
}

.engine-card.active[data-engine="browser"] {
    border-color: var(--engine-browser);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 1px var(--engine-browser);
}

.engine-card.active[data-engine="web-llm"] {
    border-color: var(--engine-webllm);
    background: rgba(245, 158, 11, 0.05);
    box-shadow: 0 0 0 1px var(--engine-webllm);
}

.engine-card.active[data-engine="local"] {
    border-color: var(--engine-local);
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 0 1px var(--engine-local);
}

.engine-card .icon {
    font-size: 24px;
    color: var(--neutral-600);
}

.engine-card.active .icon {
    color: var(--primary-500);
}

.engine-card.active[data-engine="browser"] .icon {
    color: var(--engine-browser);
}

.engine-card.active[data-engine="web-llm"] .icon {
    color: var(--engine-webllm);
}

.engine-card.active[data-engine="local"] .icon {
    color: var(--engine-local);
}

.engine-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--neutral-800);
}

.engine-card small {
    font-size: 10px;
    color: var(--neutral-500);
    line-height: 1.3;
}

/* Engine config panels — paineis de configuracao por engine */
.engine-config {
    padding-top: var(--space-2);
}

/* ================================================================
   BENCHMARK RESULTS — resultado da avaliacao do dispositivo
   ================================================================ */

.benchmark-results {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: 12px;
}

.benchmark-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-1) 0;
}

.benchmark-row:not(:last-child) {
    border-bottom: 1px solid var(--neutral-100);
}

.benchmark-label {
    color: var(--neutral-600);
    font-size: 11px;
}

.benchmark-value {
    font-weight: 600;
    color: var(--neutral-800);
    font-size: 11px;
}

.benchmark-value.available {
    color: var(--engine-browser);
}

.benchmark-value.unavailable {
    color: var(--error);
}

.benchmark-recommendation {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--neutral-700);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.benchmark-recommendation strong {
    color: var(--engine-browser);
}

.benchmark-loading {
    text-align: center;
    padding: var(--space-4);
    color: var(--neutral-500);
    font-size: 11px;
}

/* ================================================================
   MODEL DOWNLOAD SECTION — secao de download no config browser
   ================================================================ */

.model-download-section {
    margin-top: var(--space-3);
}

.model-download-progress {
    margin-top: var(--space-2);
    background: var(--neutral-100);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 20px;
    position: relative;
}

.model-download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--engine-browser), #34d399);
    transition: width 0.3s ease;
    width: 0%;
}

.model-download-progress-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--neutral-700);
}

/* ================================================================
   RESPONSIVE — mobile breakpoint
   ================================================================ */

@media (max-width: 768px) {
    .llm-chat-panel {
        width: calc(100% - 16px);
        max-height: calc(100vh - 132px); /* 56px bottom nav + gap */
        bottom: 64px;  /* acima da bottom nav (56px) */
        right: 8px;
    }

    .ai-widget-fab {
        bottom: 68px;  /* acima da bottom nav (56px) */
        right: 12px;
        width: 48px;
        height: 48px;
    }

    .engine-selector {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .engine-card {
        flex-direction: row;
        text-align: left;
        padding: var(--space-3);
    }

    .engine-card .icon {
        font-size: 20px;
    }
}

/* ================================================================
   ZEN MODE — oculta chat em modo zen
   ================================================================ */

body.zen-mode .llm-chat-panel,
body.zen-mode .ai-widget-fab {
    display: none !important;
}

/* ================================================================
   SPEECH — Mic button, recording indicator, speak button
   Controles de entrada/saida por voz no chat IA
   ================================================================ */

/* Mic button — entre input e Send */
.llm-mic-btn {
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.llm-mic-btn:hover {
    color: var(--primary-500);
    border-color: var(--primary-500);
}

.llm-mic-btn.recording {
    color: #ef4444;
    border-color: #ef4444;
    animation: mic-pulse 1.5s ease-in-out infinite;
}

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

/* Recording indicator — header do chat */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ef4444;
    margin-left: 8px;
}

.recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: mic-pulse 1.5s ease-in-out infinite;
}

/* Speak button — em mensagens do assistente */
.llm-message .speak-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 2px 4px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.llm-message:hover .speak-btn {
    opacity: 0.7;
}

.llm-message .speak-btn:hover {
    opacity: 1;
    color: var(--primary-500);
}

.llm-message .speak-btn.playing {
    opacity: 1;
    color: var(--accent-green, #10b981);
}

/* Voice settings section no modal config */
.engine-config-section {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.config-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

/* ================================================================
   PROACTIVE AI — Token meter, credits, toggle, tips
   ================================================================ */

/* Token meter — barra de % de tokens na sessao */
.llm-token-meter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}

.llm-token-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.llm-token-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-green, #10b981);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.llm-token-fill.warning { background: var(--warning, #f59e0b); }
.llm-token-fill.critical { background: var(--error, #ef4444); }

.llm-token-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
    min-width: 24px;
}

/* Credits remaining meter */
.llm-credits-meter {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
    color: rgba(255, 255, 255, 0.7);
}

.llm-credits-label {
    font-size: 9px;
    font-variant-numeric: tabular-nums;
}

/* Proactive toggle active state */
.llm-chat-header .panel-header-btn.active {
    color: var(--accent-green, #10b981);
    opacity: 1;
}

.llm-chat-header .panel-header-btn:not(.active) {
    opacity: 0.6;
}

/* Proactive tips — mensagens de insight */
.llm-message.llm-tip {
    font-size: 12px;
    padding: 6px 10px;
    border-left: 3px solid var(--border);
    background: var(--surface-secondary, rgba(0, 0, 0, 0.03));
    margin-bottom: 2px;
}

.llm-message.llm-tip.tip-critical { border-left-color: var(--error, #ef4444); }
.llm-message.llm-tip.tip-warning  { border-left-color: var(--warning, #f59e0b); }
.llm-message.llm-tip.tip-info     { border-left-color: var(--info, #3b82f6); }

.llm-tip-category {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-right: 6px;
}

.llm-tip-action {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Engine badge — Ecbyts branded */
.engine-badge.engine-ecbyts {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: white;
}

/* Range slider — personality technical depth */
.form-range {
    width: 100%;
    height: 4px;
    appearance: none;
    background: var(--neutral-700, #3a3d43);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: var(--space-2) 0;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-500);
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: var(--primary-500);
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.range-labels output {
    font-weight: 600;
    color: var(--primary-500);
    font-size: 12px;
}

/* Toast category checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}

.checkbox-group .toggle-label {
    font-size: 12px;
}
