:root {
    --bg: #111317;
    --panel: #1b1d22;
    --panel-soft: #23262d;
    --panel-deep: #16181d;
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #1276d1;
    --primary-soft: #0f4e86;
    --text: #eef4ff;
    --muted: #99a4b8;
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(21, 118, 209, 0.18), transparent 24%),
        radial-gradient(circle at bottom right, rgba(16, 81, 140, 0.18), transparent 22%),
        linear-gradient(180deg, #17191e 0%, #101216 100%);
    color: var(--text);
}

button,
input,
textarea {
    font: inherit;
}

.lang-switcher,
.theme-switcher {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 12px;
    padding: 9px 12px;
    min-width: 116px;
    outline: none;
}

.hidden {
    display: none !important;
}

.push-notice-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 11, 18, 0.58);
    backdrop-filter: blur(10px);
}

.push-notice-card {
    width: min(520px, calc(100vw - 24px));
    max-height: min(80vh, 680px);
    overflow-y: auto;
    padding: 20px 20px 18px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(16, 18, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.36);
}

.push-notice-head {
    margin-bottom: 14px;
}

.push-notice-title {
    display: block;
    font-size: 20px;
    line-height: 1.25;
    color: #f4f8ff;
}

.push-notice-body {
    display: grid;
    gap: 10px;
    color: rgba(236, 242, 255, 0.88);
    font-size: 14px;
    line-height: 1.7;
}

.push-notice-body p {
    margin: 0;
}

.push-notice-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.push-notice-confirm {
    min-width: 128px;
}

.chat-ui-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    max-width: min(240px, calc(100vw - 24px));
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(14, 18, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    color: #eef4ff;
    font-size: 12px;
    line-height: 1.35;
    letter-spacing: 0.01em;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease;
    transform: translateY(4px);
}

.chat-ui-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

.chat-ui-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    transform: rotate(45deg);
    background: inherit;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-ui-tooltip[data-placement="top"] {
    transform: translateY(0);
}

.chat-ui-tooltip[data-placement="top"]::after {
    bottom: -5px;
}

.chat-ui-tooltip[data-placement="bottom"] {
    transform: translateY(0);
}

.chat-ui-tooltip[data-placement="bottom"]::after {
    top: -5px;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.client-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.client-window {
    width: min(1040px, 100%);
    min-height: min(880px, calc(100vh - 32px));
    height: min(880px, calc(100vh - 32px));
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--panel-border);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

.client-window.chat-mode {
    background: #f3f4f7;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.14);
}

.window-topbar,
.composer-tools,
.captcha-row,
.composer-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.window-topbar {
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.022);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 6;
    backdrop-filter: blur(16px);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.window-topbar-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.client-window.chat-mode .window-topbar {
    background: rgba(255, 255, 255, 0.97);
    border-bottom-color: rgba(15, 23, 42, 0.08);
    justify-content: space-between;
    padding: 8px 12px;
    backdrop-filter: blur(16px);
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-window:not(.chat-mode) .header-tools {
    gap: 4px;
    padding: 3px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

.client-window:not(.chat-mode) .lang-switcher,
.client-window:not(.chat-mode) .theme-switcher {
    min-width: 84px;
    height: 34px;
    padding: 0 10px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font-size: 12px;
}

.topbar-menu-toggle {
    display: none;
}

.topbar-reset-shortcut {
    display: none;
    flex: 0 0 auto;
    max-width: 108px;
    min-width: 0;
    padding: 0 12px;
}

.topbar-reset-label {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.client-window.chat-mode .window-brand,
.client-window.chat-mode .header-action-label {
    color: #526071;
}

.topbar-chat-contact,
.chat-only-control {
    display: none;
}

.mobile-menu-push-control {
    display: none !important;
}

.client-window.chat-mode .topbar-chat-contact {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding-right: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.client-window.chat-mode .chat-only-control {
    display: inline-flex;
}

.client-window.chat-mode .topbar-reset-shortcut {
    display: inline-flex;
}

.client-window.chat-mode .window-topbar-main {
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.client-window.chat-mode .topbar-presence {
    display: none;
}

.client-window.chat-mode .header-tools {
    flex: 0 0 auto;
    gap: 4px;
    padding: 3px;
    border-radius: 13px;
    background: rgba(245, 247, 250, 0.74);
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.76),
        0 1px 3px rgba(15, 23, 42, 0.03);
}

.client-window.chat-mode .lang-switcher,
.client-window.chat-mode .theme-switcher {
    min-width: 78px;
    height: 32px;
    padding: 0 10px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.04);
    color: #405063;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

.client-window.chat-mode .chat-session-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2631;
}

.client-window.chat-mode .contact-copy {
    min-height: 34px;
}

.client-window.chat-mode .chat-contact-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.client-window.chat-mode .lang-switcher:hover,
.client-window.chat-mode .theme-switcher:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(18, 118, 209, 0.12);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.client-window.chat-mode .lang-switcher:focus,
.client-window.chat-mode .theme-switcher:focus {
    border-color: rgba(18, 118, 209, 0.34);
    box-shadow: 0 0 0 3px rgba(18, 118, 209, 0.1);
}

body.ui-theme-dark {
    background:
        radial-gradient(circle at top left, rgba(42, 110, 176, 0.18), transparent 24%),
        radial-gradient(circle at bottom right, rgba(24, 56, 98, 0.18), transparent 22%),
        linear-gradient(180deg, #171b22 0%, #10141a 100%);
}

body.ui-theme-light {
    background:
        radial-gradient(circle at top left, rgba(76, 145, 219, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(126, 170, 227, 0.12), transparent 24%),
        linear-gradient(180deg, #f4f8ff 0%, #eaf1fb 100%);
    color: #1f2937;
}

body.ui-theme-light .client-window {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 58px rgba(31, 56, 88, 0.12);
}

body.ui-theme-light .window-topbar {
    background: rgba(255, 255, 255, 0.84);
    border-bottom-color: rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

body.ui-theme-light .client-window:not(.chat-mode) .header-tools {
    background: rgba(246, 249, 255, 0.94);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.76),
        0 8px 18px rgba(31, 56, 88, 0.08);
}

body.ui-theme-light .client-window:not(.chat-mode) .lang-switcher,
body.ui-theme-light .client-window:not(.chat-mode) .theme-switcher,
body.ui-theme-light .client-window:not(.chat-mode) .quiet-button {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(15, 23, 42, 0.08);
    color: #415166;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.ui-theme-light .client-window:not(.chat-mode) .lang-switcher:hover,
body.ui-theme-light .client-window:not(.chat-mode) .theme-switcher:hover,
body.ui-theme-light .client-window:not(.chat-mode) .quiet-button:hover {
    background: #ffffff;
    border-color: rgba(18, 118, 209, 0.18);
    box-shadow: 0 10px 18px rgba(31, 56, 88, 0.08);
}

body.ui-theme-light .entry-panel {
    background:
        radial-gradient(circle at 50% 100%, rgba(90, 149, 227, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(131, 183, 255, 0.18), transparent 28%),
        linear-gradient(180deg, #eef4ff 0%, #e6eefc 52%, #dee8fb 100%);
}

body.ui-theme-light .entry-cover h1,
body.ui-theme-light .entry-copy h2,
body.ui-theme-light .blocked-panel h2 {
    color: #1d2a3b;
}

body.ui-theme-light .entry-cover p:not(.eyebrow),
body.ui-theme-light .blocked-panel p,
body.ui-theme-light .entry-copy p,
body.ui-theme-light #conversationLabel,
body.ui-theme-light label span {
    color: #5f7085;
}

body.ui-theme-light .entry-card,
body.ui-theme-light .blocked-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 255, 0.92) 100%),
        rgba(255, 255, 255, 0.94);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 22px 46px rgba(31, 56, 88, 0.1);
}

body.ui-theme-light input[type="text"],
body.ui-theme-light input[type="email"],
body.ui-theme-light textarea {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.1);
    color: #203041;
}

body.ui-theme-light input[type="text"]:focus,
body.ui-theme-light input[type="email"]:focus,
body.ui-theme-light textarea:focus {
    background: #ffffff;
}

body.ui-theme-light .entry-form input[type="text"],
body.ui-theme-light .entry-form input[type="email"] {
    background: rgba(250, 252, 255, 0.98);
}

body.ui-theme-light .captcha-row img {
    background: #ffffff;
}

body.ui-theme-light .blocked-panel {
    background: linear-gradient(180deg, #edf3ff 0%, #e4edfb 100%);
}

body.ui-theme-dark .client-window.chat-mode {
    background: #1a1f27;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

body.ui-theme-dark .client-window.chat-mode .window-topbar {
    background: rgba(24, 28, 35, 0.98);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

body.ui-theme-dark .client-window.chat-mode .header-tools {
    background: rgba(255, 255, 255, 0.028);
    border-color: rgba(255, 255, 255, 0.055);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 1px 2px rgba(0, 0, 0, 0.12);
}

body.ui-theme-dark .client-window.chat-mode .lang-switcher,
body.ui-theme-dark .client-window.chat-mode .theme-switcher,
body.ui-theme-dark .client-window.chat-mode .quiet-button {
    background: #202631;
    border-color: rgba(255, 255, 255, 0.08);
    color: #d6e0ef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.ui-theme-dark .client-window.chat-mode .lang-switcher:hover,
body.ui-theme-dark .client-window.chat-mode .theme-switcher:hover,
body.ui-theme-dark .client-window.chat-mode .quiet-button:hover {
    background: #262d39;
    border-color: rgba(70, 162, 238, 0.24);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

body.ui-theme-dark .client-window.chat-mode .chat-session-title,
body.ui-theme-dark .client-window.chat-mode .chat-session-subtitle,
body.ui-theme-dark .client-window.chat-mode .header-action-label {
    color: #dbe5f4;
}

body.ui-theme-dark .chat-menu-button {
    background: #202631;
    border-color: rgba(255, 255, 255, 0.08);
    color: #d6e0ef;
}

body.ui-theme-dark .chat-menu-button:hover {
    background: #262d39;
    border-color: rgba(70, 162, 238, 0.24);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

body.ui-theme-dark .chat-panel {
    background: #171c23;
}

body.ui-theme-dark .messages {
    background:
        radial-gradient(circle at top, rgba(18, 118, 209, 0.09), transparent 24%),
        linear-gradient(180deg, #171c23 0%, #131820 100%);
}

body.ui-theme-dark .message-timeline {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.06);
    color: #9eadc0;
    box-shadow: none;
}

body.ui-theme-dark .message-bubble {
    background: linear-gradient(180deg, rgba(39, 45, 56, 0.98) 0%, rgba(31, 36, 45, 0.98) 100%);
    color: #edf3ff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

body.ui-theme-dark .message-item.from-support .message-bubble::before {
    background: #232831;
}

body.ui-theme-dark .message-item.from-self .message-bubble {
    background: linear-gradient(180deg, #1688de 0%, #0f79cf 100%);
    box-shadow: 0 3px 10px rgba(10, 89, 157, 0.24);
}

body.ui-theme-dark .message-item.from-self .message-bubble::before {
    background: #127fd5;
}

body.ui-theme-dark .message-author,
body.ui-theme-dark .message-time {
    color: rgba(220, 231, 245, 0.72);
}

body.ui-theme-dark .message-content img {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

body.ui-theme-dark .message-content audio {
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

body.ui-theme-dark .composer {
    background: linear-gradient(180deg, rgba(24, 28, 35, 0.94) 0%, rgba(20, 24, 31, 0.985) 82%);
    border-top-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.24);
}

body.ui-theme-dark .icon-file-button {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
    color: #c7d2e5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.ui-theme-dark .tool-icon {
    background: rgba(26, 129, 217, 0.18);
    color: #82c4ff;
}

body.ui-theme-dark #messageInput {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.03) 100%),
        rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    color: #edf3ff;
}

body.ui-theme-dark #messageInput:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(64, 156, 235, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 3px rgba(18, 118, 209, 0.14);
}

body.ui-theme-dark .composer-tip {
    color: #9cabbe;
}

body.ui-theme-dark .presence-notice {
    background: rgba(255, 184, 77, 0.1);
    color: #efc180;
    border-color: rgba(255, 184, 77, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.ui-theme-dark .send-button {
    box-shadow: 0 6px 14px rgba(9, 77, 135, 0.28);
}

.brand-dot,
.action-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.55);
}

.action-dot.offline {
    background: #8a93a4;
    box-shadow: 0 0 10px rgba(138, 147, 164, 0.25);
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--muted);
}

h1,
h2,
p {
    margin: 0;
}

.status-pill {
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(18, 118, 209, 0.18);
    color: #8fc9ff;
    font-size: 13px;
}

.entry-panel,
.blocked-panel,
.chat-panel {
    min-height: 0;
}

.entry-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px 26px;
    background:
        radial-gradient(circle at 50% 100%, rgba(133, 34, 39, 0.28), transparent 34%),
        radial-gradient(circle at top right, rgba(82, 58, 150, 0.28), transparent 28%),
        linear-gradient(180deg, #2e1536 0%, #2a1333 52%, #281231 100%);
}

.entry-stage {
    width: min(392px, 100%);
    display: grid;
    gap: 16px;
}

.entry-cover,
.entry-card,
.blocked-card {
    padding: 40px;
}

.entry-cover {
    padding: 0;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 10px;
    background: transparent;
}

.entry-cover h1 {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 600;
}

.entry-cover p:not(.eyebrow) {
    max-width: 300px;
    color: #aab4c8;
    font-size: 13px;
    line-height: 1.6;
}

.entry-card,
.blocked-card {
    padding: 18px 18px 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(255, 255, 255, 0.028);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 20px 44px rgba(0, 0, 0, 0.18);
}

.entry-copy h2,
.blocked-panel h2 {
    margin-bottom: 10px;
    line-height: 1.35;
}

.entry-copy p,
.blocked-panel p,
#conversationLabel {
    color: var(--muted);
    line-height: 1.7;
}

.blocked-card {
    max-width: min(460px, 100%);
    text-align: center;
    justify-items: center;
    gap: 8px;
}

.blocked-panel h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f4f8ff;
}

.blocked-panel p {
    max-width: 320px;
    margin: 0;
    font-size: 13px;
    color: #aab4c8;
}

.entry-copy {
    text-align: center;
    display: grid;
    gap: 4px;
}

.entry-copy h2 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}

.entry-form,
.composer {
    display: grid;
    gap: 16px;
}

label span {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--muted);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: rgba(18, 118, 209, 0.42);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(18, 118, 209, 0.1);
}

.entry-form input[type="text"],
.entry-form input[type="email"] {
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.07);
}

.captcha-row img {
    height: 44px;
    width: 96px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
}

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 86px;
    align-items: stretch;
    gap: 8px;
}

.captcha-row input[type="text"] {
    min-width: 0;
    height: 44px;
}

.captcha-row img,
.captcha-row .ghost-button {
    height: 44px;
}

.captcha-row .ghost-button {
    min-width: 86px;
    padding: 0 10px;
    white-space: nowrap;
    border-radius: 12px;
    font-size: 12px;
}

.primary-button,
.ghost-button,
.file-button {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary) 0%, #2890ef 100%);
    color: #fff;
    box-shadow: 0 14px 24px rgba(18, 118, 209, 0.28);
}

.ghost-button,
.file-button {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid var(--line);
}

.primary-button:hover,
.ghost-button:hover,
.file-button:hover {
    transform: translateY(-1px);
}

.primary-button:hover {
    box-shadow: 0 16px 26px rgba(18, 118, 209, 0.24);
}

.ghost-button:hover,
.file-button:hover,
.quiet-button:hover {
    border-color: rgba(18, 118, 209, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.file-button:focus-visible,
.lang-switcher:focus-visible,
.theme-switcher:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(18, 118, 209, 0.14);
}

.entry-form .primary-button {
    width: 100%;
    margin-top: 4px;
    padding: 13px 16px;
    border-radius: 13px;
    font-size: 18px;
    font-weight: 600;
}

.file-button {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.quiet-button {
    padding: 10px 14px;
    border-radius: 12px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: #f3f4f7;
    overflow: hidden;
}

.chat-contact,
.chat-header-actions,
.header-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-contact {
    min-width: 0;
}

.chat-contact-primary {
    gap: 10px;
}

.chat-session-title {
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: #1f2631;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-contact-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.chat-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f4f6f8;
    border-color: rgba(15, 23, 42, 0.08);
    color: #526071;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.chat-menu-icon {
    width: 14px;
    height: 10px;
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.chat-menu-icon::before,
.chat-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1.8px;
    border-radius: 999px;
    background: currentColor;
}

.chat-menu-icon::before {
    top: 1px;
    box-shadow: 0 4px 0 currentColor;
}

.chat-menu-icon::after {
    bottom: 1px;
}

.chat-menu-label {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 500;
}

.presence-badge {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 1px 2px rgba(15, 23, 42, 0.02);
}

.client-window.chat-mode .presence-badge {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.18);
    box-shadow: none;
}

.presence-badge.offline {
    background: rgba(138, 147, 164, 0.1);
    border-color: rgba(138, 147, 164, 0.18);
}

.client-window.chat-mode .presence-badge.offline {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.18);
}

.topbar-presence {
    flex-shrink: 0;
}

.presence-notice {
    margin: 8px 22px 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 184, 77, 0.1);
    border: 1px solid rgba(255, 184, 77, 0.18);
    color: #936019;
    font-size: 11px;
    line-height: 1.3;
    min-height: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.push-banner {
    margin: 10px 22px 0;
    padding: 14px 14px 13px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background:
        linear-gradient(135deg, rgba(18, 118, 209, 0.14) 0%, rgba(53, 164, 255, 0.08) 100%),
        rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(18, 118, 209, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 14px 30px rgba(18, 118, 209, 0.12);
}

.push-banner.needs-attention {
    animation: pushBannerPulse 1.9s ease-in-out infinite;
}

.push-banner-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.push-banner-copy strong {
    color: #12324f;
    font-size: 15px;
    line-height: 1.2;
}

.push-banner-copy p {
    margin: 0;
    color: #516377;
    font-size: 12px;
    line-height: 1.55;
}

.push-banner-guide-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: #1276d1;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.push-banner-guide-link:hover,
.push-banner-guide-link:focus-visible {
    color: #0f66b4;
    text-decoration: underline;
}

.push-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.push-banner-dismiss {
    white-space: nowrap;
}

.push-banner-button {
    min-width: 118px;
    box-shadow: 0 10px 20px rgba(18, 118, 209, 0.18);
}

.push-banner-status {
    color: #1276d1;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.quiet-button {
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

.client-window.chat-mode .quiet-button {
    background: #f4f6f8;
    color: #526071;
    border-color: rgba(15, 23, 42, 0.08);
}

.quiet-button:hover {
    background: rgba(255, 255, 255, 0.9);
}

.attention-button {
    border-color: rgba(18, 118, 209, 0.22) !important;
    background: rgba(18, 118, 209, 0.08) !important;
    color: #1276d1 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 10px 20px rgba(18, 118, 209, 0.12) !important;
}

.attention-button:hover {
    background: rgba(18, 118, 209, 0.12) !important;
}

.presence-notice::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #ffb84d;
    box-shadow: 0 0 8px rgba(255, 184, 77, 0.22);
    flex: 0 0 auto;
}

@keyframes pushBannerPulse {
    0%,
    100% {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.78),
            0 14px 30px rgba(18, 118, 209, 0.12);
    }
    50% {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.84),
            0 18px 34px rgba(18, 118, 209, 0.18);
    }
}

.chat-tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.chat-tool {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-tool::before,
.chat-tool::after {
    content: "";
    position: absolute;
}

.tool-line::before {
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.tool-square::before {
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.72);
    border-radius: 3px;
}

.tool-menu::before,
.tool-menu::after {
    width: 12px;
    height: 2px;
    left: 50%;
    margin-left: -6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.tool-menu::before {
    top: 9px;
}

.tool-menu::after {
    top: 17px;
}

.contact-avatar,
.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    flex: 0 0 auto;
}

.client-window.chat-mode .contact-avatar,
.client-window.chat-mode .message-avatar {
    border: 2px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.message-avatar {
    width: 26px;
    height: 26px;
    font-size: 10px;
    background: linear-gradient(135deg, #5d6d7f 0%, #425062 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.message-item.from-self .message-avatar,
.contact-avatar {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
}

.contact-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 34px;
}

.contact-copy strong,
.contact-copy span {
    display: block;
}

.contact-copy strong {
    font-size: 17px;
    margin-bottom: 0;
    line-height: 1.15;
}

.contact-copy span,
.header-action-label {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.presence-badge .header-action-label {
    color: #b9f4d1;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.presence-badge.offline .header-action-label {
    color: #c5cad4;
}

.messages {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(135, 149, 171, 0.36) transparent;
    padding: 18px 18px 16px;
    display: grid;
    gap: 8px;
    background:
        radial-gradient(circle at top, rgba(18, 118, 209, 0.05), transparent 24%),
        linear-gradient(180deg, #eff1f4 0%, #ebedf1 100%);
}

.messages::-webkit-scrollbar {
    width: 9px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(135, 149, 171, 0.32);
    background-clip: padding-box;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 182, 203, 0.42);
    background-clip: padding-box;
}

.message-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1px;
}

.message-timeline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: center;
    width: auto;
    max-width: max-content;
    min-height: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.05);
    color: #8693a6;
    font-size: 10px;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    white-space: nowrap;
}

.message-item.from-self {
    align-items: flex-end;
    padding-left: 58px;
}

.message-item.from-support {
    align-items: flex-start;
    padding-right: 58px;
}

.message-item.from-self .message-row {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.message-row {
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.message-bubble {
    width: fit-content;
    max-width: min(60%, 496px);
    padding: 9px 12px 9px;
    border-radius: 16px 16px 16px 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 248, 250, 0.98) 100%);
    border: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    color: #2b313b;
    position: relative;
}

.message-item.from-self .message-bubble {
    border-radius: 16px 16px 6px 16px;
    background: linear-gradient(180deg, #17a2fb 0%, #1096ef 100%);
    color: #fff;
    box-shadow: 0 7px 16px rgba(17, 123, 204, 0.16);
}

.message-item.type-text .message-bubble {
    width: min(60%, 496px);
}

.message-item.from-support .message-bubble::before,
.message-item.from-self .message-bubble::before {
    content: "";
    position: absolute;
    top: 12px;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    border-radius: 2px;
}

.message-item.from-support .message-bubble::before {
    left: -4px;
    background: #f5f7fa;
}

.message-item.from-self .message-bubble::before {
    right: -4px;
    background: #1198f1;
}

.message-author {
    font-size: 10px;
    opacity: 0.58;
    line-height: 1.2;
    color: #6e7b8d;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.message-item.from-self .message-meta {
    justify-content: flex-end;
}

.message-item.from-self .message-author,
.message-item.from-self .message-time {
    opacity: 0.72;
}

.message-content {
    font-size: 14px;
    line-height: 1.42;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.message-content img {
    display: block;
    margin-top: 7px;
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.message-content audio {
    display: block;
    width: min(100%, 320px);
    margin-top: 7px;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(248, 250, 252, 0.9);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
}

.message-time {
    font-size: 9px;
    opacity: 0.42;
    line-height: 1.2;
    white-space: nowrap;
    color: #7c899a;
}

.composer {
    flex: 0 0 auto;
    padding: 7px 10px 10px;
    background:
        linear-gradient(180deg, rgba(252, 253, 255, 0.92) 0%, rgba(255, 255, 255, 0.99) 84%);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    gap: 7px;
    z-index: 3;
    position: relative;
    backdrop-filter: blur(16px);
    box-shadow: 0 -10px 22px rgba(15, 23, 42, 0.06);
    border-radius: 18px 18px 0 0;
}

.composer-toolbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 4px;
}

.icon-file-button {
    gap: 7px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 12px;
    background: rgba(244, 247, 250, 0.98);
    border-color: rgba(15, 23, 42, 0.06);
    color: #4e5969;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 1px 2px rgba(15, 23, 42, 0.02);
}

.icon-file-button:hover {
    background: #eef3f7;
}

.tool-icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    background: rgba(18, 118, 209, 0.12);
    color: #278ae4;
    position: relative;
    flex: 0 0 auto;
}

.tool-icon::before,
.tool-icon::after {
    content: "";
    position: absolute;
}

.tool-icon-image::before {
    width: 10px;
    height: 8px;
    border: 1.6px solid currentColor;
    border-radius: 2px;
    top: 5px;
    left: 5px;
}

.tool-icon-image::after {
    width: 5px;
    height: 5px;
    border-left: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    left: 8px;
    top: 8px;
}

.tool-icon-audio::before {
    width: 3px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    left: 8px;
    top: 4px;
}

.tool-icon-audio::after {
    width: 8px;
    height: 8px;
    border: 1.6px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
    left: 8px;
    top: 6px;
}

#messageInput {
    resize: none;
    min-height: 64px;
    max-height: 152px;
    border-radius: 15px;
    padding: 11px 13px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 253, 0.99) 100%);
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.76),
        0 1px 3px rgba(15, 23, 42, 0.025);
    line-height: 1.5;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    color: #2d3440;
}

#messageInput:focus {
    outline: none;
    border-color: rgba(18, 118, 209, 0.34);
    background: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 0 0 3px rgba(18, 118, 209, 0.1);
}

.composer-tools {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 2px 0;
}

.composer-tip {
    color: #798291;
    font-size: 11px;
    line-height: 1.35;
    flex: 1 1 auto;
    max-width: 70%;
}

.send-button {
    min-width: 104px;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 11px;
    font-weight: 600;
    box-shadow: 0 7px 16px rgba(18, 118, 209, 0.16);
}

.send-button:hover {
    box-shadow: 0 11px 22px rgba(18, 118, 209, 0.22);
}

.blocked-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #17191f 0%, #1d2128 100%);
}

.blocked-card {
    width: min(520px, 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

@media (max-width: 768px) {
    .client-shell {
        min-height: 100dvh;
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }

    .client-window {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .entry-panel {
        padding: 14px 12px 12px;
    }

    .window-topbar,
    .header-tools,
    .composer-tools {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }

    .window-topbar-main {
        gap: 8px;
        min-width: 0;
    }

    .captcha-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .captcha-row input[type="text"] {
        grid-column: 1 / -1;
        min-width: 0;
        width: 100%;
    }

    .captcha-row img,
    .captcha-row .ghost-button {
        width: 100%;
        min-width: 0;
    }

    .chat-tool-group {
        justify-content: flex-start;
        padding: 0;
    }

    .window-topbar {
        padding: 8px 10px;
        flex-wrap: nowrap;
    }

    .header-tools {
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 4px;
        flex: 0 0 auto;
    }

    .topbar-menu-toggle {
        display: inline-flex;
        min-width: 34px;
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        border-radius: 999px;
        flex: 0 0 auto;
    }

    .lang-switcher,
    .theme-switcher {
        min-width: 72px;
        padding: 7px 8px;
        font-size: 12px;
    }

    .status-pill,
    .presence-badge {
        padding: 5px 8px;
        font-size: 12px;
    }

    .topbar-presence {
        min-width: 0;
        max-width: calc(100vw - 180px);
    }

    .header-action-group {
        gap: 7px;
    }

    .header-action-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .client-window:not(.chat-mode) .header-tools {
        position: absolute;
        left: 10px;
        right: 10px;
        top: calc(100% + 8px);
        z-index: 40;
        display: none;
        width: auto;
        min-width: 0;
        padding: 8px;
        border-radius: 18px;
        background:
            linear-gradient(180deg, rgba(31, 36, 46, 0.98) 0%, rgba(23, 26, 34, 0.985) 100%);
        border: 1px solid rgba(255, 255, 255, 0.07);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 18px 36px rgba(0, 0, 0, 0.3);
        flex-direction: column;
        align-items: stretch;
    }

    .client-window.topbar-menu-open:not(.chat-mode) .header-tools {
        display: flex;
    }

    .client-window:not(.chat-mode) .topbar-menu-toggle {
        order: 3;
    }

    .client-window:not(.chat-mode) .header-tools .lang-switcher,
    .client-window:not(.chat-mode) .header-tools .theme-switcher {
        width: 100%;
        min-width: 0;
        height: 42px;
        padding: 0 42px 0 14px;
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        font-size: 15px;
        line-height: 1.2;
    }

    .client-window:not(.chat-mode) .header-tools .chat-only-control {
        display: none !important;
    }

    .client-window:not(.chat-mode) .topbar-chat-contact {
        display: none !important;
    }

    .client-window:not(.chat-mode) .window-topbar-main {
        min-width: 0;
        flex: 1 1 auto;
    }

    .client-window:not(.chat-mode) .topbar-presence {
        max-width: calc(100vw - 78px);
    }

    body.ui-theme-light .client-window:not(.chat-mode) .header-tools {
        background: rgba(246, 249, 255, 0.98);
        border-color: rgba(15, 23, 42, 0.08);
    }

    body.ui-theme-light .client-window:not(.chat-mode) .window-topbar {
        background: rgba(255, 255, 255, 0.94);
        border-bottom-color: rgba(15, 23, 42, 0.08);
    }

    .client-window.chat-mode .topbar-menu-toggle {
        display: inline-flex;
        order: 3;
    }

    .client-window.chat-mode .topbar-reset-shortcut {
        order: 2;
        max-width: 96px;
        min-height: 34px;
        padding: 0 10px;
        gap: 0;
    }

    .client-window.chat-mode .header-tools {
        position: absolute;
        right: 10px;
        top: calc(100% + 8px);
        z-index: 40;
        display: none;
        width: min(232px, calc(100vw - 20px));
        min-width: 0;
        padding: 6px;
        border-radius: 16px;
        background: rgba(245, 247, 250, 0.96);
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.78),
            0 18px 36px rgba(15, 23, 42, 0.14);
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .client-window.topbar-menu-open.chat-mode .header-tools {
        display: flex;
    }

    .client-window.chat-mode .header-tools .lang-switcher,
    .client-window.chat-mode .header-tools .theme-switcher,
    .client-window.chat-mode .header-tools .chat-only-control {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 0 12px;
        border-radius: 11px;
        font-size: 14px;
        align-items: center;
        justify-content: flex-start;
    }

    .client-window.chat-mode .header-tools .mobile-menu-push-control {
        display: inline-flex !important;
        justify-content: space-between;
        gap: 12px;
    }

    .client-window.chat-mode .header-tools .mobile-menu-push-label,
    .client-window.chat-mode .header-tools .mobile-menu-push-state {
        display: inline-flex;
        align-items: center;
        line-height: 1;
    }

    .client-window.chat-mode .header-tools .mobile-menu-push-label {
        min-width: 0;
        flex: 1 1 auto;
    }

    .client-window.chat-mode .header-tools .mobile-menu-push-state {
        flex: 0 0 auto;
        padding: 0 8px;
        min-height: 24px;
        border-radius: 999px;
        font-size: 12px;
        color: #5c6b7c;
        background: rgba(15, 23, 42, 0.06);
        border: 1px solid rgba(15, 23, 42, 0.06);
        font-weight: 600;
        transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    }

    .client-window.chat-mode .header-tools .mobile-menu-push-state.is-on {
        color: #1276d1;
        background: rgba(18, 118, 209, 0.14);
        border-color: rgba(18, 118, 209, 0.16);
    }

    .client-window.chat-mode .header-tools .mobile-menu-push-state.is-off {
        color: #5c6b7c;
        background: rgba(15, 23, 42, 0.06);
        border-color: rgba(15, 23, 42, 0.06);
    }

    .client-window.chat-mode .header-tools .lang-switcher,
    .client-window.chat-mode .header-tools .theme-switcher {
        padding-right: 38px;
    }

    body.ui-theme-dark .client-window.chat-mode .header-tools {
        background: rgba(22, 26, 33, 0.96);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 18px 36px rgba(0, 0, 0, 0.34);
    }

    body.ui-theme-dark .client-window.chat-mode .header-tools .lang-switcher,
    body.ui-theme-dark .client-window.chat-mode .header-tools .theme-switcher,
    body.ui-theme-dark .client-window.chat-mode .header-tools .chat-only-control {
        background: #202631;
        border-color: rgba(255, 255, 255, 0.08);
        color: #d6e0ef;
    }

    body.ui-theme-dark .client-window.chat-mode .header-tools .mobile-menu-push-state {
        color: #d6e0ef;
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.08);
    }

    body.ui-theme-dark .client-window.chat-mode .header-tools .mobile-menu-push-state.is-on {
        color: #8fceff;
        background: rgba(18, 118, 209, 0.22);
        border-color: rgba(84, 180, 255, 0.18);
    }

    body.ui-theme-dark .client-window.chat-mode .header-tools .mobile-menu-push-state.is-off {
        color: #d6e0ef;
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .entry-cover,
    .entry-card,
    .blocked-card {
        padding: 15px 13px;
    }

    .entry-stage {
        width: min(360px, 100%);
        gap: 12px;
    }

    .entry-cover {
        gap: 10px;
    }

    .entry-copy h2 {
        font-size: 15px;
    }

    .messages {
        padding: 10px 8px 12px;
        gap: 6px;
    }

    .presence-notice {
        margin: 6px 12px 0;
        padding: 6px 9px;
        font-size: 12px;
        line-height: 1.3;
    }

    .push-banner {
        margin: 8px 12px 0;
        padding: 12px 12px 11px;
        border-radius: 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .push-banner-copy strong {
        font-size: 14px;
    }

    .push-banner-copy p {
        font-size: 12px;
        line-height: 1.5;
    }

    .push-banner-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .push-banner-button {
        min-width: 108px;
        flex: 0 0 auto;
    }

    .push-banner-status {
        font-size: 11px;
        text-align: right;
    }

    .blocked-card {
        border-radius: 16px;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 16px 30px rgba(0, 0, 0, 0.2);
    }

    .blocked-panel p {
        max-width: 280px;
    }

    .chat-session-title {
        font-size: 14px;
    }

    .contact-avatar {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .chat-contact-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .contact-copy strong {
        font-size: 15px;
        margin-bottom: 0;
    }

    .chat-tool-group {
        display: none;
    }

    .quiet-button {
        padding: 7px 10px;
        border-radius: 9px;
        font-size: 12px;
    }

    .client-window.chat-mode .window-topbar {
        padding: 7px 9px;
    }

    .client-window.chat-mode .window-topbar-main {
        min-width: 0;
        flex: 1 1 auto;
        gap: 6px;
    }

    .client-window.chat-mode .topbar-chat-contact {
        gap: 7px;
        padding-right: 4px;
    }

    .client-window.chat-mode .header-tools {
        gap: 6px;
        padding: 6px;
        border-radius: 16px;
    }

    .client-window.chat-mode .lang-switcher,
    .client-window.chat-mode .theme-switcher {
        min-width: 0;
        height: 38px;
        padding: 0 38px 0 12px;
        border-radius: 11px;
        font-size: 14px;
    }

    .client-window.chat-mode .chat-only-control {
        min-width: 31px;
        height: 31px;
        padding: 0 9px;
    }

    .client-window.chat-mode .chat-contact-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    }

    .client-window.chat-mode .chat-session-title {
        font-size: 13px;
    }

    .contact-copy span,
    .header-action-label {
        font-size: 11px;
    }

    .message-bubble {
        max-width: min(78%, 300px);
        padding: 7px 9px;
    }

    .message-item.type-text .message-bubble {
        width: min(78%, 300px);
    }

    .message-timeline {
        font-size: 10px;
        padding: 2px 7px;
    }

    .message-content {
        font-size: 13px;
        line-height: 1.48;
    }

    .message-time {
        font-size: 8px;
    }

    .message-meta {
        gap: 6px;
        margin-bottom: 1px;
    }

    .message-author {
        font-size: 9px;
    }

    .message-item.from-self {
        padding-left: 24px;
    }

    .message-item.from-support {
        padding-right: 24px;
    }

    .message-row {
        gap: 6px;
    }

    .message-avatar {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    .message-item.from-support .message-bubble::before,
    .message-item.from-self .message-bubble::before {
        top: 10px;
        width: 7px;
        height: 7px;
    }

    .composer {
        padding: 4px 7px 7px;
        gap: 4px;
        border-radius: 16px 16px 0 0;
    }

    .composer-toolbar {
        gap: 6px;
        padding: 0 1px;
        justify-content: flex-start;
    }

    .icon-file-button {
        gap: 0;
        width: 34px;
        height: 34px;
        padding: 0;
        border-radius: 999px;
        font-size: 0;
        justify-content: center;
        background: rgba(243, 246, 249, 0.98);
        border-color: rgba(15, 23, 42, 0.04);
    }

    .tool-icon {
        width: 24px;
        height: 24px;
        border-radius: 999px;
    }

    .tool-icon-image::before {
        width: 12px;
        height: 9px;
        top: 7px;
        left: 7px;
    }

    .tool-icon-image::after {
        width: 6px;
        height: 6px;
        left: 10px;
        top: 11px;
    }

    .tool-icon-audio::before {
        left: 11px;
        top: 6px;
        height: 10px;
    }

    .tool-icon-audio::after {
        width: 9px;
        height: 9px;
        left: 10px;
        top: 8px;
    }

    .icon-file-button span[data-i18n] {
        display: none;
    }

    .chat-menu-label {
        display: none;
    }

    .chat-menu-button {
        min-width: 34px;
        width: auto;
        height: 34px;
        padding: 0 10px;
        justify-content: center;
        border-radius: 999px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    }

    #messageInput {
        min-height: 40px;
        max-height: 108px;
        padding: 8px 10px;
        border-radius: 12px;
    }

    .composer-tip {
        display: none;
    }

    .send-button {
        min-width: 80px;
        min-height: 36px;
        padding: 7px 12px;
        border-radius: 11px;
        box-shadow: none;
    }

    .entry-cover p:not(.eyebrow) {
        max-width: none;
    }
}

@media (max-width: 768px) {
    body.ui-theme-dark .client-window.chat-mode .window-topbar {
        background: rgba(24, 28, 35, 0.98);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    body.ui-theme-dark .client-window.chat-mode {
        background: #1a1f27;
    }

    body.ui-theme-dark .messages {
        background:
            radial-gradient(circle at top, rgba(18, 118, 209, 0.09), transparent 24%),
            linear-gradient(180deg, #171c23 0%, #131820 100%);
    }

    body.ui-theme-dark .composer {
        background: linear-gradient(180deg, rgba(24, 28, 35, 0.94) 0%, rgba(20, 24, 31, 0.985) 82%);
        border-top-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.24);
    }

    body.ui-theme-dark .icon-file-button {
        background: rgba(255, 255, 255, 0.045);
        border-color: rgba(255, 255, 255, 0.06);
    }

    body.ui-theme-dark .tool-icon {
        background: rgba(26, 129, 217, 0.18);
        color: #82c4ff;
    }

    body.ui-theme-dark #messageInput {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.03) 100%),
            rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
        color: #edf3ff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    body.ui-theme-dark .send-button {
        box-shadow: none;
    }

    body.ui-theme-dark .presence-notice {
        background: rgba(255, 184, 77, 0.12);
        color: #f5c67f;
        border-color: rgba(255, 184, 77, 0.18);
    }
}
