/* Öğrenci mesajlar — WhatsApp mobil (telefon kuklası değil) */
#student-message-modal.s-wa-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #efeae2;
}
#student-message-modal.s-wa-overlay > .s-wa-app {
    max-width: none !important;
    max-height: none !important;
    height: 100%;
    width: 100%;
}
#student-message-modal.s-wa-overlay.hidden { display: none !important; }
#student-message-modal .s-wa-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: #efeae2;
}
#student-message-modal .s-phone-shell,
#student-message-modal .s-phone-notch { display: none !important; }
#student-message-modal .s-wa-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.7rem 0.5rem;
    background: #008069;
    color: #fff;
}
#student-message-modal .s-wa-back,
#student-message-modal .s-wa-close {
    width: 2.15rem;
    height: 2.15rem;
    border: none;
    background: transparent;
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
}
#student-message-modal .s-wa-peer {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
}
#student-message-modal .s-wa-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    background: #dfe5e7;
    color: #54656f;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1 !important;
    letter-spacing: 0;
    flex-shrink: 0;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}
#student-message-modal .s-wa-avatar.has-photo {
    background: transparent;
}
#student-message-modal .s-wa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#student-message-modal .s-wa-peer h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.15;
}
#student-message-modal .s-wa-peer p {
    margin: 0.1rem 0 0;
    font-size: 0.68rem;
    opacity: 0.9;
    font-weight: 600;
}
#student-message-modal .s-wa-inbox {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}
#student-message-modal.is-thread .s-wa-inbox { display: none; }
#student-message-modal:not(.is-thread) .s-wa-thread,
#student-message-modal:not(.is-thread) .s-wa-composer { display: none; }
#student-message-modal .s-wa-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: center;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: left;
    cursor: pointer;
}
#student-message-modal .s-wa-row.is-peer { cursor: pointer; }
#student-message-modal .s-wa-comfort {
    margin: 0.45rem 0 0;
    padding: 0.45rem 0.5rem;
    border-radius: 0.45rem;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.76rem;
    line-height: 1.4;
    font-weight: 600;
}
#student-message-modal .s-wa-plan-cta {
    display: inline-flex;
    margin-top: 0.45rem;
    border: none;
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    background: #008069;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}
#student-message-modal .s-wa-row strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: #111b21;
}
#student-message-modal .s-wa-row > span:not(.s-wa-avatar) {
    display: block;
    min-width: 0;
}
#student-message-modal .s-wa-row > span:not(.s-wa-avatar) > span {
    display: block;
    font-size: 0.72rem;
    color: #667781;
    margin-top: 0.12rem;
}
#student-message-modal .s-wa-row em {
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    color: #667781;
}
#student-message-modal .s-wa-sec {
    padding: 0.45rem 0.85rem 0.2rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #008069;
    background: #f0f2f5;
}
#student-message-modal .s-wa-thread {
    flex: 1;
    overflow-y: auto;
    padding: 0.7rem 0.75rem 0.9rem;
    background: #efeae2 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d1c7b7' fill-opacity='0.18'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-overflow-scrolling: touch;
}
#student-message-modal .s-chat-row {
    display: flex;
    margin-bottom: 0.35rem;
}
#student-message-modal .s-chat-row.is-me { justify-content: flex-end; }
#student-message-modal .s-chat-row.is-them { justify-content: flex-start; }
#student-message-modal .s-chat-bubble {
    max-width: 82%;
    padding: 0.42rem 0.55rem 0.28rem;
    border-radius: 0.55rem;
    font-size: 0.84rem;
    line-height: 1.4;
    color: #111b21;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}
#student-message-modal .s-chat-row.is-me .s-chat-bubble { background: #d9fdd3; border-top-right-radius: 0.15rem; }
#student-message-modal .s-chat-row.is-them .s-chat-bubble { background: #fff; border-top-left-radius: 0.15rem; }
#student-message-modal .s-chat-time {
    display: block;
    text-align: right;
    font-size: 0.62rem;
    color: #667781;
    margin-top: 0.18rem;
}
#student-message-modal .s-wa-card {
    background: #fff;
    border-radius: 0.65rem;
    padding: 0.55rem 0.65rem;
    max-width: 86%;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}
#student-message-modal .s-wa-card h4 {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #008069;
}
#student-message-modal .s-chat-empty {
    text-align: center;
    color: #667781;
    font-size: 0.82rem;
    padding: 2rem 1rem;
}
#student-message-modal .s-wa-composer {
    display: flex;
    gap: 0.4rem;
    align-items: flex-end;
    padding: 0.4rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: #f0f2f5 !important;
    border-top: 1px solid #e9edef;
    flex-shrink: 0;
}
#student-message-modal .s-wa-composer textarea,
#student-message-modal .s-wa-composer .mp-chat-compose-field,
#student-message-modal .s-phone-composer textarea,
#student-message-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    border: none !important;
    border-radius: 1.25rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    background: #fff !important;
    color: #111b21 !important;
    -webkit-text-fill-color: #111b21 !important;
    caret-color: #111b21 !important;
    opacity: 1 !important;
    outline: none;
    resize: none;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 7rem;
    min-height: 2.45rem;
}
#student-message-modal .s-wa-composer textarea::placeholder,
#student-message-modal .s-wa-composer .mp-chat-compose-field::placeholder,
#student-message-modal .s-phone-composer textarea::placeholder,
#student-message-input::placeholder {
    color: #8696a0 !important;
    -webkit-text-fill-color: #8696a0 !important;
    opacity: 1 !important;
}
#student-message-modal .s-wa-composer button {
    width: 2.45rem;
    height: 2.45rem;
    border: none;
    border-radius: 999px;
    background: #008069;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 767px) {
    #student-message-modal.is-kb .s-wa-head {
        padding-top: calc(0.35rem + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 0.4rem !important;
    }
    #student-message-modal.is-kb .s-wa-peer p {
        display: none;
    }
    #student-message-modal.is-kb .s-wa-thread {
        min-height: 0 !important;
    }
}
#student-message-modal .s-wa-unread {
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #25d366;
    color: #054c3a;
    font-size: 0.62rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
