/* ═══════════════════════════════════════════════════════════
   SKYRISE CONCIERGE — help & chat widget (left-side drawer)
   Loaded after styles.css (see header.php). All selectors are
   scoped under #scRoot / .sc-*.
   ═══════════════════════════════════════════════════════════ */

#scRoot {
    position: fixed;
    top: 0;                       /* pinned to the visible viewport on phones */
    left: 0;
    right: 0;
    /*
     * Mobile-first sizing: a fixed overlay spanning the *layout* viewport
     * (inset: 0) lets the drawer's bottom rail end up hidden behind the
     * phone's collapsing URL bar or the on-screen keyboard. Height is set
     * to the dynamic viewport instead; help-panel.js additionally clamps
     * the canvas to window.visualViewport on <=640px screens (older WebViews).
     */
    height: 100vh;                /* fallback for browsers without dvh */
    height: 100dvh;               /* tracks collapsing mobile browser chrome */
    z-index: 2147483000;          /* above every in-page element */
    pointer-events: none;         /* only launcher/teaser/drawer opt in */
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC',
        'Noto Sans JP', sans-serif;
    line-height: 1.45;
}

/* Lock the page behind the open drawer (toggled by help-panel.js). */
html.sc-lock, html.sc-lock body { overflow: hidden; }

#scRoot *, #scRoot *::before, #scRoot *::after { box-sizing: border-box; }
#scRoot [hidden] { display: none !important; }

/* ── Shared atoms ─────────────────────────────────────────── */
.sc-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2fd188;
    box-shadow: 0 0 0 3px rgba(47, 209, 136, 0.25);
    flex: none;
}

.sc-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.18);
    box-shadow: 0 0 0 2px #ffffff;
    flex: none;
}
.sc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sc-avatar--md { width: 40px; height: 40px; }
.sc-avatar__status {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2fd188;
    border: 2px solid #ffffff;
}
.sc-avatar__status.is-away { background: #f4b942; }
.sc-avatar__status.is-off  { background: #f87171; }

/* ── Launcher pill ────────────────────────────────────────── */
.sc-launcher {
    position: absolute;
    left: 16px;                   /* bottom-left anchor */
    left: max(16px, env(safe-area-inset-left));
    bottom: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 44;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 58px;
    padding: 0 20px 0 7px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #00a0b6 0%, #007c91 55%, #005f6b 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 10px 26px rgba(0, 95, 107, 0.38), 0 2px 6px rgba(0, 60, 80, 0.2);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, opacity 0.25s ease;
}
.sc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 95, 107, 0.44); }
.sc-launcher:focus-visible { outline: 3px solid rgba(232, 155, 76, 0.65); outline-offset: 3px; }

.sc-launcher__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.15rem;
    transition: transform 0.3s var(--ease-out);
}
.sc-launcher__dot {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2fd188;
    border: 2px solid rgba(255, 255, 255, 0.9);
}
.sc-launcher__close { display: none; }

/* While the drawer is open it covers the launcher's corner, so fade the pill out. */
.sc.is-open .sc-launcher {
    opacity: 0;
    transform: translateY(6px) scale(0.95);
    pointer-events: none;
}

/* The proactive teaser only ever appears while the drawer is closed. */
.sc.is-open .sc-teaser {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Teaser bubble ────────────────────────────────────────── */
.sc-teaser {
    position: absolute;
    left: 16px;
    left: max(16px, env(safe-area-inset-left));
    bottom: 90px;                 /* above the launcher pill */
    z-index: 42;
    width: min(340px, calc(100vw - 32px));
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.16);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(0, 60, 100, 0.18), 0 0 0 1px rgba(0, 124, 145, 0.05);
    padding: 1rem 1.05rem 0.9rem;
    pointer-events: auto;
    animation: sc-pop 0.35s var(--ease-out) both;
}
@keyframes sc-pop {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.sc-teaser__close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
}
.sc-teaser__close:hover { background: rgba(0, 124, 145, 0.08); color: var(--text); }
.sc-teaser__head { display: flex; align-items: center; gap: 0.65rem; padding-right: 1.4rem; }
.sc-teaser__meta { display: flex; flex-direction: column; min-width: 0; }
.sc-teaser__meta strong { font-size: 0.92rem; color: var(--text); font-weight: 700; }
.sc-teaser__meta small {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.sc-teaser__msg {
    margin: 0.7rem 0 0.85rem;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.55;
}
.sc-teaser__cta {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #00a0b6, #007c91);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 124, 145, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sc-teaser__cta:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0, 124, 145, 0.36); }

/* ── Window shell ──────────────────────────────────────────── */
.sc-window {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    height: 100%;
    min-height: 0;
    background: #f4f8fb;
    border: none;
    border-radius: 0 22px 22px 0;
    overflow: hidden;
    z-index: 50;
    box-shadow: 22px 0 60px rgba(10, 40, 60, 0.24), 8px 0 24px rgba(10, 40, 60, 0.12);
    pointer-events: none;
    visibility: hidden;
    transform: translateX(-102%);
    transition: transform 0.32s var(--ease-out), visibility 0s linear 0.32s;
}
.sc.is-open .sc-window {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 0.32s var(--ease-out), visibility 0s;
}

/* ── Click-outside backdrop ───────────────────────────────── */
.sc-backdrop {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(10, 32, 48, 0.44);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}
.sc.is-open .sc-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.28s ease, visibility 0s;
}
.sc-window__head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: calc(0.7rem + env(safe-area-inset-top))
             max(0.9rem, env(safe-area-inset-right))
             calc(0.7rem + env(safe-area-inset-top))
             max(0.9rem, env(safe-area-inset-left));
    background: linear-gradient(135deg, #0096ad 0%, #007c91 60%, #00606e 100%);
    color: #ffffff;
}
.sc-window__titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sc-window__titles strong { font-size: 0.98rem; font-weight: 700; letter-spacing: 0.01em; }
.sc-window__status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}
.sc-window__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ef7b8;
    box-shadow: 0 0 0 3px rgba(110, 247, 184, 0.28);
}
.sc-window__status.is-away::before { background: #ffd479; }
.sc-window__status.is-human::before { background: #ffffff; }
.sc-window__acts { display: flex; gap: 2px; }
.sc-window__acts button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sc-window__acts button:hover { background: rgba(255, 255, 255, 0.3); }

.sc-window__body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* Views */
.sc-view { display: none; }
.sc-view.is-open {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ── Home view ─────────────────────────────────────────────── */
.sc-home { overflow-y: auto; padding: 1.15rem 1rem 0.7rem; gap: 0.35rem; }
.sc-home__intro { text-align: center; padding: 0.1rem 0.35rem 0.55rem; }
.sc-home__logo {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(0, 124, 145, 0.16);
    margin-bottom: 0.6rem;
}
.sc-home__logo img { width: 46px; height: 46px; }
.sc-home__title { font-size: 1.12rem; font-weight: 700; color: var(--text); margin: 0 0 0.35rem; }
.sc-home__text { font-size: 0.84rem; color: var(--text-secondary); margin: 0 0 0.7rem; }
.sc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #0b7c63;
    background: #e5f9f0;
    border: 1px solid #b8ecd9;
    padding: 0.28rem 0.8rem;
    border-radius: 999px;
}
.sc-home__opts { display: flex; flex-direction: column; gap: 0.55rem; }
.sc-opt {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.13);
    border-radius: 15px;
    padding: 0.72rem 0.9rem;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 60, 100, 0.05);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}
.sc-opt:hover {
    border-color: rgba(0, 124, 145, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 60, 100, 0.1);
}
.sc-opt__ic {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 1.1rem;
}
.sc-opt__ic--teal  { background: #e2f4f8; color: #007c91; }
.sc-opt__ic--sand  { background: #fdf0dd; color: #b8791f; }
.sc-opt__ic--wa    { background: #e1f6e8; color: #16a34a; }
.sc-opt__ic--coral { background: #fce9e2; color: #d2603a; }
.sc-opt__ic--navy  { background: #e8ecf5; color: #334e88; }
.sc-opt__txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sc-opt__txt b { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.sc-opt__txt small { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.sc-opt__chev { font-size: 0.8rem; color: #9fb2c0; transition: transform 0.2s ease; }
.sc-opt:hover .sc-opt__chev { transform: translateX(3px); color: var(--accent); }
.sc-home__safe {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0.85rem 0.2rem 0.1rem;
}

/* ── Chat view ─────────────────────────────────────────────── */
.sc-chatview { background: #f4f8fb; }
.sc-chatview__back {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem 0.25rem;
}
.sc-chatview__back button {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 8px;
}
.sc-chatview__back button:hover { color: var(--accent); }
.sc-chatview__clear {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    user-select: none;
}
.sc-chatview__clear:hover { color: var(--accent-coral); background: rgba(232, 122, 82, 0.08); }

/* Pre-chat (name) card */
.sc-prechat {
    flex: none;
    margin: 0.2rem 0.9rem 0.4rem;
    background: #ffffff;
    border: 1px dashed rgba(0, 124, 145, 0.35);
    border-radius: 14px;
    padding: 0.8rem 0.9rem 0.7rem;
}
.sc-prechat__title { margin: 0 0 0.55rem; font-size: 0.86rem; font-weight: 600; color: var(--text); }
.sc-prechat__row { display: flex; gap: 0.5rem; }
.sc-prechat__row input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(0, 110, 150, 0.22);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    font-family: inherit;
    font-size: 0.86rem;
    color: var(--text);
    background: #fbfdfe;
}
.sc-prechat__row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 124, 145, 0.12); }
.sc-prechat__email {
    width: 100%;
    margin-top: 0.5rem;
    border: 1px solid rgba(0, 110, 150, 0.22);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text);
    background: #fbfdfe;
}
.sc-prechat__email:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 124, 145, 0.12); }
.sc-btn {
    border: none;
    border-radius: 10px;
    padding: 0.5rem 0.95rem;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.sc-btn--primary { background: var(--accent); color: #fff; }
.sc-btn--primary:hover { filter: brightness(1.08); }
.sc-prechat__skip {
    display: block;
    margin: 0.45rem auto 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
}
.sc-prechat__skip:hover { color: var(--accent); }

/* Message thread */
.sc-thread-wrap { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem 0.9rem; }
.sc-thread { display: flex; flex-direction: column; }
.sc-msg { display: flex; gap: 0.5rem; margin: 0.35rem 0 0.5rem; align-items: flex-end; }
.sc-msg--user { justify-content: flex-end; }
.sc-msg__avatar {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(0, 110, 150, 0.2);
    background: #fff;
    position: relative;
}
.sc-msg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sc-msg--user .sc-msg__avatar { display: none; }
.sc-msg__bubble {
    max-width: 80%;
    padding: 0.5rem 0.78rem;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}
.sc-msg--ai .sc-msg__bubble {
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.14);
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 60, 100, 0.06);
}
.sc-msg--user .sc-msg__bubble {
    background: linear-gradient(135deg, #0096ad, #007c91);
    color: #ffffff;
    border-bottom-right-radius: 5px;
}
.sc-msg__meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.15rem 0.1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.sc-msg--user .sc-msg__meta { justify-content: flex-end; margin-right: 0.1rem; }
.sc-msg__ai-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #007c91;
    background: #e0f2f6;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}
.sc-msg__time { opacity: 0.85; }
.sc-msg__cta { margin-top: 0.55rem; display: flex; flex-direction: column; gap: 0.45rem; }
.sc-msg__cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 11px;
    padding: 0.55rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s ease;
}
.sc-msg__cta a:hover { filter: brightness(1.05); }
.sc-msg__cta--wa { background: #1faa52; color: #fff !important; }
.sc-msg__cta--mail { background: #ffffff; color: var(--text) !important; border: 1px solid rgba(0, 110, 150, 0.2); }

/* Per-message feedback bar (👍/👎 under AI replies) */
.sc-msg__fb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.45rem;
    margin: 0.45rem 0 0.2rem 0.1rem;
    padding: 0.3rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 110, 150, 0.14);
    border-radius: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 92%;
}
.sc-msg__fb-q { flex: none; }
.sc-msg__fb-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid rgba(0, 110, 150, 0.22);
    background: #fff;
    color: #6b8594;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.sc-msg__fb-btn:hover { color: #007c91; background: #eef7fa; }
.sc-msg__fb-btn:active { transform: translateY(1px); }
.sc-msg__fb-btn:disabled { opacity: 0.5; cursor: default; }
.sc-msg__fb-title {
    flex-basis: 100%;
    font-weight: 600;
    color: var(--text);
    font-size: 0.74rem;
}
.sc-msg__fb-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sc-msg__fb-chip {
    border: 1px solid rgba(0, 124, 145, 0.3);
    background: #fff;
    color: #00707f;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}
.sc-msg__fb-chip.is-sel { background: #007c91; border-color: #007c91; color: #fff; }
.sc-msg__fb-note {
    flex-basis: 100%;
    border: 1px solid rgba(0, 110, 150, 0.22);
    border-radius: 9px;
    padding: 0.4rem 0.55rem;
    font: inherit;
    font-size: 0.74rem;
    resize: vertical;
    min-height: 46px;
    color: var(--text);
    background: #fff;
}
.sc-msg__fb-note::placeholder { color: var(--text-muted); }
.sc-msg__fb-acts {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    margin-left: auto;
}
.sc-msg__fb-skip {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
}
.sc-msg__fb-send {
    border: 1px solid #007c91;
    background: linear-gradient(135deg, #0096ad, #007c91);
    color: #fff;
    border-radius: 9px;
    padding: 0.32rem 0.8rem;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}
.sc-msg__fb-send:disabled { opacity: 0.6; cursor: default; }
.sc-msg__fb.is-done {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}
.sc-msg__fb.is-done.is-up { color: #12833e; }
.sc-msg__fb.is-done.is-down { color: #b32727; }

/* Typing indicator */
.sc-typing { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0.9rem 0.6rem; }
.sc-typing__avatar {
    width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(0,110,150,0.2); background: #fff;
}
.sc-typing__dots {
    display: inline-flex; align-items: center; gap: 4px;
    background: #ffffff; border: 1px solid rgba(0, 110, 150, 0.14);
    border-radius: 14px; padding: 0.42rem 0.7rem; border-bottom-left-radius: 4px;
}
.sc-typing__dots i { width: 6px; height: 6px; border-radius: 50%; background: #8fb4c2; animation: sc-blink 1.2s infinite; }
.sc-typing__dots i:nth-child(2) { animation-delay: 0.2s; }
.sc-typing__dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Suggestion chips */
.sc-chips { flex: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.25rem 0.9rem 0.45rem; }
.sc-chip {
    border: 1px solid rgba(0, 124, 145, 0.35);
    background: #ffffff;
    color: #00707f;
    border-radius: 999px;
    padding: 0.34rem 0.85rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.sc-chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-chip.sc-chip--human { border-color: #1faa52; color: #12833e; }
.sc-chip.sc-chip--human:hover { background: #1faa52; border-color: #1faa52; color: #fff; }

/* Composer */
.sc-composer {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.7rem 0.55rem;
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.18);
    border-radius: 999px;
    padding: 0.3rem 0.3rem 0.3rem 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 60, 100, 0.07);
}
.sc-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 124, 145, 0.12); }
.sc-composer input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
}
.sc-composer input:focus { outline: none; }
.sc-composer__send {
    flex: none;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #00a0b6, #007c91);
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.sc-composer__send:hover { filter: brightness(1.1); }
.sc-composer__send:disabled { filter: grayscale(0.6); cursor: not-allowed; }

/* ── FAQ view ──────────────────────────────────────────────── */
.sc-faqview { padding: 0.85rem 0.9rem 0.6rem; }
.sc-faqview__bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.18);
    border-radius: 999px;
    padding: 0.15rem 0.15rem 0.15rem 0.9rem;
    margin-bottom: 0.7rem;
    color: var(--text-muted);
}
.sc-faqview__bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 124, 145, 0.12); }
.sc-faqview__bar input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.86rem;
    color: var(--text);
    padding: 0.5rem 0;
}
.sc-faqview__bar input:focus { outline: none; }
.sc-faqview__cats { overflow-y: auto; flex: 1; min-height: 0; }
.sc-faq-cat { margin-bottom: 0.85rem; }
.sc-faq-cat__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 0.4rem 0.15rem;
}
.sc-faq-item {
    background: #ffffff;
    border: 1px solid rgba(0, 110, 150, 0.14);
    border-radius: 12px;
    margin-bottom: 0.4rem;
    overflow: hidden;
}
.sc-faq-item__q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    text-align: left;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.68rem 0.85rem;
    cursor: pointer;
}
.sc-faq-item__q:hover { color: var(--accent); }
.sc-faq-item__q .sc-faq-item__ic { flex: none; font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s ease; }
.sc-faq-item.is-open .sc-faq-item__ic { transform: rotate(180deg); color: var(--accent); }
.sc-faq-item__a { display: none; padding: 0 0.85rem 0.7rem; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.6; }
.sc-faq-item.is-open .sc-faq-item__a { display: block; }
.sc-faqview__empty { text-align: center; color: var(--text-muted); font-size: 0.86rem; padding: 1rem 0.5rem; }
.sc-faqview__more {
    flex: none;
    font-size: 0.74rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0.7rem 0 0.2rem;
}

/* ── Channel rail ──────────────────────────────────────────── */
.sc-window__rail {
    flex: none;
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-top: 1px solid rgba(0, 110, 150, 0.14);
}
.sc-rail {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.sc-rail + .sc-rail { border-left: 1px solid rgba(0, 110, 150, 0.1); }
.sc-rail:hover { background: #f0f8fb; color: var(--text); }
.sc-rail--wa i { color: #1faa52; font-size: 1.05rem; }
.sc-rail i { font-size: 1rem; }

/* Back-to-top sits bottom-right; the launcher/drawer live on the left. */
.back-to-top { right: 1.5rem !important; bottom: 1.5rem !important; }

/* ── Small screens (drawer fills the phone) ───────────────── */
@media (max-width: 640px) {
    .sc-launcher {
        left: 14px;
        left: max(14px, env(safe-area-inset-left));
        bottom: 14px;
        bottom: max(14px, env(safe-area-inset-bottom));
        height: 56px;
        padding-right: 16px;
    }
    .sc-teaser {
        left: 12px;
        left: max(12px, env(safe-area-inset-left));
        bottom: 82px;
        width: min(340px, calc(100vw - 24px));
    }
    .sc-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .sc-window__acts button { width: 40px; height: 40px; }

    /* Mobile-first channel rail: icon above label so WhatsApp / Email / Call
       each keep enough width and are never squeezed or clipped. */
    .sc-window__rail { padding-bottom: env(safe-area-inset-bottom); }
    .sc-rail {
        flex-direction: column;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.55rem 0.35rem;
        font-size: 0.7rem;
        line-height: 1.2;
        text-align: center;
    }
    .sc-rail i { font-size: 1.1rem; line-height: 1; }
    .sc-rail span { max-width: 100%; overflow-wrap: anywhere; }

    /* Chat action bar: wrap the two actions rather than ever clip "New conversation". */
    .sc-chatview__back { flex-wrap: wrap; }

    /* 16px text fields prevent the iOS auto-zoom on focus. */
    .sc-composer input,
    .sc-prechat__row input,
    .sc-prechat__email,
    .sc-faqview__bar input,
    .sc-msg__fb-note { font-size: 1rem; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #scRoot *, #scRoot *::before, #scRoot *::after {
        animation: none !important;
        transition: none !important;
    }
}



