/* 1. БАЗОВІ НАЛАШТУВАННЯ ТА СКРОЛ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { 
    height: 100% !important; 
    margin: 0; 
    padding: 0; 
    /* ПРИМУСОВО вмикаємо вертикальну прокрутку всередині фрейму */
    overflow-y: auto !important; 
    overflow-x: hidden !important;
    background: transparent; 
}

/* Ховаємо страшний скролбар, щоб було красиво (як ви і хотіли) */
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; }
html, body { -ms-overflow-style: none; scrollbar-width: none; }

#chat_messages {
    max-height: 280px;
    width: 100%;
    /* Дозволяємо блоку повідомлень розтягуватися і скролитися */
    height: auto; 
    min-height: 100%;
    overflow-y: auto !important;
    padding-bottom: 10px;
}

body {
    width: 97%;
    padding: 2px 4px; 
    margin: 0; 
    font-family: Tahoma, Geneva, sans-serif; /* Тип шрифту з Stiles&Colors */
    background: transparent !important; 
    color: #353b41 !important; /* Колір з Stiles&Colors */
    font-size: 11px;
    line-height: 1.2; /* Розмір з Stiles&Colors */
    cursor: url('../../../cursor.cur'), auto; 
    overflow-y: auto; 
    overflow-x: hidden;
}

form {
    width: 450px;
}

/* Стиль для роздільної лінії */
hr {
    background: #353b41; /* Ваш колір зі скріншоту */
    opacity: 0.15;        /* Можна зробити напівпрозорою для м'якості */
}

/* Стилізація смуги прокрутки (Кольори нового стилю) */
body::-webkit-scrollbar, #chat_messages::-webkit-scrollbar { width: 5px; }
body::-webkit-scrollbar-track, #chat_messages::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
body::-webkit-scrollbar-thumb, #chat_messages::-webkit-scrollbar-thumb { background: #3b4355; border-radius: 5px; }

/* 2. ТЕКСТ ПОВІДОМЛЕНЬ */
.d2 {
    /* display: block;
    font-size: 11px;
    padding: 1px 0;
    color: #353b41;
    cursor: url('../../../say.cur'), text;
    border-bottom: 1px dotted rgba(57, 90, 91, 0.15); /* Розділювач з Stiles&Colors */
}

/* Спеціальні кольори для IP та виділень */
.d2 b[style*="color:#00b050"] { 
    color: #32ff00 !important; /* Салатовий */
}
.d2 b[style*="color:#ff0000"] { 
    color: #353b41 !important; 
    font-weight: normal; 
}
.d2 b { color: #395a5b; cursor: url('../../../hand.cur'), pointer !important; }
.d2 a { cursor: url('../../../hand.cur'), pointer !important; color: #395a5b; text-decoration: underline; }

/* 3. КОМІРКИ ВВОДУ (Кольори з Stiles&Colors) */
input.sb {
    background: transparent !important;
    border: 1px solid rgba(57, 90, 91, 0.4) !important;  
    color: #395a5b !important;
    font-size: 11px;
    height: 17px !important;
    padding: 0 4px !important;
    margin: 1px 0 !important;
    cursor: url('../../../cursor.cur'), pointer;
    vertical-align: middle;
    outline: none;
}

/* Чіткі зони ширини */
input[name="person"].sb { width: 100px !important; }
input[name="message"].sb { 
    width: 405px !important; 
    max-width: 98%; 
}

/* Кнопка відправки */
input[type="image"] {
    cursor: url('../../../hand.cur'), pointer !important;
    height: 19px; 
    width: auto;
    display: block;
    margin: 1px auto 0 auto;
}

hr { border: 0; border-bottom: 1px solid rgba(57, 90, 91, 0.2); margin: 2px 0; }

/* 4. БЛОК ПОВІДОМЛЕНЬ */
#chat_messages {
    width: 96%;
    overflow-y: auto !important;
    overflow-x: hidden;
    scrollbar-width: thin;
}

/* 5. ПАНЕЛЬ СМАЙЛІВ */
.smile-box {
    display: none; /* Тепер не вантажаться відкритими */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 192px;
    background: rgba(20, 20, 20, 0.10); /* Трохи темніший, але прозорий */
    backdrop-filter: blur(5px); 
    border: 1px solid #3b4355;
    border-radius: 4px;
    padding: 3px;
    z-index: 1000;
}

.smile-box img:hover { 
    background: #5C4D38; 
    border-radius: 3px; 
    transform: scale(1.2); /* Смайлик трохи збільшиться при наведенні */
    transition: 0.2s; 
}

.smile-box img {
    cursor: pointer;
    padding: 2px;
}

/* 6. Кнопка відправити */
.msg_input_btn { 
    outline: none; 
    margin: 0.5px; 
    padding: 4px 7px 3px 7px; 
    background: #232732; 
    color: #fff; 
    border: none; 
    font-size: 10px; 
    cursor: url('../../../hand.cur'), pointer !important; 
    -webkit-border-radius: 5px; 
    -moz-border-radius: 5px; 
    border-radius: 5px; 
    height: 20px; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Приховуємо оригінальну картинку send_1.png */
.msg_input_btn img {
    display: none;
}

/* Додаємо текст "Отправить" замість картинки */
.msg_input_btn::before {
    content: "Ответить";
}

.msg_input_btn:hover { 
    background: #3b4355; 
}