body {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background: #f0f4f8;
    /* Softer background */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.page-logo {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
    text-align: center;
}

.page-logo img {
    width: 50px;
    height: auto;
    opacity: 0.8;
}

.page-logo h3 {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.page-logo p {
    margin: 2px 0 0;
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

.chat-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 520px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    height: 650px;
    overflow: hidden;
    border: 1px solid #e3e8ee;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e3e8ee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.chat-header img {
    width: 36px;
    height: 36px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #e3e8ee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.chat-header img {
    width: 36px;
    height: 36px;
    margin-left: 20px;
    margin-right: 0;
    z-index: 1;
}

.chat-header h2 {
    flex: 1;
    background: #f76d32;
    color: #fff;
    border-radius: 0 8px 8px 0;
    padding: 12px 20px 12px 24px;
    margin: 0 0 0 -8px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    height: 36px;
}

.chat-window {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
    position: relative;
}

.chat-window::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    max-width: 400px;
    max-height: 300px;
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.chat-bubble {
    position: relative;
    z-index: 1;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    animation: pop-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes pop-in {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.user {
    align-self: flex-end;
    background: #10B981;
    /* Teal from logo */
    color: #fff;
    border-bottom-right-radius: 5px;
}

.bot {
    align-self: flex-start;
    background: #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 5px;
}

#chat-form {
    display: flex;
    border-top: 1px solid #e3e8ee;
    background: #f1f5f9;
    padding: 12px;
    align-items: center;
    gap: 10px;
}

#chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 20px;
    outline: none;
    background: #fff;
    transition: box-shadow 0.2s;
}

#chat-input:focus {
    box-shadow: 0 0 0 2px #10B981;
    border-color: #10B981;
}

#chat-form button[type="submit"] {
    background: #10B981;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    width: 42px;
    height: 42px;
    font-size: 18px;
    padding-left: 2px;
    /* Center icon */
}

#chat-form button[type="submit"]:hover {
    background: #059669;
}

#mic-btn {
    display: none;
    margin: 8px auto 8px auto;
    background: #10B981;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.2s;
}

#mic-btn:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.upload-btn {
    display: block;
    margin: 8px auto;
    background: #3B82F6;
    /* Blue for file uploads */
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transition: all 0.2s;
}

.upload-btn:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.option-btn {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.option-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.option-btn-next {
    background: #f76d32;
    border-color: #f76d32;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-right: 18px;
    position: relative;
}

.option-btn-next::after {
    content: '\2192';
    position: absolute;
    right: 12px;
    font-size: 16px;
    line-height: 1;
}

.option-btn-next:hover {
    background: #df5e28;
    border-color: #df5e28;
    color: #fff;
}

.chat-bubble .option-btn {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    text-align: left;
    padding: 10px 16px;
    height: auto;
    line-height: 1.4;
}

.chat-bubble div {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 18px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #94a3b8;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-of-type(2) {
    animation-delay: -0.8s;
}

.typing-indicator span:nth-of-type(3) {
    animation-delay: -0.4s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

.chat-bubble img {
    max-width: 160px;
    border-radius: 8px;
    margin-top: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chat-bubble audio {
    margin-top: 8px;
    width: 180px;
}

.hidden {
    display: none;
}

#question-container button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    cursor: pointer;
}

#question-container button:hover {
    background-color: #e0e0e0;
}

/* Option-level speaker icon row placed under each option */
.option-with-tts {
    display: grid;
    grid-template-columns: 1fr 24px;
    /* left: option, right: icon */
    align-items: center;
    column-gap: 8px;
    width: 100%;
}

.option-tts-icon {
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    line-height: 1;
    justify-self: end;
}

.option-with-tts .option-btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
    /* allow wrapping */
    overflow: visible;
    text-overflow: clip;
}

.option-tts-icon:focus {
    outline: 2px solid #10B981;
    border-radius: 4px;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .page-logo {
        display: none;
    }

    body {
        /* Remove centering to allow full-screen layout on mobile */
        display: block;
        height: 100%;
        width: 100%;
        overflow: hidden;
        /* Prevent body from scrolling */
    }

    html {
        height: 100%;
        width: 100%;
    }

    .chat-container {
        height: 100%;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
}