/* =========================================================

   CHATBOT PMB UNBARA

   Desain mengikuti gambar referensi

   ========================================================= */

/* =========================================================

   1. RESET DAN DASAR HALAMAN

   ========================================================= */

* {

    box-sizing: border-box;

    margin: 0;

    padding: 0;

}

html {

    min-height: 100%;

    scroll-behavior: smooth;

}

body {

    position: relative;

    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 24px;

    overflow-x: hidden;

    font-family: Arial, Helvetica, sans-serif;

    color: #10234b;

    background-image: url("../static/bg_unbara.jpeg");

    background-position: center;

    background-repeat: no-repeat;

    background-size: cover;

    background-attachment: fixed;

}

/* =========================================================

   2. BACKGROUND BLUR

   ========================================================= */

body::before {

    content: "";

    position: fixed;

    inset: 0;

    z-index: -1;

    background-image: url("../static/bg_unbara.jpeg");

    background-position: center;

    background-repeat: no-repeat;

    background-size: cover;

    filter: blur(5px);

    transform: scale(1.04);

}

body::after {

    content: "";

    position: fixed;

    inset: 0;

    z-index: -1;

    background: rgba(230, 240, 255, 0.15);

}

/* =========================================================

   3. CONTAINER CHATBOT

   ========================================================= */

.chat-container {

    position: relative;

    isolation: isolate;

    width: min(1200px, 100%);

    min-height: 90vh;

    margin: auto;

    padding: 24px 30px 20px;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.85);

    border-radius: 28px;

    background: rgba(255, 255, 255, 0.94);

    box-shadow:

        0 15px 45px rgba(15, 45, 95, 0.22),

        0 4px 12px rgba(15, 45, 95, 0.08);

}

/* =========================================================

   4. DEKORASI BIRU BAGIAN ATAS

   ========================================================= */

.chat-container::before {

    content: "";

    position: absolute;

    top: -20px;

    right: 0;

    width: 400px;

    height: 140px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http\://www\.w3.org/2000/svg' viewBox='0 0 260 110'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%239bd0ff'/%3E%3Cstop offset='1' stop-color='%230878ec'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23b)' d='M0 0H260V110C205 105 177 82 143 55C103 23 60 0 0 0Z'/%3E%3Cpath fill='%230878ec' d='M0 0H260V75C211 76 182 53 151 32C111 5 64 0 0 0Z'/%3E%3Cpath fill='%239acbff' d='M0 0H260V45C216 58 187 32 153 17C109 -2 60 0 0 0Z'/%3E%3C/svg%3E");

    background-size: 100% 100%;

    background-repeat: no-repeat;

    z-index: -1;

}

/* =========================================================

   5. DEKORASI BIRU BAGIAN BAWAH

   ========================================================= */

.chat-container::after {

    content: "";

    position: absolute;

    bottom: -11px;

    left: 0;

    width: 400px;

    height: 140px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http\://www\.w3.org/2000/svg' viewBox='0 0 320 95'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%239bd0ff'/%3E%3Cstop offset='1' stop-color='%230878ec'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23b)' d='M0 0C63 8 104 35 151 64C184 84 212 95 252 95H0Z'/%3E%3Cpath fill='%23d8ebff' d='M0 0C66 12 107 43 153 69C179 84 203 95 228 95H0Z'/%3E%3Cpath fill='%239acbff' d='M0 0C53 18 92 48 129 72C151 86 174 95 196 95H0Z'/%3E%3C/svg%3E");

    background-size: 100% 100%;

    background-repeat: no-repeat;

    z-index: -1;

}

/* =========================================================

   6. HEADER LOGO DAN JUDUL

   ========================================================= */

.header-area {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 20px;

    width: 100%;

    margin-bottom: 24px;

}

.logo {

    width: 82px;

    height: 82px;

    flex-shrink: 0;

    object-fit: contain;

}

.header-text {

    text-align: left;

}

.header-text h1 {

    margin: 0;

    color: #111827;

    font-size: clamp(25px, 3vw, 40px);

    font-weight: 800;

    line-height: 1.2;

}

.header-text h1 span {

    color: #0878e8;

}

.header-text p {

    margin: 5px 0 0;

    color: #17233f;

    font-size: 17px;

    line-height: 1.4;

}

/* =========================================================

   7. AREA SAMBUTAN MASKOT

   ========================================================= */

.welcome-area {

    display: flex;

    align-items: center;

    gap: 22px;

    width: min(820px, 100%);

    min-height: 155px;

    margin: 0 auto 18px;

    padding: 18px 26px;

    border-radius: 100px;

    background: linear-gradient(

        110deg,

        #e5f0ff 0%,

        #d5e7ff 100%

    );

}

/* =========================================================

   8. GAMBAR MASKOT

   ========================================================= */

.welcome-mascot {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 220px;

    min-width: 180px;

    height: 130px;

    overflow: hidden;

}

.welcome-mascot img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    animation: mascotFloat 3s ease-in-out infinite;

}

/* =========================================================

   9. TEKS SAMBUTAN

   ========================================================= */

.welcome-text {

    flex: 1;

    min-width: 0;

}

.welcome-text h2 {

    margin: 0 0 5px;

    color: #10234b;

    font-size: 27px;

    font-weight: 800;

}

.welcome-text h3 {

    margin: 0 0 8px;

    color: #10234b;

    font-size: 18px;

    font-weight: 700;

}

.welcome-text p {

    margin: 0;

    color: #1f2e4d;

    font-size: 16px;

    line-height: 1.45;

}

/* =========================================================

   10. JUDUL FAQ

   ========================================================= */

.quick-box {

    width: 100%;

    margin: 0 0 18px;

    padding: 0;

    background: transparent;

}

.quick-title {

    display: flex;

    align-items: center;

    gap: 10px;

    margin: 0 0 12px;

    color: #10234b;

    font-size: 20px;

    font-weight: 800;

}

.quick-title i {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 34px;

    height: 30px;

    border-radius: 10px;

    color: #ffffff;

    background: #0878e8;

    font-size: 17px;

}

/* =========================================================

   11. GRID FAQ

   ========================================================= */

.quick-list {

    display: grid;

    grid-template-columns: repeat(6, minmax(0, 1fr));

    gap: 10px;

    width: 100%;

}

/* =========================================================

   12. KARTU FAQ

   ========================================================= */

.quick-item {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 7px;

    min-height: 108px;

    padding: 12px 8px;

    border: 1px solid #d6e0ef;

    border-radius: 18px;

    color: #10234b;

    background: linear-gradient(

        145deg,

        #ffffff 0%,

        #edf3ff 100%

    );

    box-shadow:

        0 3px 7px rgba(28, 61, 112, 0.08);

    font-size: 15px;

    font-weight: 700;

    line-height: 1.3;

    text-align: center;

    cursor: pointer;

    transition:

        transform 0.2s ease,

        background 0.2s ease,

        border-color 0.2s ease,

        box-shadow 0.2s ease;

}

/* =========================================================

   13. IKON FAQ

   ========================================================= */

.quick-item i {

    color: #0878e8;

    font-size: 31px;

}

/* =========================================================

   14. EFEK HOVER FAQ

   ========================================================= */

.quick-item:hover {

    transform: translateY(-3px);

    border-color: #60a5fa;

    background: #e5f1ff;

    box-shadow:

        0 7px 14px rgba(28, 61, 112, 0.12);

}

/* =========================================================

   15. FAQ WARNA HIJAU MUDA

   ========================================================= */

.quick-item:nth-child(1),

.quick-item:nth-child(4) {

    border-color: #9bd9ca;

    background: linear-gradient(

        145deg,

        #e8fbf4 0%,

        #d5f3e8 100%

    );

}

/* =========================================================

   16. AREA PERCAKAPAN

   ========================================================= */

#chat-box {

    display: flex;

    flex-direction: column;

    gap: 8px;

    width: 100%;

    height: clamp(400px, 58vh, 650px);

    min-height: 400px;

    margin: 0;

    padding: 18px;

    overflow-x: hidden;

    overflow-y: auto;

    border: 1px solid #e0eafa;

    border-radius: 20px;

    background: rgba(235, 243, 255, 0.85);

    scroll-behavior: smooth;

}

/* =========================================================

   17. BALON PESAN

   ========================================================= */

#chat-box .message {

    width: fit-content;

    max-width: 96%;

    margin: 0;

    padding: 12px 17px;

    border-radius: 18px;

    font-size: 15px;

    line-height: 1.55;

    overflow-wrap: anywhere;

    white-space: pre-wrap;

}

/* =========================================================

   18. PESAN USER

   ========================================================= */

#chat-box .user {

    align-self: flex-end;

    color: #ffffff;

    background: #0878e8;

    border-bottom-right-radius: 5px;

}

/* =========================================================

   19. PESAN BOT

   ========================================================= */

#chat-box .bot {

    align-self: flex-start;

    color: #17233f;

    background: #e1e9f7;

    border-bottom-left-radius: 5px;

}

/* =========================================================

   20. PESAN ERROR

   ========================================================= */

#chat-box .chat-error {

    color: #b91c1c;

}

/* =========================================================

   21. LINK DI AREA CHAT

   ========================================================= */

#chat-box a {

    color: #075fc0;

    overflow-wrap: anywhere;

}

/* =========================================================

   22. FORM INPUT PESAN

   ========================================================= */

.message-input-area {

    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    margin: 14px 0 0;

    padding: 7px;

    border: 1px solid #cbd5e1;

    border-radius: 40px;

    background: #ffffff;

    box-shadow:

        0 2px 5px rgba(15, 45, 95, 0.05);

}

/* =========================================================

   23. TOMBOL LAMPIRAN

   ========================================================= */

.attachment-button {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 42px;

    min-width: 42px;

    height: 42px;

    border: none;

    border-right: 1px solid #dce4f0;

    border-radius: 50%;

    color: #4776b8;

    background: transparent;

    font-size: 21px;

    cursor: pointer;

}

/* =========================================================

   24. INPUT PERTANYAAN

   ========================================================= */

#message-input {

    flex: 1;

    width: 0;

    min-width: 0;

    min-height: 44px;

    padding: 10px 12px;

    border: none;

    outline: none;

    color: #17233f;

    background: transparent;

    font-size: 16px;

}

/* =========================================================

   25. PLACEHOLDER INPUT

   ========================================================= */

#message-input::placeholder {

    color: #64748b;

}

/* =========================================================

   26. FOKUS INPUT

   ========================================================= */

#message-input:focus {

    outline: none;

    box-shadow: none;

}

/* =========================================================

   27. TOMBOL KIRIM

   ========================================================= */

#send-button {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    min-width: 120px;

    min-height: 46px;

    padding: 10px 20px;

    border: none;

    border-radius: 30px;

    color: #ffffff;

    background: linear-gradient(

        135deg,

        #1689ff 0%,

        #0064d9 100%

    );

    font-size: 16px;

    font-weight: 700;

    white-space: nowrap;

    cursor: pointer;

    transition: background 0.2s ease;

}

/* =========================================================

   28. HOVER TOMBOL KIRIM

   ========================================================= */

#send-button:hover {

    background: linear-gradient(

        135deg,

        #0878e8 0%,

        #0055bf 100%

    );

}

/* =========================================================

   29. TOMBOL KIRIM NONAKTIF

   ========================================================= */

#send-button:disabled {

    opacity: 0.6;

    cursor: not-allowed;

}

/* =========================================================

   30. AREA WHATSAPP

   ========================================================= */

.chat-admin {

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 14px 0 0;

    text-align: center;

}

/* =========================================================

   31. TOMBOL WHATSAPP

   ========================================================= */

.chat-admin a {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    min-width: 250px;

    min-height: 48px;

    padding: 10px 24px;

    border-radius: 35px;

    color: #ffffff;

    background: linear-gradient(

        135deg,

        #14b86a 0%,

        #008d4d 100%

    );

    box-shadow:

        0 3px 8px rgba(0, 141, 77, 0.18);

    font-size: 17px;

    font-weight: 700;

    text-decoration: none;

    transition:

        transform 0.2s ease,

        background 0.2s ease;

}

/* =========================================================

   32. HOVER WHATSAPP

   ========================================================= */

.chat-admin a:hover {

    transform: translateY(-2px);

    color: #ffffff;

    background: #008d4d;

}

/* =========================================================

   33. IKON WHATSAPP

   ========================================================= */

.wa-icon {

    width: 35px;

    height: 35px;

    object-fit: contain;

}

/* =========================================================

   34. ANIMASI MASKOT

   ========================================================= */

@keyframes mascotFloat {

    0%,

    100% {

        transform: translateY(0);

    }

    50% {

        transform: translateY(-5px);

    }

}

/* =========================================================

   35. RESPONSIVE TABLET

   ========================================================= */

@media (max-width: 900px) {

    body {

        padding: 12px;

    }

    .chat-container {

        min-height: 95vh;

        padding: 20px;

        border-radius: 22px;

    }

    .quick-list {

        grid-template-columns: repeat(3, minmax(0, 1fr));

    }

    .quick-item {

        min-height: 95px;

    }

    .welcome-area {

        gap: 15px;

        padding: 16px 20px;

    }

    .welcome-mascot {

        width: 180px;

        min-width: 150px;

    }

    .welcome-text h2 {

        font-size: 24px;

    }

    .welcome-text h3 {

        font-size: 16px;

    }

    .welcome-text p {

        font-size: 14px;

    }

}

/* =========================================================

   36. RESPONSIVE HP

   ========================================================= */

@media (max-width: 600px) {

    body {

        display: block;

        min-height: 100vh;

        padding: 8px;

    }

    .chat-container {

        width: 100%;

        min-height: calc(100vh - 16px);

        margin: 0 auto;

        padding: 14px;

        border-radius: 18px;

    }

    .chat-container::before {

        width: 120px;

        height: 55px;

    }

    .chat-container::after {

        width: 150px;

        height: 45px;

    }

    .header-area {

        gap: 12px;

        margin-bottom: 18px;

    }

    .logo {

        width: 58px;

        height: 58px;

    }

    .header-text h1 {

        font-size: 21px;

    }

    .header-text p {

        font-size: 12px;

    }

    .welcome-area {

        flex-direction: row;

        gap: 10px;

        min-height: 115px;

        margin-bottom: 16px;

        padding: 12px;

        border-radius: 28px;

    }

    .welcome-mascot {

        width: 100px;

        min-width: 90px;

        height: 95px;

    }

    .welcome-text h2 {

        font-size: 19px;

    }

    .welcome-text h3 {

        font-size: 13px;

    }

    .welcome-text p {

        font-size: 12px;

        line-height: 1.4;

    }

    .quick-title {

        gap: 8px;

        margin-bottom: 10px;

        font-size: 16px;

    }

    .quick-title i {

        width: 28px;

        height: 26px;

        font-size: 14px;

    }

    .quick-list {

        grid-template-columns: repeat(3, minmax(0, 1fr));

        gap: 7px;

    }

    .quick-item {

        gap: 5px;

        min-height: 78px;

        padding: 8px 5px;

        border-radius: 13px;

        font-size: 11px;

    }

    .quick-item i {

        font-size: 23px;

    }

    #chat-box {

        height: 36vh;

        min-height: 220px;

        max-height: 350px;

        padding: 10px;

        border-radius: 15px;

    }

    #chat-box .message {

        max-width: 92%;

        padding: 9px 12px;

        font-size: 13px;

    }

    .message-input-area {

        gap: 5px;

        margin-top: 12px;

        padding: 5px;

    }

    .attachment-button {

        width: 32px;

        min-width: 32px;

        height: 36px;

        font-size: 18px;

    }

    #message-input {

        min-height: 40px;

        padding: 8px;

        font-size: 14px;

    }

    #send-button {

        min-width: 78px;

        min-height: 40px;

        gap: 5px;

        padding: 8px 12px;

        font-size: 13px;

    }

    .chat-admin {

        margin-top: 12px;

    }

    .chat-admin a {

        min-width: 210px;

        min-height: 43px;

        padding: 9px 18px;

        font-size: 14px;

    }

    .wa-icon {

        width: 21px;

        height: 21px;

    }

}

/* =========================================================

   37. HP KECIL

   ========================================================= */

@media (max-width: 360px) {

    .chat-container {

        padding: 10px;

    }

    .header-area {

        gap: 8px;

    }

    .logo {

        width: 48px;

        height: 48px;

    }

    .header-text h1 {

        font-size: 18px;

    }

    .header-text p {

        font-size: 11px;

    }

    .welcome-mascot {

        width: 75px;

        min-width: 75px;

    }

    .welcome-text h2 {

        font-size: 17px;

    }

    .welcome-text h3 {

        font-size: 12px;

    }

    .welcome-text p {

        font-size: 11px;

    }

    .quick-list {

        gap: 5px;

    }

    .quick-item {

        min-height: 72px;

        padding: 6px 3px;

        font-size: 10px;

    }

    .quick-item i {

        font-size: 20px;

    }

    #send-button {

        min-width: 65px;

        padding: 7px 9px;

    }

}

/* =========================================================

   38. AKSESIBILITAS

   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,

    *::before,

    *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;

    }

}

/* Hanya mengurangi skala tampilan desktop/laptop */

@media (min-width: 901px) {

    html {

        zoom: 70%;

    }

}

/* Perbesar hanya ikon WhatsApp Chat Admin */

.chat-admin a img.wa-icon {

    width: 40px !important;

    height: 40px !important;

    min-width: 40px !important;

    min-height: 40px !important;

    object-fit: contain;

    transform: scale(1.7);

    transform-origin: center;

}

/* Robot maskot tambahan di sebelah kiri chatbot */

.robot-maskot-side {

    position: fixed;

    left: 115px;

    bottom: 20px;

    width: 210px;

    height: auto;

    object-fit: contain;

    z-index: 10;

    pointer-events: none;

}

/* Penyesuaian ukuran pada layar HP */

@media (max-width: 600px) {

    .robot-maskot-side {

        width: 100px;

        left: 5px;

        bottom: 10px;

    }

}

/* Posisi dan ukuran robot maskot tambahan */

img.robot-maskot-side {

    position: fixed !important;

    right: 35px !important;

    left: auto !important;

    bottom: 50px !important;

    width: 400px !important;

    height: auto !important;

    object-fit: contain;

    transform: scaleX(-1);

    z-index: 9999;

    pointer-events: none;

}

@media (max-width: 600px) {

    img.robot-maskot-side {

        width: 100px !important;

        right: auto !important;

        left: 5px !important;

        bottom: 10px !important;

    }

}

/* =========================================================

   TOMBOL MIKROFON DAN SPEAKER UNIBOT

   ========================================================= */

#microphone-button,

#speech-button {

    width: 42px;

    height: 42px;

    min-width: 42px;

    padding: 0;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #d8e7fb;

    border-radius: 50%;

    background: #f0f6ff;

    color: #0878e8;

    font-size: 18px;

    cursor: pointer;

    transition:

        background 0.2s ease,

        color 0.2s ease,

        border-color 0.2s ease,

        transform 0.2s ease,

        box-shadow 0.2s ease;

    flex-shrink: 0;

}

/* Efek ketika mouse diarahkan ke tombol */

#microphone-button:hover,

#speech-button:hover {

    background: #0878e8;

    color: #ffffff;

    border-color: #0878e8;

    transform: translateY(-2px);

    box-shadow: 0 4px 10px rgba(8, 120, 232, 0.2);

}

/* Efek ketika tombol ditekan */

#microphone-button:active,

#speech-button:active {

    transform: scale(0.94);

}

/* Fokus keyboard */

#microphone-button:focus-visible,

#speech-button:focus-visible {

    outline: 3px solid rgba(8, 120, 232, 0.3);

    outline-offset: 3px;

}

/* Mikrofon sedang mendengarkan */

#microphone-button.microphone-active {

    background: #e53935;

    color: #ffffff;

    border-color: #e53935;

    animation: microphonePulse 1.4s infinite;

}

/* Hover ketika mikrofon aktif */

#microphone-button.microphone-active:hover {

    background: #c62828;

    border-color: #c62828;

}

/* Speaker dimatikan */

#speech-button.speech-disabled {

    background: #f1f2f4;

    color: #7b8491;

    border-color: #e0e3e7;

}

/* Animasi mikrofon */

@keyframes microphonePulse {

    0% {

        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.35);

    }

    70% {

        box-shadow: 0 0 0 8px rgba(229, 57, 53, 0);

    }

    100% {

        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);

    }

}

/* Menghormati pengaturan pengurangan animasi */

@media (prefers-reduced-motion: reduce) {

    #microphone-button,

    #speech-button {

        transition: none;

    }

    #microphone-button.microphone-active {

        animation: none;

    }

}

/* Chat Admin di bawah kaki robot maskot */

.chat-admin {

    position: fixed;

    right: 95px;

    bottom: 12px;

    z-index: 20;

    margin: 0;

    width: auto;

}

.chat-admin a {

    min-width: 175px;

    min-height: 42px;

    padding: 8px 16px;

    font-size: 14px;

}

/* Tampilan HP */

@media (max-width: 600px) {

    .chat-admin {

        position: static;

        width: 100%;

        margin-top: 12px;

    }

}

/* ==========================================

   POSISI CHAT ADMIN PMB

   ========================================== */

@media (min-width: 901px) {

    .chat-admin {

        position: fixed !important;

        right: 90px !important;

        bottom: 12px !important;

        left: auto !important;

        width: auto !important;

        margin: 0 !important;

        display: flex;

        justify-content: center;

        align-items: center;

        z-index: 10000;

    }

}

/* Tampilan HP */

@media (max-width: 600px) {

    .chat-admin {

        position: static !important;

        width: 100% !important;

        margin-top: 12px !important;

    }

}

/* =========================================

   MEMPERLEBAR CONTAINER CHATBOT PMB

   ========================================= */

/* Layout desktop: lebar tetapi tetap proporsional */

@media (min-width: 901px) {

    .chat-container {

        width: min(1200px, calc(100% - 260px)) !important;

        max-width: 1200px !important;

        margin: 12px auto !important;

        transform: none !important;

        zoom: 1 !important;

    }

    #chat-box {

    width: 100% !important;

    height: 42vh !important;

    min-height: 320px !important;

    max-height: 460px !important;

}

}

/* Geser ornamen kanan atas ke atas */
.chat-container::before {
    top: 4px !important;
    transform: translateY(-15px) !important;
}

/* =========================================
   TOMBOL SPEAKER PADA SETIAP PESAN CHATBOT
   ========================================= */

/* Tombol speaker ditampilkan pada pesan bot dan tidak memutar suara otomatis. */
.message-speaker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    margin: 8px 0 0 6px;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 50%;
    background: #ffffff;
    color: #2563eb;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, transform 0.2s ease,
                box-shadow 0.2s ease;
}

.message-speaker:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 3px 9px rgba(37, 99, 235, 0.16);
}

.message-speaker:active {
    transform: scale(0.94);
}

.message-speaker:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.message-speaker svg,
.message-speaker i {
    width: 17px;
    height: 17px;
    font-size: 17px;
    pointer-events: none;
}

/* Kondisi ketika pesan sedang dibacakan. */
.message-speaker-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.message-speaker-active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

/* Penyesuaian tombol speaker untuk layar ponsel. */
@media (max-width: 600px) {
    .message-speaker {
        width: 30px;
        height: 30px;
        min-width: 30px;
        margin-top: 7px;
    }

    .message-speaker svg,
    .message-speaker i {
        width: 16px;
        height: 16px;
        font-size: 16px;
    }
}


/* =========================================================
   RESPONSIVE MASKOT UNIBOT
   Menjaga ukuran robot tetap proporsional saat jendela
   browser diperkecil dan pada perangkat ponsel.
   ========================================================= */

/* Laptop kecil dan jendela browser yang tidak maksimal */
@media (min-width: 901px) and (max-width: 1200px) {
    img.robot-maskot-side {
        width: clamp(190px, 25vw, 280px) !important;
        right: 12px !important;
        left: auto !important;
        bottom: 58px !important;
    }
}

/* Tablet dan jendela browser berukuran sedang */
@media (min-width: 601px) and (max-width: 900px) {
    img.robot-maskot-side {
        width: clamp(125px, 21vw, 175px) !important;
        right: 8px !important;
        left: auto !important;
        bottom: 76px !important;
    }
}

/* Ponsel */
@media (max-width: 600px) {
    img.robot-maskot-side {
        width: clamp(72px, 22vw, 96px) !important;
        right: 4px !important;
        left: auto !important;
        bottom: 82px !important;
        z-index: 9 !important;
    }
}

/* Ponsel dengan layar sangat kecil */
@media (max-width: 360px) {
    img.robot-maskot-side {
        width: 68px !important;
        right: 2px !important;
        bottom: 82px !important;
    }
}

/* =========================================================
   TAMBAHAN RESPONSIVE KHUSUS HP DAN IPAD/TABLET
   File asli dipertahankan; aturan berikut hanya menimpa
   layout pada perangkat sentuh. Laptop dan desktop tidak
   menjadi target aturan ini.
   Ornamen, background, logo, dan maskot sambutan tetap.
   ========================================================= */

/* HP Android dan iPhone */
@media screen and (max-width: 600px) and (hover: none) and (pointer: coarse) {
    html,
    body {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    html {
        zoom: 1 !important;
    }

    body {
        display: block;
        min-height: 100vh;
        min-height: 100svh;
        padding: 8px;
        background-attachment: scroll;
    }

    .chat-container {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: calc(100vh - 16px);
        min-height: calc(100svh - 16px);
        margin: 0 auto;
        padding: clamp(10px, 3vw, 14px);
    }

    .header-area {
        gap: clamp(8px, 2.5vw, 12px);
        margin-bottom: clamp(12px, 3vw, 18px);
    }

    .logo {
        width: clamp(46px, 14vw, 58px);
        height: clamp(46px, 14vw, 58px);
    }

    .header-text {
        min-width: 0;
    }

    .header-text h1 {
        font-size: clamp(17px, 5vw, 21px);
        overflow-wrap: anywhere;
    }

    .header-text p {
        font-size: clamp(10px, 3vw, 12px);
        line-height: 1.35;
    }

    .welcome-area {
        width: 100%;
        min-width: 0;
        min-height: clamp(100px, 29vw, 120px);
        gap: clamp(7px, 2.5vw, 12px);
        padding: clamp(9px, 3vw, 13px);
    }

    .welcome-mascot {
        flex: 0 0 clamp(72px, 24vw, 100px);
        width: clamp(72px, 24vw, 100px);
        min-width: 0;
        height: clamp(75px, 25vw, 96px);
    }

    .welcome-text {
        min-width: 0;
    }

    .welcome-text h2 {
        font-size: clamp(16px, 4.8vw, 19px);
    }

    .welcome-text h3 {
        font-size: clamp(11px, 3.4vw, 13px);
        line-height: 1.3;
    }

    .welcome-text p {
        font-size: clamp(10px, 3.1vw, 12px);
        line-height: 1.4;
    }

    .quick-title {
        gap: 7px;
        font-size: clamp(14px, 4.2vw, 16px);
    }

    .quick-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(5px, 1.8vw, 8px);
    }

    .quick-item {
        min-width: 0;
        min-height: clamp(68px, 20vw, 82px);
        padding: 7px 4px;
        gap: 4px;
        font-size: clamp(9px, 2.9vw, 11px);
        overflow-wrap: anywhere;
    }

    .quick-item i {
        font-size: clamp(19px, 6vw, 24px);
    }

    #chat-box {
        width: 100%;
        height: clamp(200px, 36svh, 350px);
        min-height: 190px;
        max-height: 350px;
        padding: 9px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #chat-box .message {
        max-width: 94%;
        padding: 9px 11px;
        font-size: clamp(12px, 3.4vw, 14px);
    }

    .message-input-area {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 4px;
        margin-top: 9px;
        padding: 5px;
    }

    .attachment-button {
        flex: 0 0 32px;
        width: 32px;
        min-width: 32px;
        height: 36px;
    }

    #microphone-button {
        flex: 0 0 34px;
        width: 34px;
        min-width: 34px;
        height: 36px;
    }

    #message-input {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        min-height: 38px;
        padding: 6px 5px;
        font-size: 13px;
    }

    #send-button {
        display: inline-flex;
        flex: 0 0 auto;
        min-width: 64px;
        min-height: 38px;
        padding: 6px 9px;
        gap: 4px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* Admin mengikuti alur halaman setelah kolom input. */
    .chat-admin {
        position: static !important;
        inset: auto !important;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100% !important;
        margin: 9px 0 2px !important;
        transform: none !important;
        z-index: 1;
    }

    .chat-admin a {
        min-width: min(210px, 100%);
        min-height: 40px;
        padding: 7px 14px;
        gap: 8px;
        font-size: 13px;
    }

    .chat-admin a img.wa-icon,
    .chat-admin .wa-icon {
        width: 25px !important;
        height: 25px !important;
        min-width: 25px !important;
        min-height: 25px !important;
        transform: none !important;
    }

    /* Hilangkan robot samping; maskot di area sambutan tetap tampil. */
    img.robot-maskot-side,
    .robot-maskot-side {
        display: none !important;
        visibility: hidden !important;
    }

    .message-speaker {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }
}

/* HP dengan lebar sangat kecil */
@media screen and (max-width: 360px) and (hover: none) and (pointer: coarse) {
    .chat-container {
        padding: 9px;
    }

    .header-area {
        gap: 7px;
    }

    .logo {
        width: 45px;
        height: 45px;
    }

    .welcome-mascot {
        flex-basis: 68px;
        width: 68px;
        height: 72px;
    }

    .quick-list {
        gap: 5px;
    }

    .quick-item {
        min-height: 66px;
        padding: 6px 3px;
        font-size: 9px;
    }

    .message-input-area {
        gap: 2px;
        padding: 4px;
    }

    .attachment-button {
        flex-basis: 28px;
        width: 28px;
        min-width: 28px;
    }

    #microphone-button {
        flex-basis: 30px;
        width: 30px;
        min-width: 30px;
    }

    #message-input {
        padding-left: 3px;
        padding-right: 3px;
        font-size: 11px;
    }

    #send-button {
        min-width: 56px;
        padding: 5px 6px;
        font-size: 10px;
    }
}

/* iPad dan tablet layar sentuh: portrait maupun landscape.
   Query pointer coarse membatasi aturan ini ke perangkat sentuh,
   sehingga laptop layar kecil tidak ikut terkena perubahan. */
@media screen and (min-width: 601px) and (hover: none) and (pointer: coarse) {
    html {
        width: 100%;
        zoom: 1 !important;
    }

    body {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 100vh;
        padding: clamp(12px, 2vw, 24px);
        overflow-x: hidden;
        background-attachment: scroll;
    }

    .chat-container {
        box-sizing: border-box;
        width: min(100%, 1100px);
        max-width: 1100px;
        min-width: 0;
        min-height: min(92vh, 1050px);
        margin: auto;
        padding: clamp(18px, 2.5vw, 30px);
        zoom: 1 !important;
        transform: none;
    }

    .header-area {
        gap: clamp(12px, 2vw, 20px);
        margin-bottom: clamp(16px, 2vw, 24px);
    }

    .logo {
        width: clamp(60px, 7vw, 82px);
        height: clamp(60px, 7vw, 82px);
    }

    .header-text h1 {
        font-size: clamp(24px, 3vw, 36px);
    }

    .header-text p {
        font-size: clamp(13px, 1.5vw, 17px);
    }

    .welcome-area {
        width: min(820px, 100%);
        min-height: clamp(125px, 15vw, 155px);
        padding: clamp(14px, 2vw, 20px) clamp(18px, 2.5vw, 26px);
    }

    .welcome-mascot {
        width: clamp(145px, 18vw, 200px);
        min-width: clamp(130px, 15vw, 180px);
        height: clamp(105px, 13vw, 130px);
    }

    .welcome-text h2 {
        font-size: clamp(22px, 2.5vw, 27px);
    }

    .welcome-text h3 {
        font-size: clamp(15px, 1.7vw, 18px);
    }

    .welcome-text p {
        font-size: clamp(13px, 1.5vw, 16px);
    }

    .quick-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(8px, 1.2vw, 12px);
    }

    .quick-item {
        min-width: 0;
        min-height: clamp(82px, 9vw, 108px);
        padding: 10px 7px;
        font-size: clamp(12px, 1.4vw, 15px);
    }

    .quick-item i {
        font-size: clamp(24px, 2.8vw, 31px);
    }

    #chat-box {
        width: 100%;
        height: clamp(280px, 42vh, 520px);
        min-height: 260px;
        max-height: 520px;
        padding: clamp(12px, 1.6vw, 18px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .message-input-area {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: clamp(6px, 1vw, 10px);
    }

    .attachment-button {
        flex: 0 0 42px;
    }

    #microphone-button {
        flex: 0 0 42px;
    }

    #message-input {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
    }

    #send-button {
        flex: 0 0 auto;
        min-width: 100px;
    }

    /* Admin diletakkan setelah input, tidak mengambang di atasnya. */
    .chat-admin {
        position: static !important;
        inset: auto !important;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100% !important;
        margin: 12px 0 3px !important;
        transform: none !important;
        z-index: 1;
    }

    .chat-admin a {
        min-width: 210px;
        min-height: 44px;
        padding: 8px 18px;
        font-size: 14px;
    }

    .chat-admin a img.wa-icon,
    .chat-admin .wa-icon {
        width: 27px !important;
        height: 27px !important;
        min-width: 27px !important;
        min-height: 27px !important;
        transform: none !important;
    }

    /* Hilangkan robot samping di semua iPad/tablet. */
    img.robot-maskot-side,
    .robot-maskot-side {
        display: none !important;
        visibility: hidden !important;
    }
}

/* iPad/tablet landscape: gunakan ruang horizontal lebih lega. */
@media screen and (min-width: 900px) and (hover: none) and (pointer: coarse) and (orientation: landscape) {
    .chat-container {
        width: min(1100px, 94%);
        max-width: 1100px;
    }

    .quick-list {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    #chat-box {
        height: clamp(280px, 43vh, 500px);
    }
}
