/* Chat AI Widget — Matrix Sentinel style */
.cai-chat {
    --m-green: #00ff41;
    --m-green-glow: #00ff41aa;
    --m-dark: #050505;
    --m-bg: #0a0a0f;
    font-family: 'Orbitron', sans-serif;
    box-sizing: border-box;
}

.cai-chat *,
.cai-chat *::before,
.cai-chat *::after {
    box-sizing: border-box;
}

/* Floating / inline positioning */
.cai-mode-floating {
    position: fixed;
    bottom: 24px;
    z-index: 9999;
}

.cai-pos-right {
    right: 0;
}

.cai-pos-left {
    left: 12px;
    right: auto;
    margin-left: 0;
}

/* Przy lewej pozycji zawartość (głowa + czat) przy lewej krawędzi */
.cai-pos-left .cai-bot-container {
    align-items: flex-start;
}

.cai-mode-inline {
    position: relative;
    z-index: 1;
}

.cai-mode-inline .cai-bot-container {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Tryb floating: kontener niewidoczny od pierwszego malowania, dopóki JS nie doda .cai-entrance-visible (brak migania przy odświeżeniu) */
.cai-mode-floating .cai-bot-container {
    opacity: 0;
    pointer-events: none;
}
.cai-mode-floating .cai-bot-container.cai-entrance-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Bot container */
.cai-bot-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* --- Okno czatu --- */
.cai-chat-ui {
    position: relative;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 0;
    opacity: 0;
    background: var(--m-bg);
    border: 2px solid var(--m-green);
    border-radius: 4px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
    backdrop-filter: blur(10px);
}

.cai-chat-ui.cai-active {
    height: 500px;
    opacity: 1;
}

.cai-mode-inline .cai-chat-ui {
    height: 500px;
    opacity: 1;
    margin-bottom: 16px;
}

.cai-header {
    padding: 12px;
    border-bottom: 1px solid var(--m-green);
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--m-green);
    background: rgba(0, 255, 65, 0.1);
    flex-shrink: 0;
}

.cai-header-title {
    font-family: 'Share Tech Mono', monospace;
}

.cai-header-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cai-header-btn {
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: rgba(0, 255, 65, 0.6);
    transition: color 0.15s ease, text-shadow 0.15s ease;
    user-select: none;
    padding: 0 4px;
}

.cai-header-btn:hover {
    color: var(--m-green);
    text-shadow: 0 0 8px var(--m-green);
}

.cai-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    color: var(--m-green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    min-height: 0;
    /* Matrixowy suwak – cienki, zielony, w stylu czatu */
    scrollbar-width: thin;
    scrollbar-color: var(--m-green) var(--m-dark);
}
.cai-messages::-webkit-scrollbar {
    width: 8px;
}
.cai-messages::-webkit-scrollbar-track {
    background: var(--m-dark);
    border-left: 1px solid rgba(0, 255, 65, 0.2);
}
.cai-messages::-webkit-scrollbar-thumb {
    background: var(--m-green);
    border-radius: 2px;
    box-shadow: 0 0 6px var(--m-green-glow);
}
.cai-messages::-webkit-scrollbar-thumb:hover {
    background: #00ff41;
    box-shadow: 0 0 10px var(--m-green-glow);
}

.cai-message {
    margin-bottom: 10px;
}

.cai-message--user .cai-bubble {
    color: #fff;
}

.cai-bubble {
    word-break: break-word;
}

.cai-bubble a {
    color: var(--m-green);
}

.cai-typing {
    color: rgba(0, 255, 65, 0.7);
}

.cai-input-box {
    padding: 15px;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cai-input-field {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--m-green);
    outline: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
}

.cai-send-btn {
    width: 42px;
    height: 34px;
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.35);
    color: rgba(0, 255, 65, 0.9);
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    user-select: none;
    flex: 0 0 auto;
}
.cai-send-btn:hover {
    border-color: var(--m-green);
    color: var(--m-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transform: translateY(-1px);
}
.cai-send-btn:focus-visible {
    outline: 2px solid rgba(0, 255, 65, 0.55);
    outline-offset: 2px;
}
.cai-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.cai-input-field::placeholder {
    color: rgba(0, 255, 65, 0.5);
}

/* Suggestions */
.cai-suggestions-toggle {
    margin: 0 15px 8px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: rgba(0, 255, 65, 0.8);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cai-suggestions-toggle:hover {
    border-color: var(--m-green);
    color: var(--m-green);
}

.cai-suggestions {
    padding: 0 15px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cai-suggestion-chip {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.35);
    color: rgba(0, 255, 65, 0.9);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.cai-suggestion-chip:hover {
    border-color: var(--m-green);
    color: var(--m-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

/* Modal */
.cai-chat-modal {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.92);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: 'Share Tech Mono', monospace;
}

.cai-chat-modal.cai-visible {
    display: flex;
}

.cai-modal-q {
    font-size: 11px;
    color: var(--m-green);
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.7;
}

.cai-modal-btns {
    display: flex;
    gap: 10px;
}

.cai-modal-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.35);
    color: rgba(0, 255, 65, 0.7);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 6px 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s ease;
    border-radius: 2px;
}

.cai-modal-btn:hover {
    border-color: var(--m-green);
    color: var(--m-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

/* Glitch przy pojawianiu się (wejście na stronę / odświeżenie) */
@keyframes cai-glitch-in {
    0%   { opacity: 0; transform: translateX(4px) scaleY(0.3); filter: brightness(4); clip-path: inset(50% 0 50% 0); }
    15%  { transform: translateX(-5px) skewX(3deg);  filter: hue-rotate(180deg) brightness(0.4); opacity: 0.2; clip-path: inset(30% 0 40% 0); }
    30%  { transform: translateX(6px) skewX(-4deg);    filter: hue-rotate(90deg) brightness(2); clip-path: inset(10% 0 60% 0); }
    45%  { transform: translateX(-3px);               filter: brightness(3) saturate(0); clip-path: inset(40% 0 20% 0); opacity: 0.5; }
    60%  { transform: translateX(5px) skewX(-2deg);   filter: hue-rotate(270deg); clip-path: inset(5% 0 50% 0); opacity: 0.8; }
    75%  { transform: translateX(-4px) scaleX(1.02); filter: hue-rotate(180deg) brightness(1.2); opacity: 0.95; clip-path: inset(0); }
    100% { opacity: 1; transform: translateX(0) scale(1); filter: none; clip-path: inset(0); }
}

.cai-bot-container.cai-glitch-in {
    animation: cai-glitch-in 0.6s steps(1) forwards;
}

/* Glitch przy zamykaniu */
@keyframes cai-glitch-out {
    0%   { opacity: 1; transform: translateX(0);    filter: none; }
    10%  { transform: translateX(-6px) skewX(-4deg); filter: hue-rotate(90deg) brightness(2); }
    20%  { transform: translateX(5px)  skewX(3deg);  filter: hue-rotate(180deg) brightness(0.5); clip-path: inset(20% 0 30% 0); }
    30%  { transform: translateX(-3px);               filter: brightness(3) saturate(0); clip-path: inset(50% 0 10% 0); }
    40%  { transform: translateX(4px)  skewX(-2deg); filter: hue-rotate(270deg); clip-path: inset(5% 0 60% 0); }
    55%  { transform: translateX(0);                  filter: brightness(4); clip-path: inset(0); opacity: 0.6; }
    70%  { transform: translateX(-8px) scaleX(1.05); filter: hue-rotate(180deg) brightness(1); opacity: 0.3; }
    85%  { transform: translateX(3px);                filter: brightness(2); opacity: 0.1; clip-path: inset(45% 0 45% 0); }
    100% { opacity: 0; transform: translateX(0) scaleY(0.02); filter: brightness(5); clip-path: inset(49% 0 49% 0); }
}

.cai-chat-ui.cai-glitch-close {
    animation: cai-glitch-out 0.55s steps(1) forwards !important;
    pointer-events: none;
}

/* Glitch na całym ludku (czat + głowa) przy zamknięciu na sesję */
.cai-bot-container.cai-glitch-close {
    animation: cai-glitch-out 0.55s steps(1) forwards !important;
    pointer-events: none;
}

.cai-chat-ui.cai-minimized {
    height: 42px !important;
}

.cai-chat-ui.cai-minimized .cai-messages,
.cai-chat-ui.cai-minimized .cai-input-box,
.cai-chat-ui.cai-minimized .cai-suggestions-toggle,
.cai-chat-ui.cai-minimized .cai-suggestions {
    display: none !important;
}

/* --- Głowa robota --- */
.cai-bot-head {
    width: 130px;
    height: 110px;
    background: var(--m-dark);
    border: 2px solid var(--m-green);
    border-radius: 40px;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    box-shadow:
        0 0 0 1px rgba(0, 255, 65, 0.15),
        0 0 18px rgba(0, 255, 65, 0.35),
        0 0 45px rgba(0, 255, 65, 0.12),
        inset 0 0 20px rgba(0, 255, 65, 0.08),
        inset 0 0 1px 1px rgba(0, 255, 65, 0.12);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    overflow: hidden;
}

.cai-bot-head-inline {
    cursor: default;
    pointer-events: none;
}

.cai-bot-head::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.4), transparent);
    animation: cai-scanline 3.5s linear infinite;
    pointer-events: none;
}

@keyframes cai-scanline {
    0%   { top: -2px; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 112px; opacity: 0; }
}

.cai-bot-head::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 36px;
    border: 1px solid rgba(0, 255, 65, 0.08);
    pointer-events: none;
}

.cai-bot-head:hover:not(.cai-bot-head-inline) {
    transform: scale(1.05) translateY(-5px);
    box-shadow:
        0 0 0 1px rgba(0, 255, 65, 0.25),
        0 0 28px rgba(0, 255, 65, 0.55),
        0 0 60px rgba(0, 255, 65, 0.2),
        inset 0 0 25px rgba(0, 255, 65, 0.12),
        inset 0 0 1px 1px rgba(0, 255, 65, 0.2);
}

/* Zamykanie oczu */
.cai-bot-head.cai-closing .cai-pupil {
    transform: scaleY(0.09) !important;
    opacity: 0.75 !important;
    box-shadow: 0 0 8px var(--m-green) !important;
}

/* Drzemka */
@keyframes cai-snore {
    0%   { transform: rotate(0deg)   translateY(0px); }
    20%  { transform: rotate(1.5deg) translateY(2px); }
    50%  { transform: rotate(0deg)   translateY(4px); }
    80%  { transform: rotate(-1deg)  translateY(2px); }
    100% { transform: rotate(0deg)   translateY(0px); }
}

.cai-bot-head.cai-sleeping {
    animation: cai-snore 3.2s ease-in-out infinite;
    box-shadow:
        0 0 0 1px rgba(0, 255, 65, 0.06),
        0 0 10px rgba(0, 255, 65, 0.12),
        0 0 22px rgba(0, 255, 65, 0.05),
        inset 0 0 10px rgba(0, 255, 65, 0.03),
        inset 0 0 1px 1px rgba(0, 255, 65, 0.05) !important;
}

.cai-bot-head.cai-sleeping .cai-pupil {
    transform: scaleY(0.09) !important;
    opacity: 0.85 !important;
    box-shadow: 0 0 10px var(--m-green), 0 0 20px rgba(0, 255, 65, 0.4) !important;
}

/* Oczodoły i źrenice */
.cai-eye-socket {
    width: 36px;
    height: 36px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.cai-pupil {
    width: 18px;
    height: 18px;
    background: var(--m-green);
    border-radius: 4px;
    box-shadow: 0 0 12px var(--m-green), 0 0 28px var(--m-green);
    position: absolute;
    background-image: linear-gradient(rgba(0, 0, 0, 0.2) 50%, transparent 50%);
    background-size: 100% 4px;
    transition: width 0.15s ease, border-radius 0.15s ease, opacity 0.1s ease, box-shadow 0.15s ease, transform 0.8s ease;
    transform-origin: center center;
}

/* Myślenie — pulsowanie */
.cai-bot-head.cai-thinking .cai-pupil {
    animation: cai-pulse 0.35s infinite alternate;
}

@keyframes cai-pulse {
    from { transform: scaleY(1); }
    to   { transform: scaleY(1.35); }
}

/* Zmrużenie */
.cai-bot-head.cai-squint .cai-pupil {
    width: 22px !important;
    border-radius: 3px !important;
    transform: scaleY(0.32) !important;
    box-shadow: 0 0 10px var(--m-green) !important;
}

/* Sceptycyzm */
.cai-bot-head.cai-skeptic .cai-eye-socket:first-child .cai-pupil {
    width: 22px !important;
    border-radius: 3px !important;
    transform: scaleY(0.32) !important;
}

/* Radość */
@keyframes cai-laugh-shake {
    0%   { transform: translateY(0px);   }
    15%  { transform: translateY(-3px);  }
    30%  { transform: translateY(1px);   }
    45%  { transform: translateY(-2.5px);}
    60%  { transform: translateY(0.5px); }
    75%  { transform: translateY(-2px);  }
    90%  { transform: translateY(0.5px); }
    100% { transform: translateY(0px);   }
}

.cai-bot-head.cai-happy .cai-pupil {
    width: 22px !important;
    border-radius: 50% 50% 2px 2px !important;
    transform: scaleY(0.75) !important;
    box-shadow: 0 0 20px var(--m-green), 0 0 45px var(--m-green) !important;
}

.cai-bot-head.cai-happy .cai-eye-socket {
    animation: cai-laugh-shake 0.38s ease-in-out infinite !important;
}

.cai-bot-head.cai-happy .cai-eye-socket:last-child {
    animation-delay: 0.09s !important;
}

/* Zły */
@keyframes cai-angry-shake {
    0%   { transform: translateX(0px);   }
    10%  { transform: translateX(-3px);  }
    25%  { transform: translateX(3px);   }
    40%  { transform: translateX(-2.5px);}
    55%  { transform: translateX(2px);   }
    70%  { transform: translateX(-1.5px);}
    85%  { transform: translateX(1px);   }
    100% { transform: translateX(0px);   }
}

.cai-bot-head.cai-angry .cai-pupil {
    width: 20px !important;
    border-radius: 2px 2px 6px 6px !important;
    transform: scaleY(0.78) !important;
    box-shadow: 0 0 20px var(--m-green), 0 0 50px rgba(255, 60, 0, 0.3) !important;
}

.cai-bot-head.cai-angry .cai-eye-socket {
    animation: cai-angry-shake 0.32s ease-in-out infinite !important;
}

.cai-bot-head.cai-angry .cai-eye-socket:last-child {
    animation-delay: 0.06s !important;
}

/* Zdziwienie — prawe oko szeroko */
.cai-bot-head.cai-onewide .cai-eye-socket:last-child .cai-pupil {
    width: 24px !important;
    border-radius: 5px !important;
    transform: scaleY(1.6) !important;
    box-shadow: 0 0 25px var(--m-green), 0 0 55px var(--m-green) !important;
}

/* Hook bubble (chmurka zaczeki) — zaraz nad głową robota, lekko wyżej */
.cai-hook-bubble {
    position: absolute;
    bottom: 134px; /* głowa ~110px + odstęp, +16px wyżej na PC */
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
    padding: 10px 14px;
    max-width: 220px;
    min-width: 140px;
    background: var(--m-bg);
    border: 1px solid var(--m-green);
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--m-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
    z-index: 5;
}

/* Przy lewej pozycji chmurka wyrównana do głowy, bez wychodzenia poza ekran */
.cai-pos-left .cai-hook-bubble {
    left: 0;
    transform: none;
}

.cai-hook-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--m-green);
}

/* Strzałka chmurki przy lewej pozycji — wskazuje środek głowy (65px przy szer. 130px) */
.cai-pos-left .cai-hook-bubble::after {
    left: 65px;
    transform: translateX(-50%);
}

/* Na tablecie chmurka tuż nad głową, lekko wyżej */
@media (max-width: 1024px) {
    .cai-hook-bubble {
        bottom: 120px;
    }
}

.cai-hook-bubble.cai-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cai-hook-bubble .cai-hook-text {
    display: block;
    padding-right: 22px;
}

.cai-hook-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(0, 255, 65, 0.5);
    background: transparent;
    color: var(--m-green);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    font-family: 'Share Tech Mono', monospace;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.cai-hook-close:hover {
    border-color: var(--m-green);
    box-shadow: 0 0 8px var(--m-green-glow);
}

/* Inline mode: chat always visible, no launcher click */
.cai-mode-inline .cai-chat-ui {
    display: flex;
}

.cai-mode-inline .cai-hook-bubble {
    display: none;
}

/* --- Responsywność: tablet --- */
@media (max-width: 1024px) {
    .cai-mode-floating {
        bottom: 16px;
    }

    /* Odstępy od boków na tablecie */
    .cai-pos-left {
        left: 10px;
    }

    .cai-pos-right {
        right: 16px;
    }

    .cai-chat-ui {
        width: 360px;
        max-width: calc(100vw - 32px);
    }

    .cai-chat-ui.cai-active {
        height: 480px;
    }

    .cai-mode-inline .cai-chat-ui {
        height: 480px;
    }

    .cai-header,
    .cai-messages,
    .cai-input-box {
        padding: 10px 12px;
    }

    .cai-messages {
        font-size: 13px;
    }
}

@keyframes cai-snore-mobile {
    0%   { transform: scale(0.75) rotate(0deg) translateY(0); }
    20%  { transform: scale(0.75) rotate(1.5deg) translateY(2px); }
    50%  { transform: scale(0.75) rotate(0deg) translateY(4px); }
    80%  { transform: scale(0.75) rotate(-1deg) translateY(2px); }
    100% { transform: scale(0.75) rotate(0deg) translateY(0); }
}

/* --- Responsywność: telefon --- */
@media (max-width: 768px) {
    .cai-mode-floating {
        bottom: 12px;
        /* Na telefonie kontener na całą szerokość ekranu – okno czatu nie wychodzi poza krawędzie */
        left: 0;
        right: 0;
        width: 100%;
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
        box-sizing: border-box;
    }

    .cai-mode-floating .cai-bot-container {
        width: 100%;
        max-width: 100%;
        align-items: stretch;
    }

    /* Na telefonie pozycja lewa/prawa nie przesuwa – czat i tak na pełną szerokość */
    .cai-mode-floating.cai-pos-left,
    .cai-mode-floating.cai-pos-right {
        left: 0;
        right: 0;
    }

    .cai-chat-ui {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 12px;
        border-radius: 0;
        box-sizing: border-box;
    }

    .cai-chat-ui.cai-active {
        height: min(500px, 70vh);
    }

    .cai-mode-inline .cai-chat-ui {
        height: min(500px, 70vh);
        margin-bottom: 12px;
    }

    .cai-header {
        padding: 10px 12px;
        font-size: 10px;
    }

    .cai-messages {
        padding: 12px;
        font-size: 13px;
    }

    .cai-input-box {
        padding: 12px;
    }

    .cai-input-field {
        font-size: 16px; /* zapobiega zoomowi przy focus na iOS */
    }

    .cai-modal-btn,
    .cai-suggestion-chip {
        padding: 8px 12px;
        min-height: 44px; /* touch target */
    }

    .cai-header-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Głowa robota na telefonie mniejsza o 25% (skala 0.75), całkowicie po lewej */
    .cai-mode-floating .cai-bot-container .cai-bot-head:not(.cai-bot-head-inline) {
        align-self: flex-start;
    }

    .cai-bot-head {
        transform: scale(0.75);
        transform-origin: bottom center;
    }

    .cai-bot-head:hover:not(.cai-bot-head-inline) {
        transform: scale(0.7875) translateY(-4px); /* 0.75 * 1.05 */
    }

    .cai-bot-head.cai-sleeping {
        animation: cai-snore-mobile 3.2s ease-in-out infinite;
    }

    .cai-hook-bubble {
        bottom: 104px; /* głowa na tel. ~82px + odstęp, +14px wyżej na tel */
        max-width: min(220px, calc(100vw - 32px));
        font-size: 15px;
        line-height: 1.35;
        padding: 10px 14px;
        margin-bottom: 0;
    }

    /* Przy lewej pozycji na telefonie chmurka nie wychodzi za lewą krawędź viewportu */
    .cai-pos-left .cai-hook-bubble {
        left: 10px;
    }

    /* Strzałka chmurki przy lewej pozycji na telefonie — po przesunięciu chmurki o 10px (49 − 10) */
    .cai-pos-left .cai-hook-bubble::after {
        left: 39px;
    }
}
