.chat-box {
    font-family: Georgia, serif;
    max-width: 950px;
    width: 90%;
    margin: 60px auto;
    padding: 30px;
    padding-bottom: 150px !important;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.chat-window {
    height: 600px;
    overflow-y: auto;
    background: #f5f6fa;
    border-radius: 14px;
    padding: 20px;
    margin: 20px 0;
}

.ai-message,
.user-message {
    max-width: 90%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 14px;
}

.ai-message {
    background: #e8eefc;
}

.user-message {
    background: #dff7e8;
    margin-left: auto;
}

.chat-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 12px;
    width: 100%;
    align-items: stretch;
    margin-top: 14px;
}

#message {
    width: 100%;
    height: 62px;
    min-height: 62px;
    max-height: 120px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    outline: none;
}

#message:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.chat-input button {
    height: 62px;
    width: 110px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg,#3b82f6,#1e3a8a);
    color: white;
    font-weight: bold;
    cursor: pointer;
}
.ai-message,
.user-message {
    max-width:  88%;
    font-family: Arial, sans-serif !important;
    white-space: pre-wrap;
}
.ai-message:has(img.uloha-obrazok) {
    max-width: 95% !important;
}

img.uloha-obrazok {
    display: block !important;
    width: auto !important;
    max-width: 85% !important;
    max-height: 45vh !important;
    object-fit: contain !important;
    margin: 16px auto !important;
    border-radius: 10px !important;
}

img.uloha-obrazok[src*="mozaika"] {
    width: min(760px, 100%) !important;
}