:root {
    --n8n-chat-accent: #128c7e;
    --n8n-chat-accent-2: #0e7268;
    --n8n-chat-accent-soft: #e8f6f2;
    --n8n-chat-accent-soft-2: #dff3ee;
    --n8n-chat-bg: #ece5dd;
    --n8n-chat-panel: #ffffff;
    --n8n-chat-panel-soft: #f7faf9;
    --n8n-chat-text: #18222f;
    --n8n-chat-muted: #667085;
    --n8n-chat-border: rgba(18, 140, 126, 0.18);
    --n8n-chat-shadow:
        0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    --n8n-chat-radius: 18px;
    --acu-widget-top-offset: 72px;
    --acu-widget-gap: 12px;
    --acu-safe-top: env(safe-area-inset-top, 0px);
    --acu-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── LAUNCHER ─────────────────────────────────────────────────── */
.n8n-chat-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25d366 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    z-index: 9998;
    transition:
        transform 0.22s ease,
        opacity 0.22s ease;
}
.n8n-chat-launcher:hover {
    transform: scale(1.06);
}
.n8n-chat-launcher img {
    width: 30px;
    height: 30px;
    filter: invert(1);
}
.n8n-chat-launcher--hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.n8n-chat-launcher::before,
.n8n-chat-launcher::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25d366;
    z-index: -1;
    opacity: 0;
    animation: launcherPulse 2.4s infinite;
}
.n8n-chat-launcher::after {
    animation-delay: 0.45s;
}

.n8n-chat-launcher-ring3 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25d366;
    z-index: -1;
    opacity: 0;
    animation: launcherPulse 2.4s infinite 0.9s;
}

@keyframes launcherPulse {
    0% {
        transform: scale(0.86);
        opacity: 0;
    }
    22% {
        opacity: 0.34;
    }
    100% {
        transform: scale(2.15);
        opacity: 0;
    }
}

/* ── OVERLAY ──────────────────────────────────────────────────── */
.n8n-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.24s ease,
        visibility 0.24s ease;
    z-index: 9997;
}
.n8n-chat-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* ── WIDGET ───────────────────────────────────────────────────── */
.n8n-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 390px;
    max-width: calc(100vw - 24px);
    height: min(580px, calc(100vh - 40px));
    border-radius: 22px;
    background: var(--n8n-chat-panel);
    box-shadow: var(--n8n-chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(22px) scale(0.97);
    transition:
        transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
        opacity 0.24s ease,
        visibility 0.24s ease;
    z-index: 9999;
    font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--n8n-chat-text);
}

.n8n-chat-widget--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.n8n-chat-widget--fullscreen {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
}

.n8n-chat-widget--gallery-open .n8n-chat-quick-btns,
.n8n-chat-widget--gallery-open .n8n-chat-input-area {
    pointer-events: none;
    opacity: 0.45;
    filter: blur(1px);
}

/* ── HEADER ───────────────────────────────────────────────────── */
.n8n-chat-header {
    padding: 12px 14px;
    background: var(--n8n-chat-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.n8n-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.n8n-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}
.n8n-chat-avatar svg {
    width: 30px;
    height: 30px;
}

.n8n-chat-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.n8n-chat-header-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.n8n-chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.95;
    margin-top: 2px;
}

.n8n-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5cf08d;
    box-shadow: 0 0 6px #5cf08d;
    animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.n8n-chat-header-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── HEADER BTN TOOLTIPS ──────────────────────────────────────── */
.n8n-chat-clear-btn,
.n8n-chat-close-btn {
    position: relative;
}
.n8n-chat-clear-btn::after,
.n8n-chat-close-btn::after {
    content: attr(title);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(12, 18, 30, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 20;
}

.n8n-chat-clear-btn:hover::after,
.n8n-chat-close-btn:hover::after {
    opacity: 1;
}

/* Botón de contacto — visualmente diferenciado de los tipos guiados */
.n8n-chat-quick-btn--contact {
    background: #f3f4f6;
    color: #374151;
    border-color: rgba(75, 85, 99, 0.22);
    font-weight: 600;
}
.n8n-chat-quick-btn--contact:hover {
    background: #e5e7eb;
    color: #111827;
    border-color: rgba(75, 85, 99, 0.42);
    box-shadow: 0 5px 14px rgba(75, 85, 99, 0.12);
}
.n8n-chat-close-btn {
    width: clamp(30px, 5vw, 36px);
    height: clamp(30px, 5vw, 36px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(15px, 2.5vw, 19px);
    flex-shrink: 0;
    transition:
        color 0.14s ease,
        background-color 0.14s ease,
        border-color 0.14s ease;
}
.n8n-chat-close-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.n8n-chat-clear-btn {
    width: clamp(30px, 5vw, 36px);
    height: clamp(30px, 5vw, 36px);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 2.5vw, 18px);
    flex-shrink: 0;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease;
}
.n8n-chat-clear-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
}

@keyframes btnBreath {
    from {
        animation-timing-function: ease-out;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
    }
    to {
        transform: scale(1.18);
        box-shadow: 0 0 0 9px rgba(255, 255, 255, 0);
        animation-timing-function: ease-in-out;
    }
}
.n8n-chat-clear-btn--pulse {
    animation: btnBreath 1.6s ease-in-out 0.5s 3 alternate;
}

/* ── MESSAGES ─────────────────────────────────────────────────── */
.n8n-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--n8n-chat-bg);
    padding: 14px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.n8n-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.n8n-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(18, 140, 126, 0.25);
    border-radius: 99px;
}
.n8n-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* ── BUBBLES ──────────────────────────────────────────────────── */
.n8n-chat-bubble {
    max-width: 84%;
    padding: 11px 14px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 15px;
    white-space: pre-line;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.n8n-chat-user-message {
    align-self: flex-end;
    background: #d9fdd3;
    color: #122016;
    border-bottom-right-radius: 5px;
}

.n8n-chat-ai-message {
    align-self: flex-start;
    background: #fff;
    color: var(--n8n-chat-text);
    border-bottom-left-radius: 5px;
}

.n8n-chat-ai-message a {
    color: #0b6f65;
    text-decoration: none;
    font-weight: 700;
    word-break: break-word;
}
.n8n-chat-ai-message a:hover {
    color: var(--n8n-chat-accent);
}

.n8n-chat-guided-emph {
    font-weight: 600;
}

.n8n-chat-guided-option-text {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Variantes de estado */
.n8n-chat-ai-message--guided {
    background: #f8fffd;
    border: 1px solid rgba(18, 140, 126, 0.18);
}

.n8n-chat-ai-message--clarification {
    background: #fff8ea;
    border: 1px solid rgba(226, 160, 43, 0.32);
    box-shadow: 0 1px 3px rgba(226, 160, 43, 0.12);
}

.n8n-chat-ai-message--guardrail {
    background: #f5f7fb;
    border: 1px solid rgba(86, 104, 140, 0.18);
    color: #243246;
}

.n8n-chat-ai-message--empty {
    background: #f7fbfa;
    border: 1px solid rgba(18, 140, 126, 0.16);
}

.n8n-chat-ai-message--lead-confirmation {
    position: relative;
    padding-left: 48px;
    background: linear-gradient(180deg, #ecfdf3 0%, #f7fff9 100%);
    border: 1px solid #bbf7d0;
    color: #14532d;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.08);
}

.n8n-chat-ai-message--lead-confirmation::before {
    content: '✓';
    position: absolute;
    left: 16px;
    top: 14px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
}

.n8n-chat-ai-message--lead-confirmation a {
    color: #166534;
}

.n8n-chat-detail-bubble {
    border-left: 3px solid var(--n8n-chat-accent);
    border-bottom-left-radius: 5px;
}

.n8n-chat-detail-bubble.is-highlighted {
    animation: bubbleFlash 0.9s ease forwards;
}

@keyframes bubbleFlash {
    0% {
        background: #ffffff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }
    25% {
        background: #e9fbf6;
        box-shadow: 0 0 0 5px rgba(18, 140, 126, 0.2);
    }
    100% {
        background: #ffffff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }
}

/* ── QUICK AREA ───────────────────────────────────────────────── */
.n8n-chat-quick-btns {
    display: none;
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid #e7edef;
    padding: 10px 12px 10px;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.n8n-chat-quick-label {
    font-size: 12px;
    font-weight: 800;
    color: #3c5d58;
    margin-right: 2px;
}

.n8n-chat-option-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.n8n-chat-quick-btn {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid rgba(18, 140, 126, 0.22);
    background: var(--n8n-chat-accent-soft);
    color: var(--n8n-chat-accent-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition:
        background-color 0.14s ease,
        color 0.14s ease,
        border-color 0.14s ease,
        transform 0.1s ease,
        box-shadow 0.14s ease;
}

.n8n-chat-btn-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}
.n8n-chat-btn-icon svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.n8n-chat-quick-btn:hover {
    background: var(--n8n-chat-accent) !important;
    color: #fff;
    border-color: var(--n8n-chat-accent);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(18, 140, 126, 0.18);
}
.n8n-chat-quick-btn:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.n8n-chat-quick-btn--result {
    min-width: 40px;
    justify-content: center;
    padding-inline: 12px;
    background: #edf8f5;
}
.n8n-chat-quick-btn--result.is-active {
    background: var(--n8n-chat-accent);
    color: #fff;
    border-color: var(--n8n-chat-accent);
}
.n8n-chat-quick-btn--result.is-viewed:not(.is-active) {
    background: #dff3ee;
    color: var(--n8n-chat-accent);
}
.n8n-chat-quick-btn--ghost {
    background: #f6fbfa;
}

.n8n-chat-nav-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(18, 140, 126, 0.24);
    background: #eef8f6;
    color: var(--n8n-chat-accent);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.14s ease,
        color 0.14s ease,
        transform 0.1s ease;
}
.n8n-chat-nav-arrow:hover {
    background: var(--n8n-chat-accent);
    color: #fff;
}
.n8n-chat-nav-arrow:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.n8n-chat-quick-btn--new-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5faf9;
}

/* ── INLINE ACTIONS ───────────────────────────────────────────── */
.n8n-chat-inline-actions {
    align-self: flex-start;
    width: min(84%, 320px);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -2px;
}

.n8n-chat-inline-action {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    transition:
        transform 0.12s ease,
        box-shadow 0.14s ease,
        filter 0.14s ease;
}
.n8n-chat-inline-action:hover {
    transform: translateY(-1px);
}
.n8n-chat-inline-action:disabled {
    cursor: not-allowed;
    transform: none;
}

.n8n-chat-interest-btn {
    background: var(--n8n-chat-accent);
    color: #fff;
    box-shadow: 0 5px 14px rgba(18, 140, 126, 0.24);
}
.n8n-chat-interest-btn:hover {
    filter: brightness(1.06);
}

.n8n-chat-interest-btn.is-sent {
    background: #e8f7ee;
    color: #0e7268;
    box-shadow: none;
    border: 1.5px solid rgba(18, 140, 126, 0.28);
}

.n8n-chat-interest-btn.is-added {
    background: #eef8f6;
    color: #0e7268;
    box-shadow: none;
    border: 1.5px solid rgba(18, 140, 126, 0.24);
}

.n8n-chat-quick-btn--secondary {
    background: #f6fbfa;
    color: var(--n8n-chat-accent);
    border-color: rgba(18, 140, 126, 0.18);
}

/* Botón informativo — contador de seleccionadas, no clickeable */
.n8n-chat-quick-btn--info {
    background: rgba(18, 140, 126, 0.08);
    color: var(--n8n-chat-accent);
    border-color: rgba(18, 140, 126, 0.25);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
    letter-spacing: 0.01em;
}

/* Botón primario — Continuar → */
.n8n-chat-quick-btn--primary {
    background: var(--n8n-chat-accent);
    color: #fff;
    border-color: var(--n8n-chat-accent);
    font-weight: 600;
}
.n8n-chat-quick-btn--primary:hover {
    background: #0fa896;
    border-color: #0fa896;
}

/* Botón "Agregar todas" en el navigator */
.n8n-chat-quick-btn--select-all {
    background: #f0faf9;
    color: var(--n8n-chat-accent);
    border-color: rgba(18, 140, 126, 0.3);
    font-weight: 500;
}
.n8n-chat-quick-btn--select-all:hover {
    background: rgba(18, 140, 126, 0.12);
}

.n8n-chat-ai-message--notify-confirmation {
    position: relative;
    padding-left: 48px;
    background: linear-gradient(180deg, #eef8ff 0%, #f8fbff 100%);
    border: 1px solid #bfdcff;
    color: #17406d;
    box-shadow: 0 10px 24px rgba(23, 64, 109, 0.08);
}

.n8n-chat-ai-message--notify-confirmation::before {
    content: '🔔';
    position: absolute;
    left: 14px;
    top: 12px;
    font-size: 18px;
    line-height: 1;
}

/* ── MEDIA GALLERY ────────────────────────────────────────────── */
.n8n-chat-media-gallery {
    align-self: flex-start;
    width: min(84%, 320px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: -2px;
}

.n8n-chat-media-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(18, 140, 126, 0.12);
    background: #f2f4f7;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.n8n-chat-media-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(18, 140, 126, 0.18);
}
.n8n-chat-media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.n8n-chat-media-item--error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f8;
}
.n8n-chat-media-fallback {
    display: block;
    padding: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    line-height: 1.3;
}
.n8n-chat-media-more {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
}

/* ── GALLERY MODAL ────────────────────────────────────────────── */
.n8n-chat-gallery-modal {
    position: absolute;
    inset: 0;
    z-index: 10020;
    display: none;
}
.n8n-chat-gallery-modal.is-open {
    display: block;
}

.n8n-chat-gallery-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 12, 26, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.n8n-chat-gallery-dialog {
    position: absolute;
    inset: 10px;
    border-radius: 22px;
    background: rgba(8, 18, 38, 0.98);
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: 8px;
    align-items: center;
    padding: 12px 10px 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

.n8n-chat-gallery-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}

.n8n-chat-gallery-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    justify-self: center;
}

.n8n-chat-gallery-close:hover,
.n8n-chat-gallery-nav:hover {
    background: rgba(255, 255, 255, 0.24);
}

.n8n-chat-gallery-stage {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    justify-items: center;
}

.n8n-chat-gallery-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-height: 280px;
    object-fit: contain;
    display: block;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.n8n-chat-gallery-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}
.n8n-chat-gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
}
.n8n-chat-gallery-dot.is-active {
    background: #fff;
}

.n8n-chat-gallery-caption {
    color: #edf2f7;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
}
.n8n-chat-gallery-counter {
    color: #aeb7c2;
    font-size: 12px;
    font-weight: 600;
}

/* ── CONFIRM ──────────────────────────────────────────────────── */
.n8n-chat-confirm {
    align-self: flex-start;
    max-width: 84%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid rgba(18, 140, 126, 0.32);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.1);
}
.n8n-chat-confirm span {
    flex: 1;
    min-width: 120px;
    font-size: 13px;
}
.n8n-chat-confirm-yes,
.n8n-chat-confirm-no {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--n8n-chat-accent);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.n8n-chat-confirm-yes {
    background: var(--n8n-chat-accent);
    color: #fff;
}
.n8n-chat-confirm-no {
    background: #fff;
    color: var(--n8n-chat-accent);
}

/* ── INPUT ────────────────────────────────────────────────────── */
.n8n-chat-input-area {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 10px 12px calc(10px + var(--acu-safe-bottom));
    background: #f1f3f5;
    border-top: 1px solid #e2e8ea;
}

.n8n-chat-input-area input {
    flex: 1 1 auto;
    min-width: 0;
    border: 2px solid rgba(18, 140, 126, 0.18);
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 15px;
    background: #fff;
    outline: none;
    color: var(--n8n-chat-text);
}
.n8n-chat-input-area input:focus {
    border-color: rgba(18, 140, 126, 0.42);
    box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.12);
}
.n8n-chat-input-area input:disabled {
    background: #eef1f4;
    color: #98a2b3;
}

.n8n-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--n8n-chat-accent);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.25);
    transition:
        transform 0.12s ease,
        filter 0.14s ease;
}
.n8n-chat-send-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.06);
}
.n8n-chat-send-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}
.n8n-chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* ── TYPING ───────────────────────────────────────────────────── */
.n8n-chat-typing-indicator {
    padding: 12px 15px;
    min-width: 58px;
}
.n8n-chat-typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    border-radius: 50%;
    background: #98a2b3;
    animation: bounce 1.4s infinite ease-in-out both;
}
.n8n-chat-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}
.n8n-chat-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* ── TABLET / LAPTOP / DESKTOP ────────────────────────────────── */
@media (max-width: 1199px) {
    .n8n-chat-widget {
        right: 14px;
        bottom: 14px;
        width: 380px;
        height: min(720px, calc(100vh - 28px));
    }
}

@media (max-width: 768px) {
    .n8n-chat-widget {
        left: 10px;
        right: 10px;
        top: max(var(--acu-widget-top-offset), calc(var(--acu-safe-top) + 8px));
        bottom: 10px;
        width: auto;
        height: auto;
        max-width: none;
        border-radius: 22px;
    }

    .n8n-chat-launcher {
        right: 14px;
        bottom: 14px;
    }

    .n8n-chat-bubble {
        max-width: 90%;
        font-size: 14px;
    }
    .n8n-chat-media-gallery,
    .n8n-chat-inline-actions {
        width: 90%;
    }

    .n8n-chat-gallery-dialog {
        inset: 8px;
        grid-template-columns: 34px 1fr 34px;
        padding: 12px 8px 12px;
    }
    .n8n-chat-gallery-image {
        min-height: 240px;
    }

    .n8n-chat-quick-btns {
        padding: 10px 10px 10px;
        gap: 7px;
    }
}

@media (max-width: 480px) {
    .n8n-chat-widget {
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: max(var(--acu-widget-top-offset), calc(var(--acu-safe-top) + 6px));
        border-radius: 20px;
    }

    .n8n-chat-header {
        padding: 10px 12px;
    }

    .n8n-chat-header-name {
        font-size: 15px;
    }

    .n8n-chat-header-status {
        font-size: 11px;
    }

    .n8n-chat-messages {
        padding: 12px 10px 8px;
        gap: 8px;
    }

    .n8n-chat-bubble {
        max-width: 92%;
        font-size: 14px;
        padding: 10px 12px;
    }

    .n8n-chat-quick-btns {
        padding: 8px 10px 8px;
    }

    .n8n-chat-option-row {
        gap: 5px;
    }

    .n8n-chat-quick-btn {
        font-size: 12.5px;
        padding: 8px 12px;
        min-height: 34px;
    }

    .n8n-chat-nav-arrow {
        width: 32px;
        height: 32px;
    }

    .n8n-chat-inline-actions,
    .n8n-chat-media-gallery {
        width: 92%;
    }

    .n8n-chat-gallery-dialog {
        inset: 6px;
        border-radius: 18px;
        grid-template-columns: 32px 1fr 32px;
        padding: 10px 6px 10px;
    }

    .n8n-chat-gallery-close {
        top: 8px;
        right: 8px;
    }

    .n8n-chat-gallery-image {
        min-height: 220px;
    }

    .n8n-chat-input-area {
        padding: 8px 10px calc(8px + var(--acu-safe-bottom));
    }

    .n8n-chat-input-area input {
        font-size: 14px;
        padding: 11px 14px;
    }

    .n8n-chat-send-btn {
        width: 42px;
        height: 42px;
    }
}
