/* ==========================================================================
   Dr. Ankit Parakh - Appointment Booking Chatbot Styles
   ========================================================================== */

/* 1. Floating Launcher Button */
.ap-chatbot-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, #004D5A 100%);
    border: 2px solid rgba(0, 168, 150, 0.4);
    border-radius: 50px;
    padding: 6px 18px 6px 8px;
    box-shadow: 0 10px 30px rgba(10, 37, 64, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-heading);
    user-select: none;
}

.ap-chatbot-launcher:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 36px rgba(0, 168, 150, 0.35);
    border-color: var(--color-teal);
}

.launcher-pulse {
    position: absolute;
    top: 50%;
    left: 24px;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(0, 168, 150, 0.4);
    z-index: 1;
    animation: apPulse 2.4s infinite;
    pointer-events: none;
}

@keyframes apPulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
    70% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.launcher-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.launcher-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 168, 150, 0.4);
}

.launcher-avatar .online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: var(--color-mint);
    border: 2px solid var(--color-bg-white);
    border-radius: 50%;
}

.launcher-label {
    display: flex;
    flex-direction: column;
}

.launcher-label .label-heading {
    color: var(--color-bg-white);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.launcher-label .label-sub {
    color: var(--color-cyan);
    font-size: var(--text-2xs);
    font-weight: 500;
    line-height: 1.3;
}

.launcher-close-icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #E53E3E;
}

.ap-chatbot-launcher.is-active {
    padding: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-primary);
    justify-content: center;
}

.ap-chatbot-launcher.is-active .launcher-content,
.ap-chatbot-launcher.is-active .launcher-pulse {
    display: none;
}

.ap-chatbot-launcher.is-active .launcher-close-icon {
    display: flex;
}

/* 2. Chatbot Window */
.ap-chatbot-window {
    position: fixed;
    bottom: 95px;
    right: 28px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 130px);
    background: var(--color-bg-white);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(10, 37, 64, 0.25), 0 0 0 1px rgba(10, 37, 64, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: var(--font-heading);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ap-chatbot-window.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 3. Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0A3654 100%);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-bg-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-header-doctor {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-doctor-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 168, 150, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doctor-badge-online {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--color-mint);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
}

.chat-doctor-meta .chat-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-bg-white);
    line-height: 1.2;
}

.chat-doctor-meta .chat-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-2xs);
    color: var(--color-text-light);
    margin-top: 2px;
}

.chat-subtitle .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-mint);
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-hdr-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #CBD5E1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-hdr-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-bg-white);
}

/* Notice banner */
.chatbot-notice {
    background: #F0FDF4;
    border-bottom: 1px solid #DCFCE7;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-2xs);
    color: #166534;
    font-weight: 600;
}

/* 4. Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--color-bg-alt);
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

/* Message Rows */
.chat-msg-row {
    display: flex;
    gap: 10px;
    animation: apMsgIn 0.3s ease-out forwards;
}

@keyframes apMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-bot {
    align-items: flex-start;
}

.chat-msg-user {
    justify-content: flex-end;
}

.chat-bot-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg-bubble {
    max-width: 84%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: var(--text-sm);
    line-height: 1.5;
    position: relative;
}

.chat-msg-bot .chat-msg-bubble {
    background: var(--color-bg-white);
    color: var(--color-text-main);
    border-top-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--color-border);
}

.chat-msg-user .chat-msg-bubble {
    background: var(--color-teal);
    color: var(--color-bg-white);
    border-top-right-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 168, 150, 0.25);
}

.chat-msg-time {
    font-size: var(--text-3xs);
    color: var(--color-text-light);
    margin-top: 4px;
    text-align: right;
}

.chat-msg-user .chat-msg-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Quick Action Options Grid inside Chat */
.chat-action-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.chat-opt-btn {
    background: var(--color-border-light);
    border: 1px solid #CBD5E1;
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.chat-opt-btn:hover {
    background: var(--color-teal);
    color: var(--color-bg-white);
    border-color: var(--color-teal);
    transform: translateX(3px);
}

.chat-opt-btn.btn-primary-opt {
    background: #E6FFFA;
    border-color: var(--color-teal);
    color: #007A6C;
}
.chat-opt-btn.btn-primary-opt:hover {
    background: var(--color-teal);
    color: var(--color-bg-white);
}

/* Interactive Embedded Booking Form */
.chat-embedded-form {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 14px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.chat-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-form-group label {
    font-size: var(--text-2xs);
    font-weight: 700;
    color: var(--color-text-body);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chat-form-input,
.chat-form-select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    font-size: var(--text-sm);
    font-family: inherit;
    color: var(--color-text-main);
    background: var(--color-bg-alt);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.chat-form-input:focus,
.chat-form-select:focus {
    outline: none;
    border-color: var(--color-teal);
    background: var(--color-bg-white);
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.15);
}

.chat-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.chat-form-submit-btn {
    background: var(--color-teal);
    color: var(--color-bg-white);
    border: none;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 168, 150, 0.3);
}

.chat-form-submit-btn:hover {
    background: #008274;
    transform: translateY(-1px);
}

/* Appointment Summary Card */
.chat-summary-card {
    background: var(--color-bg-white);
    border: 1.5px solid var(--color-teal);
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    box-shadow: 0 6px 18px rgba(0, 168, 150, 0.12);
}

.chat-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #CBD5E1;
}

.chat-summary-header svg {
    color: var(--color-mint);
}

.chat-summary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--color-text-strong);
    margin-bottom: 14px;
}

.chat-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chat-summary-row span:first-child {
    color: var(--color-text-muted);
    font-weight: 500;
}
.chat-summary-row span:last-child {
    color: var(--color-primary);
    font-weight: 700;
    text-align: right;
}

.chat-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-btn-whatsapp-confirm {
    background: #25D366;
    color: var(--color-bg-white);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.chat-btn-whatsapp-confirm:hover {
    background: #1EBE5B;
    transform: translateY(-2px);
}

.chat-btn-direct-submit {
    background: var(--color-primary);
    color: var(--color-bg-white);
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.chat-btn-direct-submit:hover {
    background: #004D5A;
}

/* Typing Indicator Animation */
.chat-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--color-bg-white);
    border-radius: 14px;
    border: 1px solid var(--color-border);
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-light);
    animation: apTypingDot 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(1) { animation-delay: 0s; }
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes apTypingDot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; background: var(--color-teal); }
}

/* 5. Chips Bar */
.chatbot-chips-bar {
    padding: 8px 12px;
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border-light);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.chatbot-chips-bar::-webkit-scrollbar {
    display: none;
}

.chat-chip-btn {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-body);
    font-size: var(--text-2xs);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-chip-btn:hover {
    background: #E6FFFA;
    color: var(--color-teal);
    border-color: var(--color-teal);
}

/* 6. Footer Input */
.chatbot-footer {
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    padding: 10px 14px 8px;
}

.chatbot-input-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 24px;
    font-size: var(--text-sm);
    font-family: inherit;
    outline: none;
    background: var(--color-bg-alt);
    color: var(--color-text-main);
    transition: all 0.2s ease;
}

.chatbot-input:focus {
    border-color: var(--color-teal);
    background: var(--color-bg-white);
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.12);
}

.chatbot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-teal);
    border: none;
    color: var(--color-bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
    background: #008274;
    transform: scale(1.05);
}

.chatbot-footer-brand {
    text-align: center;
    font-size: var(--text-3xs);
    /* --color-text-light is 2.56:1 on white, below the 4.5:1 minimum, and this
       is real text at 11px rather than a separator or an icon. */
    color: var(--color-text-muted);
    margin-top: 6px;
}

/* Responsive Rules for Mobile */
@media (max-width: 768px) {
    .ap-chatbot-launcher {
        /* The sticky action bar is 76px tall, so 72px left the launcher sitting
           4px inside it. 88px clears the bar and leaves a visible gap. */
        bottom: 88px;
        right: 16px;
        padding: 5px 12px 5px 6px;
    }

    .launcher-avatar {
        width: 38px;
        height: 38px;
    }

    .launcher-label .label-heading {
        font-size: var(--text-2xs);
    }
    .launcher-label .label-sub {
        font-size: var(--text-3xs);
    }

    .ap-chatbot-window {
        bottom: 70px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        height: calc(100vh - 150px);
        max-height: 560px;
    }
}

/* ==========================================================================
   Readability pass.
   Options used to turn solid teal with white text on hover, but lines inside
   them kept a hard-coded light grey, so a hovered location's address and
   timings disappeared. Hover is now a light tint that keeps every line's
   colour; body text is a size up with more line height.
   ========================================================================== */
.chat-msg-bubble {
    font-size: var(--text-sm);
    line-height: 1.55;
}

.chat-opt-btn {
    font-size: var(--text-sm);
    line-height: 1.4;
    gap: 10px;
    text-decoration: none;
}

.chat-opt-btn:hover,
.chat-opt-btn:focus-visible,
.chat-opt-btn.btn-primary-opt:hover,
.chat-opt-btn.btn-primary-opt:focus-visible {
    background: #E6FFFA;
    color: #00574D;
    border-color: var(--color-teal);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 168, 150, 0.15);
}

.chat-opt-btn:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

.chat-link-opt {
    font-weight: 700;
    color: var(--color-primary);
}

.chat-link-opt.btn-primary-opt {
    color: #007A6C;
}

/* Location options in the booking step. */
.chat-book-link {
    align-items: center;
    background: var(--color-bg-white);
    border-color: #CBD5E1;
    padding: 12px 14px;
}

.chat-book-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-book-name {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-primary);
}

.chat-book-meta {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: #475569;
}

.chat-book-time {
    color: #00695F;
    font-weight: 600;
}

.chat-book-go {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #E6FFFA;
    color: #00695F;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.chat-book-link:hover .chat-book-go,
.chat-book-link:focus-visible .chat-book-go {
    background: var(--color-teal);
    color: #fff;
}

.chat-hint {
    margin-top: 4px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #475569;
}
/* ==========================================================================
   Redesign — calmer, less cluttered.
   Light header with an "AP" avatar, the conversation on a soft grey, bot
   messages as plain white cards, options as list rows with line icons, one
   rounded input. No notice strip, quick chips, timestamps or footer credit.
   ========================================================================== */
.ap-chatbot-window {
    width: 380px;
    height: 600px;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(14, 35, 66, 0.22), 0 0 0 1px rgba(14, 35, 66, 0.06);
}

/* Header */
.chatbot-header {
    background: #FFFFFF;
    color: var(--color-primary);
    padding: 14px 14px 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.chat-avatar-ap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-primary);
    color: #FFFFFF;
    font-family: 'Montserrat', var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.chat-avatar-ap .doctor-badge-online {
    bottom: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border: 2px solid #FFFFFF;
    background: #10B981;
}

.chat-doctor-meta .chat-title {
    color: var(--color-primary);
    font-size: var(--text-base);
}

.chat-doctor-meta .chat-subtitle {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    margin-top: 1px;
}

.chat-hdr-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text-muted);
}

.chat-hdr-btn:hover,
.chat-hdr-btn:focus-visible {
    background: var(--color-border-light);
    color: var(--color-primary);
}

/* Removed pieces (in case an old cached template still prints them). */
.chatbot-notice,
.chatbot-chips-bar,
.chatbot-footer-brand,
.chat-msg-time,
.chat-bot-avatar {
    display: none !important;
}

/* Conversation */
.chatbot-messages {
    background: #F6F8FB;
    padding: 18px 16px;
    gap: 12px;
}

.chat-msg-bubble {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: var(--text-sm);
    line-height: 1.55;
}

.chat-msg-bot .chat-msg-bubble {
    width: 100%;
    max-width: 100%;
    background: #FFFFFF;
    color: var(--color-text-strong);
    border-top-left-radius: 16px;
    box-shadow: 0 1px 2px rgba(14, 35, 66, 0.04), 0 0 0 1px #E8EDF3;
}

.chat-msg-user .chat-msg-bubble {
    background: var(--color-teal-dark);
    color: #FFFFFF;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 6px;
    box-shadow: none;
}

.chat-lead {
    margin: 0;
    color: var(--color-primary);
    font-weight: 600;
}

.chat-lead strong {
    font-weight: 700;
}

.chat-hint {
    margin: 2px 0 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.chat-inline-link {
    color: var(--color-teal-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-list {
    margin: 8px 0 0;
    padding-left: 18px;
    list-style: disc;
    color: var(--color-text-strong);
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* Options */
.chat-action-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.chat-opt-btn,
.chat-book-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 10px 10px 10px;
    border: 1px solid #E8EDF3;
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transform: none;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.chat-opt-btn:hover,
.chat-opt-btn:focus-visible,
.chat-opt-btn.btn-primary-opt:hover,
.chat-opt-btn.btn-primary-opt:focus-visible {
    background: #F0FAF8;
    border-color: #B7E4DC;
    color: var(--color-primary);
    transform: none;
    box-shadow: none;
}

.chat-opt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--color-border-light);
    color: var(--color-primary);
    flex-shrink: 0;
}

.chat-opt-label {
    min-width: 0;
}

.chat-opt-chevron {
    display: inline-flex;
    color: #94A3B8;
}

.chat-opt-btn:hover .chat-opt-chevron {
    color: var(--color-teal-dark);
}

/* The main action stands out: teal icon tile. */
.chat-opt-btn.btn-primary-opt {
    background: #FFFFFF;
    border-color: #B7E4DC;
    color: var(--color-primary);
}

.chat-opt-btn.btn-primary-opt .chat-opt-icon {
    background: var(--color-teal-dark);
    color: #FFFFFF;
}

.chat-book-link .chat-opt-icon {
    background: #E6F7F5;
    color: var(--color-teal-dark);
}

.chat-book-name {
    font-size: var(--text-sm);
}

.chat-book-meta {
    font-size: 0.78rem;
    font-weight: 500;
}

.chat-book-go {
    display: none;
}

/* Emergency note */
.chat-alert {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #FEF2F2;
    color: #991B1B;
}

.chat-alert-icon {
    flex-shrink: 0;
    color: #B91C1C;
}

.chat-alert p {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #7F1D1D;
}

/* Typing dots sit in a small white pill. */
.chat-typing-indicator {
    background: #FFFFFF;
    box-shadow: 0 0 0 1px #E8EDF3;
    border-radius: 14px;
}

/* Input */
.chatbot-footer {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--color-border-light);
}

.chatbot-input {
    height: 44px;
    padding: 0 16px;
    border: 1px solid #E2E8F0;
    border-radius: 22px;
    background: #F6F8FB;
}

.chatbot-input:focus {
    border-color: var(--color-teal-dark);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.12);
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    background: var(--color-teal-dark);
}

.chatbot-send-btn:hover,
.chatbot-send-btn:focus-visible {
    background: var(--color-teal-darker, #00655A);
    transform: none;
}

/* Launcher: a little lighter. */
.ap-chatbot-launcher {
    background: var(--color-primary);
    border: none;
    box-shadow: 0 10px 28px rgba(14, 35, 66, 0.28);
}

.launcher-avatar {
    background: var(--color-teal-dark);
}

@media (max-width: 768px) {
    .ap-chatbot-window {
        height: calc(100vh - 150px);
        max-height: 580px;
        border-radius: 18px;
    }
}
