/* SunHomeKey AI Chatbot - Frontend Styles */

#sunhomekey-ai-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* =====================================================
   IKONA CZATU
   ===================================================== */
.sunhomekey-ai-chat-icon {
    width: 60px;
    height: 60px;
    background: #002349;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 35, 73, 0.3);
    transition: all 0.3s ease;
    color: white;
}

.sunhomekey-ai-chat-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 35, 73, 0.4);
    background: #002349;
}

.sunhomekey-ai-chat-icon svg {
    width: 28px;
    height: 28px;
}

/* =====================================================
   OKNO CZATU – pełny ekran, flex kolumna
   ===================================================== */
.sunhomekey-ai-chat-window {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh; /* fallback */
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
    animation: slideUp 0.3s ease;
    z-index: 99999;
    box-sizing: border-box;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   NAGŁÓWEK
   ===================================================== */
.sunhomekey-ai-chat-header {
    background: #1e3a8a;
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    z-index: 10;
}

.sunhomekey-ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.sunhomekey-ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.sunhomekey-ai-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* =====================================================
   ZAKŁADKI MOBILNE (ukryte na desktop)
   ===================================================== */
.sunhomekey-ai-mobile-tabs {
    display: none;
    background: #fff;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.sunhomekey-ai-tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.2s, border-color 0.2s;
}

.sunhomekey-ai-tab-btn.active {
    color: #1e3a8a;
    border-bottom-color: #1e3a8a;
}

.sunhomekey-ai-tab-counter {
    background: #1e3a8a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.6;
}

/* =====================================================
   CIAŁO – dwa panele obok siebie
   ===================================================== */
.sunhomekey-ai-chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    overflow-x: hidden;
    min-height: 0;
}

/* =====================================================
   LEWA – rozmowa (dokładnie 50%)
   ===================================================== */
.sunhomekey-ai-chat-left {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e5e7eb;
    background: #fff;
    overflow: hidden;
    overflow-x: hidden;
}

/* Wiadomości */
.sunhomekey-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sunhomekey-ai-message {
    display: flex;
    animation: fadeIn 0.3s ease;
    gap: 8px;
    align-items: flex-start;
}

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

.sunhomekey-ai-message-user { justify-content: flex-end; }
.sunhomekey-ai-message-bot  { justify-content: flex-start; }

.sunhomekey-ai-message-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sunhomekey-ai-message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sunhomekey-ai-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sunhomekey-ai-message-content {
    padding: 10px 14px;
    border-radius: 8px;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.55;
    font-size: 13.5px;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.sunhomekey-ai-message-user .sunhomekey-ai-message-content {
    background: #1e3a8a;
    color: white;
    border-bottom-right-radius: 3px;
    margin-left: auto;
}

.sunhomekey-ai-message-bot .sunhomekey-ai-message-content {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Animacja "Myślę..." */
.sunhomekey-ai-thinking {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.sunhomekey-ai-thinking-text {
    color: #1e3a8a;
    font-size: 13px;
    font-style: italic;
}

.sunhomekey-ai-thinking-dot {
    width: 7px;
    height: 7px;
    background: #1e3a8a;
    border-radius: 50%;
    animation: thinkingDot 1.4s infinite;
}

.sunhomekey-ai-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.sunhomekey-ai-thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkingDot {
    0%, 60%, 100% { transform: translateY(0);     opacity: 0.7; }
    30%            { transform: translateY(-8px); opacity: 1;   }
}

/* CTA telefon – spójny z .sunhomekey-ai-chat-input-container */
.sunhomekey-ai-chat-phone-cta {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.sunhomekey-ai-chat-phone-cta-title {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #1e3a8a;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

.sunhomekey-ai-phone-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    box-sizing: border-box;
}

.sunhomekey-ai-phone-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.sunhomekey-ai-phone-code {
    flex: 0 0 76px;
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13.5px;
    background: #fff;
    outline: none;
    color: #1f2937;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-image: none;
    padding-right: 8px;
}

.sunhomekey-ai-phone-number {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13.5px;
    outline: none;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
    box-sizing: border-box;
}

.sunhomekey-ai-phone-code:focus,
.sunhomekey-ai-phone-number:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30,58,138,0.08);
}

.sunhomekey-ai-phone-submit {
    width: 100%;
    min-height: 40px;
    padding: 10px 16px;
    background: #1e3a8a;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    font-family: inherit;
}

.sunhomekey-ai-phone-submit:hover:not(:disabled) {
    background: #1e40af;
}

.sunhomekey-ai-phone-submit:active:not(:disabled) {
    transform: translateY(0);
}

.sunhomekey-ai-phone-submit:disabled,
.sunhomekey-ai-phone-submit.is-loading {
    opacity: 0.75;
    cursor: wait;
}

.sunhomekey-ai-phone-error {
    font-size: 12px;
    color: #b91c1c;
    font-weight: 500;
    text-align: center;
    margin-top: 4px;
}

.sunhomekey-ai-phone-success {
    font-size: 13px;
    color: #047857;
    font-weight: 600;
    text-align: center;
    padding: 10px 12px;
    background: #ecfdf5;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
    line-height: 1.45;
}

/* Pole input */
.sunhomekey-ai-chat-input-container {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

.sunhomekey-ai-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

/* Migający kursor (pusty input) */
.sunhomekey-ai-blink-caret {
    position: absolute;
    left: 26px;               /* padding kontenera + padding inputu */
    bottom: 50%;
    transform: translateY(50%);
    color: rgba(17, 24, 39, 0.55);
    font-weight: 600;
    pointer-events: none;
    user-select: none;
    display: none;
    animation: shkBlinkCaret 1s steps(1, end) infinite;
}

.sunhomekey-ai-chat-input:placeholder-shown:not(:focus) + .sunhomekey-ai-blink-caret {
    display: inline-block;
}

@keyframes shkBlinkCaret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.sunhomekey-ai-chat-input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30,58,138,0.08);
}

.sunhomekey-ai-send-btn {
    width: 40px;
    height: 40px;
    background: #1e3a8a;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.sunhomekey-ai-send-btn:hover  { background: #1e40af; transform: translateY(-1px); }
.sunhomekey-ai-send-btn:active { transform: translateY(0); }
.sunhomekey-ai-send-btn svg    { width: 18px; height: 18px; }

/* =====================================================
   PRAWA – pełna strona ofert (dokładnie 50%)
   ===================================================== */
.sunhomekey-ai-chat-right {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

/* Aktywne filtry (zachowane dla JS) */
.sunhomekey-ai-active-filters { display: none; }
.sunhomekey-ai-offers-counter  { display: none; }

/* Prawy panel – body bez nagłówka, iframe wypełnia całość */
.sunhomekey-ai-offers-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Seamless iframe – wypełnia cały prawy panel, własny scroll */
.sunhomekey-ai-houzez-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
}

/* =====================================================
   KARTY NIERUCHOMOŚCI
   ===================================================== */
.sunhomekey-ai-property-card {
    display: block;
    border-radius: 10px;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
    overflow: hidden;
}

.sunhomekey-ai-property-card:hover {
    transform: translateY(-3px);
    border-color: #1e3a8a;
    box-shadow: 0 8px 20px rgba(30,58,138,0.13);
    text-decoration: none;
    color: inherit;
}

.sunhomekey-ai-property-image {
    width: 100%;
    height: 160px;
    background-color: #f3f4f6;
    position: relative;
    overflow: hidden;
    display: block;
}

.sunhomekey-ai-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sunhomekey-ai-property-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #9ca3af;
}

.sunhomekey-ai-property-placeholder svg {
    width: 40px;
    height: 40px;
}

.sunhomekey-ai-property-content {
    padding: 12px;
}

.sunhomekey-ai-property-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sunhomekey-ai-property-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #6b7280;
}

.sunhomekey-ai-property-details span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.sunhomekey-ai-property-details svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: #9ca3af;
}

.sunhomekey-ai-property-address,
.sunhomekey-ai-property-bedrooms,
.sunhomekey-ai-property-bathrooms {
    white-space: nowrap;
}

.sunhomekey-ai-property-price {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a8a;
    margin-top: 6px;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
.sunhomekey-ai-chat-messages::-webkit-scrollbar { width: 5px; }
.sunhomekey-ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.sunhomekey-ai-chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.sunhomekey-ai-chat-messages::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Podział 50/50 obowiązuje na wszystkich ekranach desktop/tablet */

/* =====================================================
   RESPONSYWNOŚĆ – mobile (< 768px)
   Układ pionowy z zakładkami
   ===================================================== */
@media (max-width: 768px) {
    .sunhomekey-ai-mobile-tabs {
        display: flex;
    }

    .sunhomekey-ai-chat-window {
        overflow: hidden !important;
    }

    .sunhomekey-ai-chat-body {
        flex-direction: column;
        overflow: hidden !important;
    }

    .sunhomekey-ai-chat-left,
    .sunhomekey-ai-chat-right {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        flex-shrink: 0;
        border-right: none;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    .sunhomekey-ai-chat-left  { flex: 1; display: flex; }
    .sunhomekey-ai-chat-right { flex: 1; display: none; }

    .sunhomekey-ai-chat-left.active  { display: flex !important; }
    .sunhomekey-ai-chat-right.active { display: flex !important; }

    .sunhomekey-ai-offers-panel-body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    .sunhomekey-ai-houzez-frame {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .sunhomekey-ai-chat-messages {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    .sunhomekey-ai-message-content {
        max-width: calc(100% - 50px) !important;
    }

    .sunhomekey-ai-offers-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sunhomekey-ai-property-image {
        height: 130px;
    }
}

@media (max-width: 480px) {
    .sunhomekey-ai-offers-grid {
        grid-template-columns: 1fr;
    }

    .sunhomekey-ai-chat-icon {
        width: 50px;
        height: 50px;
    }
}

/* =====================================================
   PANEL OFERT W IFRAME (shortcode [sunhomekey_ai_offers])
   ===================================================== */
.sunhomekey-ai-offers-embed {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 600px;
    position: relative;
    background: #fff;
    box-sizing: border-box;
}

/* Elementor: wymuś pełną wysokość na kontenerach nadrzędnych panelu ofert */
.elementor-widget-container:has(.sunhomekey-ai-offers-embed),
.elementor-widget:has(.sunhomekey-ai-offers-embed),
.elementor-column:has(.sunhomekey-ai-offers-embed),
.elementor-column-wrap:has(.sunhomekey-ai-offers-embed),
.elementor-widget-wrap:has(.sunhomekey-ai-offers-embed),
.elementor-element:has(.sunhomekey-ai-offers-embed),
.elementor-section:has(.sunhomekey-ai-offers-embed),
.elementor-container:has(.sunhomekey-ai-offers-embed),
.e-con:has(.sunhomekey-ai-offers-embed),
.e-con-inner:has(.sunhomekey-ai-offers-embed) {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
}

.sunhomekey-ai-offers-embed .sunhomekey-ai-houzez-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* =====================================================
   TRYB OSADZONY (fullpage shortcode – sam chatbot)
   ===================================================== */
.sunhomekey-ai-embedded {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    overflow: hidden;
    max-width: 100%;
    background: #fff;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
    /* JS ustawi dokładną wysokość przez --shk-height */
    height: var(--shk-height, 100vh);
    /* iOS Safari: ogranicz automatyczne dostosowanie rozmiaru tekstu */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* =====================================================
   TRYB OSADZONY: ukryj tytuł strony i elementorowe menu,
   ale TYLKO na stronach gdzie jest nasz chatbot.
   ===================================================== */
body:has(.sunhomekey-ai-embedded) .page-title {
    display: none !important;
}

/* Elementor: ukryj .e-con-inner poza kontenerem chatbota */
body:has(.sunhomekey-ai-embedded) .e-con-inner:not(:has(.sunhomekey-ai-embedded)) {
    display: none !important;
}

/* iOS Safari often zooms inputs with font-size < 16px */
.sunhomekey-ai-embedded .sunhomekey-ai-chat-input,
.sunhomekey-ai-embedded .sunhomekey-ai-phone-code,
.sunhomekey-ai-embedded .sunhomekey-ai-phone-number {
    font-size: 16px !important;
}

.sunhomekey-ai-embedded input,
.sunhomekey-ai-embedded select,
.sunhomekey-ai-embedded textarea,
.sunhomekey-ai-embedded button {
    font-size: 16px !important;
}

.sunhomekey-ai-embedded input,
.sunhomekey-ai-embedded select,
.sunhomekey-ai-embedded textarea {
    line-height: 1.2;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.sunhomekey-ai-embedded .sunhomekey-ai-chat-input-container,
.sunhomekey-ai-embedded .sunhomekey-ai-chat-phone-cta,
.sunhomekey-ai-embedded .sunhomekey-ai-chat-messages {
    overflow-x: hidden;
}

.sunhomekey-ai-embedded .sunhomekey-ai-chat-input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.sunhomekey-ai-embedded .sunhomekey-ai-phone-row {
    width: 100%;
    min-width: 0;
}

.sunhomekey-ai-embedded .sunhomekey-ai-embedded-header {
    background: #1e3a8a;
    color: white;
    padding: 14px 20px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sunhomekey-ai-embedded .sunhomekey-ai-embedded-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.sunhomekey-ai-embedded-close {
    color: white;
    text-decoration: none;
    font-size: 28px;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.sunhomekey-ai-embedded-close:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
}

.sunhomekey-ai-embedded .sunhomekey-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.sunhomekey-ai-embedded .sunhomekey-ai-chat-input-container,
.sunhomekey-ai-embedded .sunhomekey-ai-chat-phone-cta,
.sunhomekey-ai-embedded .sunhomekey-ai-thinking {
    flex-shrink: 0;
}

/* Telefon + input – flex-shrink: 0 trzyma je na dole,
   wiadomości (flex:1 + overflow-y:auto) zajmują resztę */
.sunhomekey-ai-embedded .sunhomekey-ai-chat-phone-cta {
    flex-shrink: 0;
    background: #fff;
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
}

.sunhomekey-ai-embedded .sunhomekey-ai-chat-input-container {
    flex-shrink: 0;
    background: #fff;
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
}

/* =====================================================
   ZAKŁADKI MOBILNE – tryb embedded (ukryte na desktop)
   ===================================================== */
.sunhomekey-ai-embed-tabs {
    display: none;
}

@media (max-width: 768px) {
    .sunhomekey-ai-embedded {
        border-radius: 0;
        border: none;
        height: auto;
        min-height: 0;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .sunhomekey-ai-embedded .sunhomekey-ai-chat-messages {
        flex: 1;
        min-height: 0;
        overflow: visible;
        /* Miejsce na sticky kontener na dole */
        padding-bottom: 130px;
    }

    /* Telefon + input fixed na dole ekranu */
    .sunhomekey-ai-embedded .sunhomekey-ai-chat-phone-cta,
    .sunhomekey-ai-embedded .sunhomekey-ai-chat-input-container {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 99 !important;
        background: #fff !important;
        margin: 0 !important;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08) !important;
    }

    .sunhomekey-ai-embedded .sunhomekey-ai-chat-phone-cta {
        bottom: 56px !important;
        padding: 10px 12px !important;
        border-top: 1px solid #e5e7eb !important;
    }

    .sunhomekey-ai-embedded .sunhomekey-ai-chat-input-container {
        bottom: 0 !important;
        padding: 8px 12px !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Pasek zakładek */
    .sunhomekey-ai-embed-tabs {
        display: flex !important;
        flex-direction: row !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        background: #eef1f6 !important;
        padding: 4px !important;
        border-radius: 14px !important;
        margin: 10px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .sunhomekey-ai-embed-tabs button.sunhomekey-ai-embed-tab {
        flex: 1 1 0% !important;
        width: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 12px 0 !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 11px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        background: transparent !important;
        color: #64748b !important;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s !important;
        line-height: 1.2 !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        outline: none !important;
        box-shadow: none !important;
        min-height: 44px !important;
    }

    .sunhomekey-ai-embed-tabs button.sunhomekey-ai-embed-tab.active {
        background: #fff !important;
        color: #1e3a8a !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12) !important;
    }

    .sunhomekey-ai-embed-tabs button.sunhomekey-ai-embed-tab:not(.active):active {
        background: rgba(255,255,255,0.5) !important;
    }

    .sunhomekey-ai-embed-tabs button.sunhomekey-ai-embed-tab svg {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0 !important;
    }

    /* Ukryj oryginalne taby Elementora */
    .sunhomekey-ai-has-tabs .e-n-tabs-heading,
    .sunhomekey-ai-has-tabs .elementor-tabs-wrapper,
    .sunhomekey-ai-has-tabs > .elementor-widget-container > .e-n-tabs > .e-n-tabs-heading {
        display: none !important;
    }

    /* Oferty ukryte – visibility zamiast display:none,
       żeby przeglądarka załadowała obrazki i Slick policzył wymiary */
    .sunhomekey-ai-panel-offers {
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        width: 100% !important;
        pointer-events: none !important;
    }
    .sunhomekey-ai-panel-offers.sunhomekey-ai-panel-active {
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        pointer-events: auto !important;
    }
}

/* =====================================================
   INTRO SHORTCODE BOX
   ===================================================== */
.sunhomekey-ai-intro-box {
    position: relative;
    margin: 30px 0;
    padding: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(229,231,235,0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.sunhomekey-ai-intro-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.sunhomekey-ai-intro-left {
    flex: 1;
    min-width: 0;
}

.sunhomekey-ai-intro-right {
    flex: 0 0 auto;
    width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sunhomekey-ai-agent-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.sunhomekey-ai-intro-title {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.3;
    color: #ffffff;
    font-weight: 600;
}

.sunhomekey-ai-intro-subtitle {
    margin: 0 0 28px;
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    font-weight: 400;
}

.sunhomekey-ai-intro-input-wrapper { margin-bottom: 0; }

.sunhomekey-ai-intro-input-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: nowrap;
    box-sizing: border-box;
    width: 100%;
    position: relative;
}

.sunhomekey-ai-intro-input-field {
    flex: 1;
    min-height: 52px;
    border-radius: 8px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(229,231,235,0.9);
    font-size: 15px;
    color: #111827;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    box-sizing: border-box;
    width: 100%;
}

.sunhomekey-ai-intro-input-field:placeholder-shown:not(:focus) + .sunhomekey-ai-blink-caret--intro {
    display: inline-block;
}

.sunhomekey-ai-blink-caret--intro {
    left: 18px;
    color: rgba(17, 24, 39, 0.45);
}

.sunhomekey-ai-intro-input-field:focus {
    border-color: #1e3a8a;
    background: rgba(255,255,255,1);
    box-shadow: 0 0 0 3px rgba(30,58,138,0.1);
}

.sunhomekey-ai-intro-input-field::placeholder {
    color: #8a94a6;
    opacity: 1;
}

.sunhomekey-ai-intro-ask-btn {
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 52px;
    border-radius: 8px;
    padding: 14px 28px;
    background: #002349;
    border: none;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-family: inherit;
}

.sunhomekey-ai-intro-ask-btn:hover  { background: #002349; transform: translateY(-1px); }
.sunhomekey-ai-intro-ask-btn:active { transform: translateY(0); background: #002349; }

.sunhomekey-ai-intro-examples {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #ffffff;
    flex-wrap: wrap;
}

.sunhomekey-ai-intro-examples-label {
    font-weight: 500;
    color: #ffffff;
    flex-shrink: 0;
}

.sunhomekey-ai-intro-examples-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sunhomekey-ai-intro-example-item {
    color: #ffffff;
    font-style: italic;
    transition: color 0.3s ease;
    opacity: 0.6;
}

.sunhomekey-ai-intro-example-item.active {
    color: #ffffff;
    opacity: 1;
    font-weight: 500;
}

@media (max-width: 968px) {
    .sunhomekey-ai-intro-content { flex-direction: column; gap: 24px; }
    .sunhomekey-ai-intro-right   { width: 100%; max-width: 300px; }
    .sunhomekey-ai-intro-title   { font-size: 24px; }
    .sunhomekey-ai-intro-subtitle { font-size: 15px; }
}

@media (max-width: 768px) {
    .sunhomekey-ai-intro-box { padding: 20px 16px 16px; margin: 16px 0 24px; border-radius: 12px; width: 100%; box-sizing: border-box; }
    .sunhomekey-ai-intro-title { font-size: 18px; line-height: 1.35; }
    .sunhomekey-ai-intro-subtitle { font-size: 13px; margin-bottom: 14px; }
    .sunhomekey-ai-intro-input-container { flex-direction: column; gap: 10px; width: 100%; box-sizing: border-box; }
    .sunhomekey-ai-intro-input-field { min-height: 46px; padding: 12px 14px; font-size: 14px; width: 100%; box-sizing: border-box; }
    .sunhomekey-ai-intro-ask-btn { width: 100%; min-height: 46px; padding: 12px 18px; font-size: 14px; box-sizing: border-box; }
}