#support-root,
.support-admin {
    --support-blue: #2563eb;
    --support-ink: #182941;
    --support-muted: #5b6d85;
    --support-line: #dce5f1;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--support-ink);
}
#support-root[hidden],
#support-root [hidden],
.support-admin [hidden] { display: none !important; }
.support-launch {
    position: fixed;
    right: 24px;
    bottom: 88px;
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 12px 18px;
    color: #fff;
    background: var(--support-blue);
    border: 1px solid #1f58d4;
    border-radius: 28px;
    box-shadow: 0 8px 24px #1c55b930;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
.support-launch .icon { width: 21px; height: 21px; }
.support-launch:hover { background: #1d4ed8; }
.support-window {
    position: fixed;
    z-index: 55;
    right: 24px;
    bottom: 24px;
    width: min(390px, calc(100vw - 32px));
    height: min(650px, calc(100dvh - 110px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--support-line);
    border-radius: 20px;
    box-shadow: 0 18px 65px #17335430;
    overflow: hidden;
}
.support-window-head,
.support-conversation > header,
.support-conversations > header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--support-line);
    flex-shrink: 0;
}
.support-window-head { background: #eff6ff; }
.support-window-head strong { display: block; font-size: 16px; color: #172d4c; }
.support-window-head [data-support-status] { font-size: 12px; color: #526780; display: block; margin-top: 4px; }
.support-window-head [data-support-status]::before { content: ""; display: inline-block; width: 6px; height: 6px; background: #7b8da4; border-radius: 50%; margin-right: 5px; }
.support-window-head [data-support-status].is-online::before { background: #119365; }
.support-agent-icon { width: 40px; height: 40px; background: #fff; color: #2563eb; display: grid; place-items: center; border-radius: 12px; }
.support-agent-icon .icon { width: 24px; height: 24px; }
.support-icon-button { border: 1px solid var(--support-line); background: #fff; color: #52627b; border-radius: 10px; min-width: 40px; min-height: 40px; font-size: 23px; line-height: 1; }
.support-window-head > .support-icon-button { margin-left: auto; }
.support-icon-button:hover { background: #e8f1ff; color: #174fae; }
.support-welcome { margin: 0; padding: 12px 18px; background: #fff; color: var(--support-muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; max-height: 105px; overflow: auto; flex-shrink: 0; }
.support-messages { flex: 1; min-height: 100px; padding: 18px; overflow: auto; overscroll-behavior: contain; background: #f7f9fd; }
.support-message { margin-bottom: 16px; display: flex; flex-direction: column; align-items: flex-start; }
.support-message.is-own { align-items: flex-end; }
.support-message-meta { color: #60738c; font-size: 11px; line-height: 1.5; margin-bottom: 5px; }
.support-bubble { max-width: 88%; padding: 10px 13px; background: #fff; border: 1px solid #e0e8f3; border-radius: 12px 12px 12px 3px; font-size: 14px; line-height: 1.65; color: #243751; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-message.is-own .support-bubble { color: #fff; background: #2563eb; border-color: #2563eb; border-radius: 12px 12px 3px 12px; }
.support-thread-status { flex-shrink: 0; margin: 0; padding: 0 16px; font-size: 12px; line-height: 1.6; color: #5d6f88; background: #f7f9fd; }
.support-thread-status:not(:empty) { padding-block: 9px; }
.support-compose { margin: 0; padding: 14px 16px; border-top: 1px solid var(--support-line); background: #fff; flex-shrink: 0; }
.support-compose label { display: block; color: #40536e; font-size: 13px; margin-bottom: 7px; }
.support-compose .support-input-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.support-compose input,
.support-compose textarea,
.support-settings input:not([type="checkbox"]),
.support-settings textarea { box-sizing: border-box; width: 100%; border: 1px solid #cdd9e9; background: #fff; color: #172d47; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; outline: none; }
.support-compose textarea { min-height: 72px; max-height: 160px; resize: vertical; display: block; }
.support-compose input:focus,
.support-compose textarea:focus,
.support-settings input:focus,
.support-settings textarea:focus { border-color: #4c87ef; box-shadow: 0 0 0 3px #2563eb12; }
.support-compose .support-name input { margin-top: 4px; min-height: 40px; }
.support-form-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 9px; }
.support-form-bottom > span { color: var(--support-muted); font-size: 11px; }
.support-primary,
.support-secondary { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 40px; padding: 9px 16px; border-radius: 9px; border: 1px solid #2563eb; font-size: 14px; font-weight: 600; line-height: 1.4; color: #fff; background: #2563eb; }
.support-primary .icon { width: 16px; height: 16px; }
.support-secondary { border-color: var(--support-line); background: #fff; color: #385575; }
.support-primary:disabled,
.support-admin button:disabled { opacity: .5; cursor: wait; }
.support-error { color: #b02f40; font-size: 13px; line-height: 1.5; margin: 7px 0 0; overflow-wrap: anywhere; }
.support-error:empty { display: none; }
.support-empty { margin: 0; padding: 28px 12px; color: #5d708b; line-height: 1.8; text-align: center; font-size: 14px; }
.support-settings { border: 1px solid var(--support-line); border-radius: 14px; background: #fff; margin-bottom: 18px; overflow: hidden; }
.support-settings summary { cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #233c5d; }
.support-settings summary::after { content: "+"; margin-left: auto; font-size: 20px; }
.support-settings[open] summary::after { content: "−"; }
.support-settings form { padding: 0 20px 20px; max-width: 760px; }
.support-settings form > label { display: block; margin-top: 14px; font-size: 14px; }
.support-settings form > label input,
.support-settings form > label textarea { display: block; margin-top: 7px; }
.support-setting-switches { display: flex; gap: 24px; flex-wrap: wrap; }
.support-setting-switches label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.support-setting-switches input { width: 18px; height: 18px; accent-color: #2563eb; }
.support-settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.support-settings-actions > span { color: var(--support-muted); font-size: 13px; }
.support-settings-result { font-size: 13px; color: #3e5a78; margin: 10px 0 0; }
.support-inbox { display: grid; grid-template-columns: 290px minmax(0, 1fr); border: 1px solid var(--support-line); border-radius: 15px; overflow: hidden; background: #fff; min-height: 580px; height: min(740px, 80dvh); }
.support-conversations { display: flex; flex-direction: column; border-right: 1px solid var(--support-line); min-height: 0; }
.support-conversations > header { justify-content: space-between; min-height: 74px; }
.support-thread-list { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.support-thread { display: block; width: 100%; text-align: left; color: #243b57; border: 1px solid transparent; border-radius: 10px; padding: 13px 12px; margin: 0 0 6px; background: #fff; }
.support-thread:hover { background: #f4f7fc; }
.support-thread.is-selected { background: #edf4ff; border-color: #c3d9ff; }
.support-thread-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.support-thread-line strong { font-size: 14px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-thread-preview { display: block; font-size: 13px; color: #5b6f87; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin: 8px 0; }
.support-thread-meta { font-size: 11px; color: #667b94; }
.support-unread { min-width: 19px; height: 19px; display: inline-grid; place-items: center; background: #2563eb; border-radius: 10px; color: #fff; font-size: 10px; padding: 0 4px; }
.support-pagination { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 8px; border-top: 1px solid var(--support-line); font-size: 12px; }
.support-pagination button { min-height: 40px; padding: 8px; border-radius: 8px; color: #355a82; background: #f5f8fc; font-size: 12px; }
.support-conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.support-conversation > header { justify-content: space-between; min-height: 74px; }
.support-conversation [data-support-contact] { display: block; font-size: 15px; }
.support-conversation [data-support-contact-status] { display: block; color: #68809c; font-size: 12px; margin-top: 5px; }
.support-conversation > .support-admin-error:not(:empty) { padding: 8px 16px 12px; margin: 0; }
.support-admin button:focus-visible,
#support-root button:focus-visible { outline: 3px solid #8cb8ff; outline-offset: 2px; }
@media (max-width: 760px) {
    .support-inbox { grid-template-columns: 1fr; height: auto; }
    .support-conversations { border-right: 0; border-bottom: 1px solid var(--support-line); }
    .support-thread-list { max-height: 230px; }
    .support-conversation { min-height: 480px; height: 65dvh; }
    .support-settings-actions { align-items: flex-start; flex-direction: column; }
    .support-settings form { padding: 0 14px 16px; }
    .support-compose input, .support-compose textarea { font-size: 16px; }
}
@media (max-width: 480px) {
    .support-launch { right: 14px; bottom: 138px; min-height: 44px; padding: 11px 14px; }
    .support-window { right: 12px; bottom: 12px; width: calc(100vw - 24px); height: min(650px, calc(100dvh - 32px)); border-radius: 15px; }
    .support-messages { padding: 14px; }
    .support-window-head { padding: 12px 14px; }
    .support-welcome { padding: 10px 14px; }
    .support-compose { padding: 12px; }
}
/* Original floating service dock and lightweight conversation panel. */
#support-root .support-launch { width: 64px; min-height: 76px; padding: 9px 7px; flex-direction: column; gap: 5px; border-radius: 18px; background: #fff; border: 1px solid #dbe6f6; color: #314c70; box-shadow: 0 8px 28px #203e721c; font-size: 12px; }
#support-root .support-launch:hover { transform: translateY(-3px); border-color: #9dc1fa; }
.support-launch-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(140deg,#3487ff,#2455d6); box-shadow: 0 4px 10px #2868e32b; }
.support-launch-icon svg { width: 28px; height: 28px; }
.support-launch-badge { position: absolute; right: -5px; top: -5px; min-width: 21px; height: 21px; padding: 0 5px; border: 2px solid #fff; border-radius: 12px; background: #ef5267; color: #fff; font-size: 11px; display: grid; place-items: center; }
.support-launch-tip { position: absolute; right: calc(100% + 12px); top: 20px; width: max-content; max-width: 220px; padding: 10px 13px; border-radius: 10px; background: #233a58; color: #fff; font-size: 13px; font-weight: 400; opacity: 0; visibility: hidden; transform: translateX(4px); transition: .18s ease; pointer-events: none; }
.support-launch:hover .support-launch-tip, .support-launch:focus-visible .support-launch-tip { opacity: 1; visibility: visible; transform: none; }
#support-root .support-window { width: min(400px, calc(100vw - 32px)); border-radius: 22px; border-color: #dbe5f3; box-shadow: 0 24px 80px #15335930, 0 4px 16px #1533590c; transform-origin: bottom right; animation: support-reveal .22s ease-out; }
#support-root .support-window-head { padding: 22px 20px; border: 0; background: radial-gradient(circle at 100% 0,#4772a8 0,transparent 55%),linear-gradient(115deg,#183251,#264a73); }
#support-root .support-window-head strong { color: #fff; font-size: 18px; letter-spacing: .3px; }
#support-root .support-window-head [data-support-status] { color: #d8e6f8; font-size: 12px; margin-top: 6px; }
#support-root .support-window-head [data-support-status].is-online::before { background: #70e1b4; box-shadow: 0 0 0 3px #70e1b41a; }
#support-root .support-agent-icon { width: 48px; height: 48px; border: 1px solid #ffffff35; border-radius: 15px; background: #ffffff13; color: #fff; flex: none; }
.support-agent-icon svg { width: 31px; height: 31px; }
#support-root .support-window-head .support-icon-button { background: #ffffff12; color: #fff; border-color: #ffffff20; border-radius: 50%; min-width: 32px; min-height: 32px; font-size: 21px; }
#support-root .support-window-head .support-icon-button:hover { background: #ffffff2b; }
#support-root .support-welcome { padding: 14px 20px; border-bottom: 1px solid #e9eff7; color: #526a86; font-size: 13px; }
#support-root .support-messages { background: #f4f7fc; padding: 20px; }
#support-root .support-message-meta { font-size: 12px; color: #6a7d95; }
#support-root .support-bubble { box-shadow: 0 3px 8px #27405a04; border-radius: 14px 14px 14px 4px; }
#support-root .is-own .support-bubble { background: #2d6aeb; border-color: #2d6aeb; border-radius: 14px 14px 4px 14px; }
#support-root .support-compose { padding: 14px 18px 16px; }
#support-root .support-compose textarea { border-color: #dce5f1; background: #f9fbfe; border-radius: 12px; min-height: 78px; }
#support-root .support-form-bottom > span { font-size: 12px; }
#support-root .support-primary { border-radius: 11px; padding-inline: 20px; }
@keyframes support-reveal { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media(prefers-reduced-motion:reduce) { #support-root .support-window { animation: none; } #support-root .support-launch, .support-launch-tip { transition: none; } }
@media(max-width:480px) { #support-root .support-launch { width: 54px; min-height: 66px; padding: 7px; border-radius: 15px; } .support-launch-icon { width: 32px; height: 32px; } #support-root .support-window { width: calc(100vw - 24px); border-radius: 18px; } #support-root .support-window-head { padding: 16px; } }
@media(max-height:600px) { #support-root .support-window { top: 8px; bottom: 8px; height: calc(100dvh - 16px); overflow-y: auto; } #support-root .support-window-head { padding: 10px 16px; } #support-root .support-welcome { max-height: 64px; } #support-root .support-messages { min-height: 90px; } }
