/* Floating support chat: shares Madno's glass treatment, Vazirmatn and theme switch. */
.support-chat,
.support-chat * { box-sizing: border-box; }

.support-chat {
    --sc-surface: rgba(10, 18, 34, .97);
    --sc-surface-raised: rgba(18, 29, 50, .98);
    --sc-line: rgba(255, 255, 255, .10);
    --sc-ink: #f8fafc;
    --sc-muted: #aab7cc;
    --sc-accent: #50d5c1;
    --sc-accent-2: #5b8cff;
    --sc-bubble: rgba(255, 255, 255, .075);
    --sc-shadow: 0 26px 80px rgba(1, 7, 20, .46), 0 6px 22px rgba(1, 7, 20, .28);
    position: fixed;
    inset-inline-end: clamp(16px, 2.2vw, 30px);
    bottom: 24px;
    z-index: 1101;
    direction: rtl;
    color: var(--sc-ink);
    font-family: 'Vazirmatn', sans-serif;
    -webkit-font-smoothing: antialiased;
}

[data-theme="light"] .support-chat {
    --sc-surface: rgba(255, 255, 255, .98);
    --sc-surface-raised: #f5f8ff;
    --sc-line: rgba(30, 58, 138, .11);
    --sc-ink: #17233c;
    --sc-muted: #64748b;
    --sc-bubble: #f1f5fb;
    --sc-shadow: 0 26px 74px rgba(31, 51, 91, .24), 0 6px 20px rgba(31, 51, 91, .12);
}

.support-chat [hidden] { display: none !important; }

.support-chat__launcher {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(120deg, #0d9488 0%, #087fbd 52%, #4f6de6 100%);
    box-shadow: 0 15px 34px rgba(3, 105, 161, .34), inset 0 1px 0 rgba(255, 255, 255, .25);
    font: 800 .92rem/1 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
    -webkit-tap-highlight-color: transparent;
}

.support-chat__launcher:hover {
    transform: translateY(-3px);
    filter: saturate(1.12);
    box-shadow: 0 20px 42px rgba(3, 105, 161, .42), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.support-chat__launcher:focus-visible,
.support-chat button:focus-visible,
.support-chat textarea:focus-visible {
    outline: 3px solid rgba(80, 213, 193, .72);
    outline-offset: 3px;
}

.support-chat__launcher-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 1.12rem;
}

.support-chat__launcher-label { display: none; }
.support-chat__launcher-ping {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .17);
}

.support-chat__panel {
    position: absolute;
    inset-inline-end: 0;
    bottom: calc(100% + 15px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(410px, calc(100vw - 28px));
    height: min(660px, calc(100dvh - 145px));
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--sc-line);
    border-radius: 25px;
    color: var(--sc-ink);
    background: var(--sc-surface);
    box-shadow: var(--sc-shadow);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    transform-origin: bottom right;
    animation: support-chat-in .22s cubic-bezier(.2, .85, .25, 1) both;
}

@keyframes support-chat-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.support-chat__header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 82px;
    padding: 15px 17px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 12% 8%, rgba(255,255,255,.18), transparent 28%),
        linear-gradient(118deg, #087f78, #0a75a9 52%, #495fd1);
}

.support-chat__header::after {
    content: '';
    position: absolute;
    inset-inline-end: -30px;
    bottom: -58px;
    width: 160px;
    height: 110px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(255, 255, 255, .035), 0 0 0 37px rgba(255, 255, 255, .025);
    pointer-events: none;
}

.support-chat__brand-mark {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 17px;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 9px 20px rgba(0, 30, 70, .16);
    font-size: 1.22rem;
}

.support-chat__brand-spark {
    position: absolute;
    top: -7px;
    inset-inline-start: -5px;
    color: #fef08a;
    font-size: .9rem;
}

.support-chat__heading { position: relative; z-index: 1; min-width: 0; flex: 1; }
.support-chat__heading h2 { margin: 0; color: #fff; font-size: 1.02rem; font-weight: 850; letter-spacing: -.025em; }
.support-chat__heading p { display: flex; align-items: center; gap: 7px; margin: 4px 0 0; color: rgba(255,255,255,.86); font-size: .73rem; }
.support-chat__status-dot { width: 7px; height: 7px; border-radius: 50%; background: #facc15; box-shadow: 0 0 0 4px rgba(250,204,21,.16); }
.support-chat__close {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.12);
    font-size: 1.05rem;
    cursor: pointer;
}

.support-chat__conversation-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 0 17px;
    border-bottom: 1px solid var(--sc-line);
    color: var(--sc-muted);
    font-size: .68rem;
}
.support-chat__conversation-meta > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.support-chat__conversation-meta i { color: var(--sc-accent); }
.support-chat__code { direction: ltr; unicode-bidi: isolate; font: 700 .65rem/1 'Vazirmatn', sans-serif; }

.support-chat__body {
    position: relative;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 16px 16px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .45) transparent;
}

.support-chat__welcome { display: flex; flex-direction: column; align-items: center; padding: 12px 5px 20px; text-align: center; }
.support-chat__welcome-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 13px;
    place-items: center;
    border: 1px solid rgba(80, 213, 193, .25);
    border-radius: 22px;
    color: var(--sc-accent);
    background: linear-gradient(145deg, rgba(80,213,193,.17), rgba(91,140,255,.13));
    box-shadow: 0 12px 26px rgba(14, 116, 144, .12), inset 0 1px 0 rgba(255,255,255,.08);
    font-size: 1.55rem;
}
.support-chat__eyebrow { color: var(--sc-accent); font-size: .68rem; font-weight: 800; }
.support-chat__welcome h3 { margin: 6px 0 5px; color: var(--sc-ink); font-size: 1rem; font-weight: 850; }
.support-chat__welcome p { max-width: 275px; margin: 0; color: var(--sc-muted); font-size: .74rem; line-height: 1.9; }
.support-chat__prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 16px; }
.support-chat__prompts button {
    padding: 7px 11px;
    border: 1px solid var(--sc-line);
    border-radius: 999px;
    color: var(--sc-muted);
    background: var(--sc-bubble);
    font: 650 .68rem/1.5 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.support-chat__prompts button:hover { transform: translateY(-1px); border-color: rgba(80,213,193,.4); color: var(--sc-accent); }

.support-chat__messages { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.support-chat__message { display: flex; flex-direction: column; max-width: 87%; animation: support-message-in .18s ease both; }
@keyframes support-message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.support-chat__message--visitor { align-self: flex-start; align-items: flex-start; }
.support-chat__message--support { align-self: flex-end; align-items: flex-end; }
.support-chat__bubble { padding: 10px 13px; border: 1px solid var(--sc-line); border-radius: 16px 16px 5px 16px; color: var(--sc-ink); background: var(--sc-bubble); font-size: .78rem; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-chat__message--visitor .support-chat__bubble { color: #fff; border-color: rgba(80,213,193,.22); border-radius: 16px 16px 16px 5px; background: linear-gradient(130deg, #087f78, #087cac); box-shadow: 0 7px 18px rgba(8, 127, 120, .16); }
.support-chat__message-meta { display: flex; align-items: center; gap: 5px; margin: 5px 4px 0; color: var(--sc-muted); font-size: .61rem; }
.support-chat__delivery { display: inline-flex; align-items: center; gap: 4px; }

.support-chat__notice,
.support-chat__error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 13px;
    color: var(--sc-muted);
    background: rgba(245, 158, 11, .08);
    font-size: .69rem;
    line-height: 1.8;
}
.support-chat__notice i { margin-top: 3px; color: #fbbf24; }
.support-chat__error { border-color: rgba(239,68,68,.25); color: #fecaca; background: rgba(239,68,68,.09); }
[data-theme="light"] .support-chat__error { color: #991b1b; }

.support-chat__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 45px;
    align-items: end;
    gap: 9px;
    padding: 13px 14px 11px;
    border-top: 1px solid var(--sc-line);
    background: var(--sc-surface-raised);
}
.support-chat__composer textarea {
    width: 100%;
    min-height: 45px;
    max-height: 112px;
    resize: none;
    padding: 11px 13px;
    border: 1px solid var(--sc-line);
    border-radius: 15px;
    outline: none;
    color: var(--sc-ink);
    background: var(--sc-surface);
    font: 450 .76rem/1.8 'Vazirmatn', sans-serif;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.support-chat__composer textarea::placeholder { color: var(--sc-muted); opacity: .85; }
.support-chat__composer textarea:focus { border-color: rgba(80,213,193,.65); box-shadow: 0 0 0 3px rgba(80,213,193,.1); }
.support-chat__composer textarea:disabled { opacity: .62; cursor: not-allowed; }
.support-chat__send {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    border: 0;
    border-radius: 15px;
    color: #073b48;
    background: linear-gradient(145deg, #65e4cf, #55bff2);
    box-shadow: 0 7px 16px rgba(31, 174, 184, .22);
    font-size: .95rem;
    cursor: pointer;
    transition: transform .18s ease, opacity .18s ease;
}
.support-chat__send:hover:not(:disabled) { transform: translateY(-2px); }
.support-chat__send:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.support-chat__composer-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 2px; color: var(--sc-muted); font-size: .62rem; }
.support-chat__composer-foot span { display: inline-flex; align-items: center; gap: 5px; }
.support-chat__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.splash-active #madnoSupportChat,
body.mobile-sheet-open #madnoSupportChat { visibility: hidden !important; pointer-events: none !important; }

@media (max-width: 767.98px) {
    .support-chat {
        inset-inline-start: auto;
        inset-inline-end: 14px;
        bottom: calc(var(--bottom-nav-height, 72px) + env(safe-area-inset-bottom, 0px) + 12px);
        z-index: 1101;
    }
    .support-chat--dashboard {
        inset-inline-start: 14px;
        inset-inline-end: auto;
    }
    .support-chat__launcher {
        display: grid;
        width: 54px;
        height: 54px;
        min-height: 54px;
        padding: 0;
        place-items: center;
        border-radius: 50%;
    }
    .support-chat__launcher-label { display: none; }
    .support-chat__launcher-icon { width: 42px; height: 42px; }
    .support-chat__panel {
        position: fixed;
        inset-inline: 12px;
        bottom: calc(var(--bottom-nav-height, 72px) + env(safe-area-inset-bottom, 0px) + 82px);
        width: auto;
        height: min(620px, calc(100dvh - var(--app-bar-height, 64px) - var(--bottom-nav-height, 72px) - env(safe-area-inset-bottom, 0px) - 112px));
        min-height: min(430px, calc(100dvh - 190px));
        border-radius: 23px;
        transform-origin: bottom right;
    }
    .support-chat__header { min-height: 76px; padding: 12px 14px; }
    .support-chat__body { padding: 15px 13px; }
}

@media (max-width: 380px) {
    .support-chat { inset-inline-start: auto; inset-inline-end: 10px; }
    .support-chat--dashboard { inset-inline-start: 10px; inset-inline-end: auto; }
    .support-chat__panel { inset-inline: 8px; }
    .support-chat__prompts { gap: 5px; }
    .support-chat__prompts button { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .support-chat *, .support-chat *::before, .support-chat *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
