/* =============================================================
   AI Doctor Bot — Jawaba
   Clean, premium medical assistant. Guapa purple + gold.
   ============================================================= */

:root {
    --bot-primary: #633479;
    --bot-primary-dark: #4a2659;
    --bot-primary-light: #8b5fa0;
    --bot-primary-soft: #f5f0f8;
    --bot-accent: #ffc05a;
    --bot-accent-dark: #d99b27;
    --bot-bg: #f4f2f7;
    --bot-white: #ffffff;
    --bot-ink: #1c1530;
    --bot-muted: #6b7280;
    --bot-line: #e9e7ef;
    --bot-line-soft: #ece8f1;
    --bot-radius: 22px;
    --bot-radius-sm: 14px;
    --bot-shadow: 0 10px 40px rgba(74, 38, 89, 0.10);
    --bot-shadow-soft: 0 4px 18px rgba(74, 38, 89, 0.06);
}

.ai-bot-page {
    --bot-nav: 98px;
    min-height: 100vh;
    background:
        radial-gradient(1100px 420px at 85% -8%, rgba(255, 192, 90, 0.16), transparent 60%),
        radial-gradient(900px 460px at 0% 0%, rgba(99, 52, 121, 0.12), transparent 55%),
        var(--bot-bg);
    padding: calc(var(--bot-nav) + 14px) 0 40px;
}

.ai-bot-shell {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding-inline: 1.25rem;
}

/* ── Layout (single scrolling column) ─────────────────────── */
.ai-bot-layout {
    display: block;
}

/* ── Card (content height, single scroll page) ────────────── */
.ai-bot-card {
    position: relative;
    background: var(--bot-white);
    border-radius: var(--bot-radius);
    box-shadow: var(--bot-shadow);
    border: 1px solid var(--bot-line-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ai-bot-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bot-primary), var(--bot-accent), var(--bot-primary));
    z-index: 2;
}

/* ── Voice bar ────────────────────────────────────────────── */
.ai-bot-voice-bar {
    padding: 0.85rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--bot-line-soft);
    background: linear-gradient(180deg, #faf7fd 0%, var(--bot-white) 100%);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

/* Big mic removed from the new layout; voice starts via the input-bar mic. */
.ai-bot-mic-container {
    display: none !important;
}

/* Brand row */
.ai-bot-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    justify-content: flex-start;
    margin-bottom: 0.9rem;
}

.ai-bot-brand__avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    flex-shrink: 0;
    background: conic-gradient(from 140deg, var(--bot-primary), var(--bot-accent), var(--bot-primary));
    box-shadow: var(--bot-shadow-soft);
}

.ai-bot-brand__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bot-white);
    border: 2px solid var(--bot-white);
    object-fit: cover;
    display: block;
}

.ai-bot-brand__dot {
    position: absolute;
    bottom: 1px;
    inset-inline-end: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bot-white);
}

.ai-bot-brand__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}

.ai-bot-brand__name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
}

.ai-bot-brand__role {
    font-size: 0.78rem;
    color: var(--bot-muted);
}

.ai-bot-voice-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 1rem;
    border-radius: 999px;
    background: var(--bot-white);
    color: var(--bot-primary-dark);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0;
    border: 1px solid var(--bot-line);
    box-shadow: var(--bot-shadow-soft);
    max-width: 90%;
}

.ai-bot-voice-status-pill .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bot-primary);
    animation: ai-pulse-dot 1.4s ease-in-out infinite;
}

.ai-bot-voice-status-pill.is-listening { color: #15803d; border-color: #bbf7d0; }
.ai-bot-voice-status-pill.is-listening .pulse-dot { background: #22c55e; }
.ai-bot-voice-status-pill.is-speaking { color: var(--bot-accent-dark); border-color: #fde6b3; }
.ai-bot-voice-status-pill.is-speaking .pulse-dot { background: var(--bot-accent); }
.ai-bot-voice-status-pill.is-error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

.ai-bot-voice-mode {
    margin-inline-start: 0.35rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.ai-bot-voice-mode.is-legacy {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.ai-bot-phase-hint {
    margin: 0 auto;
    max-width: 560px;
    display: grid;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: var(--bot-muted);
}

@keyframes ai-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Mic */
.ai-bot-mic-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.4rem;
}

.ai-bot-mic-wrap {
    position: relative;
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-bot-mic-ring {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 2px solid rgba(99, 52, 121, 0.35);
    opacity: 0;
    pointer-events: none;
}

.ai-bot-mic-wrap.is-listening .ai-bot-mic-ring,
.ai-bot-mic-wrap.is-speaking .ai-bot-mic-ring {
    animation: ai-mic-ripple 1.8s ease-out infinite;
}

.ai-bot-mic-wrap.is-listening .ai-bot-mic-ring { border-color: rgba(34, 197, 94, 0.5); }
.ai-bot-mic-wrap.is-speaking .ai-bot-mic-ring { border-color: rgba(255, 192, 90, 0.6); }
.ai-bot-mic-ring--2 { animation-delay: 0.9s !important; }

@keyframes ai-mic-ripple {
    0% { transform: scale(0.85); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}

.ai-bot-mic-btn {
    position: relative;
    width: 76px;
    height: 76px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
    color: var(--bot-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 8px 22px rgba(99, 52, 121, 0.35);
}

.ai-bot-mic-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.ai-bot-mic-btn:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 12px 28px rgba(99, 52, 121, 0.42);
}

.ai-bot-mic-btn:active:not(:disabled) { transform: scale(0.97); }

.ai-bot-mic-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.ai-bot-mic-btn.is-ptt-active,
.ai-bot-mic-wrap.is-listening .ai-bot-mic-btn {
  background: linear-gradient(145deg, #7c3aed, #633479);
  box-shadow: 0 0 0 0 rgba(99, 52, 121, 0.45);
  animation: ai-bot-mic-pulse 1.2s ease-in-out infinite;
}

.ai-bot-voice-mode.is-ptt {
  background: rgba(99, 52, 121, 0.12);
  color: var(--bot-primary-dark, #4c1d95);
}

@keyframes ai-bot-mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 52, 121, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(99, 52, 121, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 52, 121, 0); }
}

.ai-bot-mic-wrap.is-speaking .ai-bot-mic-btn {
    background: linear-gradient(145deg, #fbbf24, #d97706);
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.4);
}

.ai-bot-mic-wrap.is-processing .ai-bot-mic-btn {
    animation: ai-mic-pulse 1s ease-in-out infinite;
}

@keyframes ai-mic-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.94); }
}

.ai-bot-waveform {
    height: 0;
    overflow: hidden;
    transition: height 0.25s ease;
}

.ai-bot-waveform.is-active {
    height: 52px;
    margin-top: 0.6rem;
}

.ai-bot-waveform canvas {
    width: 100%;
    height: 52px;
    display: block;
}

/* Voice player */
.ai-bot-voice-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.85rem auto 0;
    max-width: 420px;
    padding: 0.6rem 0.85rem;
    background: var(--bot-primary-soft);
    border-radius: 12px;
    border: 1px solid var(--bot-line);
}

.ai-bot-voice-player__btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--bot-primary);
    color: var(--bot-white);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-bot-voice-player__btn svg { width: 16px; height: 16px; fill: currentColor; }

.ai-bot-voice-player__info { flex: 1; min-width: 0; text-align: start; }

.ai-bot-voice-player__status {
    display: block;
    font-size: 0.8rem;
    color: var(--bot-primary-dark);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.ai-bot-voice-player__bar {
    height: 5px;
    background: rgba(99, 52, 121, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.ai-bot-voice-player__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--bot-primary), var(--bot-accent));
    transition: width 0.1s linear;
}

.ai-bot-voice-player__time {
    font-size: 0.75rem;
    color: var(--bot-muted);
    white-space: nowrap;
}

/* ── Messages ─────────────────────────────────────────────── */
.ai-bot-messages {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 52vh;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    scroll-behavior: smooth;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(99, 52, 121, 0.04), transparent 60%),
        var(--bot-white);
}

.ai-bot-messages::-webkit-scrollbar { width: 6px; }
.ai-bot-messages::-webkit-scrollbar-thumb { background: var(--bot-line); border-radius: 3px; }

.ai-bot-message-row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-end;
    animation: ai-msg-in 0.28s ease;
}

@keyframes ai-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-bot-message-row--user { flex-direction: row-reverse; }

.ai-bot-message-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--bot-line-soft);
    object-fit: cover;
    object-position: top center;
    background: var(--bot-primary-soft);
}

.ai-bot-message {
    max-width: 82%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    box-shadow: var(--bot-shadow-soft);
}

.ai-bot-message--assistant {
    background: var(--bot-primary-soft);
    color: var(--bot-ink);
    border: 1px solid var(--bot-line);
    border-bottom-right-radius: 5px;
}

.ai-bot-message--user {
    background: linear-gradient(145deg, var(--bot-primary), var(--bot-primary-dark));
    color: var(--bot-white);
    border-bottom-left-radius: 5px;
}

.ai-bot-message__time {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    opacity: 0.6;
}

/* ── Input ────────────────────────────────────────────────── */
.ai-bot-permission-msg {
    margin: 0 1.25rem 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #b91c1c;
    flex-shrink: 0;
}

.ai-bot-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem 1rem;
    border-top: 1px solid var(--bot-line-soft);
    background: var(--bot-white);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.ai-bot-input-mic-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--bot-line);
    border-radius: 50%;
    background: var(--bot-white);
    color: var(--bot-primary);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.ai-bot-input-mic-btn svg { width: 18px; height: 18px; fill: currentColor; }

.ai-bot-input-mic-btn.is-active {
    background: var(--bot-primary);
    color: var(--bot-white);
    border-color: var(--bot-primary);
}

.ai-bot-input-area textarea {
    flex: 1;
    border: 1px solid var(--bot-line);
    border-radius: 22px;
    padding: 0.7rem 1.1rem;
    font-size: 0.95rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
    background: var(--bot-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-bot-input-area textarea:focus {
    outline: none;
    border-color: var(--bot-primary-light);
    box-shadow: 0 0 0 3px rgba(99, 52, 121, 0.12);
}

.ai-bot-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
    color: var(--bot-white);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.2s;
}

.ai-bot-send-btn:hover:not(:disabled) { transform: scale(1.05); }
.ai-bot-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-bot-send-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Summary / alerts ─────────────────────────────────────── */
.ai-bot-summary {
    margin: 0 1.25rem 1rem;
    padding: 1rem 1.1rem;
    background: var(--bot-primary-soft);
    border-radius: 12px;
    border: 1px solid var(--bot-line);
}

.ai-bot-summary__title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--bot-primary-dark);
}

.ai-bot-summary__text { margin: 0; font-size: 0.9rem; line-height: 1.65; color: var(--bot-ink); }

.ai-bot-emergency {
    position: relative;
    margin: 0 1.25rem 1rem;
    padding: 1rem 1.1rem 1rem 3.1rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-inline-start: 4px solid #dc2626;
    border-radius: 12px;
    color: #991b1b;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.12);
}

.ai-bot-emergency::before {
    content: '!';
    position: absolute;
    inset-inline-start: 1rem;
    top: 1rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-bot-disclaimer-banner {
    margin: 0 1.25rem 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    color: #5b21b6;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

.ai-bot-disclaimer-footer {
    margin: 0 1.25rem 1.25rem;
    padding-top: 0.9rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--bot-muted);
    border-top: 1px dashed var(--bot-line);
}

/* ── Results screen (inline recommendations) ──────────────── */
.ai-results-screen {
    background: var(--bot-white);
    border-top: 1px solid var(--bot-line-soft);
    display: block;
}

.ai-results-screen__inner {
    display: block;
}

.ai-results-header {
    padding: 1.35rem 1.5rem 1rem;
    border-bottom: 1px solid var(--bot-line-soft);
    background: linear-gradient(180deg, #faf7fd, var(--bot-white));
}

.ai-results-header__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
    line-height: 1.35;
}

.ai-results-header__subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: var(--bot-muted);
    line-height: 1.55;
}

.ai-results-grid {
    padding: 1.25rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    align-content: start;
}

.ai-results-section {
    min-width: 0;
}

.ai-results-section + .ai-results-section {
    margin-top: 0;
}

.ai-results-section__title {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.ai-results-section__title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--bot-primary), var(--bot-accent));
    flex-shrink: 0;
}

.ai-results-section__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.ai-results-empty {
    margin: 0;
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--bot-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    border: 1px dashed var(--bot-line);
    border-radius: var(--bot-radius-sm);
    background: #fcfbfe;
}

/* ── Result cards ─────────────────────────────────────────── */
.ai-result-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--bot-line-soft);
    border-radius: var(--bot-radius-sm);
    background: var(--bot-white);
    box-shadow: var(--bot-shadow-soft);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.ai-result-card--link:hover {
    transform: translateY(-1px);
    box-shadow: var(--bot-shadow);
    border-color: #d8c4ef;
    color: inherit;
}

.ai-result-card__media {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bot-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-result-card--doctor .ai-result-card__media {
    border-radius: 50%;
    width: 56px;
    height: 56px;
    border: 2px solid var(--bot-white);
    box-shadow: var(--bot-shadow-soft);
}

.ai-result-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-result-card__media--fallback {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bot-primary);
    letter-spacing: 0.02em;
}

.ai-result-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ai-result-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.ai-result-card__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--bot-ink);
    line-height: 1.35;
}

.ai-result-card__badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
    background: #f3f0f7;
    color: var(--bot-primary-dark);
    white-space: nowrap;
}

.ai-result-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--bot-muted);
    line-height: 1.45;
}

.ai-result-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.ai-result-card__meta-item--specialty {
    color: var(--bot-primary);
    font-weight: 600;
}

.ai-result-card__meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.74rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: #f3f0f7;
    color: var(--bot-primary-dark);
    font-weight: 600;
}

.ai-result-card__meta-pill--rating {
    background: #fff5e1;
    color: var(--bot-accent-dark);
}

.ai-result-card__description {
    margin: 0;
    font-size: 0.8rem;
    color: var(--bot-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-result-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.ai-result-card--doctor .ai-result-card__actions .ai-result-card__cta--action {
    flex: 1;
}

.ai-result-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}

.ai-result-card__cta--primary {
    background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
    color: var(--bot-white);
}

.ai-result-card__cta--secondary {
    background: #f3f0f7;
    color: var(--bot-primary-dark);
}

.ai-result-card__cta:hover {
    transform: translateY(-1px);
    color: inherit;
}

.ai-result-card__cta--primary:hover {
    color: var(--bot-white);
}

.ai-results-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid var(--bot-line-soft);
    background: #fcfbfe;
}

.ai-results-footer__btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    padding: 0.5rem 0.65rem;
    border-radius: 9px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
}

.ai-results-footer__btn--primary {
    background: var(--bot-primary);
    color: var(--bot-white);
    border-color: var(--bot-primary);
}

.ai-results-footer__btn--ghost {
    background: var(--bot-white);
    color: var(--bot-primary-dark);
    border-color: var(--bot-line-soft);
}

.ai-results-footer__btn:hover {
    opacity: 0.92;
    color: inherit;
}

.ai-results-footer__btn--primary:hover {
    color: var(--bot-white);
}

/* ── Intro (hero + quick actions) ─────────────────────────── */
.ai-bot-intro {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.6rem 1.6rem 0.5rem;
    animation: ai-msg-in 0.32s ease;
}

/* ── Hero ─────────────────────────────────────────────────── */
.ai-bot-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    padding: 1.9rem 2rem;
    border-radius: var(--bot-radius);
    border: 1px solid var(--bot-line-soft);
    background:
        radial-gradient(640px 280px at 18% -10%, rgba(255, 192, 90, 0.18), transparent 62%),
        radial-gradient(620px 300px at 100% 120%, rgba(99, 52, 121, 0.10), transparent 60%),
        linear-gradient(180deg, var(--bot-primary-soft), var(--bot-white));
    box-shadow: var(--bot-shadow-soft);
}

.ai-bot-hero__identity {
    order: 1;
    flex: 1 1 320px;
    min-width: 260px;
    text-align: center;
}

.ai-bot-hero__title {
    margin: 0;
    font-size: clamp(1.6rem, 2.4vw, 2.3rem);
    font-weight: 800;
    color: var(--bot-ink);
    line-height: 1.25;
}

.ai-bot-hero__brand {
    color: var(--bot-primary);
}

.ai-bot-hero__brand-en {
    display: block;
    margin-top: 0.1rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bot-accent-dark);
}

.ai-bot-hero__subtitle {
    margin: 0.7rem 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bot-primary-dark);
}

.ai-bot-hero__subtitle-en {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--bot-muted);
}

.ai-bot-hero__trust {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--bot-white);
    border: 1px solid var(--bot-line);
    box-shadow: var(--bot-shadow-soft);
    font-size: 0.82rem;
    color: var(--bot-primary-dark);
    line-height: 1.4;
}

.ai-bot-hero__trust svg { width: 16px; height: 16px; color: var(--bot-accent-dark); flex-shrink: 0; }

/* Hero visual / mascot */
.ai-bot-hero__visual {
    order: 2;
    position: relative;
    flex: 0 0 auto;
    width: 210px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-bot-hero__glow {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 95, 160, 0.30), transparent 68%);
    filter: blur(6px);
}

.ai-bot-hero__avatar {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    padding: 5px;
    background: conic-gradient(from 140deg, var(--bot-primary), var(--bot-accent), var(--bot-primary));
    box-shadow: 0 14px 34px rgba(99, 52, 121, 0.28);
}

.ai-bot-hero__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bot-white);
    border: 3px solid var(--bot-white);
    object-fit: cover;
    object-position: top center;
    display: block;
}

.ai-bot-hero__chip {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bot-white);
    box-shadow: var(--bot-shadow);
    color: var(--bot-primary);
    animation: ai-float 4s ease-in-out infinite;
}

.ai-bot-hero__chip svg { width: 22px; height: 22px; }
.ai-bot-hero__chip--doctor { top: 6px; inset-inline-start: 2px; }
.ai-bot-hero__chip--product { top: 16px; inset-inline-end: 2px; color: var(--bot-accent-dark); animation-delay: 0.6s; }
.ai-bot-hero__chip--service { bottom: 18px; inset-inline-start: 0; color: #0f766e; animation-delay: 1.2s; }
.ai-bot-hero__chip--care { bottom: 4px; inset-inline-end: 14px; color: #b4456b; animation-delay: 1.8s; }

@keyframes ai-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

/* Capability list */
.ai-bot-hero__capabilities {
    order: 3;
    flex: 0 0 250px;
    min-width: 220px;
}

.ai-bot-hero__cap-title {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
    text-align: start;
}

.ai-bot-cap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.ai-bot-cap-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--bot-ink);
}

.ai-bot-cap-list__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bot-primary-soft);
    color: var(--bot-primary);
}

.ai-bot-cap-list__icon svg { width: 17px; height: 17px; }

/* ── Section heading (Quick start) ────────────────────────── */
.ai-bot-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    justify-content: space-between;
}

.ai-bot-section-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
}

.ai-bot-section-head span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bot-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Quick action cards ───────────────────────────────────── */
.ai-bot-quickstart {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.ai-bot-quick-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.85rem;
}

.ai-bot-quick-action {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-align: start;
    padding: 1.1rem 1rem;
    min-height: 158px;
    border-radius: 20px;
    border: 1px solid var(--bot-line-soft);
    background: var(--bot-white);
    box-shadow: var(--bot-shadow-soft);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.ai-bot-quick-action:hover,
.ai-bot-quick-action:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(99, 52, 121, 0.16);
    border-color: var(--bot-primary);
    outline: none;
}

.ai-bot-quick-action__icon {
    align-self: flex-end;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bot-primary);
    background: var(--bot-primary-soft);
}

.ai-bot-quick-action__icon svg { width: 23px; height: 23px; }

.ai-bot-quick-action--product { border-color: #f3dcae; }
.ai-bot-quick-action--product .ai-bot-quick-action__icon { color: var(--bot-accent-dark); background: #fff4dc; }
.ai-bot-quick-action--product:hover { border-color: var(--bot-accent-dark); box-shadow: 0 14px 30px rgba(217, 155, 39, 0.22); }
.ai-bot-quick-action--service .ai-bot-quick-action__icon { color: #0f766e; background: #e6f6f3; }
.ai-bot-quick-action--symptom .ai-bot-quick-action__icon { color: #b4456b; background: #fcecf1; }
.ai-bot-quick-action--symptom:hover { border-color: #d57494; box-shadow: 0 14px 30px rgba(180, 69, 107, 0.18); }

.ai-bot-quick-action__body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ai-bot-quick-action__label {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--bot-ink);
    line-height: 1.3;
}

.ai-bot-quick-action__desc {
    font-size: 0.76rem;
    color: var(--bot-muted);
    line-height: 1.45;
}

.ai-bot-quick-action__arrow {
    margin-top: auto;
    align-self: flex-start;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bot-primary-soft);
    color: var(--bot-primary);
}

.ai-bot-quick-action__arrow svg { width: 15px; height: 15px; }
.ai-bot-quick-action--product .ai-bot-quick-action__arrow { background: #fff4dc; color: var(--bot-accent-dark); }

/* ── Result card type accents + action CTA ────────────────── */
.ai-result-card--product .ai-result-card__media { border-radius: 14px; background: #fff5e1; color: var(--bot-accent-dark); }
.ai-result-card--service .ai-result-card__media { border-radius: 14px; background: #e6f6f3; color: #0f766e; }

/* Cards become full-height vertical cards inside the recommendations grid */
.ai-results-section__list .ai-result-card {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    padding: 1rem;
    border-radius: 18px;
}

.ai-results-section__list .ai-result-card__media {
    width: 100%;
    height: 120px;
    border-radius: 14px;
}

.ai-results-section__list .ai-result-card--doctor .ai-result-card__media {
    width: 72px;
    height: 72px;
    align-self: center;
}

.ai-result-card__body { flex: 1; }

/* Label chips (top of each card) */
.ai-result-card__chip {
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    background: var(--bot-primary-soft);
    color: var(--bot-primary-dark);
}

.ai-result-card__chip--product { background: #fff4dc; color: var(--bot-accent-dark); }
.ai-result-card__chip--service { background: #e6f6f3; color: #0f766e; }

/* Price row */
.ai-result-card__pricerow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.ai-result-card__price {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
}

.ai-result-card__price-now {
    font-size: 1rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
}

.ai-result-card--product .ai-result-card__price-now { color: var(--bot-accent-dark); }

.ai-result-card__price-old {
    font-size: 0.78rem;
    color: var(--bot-muted);
    text-decoration: line-through;
}

/* Action buttons (primary fills, secondary is a small icon) */
.ai-result-card__actions {
    margin-top: auto;
    align-items: center;
}

.ai-result-card__cta--action {
    flex: 1;
    background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
    color: var(--bot-white);
    box-shadow: 0 4px 12px rgba(99, 52, 121, 0.25);
}

.ai-result-card--product .ai-result-card__cta--action {
    background: linear-gradient(145deg, var(--bot-accent), var(--bot-accent-dark));
    box-shadow: 0 4px 12px rgba(217, 155, 39, 0.28);
}

.ai-result-card__cta--action:hover { color: var(--bot-white); }

.ai-result-card__cta--icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    background: var(--bot-primary-soft);
    color: var(--bot-primary-dark);
    border: 1px solid var(--bot-line);
}

.ai-result-card__cta--icon svg { width: 18px; height: 18px; }
.ai-result-card__cta--icon:hover { color: var(--bot-primary-dark); background: #ece4f3; }

/* ── Privacy note (bottom) ────────────────────────────────── */
.ai-bot-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem 0.95rem;
    font-size: 0.78rem;
    color: var(--bot-muted);
    background: var(--bot-white);
    text-align: center;
}

.ai-bot-privacy-note svg { width: 16px; height: 16px; color: var(--bot-primary); flex-shrink: 0; }

/* ── Guided UI (in-chat options + cards) ──────────────────── */
.ai-guided-ui__panel {
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--bot-line-soft);
  background: var(--bot-white);
  box-shadow: var(--bot-shadow-soft);
}

.ai-guided-ui__title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--bot-primary-dark);
}

.ai-guided-ui__hint,
.ai-action-ui .ai-guided-ui__hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--bot-muted);
}

.ai-guided-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}

.ai-guided-option-card {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--bot-line);
  background: var(--bot-primary-soft);
  color: var(--bot-primary-dark);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  width: 100%;
}

.ai-guided-option-card.is-selectable:hover,
.ai-guided-entity-card.is-selectable:hover,
.ai-action-option-card.is-selectable:hover,
.ai-action-variant-card.is-selectable:hover {
  transform: translateY(-1px);
  border-color: var(--bot-primary);
  box-shadow: var(--bot-shadow-soft);
}

.ai-guided-option-card.is-selected,
.ai-guided-entity-card.is-selected,
.ai-action-option-card.is-selected,
.ai-action-variant-card.is-selected {
  border-color: var(--bot-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}

.ai-guided-option-card.is-disabled,
.ai-guided-entity-card.is-disabled,
.ai-action-option-card.is-disabled,
.ai-action-variant-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-guided-option-card:hover {
  transform: translateY(-1px);
  border-color: var(--bot-primary);
  box-shadow: var(--bot-shadow-soft);
}

.ai-guided-card.is-display-only,
.ai-guided-entity-card.is-display-only,
.ai-guided-option-card.is-display-only,
.ai-action-option-card.is-display-only,
.ai-action-variant-card.is-display-only {
  cursor: default;
}

.ai-guided-card.is-display-only:hover,
.ai-guided-entity-card.is-display-only:hover,
.ai-guided-option-card.is-display-only:hover,
.ai-action-option-card.is-display-only:hover,
.ai-action-variant-card.is-display-only:hover {
  transform: none;
  box-shadow: var(--bot-shadow-soft);
}

.ai-guided-card.is-display-only button,
.ai-guided-card.is-display-only .selection-button,
.ai-guided-entity-card.is-display-only .ai-guided-entity-card__cta,
.ai-guided-entity-card.is-display-only .selection-button {
  display: none;
}

.ai-guided-entity-card__choice-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--bot-muted);
}

.ai-guided-option-card__label,
.ai-action-option-card__label,
.ai-action-variant-card__label {
  display: block;
  font-weight: 700;
}

.ai-guided-option-card__description {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--bot-muted);
  font-weight: 400;
}

.ai-guided-redirect-button {
  cursor: pointer;
}

.ai-action-ui--display-only .ai-action-btn:not(.ai-guided-redirect-button) {
  display: none;
}

.ai-action-quantity-grid {
  margin-top: 0.35rem;
}

.ai-action-quantity-card {
  min-height: 3.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.ai-action-quantity-card .ai-guided-card-number {
  position: static;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--bot-primary-dark);
  box-shadow: none;
  font-size: 1.1rem;
}

.ai-action-boolean-grid {
  margin-top: 0.35rem;
}

.ai-guided-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.ai-guided-entity-card {
  position: relative;
  border: 1px solid var(--bot-line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bot-white);
  box-shadow: var(--bot-shadow-soft);
}

.ai-guided-entity-card.is-selectable,
.ai-action-option-card.is-selectable,
.ai-action-variant-card.is-selectable {
  cursor: pointer;
}

.ai-action-option-card,
.ai-action-variant-card {
  width: 100%;
  text-align: start;
  font-family: inherit;
}

.ai-guided-card-number {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bot-primary, #6d28d9);
  color: var(--bot-white, #fff);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.ai-guided-more-btn {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bot-line-soft);
  border-radius: 10px;
  background: var(--bot-primary-soft, #f1ecfb);
  color: var(--bot-primary-dark, #4c1d95);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-guided-more-btn:hover { filter: brightness(0.98); }

.ai-guided-entity-card__img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: var(--bot-primary-soft);
}

.ai-guided-entity-card__body { padding: 0.75rem; }

.ai-guided-entity-card__body h5 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--bot-ink);
}

.ai-guided-entity-card__meta,
.ai-guided-entity-card__reason {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  color: var(--bot-muted);
}

.ai-guided-entity-card__price {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--bot-primary-dark);
}

.ai-guided-entity-card--product .ai-guided-entity-card__price { color: var(--bot-accent-dark); }

.ai-guided-entity-card__cta {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
  color: var(--bot-white);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-guided-entity-card--product .ai-guided-entity-card__cta {
  background: linear-gradient(145deg, var(--bot-accent), var(--bot-accent-dark));
}

.ai-guided-empty__text {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--bot-muted);
  line-height: 1.5;
}

.ai-guided-empty__link {
  display: inline-flex;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: var(--bot-primary-soft);
  color: var(--bot-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.ai-bot-message-row--assistant.ai-guided-ui {
  display: block;
  width: 100%;
}

/* Voice-only: assistant speaks via Gemini TTS — no chat bubbles or duplicate titles */
.ai-bot-layout.is-voice-only .ai-bot-message-row--assistant:not(.ai-guided-ui) {
  display: none;
}

.ai-bot-layout.is-voice-only .ai-guided-ui__title,
.ai-bot-layout.is-voice-only .ai-guided-ui__hint,
.ai-bot-layout.is-voice-only .ai-guided-entity-card__choice-hint,
.ai-bot-layout.is-voice-only .ai-action-ui__title {
  display: none;
}

@media (max-width: 600px) {
  .ai-guided-option-grid { grid-template-columns: 1fr 1fr; }
  .ai-guided-card-grid { grid-template-columns: 1fr; }
}

.ai-flow-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    width: 100%;
    margin-top: 0.25rem;
}

.ai-flow-choice-btn {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--bot-line);
    background: var(--bot-white);
    color: var(--bot-primary-dark);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.ai-flow-choice-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--bot-primary);
    box-shadow: var(--bot-shadow-soft);
}

.ai-flow-choice-btn--primary {
    background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
    color: var(--bot-white);
    border-color: transparent;
}

.ai-flow-choice-btn:disabled { opacity: 0.55; cursor: default; }

/* ── Action panels (in-chat: questions, options, variants, slots, redirect) ── */
.ai-bot-message-row--action {
    display: block;
    width: 100%;
    animation: ai-msg-in 0.28s ease;
}

.ai-action-ui {
    width: 100%;
    background: var(--bot-white);
    border: 1px solid var(--bot-line);
    border-radius: var(--bot-radius-sm);
    box-shadow: var(--bot-shadow-soft);
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
}

.ai-action-ui::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--bot-primary), var(--bot-accent));
}

.ai-action-ui__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--bot-primary-dark);
    line-height: 1.4;
}

.ai-action-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-action-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ai-action-field__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bot-ink);
}

.ai-action-field__input {
    width: 100%;
    border: 1px solid var(--bot-line);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bot-white);
    color: var(--bot-ink);
    transition: border-color 0.18s, box-shadow 0.18s;
}

.ai-action-field__input:focus {
    outline: none;
    border-color: var(--bot-primary-light);
    box-shadow: 0 0 0 3px rgba(99, 52, 121, 0.12);
}

.ai-action-field__value {
    font-size: 0.86rem;
    color: var(--bot-muted);
    line-height: 1.45;
}

.ai-action-field__value--pending {
    color: var(--bot-primary);
    font-weight: 600;
}

.ai-action-field.is-current {
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(99, 52, 121, 0.06);
    border: 1px solid rgba(99, 52, 121, 0.14);
}

.ai-action-field.is-done .ai-action-field__label {
    color: var(--bot-primary-dark);
}

/* Yes/No toggle */
.ai-action-toggle {
    display: inline-flex;
    gap: 0.4rem;
}

.ai-action-toggle__btn {
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--bot-line);
    background: var(--bot-white);
    color: var(--bot-primary-dark);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ai-action-toggle__btn--active {
    background: var(--bot-primary);
    color: var(--bot-white);
    border-color: var(--bot-primary);
}

/* Options / slot grids */
.ai-action-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.ai-action-option-btn {
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--bot-line);
    background: var(--bot-primary-soft);
    color: var(--bot-primary-dark);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.ai-action-option-btn:hover {
    transform: translateY(-1px);
    background: var(--bot-primary);
    color: var(--bot-white);
    border-color: var(--bot-primary);
}

/* Variant picker */
.ai-action-variant-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-action-variant-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--bot-line);
    background: var(--bot-white);
    color: var(--bot-ink);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.ai-action-variant-card:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--bot-primary-light);
}

.ai-action-variant-card--selected {
    border-color: var(--bot-primary);
    box-shadow: 0 0 0 2px rgba(99, 52, 121, 0.18);
    background: var(--bot-primary-soft);
}

.ai-action-variant-card--oos {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}

.ai-action-variant-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

/* Summary box */
.ai-action-summary {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: var(--bot-primary-soft);
    border: 1px solid var(--bot-line);
}

.ai-action-summary__line {
    font-size: 0.82rem;
    color: var(--bot-ink);
    text-transform: capitalize;
}

/* Action button rows */
.ai-action-btn-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-action-btn {
    flex: 1 1 auto;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.62rem 1rem;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s, background 0.15s;
}

.ai-action-btn--full { width: 100%; flex-basis: 100%; }

.ai-action-btn--primary {
    background: linear-gradient(145deg, var(--bot-primary-light), var(--bot-primary));
    color: var(--bot-white);
    box-shadow: 0 6px 16px rgba(99, 52, 121, 0.28);
}

.ai-action-btn--primary:hover { transform: translateY(-1px); color: var(--bot-white); }

.ai-action-btn--secondary {
    background: var(--bot-white);
    color: var(--bot-primary-dark);
    border-color: var(--bot-line);
}

.ai-action-btn--secondary:hover { background: var(--bot-primary-soft); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
    .ai-bot-shell {
        padding-inline: 1rem;
    }

    /* Hero stacks: identity, then mascot, then capabilities */
    .ai-bot-hero {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1.25rem;
    }

    .ai-bot-hero__identity,
    .ai-bot-hero__capabilities {
        flex: 1 1 100%;
        width: 100%;
    }

    .ai-bot-hero__cap-title { text-align: center; }
    .ai-bot-cap-list { align-items: center; }
    .ai-bot-cap-list li { width: max-content; max-width: 100%; }

    .ai-bot-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-bot-messages {
        min-height: 200px;
        max-height: 55vh;
    }

    .ai-results-grid {
        padding: 1rem 1rem 1.25rem;
    }

    .ai-results-header {
        padding: 1rem 1rem 0.85rem;
    }

    .ai-results-footer__btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 600px) {
    .ai-bot-intro { padding: 1.1rem 1.1rem 0.25rem; }
    .ai-bot-message { max-width: 88%; }
    .ai-bot-quick-actions { grid-template-columns: 1fr; }
    .ai-bot-quick-action { min-height: 0; flex-direction: row; align-items: center; }
    .ai-bot-quick-action__icon { align-self: center; order: -1; }
    .ai-bot-quick-action__arrow { display: none; }
    .ai-bot-hero { padding: 1.25rem 1rem; }
    .ai-results-section__list { grid-template-columns: 1fr; }
}

/* ── Chat-only page tweaks ─────────────────────────────────── */
.ai-bot-layout.is-chat-only .ai-bot-voice-bar,
.ai-bot-layout.is-chat-only .ai-bot-input-mic-btn {
    display: none !important;
}

.ai-bot-layout.is-chat-only .ai-bot-messages {
    min-height: 280px;
}

/* ── Floating widget (chat mode) ───────────────────────────── */
.ai-bot-widget {
    position: fixed;
    right: 1.25rem;
    left: auto;
    bottom: 1.25rem;
    z-index: 12050;
    font-family: inherit;
}

.ai-bot-widget__status {
    display: none;
}

.ai-bot-layout.is-chat-only.is-widget-mode .ai-bot-widget__status.is-visible {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0.85rem 0;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--bot-primary-dark);
    background: rgba(74, 38, 89, 0.08);
}

.ai-bot-widget__header-subtitle.is-typing {
    color: var(--bot-primary);
}

.ai-bot-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    padding: 0.65rem 0.9rem;
}

.ai-bot-typing-label {
    font-size: 0.82rem;
    color: var(--bot-muted);
}

.ai-bot-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
}

.ai-bot-typing-dots span {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--bot-primary);
    opacity: 0.35;
    animation: ai-bot-typing-dot 1.2s infinite ease-in-out;
}

.ai-bot-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-bot-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-bot-typing-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
    40% { transform: translateY(-3px); opacity: 1; }
}

.ai-bot-widget__launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.95rem 0.45rem 0.45rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--bot-primary), var(--bot-primary-dark));
    color: #fff;
    box-shadow: 0 12px 32px rgba(74, 38, 89, 0.28);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-bot-widget__launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(74, 38, 89, 0.34);
}

.ai-bot-widget__launcher-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.ai-bot-widget__launcher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-bot-widget__launcher-label {
    font-weight: 700;
    font-size: 0.95rem;
    padding-inline-end: 0.15rem;
}

.ai-bot-widget__panel {
    position: absolute;
    right: 0;
    left: auto;
    bottom: calc(100% + 0.85rem);
    width: min(390px, calc(100vw - 1.5rem));
    height: min(640px, calc(100vh - 6rem));
    background: var(--bot-white);
    border-radius: 20px;
    border: 1px solid var(--bot-line-soft);
    box-shadow: 0 24px 60px rgba(28, 21, 48, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-bot-widget__panel[hidden] {
    display: none !important;
}

.ai-bot-widget.is-open .ai-bot-widget__launcher {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
}

.ai-bot-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #faf7fd, #fff);
    border-bottom: 1px solid var(--bot-line-soft);
}

.ai-bot-widget__header-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.ai-bot-widget__header-avatar {
    border-radius: 50%;
    object-fit: cover;
}

.ai-bot-widget__header-title {
    display: block;
    color: var(--bot-ink);
    font-size: 0.98rem;
}

.ai-bot-widget__header-subtitle {
    display: block;
    color: var(--bot-muted);
    font-size: 0.78rem;
}

.ai-bot-widget__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--bot-primary-soft);
    color: var(--bot-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ai-bot-widget__close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.ai-bot-widget__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bot-bg);
}

.ai-bot-widget__intro {
    padding: 0.85rem 1rem 0.35rem;
}

.ai-bot-widget__intro-text {
    margin: 0 0 0.65rem;
    color: var(--bot-muted);
    font-size: 0.86rem;
}

.ai-bot-widget__quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.ai-bot-widget__quick-btn {
    border: 1px solid var(--bot-line);
    background: #fff;
    color: var(--bot-primary);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.ai-bot-widget__messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 0.85rem;
}

.ai-bot-widget__input-area {
    flex-shrink: 0;
    border-top: 1px solid var(--bot-line-soft);
    background: #fff;
}

.ai-bot-widget__results {
    max-height: 42%;
    overflow: auto;
}

body.ai-bot-widget-open,
html.ai-bot-widget-open {
    overflow: hidden;
    height: 100%;
}

.ai-bot-layout.is-widget-mode {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-bot-layout.is-widget-mode .ai-bot-messages {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
}

.ai-bot-layout.is-widget-mode .ai-bot-message {
    max-width: min(92%, 34rem);
}

.ai-bot-layout.is-widget-mode .ai-guided-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
}

/* Mobile full-screen sheet (JS adds .is-mobile-sheet; media query is fallback) */
.ai-bot-widget.is-open.is-mobile-sheet {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    right: 0;
    left: 0;
    bottom: 0;
    top: 0;
    z-index: 12050;
    margin: 0;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    margin: 0;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__launcher {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__header {
    flex-shrink: 0;
    padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-layout.is-chat-only .ai-bot-messages,
.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__results {
    flex: 0 1 auto;
    max-height: min(42vh, 320px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__input-area {
    flex-shrink: 0;
    margin-top: auto;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__input-area textarea {
    font-size: 16px;
    max-height: 120px;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__intro {
    flex-shrink: 0;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.ai-bot-widget.is-open.is-mobile-sheet .ai-bot-widget__quick-btn {
    width: 100%;
    text-align: center;
    padding: 0.55rem 0.35rem;
}

@media (max-width: 991px) {
    .ai-bot-widget.is-open {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        right: 0;
        left: 0;
        bottom: 0;
        top: 0;
        z-index: 12050;
        margin: 0;
    }

    .ai-bot-widget.is-open .ai-bot-widget__panel {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        height: 100dvh;
        max-height: none;
        min-height: 0;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        margin: 0;
    }

    .ai-bot-widget.is-open .ai-bot-widget__launcher {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .ai-bot-widget__header {
        flex-shrink: 0;
        padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
    }

    .ai-bot-widget__body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .ai-bot-widget.is-open .ai-bot-layout.is-chat-only .ai-bot-messages,
    .ai-bot-widget.is-open .ai-bot-widget__messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .ai-bot-widget__results {
        flex: 0 1 auto;
        max-height: min(42vh, 320px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ai-bot-widget__input-area {
        flex-shrink: 0;
        margin-top: auto;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    }

    .ai-bot-widget__input-area textarea {
        font-size: 16px;
        max-height: 120px;
    }

    .ai-bot-widget__intro {
        flex-shrink: 0;
    }

    .ai-bot-widget__quick-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .ai-bot-widget__quick-btn {
        width: 100%;
        text-align: center;
        padding: 0.55rem 0.35rem;
    }

    .ai-bot-widget:not(.is-open) {
        right: 1rem;
        left: auto;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 420px) {
    .ai-bot-widget__quick-actions {
        grid-template-columns: 1fr;
    }
}
