/**
 * Customer Support Center - CSS
 * Premium canvas layout (v1.3)
 *
 * Structure of this file
 *   1. Brand tokens (everything below derives from the admin "Brand color")
 *   2. Canvas shell, header, search, tabs
 *   3. Home (quick actions, topics, popular, still-need-help)
 *   4. Live chat
 *   5. Voice call (idle / calling / connected)
 *   6. Tickets, Help center, article viewer, pre-chat
 *   7. Launcher, floating panel, mobile
 *   8. Shared primitives (also used by the agent dashboard + admin panel — keep)
 *   9. Agent dashboard (unchanged)
 *
 * All widget rules are scoped under .sc-plugin-wrap so they can never leak
 * into the agent dashboard / admin screens that share this stylesheet.
 */

/* ═══════════════════════════════════════════════════════════════
   1. BRAND TOKENS
   PHP prints --sc-user-* on :root from the "Brand color" setting
   (see inject_inline_css_vars). Defaults below = original amber.
   ═══════════════════════════════════════════════════════════════ */
.sc-plugin-wrap {
    --sc-brand:        var(--sc-user-brand, #F5A623);
    --sc-brand-dark:   var(--sc-user-brand-dark, #D4881A);
    --sc-brand-light:  var(--sc-user-brand-light, #FFF8EC);
    --sc-on-brand:     var(--sc-user-on-brand, #1c1303);   /* text/icon colour that stays readable on the brand colour */
    --sc-grad-end:     var(--sc-user-grad-end, #F9C466);

    /* Fallbacks for engines without color-mix() */
    --sc-brand-ink:    var(--sc-brand-dark);
    --sc-brand-deep:   #17261f;
    --sc-tint-1:       var(--sc-brand-light);
    --sc-tint-2:       var(--sc-brand-light);
    --sc-brand-line:   var(--sc-brand-light);
    --sc-ring:         rgba(16, 24, 40, 0.12);
    --sc-bubble-in:    #F2F4F7;
    --sc-live-top:     #17261f;
    --sc-live-bottom:  #0d1814;

    /* Neutrals */
    --sc-text:         #101828;
    --sc-muted:        #566074;
    --sc-faint:        #8591A5;
    --sc-line:         #E7EAF0;
    --sc-line-strong:  #D3D9E3;
    --sc-wash:         #F7F8FA;

    --sc-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sc-radius-lg: 20px;
    --sc-radius:    16px;
    --sc-radius-sm: 12px;

    /* Aliases used by inline styles generated in support-center.js */
    --brand: var(--sc-brand);
    --bg: #fff;
    --ts: var(--sc-muted);
    --tm: var(--sc-text);

    /* Legacy names still referenced elsewhere */
    --sc-bg: #ffffff;
    --sc-bg2: #F9FAFB;
    --sc-bg3: #F3F4F6;
    --sc-border: rgba(0,0,0,0.1);
    --sc-font-legacy: var(--sc-font);
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
    .sc-plugin-wrap {
        --sc-brand-ink:   color-mix(in srgb, var(--sc-brand) 52%, #000);
        --sc-brand-deep:  color-mix(in srgb, var(--sc-brand) 36%, #000);
        --sc-tint-1:      color-mix(in srgb, var(--sc-brand) 8%,  #fff);
        --sc-tint-2:      color-mix(in srgb, var(--sc-brand) 16%, #fff);
        --sc-brand-line:  color-mix(in srgb, var(--sc-brand) 34%, #fff);
        --sc-ring:        color-mix(in srgb, var(--sc-brand) 26%, transparent);
        --sc-bubble-in:   color-mix(in srgb, var(--sc-brand) 9%, #F3F5F7);
        --sc-live-top:    color-mix(in srgb, var(--sc-brand) 44%, #000);
        --sc-live-bottom: color-mix(in srgb, var(--sc-brand) 20%, #000);
    }
}

/* Per-topic colour tones. Tone 1 follows the brand; the rest are fixed hues
   so topic icons read as distinct at a glance. */
.sc-plugin-wrap .sc-tone-1 { --t-fg: var(--sc-brand-ink); --t-tile: var(--sc-tint-2); --t-wash: var(--sc-tint-1); --t-line: var(--sc-brand-line); }
.sc-plugin-wrap .sc-tone-2 { --t-fg: #0F7B53; --t-tile: #DDF4EA; --t-wash: #F3FBF7; --t-line: #C9EADB; }
.sc-plugin-wrap .sc-tone-3 { --t-fg: #1F5FBF; --t-tile: #E1ECFC; --t-wash: #F4F8FE; --t-line: #CCDEF7; }
.sc-plugin-wrap .sc-tone-4 { --t-fg: #6338C9; --t-tile: #ECE5FB; --t-wash: #F8F5FE; --t-line: #DBD0F6; }
.sc-plugin-wrap .sc-tone-5 { --t-fg: #C2303A; --t-tile: #FBE4E6; --t-wash: #FEF6F7; --t-line: #F5CDD1; }
.sc-plugin-wrap .sc-tone-6 { --t-fg: #0A7F8F; --t-tile: #DAF1F4; --t-wash: #F2FAFB; --t-line: #C2E6EB; }

/* ═══════════════════════════════════════════════════════════════
   2. CANVAS SHELL
   ═══════════════════════════════════════════════════════════════ */
.sc-plugin-wrap {
    font-family: var(--sc-font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--sc-text);
    width: 420px;
    max-width: 100%;
    height: 660px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: var(--sc-radius-lg);
    overflow: hidden;
    background: #fff;
    position: relative;
    box-shadow: 0 28px 60px -24px rgba(16, 24, 40, 0.4), 0 4px 12px rgba(16, 24, 40, 0.06);
    -webkit-font-smoothing: antialiased;
    text-align: left;
}
.sc-plugin-wrap *,
.sc-plugin-wrap *::before,
.sc-plugin-wrap *::after { box-sizing: border-box; }
.sc-plugin-wrap button,
.sc-plugin-wrap input,
.sc-plugin-wrap select,
.sc-plugin-wrap textarea { font-family: inherit; }
.sc-plugin-wrap button { margin: 0; text-transform: none; letter-spacing: normal; }
.sc-plugin-wrap svg { flex-shrink: 0; }
.sc-plugin-wrap p { margin: 0; }

.sc-plugin-wrap :focus-visible {
    outline: 2px solid var(--sc-brand-ink);
    outline-offset: 2px;
}
.sc-plugin-wrap .sc-header :focus-visible { outline-color: var(--sc-on-brand); }

/* ── Header ─────────────────────────────────────────────────── */
.sc-plugin-wrap .sc-header {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    padding: 18px 18px 54px;
    color: var(--sc-on-brand);
    overflow: hidden;
    background:
        radial-gradient(110% 120% at 100% -10%, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 58%),
        radial-gradient(70% 90% at 0% 120%, rgba(0,0,0,.16) 0%, rgba(0,0,0,0) 62%),
        linear-gradient(135deg, var(--sc-brand) 0%, var(--sc-grad-end) 100%);
}
.sc-plugin-wrap .sc-header::after {           /* soft diagonal sweep, echoes the sample layout */
    content: "";
    position: absolute;
    right: -40px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: 0 0 0 28px rgba(255,255,255,.05), 0 0 0 64px rgba(255,255,255,.035);
    pointer-events: none;
}
.sc-plugin-wrap .sc-header-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}
.sc-plugin-wrap .sc-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.sc-plugin-wrap .sc-avatar-wrap { position: relative; flex: none; }
.sc-plugin-wrap .sc-logo-circle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.92);
    background: rgba(255,255,255,.3);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,.35);
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 19px;
    font-weight: 700;
    color: var(--sc-on-brand);
}
.sc-plugin-wrap .sc-logo-circle img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.sc-plugin-wrap .sc-hero-text { min-width: 0; padding-top: 2px; }
.sc-plugin-wrap .sc-greeting {
    font-size: 22px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
    color: inherit;
    overflow-wrap: anywhere;
}
.sc-plugin-wrap .sc-subline {
    font-size: 13.5px;
    line-height: 1.35;
    margin-top: 5px;
    color: inherit;
    opacity: .92;
}
.sc-plugin-wrap .sc-logo-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-plugin-wrap .sc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}
.sc-plugin-wrap .sc-hdr-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--sc-on-brand);
    background: rgba(255,255,255,.24);
    font-size: 18px;
    line-height: 1;
    transition: background .15s;
}
.sc-plugin-wrap .sc-hdr-btn:hover { background: rgba(255,255,255,.4); }

/* Online dot (status colour is set at runtime by JS) */
.sc-plugin-wrap .sc-online-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* Compact header on every screen except Home */
.sc-plugin-wrap:not([data-view="home"]) .sc-header { padding: 11px 14px; }
.sc-plugin-wrap:not([data-view="home"]) .sc-header::after { display: none; }
.sc-plugin-wrap:not([data-view="home"]) .sc-logo { gap: 10px; }
.sc-plugin-wrap:not([data-view="home"]) .sc-logo-circle { width: 34px; height: 34px; border-width: 2px; font-size: 12px; box-shadow: none; }
.sc-plugin-wrap:not([data-view="home"]) .sc-header .sc-online-dot { width: 10px; height: 10px; border-width: 2px; }
.sc-plugin-wrap:not([data-view="home"]) .sc-hero-text { display: none; }
.sc-plugin-wrap:not([data-view="home"]) .sc-hdr-btn { width: 30px; height: 30px; font-size: 16px; }
.sc-plugin-wrap:not([data-view="home"]) .sc-header-top { align-items: center; }
.sc-plugin-wrap[data-view="home"] .sc-logo-name { display: none; }

/* ── Search ─────────────────────────────────────────────────── */
.sc-plugin-wrap .sc-search-overlap {
    position: relative;
    z-index: 6;
    flex-shrink: 0;
    margin: -30px 16px 0;
}
.sc-plugin-wrap .sc-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 8px 0 18px;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: 999px;
    box-shadow: 0 16px 30px -16px rgba(16,24,40,.45), 0 2px 6px rgba(16,24,40,.06);
    transition: border-color .15s, box-shadow .15s;
}
.sc-plugin-wrap .sc-search-box:focus-within {
    border-color: var(--sc-brand);
    box-shadow: 0 0 0 4px var(--sc-ring), 0 16px 30px -16px rgba(16,24,40,.45);
}
.sc-plugin-wrap .sc-search-box > svg { width: 20px; height: 20px; color: var(--sc-text); }
.sc-plugin-wrap .sc-search-box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-size: 15px;
    color: var(--sc-text);
}
.sc-plugin-wrap .sc-search-box input::placeholder { color: var(--sc-muted); opacity: 1; }
.sc-plugin-wrap .sc-search-go {
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    transition: background .15s, color .15s;
}
.sc-plugin-wrap .sc-search-go:hover { background: var(--sc-brand); color: var(--sc-on-brand); }
.sc-plugin-wrap .sc-search-go svg { width: 18px; height: 18px; }

.sc-plugin-wrap .sc-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    box-shadow: 0 24px 44px -18px rgba(16,24,40,.4);
    z-index: 100;
    max-height: 270px;
    overflow-y: auto;
    padding: 6px;
}
.sc-plugin-wrap .sc-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    font-size: 13.5px;
    cursor: pointer;
    color: var(--sc-text);
}
.sc-plugin-wrap .sc-search-result-item:hover { background: var(--sc-tint-1); }
.sc-plugin-wrap .sc-search-result-item .sc-res-ico { display: grid; place-items: center; color: var(--sc-brand-ink); }
.sc-plugin-wrap .sc-search-result-item .sc-res-ico svg { width: 16px; height: 16px; }
.sc-plugin-wrap .sc-search-result-item .sc-res-cat { margin-left: auto; font-size: 11.5px; color: var(--sc-muted); white-space: nowrap; }

/* Search is for Home and the Help center only; on Help it sits flat under the compact header */
.sc-plugin-wrap:not([data-view="home"]):not([data-view="kb"]) .sc-search-overlap { display: none; }
.sc-plugin-wrap[data-view="kb"] .sc-search-overlap { margin: 12px 16px 0; }
.sc-plugin-wrap[data-view="kb"] .sc-search-box { height: 46px; box-shadow: none; background: var(--sc-wash); }
.sc-plugin-wrap[data-view="kb"] .sc-search-box:focus-within { background: #fff; box-shadow: 0 0 0 4px var(--sc-ring); }
.sc-plugin-wrap[data-view="kb"] .sc-search-go { width: 34px; height: 34px; }

/* ── Tabs ───────────────────────────────────────────────────── */
.sc-plugin-wrap .sc-nav-tabs {
    position: relative;
    z-index: 3;
    display: flex;
    gap: 0;
    flex-shrink: 0;
    margin: 14px 0 0;
    padding: 0 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-bottom: 1px solid var(--sc-line);
    background: #fff;
}
.sc-plugin-wrap .sc-nav-tabs::-webkit-scrollbar { display: none; }
.sc-plugin-wrap:not([data-view="home"]):not([data-view="kb"]) .sc-nav-tabs { margin-top: 0; }
/* Right-edge fade appears only while more tabs are hidden off-screen (toggled by JS) */
.sc-plugin-wrap .sc-nav-tabs[data-more-right="1"] {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent);
}
.sc-plugin-wrap .sc-nav-tabs[data-more-left="1"] {
    -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(270deg, #000 calc(100% - 34px), transparent);
}
.sc-plugin-wrap .sc-nav-tabs[data-more-left="1"][data-more-right="1"] {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent);
}
.sc-plugin-wrap .sc-nav-tab {
    position: relative;
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 9px 14px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--sc-muted);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s;
}
.sc-plugin-wrap .sc-nav-tab svg { width: 17px; height: 17px; margin: 0; }
.sc-plugin-wrap .sc-nav-tab::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--sc-brand);
    transform: scaleX(0);
    transition: transform .2s ease;
}
.sc-plugin-wrap .sc-nav-tab:hover { color: var(--sc-text); background: none; }
.sc-plugin-wrap .sc-nav-tab.active { color: var(--sc-brand-ink); font-weight: 700; }
.sc-plugin-wrap .sc-nav-tab.active::after { transform: scaleX(1); }

/* ── Screens ────────────────────────────────────────────────── */
.sc-plugin-wrap .sc-screen { display: none; }
.sc-plugin-wrap .sc-screen.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.sc-plugin-wrap .sc-screen-chat { display: none; flex-direction: column; }
.sc-plugin-wrap .sc-screen-chat.active { display: flex; flex: 1; min-height: 0; }
.sc-plugin-wrap .sc-screen-voice { display: none; }
.sc-plugin-wrap .sc-screen-voice.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.sc-plugin-wrap .sc-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 16px 22px;
    scrollbar-width: thin;
    scrollbar-color: var(--sc-line-strong) transparent;
}
.sc-plugin-wrap .sc-link { color: var(--sc-brand-ink); cursor: pointer; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   3. HOME
   ═══════════════════════════════════════════════════════════════ */
.sc-plugin-wrap .sc-section + .sc-section { margin-top: 24px; }
.sc-plugin-wrap .sc-section-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.sc-plugin-wrap .sc-section-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-top: -1px;
    color: var(--sc-brand-ink);
}
.sc-plugin-wrap .sc-section-icon svg { width: 22px; height: 22px; }
.sc-plugin-wrap .sc-section-title {
    margin: 0;
    padding: 0;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--sc-text);
    text-transform: none;
}
.sc-plugin-wrap .sc-section-sub {
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--sc-muted);
}

/* Quick-action cards */
.sc-plugin-wrap .sc-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}
.sc-plugin-wrap .sc-quick-action {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    min-height: 144px;
    padding: 12px 12px 14px;
    margin: 0;
    text-align: left;
    color: var(--sc-text);
    cursor: pointer;
    border: 1px solid var(--t-line);
    border-radius: var(--sc-radius);
    background: linear-gradient(165deg, var(--t-wash) 0%, #fff 78%);
    transition: border-color .15s, box-shadow .15s;
}
.sc-plugin-wrap .sc-quick-action:hover {
    border-color: var(--t-fg);
    box-shadow: 0 10px 22px -14px var(--t-fg);
}
.sc-plugin-wrap .sc-qa-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}
.sc-plugin-wrap .sc-qa-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    border-radius: 13px;
    background: var(--t-tile);
    color: var(--t-fg);
}
.sc-plugin-wrap .sc-qa-icon svg { width: 21px; height: 21px; }
.sc-plugin-wrap .sc-qa-go {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--t-tile);
    color: var(--t-fg);
    transition: transform .15s;
}
.sc-plugin-wrap .sc-qa-go svg { width: 13px; height: 13px; }
.sc-plugin-wrap .sc-quick-action:hover .sc-qa-go { transform: translateX(2px); }
.sc-plugin-wrap .sc-qa-label {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--sc-text);
}
.sc-plugin-wrap .sc-qa-desc {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--sc-muted);
}

/* Topic grid */
.sc-plugin-wrap .sc-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.sc-plugin-wrap .sc-category-grid > .sc-category-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sc-plugin-wrap .sc-category-card {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    margin: 0;
    text-align: left;
    color: var(--sc-text);
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    transition: border-color .15s, background .15s;
}
.sc-plugin-wrap .sc-category-card:hover { border-color: var(--t-line); background: var(--t-wash); }
.sc-plugin-wrap .sc-cat-img {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--t-tile);
    color: var(--t-fg);
    font-size: 20px;
}
.sc-plugin-wrap .sc-cat-img svg { width: 22px; height: 22px; }
.sc-plugin-wrap .sc-cat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-plugin-wrap .sc-cat-name {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.25;
    font-weight: 650;
    color: var(--sc-text);
    overflow-wrap: anywhere;
}
.sc-plugin-wrap .sc-cat-count { font-size: 12px; color: var(--sc-muted); }
.sc-plugin-wrap .sc-cat-arrow { flex: none; display: grid; place-items: center; color: var(--sc-faint); margin: 0; transition: transform .15s, color .15s; }
.sc-plugin-wrap .sc-cat-arrow svg { width: 16px; height: 16px; }
.sc-plugin-wrap .sc-category-card:hover .sc-cat-arrow { transform: translateX(2px); color: var(--t-fg); }

/* Popular articles */
.sc-plugin-wrap .sc-popular-articles {
    margin: 0;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    overflow: hidden;
}
.sc-plugin-wrap .sc-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--sc-line);
    cursor: pointer;
    transition: background .12s;
}
.sc-plugin-wrap .sc-article-item:last-child { border-bottom: 0; }
.sc-plugin-wrap .sc-article-item:hover { background: var(--sc-tint-1); }
.sc-plugin-wrap .sc-article-title { flex: 1; font-size: 13.5px; line-height: 1.35; font-weight: 500; color: var(--sc-text); }
.sc-plugin-wrap .sc-article-arrow { display: grid; place-items: center; margin: 0; color: var(--sc-faint); }
.sc-plugin-wrap .sc-article-arrow svg { width: 16px; height: 16px; }

/* Still need help? */
.sc-plugin-wrap .sc-help-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--sc-tint-1);
    border: 1px solid var(--sc-brand-line);
}
.sc-plugin-wrap .sc-help-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
}
.sc-plugin-wrap .sc-help-icon svg { width: 24px; height: 24px; }
.sc-plugin-wrap .sc-help-text { flex: 1 1 140px; min-width: 0; }
.sc-plugin-wrap .sc-help-title { font-size: 14.5px; line-height: 1.2; font-weight: 700; color: var(--sc-text); }
.sc-plugin-wrap .sc-help-sub { margin-top: 3px; font-size: 12px; line-height: 1.4; color: var(--sc-muted); }
.sc-plugin-wrap .sc-help-btn,
.sc-plugin-wrap .sc-primary-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: none;
    height: 44px;
    padding: 0 18px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 20px -12px var(--sc-brand);
    transition: filter .15s, transform .15s;
}
.sc-plugin-wrap .sc-help-btn:hover,
.sc-plugin-wrap .sc-primary-btn:hover { filter: brightness(.94); }
.sc-plugin-wrap .sc-help-btn svg { width: 16px; height: 16px; transition: transform .15s; }
.sc-plugin-wrap .sc-help-btn:hover svg { transform: translateX(2px); }

/* ═══════════════════════════════════════════════════════════════
   4. LIVE CHAT
   ═══════════════════════════════════════════════════════════════ */
.sc-plugin-wrap .sc-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin: 12px 14px 0;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 22px -18px rgba(16,24,40,.35);
}
.sc-plugin-wrap .sc-agent-avatar-wrap { position: relative; flex: none; }
.sc-plugin-wrap .sc-agent-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    font-size: 13px;
    font-weight: 700;
}
.sc-plugin-wrap .sc-agent-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-plugin-wrap .sc-agent-avatar-wrap .sc-online-dot { width: 12px; height: 12px; border-width: 2px; right: -1px; bottom: -1px; }
.sc-plugin-wrap .sc-agent-info { flex: 1; min-width: 0; }
.sc-plugin-wrap .sc-agent-name { font-size: 14.5px; line-height: 1.2; font-weight: 700; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-plugin-wrap .sc-agent-status { margin-top: 3px; font-size: 12px; line-height: 1.2; color: var(--sc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-plugin-wrap .sc-chat-hdr-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.sc-plugin-wrap .sc-chat-action-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sc-plugin-wrap .sc-chat-action-btn:hover { background: var(--sc-brand); color: var(--sc-on-brand); }
.sc-plugin-wrap .sc-chat-action-btn svg { width: 18px; height: 18px; }

/* language picker inside the agent card */
.sc-plugin-wrap .sc-chat-hdr-actions .sc-lang-wrap {
    gap: 4px;
    padding: 0 8px 0 10px;
    height: 38px;
    border-radius: 999px;
    background: var(--sc-wash);
    border: 1px solid var(--sc-line);
    color: var(--sc-muted);
}
.sc-plugin-wrap .sc-chat-hdr-actions .sc-lang-select {
    max-width: 84px;
    padding: 4px 2px;
    background: transparent;
    color: var(--sc-text) !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}
.sc-plugin-wrap .sc-chat-hdr-actions .sc-lang-select:hover { background: transparent; }
.sc-plugin-wrap .sc-chat-hdr-actions .sc-lang-select option { background: #fff; color: #111827; }

/* messages */
.sc-plugin-wrap .sc-messages {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--sc-line-strong) transparent;
}
.sc-plugin-wrap .sc-welcome-msg {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 40px;
}
.sc-plugin-wrap .sc-welcome-msg > .sc-msg-avatar { position: absolute; left: 0; top: 0; }
.sc-plugin-wrap .sc-welcome-bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    background: var(--sc-bubble-in);
    color: var(--sc-text);
    font-size: 13.5px;
    line-height: 1.5;
}
.sc-plugin-wrap .sc-msg-time { margin-top: 4px; padding: 0 4px; font-size: 11px; line-height: 1.2; color: var(--sc-faint); }
.sc-plugin-wrap .sc-quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sc-plugin-wrap .sc-quick-reply {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    padding: 0 14px;
    margin: 0;
    border: 1px solid var(--sc-brand-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sc-brand-ink);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.sc-plugin-wrap .sc-quick-reply:hover { background: var(--sc-tint-1); border-color: var(--sc-brand); }

.sc-plugin-wrap .sc-msg { display: flex; align-items: flex-end; gap: 8px; }
.sc-plugin-wrap .sc-msg.sc-msg-agent  { justify-content: flex-start; }
.sc-plugin-wrap .sc-msg.sc-msg-customer { justify-content: flex-end; }
.sc-plugin-wrap .sc-msg.sc-msg-system { justify-content: center; }
.sc-plugin-wrap .sc-msg-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    font-size: 11px;
    font-weight: 700;
}
.sc-plugin-wrap .sc-msg-avatar svg { width: 18px; height: 18px; }
.sc-plugin-wrap .sc-msg-inner { max-width: 78%; min-width: 0; }
.sc-plugin-wrap .sc-msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.sc-plugin-wrap .sc-msg.sc-msg-agent .sc-msg-bubble {
    background: var(--sc-bubble-in);
    color: var(--sc-text);
    border-bottom-left-radius: 6px;
}
.sc-plugin-wrap .sc-msg.sc-msg-customer .sc-msg-bubble {
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    border-bottom-right-radius: 6px;
}
.sc-plugin-wrap .sc-msg.sc-msg-customer .sc-msg-bubble a { color: inherit; text-decoration: underline; }
.sc-plugin-wrap .sc-msg.sc-msg-system .sc-msg-bubble {
    background: transparent;
    color: var(--sc-muted);
    font-size: 11.5px;
    font-style: normal;
    padding: 4px 10px;
}
.sc-plugin-wrap .sc-msg.sc-msg-customer .sc-msg-time { text-align: right; }
.sc-plugin-wrap .sc-msg.sc-msg-customer .sc-msg-tick { color: var(--sc-brand-ink) !important; font-weight: 700; }
.sc-plugin-wrap .sc-msg-attachment a { color: inherit; display: flex; align-items: center; gap: 6px; text-decoration: none; }
.sc-plugin-wrap .sc-msg-attachment a:hover { text-decoration: underline; }

/* typing */
.sc-plugin-wrap .sc-typing-indicator { display: flex; align-items: center; gap: 8px; padding: 0 16px 10px; flex-shrink: 0; }
.sc-plugin-wrap .sc-typing-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    font-size: 10px;
    font-weight: 700;
}
.sc-plugin-wrap .sc-typing-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-plugin-wrap .sc-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 5px;
    background: var(--sc-bubble-in);
}
.sc-plugin-wrap .sc-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--sc-brand-ink); opacity: .55; animation: scTypeBounce 1.2s infinite; }
.sc-plugin-wrap .sc-typing-dots span:nth-child(2) { animation-delay: .2s; }
.sc-plugin-wrap .sc-typing-dots span:nth-child(3) { animation-delay: .4s; }
.sc-plugin-wrap .sc-typing-label { font-size: 12px; color: var(--sc-muted); }
@keyframes scTypeBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ended / CSAT */
.sc-plugin-wrap .sc-chat-ended-banner {
    flex-shrink: 0;
    padding: 12px 16px;
    background: var(--sc-wash);
    border-top: 1px solid var(--sc-line);
    text-align: center;
    font-size: 12.5px;
    color: var(--sc-muted);
}
.sc-plugin-wrap .sc-csat-prompt { flex-shrink: 0; padding: 14px 16px; text-align: center; border-top: 1px solid var(--sc-line); }
.sc-plugin-wrap .sc-csat-prompt p { margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--sc-text); }
.sc-plugin-wrap .sc-csat-emojis { display: flex; justify-content: center; gap: 12px; font-size: 22px; }
.sc-plugin-wrap .sc-csat-emojis span { cursor: pointer; transition: transform .15s; }
.sc-plugin-wrap .sc-csat-emojis span:hover { transform: scale(1.15); }

/* composer */
.sc-plugin-wrap .sc-chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--sc-line);
}
.sc-plugin-wrap .sc-attach-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sc-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sc-plugin-wrap .sc-attach-btn:hover { background: var(--sc-tint-1); color: var(--sc-brand-ink); }
.sc-plugin-wrap .sc-attach-btn svg { width: 20px; height: 20px; }
.sc-plugin-wrap .sc-input-pill {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 8px;
    border: 1px solid var(--sc-line-strong);
    border-radius: 22px;
    background: var(--sc-wash);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.sc-plugin-wrap .sc-input-pill:focus-within {
    border-color: var(--sc-brand);
    background: #fff;
    box-shadow: 0 0 0 4px var(--sc-ring);
}
.sc-plugin-wrap .sc-chat-input-bar textarea#sc-chat-input {
    display: block;
    flex: 1;
    min-width: 0;
    height: 40px;
    max-height: 120px;
    margin: 0;
    padding: 10px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    resize: none;
    overflow: hidden;
    font-size: 14px;
    line-height: 20px;
    color: var(--sc-text);
}
.sc-plugin-wrap .sc-chat-input-bar textarea#sc-chat-input::placeholder { color: var(--sc-faint); opacity: 1; }
.sc-plugin-wrap .sc-send-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    cursor: pointer;
    box-shadow: 0 10px 18px -10px var(--sc-brand);
    transition: filter .15s;
}
.sc-plugin-wrap .sc-send-btn:hover { filter: brightness(.94); background: var(--sc-brand); }
.sc-plugin-wrap .sc-send-btn svg { width: 18px; height: 18px; margin-left: -1px; }
.sc-plugin-wrap .sc-send-btn:disabled { background: #D8DDE6; color: #fff; box-shadow: none; cursor: not-allowed; filter: none; }
.sc-plugin-wrap .sc-restart-bar { flex-shrink: 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sc-line); text-align: center; }
.sc-plugin-wrap .sc-restart-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.sc-plugin-wrap .sc-restart-btn:hover { filter: brightness(.94); }

/* ═══════════════════════════════════════════════════════════════
   5. VOICE CALL   (state classes set by JS: sc-vs-idle | calling | connected | ended)
   ═══════════════════════════════════════════════════════════════ */
.sc-plugin-wrap .sc-voice-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    padding: 26px 20px 20px;
    text-align: center;
}
.sc-plugin-wrap .sc-call-avatar-ring {
    position: relative;
    order: 0;
    width: 112px;
    height: 112px;
    margin: 0 0 14px;
    padding: 5px;
    border-radius: 50%;
    border: 3px solid var(--sc-brand);
    background: #fff;
    transition: box-shadow .3s;
}
.sc-plugin-wrap .sc-call-avatar-inner {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    font-size: 30px;
    font-weight: 700;
}
.sc-plugin-wrap .sc-call-avatar-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-plugin-wrap .sc-call-avatar-ring .sc-online-dot { width: 18px; height: 18px; right: 6px; bottom: 6px; border-width: 3px; }
.sc-plugin-wrap .sc-call-avatar-ring.ringing { animation: scRingGlow 1.5s infinite; }
@keyframes scRingGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--sc-ring); }
    50%      { box-shadow: 0 0 0 16px transparent; }
}
.sc-plugin-wrap .sc-call-agent-name { order: 1; margin: 0 0 4px; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); }
.sc-plugin-wrap .sc-call-status { order: 2; margin: 0 0 4px; font-size: 13px; color: var(--sc-muted); }
.sc-plugin-wrap .sc-call-timer { order: 2; margin: 6px 0 4px; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--sc-text); }
.sc-plugin-wrap .sc-record-dot { order: 2; }

.sc-plugin-wrap .sc-call-card {
    order: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 18px 0 16px;
    padding: 14px 16px;
    text-align: left;
    background: var(--sc-wash);
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
}
.sc-plugin-wrap .sc-call-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
}
.sc-plugin-wrap .sc-call-card-icon svg { width: 24px; height: 24px; }
.sc-plugin-wrap .sc-call-card-body { flex: 1; min-width: 0; }
.sc-plugin-wrap .sc-call-state-label { margin: 0; font-size: 15px; line-height: 1.25; font-weight: 700; color: var(--sc-text); text-transform: none; letter-spacing: normal; }
.sc-plugin-wrap .sc-queue-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: auto;
    margin: 4px 0 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
}
.sc-plugin-wrap .sc-queue-text { font-size: 12.5px; color: var(--sc-muted); }
.sc-plugin-wrap .sc-queue-badge { padding: 0; background: none; border-radius: 0; font-size: 12.5px; font-weight: 400; color: var(--sc-muted); }
.sc-plugin-wrap .sc-queue-badge:empty { display: none; }

.sc-plugin-wrap .sc-call-cta { order: 4; width: 100%; margin: 0 0 10px; }
.sc-plugin-wrap .sc-start-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 24px -14px var(--sc-brand);
    transition: filter .15s;
}
.sc-plugin-wrap .sc-start-call-btn:hover { filter: brightness(.94); background: var(--sc-brand); }
.sc-plugin-wrap .sc-start-call-btn svg { width: 20px; height: 20px; }
.sc-plugin-wrap .sc-callback-link {
    order: 5;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 48px;
    margin: 0 0 20px;
    padding: 0 18px;
    border: 1.5px solid var(--sc-brand-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sc-brand-ink);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.sc-plugin-wrap .sc-callback-link:hover { background: var(--sc-tint-1); border-color: var(--sc-brand); }
.sc-plugin-wrap .sc-callback-link svg { width: 18px; height: 18px; }

.sc-plugin-wrap .sc-call-controls { order: 6; display: flex; justify-content: center; gap: 16px; margin: auto 0 0; padding-top: 4px; }
.sc-plugin-wrap .sc-call-ctrl { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.sc-plugin-wrap .sc-call-ctrl-btn {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--sc-line-strong);
    background: #fff;
    color: var(--sc-text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.sc-plugin-wrap .sc-call-ctrl-btn:hover { background: var(--sc-tint-1); border-color: var(--sc-brand-line); }
.sc-plugin-wrap .sc-call-ctrl-btn.active { background: var(--sc-tint-2); border-color: var(--sc-brand); color: var(--sc-brand-ink); }
.sc-plugin-wrap .sc-call-ctrl-btn svg { width: 22px; height: 22px; }
.sc-plugin-wrap .sc-call-ctrl-label { font-size: 12px; font-weight: 500; color: var(--sc-muted); }
.sc-plugin-wrap .sc-call-ctrl-btn.active + .sc-call-ctrl-label { color: var(--sc-brand-ink); font-weight: 700; }
/* Before a call exists, mute / speaker / hold have nothing to act on */
.sc-plugin-wrap .sc-vs-idle #sc-mute-btn,
.sc-plugin-wrap .sc-vs-idle #sc-speaker-btn,
.sc-plugin-wrap .sc-vs-idle #sc-hold-btn,
.sc-plugin-wrap .sc-vs-ended #sc-mute-btn,
.sc-plugin-wrap .sc-vs-ended #sc-speaker-btn,
.sc-plugin-wrap .sc-vs-ended #sc-hold-btn { opacity: .5; }

.sc-plugin-wrap .sc-end-call-btn {
    order: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    margin: 22px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: #E5484D;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 26px -14px rgba(229,72,77,.75);
    transition: filter .15s;
}
.sc-plugin-wrap .sc-end-call-btn:hover { filter: brightness(.94); }
.sc-plugin-wrap .sc-end-call-btn svg { width: 22px; height: 22px; transform: rotate(135deg); }
.sc-plugin-wrap .sc-post-call-csat { order: 8; width: 100%; margin-top: 18px; text-align: center; }
.sc-plugin-wrap .sc-post-call-csat p { margin-bottom: 10px; font-size: 13px; color: var(--sc-muted); }

/* Connected / calling → dark brand canvas, controls first, End call last */
.sc-plugin-wrap .sc-screen-voice.sc-vs-calling,
.sc-plugin-wrap .sc-screen-voice.sc-vs-connected {
    background:
        radial-gradient(90% 55% at 50% 22%, rgba(255,255,255,.1) 0%, rgba(255,255,255,0) 70%),
        linear-gradient(180deg, var(--sc-live-top) 0%, var(--sc-live-bottom) 100%);
}
.sc-plugin-wrap .sc-vs-calling .sc-call-agent-name,
.sc-plugin-wrap .sc-vs-connected .sc-call-agent-name,
.sc-plugin-wrap .sc-vs-calling .sc-call-timer,
.sc-plugin-wrap .sc-vs-connected .sc-call-timer,
.sc-plugin-wrap .sc-vs-calling .sc-call-state-label,
.sc-plugin-wrap .sc-vs-connected .sc-call-state-label { color: #fff; }
.sc-plugin-wrap .sc-vs-calling .sc-call-status,
.sc-plugin-wrap .sc-vs-connected .sc-call-status { color: rgba(255,255,255,.74); }
.sc-plugin-wrap .sc-vs-calling .sc-call-avatar-ring,
.sc-plugin-wrap .sc-vs-connected .sc-call-avatar-ring {
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 0 7px var(--sc-ring), 0 0 44px -6px var(--sc-brand);
}
.sc-plugin-wrap .sc-vs-calling .sc-call-avatar-ring .sc-online-dot,
.sc-plugin-wrap .sc-vs-connected .sc-call-avatar-ring .sc-online-dot { border-color: var(--sc-live-top); }
/* live order: name → state label → status → timer → controls → End call */
.sc-plugin-wrap .sc-vs-calling .sc-call-status,
.sc-plugin-wrap .sc-vs-connected .sc-call-status,
.sc-plugin-wrap .sc-vs-calling .sc-call-timer,
.sc-plugin-wrap .sc-vs-connected .sc-call-timer,
.sc-plugin-wrap .sc-vs-calling .sc-record-dot,
.sc-plugin-wrap .sc-vs-connected .sc-record-dot { order: 3; }
/* state label collapses to a plain status line while a call is live */
.sc-plugin-wrap .sc-vs-calling .sc-call-card,
.sc-plugin-wrap .sc-vs-connected .sc-call-card { order: 2; justify-content: center; width: auto; margin: 0 0 6px; padding: 0; background: none; border: 0; }
.sc-plugin-wrap .sc-vs-calling .sc-call-card-icon,
.sc-plugin-wrap .sc-vs-connected .sc-call-card-icon { display: none; }
.sc-plugin-wrap .sc-vs-calling .sc-call-state-label,
.sc-plugin-wrap .sc-vs-connected .sc-call-state-label { font-size: 13px; font-weight: 600; opacity: .9; }
.sc-plugin-wrap .sc-vs-calling .sc-call-card-body,
.sc-plugin-wrap .sc-vs-connected .sc-call-card-body { text-align: center; }
.sc-plugin-wrap .sc-vs-calling .sc-call-controls,
.sc-plugin-wrap .sc-vs-connected .sc-call-controls { order: 4; margin-top: 26px; }
.sc-plugin-wrap .sc-vs-calling .sc-call-ctrl-btn,
.sc-plugin-wrap .sc-vs-connected .sc-call-ctrl-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; }
.sc-plugin-wrap .sc-vs-calling .sc-call-ctrl-btn:hover,
.sc-plugin-wrap .sc-vs-connected .sc-call-ctrl-btn:hover { background: rgba(255,255,255,.16); }
.sc-plugin-wrap .sc-vs-calling .sc-call-ctrl-btn.active,
.sc-plugin-wrap .sc-vs-connected .sc-call-ctrl-btn.active { background: var(--sc-brand); border-color: var(--sc-brand); color: var(--sc-on-brand); }
.sc-plugin-wrap .sc-vs-calling .sc-call-ctrl-label,
.sc-plugin-wrap .sc-vs-connected .sc-call-ctrl-label { color: rgba(255,255,255,.7); }
.sc-plugin-wrap .sc-vs-calling .sc-call-ctrl-btn.active + .sc-call-ctrl-label,
.sc-plugin-wrap .sc-vs-connected .sc-call-ctrl-btn.active + .sc-call-ctrl-label { color: #fff; }
.sc-plugin-wrap .sc-vs-calling .sc-end-call-btn,
.sc-plugin-wrap .sc-vs-connected .sc-end-call-btn { order: 5; margin-top: auto; }
.sc-plugin-wrap .sc-vs-calling .sc-call-controls,
.sc-plugin-wrap .sc-vs-connected .sc-call-controls { margin-bottom: 22px; }
.sc-plugin-wrap .sc-vs-connected .sc-call-timer { font-size: 30px; }
.sc-plugin-wrap .sc-vs-connected .sc-record-dot { color: #ff8a8f !important; }

/* ═══════════════════════════════════════════════════════════════
   6. TICKETS · HELP CENTER · ARTICLE · PRE-CHAT
   ═══════════════════════════════════════════════════════════════ */
/* Tickets */
.sc-plugin-wrap .sc-ticket-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    background: var(--sc-wash);
    border: 1px solid var(--sc-line);
    border-radius: 999px;
}
.sc-plugin-wrap .sc-ticket-tab {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--sc-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sc-plugin-wrap .sc-ticket-tab.active { background: var(--sc-brand); color: var(--sc-on-brand); font-weight: 700; box-shadow: 0 6px 14px -8px var(--sc-brand); }
.sc-plugin-wrap .sc-form-group { margin-bottom: 16px; }
.sc-plugin-wrap .sc-form-label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 650; color: var(--sc-text); }
.sc-plugin-wrap .sc-form-control {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--sc-line-strong);
    border-radius: var(--sc-radius-sm);
    background: #fff;
    color: var(--sc-text);
    font-size: 14px;
    outline: none;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.sc-plugin-wrap textarea.sc-form-control { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.sc-plugin-wrap .sc-form-control:focus { border-color: var(--sc-brand); box-shadow: 0 0 0 4px var(--sc-ring); }
.sc-plugin-wrap .sc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-plugin-wrap .sc-chip {
    padding: 8px 14px;
    border: 1px solid var(--sc-line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--sc-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.sc-plugin-wrap .sc-chip:hover { border-color: var(--sc-brand-line); background: var(--sc-tint-1); }
.sc-plugin-wrap .sc-chip.selected { background: var(--sc-brand); border-color: var(--sc-brand); color: var(--sc-on-brand); }
.sc-plugin-wrap .sc-submit-btn {
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 6px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    box-shadow: 0 14px 24px -14px var(--sc-brand);
    transition: filter .15s;
}
.sc-plugin-wrap .sc-submit-btn:hover { filter: brightness(.94); background: var(--sc-brand); }
.sc-plugin-wrap .sc-submit-btn:disabled { background: #D8DDE6; color: #fff; box-shadow: none; cursor: not-allowed; }
.sc-plugin-wrap .sc-ticket-success { margin-top: 14px; padding: 26px 16px; text-align: center; background: var(--sc-wash); border-radius: var(--sc-radius); }
.sc-plugin-wrap .sc-ticket-item { padding: 14px 4px; border-bottom: 1px solid var(--sc-line); }
.sc-plugin-wrap .sc-ticket-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sc-tint-1); color: var(--sc-brand-ink); }
.sc-plugin-wrap .sc-ticket-subject { font-size: 13.5px; font-weight: 650; color: var(--sc-text); }
.sc-plugin-wrap .sc-ticket-meta { font-size: 12px; color: var(--sc-muted); }

/* Help center accordion */
.sc-plugin-wrap .sc-kb-category {
    margin-bottom: 10px;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: #fff;
    overflow: hidden;
}
.sc-plugin-wrap .sc-kb-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}
.sc-plugin-wrap .sc-kb-cat-header:hover { background: var(--t-wash); }
.sc-plugin-wrap .sc-kb-cat-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--t-tile);
    color: var(--t-fg);
    font-size: 17px;
}
.sc-plugin-wrap .sc-kb-cat-icon svg { width: 20px; height: 20px; }
.sc-plugin-wrap .sc-kb-cat-name { flex: 1; font-size: 14px; font-weight: 650; color: var(--sc-text) !important; }
.sc-plugin-wrap .sc-kb-cat-count { font-size: 12px; color: var(--sc-muted); }
.sc-plugin-wrap .sc-kb-cat-toggle { width: 16px; text-align: center; font-size: 13px; color: var(--sc-faint); }
.sc-plugin-wrap .sc-kb-articles { padding: 0 14px 4px; background: #fff; border-top: 1px solid var(--sc-line); }
.sc-plugin-wrap .sc-kb-article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sc-line);
    font-size: 13.5px;
    color: var(--sc-text);
    cursor: pointer;
}
.sc-plugin-wrap .sc-kb-article:last-child { border-bottom: 0; }
.sc-plugin-wrap .sc-kb-article:hover { color: var(--sc-brand-ink); }
.sc-plugin-wrap .sc-suggest-box { margin-top: 16px; padding: 18px; text-align: center; background: var(--sc-tint-1); border: 1px solid var(--sc-brand-line); border-radius: var(--sc-radius); }
.sc-plugin-wrap .sc-suggest-box p { margin-bottom: 12px; font-size: 13.5px; font-weight: 600; color: var(--sc-text); }
.sc-plugin-wrap .sc-link-btn {
    height: 40px;
    padding: 0 18px;
    border: 1.5px solid var(--sc-brand-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sc-brand-ink);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.sc-plugin-wrap .sc-link-btn:hover { background: var(--sc-tint-1); border-color: var(--sc-brand); }

/* Article viewer */
.sc-plugin-wrap .sc-screen-article { display: none; }
.sc-plugin-wrap .sc-screen-article.active { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.sc-plugin-wrap .sc-article-header { padding: 10px 14px; border-bottom: 1px solid var(--sc-line); }
.sc-plugin-wrap .sc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--sc-brand-ink);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}
.sc-plugin-wrap .sc-back-btn:hover { background: var(--sc-tint-1); text-decoration: none; }
.sc-plugin-wrap #sc-article-content .sc-article-title { display: block; margin-bottom: 14px; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); }
.sc-plugin-wrap #sc-article-content .sc-article-body { font-size: 14px; line-height: 1.7; color: var(--sc-text); }
.sc-plugin-wrap #sc-article-content .sc-article-category { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px; background: var(--sc-tint-1); font-size: 12px; font-weight: 600; color: var(--sc-brand-ink); }
.sc-plugin-wrap #sc-article-content .sc-article-category svg { width: 14px; height: 14px; }

/* Pre-chat (guests) */
.sc-plugin-wrap .sc-prechat {
    position: absolute;
    inset: 0;
    z-index: 90;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    text-align: center;
    background: #fff;
    border-radius: inherit;
}
.sc-plugin-wrap .sc-prechat-back {
    position: absolute;
    top: 14px;
    left: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sc-wash);
    color: var(--sc-muted);
    font-size: 18px;
    cursor: pointer;
    transition: background .15s;
}
.sc-plugin-wrap .sc-prechat-back:hover { background: var(--sc-tint-2); color: var(--sc-brand-ink); }
.sc-plugin-wrap .sc-prechat-title { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); }
.sc-plugin-wrap .sc-prechat-sub { margin: 0 0 24px; max-width: 290px; font-size: 13.5px; line-height: 1.5; color: var(--sc-muted); }
.sc-plugin-wrap .sc-prechat-form { width: 100%; max-width: 300px; text-align: left; }
.sc-plugin-wrap .sc-prechat-form .sc-form-group:last-of-type { margin-bottom: 20px; }
.sc-plugin-wrap .sc-prechat-skip { margin-top: 14px; font-size: 12.5px; text-align: center; color: var(--sc-muted); }
.sc-plugin-wrap .sc-prechat-skip a { color: var(--sc-brand-ink); font-weight: 600; text-decoration: underline; }
.sc-plugin-wrap .sc-prechat .sc-welcome-icon { background: var(--sc-tint-2); }
.sc-plugin-wrap .sc-prechat .sc-welcome-icon svg { color: var(--sc-brand-ink); }

/* Loading / empty states inside the canvas */
.sc-plugin-wrap .sc-loading,
.sc-plugin-wrap .sc-empty { padding: 28px 16px; text-align: center; font-size: 13px; color: var(--sc-muted); }

/* Language selector — chat card variant handled above; bare select used elsewhere */
.sc-plugin-wrap .sc-lang-select { color: var(--sc-text) !important; }

/* ═══════════════════════════════════════════════════════════════
   7. LAUNCHER · FLOATING PANEL · MOBILE
   ═══════════════════════════════════════════════════════════════ */
.sc-launcher { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.sc-launcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 0;
    border-radius: 28px;
    background: var(--sc-user-brand, #F5A623);
    color: var(--sc-user-on-brand, #1c1303);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px -8px rgba(16,24,40,.45);
    transition: transform .15s, box-shadow .15s;
}
.sc-launcher-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(16,24,40,.5); }
.sc-launcher-badge { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #EF4444; color: #fff; font-size: 10px; font-weight: 700; }
.sc-launcher-icon { width: 22px; height: 22px; object-fit: contain; display: block; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    .sc-plugin-wrap *,
    .sc-plugin-wrap *::before,
    .sc-plugin-wrap *::after { animation: none !important; transition: none !important; }
}

/* Phones: topics collapse to one column, quick actions become rows */
@media (max-width: 380px) {
    .sc-plugin-wrap .sc-category-grid { grid-template-columns: 1fr; }
    .sc-plugin-wrap .sc-quick-actions { grid-template-columns: 1fr; }
    .sc-plugin-wrap .sc-quick-action {
        display: grid;
        grid-template-columns: 40px 1fr 26px;
        grid-template-areas: "icon label go" "icon desc go";
        align-items: center;
        column-gap: 12px;
        row-gap: 2px;
        min-height: 0;
        padding: 12px;
    }
    .sc-plugin-wrap .sc-qa-top { display: contents; }
    .sc-plugin-wrap .sc-qa-icon { grid-area: icon; align-self: start; }
    .sc-plugin-wrap .sc-qa-go { grid-area: go; }
    .sc-plugin-wrap .sc-qa-label { grid-area: label; align-self: end; }
    .sc-plugin-wrap .sc-qa-desc { grid-area: desc; align-self: start; }
    .sc-plugin-wrap .sc-help-btn { width: 100%; }
    .sc-plugin-wrap .sc-greeting { font-size: 20px; }
    .sc-plugin-wrap .sc-logo-circle { width: 54px; height: 54px; }
    .sc-plugin-wrap .sc-call-controls { gap: 12px; }
    .sc-plugin-wrap .sc-call-ctrl-btn { width: 52px; height: 52px; }
}

@media (max-width: 480px) {
    .sc-plugin-wrap {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 20px 20px 0 0;
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        box-shadow: 0 -8px 30px rgba(16,24,40,.18);
    }
    .sc-plugin-wrap .sc-header { padding-top: max(18px, env(safe-area-inset-top, 0px)); }
    .sc-plugin-wrap:not([data-view="home"]) .sc-header { padding-top: max(11px, env(safe-area-inset-top, 0px)); }
    .sc-plugin-wrap .sc-body { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
    .sc-plugin-wrap .sc-voice-body { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
    .sc-plugin-wrap .sc-chat-input-bar textarea#sc-chat-input { font-size: 16px; }  /* stops iOS zoom-on-focus */
    .sc-plugin-wrap .sc-search-box input { font-size: 16px; }
    .sc-plugin-wrap .sc-form-control { font-size: 16px; }

    #sc-floating-panel,
    #sc-trigger-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        transform: none !important;
        border-radius: 20px 20px 0 0 !important;
    }
    #sc-floating-panel .sc-plugin-wrap,
    #sc-trigger-panel .sc-plugin-wrap {
        border-radius: 20px 20px 0 0;
        height: 100dvh;
        max-height: 100dvh;
    }
}

/* Canvas position variants */
.sc-canvas-right  { margin-left: auto; margin-right: 0; }
.sc-canvas-left   { margin-left: 0; margin-right: auto; }
.sc-canvas-center { margin-left: auto; margin-right: auto; }

/* Floating panel animation */
@keyframes scSlideUp {
    0%   { opacity: 0; transform: translateY(28px) scale(0.96); }
    60%  { opacity: 1; transform: translateY(-4px)  scale(1.01); }
    80%  { transform: translateY(2px)  scale(0.995); }
    100% { opacity: 1; transform: translateY(0)     scale(1); }
}
@keyframes scSlideDown {
    from { opacity: 1; transform: translateY(0)    scale(1); }
    to   { opacity: 0; transform: translateY(24px) scale(0.97); }
}
#sc-floating-panel {
    transform-origin: bottom right;
    animation-duration: 0.30s;
    animation-fill-mode: both;
    animation-timing-function: ease-out;
}
#sc-floating-panel.sc-panel-open,
#sc-trigger-panel.sc-panel-open { animation-name: scSlideUp; }
#sc-floating-panel.sc-panel-close,
#sc-trigger-panel.sc-panel-close {
    animation-name: scSlideDown;
    animation-timing-function: ease-in;
    animation-duration: 0.18s;
}
#sc-floating-panel .sc-plugin-wrap,
#sc-trigger-panel .sc-plugin-wrap {
    border-radius: var(--sc-radius-lg, 20px);
    box-shadow: none;
    max-width: 100%;
    margin: 0;
    width: 100%;
    height: 660px;
    max-height: 84vh;
}
#sc-floating-btn { transition: opacity 0.18s ease, transform 0.18s ease; }
#sc-floating-btn.sc-btn-hidden { opacity: 0; pointer-events: none; transform: scale(0.85); }
@media (prefers-reduced-motion: reduce) {
    #sc-floating-panel, #sc-trigger-panel { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   8. SHARED PRIMITIVES — also consumed by the agent dashboard and
      admin panel (their JS builds .sc-msg-* / ticket rows etc.).
      Kept verbatim; the canvas overrides them via .sc-plugin-wrap.
   ═══════════════════════════════════════════════════════════════ */

/* .sc-online-dot / message bubbles / ticket rows: used by the widget AND the dashboards */
.sc-online-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    position: absolute;
    bottom: 0;
    right: 0;
}

/* Chat messages */
.sc-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.sc-msg.sc-msg-agent { justify-content: flex-start; }
.sc-msg.sc-msg-customer { justify-content: flex-end; }
.sc-msg.sc-msg-system { justify-content: center; }
.sc-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FFF8EC;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #D4881A;
}
.sc-msg-inner { max-width: 70%; }
.sc-msg-bubble {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}
.sc-msg.sc-msg-agent .sc-msg-bubble {
    background: #F9FAFB;
    color: #111827;
    border-bottom-left-radius: 4px;
}
.sc-msg.sc-msg-customer .sc-msg-bubble {
    background: #F5A623;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sc-msg.sc-msg-system .sc-msg-bubble {
    background: transparent;
    color: #6B7280;
    font-size: 11px;
    font-style: italic;
}
.sc-msg.sc-msg-customer .sc-msg-time { text-align: right; }
.sc-msg-attachment a {
    color: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.sc-msg-attachment a:hover { text-decoration: underline; }

/* Ticket list */
.sc-ticket-list { display: flex; flex-direction: column; }
.sc-ticket-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
}
.sc-ticket-item:last-child { border-bottom: none; }
.sc-ticket-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #F9FAFB;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.sc-ticket-info { flex: 1; min-width: 0; }
.sc-ticket-subject { font-size: 13px; font-weight: 500; color: #111827; }
.sc-ticket-meta { font-size: 11px; color: #6B7280; margin-top: 2px; }
.sc-ticket-status {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}
.sc-status-open    { background: #FEF3C7; color: #92400E; }
.sc-status-pending { background: #DBEAFE; color: #1E40AF; }
.sc-status-resolved{ background: #D1FAE5; color: #065F46; }
.sc-status-closed  { background: #F3F4F6; color: #374151; }

/* ── LOADING / EMPTY ─────────────────────────────────────────── */
.sc-loading {
    text-align: center;
    color: #6B7280;
    font-size: 13px;
    padding: 24px;
}
.sc-empty {
    text-align: center;
    color: #6B7280;
    font-size: 13px;
    padding: 16px;
}

/* ── Language selector ─────────────────────────────────────── */
.sc-lang-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    position: relative;
}
.sc-lang-icon {
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
    flex-shrink: 0;
}
.sc-lang-select {
    border: none;
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    max-width: 100px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.sc-lang-select option {
    background: #1a1a2e;
    color: #ffffff;
}
.sc-lang-select:hover {
    background: rgba(255,255,255,0.3);
}

/* Agent dashboard language selector (light background) */
.sc-agent-lang-wrap {
    margin-left: auto;
}
.sc-agent-lang-wrap .sc-lang-select {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}
.sc-agent-lang-wrap .sc-lang-select option {
    background: #ffffff;
    color: #111827;
}
.sc-agent-lang-wrap .sc-lang-icon {
    color: #6b7280;
}


/*** support chat language select + admin colour helpers ***/
.sc-lang-select{color:black !important}
/* (widget selectors .sc-nav-tab.active / .sc-link / .sc-kb-article removed — the canvas styles those itself) */
.sc-lnk,.sc-admin-nav-item.active,.sc-add-cat-btn,.sc-export-btn:hover{color:#fff !important}
.sc-kb-cat-name{color:#fff !important}
.sc-drp-btn.active{color:#fff !important}
.sc-activity-avatar{color:#fffcf9 !important}
/* sc-admin-panel layout moved to agent-dashboard.css */
#sc-view-tickets .sc-admin-table-wrap .sc-filter-bar,
#sc-view-voice .sc-admin-table-wrap .sc-filter-bar,
#sc-view-chats .sc-admin-table-wrap .sc-filter-bar{flex-wrap:nowrap}
#sc-kb-cat-list .sc-kb-cat-name{color:#c9c4c4 !important}
#sc-kb-cat-list .sc-kb-cat-name .active{color:#fff !important}
#sc-view-chats .sc-filter-bar .sc-export-btn{padding:12px 20px 12px 0}
#sc-chats-search-btn{padding:12px 17px}
#sc-bulk-action{width:116px}
#sc-bulk-apply-btn,
#sc-view-tickets .sc-filter-bar .sc-export-btn{padding-top:12px;padding-bottom:12px}
#sc-view-tickets .sc-filter-bar .sc-export-btn{padding-right:20px}

/* ── SC Icon System ──────────────────────────────────────────────────────────
   Inline SVG icons inherit currentColor so they match button/text colour.
   Canvas icon sizing lives next to each component above.
   ─────────────────────────────────────────────────────────────────────────── */
.sc-plugin-wrap svg[aria-hidden="true"] {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: none;
}

/* Agent panel stat badges */
.sc-stat-badge svg { margin-right: 4px; vertical-align: -2px; }

/* Language selector globe */
.sc-lang-icon svg { width: 15px; height: 15px; vertical-align: -2px; }

/* Helpful yes/no inline */
.sc-helpful-btn svg { width: 14px; height: 14px; margin-right: 3px; vertical-align: -1px; }

/* Welcome icon (pre-chat) */
.sc-welcome-icon { display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 50%;
    background: color-mix(in srgb, var(--sc-brand) 15%, transparent);
    margin: 0 auto 14px; }
.sc-welcome-icon svg { width: 28px; height: 28px; color: var(--sc-brand); }

/* CSAT face icons */
.sc-csat-emojis svg { width: 36px; height: 36px; cursor: pointer;
    transition: transform .15s; border-radius: 50%; }
.sc-csat-emojis svg:hover { transform: scale(1.2); }

/* Record indicator dot */
.sc-record-dot { display: inline-flex; align-items: center; gap: 5px; }
.sc-record-dot svg { width: 10px; height: 10px; color: #dc2626; animation: sc-pulse 1.4s ease-in-out infinite; }
@keyframes sc-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Ticket category icon chips */
.sc-chip svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -1px; }

/* Login lock icon */
.sc-lock-icon { display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: #f3f4f6; margin: 0 auto 16px; }
.sc-lock-icon svg { width: 28px; height: 28px; color: #6b7280; }

/* Ticket success check icon */
.sc-success-icon { display: flex; align-items: center; justify-content: center;
    width: 60px; height: 60px; border-radius: 50%;
    background: #dcfce7; margin: 0 auto 16px; }
.sc-success-icon svg { width: 32px; height: 32px; color: #16a34a; }


/* back arrow in the article viewer reuses the right-arrow glyph */
.sc-plugin-wrap .sc-back-btn svg { transform: rotate(180deg); width: 16px; height: 16px; }
