/* AI Support Chat Widget — modern UI */
#support-chat-root {
    --sc-primary: #6366f1;
    --sc-primary-2: #8b5cf6;
    --sc-accent: #4f46e5;
    --sc-bg: #f6f7fb;
    --sc-bot-bubble: #ffffff;
    --sc-text: #1f2430;
    --sc-muted: #8a90a2;
    --sc-border: #ececf2;
    --sc-shadow: 0 18px 50px rgba(31, 36, 48, 0.22);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    z-index: 99990;
}

.sc-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Floating launcher */
#support-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 99991;
}

#support-chat-toggle:hover { transform: translateY(-2px) scale(1.04); }

#support-chat-toggle .sc-launcher-icon,
#support-chat-toggle .material-icons {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#support-chat-toggle .sc-launcher-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

#support-chat-toggle .sc-launcher-icon svg {
    width: 32px;
    height: 32px;
    display: block;
    color: #fff;
}

#support-chat-toggle .sc-icon-close {
    position: absolute;
    font-size: 28px;
    opacity: 0;
    transform: rotate(-90deg);
}

#support-chat-root.is-open #support-chat-toggle .sc-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.85);
}

#support-chat-root.is-open #support-chat-toggle .sc-icon-close {
    opacity: 1;
    transform: rotate(0);
}

/* Panel */
#support-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 388px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 130px);
    background: var(--sc-bg);
    border-radius: 20px;
    box-shadow: var(--sc-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99992;
}

#support-chat-panel.is-open { display: flex; animation: scSlideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }

@keyframes scSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.sc-header {
    background: linear-gradient(135deg, var(--sc-accent) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    padding: 16px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sc-header-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.sc-header-ai-icon {
    width: 26px;
    height: 26px;
    color: #fff;
    display: block;
}

.sc-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.sc-header-info { min-width: 0; }
.sc-header-info h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.sc-header-info p { margin: 2px 0 0; font-size: 12px; opacity: 0.9; display: flex; align-items: center; }

.sc-header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.sc-new-chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.sc-new-chat-btn .material-icons { font-size: 16px; }

.sc-new-chat-btn--icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    justify-content: center;
}

.sc-new-chat-btn--icon .material-icons { font-size: 20px; }

.sc-new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 36, 48, 0.14);
}

.sc-new-chat-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.sc-new-chat-btn--banner {
    background: #fff;
    color: var(--sc-accent);
    border-color: #fdba74;
    box-shadow: 0 1px 4px rgba(154, 52, 18, 0.08);
    padding: 6px 12px;
    font-size: 11.5px;
}

.sc-new-chat-btn--banner:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.14);
}

.sc-icon-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.sc-icon-btn:hover { background: rgba(255, 255, 255, 0.26); }
.sc-icon-btn .material-icons { font-size: 20px; }

/* Tabs — compact single row */
.sc-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    background: #fff;
    border-bottom: 1px solid var(--sc-border);
    flex-shrink: 0;
}

.sc-tab {
    flex: 1;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--sc-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
    min-height: 0;
}

.sc-tab .material-icons { font-size: 16px; }

.sc-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--sc-accent) 0%, var(--sc-primary-2) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}

.sc-tab:not(.is-active):hover {
    color: var(--sc-text);
    background: #f3f4f8;
}

.sc-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sc-tab-view {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.sc-tab-view.is-active { display: flex; }

.sc-readonly-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border-bottom: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 12px;
    flex-shrink: 0;
}

.sc-readonly-text {
    min-width: 0;
    line-height: 1.35;
}

/* History list */
.sc-history-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sc-history-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 8px;
    background: #fff;
    border-bottom: 1px solid var(--sc-border);
    flex-shrink: 0;
}

.sc-history-toolbar-text h5 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--sc-text);
}

.sc-history-toolbar-text p {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--sc-muted);
}

.sc-history-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sc-history-clear-btn .material-icons { font-size: 16px; }

.sc-history-clear-btn:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
    transform: translateY(-1px);
}

.sc-history-clear-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sc-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sc-history-list::-webkit-scrollbar { width: 6px; }
.sc-history-list::-webkit-scrollbar-thumb { background: #d6d8e2; border-radius: 8px; }

.sc-history-empty {
    text-align: center;
    color: var(--sc-muted);
    font-size: 13px;
    padding: 28px 16px;
    line-height: 1.5;
}

.sc-history-card {
    position: relative;
    margin-bottom: 10px;
}

.sc-history-card:last-child { margin-bottom: 0; }

.sc-history-item {
    width: 100%;
    min-width: 0;
    text-align: left;
    border: 1px solid var(--sc-border);
    background: #fff;
    border-radius: 14px;
    padding: 12px 34px 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    font-family: inherit;
}

.sc-history-item:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.sc-history-item.is-current {
    border-color: rgba(99, 102, 241, 0.45);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.sc-history-item-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    padding-right: 4px;
}

.sc-history-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--sc-text);
}

.sc-history-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 999px;
}

.sc-history-badge.active { background: #dcfce7; color: #166534; }
.sc-history-badge.past { background: #eef2ff; color: #4338ca; }

.sc-history-item-action {
    font-size: 11px;
    color: var(--sc-accent);
    font-weight: 600;
    margin-top: 6px;
}

.sc-history-preview {
    font-size: 13px;
    color: var(--sc-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-history-meta {
    margin-top: 8px;
    font-size: 11px;
    color: #aab0bf;
}

.sc-history-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.sc-history-remove-btn .material-icons { font-size: 18px; }

.sc-history-remove-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.sc-history-remove-btn:active {
    background: #fecaca;
}

/* Menu tab — topic launcher grid */
.sc-menu-panel {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.sc-menu-panel::-webkit-scrollbar { width: 6px; }
.sc-menu-panel::-webkit-scrollbar-thumb { background: #d6d8e2; border-radius: 8px; }

.sc-menu-card {
    background: #fff;
    border: 1px solid var(--sc-border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(31, 36, 48, 0.05);
}

.sc-menu-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 4px 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--sc-border);
}

.sc-menu-card-head h5 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sc-text);
}

.sc-menu-card-head p {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--sc-muted);
}

.sc-menu-hero-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sc-accent), var(--sc-primary-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.sc-menu-hero-icon .material-icons { font-size: 18px; }

.sc-menu-section {
    padding: 8px 2px 2px;
}

.sc-menu-section + .sc-menu-section {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed #ececf2;
}

.sc-menu-section-title {
    margin: 0 0 6px 2px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.sc-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.sc-menu-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 6px 3px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sc-menu-tile-icon {
    font-size: 17px;
    line-height: 1;
}

.sc-menu-tile-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.sc-menu-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 36, 48, 0.1);
}

.sc-menu-tile:active {
    transform: translateY(0) scale(0.97);
}

.sc-menu-tile--violet { border-color: #ddd6fe; background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%); color: #5b21b6; }
.sc-menu-tile--blue { border-color: #bfdbfe; background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%); color: #1d4ed8; }
.sc-menu-tile--rose { border-color: #fecdd3; background: linear-gradient(180deg, #fff8f9 0%, #fff1f2 100%); color: #be123c; }
.sc-menu-tile--amber { border-color: #fde68a; background: linear-gradient(180deg, #fffdf5 0%, #fffbeb 100%); color: #b45309; }
.sc-menu-tile--teal { border-color: #99f6e4; background: linear-gradient(180deg, #f4fffd 0%, #f0fdfa 100%); color: #0f766e; }
.sc-menu-tile--green { border-color: #bbf7d0; background: linear-gradient(180deg, #f6fff8 0%, #f0fdf4 100%); color: #15803d; }
.sc-menu-tile--gold { border-color: #fde047; background: linear-gradient(180deg, #fffef5 0%, #fefce8 100%); color: #a16207; }
.sc-menu-tile--indigo { border-color: #c7d2fe; background: linear-gradient(180deg, #f7f8ff 0%, #eef2ff 100%); color: #4338ca; }
.sc-menu-tile--slate { border-color: #e2e8f0; background: linear-gradient(180deg, #fcfdfe 0%, #f8fafc 100%); color: #475569; }

.sc-menu-tile--violet:hover { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.sc-menu-tile--blue:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.sc-menu-tile--rose:hover { background: #e11d48; border-color: #e11d48; color: #fff; }
.sc-menu-tile--amber:hover { background: #d97706; border-color: #d97706; color: #fff; }
.sc-menu-tile--teal:hover { background: #0d9488; border-color: #0d9488; color: #fff; }
.sc-menu-tile--green:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.sc-menu-tile--gold:hover { background: #ca8a04; border-color: #ca8a04; color: #fff; }
.sc-menu-tile--indigo:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.sc-menu-tile--slate:hover { background: #64748b; border-color: #64748b; color: #fff; }

#support-chat-root[data-active-tab="menu"] .sc-input-area,
#support-chat-root[data-active-tab="history"] .sc-input-area {
    display: none !important;
}

/* Chip colour variants (bot reply options) */
.sc-chip--violet { border-color: #ddd6fe; background: #f5f3ff; color: #5b21b6; }
.sc-chip--blue { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.sc-chip--rose { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.sc-chip--amber { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.sc-chip--teal { border-color: #99f6e4; background: #f0fdfa; color: #0f766e; }
.sc-chip--green { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.sc-chip--gold { border-color: #fde047; background: #fefce8; color: #a16207; }
.sc-chip--indigo { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
.sc-chip--slate { border-color: #e2e8f0; background: #f8fafc; color: #475569; }

.sc-chip--violet:hover { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.sc-chip--blue:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.sc-chip--rose:hover { background: #e11d48; border-color: #e11d48; color: #fff; }
.sc-chip--amber:hover { background: #d97706; border-color: #d97706; color: #fff; }
.sc-chip--teal:hover { background: #0d9488; border-color: #0d9488; color: #fff; }
.sc-chip--green:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.sc-chip--gold:hover { background: #ca8a04; border-color: #ca8a04; color: #fff; }
.sc-chip--indigo:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.sc-chip--slate:hover { background: #64748b; border-color: #64748b; color: #fff; }

.sc-chip--tone-0 { border-color: #ddd6fe; background: #f5f3ff; color: #5b21b6; }
.sc-chip--tone-1 { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.sc-chip--tone-2 { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.sc-chip--tone-3 { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.sc-chip--tone-4 { border-color: #fecdd3; background: #fff1f2; color: #be123c; }

.sc-chat-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--sc-muted);
}

.sc-chat-empty .material-icons {
    font-size: 40px;
    color: #c7cce0;
    margin-bottom: 10px;
}

.sc-chat-empty p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.sc-chat-empty button {
    margin-top: 12px;
    border: none;
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Messages */
.sc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    min-height: 0;
}
.sc-messages::-webkit-scrollbar { width: 6px; }
.sc-messages::-webkit-scrollbar-thumb { background: #d6d8e2; border-radius: 8px; }

.sc-message { display: flex; max-width: 92%; animation: scPop 0.18s ease; align-items: flex-start; gap: 8px; }
@keyframes scPop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.sc-message.user { margin-left: auto; justify-content: flex-end; }
.sc-message.bot, .sc-message.admin { margin-right: auto; }

.sc-message-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sc-message-body .sc-options {
    margin-top: 8px;
    padding-left: 0;
    padding-right: 0;
}

.sc-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
}
.sc-msg-avatar .material-icons { font-size: 16px; }

.sc-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    color: var(--sc-text);
}

.sc-message.bot .sc-bubble {
    background: var(--sc-bot-bubble);
    border: 1px solid var(--sc-border);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(31, 36, 48, 0.05);
}

.sc-message.admin .sc-bubble {
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    border-bottom-left-radius: 5px;
}

.sc-message.user .sc-message-body {
    align-items: flex-end;
}

.sc-message.user .sc-bubble {
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sc-bubble strong { font-weight: 700; }

.sc-time { display: block; font-size: 10px; margin-top: 5px; text-align: right; opacity: 0.65; }
.sc-message.user .sc-time { color: rgba(255, 255, 255, 0.85); }
.sc-message.bot .sc-time, .sc-message.admin .sc-time { color: var(--sc-muted); }

/* Welcome + quick chips */
.sc-welcome { text-align: center; padding: 18px 10px 6px; color: var(--sc-muted); }
.sc-welcome-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}
.sc-welcome-icon .material-icons { font-size: 30px; }
.sc-welcome h5 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--sc-text); }
.sc-welcome p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; }

.sc-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 2px;
}

.sc-chip,
a.sc-chip-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    color: var(--sc-text);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.06);
    text-align: left;
}

.sc-chip:hover,
a.sc-chip-link:hover {
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.28);
    text-decoration: none;
}

.sc-chip:active,
a.sc-chip-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.18);
}

.sc-chip-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(99, 102, 241, 0.1);
    transition: background 0.16s ease;
}

.sc-chip:hover .sc-chip-icon,
a.sc-chip-link:hover .sc-chip-icon {
    background: rgba(255, 255, 255, 0.18);
}

.sc-chip-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.sc-chip-link {
    border-style: solid;
}

a.sc-chip-link::after {
    content: '↗';
    margin-left: auto;
    font-size: 12px;
    opacity: 0.55;
}

a.sc-chip-link:hover::after {
    opacity: 1;
}

/* Clickable options under bot messages */
.sc-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    animation: scPop 0.18s ease;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.sc-options::-webkit-scrollbar { height: 0; }

.sc-options .sc-chip,
.sc-options a.sc-chip-link {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 999px;
    white-space: nowrap;
}

/* Typing / thinking indicator */
.sc-typing {
    display: none;
    padding: 6px 16px 10px;
}

.sc-typing.is-visible {
    display: block;
}

.sc-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    background: #fff;
    border: 1px solid var(--sc-border);
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 2px 8px rgba(31, 36, 48, 0.06);
}

.sc-typing-bubble .site-loader-spinner--sm {
    width: 20px;
    height: 20px;
}

.sc-typing-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--sc-muted);
}

/* Input */
.sc-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid var(--sc-border);
    flex-shrink: 0;
}

.sc-input-area textarea {
    flex: 1;
    border: 1px solid var(--sc-border);
    border-radius: 22px;
    padding: 11px 16px;
    font-size: 14px;
    resize: none;
    max-height: 110px;
    outline: none;
    background: #f6f7fb;
    font-family: inherit;
    color: var(--sc-text);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sc-input-area textarea:focus { border-color: var(--sc-primary); background: #fff; }

.sc-send-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.sc-send-btn:hover { transform: scale(1.06); }
.sc-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.sc-send-btn.is-loading .material-icons {
    opacity: 0;
}

.sc-send-btn.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: scSendPulse 0.85s ease-in-out infinite;
    box-shadow: 12px 0 0 -2px rgba(255, 255, 255, 0.55), -12px 0 0 -2px rgba(255, 255, 255, 0.55);
}

@keyframes scSendPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.65; }
    50% { transform: scale(1.1); opacity: 1; }
}

.sc-footer {
    text-align: center;
    font-size: 10.5px;
    color: var(--sc-muted);
    padding: 6px 10px 9px;
    background: #fff;
}

.sc-footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sc-disclaimer {
    margin: 3px 0 0;
    font-size: 9.5px;
    color: #aab0bf;
    line-height: 1.35;
}
.sc-footer .material-icons {
    font-size: 13px;
    background: linear-gradient(135deg, var(--sc-primary) 0%, var(--sc-primary-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mobile */
@media (max-width: 767px) {
    #support-chat-toggle { bottom: 80px; right: 16px; }
    #support-chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .sc-tabs { padding: 5px 8px; }
    .sc-tab { font-size: 11px; padding: 6px 4px; }
    .sc-tab .material-icons { font-size: 15px; }
    .sc-tab span:not(.material-icons) { display: none; }
    .sc-options { padding-left: 12px; }
}
