* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

html {
    height: -webkit-fill-available;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    height: 50px;
    background: white;
    z-index: 10;
}

.logo { 
    height: 40px; 
}

.chat-container { 
    flex: 1;
    padding: 1rem;
    padding-top: 60px; /* Добавлен отступ под fixed header */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    height: calc(100vh - env(safe-area-inset-bottom));
}

.doctor-area { 
    position: relative;
    display: flex; 
    align-items: flex-start;
    gap: 1rem;
    max-width: 100%;
    margin-top: auto; /* Прижимаем к низу */
}

.doctor-image { 
    width: 128px;
    align-self: flex-end;
    margin-bottom: -10px;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-right: 1rem;
    position: relative;
    width: 100%;
}

.message-bubble {
    flex: 1;
    padding: 1rem;
    background-color: #c7df95;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

/* Остальные стили остаются без изменений */
.markdown h1 { 
    font-size: 1.1rem; 
    font-weight: bold; 
}

.markdown ul { 
    margin-left: 1.5rem; 
    font-size: 1rem;
}

.markdown li { 
    margin-bottom: 0.0rem; 
}

.buttons { 
    display: none;
    margin-top: 1rem;
    border-radius: 1rem;
}

/* Unified button styles */
.btn,
.submit-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border-radius: 9999px;
    background-color: #95C11F;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: bold;
}

.btn:hover, 
.submit-btn:hover {
    background-color: #86af1b;
}

.btn:disabled, 
.submit-btn:disabled {
    background-color: #86af1b;
    opacity: 0.7;
    cursor: not-allowed;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Combined media queries */
@media (max-width: 640px) {
 
    .doctor-image {
        width: 96px;
    }
    
    .message-bubble {
        margin-right: -20px;
        margin-left: -30px;
    }
    

}

@supports(padding: max(0px)) {
    .chat-container {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        height: calc(100vh - max(0px, env(safe-area-inset-bottom)));
    }
}