/* Synthoil AI Widget — Consultor LUB-TEK embutido no site */

.synthoil-ai-widget {
    --sai-gold: #D4AF37;
    --sai-gold-dark: #b5952f;
    --sai-gold-light: #f5d76e;
    --sai-navy: #001833;
    --sai-navy-light: #002a5c;
    --sai-bg: #0f1117;
    --sai-panel: #161a24;
    --sai-border: rgba(212, 175, 55, 0.25);
    --sai-text: #f3f4f6;
    --sai-muted: #9ca3af;
    position: fixed;
    bottom: 30px;
    left: 30px;
    right: auto;
    z-index: 10001;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.synthoil-ai-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.synthoil-ai-toggle {
    width: auto;
    height: auto;
    min-height: 48px;
    padding: 11px 18px;
    border: 2px solid var(--sai-gold);
    border-radius: 6px;
    cursor: pointer;
    background: var(--sai-navy);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 24, 51, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    line-height: 1.2;
    white-space: nowrap;
}

.synthoil-ai-toggle-label {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.synthoil-ai-toggle-ia {
    color: var(--sai-gold);
    font-weight: 800;
    font-size: 0.95rem;
}

.synthoil-ai-toggle-brand {
    color: #fff;
    font-weight: 700;
}

.synthoil-ai-toggle:hover {
    transform: translateY(-2px);
    background: var(--sai-navy-light);
    box-shadow: 0 8px 22px rgba(0, 24, 51, 0.45);
    border-color: var(--sai-gold-light);
}

.synthoil-ai-toggle.is-open {
    background: var(--sai-gold);
    color: var(--sai-navy);
    border-color: var(--sai-gold);
}

.synthoil-ai-toggle.is-open .synthoil-ai-toggle-ia,
.synthoil-ai-toggle.is-open .synthoil-ai-toggle-brand {
    color: var(--sai-navy);
}

.synthoil-ai-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    right: auto;
    width: min(400px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 140px));
    background: var(--sai-panel);
    border: 1px solid var(--sai-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1;
}

.synthoil-ai-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.synthoil-ai-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #1a1f2e, #111827);
    border-bottom: 1px solid var(--sai-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.synthoil-ai-header-info {
    min-width: 0;
    flex: 1;
}

.synthoil-ai-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--sai-gold);
    font-weight: 700;
    line-height: 1.3;
}

.synthoil-ai-header p {
    margin: 2px 0 0;
    font-size: 0.72rem;
    color: var(--sai-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.synthoil-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.synthoil-ai-maximize,
.synthoil-ai-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--sai-muted);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}

.synthoil-ai-close {
    font-size: 1.25rem;
}

.synthoil-ai-maximize .sai-icon-restore {
    display: none;
}

.synthoil-ai-maximize.is-restored .sai-icon-expand {
    display: none;
}

.synthoil-ai-maximize.is-restored .sai-icon-restore {
    display: block;
}

.synthoil-ai-maximize:hover,
.synthoil-ai-close:hover {
    color: var(--sai-gold);
    background: rgba(212, 175, 55, 0.12);
}

.synthoil-ai-agents {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    scrollbar-width: none;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.synthoil-ai-agents::-webkit-scrollbar {
    display: none;
}

.synthoil-ai-agent-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: var(--sai-muted);
    font-size: 0.72rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    scroll-snap-align: start;
    min-height: 34px;
}

.synthoil-ai-agent-btn.is-active,
.synthoil-ai-agent-btn:hover {
    border-color: var(--sai-gold);
    color: var(--sai-gold);
    background: rgba(212, 175, 55, 0.1);
}

.synthoil-ai-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--sai-bg);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.synthoil-ai-msg {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.synthoil-ai-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--sai-gold), var(--sai-gold-dark));
    color: #111;
    border-bottom-right-radius: 4px;
}

.synthoil-ai-msg.ai {
    align-self: flex-start;
    background: #1f2937;
    color: var(--sai-text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    max-width: 92%;
}

.synthoil-ai-msg.ai strong {
    color: var(--sai-gold);
}

.synthoil-ai-msg a {
    color: var(--sai-gold);
    text-decoration: underline;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.synthoil-ai-msg.user a {
    color: #1a1a1a;
    font-weight: 600;
}

.synthoil-ai-msg.system {
    align-self: center;
    background: rgba(212, 175, 55, 0.08);
    color: var(--sai-muted);
    font-size: 0.75rem;
    text-align: center;
    max-width: 95%;
}

.synthoil-ai-typing {
    align-self: flex-start;
    padding: 10px 14px;
    background: #1f2937;
    border-radius: 12px;
    display: flex;
    gap: 4px;
}

.synthoil-ai-typing span {
    width: 6px;
    height: 6px;
    background: var(--sai-gold);
    border-radius: 50%;
    animation: sai-bounce 1.2s infinite ease-in-out;
}

.synthoil-ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.synthoil-ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sai-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

.synthoil-ai-input-area {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--sai-panel);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.synthoil-ai-input-area textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--sai-bg);
    color: var(--sai-text);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
}

.synthoil-ai-input-area textarea:focus {
    outline: none;
    border-color: var(--sai-gold);
}

.synthoil-ai-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--sai-gold);
    color: #111;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.synthoil-ai-send:hover:not(:disabled) {
    background: var(--sai-gold-dark);
}

.synthoil-ai-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.synthoil-ai-footer-link {
    text-align: center;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    font-size: 0.68rem;
    color: var(--sai-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.synthoil-ai-footer-link a {
    color: var(--sai-gold);
    text-decoration: none;
    display: inline-block;
    padding: 4px 0;
}

/* Body layout — auth OR chat, never both */
.synthoil-ai-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.sai-is-hidden {
    display: none !important;
}

/* Google login gate — premium */
.synthoil-ai-auth {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 175, 55, 0.08), transparent),
        var(--sai-bg);
    overflow-y: auto;
}

.synthoil-ai-auth-card {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.synthoil-ai-auth-card--login {
    max-width: 360px;
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem 1.5rem 1.35rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.synthoil-ai-auth-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4285f4;
}

.synthoil-ai-auth-card--login h4 {
    margin: 0 0 0.45rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.synthoil-ai-auth-card--login .synthoil-ai-auth-desc {
    margin: 0 0 1.25rem !important;
    color: #6b7280 !important;
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
}

.synthoil-ai-auth-card--login .synthoil-ai-auth-note {
    color: #9ca3af;
    font-size: 0.68rem;
    margin-top: 0.85rem;
}

.synthoil-ai-auth-divider--light {
    color: #9ca3af;
    margin: 1rem 0 0.85rem;
}

.synthoil-ai-auth-divider--light::before,
.synthoil-ai-auth-divider--light::after {
    background: #e5e7eb;
}

.synthoil-ai-auth-card--login .synthoil-ai-auth-fallback {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.synthoil-ai-auth-card--login .synthoil-ai-auth-fallback p {
    color: #6b7280;
    font-size: 0.78rem;
}

.synthoil-ai-auth-card--login .synthoil-ai-alt-btn {
    border-color: #e5e7eb;
    color: #374151;
    background: #f9fafb;
}

.synthoil-ai-auth-card--login .synthoil-ai-alt-btn:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #111827;
}

.synthoil-ai-auth-card--login .synthoil-ai-alt-btn--wa {
    border-color: rgba(37, 211, 102, 0.45);
    color: #059669;
    background: #f0fdf4;
}

.synthoil-ai-auth-card--login .synthoil-ai-auth-error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.synthoil-ai-google-wrap {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    width: 100%;
}

.synthoil-ai-google-wrap > div,
.synthoil-ai-google-wrap iframe {
    margin: 0 auto !important;
}

.synthoil-ai-google-skeleton {
    width: min(100%, 320px);
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: sai-skeleton 1.2s ease-in-out infinite;
}

@keyframes sai-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.synthoil-ai-google-fallback-btn {
    width: min(100%, 320px);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.65rem 1.25rem;
    border: 1px solid #dadce0;
    border-radius: 999px;
    background: #fff;
    color: #3c4043;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: 'Segoe UI', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.synthoil-ai-google-fallback-btn:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}

.synthoil-ai-google-fallback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.synthoil-ai-auth-loading[hidden],
.synthoil-ai-auth-error[hidden],
.synthoil-ai-auth-fallback[hidden] {
    display: none !important;
}

.synthoil-ai-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #2563eb;
    margin: 0.5rem 0;
}

.synthoil-ai-auth-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sai-gold);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    margin-bottom: 1rem;
}

.synthoil-ai-auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sai-gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.synthoil-ai-auth h4 {
    margin: 0 0 0.5rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.synthoil-ai-auth-desc {
    margin: 0 0 1rem !important;
    color: var(--sai-muted) !important;
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
    max-width: none !important;
}

.synthoil-ai-auth-benefits {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    text-align: left;
}

.synthoil-ai-auth-benefits li {
    position: relative;
    padding: 0.35rem 0 0.35rem 1.4rem;
    font-size: 0.78rem;
    color: #d1d5db;
    line-height: 1.4;
}

.synthoil-ai-auth-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--sai-gold);
    font-weight: 700;
}

.synthoil-ai-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
    color: #6b7280;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.synthoil-ai-auth-divider::before,
.synthoil-ai-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.synthoil-ai-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--sai-gold);
    margin: 0.5rem 0;
}

.synthoil-ai-auth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(212, 175, 55, 0.25);
    border-top-color: var(--sai-gold);
    border-radius: 50%;
    animation: sai-spin 0.7s linear infinite;
}

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

.synthoil-ai-auth-fallback {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.synthoil-ai-auth-fallback p {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    color: var(--sai-muted);
}

.synthoil-ai-auth-fallback-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.synthoil-ai-alt-btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--sai-text);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.15s, background 0.15s;
}

.synthoil-ai-alt-btn:hover {
    border-color: var(--sai-gold);
    background: rgba(212, 175, 55, 0.08);
    color: var(--sai-gold);
}

.synthoil-ai-alt-btn--wa {
    border-color: rgba(37, 211, 102, 0.35);
    color: #86efac;
}

.synthoil-ai-alt-btn--wa:hover {
    border-color: #25d366;
    background: rgba(37, 211, 102, 0.1);
    color: #86efac;
}

.synthoil-ai-setup-notice {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    text-align: center;
}

.synthoil-ai-setup-notice strong {
    display: block;
    color: var(--sai-gold);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.synthoil-ai-setup-notice span {
    color: var(--sai-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.synthoil-ai-auth-error {
    color: #fca5a5;
    background: rgba(185, 28, 28, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.78rem;
    max-width: 100%;
    line-height: 1.45;
    margin-top: 0.75rem;
}

.synthoil-ai-auth-note {
    font-size: 0.65rem !important;
    color: #6b7280 !important;
    line-height: 1.45 !important;
    margin-top: 1rem !important;
    max-width: none !important;
}

.synthoil-ai-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.synthoil-ai-user-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.7rem;
    color: var(--sai-muted);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.synthoil-ai-user-meta {
    flex: 1;
    min-width: 0;
}

.synthoil-ai-phone-bar {
    padding: 0.4rem 12px 0.5rem;
    background: rgba(212, 175, 55, 0.06);
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    flex-shrink: 0;
}

.synthoil-ai-phone-label {
    display: block;
    font-size: 0.65rem;
    color: var(--sai-gold);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.synthoil-ai-phone-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.synthoil-ai-phone-input {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(0, 0, 0, 0.22);
    color: var(--sai-text);
    font-size: 0.75rem;
}

.synthoil-ai-phone-input:focus {
    outline: none;
    border-color: var(--sai-gold);
}

.synthoil-ai-phone-hint {
    font-size: 0.62rem;
    color: var(--sai-muted);
    white-space: nowrap;
}

.synthoil-ai-user-bar img {
    border-radius: 50%;
    object-fit: cover;
}

.synthoil-ai-user-bar strong {
    color: var(--sai-text);
}

.synthoil-ai-logout {
    margin-left: auto;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.12rem 0.45rem;
    font-size: 0.65rem;
    color: var(--sai-muted);
    cursor: pointer;
}

.synthoil-ai-logout:hover {
    color: var(--sai-gold);
    border-color: var(--sai-gold);
}

.synthoil-ai-msg.error {
    align-self: center;
    background: rgba(185, 28, 28, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.25);
    font-size: 0.75rem;
    max-width: 95%;
    text-align: center;
}

body.synthoil-ai-open {
    overflow: hidden;
}

/* Modo página dedicada (consultor-ia.html) */
.synthoil-ai-widget--embed {
    position: relative;
    bottom: auto;
    left: auto;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    z-index: 1;
}

.synthoil-ai-widget--embed .synthoil-ai-backdrop {
    display: none !important;
}

.synthoil-ai-widget--embed .synthoil-ai-panel {
    position: relative;
    bottom: auto;
    left: auto;
    width: 100%;
    height: min(680px, 72vh);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

.synthoil-ai-widget--embed.is-panel-open .synthoil-ai-panel {
    transform: none;
}

.ai-page-container {
    padding: 2rem 1rem 4rem;
    background: #f4f6f9;
}

.ai-page-container .container {
    max-width: 960px;
    margin: 0 auto;
}

/* Tablet e mobile */
@media (max-width: 768px) {
    .synthoil-ai-widget {
        bottom: 24px;
        left: 16px;
        right: auto;
    }

    .synthoil-ai-toggle {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.78rem;
    }

    .synthoil-ai-toggle-ia {
        font-size: 0.88rem;
    }

    .synthoil-ai-widget.is-panel-open {
        inset: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10000;
    }

    .synthoil-ai-widget.is-panel-open .synthoil-ai-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .synthoil-ai-widget.is-panel-open .synthoil-ai-toggle {
        display: none;
    }

    .synthoil-ai-widget.is-panel-open .synthoil-ai-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        bottom: auto;
        right: auto;
        border-radius: 0;
        border: none;
        transform: none;
        box-shadow: none;
    }

    .synthoil-ai-widget.is-panel-open .synthoil-ai-panel.is-open {
        transform: none;
    }

    .synthoil-ai-header {
        padding: 12px 14px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .synthoil-ai-header h3 {
        font-size: 1rem;
    }

    .synthoil-ai-maximize {
        display: none;
    }

    .synthoil-ai-agents {
        padding: 8px 12px;
    }

    .synthoil-ai-messages {
        padding: 12px;
    }

    .synthoil-ai-msg {
        font-size: 0.9rem;
        max-width: 90%;
    }

    .synthoil-ai-msg.ai {
        max-width: 94%;
    }
}

/* Telas muito estreitas */
@media (max-width: 380px) {
    .synthoil-ai-widget:not(.is-panel-open) {
        left: 12px;
        bottom: 20px;
    }

    .synthoil-ai-agent-btn {
        font-size: 0.68rem;
        padding: 7px 10px;
    }
}

/* Desktop: painel flutuante compacto */
@media (min-width: 769px) {
    .synthoil-ai-panel {
        width: min(400px, calc(100vw - 48px));
        height: min(560px, calc(100vh - 160px));
    }

    /* Tela cheia no desktop */
    .synthoil-ai-widget.is-maximized {
        inset: 0;
        bottom: 0;
        left: 0;
        right: 0;
        top: 0;
        z-index: 10000;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-toggle {
        display: none;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        bottom: auto;
        right: auto;
        border-radius: 0;
        border: none;
        transform: none;
        box-shadow: none;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-panel.is-open {
        transform: none;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-messages {
        padding: 16px 20px;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-msg {
        font-size: 0.92rem;
        max-width: 85%;
    }

    .synthoil-ai-widget.is-maximized .synthoil-ai-msg.ai {
        max-width: 88%;
    }
}

/* Cota excedida / bloqueio administrativo */
.synthoil-ai-widget.sai-is-quota-blocked .synthoil-ai-input-area {
    opacity: 0.72;
    background: #fef2f2;
    border-top-color: rgba(185, 28, 28, 0.15);
}

.synthoil-ai-widget.sai-is-quota-blocked #sai-input {
    background: #fff;
    cursor: not-allowed;
}

.synthoil-ai-widget.sai-is-quota-blocked #sai-send {
    opacity: 0.45;
    cursor: not-allowed;
}
