:root {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: #202637;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --blue: #3578e5;
  --muted: #65748b;
  --line: #edf0f5;
}

* { box-sizing: border-box; }
body { min-width: 720px; min-height: 100vh; margin: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.window-titlebar { height: 38px; display: flex; align-items: stretch; justify-content: space-between; background: #f5f7fb; color: #526078; user-select: none; }
.window-caption { min-width: 0; display: flex; align-items: center; flex: 1; gap: 9px; padding-left: 13px; -webkit-app-region: drag; app-region: drag; font-size: 12px; font-weight: 600; }
.window-logo { display: block; width: 24px; height: 24px; object-fit: contain; }
.window-subtitle { margin-left: 6px; color: #8a95a7; font-size: 10px; font-weight: 400; }
.window-connection-status { padding: 3px 7px; border-radius: 999px; background: #fff1dd; color: #875200; font-size: 10px; font-weight: 600; }
.window-controls { display: flex; -webkit-app-region: no-drag; app-region: no-drag; }
.window-control { width: 46px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: default; }
.window-control svg { fill: none; stroke: currentColor; stroke-width: 1; }
.window-control:hover { background: #e5eaf2; }
.window-control:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.window-control.window-close:hover { color: #fff; background: #c42b35; }
.desktop-app body { height: 100vh; min-height: 0; padding: 1px; overflow: hidden; box-shadow: inset 0 0 0 1px #c9d3e3; }
.desktop-app .app-shell { height: calc(100vh - 40px); min-height: 0; }
.desktop-app.window-maximized body { padding: 0; box-shadow: none; }
.desktop-app.window-maximized .app-shell { height: calc(100vh - 38px); }
.window-unfocused .window-caption { opacity: .65; }
.desktop-app .window-titlebar { position: relative; z-index: 10; flex: 0 0 38px; border-bottom: 1px solid var(--chat-border, #dce3ed); }
.desktop-app .window-caption { overflow: hidden; }
.desktop-app .window-caption > span:first-of-type { white-space: nowrap; }
.desktop-app .window-controls { flex: 0 0 138px; }
.desktop-app .access-gate { top: 39px; padding: 16px; overflow: hidden; }
.desktop-app.window-maximized .access-gate { top: 38px; }
.desktop-app.native-titlebar body { padding: 0; box-shadow: none; }
.desktop-app.native-titlebar .app-shell { height: 100vh; min-height: 0; }
.desktop-app.native-titlebar .access-gate { top: 0; }
.desktop-app .access-gate-layout { width: min(100%, 960px); height: 100%; max-height: 820px; min-height: 0; border-radius: 8px; }
.desktop-app .access-gate-card { min-height: 0; overflow-y: auto; padding: 24px 32px; gap: 9px; }
.desktop-app .access-brand-panel { padding: 28px; }
.desktop-app .access-brand-content { padding: 20px 0; }
@media (max-height: 650px) {
  .desktop-app .access-gate { padding: 12px; }
  .desktop-app .access-brand-panel { padding: 22px; }
  .desktop-app .access-gate-card { padding: 20px 26px; }
  .desktop-app .window-subtitle { display: none; }
}
html[data-theme="dark"] .window-titlebar { color: #d4dbe6; background: #171e2b; }
html[data-theme="dark"] .window-control:hover { background: #303b4e; }
html[data-theme="dark"] .window-control.window-close:hover { background: #c42b35; }
html[data-theme="dark"].desktop-app body { box-shadow: inset 0 0 0 1px #414d63; }
html[data-theme="dark"].desktop-app.window-maximized body { box-shadow: none; }
.app-shell { position: relative; display: flex; width: 100%; height: 100vh; min-height: 560px; overflow: hidden; background: #fff; }
.access-gate { position: fixed; z-index: 4; inset: 0; padding: 24px; display: grid; place-items: center; background: linear-gradient(145deg, #eef4ff, #f8faff 55%, #edf1fa); }
.access-gate-card { width: min(100%, 430px); max-height: calc(100vh - 40px); padding: 32px 34px; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-y: auto; border: 1px solid #e5eaf2; border-radius: 20px; background: #fff; box-shadow: 0 20px 70px #23365a1c; text-align: center; }
.access-gate-card img { object-fit: contain; }
.access-gate-card h1 { margin: 0; color: #293246; font-size: 25px; }
.access-gate-card p { margin: 0; color: #65748b; font-size: 14px; line-height: 1.6; }
.access-gate-card > p { color: #4f5d73; }
.access-gate-card .primary-button { width: auto; min-height: 44px; padding: 0 20px; }
.access-gate-card .access-gate-note { font-size: 12px; }
.access-password-help { width: 100%; margin-top: -8px; text-align: left; }
.access-password-help p { margin-top: 6px; font-size: 12px; }
.access-gate-card .access-help-link { padding: 0; border: 0; color: #276ad2; background: transparent; font-size: 12px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.access-gate-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 10px; background: #f0f3f8; }
.access-gate-tab { min-height: 38px; border: 0; border-radius: 7px; background: transparent; color: #65748b; font-size: 13px; font-weight: 600; cursor: pointer; }
.access-gate-tab.active { background: #fff; color: #276ad2; box-shadow: 0 1px 4px #23365a1a; }
.access-gate-field { width: 100%; display: grid; gap: 6px; color: #39455a; text-align: left; font-size: 12px; font-weight: 600; }
.access-gate-field span { color: #778195; font-weight: 400; }
.access-gate-field input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #dce3ed; border-radius: 8px; color: #202637; background: #fff; font-size: 14px; }
.access-password-control { width: 100%; display: flex; align-items: stretch; gap: 6px; }
.access-password-control input { min-width: 0; flex: 1; }
.access-gate-field .access-password-toggle { min-width: 78px; padding: 0 8px; border: 1px solid #dce3ed; border-radius: 8px; color: #315b94; background: #f6f8fc; font-size: 12px; font-weight: 600; cursor: pointer; }
.access-gate-field input:focus-visible, .access-gate-tab:focus-visible, .access-gate-card button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.access-gate-card .access-server-status, .access-gate-card .access-form-status, .access-gate-card .access-gate-privacy { font-size: 11px; }
.access-gate-card .access-form-status { color: #a62c38; }
.access-gate-card .access-server-status, .access-gate-card .access-gate-note { color: #4f5d73; }
.access-gate-card .access-gate-privacy { color: #59677d; }
.access-gate-card .access-gate-install { margin-top: 2px; color: #43536b; font-size: 12px; }
.access-gate-card .access-install-button { min-height: 44px; padding: 0 16px; border: 1px solid #cbd7e8; border-radius: 9px; color: #315b94; background: #f6f8fc; font-size: 13px; font-weight: 600; cursor: pointer; }
.access-gate-card .access-apk-button { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.access-gate-card button:disabled { cursor: wait; opacity: .7; }
html[data-theme="dark"] .access-gate { background: linear-gradient(145deg, #131a28, #1b2434 55%, #151c2a); }
html[data-theme="dark"] .access-gate-card { border-color: #343d4e; background: #222c3d; }
html[data-theme="dark"] .access-gate-card h1 { color: #edf1f8; }
html[data-theme="dark"] .access-gate-card > p { color: #d0d8e5; }
html[data-theme="dark"] .access-gate-tabs { background: #171f2d; }
html[data-theme="dark"] .access-gate-tab { color: #bdc7d8; }
html[data-theme="dark"] .access-gate-tab.active { background: #303b4e; color: #9fc3ff; }
html[data-theme="dark"] .access-gate-field { color: #d4dbe6; }
html[data-theme="dark"] .access-gate-card .access-help-link { color: #9fc3ff; }
html[data-theme="dark"] .access-gate-field span { color: #b9c4d4; }
html[data-theme="dark"] .access-gate-field input { border-color: #414d63; color: #edf1f8; background: #171f2d; }
html[data-theme="dark"] .access-gate-field .access-password-toggle { border-color: #52627a; color: #d5e4ff; background: #303b4e; }
html[data-theme="dark"] .access-gate-card .access-server-status,
html[data-theme="dark"] .access-gate-card .access-gate-note,
html[data-theme="dark"] .access-gate-card .access-gate-privacy,
html[data-theme="dark"] .access-gate-card .access-gate-install { color: #d0d8e5; }
html[data-theme="dark"] .access-gate-card .access-form-status { color: #ffadb4; }

.sidebar { width: 310px; flex: 0 0 310px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.brand-row { height: 70px; display: flex; align-items: center; padding: 0 21px; gap: 11px; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; object-fit: contain; }
.about-logo { display: block; margin-bottom: 12px; }
.brand-name { font: 800 18px "Segoe UI", sans-serif; letter-spacing: -.5px; color: #293246; }
.icon-button { border: 0; background: none; cursor: pointer; color: #7f899b; }
.settings-button { margin-left: auto; font-size: 19px; }
.profile-card { margin: 5px 13px 14px; width: calc(100% - 26px); display: flex; align-items: center; gap: 11px; padding: 10px 9px; text-align: left; border: 0; border-radius: 12px; background: #f7f9fc; cursor: pointer; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; position: relative; flex: 0 0 auto; color: white; background: #7486bd; font-weight: 700; font-size: 15px; }
.avatar-me { background: linear-gradient(145deg, #e8b899, #955f58); }
.presence { width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; position: absolute; bottom: 0; right: -1px; background: #30c889; }
.presence.away { background: #f2b84c; }
.presence.busy { background: #df5561; }
.presence.offline { background: #b2bac6; }
.profile-copy, .person-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-copy strong, .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 13px; font-weight: 700; }
.profile-copy small { color: #778195; font-size: 11px; }
.status-dot { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; background: #2dc789; }
.chevron { margin-left: auto; color: #a1a9b7; }
.sidebar-actions { padding: 0 17px; }
.attachment-preview { width: min(900px, 95vw); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 18px; color: inherit; background: #fff; }
.attachment-preview::backdrop { background: #0009; }
.attachment-preview-actions { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; top: 0; padding: 8px 0; background: inherit; z-index: 1; }
.attachment-preview-actions button { min-height: 44px; }
.attachment-preview:focus-visible { outline: 2px solid var(--blue); }
@media (max-width: 600px) { .attachment-preview { width: 95vw; padding: 12px; } .attachment-preview-actions button { flex: 1; } }
.attachment-preview h2 { font-size: 16px; overflow-wrap: anywhere; }
.attachment-preview p { font-size: 12px; color: var(--muted); }
.attachment-preview img, .attachment-preview video { display: block; max-width: 100%; max-height: 65vh; margin: 12px auto; }
.attachment-preview audio { width: 100%; }
.attachment-preview iframe { width: 100%; height: 65vh; border: 0; }
.attachment-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; }
html[data-theme="dark"] .attachment-preview { background: #202a3a; color: #edf1f8; }
.file-open { margin-right: 8px; cursor: pointer; }
#profile-actions { display: grid; gap: 4px; margin: -6px 13px 14px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px #20263712; }
.profile-actions-title { margin: 3px 9px 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.profile-action { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.profile-action svg { flex: 0 0 auto; color: var(--blue); }
.profile-action span { min-width: 0; display: grid; gap: 4px; }
.profile-action strong { font-size: 13px; overflow-wrap: anywhere; }
.profile-action small { color: var(--muted); font-size: 11px; }
.profile-action:hover:not(:disabled), .profile-action:focus-visible { background: #3578e510; }
.profile-action:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.profile-action-logout { color: #b62d3b; border-top: 1px solid var(--line); }
.profile-action-logout svg { color: inherit; }
.profile-action-logout:hover:not(:disabled), .profile-action-logout:focus-visible { background: #c42b3510; }
.profile-action:disabled { opacity: .5; cursor: not-allowed; }
.profile-card[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--blue); }
.profile-card .chevron { transition: transform .15s ease; }
.profile-card[aria-expanded="true"] .chevron { transform: rotate(180deg); }
html[data-theme="dark"] #profile-actions { background: #202a3a; border-color: #414d63; color: #edf1f8; }
html[data-theme="dark"] .profile-action small, html[data-theme="dark"] .profile-actions-title { color: #b9c4d4; }
html[data-theme="dark"] .profile-action-logout { color: #ffadb4; border-color: #414d63; }
@media (prefers-reduced-motion: reduce) { .profile-card .chevron { transition: none; } }
#my-contact-code-panel { margin-top: 10px; display: grid; gap: 5px; font-size: 11px; }
#my-contact-code-panel small { color: var(--muted); font-size: 10px; }
#my-contact-code { min-width: 0; width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 6px; color: inherit; background: transparent; font-family: Consolas, monospace; font-size: 12px; }
.primary-button { width: 100%; height: 40px; border: 0; border-radius: 9px; color: white; background: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 5px 12px #3578e526; }
.primary-button:hover, .send-button:hover { background: #276ad2; }
.primary-button span { margin-right: 6px; font-size: 18px; vertical-align: -1px; }
.search-box { height: 38px; margin-top: 12px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 1px solid #e9edf3; border-radius: 8px; color: #8b94a3; }
.search-box > span { font-size: 20px; transform: rotate(-20deg); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: #3c4557; font-size: 12px; background: transparent; }
.search-box input::placeholder { color: #a1a9b6; }
.search-box kbd { flex: 0 0 auto; color: #a7afbd; font: 10px "DM Sans", sans-serif; }
.list-tabs { margin-top: 20px; padding: 0 18px; display: flex; gap: 19px; border-bottom: 1px solid var(--line); }
.list-tab { display: flex; align-items: center; gap: 6px; padding: 0 0 12px; border: 0; border-bottom: 2px solid transparent; color: #929aab; background: none; font-size: 12px; cursor: pointer; }
.list-tab.active { color: #3679e4; border-bottom-color: #3679e4; font-weight: 600; }
.unread-total { padding: 2px 5px; border-radius: 8px; color: #fff; background: #4d88ea; font-size: 9px; }
.conversation-list { min-height: 0; padding-top: 17px; flex: 1; overflow-y: auto; }
.section-label { margin: 0 20px 8px; color: #a3abba; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.contact { position: relative; width: 100%; padding: 10px 18px; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; transition: background .15s ease; }
:root[data-density="compact"] .contact { padding-top: 6px; padding-bottom: 6px; }
.contact:hover { background: #f7f9fc; }
.contact-row { position: relative; }
.contact-row .contact { padding-right: 42px; }
.contact-remove { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 6px; color: #b63b48; background: transparent; cursor: pointer; font-size: 20px; }
.contact-remove:hover, .contact-remove:focus-visible { background: #b63b4820; }
#report-evidence { max-height: 180px; overflow-y: auto; }
#report-evidence label { display: flex; gap: 8px; padding: 8px; font-size: 12px; overflow-wrap: anywhere; }
#report-form { max-height: 90vh; overflow-y: auto; }
#report-description { width: 100%; resize: vertical; }
.contact.selected { background: #edf4ff; }
.contact .avatar { width: 40px; height: 40px; font-size: 13px; }
.contact-copy { min-width: 0; flex: 1; }
.contact-top, .contact-bottom { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.contact-name { overflow: hidden; color: #30394c; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.contact-time { color: #a1a9b6; font-size: 9px; white-space: nowrap; }
.contact-preview { overflow: hidden; color: #707d91; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.contact-unread { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #4082ea; }
.radio-player { padding: 13px 14px 12px; border-top: 1px solid var(--line); background: linear-gradient(145deg, #f9fbff, #fff); }
.radio-sidebar { width: 280px; flex: 0 0 280px; overflow: hidden auto; border-left: 1px solid var(--line); background: #fff; transition: width .2s ease, flex-basis .2s ease, border-color .2s ease; }
.app-shell.radio-collapsed .radio-sidebar { width: 0; flex-basis: 0; border-left-color: transparent; visibility: hidden; }
.radio-backdrop { display: none; }
.radio-toggle { display: inline-grid; }
.radio-stations { padding: 18px 14px; border-top: 1px solid var(--line); }
.radio-stations h2 { margin: 0; font-size: 12px; }
.radio-stations > p { margin: 5px 0 13px; color: var(--muted); font-size: 10px; }
#radio-station-list { display: grid; gap: 7px; }
.radio-station { min-width: 0; display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.radio-station:hover, .radio-station[aria-pressed="true"] { background: color-mix(in srgb, var(--blue) 10%, transparent); border-color: var(--blue); }
.radio-station-mark { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); font-size: 10px; font-weight: 800; }
.radio-station > span:nth-child(2) { min-width: 0; flex: 1; }
.radio-station strong, .radio-station small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-station strong { font-size: 13px; }
.radio-station small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.radio-station-play { color: var(--blue); font-size: 11px; }
html[data-theme="dark"] .radio-sidebar { color: #d8dfeb; background: #171e2b; }
.radio-heading { min-width: 0; display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.radio-art { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #558df0, #735be8); box-shadow: 0 4px 10px #5e7ee733; }
.radio-art svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.radio-heading-copy { min-width: 0; flex: 1; }
.radio-heading-copy strong, .radio-heading-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-heading-copy strong { color: #273248; font-size: 13px; font-weight: 700; }
.radio-heading-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.radio-live { padding: 3px 6px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: #fff; font-size: 8px; font-weight: 800; letter-spacing: .5px; }
.radio-live[data-state="playing"] { border-color: #bcebd6; color: #138653; background: #e9fbf2; }
.radio-live[data-state="loading"] { border-color: #c9d9ff; color: #426ebd; background: #eff4ff; }
.radio-entry { height: 33px; display: flex; gap: 5px; }
.radio-entry input { min-width: 0; width: 100%; padding: 0 9px; border: 1px solid #e5eaf2; border-radius: 8px; outline: 0; color: inherit; background: #fff; font-size: 10px; transition: border-color .15s, box-shadow .15s; }
.radio-entry input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent); }
.radio-entry input::placeholder { color: #9ca6b7; }
.radio-tune-button { width: 35px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 8px; color: #fff; background: var(--blue); cursor: pointer; transition: filter .15s, transform .15s; }
.radio-tune-button:hover { filter: brightness(.94); }
.radio-tune-button:active { transform: scale(.96); }
.radio-tune-button svg, .radio-control-button svg, .radio-volume svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.radio-help { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.radio-controls { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.radio-control-button { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid #e5eaf2; border-radius: 50%; color: #687891; background: #fff; cursor: pointer; }
.radio-control-button:hover:not(:disabled) { border-color: #c9d9f5; color: var(--blue); background: #f4f8ff; }
.radio-control-button:disabled { opacity: .45; cursor: default; }
.radio-play-control { width: 38px; height: 38px; color: #fff; background: var(--blue); border-color: var(--blue); }
.radio-play-control:hover:not(:disabled) { color: #fff; background: #276ad2; }
.radio-pause-icon { display: none; }
.radio-play-control.is-playing .radio-play-icon { display: none; }
.radio-play-control.is-playing .radio-pause-icon { display: block; }
.radio-status { min-width: 0; flex: 1; overflow: hidden; margin: 0 0 0 3px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.radio-status[data-state="error"] { color: #b42332; }
.radio-status[data-state="error"] { flex: 0 0 100%; order: 1; overflow: visible; white-space: normal; font-size: 12px; line-height: 1.5; margin: 5px 0; }
#radio-retry { margin-top: 8px; width: 100%; }
.radio-volume { display: flex; align-items: center; gap: 3px; color: #7b879a; }
.radio-volume svg { width: 15px; height: 15px; flex: 0 0 auto; }
.radio-volume input { width: 52px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.composer-area { position: relative; }
.emoji-picker { position: absolute; z-index: 4; bottom: calc(100% + 8px); left: 12px; width: min(340px, calc(100% - 24px)); padding: 14px; border: 1px solid var(--line); border-radius: 18px; color: #202637; background: #fff; box-shadow: 0 12px 42px #17243a26; }
.typing-indicator { margin: 0 0 7px; font-size: 12px; color: var(--muted); }
.reply-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 9px; background: color-mix(in srgb, var(--blue) 10%, transparent); font-size: 12px; }
#reply-preview-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#reply-cancel { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 20px; }
.message-reply { display: block; width: 100%; margin-bottom: 8px; padding: 9px 12px; border: 0; border-left: 3px solid var(--blue); border-radius: 8px; color: inherit; background: color-mix(in srgb, var(--blue) 10%, transparent); font-size: 12px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.message-actions, .message-reactions, .reaction-options { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.message-actions button, .reaction-menu summary, .reaction-button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 10px; color: inherit; background: transparent; font-size: 12px; cursor: pointer; }
.reaction-options button { padding: 5px; border: 0; border-radius: 7px; background: transparent; font-size: 20px; cursor: pointer; }
.reaction-button[aria-pressed="true"], .message-actions button:hover, .reaction-options button:hover { background: color-mix(in srgb, var(--blue) 15%, transparent); }
.reaction-button[aria-pressed="true"] { border-color: var(--blue); }
.reaction-menu { min-width: 0; max-width: 100%; }
.reaction-menu[open] { flex-basis: 100%; }
.mine .reaction-menu summary { margin-left: auto; }
.reaction-menu summary { width: fit-content; list-style: none; color: var(--muted); }
.reaction-menu summary::-webkit-details-marker { display: none; }
.reaction-menu summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.reaction-menu[open] .reaction-options { padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--blue) 5%, transparent); }
.reaction-options button { min-width: 36px; min-height: 36px; }
.mine .message-actions, .mine .message-reactions { justify-content: flex-end; }
.message-row:focus { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 10px; }
.reaction-error { display: block; color: #b12b35; font-size: 12px; margin-top: 6px; }
.startup-warning { flex: 0 0 auto; padding: 12px 16px; border-bottom: 1px solid #d8aa43; color: #64430b; background: #fff2cf; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
html[data-theme="dark"] .startup-warning { color: #ffe4a7; background: #40331d; }
html[data-theme="dark"] .reaction-error { color: #ffadb4; }
.emoji-picker-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.emoji-picker-heading button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; }
.emoji-categories { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.emoji-categories button { padding: 7px 9px; border: 0; border-radius: 8px; color: inherit; background: transparent; font-size: 12px; cursor: pointer; }
.emoji-categories button[aria-pressed="true"] { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.emoji-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; max-height: 200px; overflow-y: auto; }
.emoji-grid button { min-width: 0; height: 42px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: 26px; }
.emoji-grid button:hover, .emoji-picker-heading button:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.emoji-empty { grid-column: 1 / -1; margin: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
html[data-theme="dark"] .emoji-picker { color: #d8dfeb; background: #202b3b; }
.sidebar-footer { padding: 13px 15px; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); color: #8993a4; }
.privacy-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #477fe0; background: #edf4ff; font-size: 18px; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: #647085; font-size: 9px; font-weight: 600; }
.sidebar-footer small { margin-top: 3px; font-size: 9px; }

.main-panel { min-width: 0; flex: 1; display: flex; flex-direction: column; background: #fff; }
.chat-header { height: 70px; flex: 0 0 70px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.chat-person { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; }
.header-avatar { width: 39px; height: 39px; background: linear-gradient(145deg, #f1bb89, #d77969); }
.person-copy { gap: 3px; }
.person-copy h1 { margin: 0; font: 700 15px "Segoe UI", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-copy p { margin: 0; color: #707d91; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { flex: 0 0 auto; }
.action-icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.round-action { width: 34px; height: 34px; border: 1px solid #e8edf4; border-radius: 50%; color: #5f7eaf; background: white; font-size: 16px; cursor: pointer; }
.round-action:hover { border-color: #bcd2f5; color: #3578e5; background: #f4f8ff; }
.contacts-back { display: inline-grid; flex: 0 0 auto; place-items: center; }
.sidebar-menu { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.sidebar-menu svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.brand-row { padding-left: 12px; gap: 8px; }
.brand-name { min-width: 0; }
.sidebar-backdrop { position: fixed; z-index: 2; inset: 0; padding: 0; border: 0; background: #18223866; cursor: pointer; }
@media (min-width: 621px) {
  .sidebar.sidebar-collapsed { display: none; }
}
.subtle-action { border: 0; color: #8993a3; font-size: 18px; }
.action-divider { height: 21px; width: 1px; margin: 0 3px; background: #e8edf3; }
.chat-date { padding: 17px 0 11px; display: flex; align-items: center; gap: 12px; color: #a0a8b6; font-size: 10px; }
.chat-date::before, .chat-date::after { height: 1px; flex: 1; content: ""; background: #f0f2f6; }
.chat-date span { padding: 0 4px; }
.messages { min-height: 0; padding: 10px 7.5% 18px; flex: 1; overflow-y: auto; }
.message-row { width: 100%; margin: 7px 0; display: flex; align-items: flex-end; gap: 8px; }
.message-row.mine { justify-content: flex-end; }
.message-row.grouped { margin-top: 3px; }
.message-row.grouped .message-avatar { visibility: hidden; }
.message-row.grouped .message-sender { display: none; }
.draft-preview { font-style: italic; color: var(--blue); }
.contact-unread { min-width: 18px; height: auto; padding: 2px 4px; border-radius: 9px; color: white; background: var(--blue); font-size: 10px; text-align: center; }
.chat-search-panel { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.encryption-details summary { cursor: pointer; font-size: 12px; margin: 6px 0; color: inherit; }
.chat-search-panel input { min-width: 0; width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; }
.chat-search-panel button { border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; padding: 5px 8px; cursor: pointer; }
#chat-search-count { white-space: nowrap; font-size: 11px; }
.bubble mark, .attachment-card mark { background: #ffe08a; color: #222; border-radius: 2px; }
.new-messages-button { align-self: center; padding: 8px 16px; border: 0; border-radius: 20px; background: var(--blue); color: white; cursor: pointer; }
.message-delivery-status { margin: 4px 7.5%; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.message-delivery-status.failed { color: #b12b35; }
html[data-theme="dark"] .message-delivery-status.failed { color: #ffadb4; }
.message-avatar { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: white; background: #e5a783; font-size: 10px; font-weight: 700; }
.message-content { min-width: 0; max-width: min(78%, 560px); }
.message-sender { margin: 0 0 4px 2px; color: #8992a2; font-size: 9px; }
.bubble { padding: 10px 13px; border-radius: 4px 14px 14px 14px; color: #414a5b; background: #f2f4f8; font-size: var(--message-font-size, 12px); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .bubble { border-radius: 14px 4px 14px 14px; color: white; background: #4a84e5; }
.message-meta { margin: 5px 3px 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; color: #6e7c91; font-size: 10px; }
.mine .message-meta { color: #a0bde9; }
.read-check { color: #6eaae9; font-weight: 700; }
.attachment-card { min-width: min(190px, 100%); max-width: min(320px, 100%); padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid #e8edf4; border-radius: 11px; background: #f8f9fc; }
.attachment-card > span:last-child { min-width: 0; }
.mine .attachment-card { border-color: #6b99e9; background: #f2f6ff; text-align: left; }
.attachment-icon { width: 31px; height: 31px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #3d7be0; background: #e9f1ff; font-size: 18px; }
.attachment-card strong, .attachment-card small { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-card strong { color: #414a5b; font-size: 11px; font-weight: 600; }
.attachment-card small { margin-top: 3px; color: #9099a8; font-size: 9px; }
.composer-area { padding: 8px 7.5% 17px; }
.composer { min-height: 52px; padding: 7px 9px; display: flex; align-items: flex-end; gap: 5px; border: 1px solid #dce5f2; border-radius: 20px; box-shadow: 0 5px 20px #24375d0a; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: #a9c7f4; box-shadow: 0 0 0 3px #3578e510; }
.composer-tool { width: 34px; height: 36px; flex: 0 0 auto; border: 0; color: #8993a3; background: none; font-size: 21px; cursor: pointer; }
.attach-button { font-size: 24px; }
.composer textarea { min-width: 0; max-height: 142px; min-height: 35px; padding: 9px 3px 7px; flex: 1; resize: none; outline: 0; border: 0; color: #3b4557; background: transparent; font-size: 14px; line-height: 1.5; }
.composer textarea::placeholder { color: #a0a8b5; }
.send-button { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 9px; color: white; background: var(--blue); font-size: 14px; cursor: pointer; }
.composer-hint { margin: 9px 2px 0; color: #6e7c91; font-size: 11px; line-height: 1.5; }
.composer-hint span { padding: 0 3px; }
.composer-hint { font-size: 10px; opacity: .85; }
.composer-footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); margin-top: 5px; font-size: 11px; }
#composer-counter { margin-left: auto; white-space: nowrap; }
.composer-attachments { display: flex; gap: 8px; overflow-x: auto; max-height: 150px; padding-bottom: 10px; }
.composer-attachment { display: flex; align-items: center; gap: 9px; min-width: 170px; max-width: 250px; flex: 0 0 auto; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #f5f8fd; }
.composer-attachment img { object-fit: cover; border-radius: 8px; }
.composer-attachment > span { min-width: 0; display: grid; gap: 4px; }
.composer-attachment strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-attachment small { color: var(--muted); font-size: 11px; }
.composer-attachment button { flex: 0 0 auto; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 20px; }
.composer-attachment audio { width: min(260px, 35vw); height: 36px; flex: 0 1 260px; }
.composer-attachment-audio { display: grid; grid-template-columns: minmax(0, 1fr) 36px; width: min(320px, calc(100vw - 48px)); min-width: 0; max-width: 320px; border-radius: 8px; }
.composer-attachment-audio audio { grid-column: 1 / -1; width: 100%; min-width: 0; height: 44px; }
.composer-attachment-audio button { width: 36px; height: 36px; }
.message-unavailable { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.avatar, .message-avatar, #profile-button > span:first-child { position: relative; }
.profile-photo-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.avatar .presence { z-index: 1; }
.voice-record-button { display: grid; place-items: center; border-radius: 10px; color: #5e789f; }
.voice-record-button:hover:not(:disabled) { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.voice-record-button:disabled { opacity: .4; cursor: default; }
.voice-record-button.is-recording { color: #c63745; background: #fff0f1; }
.voice-record-button.is-recording:hover { background: #ffe2e5; }
.voice-recording-row { min-height: 36px; margin: 0 3px 8px; display: flex; align-items: center; gap: 9px; color: #ae2937; font-size: 12px; }
.voice-recording-indicator { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #d73e4e; animation: voice-recording-pulse 1.2s ease-in-out infinite; }
.voice-cancel-button { margin-left: auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
@keyframes voice-recording-pulse { 50% { opacity: .35; } }
.voice-message { width: min(340px, 100%); margin-bottom: 8px; padding: 10px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid #dce5f2; border-radius: 12px; background: #f5f8fd; }
.mine .voice-message { border-color: #6b99e9; background: #f2f6ff; }
.voice-message-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #3478ed; background: #e6efff; }
.voice-message-copy { min-width: 0; flex: 1; display: grid; gap: 5px; }
.voice-message-copy strong { font-size: 12px; }
.voice-message-copy small { color: var(--muted); font-size: 10px; }
.voice-message-copy audio { width: 100%; max-width: 270px; height: 38px; }
.voice-message-load { width: fit-content; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.voice-message-load:disabled { opacity: .6; cursor: wait; }
.emoji-search { width: 100%; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; color: inherit; background: transparent; }
.file-drop-active .composer { border: 2px dashed var(--blue); box-shadow: 0 0 0 4px #3578e51a; }
.send-button:disabled { opacity: .45; box-shadow: none; cursor: default; }
.reply-preview { border-left-width: 4px; padding: 12px 14px; font-size: 13px; }
html[data-theme="dark"] .composer-attachment { background: #202b3b; }
html[data-theme="dark"] .voice-record-button.is-recording { color: #ffadb4; background: #3b2932; }
html[data-theme="dark"] .voice-record-button.is-recording:hover { background: #50323d; }
html[data-theme="dark"] .voice-recording-row { color: #ffadb4; }
html[data-theme="dark"] .voice-message { border-color: #39485e; background: #202b3b; }
html[data-theme="dark"] .mine .voice-message { border-color: #6b99e9; background: #263a5b; }
html[data-theme="dark"] .voice-message-icon { color: #a9c8ff; background: #2a3e5d; }
html[data-theme="dark"] .voice-cancel-button,
html[data-theme="dark"] .voice-message-load { border-color: #46536a; }
.empty-conversation { width: min(380px, 100%); margin: 48px auto; text-align: center; color: #65748b; }
.empty-conversation-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 22px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.empty-conversation h2 { color: #33455f; font-size: 20px; font-weight: 650; margin: 0 0 12px; }
.empty-conversation p { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.empty-conversation small { font-size: 12px; line-height: 1.6; display: block; }
html[data-theme="dark"] .empty-conversation, html[data-theme="dark"] .empty-conversation h2 { color: #bfd1e9; }
.hidden { display: none !important; }
.empty-search { padding: 25px 20px; color: #929aaa; text-align: center; font-size: 11px; }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 25px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; color: #fff; background: #2c3546; box-shadow: 0 8px 25px #1822382b; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; z-index: 5; inset: 0; padding: 20px; display: grid; place-items: center; background: #202a3a66; backdrop-filter: blur(5px); }
.call-card, .new-chat-card { position: relative; width: min(390px, 100%); padding: 34px 30px 28px; border-radius: 22px; background: white; box-shadow: 0 24px 80px #131e3333; text-align: center; }
.call-close { position: absolute; top: 13px; right: 15px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: #8c95a4; background: #f4f6f9; font-size: 21px; cursor: pointer; }
.call-avatar { width: 82px; height: 82px; margin: 0 auto 18px; font-size: 27px; background: linear-gradient(145deg, #f1bb89, #d77969); box-shadow: 0 0 0 9px #f2f6fc; }
.call-eyebrow { margin: 0 0 7px; color: #4c84e2; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.call-card h2, .new-chat-card h2 { margin: 0; font: 700 20px Manrope, sans-serif; }
.call-caption, .new-chat-card > p { margin: 9px 0 26px; color: #9099a8; font-size: 11px; line-height: 1.5; }
.call-controls { display: flex; justify-content: center; gap: 16px; }
.call-control { width: 46px; height: 46px; border: 0; border-radius: 50%; color: #60718b; background: #f0f4f9; font-size: 18px; cursor: pointer; }
.call-control.active { color: white; background: #e5a2a2; }
.call-control.end-call { color: white; background: #e4545b; transform: rotate(135deg); }
.new-chat-card { text-align: left; max-height: calc(100vh - 40px); overflow-y: auto; }
#new-chat-my-code { overflow-wrap: anywhere; font-family: Consolas, monospace; }
#contact-requests { max-height: 180px; overflow-y: auto; font-size: 12px; }
#contact-requests .details-button { margin: 0 6px 6px 0; }
#encryption-panel { padding: 8px 20px; border-bottom: 1px solid var(--line); font-size: 11px; flex: 0 0 auto; }
html.android-app #encryption-panel,
html.desktop-app #encryption-panel { display: none !important; }
#encryption-panel p { margin: 0 0 5px; }
#encryption-safety-code { display: block; width: 100%; min-width: 0; color: inherit; background: transparent; border: 1px solid var(--line); padding: 5px; font: 12px Consolas, monospace; overflow-wrap: anywhere; resize: none; }
#encryption-panel small { display: block; margin-top: 5px; }
#verify-encryption-key { margin-top: 5px; }
.message-encryption { font-size: 10px; }
.new-chat-icon { width: 40px; height: 40px; margin-bottom: 15px; display: grid; place-items: center; border-radius: 12px; color: #397be4; background: #edf4ff; font-size: 25px; }
.network-banner { min-height: 42px; padding: 6px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f6f9ff; border-bottom: 1px solid var(--line); font-size: 12px; }
.network-indicator { min-width: 0; overflow-wrap: anywhere; }
.network-banner button { flex: 0 0 auto; min-height: 30px; padding: 5px 10px; border-radius: 8px; }
.network-indicator { color: #9d6d2d; }
.network-indicator.connected { color: #218562; }
.network-banner button, .file-download { border: 0; background: transparent; color: #3578e5; font-size: 10px; cursor: pointer; }
.file-download { margin-top: 7px; padding: 0; text-decoration: underline; }
.welcome-chat { max-width: 420px; margin: 70px auto; text-align: center; color: #657187; }
.welcome-chat h2 { color: #293246; font-size: 23px; }
.welcome-chat p { font-size: 13px; line-height: 1.8; }
.welcome-chat small { font-size: 11px; line-height: 1.7; }
.server-addresses { overflow-wrap: anywhere; padding: 10px; border-radius: 8px; background: #edf4ff; color: #3478e5 !important; font-size: 11px !important; }
.call-card { width: min(580px, 100%); max-height: 92vh; overflow-y: auto; }
.call-video-stage { position: relative; }
#remote-video { width: 100%; max-height: 300px; border-radius: 14px; background: #141b2b; }
#local-video { width: 115px; max-height: 110px; margin: 8px 0 14px; border-radius: 10px; background: #141b2b; transform: scaleX(-1); }
.call-card .settings-save { margin: 0 0 18px; background: #239b6e; }
button:disabled { cursor: not-allowed; opacity: .5; }
html[data-theme="dark"] .network-banner { background: #222c3d; }
html[data-theme="dark"] .network-indicator.connected { color: #64d5a8; }
html[data-theme="dark"] .network-indicator { color: #edc07d; }
html[data-theme="dark"] .welcome-chat, html[data-theme="dark"] .welcome-chat h2 { color: #ccd6e7; }
html[data-theme="dark"] .server-addresses { background: #2c3b54; color: #a6c9ff !important; }
.new-chat-card > p { margin-bottom: 17px; }
.new-contact-form { margin-bottom: 18px; }
.new-contact-form label { display: block; margin-bottom: 6px; color: #68748a; font-size: 10px; font-weight: 600; }
.new-contact-entry { display: flex; gap: 7px; }
.new-contact-entry input { min-width: 0; height: 36px; padding: 0 10px; flex: 1; border: 1px solid #e5eaf1; border-radius: 8px; outline: 0; font-size: 11px; }
.new-contact-entry input:focus { border-color: #a9c7f4; box-shadow: 0 0 0 3px #3578e510; }
.new-contact-entry button { padding: 0 13px; border: 0; border-radius: 8px; color: white; background: var(--blue); font-size: 11px; font-weight: 600; cursor: pointer; }
.form-error { min-height: 14px; margin-top: 4px; display: block; color: #c54e57; font-size: 10px; }
.contact-list-label { margin: 8px 0 4px !important; color: #a3abba; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.new-chat-contacts { max-height: 290px; overflow-y: auto; }
.new-chat-contact { width: 100%; padding: 9px 6px; display: flex; align-items: center; gap: 10px; border: 0; border-top: 1px solid #f0f2f6; background: white; text-align: left; cursor: pointer; }
.new-chat-contact:hover { background: #f7f9fc; }
.new-chat-contact .avatar { width: 35px; height: 35px; font-size: 12px; }
.new-chat-contact strong, .new-chat-contact small { display: block; }
.new-chat-contact strong { font-size: 12px; }
.new-chat-contact small { margin-top: 3px; color: #9099a8; font-size: 10px; }

@media (max-width: 900px) {
  .sidebar { width: 275px; flex-basis: 275px; }
  .messages { padding-right: 5%; padding-left: 5%; }
  .composer-area { padding-right: 5%; padding-left: 5%; }
}
@media (max-width: 720px) {
  body { min-width: 0; }
  .sidebar { width: 245px; flex-basis: 245px; }
  .chat-header { padding: 0 14px; }
  .header-actions { gap: 5px; }
  .round-action { width: 30px; height: 30px; }
  .action-divider { display: none; }
  .message-content { max-width: 82%; }
}
@media (max-width: 620px) {
  .sidebar { position: fixed; z-index: 3; inset: 0 auto 0 0; width: min(310px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 35px #18223816; }
  .sidebar.mobile-open { transform: translateX(0); }
  .desktop-app .sidebar { top: 39px; bottom: 1px; }
  .desktop-app.window-maximized .sidebar { top: 38px; bottom: 0; }
  .contacts-back { display: inline-grid; flex: 0 0 auto; place-items: center; font-size: 25px; }
  .chat-person { gap: 7px; }
  .chat-header { padding: 0 10px; }
  .header-actions { gap: 3px; }
  .round-action { width: 29px; height: 29px; }
}

.settings-card, .details-card { position: relative; width: min(440px, 100%); max-height: min(90vh, 760px); padding: 26px 30px; overflow-y: auto; border-radius: 20px; color: #202637; background: #fff; box-shadow: 0 24px 80px #131e3333; }
.settings-card h2, .details-card h2 { margin: 0; font: 700 20px Manrope, sans-serif; }
.settings-card > p, .details-description { margin: 8px 0 22px; color: #9099a8; font-size: 11px; line-height: 1.5; }
.settings-card > .settings-section-title { margin: 17px 0 7px; color: #9aa4b4; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.settings-field { margin: 15px 0; display: block; color: #68748a; font-size: 10px; font-weight: 600; }
.settings-field input, .settings-field select { width: 100%; height: 39px; margin-top: 6px; padding: 0 10px; border: 1px solid #e5eaf1; border-radius: 8px; outline: 0; color: #3c4557; background: #fff; font-size: 12px; }
.settings-field input:focus, .settings-field select:focus { border-color: #a9c7f4; box-shadow: 0 0 0 3px #3578e510; }
.settings-toggle { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #59667b; cursor: pointer; }
.settings-toggle strong, .settings-toggle small { display: block; }
.settings-toggle strong { font-size: 11px; font-weight: 600; }
.settings-toggle small { margin-top: 3px; color: #929cac; font-size: 10px; }
.settings-toggle input { width: 16px; height: 16px; accent-color: var(--blue); }
.settings-save { width: 100%; height: 39px; margin-top: 4px; border: 0; border-radius: 8px; color: white; background: var(--blue); font-size: 12px; font-weight: 600; cursor: pointer; }
.settings-note { margin: 14px 0 0 !important; color: #a0a8b5 !important; font-size: 10px !important; }
.details-actions { display: grid; gap: 8px; }
.details-button { min-height: 38px; padding: 8px 11px; border: 1px solid #e6ebf2; border-radius: 8px; color: #536177; background: #fff; text-align: left; font-size: 11px; cursor: pointer; }
.details-button:hover:not(:disabled) { border-color: #c5d8f5; color: #3478e5; background: #f5f8fe; }
.details-button:disabled { opacity: .48; cursor: not-allowed; }
.details-button.danger-button { color: #c54e57; }
.details-button.danger-button:hover:not(:disabled) { border-color: #f1c6c8; color: #b63844; background: #fff7f7; }

html[data-theme="dark"] { color-scheme: dark; background: #171c27; color: #e4e9f1; --line: #2a3140; --blue: #4d89ee; }
html[data-theme="dark"] body, html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .sidebar, html[data-theme="dark"] .main-panel,
html[data-theme="dark"] .chat-header, html[data-theme="dark"] .new-chat-contact,
html[data-theme="dark"] .composer-tool { color: #e4e9f1; background: #1d2330; }
html[data-theme="dark"] .brand-name, html[data-theme="dark"] .contact-name,
html[data-theme="dark"] .person-copy h1, html[data-theme="dark"] .profile-copy strong,
html[data-theme="dark"] .attachment-card strong { color: #e4e9f1; }
html[data-theme="dark"] .attachment-card small, html[data-theme="dark"] .settings-note { color: #aab5c7 !important; }
html[data-theme="dark"] .profile-card, html[data-theme="dark"] .contact:hover,
html[data-theme="dark"] .new-chat-contact:hover { background: #252d3c; }
html[data-theme="dark"] .contact.selected { background: #263752; }
html[data-theme="dark"] .contact-preview, html[data-theme="dark"] .contact-time,
html[data-theme="dark"] .profile-copy small, html[data-theme="dark"] .person-copy p,
html[data-theme="dark"] .chat-date, html[data-theme="dark"] .message-sender,
html[data-theme="dark"] .sidebar-footer, html[data-theme="dark"] .settings-card > p,
html[data-theme="dark"] .details-description, html[data-theme="dark"] .call-caption,
html[data-theme="dark"] .new-chat-card > p { color: #aab5c7; }
html[data-theme="dark"] .search-box, html[data-theme="dark"] .composer,
html[data-theme="dark"] .round-action, html[data-theme="dark"] .details-button { border-color: #343d4e; }
html[data-theme="dark"] .search-box input, html[data-theme="dark"] .composer textarea { color: #e4e9f1; }
html[data-theme="dark"] .search-box input::placeholder, html[data-theme="dark"] .composer textarea::placeholder { color: #8995a9; }
html[data-theme="dark"] .bubble, html[data-theme="dark"] .attachment-card,
html[data-theme="dark"] .call-control { color: #d4dbe6; background: #2a3241; }
html[data-theme="dark"] .mine .bubble { color: #fff; background: #4a84e5; }
html[data-theme="dark"] .mine .attachment-card { border-color: #4d89ee; background: #283752; }
html[data-theme="dark"] .settings-card, html[data-theme="dark"] .details-card,
html[data-theme="dark"] .call-card, html[data-theme="dark"] .new-chat-card { color: #e4e9f1; background: #222a38; }
html[data-theme="dark"] .settings-field input, html[data-theme="dark"] .settings-field select,
html[data-theme="dark"] .new-contact-entry input { border-color: #343d4e; color: #e4e9f1; background: #1b2230; }
html[data-theme="dark"] .settings-toggle { color: #d4dbe6; }
html[data-theme="dark"] .settings-toggle small, html[data-theme="dark"] .settings-section-title { color: #aab5c7; }
html[data-theme="dark"] .details-button { color: #d4dbe6; background: #252d3c; }
html[data-theme="dark"] .details-button:hover:not(:disabled) { background: #2a3548; }
html[data-theme="dark"] .call-close { color: #c1cada; background: #30394a; }
html[data-theme="dark"] .action-divider, html[data-theme="dark"] .chat-date::before,
html[data-theme="dark"] .chat-date::after { background: #343d4e; }
html[data-theme="dark"] .sidebar-footer, html[data-theme="dark"] .new-chat-contact { border-color: #343d4e; }
html[data-theme="dark"] .new-chat-icon, html[data-theme="dark"] .privacy-icon,
html[data-theme="dark"] .attachment-icon { background: #2c3b54; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.settings-card { width: min(780px, 100%); display: grid; grid-template-columns: 165px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 0 25px; max-height: calc(100vh - 60px); overflow: hidden; padding: 24px; }
.settings-card > .new-chat-icon, .settings-card > h2, .settings-card > p { grid-column: 1 / -1; }
.settings-card > .new-chat-icon { width: 32px; height: 32px; margin-bottom: 10px; font-size: 20px; }
.settings-card > p { margin-bottom: 16px; }
.settings-navigation { display: flex; flex-direction: column; gap: 5px; padding-right: 12px; border-right: 1px solid var(--line); }
.settings-navigation button { padding: 11px 10px; border: 0; border-radius: 8px; text-align: left; background: transparent; color: #68748a; font-size: 12px; cursor: pointer; }
.settings-navigation button:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.settings-navigation button[aria-pressed="true"] { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); font-weight: 700; }
.settings-content { min-height: 240px; overflow-y: auto; padding: 0 8px 14px 0; }
.settings-section-title { margin: 8px 0; color: #8790a2; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.settings-footer { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-footer .settings-note { margin-top: 8px !important; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.settings-actions .details-button { flex: 1 1 145px; }
.settings-feedback { font-size: 12px; line-height: 1.6; color: #68748a; overflow-wrap: anywhere; }
.account-controls { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.account-controls .settings-field { margin: 12px 0; }
.about-title { margin: 12px 0 0; font-size: 20px; }
.about-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; margin: 20px 0; font-size: 12px; line-height: 1.6; }
.about-details dt { color: var(--muted); }
.about-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.settings-note { line-height: 1.6; }
.settings-field input[type="range"] { padding: 0; accent-color: var(--blue); }
.microphone-meter { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 11px; }
.microphone-meter meter { flex: 1; height: 20px; }
#settings-camera-preview { display: block; width: 100%; max-height: 190px; margin-top: 15px; border-radius: 10px; background: #141b2b; transform: scaleX(-1); }
#device-pair-video { display: block; width: 100%; max-height: 240px; margin-top: 15px; border-radius: 10px; background: #141b2b; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
html[data-timestamps="false"] .message-time { display: none; }
html[data-previews="false"] .contact-preview { visibility: hidden; }
.window-logo, .mine .bubble, html[data-theme="dark"] .mine .bubble,
.unread-total, .contact-unread, .brand-mark span { background: var(--blue); }
.list-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.network-banner button, .file-download, .new-chat-icon, .privacy-icon, .attachment-icon,
.call-eyebrow { color: var(--blue); }
.primary-button:hover, .send-button:hover { background: color-mix(in srgb, var(--blue) 85%, black); }
.primary-button { box-shadow: 0 5px 12px color-mix(in srgb, var(--blue) 15%, transparent); }
.contact.selected, html[data-theme="dark"] .contact.selected { background: color-mix(in srgb, var(--blue) 14%, transparent); }
html[data-theme="dark"] .settings-navigation button, html[data-theme="dark"] .settings-feedback,
html[data-theme="dark"] .settings-field { color: #b8c4d7; }
html[data-theme="dark"] .settings-navigation button[aria-pressed="true"] { color: #fff; }
html[data-theme="dark"] .radio-player { background: linear-gradient(145deg, #1e293b, #182231); }
html[data-theme="dark"] .radio-heading-copy strong { color: #d8dfeb; }
html[data-theme="dark"] .radio-status[data-state="error"] { color: #ff909a; }
html[data-theme="dark"] .radio-live { border-color: #39465a; color: #aab6c8; background: #202b3b; }
html[data-theme="dark"] .radio-live[data-state="playing"] { border-color: #256b50; color: #70d9a5; background: #173d31; }
html[data-theme="dark"] .radio-live[data-state="loading"] { border-color: #405b8c; color: #a9c3ff; background: #263754; }
html[data-theme="dark"] .radio-entry input, html[data-theme="dark"] .radio-control-button { border-color: #39465a; color: #d8dfeb; background: #202b3b; }
@media (max-width: 640px), (max-height: 620px) {
  .settings-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; padding: 18px; max-height: calc(100vh - 40px); }
  .settings-navigation { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; margin-bottom: 10px; }
  .settings-navigation button { padding: 7px 9px; font-size: 11px; }
  .settings-content { min-height: 90px; }
}

html[data-accent="glass-blue"] {
  --glass-surface: rgba(247, 252, 255, .88);
  --glass-raised: rgba(247, 252, 255, .95);
  --glass-line: rgba(79, 132, 193, .28);
  --glass-text: #234268;
  --glass-muted: #355274;
  --glass-accent: #1858ad;
  --glass-hover: rgba(255, 255, 255, .75);
  --glass-selected: rgba(33, 102, 196, .12);
  --glass-danger: #ab263d;
  --glass-shadow: rgba(22, 64, 118, .12);
  --line: var(--glass-line);
  background: #dcecff;
}
html[data-accent="glass-blue"][data-theme="dark"] {
  --glass-surface: rgba(19, 38, 65, .86);
  --glass-raised: rgba(27, 49, 80, .92);
  --glass-line: rgba(132, 186, 245, .25);
  --glass-text: #e0eeff;
  --glass-muted: #b6cee9;
  --glass-accent: #9dc9ff;
  --glass-hover: rgba(95, 149, 208, .18);
  --glass-selected: rgba(110, 174, 249, .2);
  --glass-danger: #ffafbc;
  --glass-shadow: rgba(0, 8, 26, .3);
  background: #0b1830;
}
html[data-accent="glass-blue"] .app-shell {
  background: radial-gradient(ellipse at 12% 10%, #f2fbff 0, transparent 50%),
    radial-gradient(ellipse at 90% 85%, #9ac9f7 0, transparent 55%), linear-gradient(135deg, #c0dcfa, #e4f1ff 55%, #b5d8fa);
}
html[data-accent="glass-blue"][data-theme="dark"] .app-shell {
  background: radial-gradient(ellipse at 12% 10%, #214e78 0, transparent 50%),
    radial-gradient(ellipse at 90% 85%, #163c70 0, transparent 55%), linear-gradient(135deg, #0c2038, #142d4b 55%, #0c1931);
}
html[data-accent="glass-blue"] .main-panel { background: transparent; }
html[data-accent="glass-blue"] .messages {
  background: linear-gradient(180deg, rgba(247, 252, 255, .56), rgba(247, 252, 255, .72));
}
html[data-accent="glass-blue"][data-theme="dark"] .messages {
  background: linear-gradient(180deg, rgba(10, 27, 47, .5), rgba(10, 27, 47, .7));
}
html[data-accent="glass-blue"] :is(.sidebar, .chat-header, .network-banner, .window-titlebar) {
  color: var(--glass-text);
  background: var(--glass-surface);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
html[data-accent="glass-blue"] .sidebar { border-right-color: var(--glass-line); }
html[data-accent="glass-blue"] .profile-card { border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
html[data-accent="glass-blue"] .contact { width: calc(100% - 16px); margin: 3px 8px; padding: 12px 10px; border-radius: 12px; border: 1px solid transparent; }
html[data-accent="glass-blue"] .contact-row .contact { padding-right: 42px; }
html[data-accent="glass-blue"][data-density="compact"] .contact { padding-top: 7px; padding-bottom: 7px; }
html[data-accent="glass-blue"] .contact:hover { background: var(--glass-hover); border-color: var(--glass-line); }
html[data-accent="glass-blue"] .contact.selected { background: var(--glass-selected); border-color: var(--glass-line); box-shadow: inset 3px 0 0 var(--glass-accent); }
html[data-accent="glass-blue"] :is(.settings-card, .details-card, .call-card, .new-chat-card) {
  color: var(--glass-text);
  background: var(--glass-raised);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 24px 70px var(--glass-shadow);
}
html[data-accent="glass-blue"] :is(.profile-card, .composer, .bubble, .attachment-card, .search-box, .round-action, .details-button, .new-chat-contact) {
  color: var(--glass-text);
  background: var(--glass-surface);
  border-color: var(--glass-line);
}
html[data-accent="glass-blue"] .composer {
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 26px var(--glass-shadow);
}
html[data-accent="glass-blue"] .composer:focus-within { border-color: var(--glass-accent); box-shadow: 0 0 0 3px var(--glass-selected), inset 0 1px 0 rgba(255, 255, 255, .25); }
html[data-accent="glass-blue"] .mine .bubble {
  color: #fff;
  background: linear-gradient(135deg, #2876d1, #1858ad);
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 14px var(--glass-shadow);
}
html[data-accent="glass-blue"] :is(.primary-button, .settings-save, .send-button, .window-logo) {
  background: linear-gradient(135deg, #2876d1, #1858ad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 12px var(--glass-shadow);
}
html[data-accent="glass-blue"] :is(.primary-button, .settings-save, .send-button):hover {
  background: linear-gradient(135deg, #2168bf, #124994);
}
html[data-accent="glass-blue"] :is(.brand-name, .contact-name, .person-copy h1, .profile-copy strong, .attachment-card strong, .welcome-chat h2) { color: var(--glass-text); }
html[data-accent="glass-blue"] :is(.contact-preview, .contact-time, .profile-copy small, .person-copy p, .chat-date, .message-sender, .message-meta, .read-check, .composer-hint, .settings-feedback, .settings-field, .settings-navigation button, .section-label, .sidebar-footer, .welcome-chat, .settings-card > p, .details-description, .call-caption) { color: var(--glass-muted); }
html[data-accent="glass-blue"] .settings-note { color: var(--glass-muted) !important; }
html[data-accent="glass-blue"] .settings-navigation button[aria-pressed="true"] { color: var(--glass-text); }
html[data-accent="glass-blue"] :is(.settings-field input, .settings-field select, .new-contact-entry input) { color: var(--glass-text); background: var(--glass-raised); border-color: var(--glass-line); }
html[data-accent="glass-blue"] .call-control.end-call { background: #e4545b; color: #fff; }
html[data-accent="glass-blue"] .call-card .settings-save { background: #197b55; }

.settings-field { font-size: 12px; }
.settings-field input, .settings-field select { height: 42px; font-size: 13px; }
.settings-section-title { font-size: 11px; }
.settings-toggle { padding: 8px 0; }
.settings-toggle strong { font-size: 12px; }
.settings-toggle small { font-size: 11px; line-height: 1.5; }
.settings-note { font-size: 11px !important; }
.settings-card > p { font-size: 12px; }
.settings-save { height: 42px; font-size: 13px; }
.details-button { font-size: 12px; line-height: 1.5; }
.settings-content { scrollbar-gutter: stable; }
.conversation-list, .messages, .settings-content, .call-card { scrollbar-width: thin; scrollbar-color: #a5b6cd transparent; }
.profile-card:focus-visible, .contact:focus-visible { outline-offset: -3px; }
.icon-button.settings-button { width: 34px; height: 34px; border-radius: 50%; }
button:not(:disabled):active:not(.window-control) { filter: brightness(.95); }
.network-banner button:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
html[data-accent="glass-blue"] :is(.search-box input, .composer textarea, .composer-tool, .call-control, .icon-button, .sidebar-footer strong, .about-details dt) { color: var(--glass-text); }
html[data-accent="glass-blue"] :is(.search-box input, .composer textarea, .settings-field input)::placeholder { color: var(--glass-muted); opacity: 1; }
html[data-accent="glass-blue"] :is(.search-box kbd, .empty-search, .window-subtitle, .attachment-card small, .new-contact-form label, .new-chat-contact small, .new-chat-card > p, .settings-toggle small, .settings-section-title, .contact-list-label) { color: var(--glass-muted) !important; }
html[data-accent="glass-blue"] .settings-toggle { color: var(--glass-text); }
html[data-accent="glass-blue"] :is(.network-banner button, .file-download, .list-tab.active, .new-chat-icon, .privacy-icon, .attachment-icon, .call-eyebrow) { color: var(--glass-accent); }
html[data-accent="glass-blue"] .list-tab { color: var(--glass-muted); }
html[data-accent="glass-blue"] .list-tab.active { color: var(--glass-accent); border-color: var(--glass-accent); }
html[data-accent="glass-blue"] .server-addresses { color: var(--glass-accent) !important; background: var(--glass-selected); border: 1px solid var(--glass-line); }
html[data-accent="glass-blue"] :is(.round-action, .details-button, .new-chat-contact, .settings-navigation button, .profile-card):hover:not(:disabled) { background: var(--glass-hover); color: var(--glass-text); border-color: var(--glass-line); }
html[data-accent="glass-blue"] .settings-navigation button[aria-pressed="true"] { background: var(--glass-selected); color: var(--glass-text); }
html[data-accent="glass-blue"] .details-button.danger-button { color: var(--glass-danger); }
html[data-accent="glass-blue"] .details-button.danger-button:hover:not(:disabled) { color: var(--glass-danger); background: color-mix(in srgb, var(--glass-danger) 10%, transparent); }
html[data-accent="glass-blue"] :is(.form-error, .network-indicator:not(.connected)) { color: var(--glass-danger); }
html[data-accent="glass-blue"] .network-indicator.connected { color: #156248; }
html[data-accent="glass-blue"][data-theme="dark"] .network-indicator.connected { color: #8ce4c6; }
html[data-accent="glass-blue"] .network-indicator::before { content: ""; width: 7px; height: 7px; display: inline-block; margin-right: 8px; border-radius: 50%; background: currentColor; }
html[data-accent="glass-blue"] :is(.chat-date::before, .chat-date::after, .action-divider) { background: var(--glass-line); }
html[data-accent="glass-blue"] .call-control { background: var(--glass-surface); color: var(--glass-text); border: 1px solid var(--glass-line); }
html[data-accent="glass-blue"] .call-control.active { color: #fff; background: #a3314a; }
html[data-accent="glass-blue"] .call-control.end-call { color: #fff; background: #c23343; }
html[data-accent="glass-blue"] :is(.new-chat-icon, .privacy-icon, .attachment-icon) { background: var(--glass-selected); }
html[data-accent="glass-blue"] .call-close { color: var(--glass-text); background: var(--glass-selected); }
html[data-accent="glass-blue"] .window-control:hover { background: var(--glass-selected); }
html[data-accent="glass-blue"] .window-control.window-close:hover { background: #c42b35; color: #fff; }
html[data-accent="glass-blue"].desktop-app body { box-shadow: inset 0 0 0 1px var(--glass-line); }
html[data-accent="glass-blue"].desktop-app.window-maximized body { box-shadow: none; }
html[data-accent="glass-blue"] .call-avatar { box-shadow: 0 0 0 8px var(--glass-selected); }
html[data-accent="glass-blue"] :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--glass-accent); outline-offset: 2px; }
html[data-accent="glass-blue"] .toast { background: #12355b; border: 1px solid #799ec8; }
html[data-accent="glass-blue"] .empty-conversation { padding: 24px; background: var(--glass-surface); border: 1px solid var(--glass-line); border-radius: 24px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 35px var(--glass-shadow); color: var(--glass-muted); }
html[data-accent="glass-blue"] .empty-conversation h2 { color: var(--glass-text); }
html[data-accent="glass-blue"] .empty-conversation-icon { color: var(--glass-accent); background: var(--glass-selected); }
html[data-accent="glass-blue"] .round-action { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
html[data-accent="glass-blue"] .call-control:focus-visible { outline-offset: 3px; }
@media (max-width: 620px) {
  html, body { width: 100%; min-width: 0; overflow-x: hidden; }
  body { min-height: 100vh; min-height: 100dvh; }
  .app-shell { width: 100%; height: 100vh; height: 100dvh; min-height: 0; }
  .main-panel, .chat-person { min-width: 0; }
  .access-gate {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow-y: auto;
  }
  .access-gate-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 24px 20px;
    gap: 12px;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
  }
  .access-gate-card img { width: 52px; height: 52px; }
  .access-gate-field input { min-height: 46px; font-size: 16px; }
  .access-gate-field .access-password-toggle { min-width: 78px; }
  .access-gate-tab { min-height: 44px; }
  .access-gate-card .primary-button { min-height: 48px; }
  .network-banner { padding: 6px 12px; }
  .chat-header { gap: 8px; }
  .chat-header { padding-top: env(safe-area-inset-top); }
  .header-actions { gap: 4px; }
  .header-avatar { width: 32px; height: 32px; }
  .chat-person { gap: 6px; }
  .person-copy h1 { font-size: 13px; }
  .person-copy p { font-size: 10px; }
  .messages { padding: 10px 14px 18px; }
  .composer-area { padding: 8px 12px 12px; }
  .sidebar { width: min(310px, calc(100vw - 145px)); }
  .sidebar .brand-row { gap: 6px; padding: 0 10px; }
  .sidebar .brand-name { font-size: 16px; }
  .sidebar .search-box kbd { display: none; }
  .sidebar .list-tabs { gap: 12px; }
  .sidebar .list-tab { font-size: 11px; }
  .brand-mark { flex: 0 0 26px; }
  .composer-area { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .chat-header { padding-right: 7px; padding-left: 7px; gap: 5px; }
  .chat-person { gap: 5px; }
  .header-actions { gap: 2px; }
  .header-actions .round-action { width: 27px; height: 27px; }
  .person-copy h1 { font-size: 12px; }
}
@media (max-width: 1050px) {
  .radio-sidebar, .app-shell.radio-collapsed .radio-sidebar { position: absolute; z-index: 4; top: 0; right: 0; bottom: 0; width: min(320px, calc(100vw - 300px)); min-width: 270px; border-left: 1px solid var(--line); box-shadow: -14px 0 36px #17243a1f; transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .radio-sidebar.radio-open { transform: translateX(0); visibility: visible; }
  .radio-backdrop:not(.hidden) { position: absolute; z-index: 3; inset: 0; display: block; padding: 0; border: 0; background: #18223866; cursor: pointer; }
  html[data-theme="dark"] .radio-sidebar { background: #171e2b; }
}
@media (max-height: 480px) {
  .settings-card { padding: 12px 16px; }
  .settings-card > .new-chat-icon { display: none; }
  .settings-card > p { margin: 4px 0 8px; }
  .settings-navigation { padding-bottom: 6px; margin-bottom: 6px; }
  .settings-footer { padding-top: 8px; }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-accent="glass-blue"] { --glass-surface: #f2f8ff; --glass-raised: #f7fbff; }
  html[data-accent="glass-blue"][data-theme="dark"] { --glass-surface: #152d49; --glass-raised: #1b3150; }
  html[data-accent="glass-blue"] :is(.sidebar, .chat-header, .network-banner, .window-titlebar, .settings-card, .details-card, .call-card, .new-chat-card, .composer) { backdrop-filter: none; }
}
@media (forced-colors: active) {
  html[data-accent="glass-blue"] :is(.app-shell, .main-panel, .messages, .sidebar, .chat-header, .network-banner, .window-titlebar, .composer, .settings-card, .details-card, .call-card, .new-chat-card, .bubble) { background: Canvas; color: CanvasText; backdrop-filter: none; box-shadow: none; }
  html[data-accent="glass-blue"] :is(.primary-button, .settings-save, .send-button, .details-button, .round-action) { background: ButtonFace; color: ButtonText; border: 1px solid ButtonText; box-shadow: none; }
}
.support-report-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: 12px; }
.settings-content details > textarea { width: 100%; max-width: 100%; }
.desktop-saved-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.desktop-saved-file span { overflow-wrap: anywhere; }
.desktop-saved-file button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.file-transfer {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f8fd;
}
.file-transfer > div { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.file-transfer strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-transfer button { flex-shrink: 0; border-radius: 8px; padding: 6px 10px; }
.file-transfer progress { display: block; width: 100%; height: 8px; margin: 10px 0; accent-color: #3478ed; }
.file-transfer small { overflow-wrap: anywhere; }
html[data-theme="dark"] .file-transfer { background: #202b3b; }
.identity-details dd { overflow-wrap: anywhere; }
#identity-code { font-family: Consolas, monospace; letter-spacing: .5px; }
.identity-qr { margin: 16px 0; display: grid; justify-items: center; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.identity-qr canvas { display: block; max-width: 100%; height: auto; width: 231px; background: #fff; border-radius: 0; image-rendering: pixelated; }
.identity-qr figcaption { text-align: center; font-size: 12px; color: var(--muted); max-width: 300px; }
.contact-scanner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; min-width: 0; }
.contact-scanner select { width: 100%; min-width: 0; padding: 8px; }
.contact-scanner video { width: 100%; min-width: 0; max-width: 100%; max-height: 240px; background: #000; border-radius: 12px; object-fit: contain; }
#contact-scanner-controls { margin-bottom: 18px; }
.call-diagnostics { margin: 10px 0 16px; text-align: left; font-size: 12px; color: var(--muted); }
.call-diagnostics summary { cursor: pointer; }
.call-diagnostics p { line-height: 1.6; overflow-wrap: anywhere; }
.my-report-card {
  padding: 12px;
  margin-top: 12px;
  border: 1px solid var(--border, #dce3ed);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.my-report-card p { white-space: pre-wrap; }

.access-gate {
  padding: 20px;
  background:
    radial-gradient(ellipse at 18% 12%, #a8c6ff55, transparent 35%),
    radial-gradient(ellipse at 86% 82%, #c9b8ff4a, transparent 32%),
    linear-gradient(145deg, #eaf1ff, #f8faff 54%, #edf1fa);
}
.access-gate-card {
  width: min(100%, 452px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 28px 34px 24px;
  gap: 11px;
  border: 1px solid #e1e8f3;
  border-radius: 24px;
  background: linear-gradient(155deg, #fff, #fbfcff 76%);
  box-shadow: 0 30px 90px #23365a24, 0 3px 12px #23365a0a;
  scrollbar-width: thin;
  scrollbar-color: #bac7da transparent;
}
.access-gate-card img {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 7px 12px #3979e533);
}
.access-gate-card h1 {
  color: #1e2a40;
  font-size: 27px;
  letter-spacing: -.65px;
}
.access-gate-card > #access-gate-description {
  max-width: 34ch;
  color: #697790;
  font-size: 14px;
}
.access-gate-tabs {
  margin: 5px 0 3px;
  padding: 5px;
  border: 1px solid #e7ebf2;
  border-radius: 13px;
  background: #f2f5fa;
}
.access-gate-tab {
  min-height: 42px;
  border-radius: 9px;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.access-gate-tab.active {
  color: #215fca;
  background: #fff;
  box-shadow: 0 2px 8px #263a5b16;
}
.access-gate-field {
  gap: 7px;
  color: #33415a;
  font-size: 13px;
}
.access-gate-field input {
  min-height: 48px;
  padding: 11px 13px;
  border-color: #dbe3ef;
  border-radius: 11px;
  background: #fbfcfe;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.access-gate-field input:hover { border-color: #b8c9e4; }
.access-gate-field input:focus {
  border-color: #4b83e7;
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px #4b83e71a;
}
.access-password-control { gap: 8px; }
.access-gate-field .access-password-toggle {
  min-width: 86px;
  border-color: #dbe3ef;
  border-radius: 11px;
  background: #f3f6fb;
  transition: background .16s ease, border-color .16s ease;
}
.access-gate-field .access-password-toggle:hover,
.access-gate-card .access-install-button:hover {
  border-color: #afc4e5;
  background: #eaf1fc;
}
.access-password-help { margin-top: -3px; }
.access-gate-card .access-help-link {
  color: #2867cb;
  font-size: 13px;
  text-decoration: none;
}
.access-gate-card .access-help-link:hover { text-decoration: underline; }
.access-gate-card .access-gate-note {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6edf8;
  border-radius: 11px;
  background: #f6f9ff;
  color: #536683;
  font-size: 12px;
  text-align: left;
}
.access-gate-card .access-gate-install {
  max-width: 36ch;
  color: #748198;
  font-size: 12px;
}
.access-gate-card .access-install-button {
  min-height: 42px;
  padding: 0 16px;
  border-color: #cfdcf0;
  border-radius: 11px;
  background: #f5f8fe;
  color: #28599f;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.access-gate-card .access-install-button:hover { transform: translateY(-1px); }
.access-gate-card .access-server-status {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  background: #f5f7fb;
  color: #62718a;
  font-size: 12px;
}
.access-gate-card .access-form-status:not(:empty) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #f0c9cd;
  border-radius: 10px;
  background: #fff5f5;
  color: #a62c38;
  text-align: left;
}
.access-gate-card .primary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(110deg, #2767d5, #4385f3);
  box-shadow: 0 8px 18px #3478ed35;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.access-gate-card .primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px #3478ed42;
  filter: saturate(1.08);
}
.access-gate-card .primary-button:active:not(:disabled) { transform: translateY(0); }
.access-gate-card .access-gate-privacy {
  max-width: 42ch;
  padding-top: 4px;
  color: #8a95a7;
  font-size: 11px;
}
.access-gate-card :is(button, a, input):focus-visible {
  outline: 3px solid #4b83e7;
  outline-offset: 3px;
}
html[data-theme="dark"] .access-gate {
  background:
    radial-gradient(ellipse at 16% 12%, #3464ac2b, transparent 36%),
    radial-gradient(ellipse at 84% 82%, #67519a27, transparent 34%),
    linear-gradient(145deg, #101724, #182235 56%, #111927);
}
html[data-theme="dark"] .access-gate-card {
  border-color: #35435b;
  background: linear-gradient(155deg, #222d40, #1c2637 80%);
  box-shadow: 0 30px 90px #050a14a8, 0 2px 10px #080d174d;
}
html[data-theme="dark"] .access-gate-card h1 { color: #f1f5fc; }
html[data-theme="dark"] .access-gate-card > #access-gate-description { color: #b5c0d2; }
html[data-theme="dark"] .access-gate-tabs {
  border-color: #303b4e;
  background: #171f2d;
}
html[data-theme="dark"] .access-gate-tab.active {
  color: #c3d8ff;
  background: #303b4e;
  box-shadow: inset 0 0 0 1px #455671, 0 2px 8px #10172580;
}
html[data-theme="dark"] .access-gate-field { color: #e0e7f2; }
html[data-theme="dark"] .access-gate-field input {
  border-color: #46536a;
  background: #161f2e;
}
html[data-theme="dark"] .access-gate-field input:hover { border-color: #7389ad; }
html[data-theme="dark"] .access-gate-field input:focus {
  border-color: #76a7ff;
  background: #141d2b;
  box-shadow: 0 0 0 4px #76a7ff20;
}
html[data-theme="dark"] .access-gate-field .access-password-toggle {
  border-color: #46536a;
  background: #2a374b;
}
html[data-theme="dark"] .access-gate-field .access-password-toggle:hover,
html[data-theme="dark"] .access-gate-card .access-install-button:hover {
  border-color: #637fa9;
  background: #354560;
}
html[data-theme="dark"] .access-gate-card .access-gate-note {
  border-color: #34445d;
  background: #202c3f;
  color: #c4d0e2;
}
html[data-theme="dark"] .access-gate-card .access-server-status {
  background: #1a2434;
  color: #c0ccde;
}
html[data-theme="dark"] .access-gate-card .access-form-status:not(:empty) {
  border-color: #75464f;
  background: #3b2932;
  color: #ffc1c6;
}
html[data-theme="dark"] .access-gate-card .access-gate-privacy { color: #aab5c6; }
@media (max-height: 700px) and (min-width: 621px) {
  .access-gate-card { padding: 20px 30px 18px; gap: 8px; }
  .access-gate-card img { width: 46px; height: 46px; }
  .access-gate-card h1 { font-size: 24px; }
  .access-gate-tabs { margin: 2px 0; }
  .access-gate-tab { min-height: 38px; }
  .access-gate-field input { min-height: 44px; }
  .access-gate-card .primary-button { min-height: 46px; }
}
@media (max-width: 620px) {
  .access-gate { padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); }
  .access-gate-card {
    width: min(100%, 452px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 22px 20px 20px;
    gap: 10px;
    border-radius: 21px;
  }
  .access-gate-card img { width: 50px; height: 50px; }
  .access-gate-card h1 { font-size: 24px; }
  .access-gate-card .primary-button { min-height: 48px; }
}
@media (min-width: 621px) and (min-height: 701px) {
  .access-gate-card { padding: 22px 32px 18px; gap: 8px; }
  .access-gate-card img { width: 50px; height: 50px; }
  .access-gate-card h1 { font-size: 25px; }
  .access-gate-tabs { margin: 2px 0; }
  .access-gate-field input { min-height: 44px; }
  .access-gate-card .access-gate-install { font-size: 11px; line-height: 1.35; }
  .access-gate-card .primary-button { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .access-gate-card *, .access-gate-card *::before, .access-gate-card *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.access-gate {
  padding: 28px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 12% 12%, #a8c6ff4d, transparent 34%),
    radial-gradient(ellipse at 88% 88%, #c5b7ff42, transparent 33%),
    linear-gradient(145deg, #f2f6fd, #eaf0f9);
}
.access-gate-layout {
  width: min(100%, 960px);
  height: min(840px, calc(100vh - 48px));
  height: min(840px, calc(100dvh - 48px));
  min-height: min(700px, calc(100vh - 48px));
  min-height: min(700px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 34px 100px #20375b26, 0 4px 14px #20375b0d;
}
.access-brand-panel {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(ellipse at 84% 8%, #7faeff55, transparent 36%),
    radial-gradient(ellipse at 12% 94%, #7889ff40, transparent 34%),
    linear-gradient(150deg, #173568, #1d4f9c 54%, #2866b5);
}
.access-brand-panel::before,
.access-brand-panel::after {
  position: absolute;
  z-index: -1;
  width: 260px;
  height: 260px;
  border: 1px solid #ffffff16;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.access-brand-panel::before { right: -132px; bottom: 108px; }
.access-brand-panel::after { right: -92px; bottom: 148px; width: 180px; height: 180px; }
.access-brand-lockup { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.access-brand-lockup img { width: 44px; height: 44px; object-fit: contain; }
.access-panel-toggle { min-height: 34px; padding: 0 10px; border: 1px solid #ffffff55; border-radius: 9px; color: #fff; background: #ffffff12; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.access-panel-toggle:hover { border-color: #ffffffaa; background: #ffffff24; }
.access-panel-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.access-brand-lockup .access-panel-toggle { margin-left: auto; }
.access-gate-card .access-panel-show { width: fit-content; color: #315b94; border-color: #cbd7e8; background: #f6f8fc; }
.access-gate-card .access-panel-show:hover { border-color: #a9bfdf; background: #edf3fc; }
.access-brand-content { max-width: 360px; padding: 32px 0; }
.access-brand-kicker { margin: 0 0 18px; color: #c4d8ff; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; }
.access-brand-content h2 { margin: 0 0 14px; font-size: clamp(34px, 4vw, 46px); line-height: 1.08; letter-spacing: -1.6px; }
.access-brand-content > p:last-child { max-width: 32ch; margin: 0; color: #e0eaff; font-size: 15px; line-height: 1.75; }
.access-downloads { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-self: center; gap: 9px; }
.access-downloads h3 { margin: 0; color: #fff; font-size: 16px; letter-spacing: -.2px; }
.access-downloads > p { margin: 0; color: #d6e5ff; font-size: 12px; line-height: 1.5; }
.access-downloads .access-install-button { width: 100%; min-height: 42px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #ffffff55; border-radius: 11px; color: #fff; background: #ffffff12; font-size: 12px; font-weight: 650; text-align: center; text-decoration: none; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.access-downloads .access-install-button:hover { transform: translateY(-1px); border-color: #ffffffaa; background: #ffffff24; }
.access-downloads .access-install-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.access-downloads .access-gate-install { color: #d6e5ff; font-size: 11px; line-height: 1.45; }
.access-downloads .access-app-version { align-self: flex-end; margin: -7px 2px 0; color: #d6e5ff; font-size: 10px; line-height: 1.3; }
.access-downloads .access-app-version + .access-app-version { margin-top: -6px; }
.access-brand-footer { margin: 0; color: #d1e0fb; font-size: 12px; }
.access-gate-card {
  width: auto;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  padding: 40px clamp(34px, 5vw, 58px);
  gap: 12px;
  align-items: stretch;
  border: 0;
  border-left: 1px solid #edf0f5;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  text-align: left;
}
.access-gate-card > img { display: none; }
.access-gate-card .access-form-eyebrow {
  margin: 0 0 -6px;
  color: #3471cf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
}
.access-gate-card h1 { font-size: 28px; letter-spacing: -.7px; }
.access-gate-card > #access-gate-description { max-width: none; margin-bottom: 3px; text-align: left; }
.access-gate-card .access-gate-tabs { margin: 7px 0 3px; }
.access-gate-card .access-gate-note { line-height: 1.5; }
.access-gate-card .access-server-status { line-height: 1.5; }
.access-gate-card .access-gate-privacy { align-self: center; text-align: center; }
.access-gate-card .access-install-button { width: 100%; }
.access-gate-layout.panel-hidden { grid-template-columns: minmax(0, 1fr); }
.access-gate-layout.panel-hidden .access-brand-panel { display: none; }
.access-gate-layout.panel-hidden .access-gate-card { width: min(100%, 620px); justify-self: center; border-left: 0; }
html[data-theme="dark"] .access-gate {
  background:
    radial-gradient(ellipse at 12% 12%, #3464ac30, transparent 35%),
    radial-gradient(ellipse at 88% 88%, #67519a29, transparent 34%),
    linear-gradient(145deg, #101724, #182235 56%, #111927);
}
html[data-theme="dark"] .access-gate-layout {
  border-color: #35435b;
  background: #1c2637;
  box-shadow: 0 34px 100px #050a14a8, 0 4px 14px #080d174d;
}
html[data-theme="dark"] .access-gate-card { border-left-color: #303b4e; background: #1c2637; }
html[data-theme="dark"] .access-gate-card .access-form-eyebrow { color: #9fc3ff; }
html[data-theme="dark"] .access-gate-card .access-panel-show { border-color: #52627a; color: #d5e4ff; background: #303b4e; }
html[data-theme="dark"] .access-gate-card .access-panel-show:hover { border-color: #7589a7; background: #39475e; }
@media (max-width: 820px) {
  .access-gate { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .access-gate-layout {
    width: min(100%, 460px);
    height: auto;
    min-height: 0;
    max-height: calc(100vh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    overflow-y: auto;
    border-radius: 24px;
  }
  .access-brand-panel { min-height: 0; padding: 18px 22px; gap: 12px; overflow: visible; }
  .access-brand-lockup img { width: 36px; height: 36px; }
  .access-brand-content { display: none; }
  .access-brand-content h2 { margin-bottom: 6px; font-size: 25px; letter-spacing: -.5px; }
  .access-brand-content > p:last-child { max-width: none; font-size: 12px; line-height: 1.5; }
  .access-brand-kicker { margin-bottom: 8px; font-size: 9px; }
  .access-downloads { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .access-downloads h3, .access-downloads > p { grid-column: 1 / -1; }
  .access-downloads h3 { font-size: 14px; }
  .access-downloads .access-install-button { min-height: 40px; padding: 0 7px; font-size: 11px; }
  .access-downloads .access-gate-install { grid-column: 1 / -1; }
  .access-brand-footer { display: none; }
  .access-gate-card {
    width: 100%;
    max-height: none;
    padding: 28px 26px 24px;
    gap: 8px;
    border: 0;
    border-radius: inherit;
    text-align: center;
    overflow: visible;
  }
  .access-gate-layout.panel-hidden .access-gate-card { width: 100%; }
  .access-brand-lockup .access-panel-toggle { min-height: 32px; padding: 0 8px; font-size: 10px; }
  .access-gate-card > img {
    display: block;
    width: 48px;
    height: 48px;
    align-self: center;
  }
  .access-gate-card .access-gate-field input { min-height: 44px; }
  .access-gate-card .access-form-eyebrow { display: none; }
  .access-gate-card > #access-gate-description { text-align: center; }
}
@media (max-width: 420px) {
  .access-brand-panel { padding: 14px 16px; }
  .access-brand-lockup { font-size: 15px; }
  .access-brand-content h2 { font-size: 22px; }
  .access-gate-card { padding: 20px 18px 16px; }
}
@media (max-height: 700px) and (min-width: 821px) {
  .access-gate { padding: 12px; }
  .access-gate-layout { height: calc(100dvh - 24px); min-height: 0; }
  .access-brand-panel { padding: 30px; }
  .access-gate-card { padding: 28px 38px; gap: 9px; }
  .access-gate-card h1 { font-size: 25px; }
}

:root { --chat-surface: #ffffff; --chat-canvas: #f5f6f7; --chat-text: #23272c; --chat-border: #e2e5e8; --chat-soft: #eef1f3; --chat-muted: #66717b; }
html[data-theme="dark"] { --chat-surface: #22262b; --chat-canvas: #191c20; --chat-text: #eef0f2; --chat-border: #363c43; --chat-soft: #2b3036; --chat-muted: #abb4be; color-scheme: dark; }
.app-shell, .access-gate { font-family: "DM Sans", "Segoe UI", sans-serif; color: var(--chat-text); }
.app-shell *, .access-gate * { letter-spacing: 0; }
.app-shell { --muted: var(--chat-muted); --line: var(--chat-border); background: var(--chat-surface); }
html .app-shell .main-panel { min-width: 0; min-height: 0; background: var(--chat-canvas); }
html .app-shell .sidebar, html .app-shell .radio-sidebar { background: var(--chat-surface); border-color: var(--chat-border); }
.app-shell .brand-name, .app-shell .person-copy h1 { color: var(--chat-text); }
html .app-shell .chat-header { height: 76px; flex-basis: 76px; padding: 0 24px; background: var(--chat-surface); }
.person-copy { min-width: 0; }
.person-copy h1 { font-size: 17px; line-height: 1.3; }
.person-copy p { font-size: 12px; color: var(--chat-muted); }
.header-actions { gap: 6px; }
.app-shell .round-action { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--chat-muted); }
.app-shell .round-action:hover { background: var(--chat-soft); color: var(--chat-text); border-color: var(--chat-border); }
.app-shell button:focus-visible, .app-shell input:focus-visible, .app-shell select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.network-banner { min-height: 36px; padding: 4px 24px; background: var(--chat-surface); border-color: var(--chat-border); font-size: 11px; }
.network-indicator.connected { color: #258269; }
.android-notification-prompt { background: var(--chat-surface); color: var(--chat-text); }
.android-notification-prompt > span { min-width: 0; overflow-wrap: anywhere; }
.android-notification-prompt button { min-height: 40px; border: 1px solid var(--chat-border); border-radius: 8px; font-size: 12px; font-weight: 600; }
html[data-theme="dark"] .network-indicator.connected { color: #70d0ab; }
.messages { padding: 20px 6% 24px; scrollbar-width: thin; scrollbar-color: var(--chat-border) transparent; }
.message-content { min-width: 0; max-width: min(560px, 100%); }
html .app-shell .bubble { border: 1px solid var(--chat-border); border-radius: 8px; color: var(--chat-text); background: var(--chat-surface); padding: 11px 14px; line-height: 1.6; }
html .app-shell .mine .bubble { border-color: color-mix(in srgb, var(--blue) 22%, var(--chat-border)); color: var(--chat-text); background: color-mix(in srgb, var(--blue) 12%, var(--chat-surface)); }
.message-meta { gap: 8px; margin-top: 6px; color: var(--chat-muted); font-size: 10px; flex-wrap: wrap; }
.message-unavailable { font-size: 11px; padding: 5px 8px; opacity: .8; }
html .app-shell .voice-message { width: 320px; max-width: 100%; margin-bottom: 0; padding: 14px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); color: var(--chat-text); }
html .app-shell .mine .voice-message { background: color-mix(in srgb, var(--blue) 9%, var(--chat-surface)); border-color: color-mix(in srgb, var(--blue) 22%, var(--chat-border)); }
html .app-shell .voice-message-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--chat-soft); color: var(--blue); }
.voice-message-copy { gap: 7px; }
.voice-message-copy strong { font-size: 13px; }
.voice-message-copy audio { display: block; width: 100%; max-width: 100%; height: 40px; }
.voice-message-load { min-height: 40px; padding: 7px 14px; border-color: var(--chat-border); border-radius: 8px; font-size: 12px; font-weight: 600; }
.voice-message-load:hover { background: var(--chat-soft); }
html .app-shell .voice-message { width: 340px; max-width: 100%; padding: 12px; gap: 10px; align-items: flex-start; }
html .app-shell .voice-message-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 6px; }
.voice-message-copy { flex: 1; min-width: 0; gap: 10px; }
.voice-message-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.voice-message-heading strong { font-size: 13px; font-weight: 600; }
.voice-message-heading small { flex-shrink: 0; color: var(--chat-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.voice-message-copy .voice-message-load { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; min-height: 44px; padding: 0 10px; color: var(--chat-text); background: var(--chat-soft); border: 1px solid var(--chat-border); border-radius: 6px; font-size: 12px; }
.voice-message-copy .voice-message-load:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.voice-message-copy .voice-message-load[aria-busy="true"] { cursor: progress; }
.voice-message-copy audio { height: 44px; border-radius: 6px; color-scheme: light; }
html[data-theme="dark"] .voice-message-copy audio { color-scheme: dark; }
.app-shell .attachment-card { border-radius: 8px; background: var(--chat-surface); border-color: var(--chat-border); }
.composer-area { padding: 10px 6% 16px; background: var(--chat-canvas); }
.app-shell .composer { min-height: 58px; padding: 7px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); box-shadow: 0 3px 12px #00000005; }
.app-shell .composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 12%, transparent); }
.composer textarea { color: var(--chat-text); font-size: 14px; }
.composer-tool { width: 40px; height: 40px; color: var(--chat-muted); border-radius: 8px; }
.composer-tool:hover { color: var(--chat-text); background: var(--chat-soft); }
.send-button { width: 42px; height: 42px; border-radius: 8px; }
.composer-hint { margin-top: 7px; color: var(--chat-muted); }
.app-shell .contact { border-radius: 8px; }
.app-shell .contact.selected { background: color-mix(in srgb, var(--blue) 10%, var(--chat-surface)); }
.app-shell .contact:hover { background: var(--chat-soft); }
.settings-modal { border-radius: 8px; }
.access-gate, html[data-theme="dark"] .access-gate { background: var(--chat-canvas); }
.access-gate-layout, html[data-theme="dark"] .access-gate-layout { border-color: var(--chat-border); border-radius: 8px; background: var(--chat-surface); box-shadow: 0 12px 48px #00000014; }
.access-brand-panel { background: #244c44; }
.access-brand-panel::before, .access-brand-panel::after { display: none; }
.access-brand-content h2 { font-size: 30px; line-height: 1.2; }
.access-brand-content p, .access-downloads > p, .access-brand-footer { color: #d4e5df; }
.access-gate-card, html[data-theme="dark"] .access-gate-card { background: var(--chat-surface); border-color: var(--chat-border); }
.access-gate-card h1 { font-size: 26px; color: var(--chat-text); }
.access-gate-tabs { border-radius: 8px; }
.access-downloads .access-install-button { border-radius: 8px; }
@media (max-width: 600px) {
  body { min-width: 320px; }
  html .app-shell .chat-header { height: auto; min-height: 116px; flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 14px; }
  .chat-person { width: 100%; min-width: 0; }
  .header-actions { width: 100%; justify-content: flex-end; gap: 6px; }
  .app-shell .round-action { width: 40px; height: 40px; flex-basis: 40px; }
  .person-copy h1 { font-size: 16px; }
  .person-copy p { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .network-banner { padding: 4px 14px; gap: 6px; min-height: 34px; }
  .network-banner button { font-size: 11px; }
  .messages { padding: 14px 12px 18px; }
  .message-content { max-width: calc(100vw - 64px); }
  .message-row.mine .message-content { max-width: calc(100vw - 32px); }
  .composer-area { padding: 8px 12px max(12px, env(safe-area-inset-bottom)); }
  .composer { gap: 2px; }
  .composer-tool { width: 36px; }
  .composer-hint { display: none; }
  .voice-message-copy audio { height: 44px; }
  .access-gate-layout { border-radius: 8px; }
  .access-gate-card { padding: 24px 20px; }
  .access-brand-content h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell *, .access-gate * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

dialog.contact-action-dialog,
dialog.call-preflight-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); color: var(--chat-text); overflow-y: auto; }
.call-preflight-dialog::backdrop { background: #00000066; }
.call-preflight-dialog h2 { margin: 0 0 12px; font-size: 18px; overflow-wrap: anywhere; }
.call-preflight-dialog video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #202020; border-radius: 4px; transform: scaleX(-1); }
.call-preflight-dialog meter { width: 100%; height: 12px; }
.call-device-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; font-size: 13px; }
.call-device-field[hidden] { display: none; }
.call-device-field select { min-width: 0; max-width: 65%; padding: 6px; border: 1px solid var(--chat-border); border-radius: 4px; background: var(--chat-surface); color: var(--chat-text); }
.call-preflight-dialog > button { min-height: 40px; margin-right: 8px; }
.call-card.video-call-expanded { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; overflow-y: auto; }
.video-call-expanded .call-avatar { display: none; }
.video-call-expanded .call-video-stage { aspect-ratio: 16 / 9; width: 100%; margin-bottom: 12px; background: #202020; }
.video-call-expanded #remote-video { width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 4px; }
.video-call-expanded #local-video { position: absolute; bottom: 10px; right: 10px; width: 22%; max-height: 30%; margin: 0; border-radius: 4px; object-fit: contain; }
.call-quality-status { margin: 8px 0; font-size: 12px; color: var(--chat-muted); }
.call-controls { flex-wrap: wrap; gap: 10px; }
.call-control { flex-shrink: 0; }
.call-card:fullscreen { width: 100%; height: 100%; max-height: none; border-radius: 0; display: flex; flex-direction: column; background: var(--chat-surface); overflow-y: auto; }
.call-card:fullscreen .call-video-stage { flex: 1; min-height: 180px; }
.call-card:fullscreen #remote-video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
dialog.contact-action-dialog,
dialog.video-message-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); color: var(--chat-text); overflow-y: auto; }
dialog.contact-action-dialog { width: min(320px, calc(100vw - 32px)); }
dialog.contact-action-dialog::backdrop,
dialog.video-message-dialog::backdrop { background: #00000066; }
.contact-action-dialog h2, .video-message-dialog h2 { margin: 0 0 16px; font-size: 18px; overflow-wrap: anywhere; }
.contact-action-list { display: grid; gap: 8px; }
.contact-action-list button { text-align: left; min-height: 40px; }
.video-message-dialog video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #202020; border-radius: 4px; }
.video-message-dialog p { font-size: 13px; overflow-wrap: anywhere; }
.video-message-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.video-message-controls button { min-height: 40px; }
.video-message-player { display: block; width: 100%; max-width: 360px; aspect-ratio: 4 / 3; background: #202020; border-radius: 4px; }
.chat-image-attachment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; width: min(360px, 100%); max-width: 100%; padding: 8px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); }
.chat-image-attachment > span { grid-column: 1 / -1; min-width: 0; padding: 2px 2px 0; color: var(--chat-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-image-attachment .chat-attachment-image { display: block; grid-column: 1 / -1; width: 100%; height: auto; max-height: 360px; object-fit: contain; border-radius: 4px; background: var(--chat-soft); }
.chat-image-attachment .chat-attachment-image.hidden { display: none; }
.chat-image-attachment .image-preview-load { grid-column: 1 / -1; min-height: 100px; justify-self: stretch; border: 1px dashed var(--chat-border); background: var(--chat-soft); color: var(--chat-muted); font-size: 12px; }
.chat-image-attachment .file-download, .chat-image-attachment .image-open { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; width: 100%; height: 38px; margin: 0; padding: 0 8px; border: 1px solid var(--chat-border); border-radius: 4px; color: var(--chat-text); background: var(--chat-surface); font-size: 12px; font-weight: 600; cursor: pointer; }
.chat-image-attachment .image-open { background: var(--chat-soft); }
.chat-image-attachment .file-download, .chat-image-attachment .image-open { text-decoration: none; }
.chat-image-attachment .file-download:hover, .chat-image-attachment .image-open:hover { color: var(--blue); border-color: var(--blue); }
.chat-image-attachment .file-download:focus-visible, .chat-image-attachment .image-open:focus-visible, .chat-attachment-image:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chat-attachment-image[role="button"] { cursor: zoom-in; }
.chat-image-viewer { width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 12px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); color: var(--chat-text); overflow: auto; }
.chat-image-viewer::backdrop { background: #000000b3; }
.chat-image-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chat-image-viewer-header h2 { min-width: 0; margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-image-viewer-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--chat-border); border-radius: 4px; background: var(--chat-soft); color: var(--chat-text); cursor: pointer; }
.chat-image-viewer-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chat-image-viewer-image { display: block; width: 100%; height: auto; max-height: calc(100dvh - 110px); object-fit: contain; border-radius: 4px; }
.chat-image-viewer-image[hidden] { display: none; }
.chat-image-viewer p { margin: 20px 0; color: var(--chat-muted); font-size: 13px; }
.app-shell .contact { min-height: 82px; padding: 12px; gap: 12px; border: 1px solid transparent; }
.app-shell .contact.selected { border-color: color-mix(in srgb, var(--blue) 38%, var(--chat-border)); box-shadow: inset 3px 0 var(--blue); }
.contact-copy { min-width: 0; flex: 1; }
.contact-top { align-items: baseline; gap: 8px; }
.contact-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.contact-time { flex-shrink: 0; font-size: 11px; color: var(--chat-muted); font-variant-numeric: tabular-nums; }
.contact-presence { display: block; margin: 2px 0 4px; font-size: 11px; color: var(--chat-muted); }
.contact-presence-online { color: #188456; }
html[data-theme="dark"] .contact-presence-online { color: #74d6aa; }
.contact-presence-busy { color: #c14d56; }
.contact-preview { font-size: 12px; line-height: 1.4; }
.contact-unread { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px; border-radius: 6px; font-size: 11px; font-variant-numeric: tabular-nums; }
.app-shell .contact-remove { width: 32px; height: 32px; border-radius: 4px; }
.messages .bubble { padding: 11px 14px; line-height: 1.5; border-radius: 8px; }
.message-meta { font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.message-encryption { font-size: 10px; opacity: .75; }
.message-actions { gap: 8px; margin-top: 8px; }
.message-actions button, .message-actions summary { font-size: 11px; }
.app-shell .attachment-card { padding: 12px; gap: 12px; border: 1px solid var(--chat-border); border-radius: 8px; }
.attachment-card > span:last-child { min-width: 0; }
.attachment-card strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.attachment-card small { display: block; margin-top: 4px; font-size: 11px; color: var(--chat-muted); }
.attachment-card .file-download, .voice-message-load, .video-message-play { min-height: 38px; padding: 8px 12px; border: 1px solid var(--chat-border); border-radius: 4px; background: var(--chat-soft); color: var(--chat-text); font-size: 12px; text-decoration: none; }
.video-message-player { margin-top: 8px; border: 1px solid var(--chat-border); }
.app-shell .attachment-card.video-message-card { display: grid; grid-template-columns: minmax(0, 1fr); width: min(360px, 100%); max-width: 100%; padding: 8px; gap: 8px; }
.video-message-card > .attachment-icon { display: none; }
.video-message-card .video-message-player { width: 100%; max-width: 100%; margin: 0; aspect-ratio: 4 / 3; object-fit: contain; border: 0; border-radius: 4px; background: #171717; }
.video-message-card .video-message-status { margin: 0; padding: 0 2px; font-size: 12px; line-height: 1.4; color: var(--chat-muted); overflow-wrap: anywhere; }
.video-message-card > span:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.video-message-card strong { width: 100%; font-size: 11px; font-weight: 400; color: var(--chat-muted); }
.video-message-card small { display: none; }
.video-message-card .file-download, .video-message-card .video-message-play { min-height: 38px; margin: 0; }
.video-message-card .video-message-play[hidden] { display: none; }
.app-shell .attachment-card.document-preview-card { display: grid; grid-template-columns: minmax(0, 1fr); width: min(420px, 100%); max-width: 100%; padding: 10px; gap: 8px; }
.document-preview-card > .attachment-icon { display: none; }
.document-preview-area { width: 100%; min-height: 80px; max-height: 460px; overflow: auto; border: 1px solid var(--chat-border); border-radius: 4px; background: #fff; color: #202020; }
.document-preview-page { display: block; width: 100%; height: auto; }
.document-preview-text { margin: 0; padding: 12px; font: 12px/1.6 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-preview-status { margin: 0; font-size: 11px; line-height: 1.5; color: var(--chat-muted); overflow-wrap: anywhere; }
.document-preview-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.document-preview-controls:empty { display: none; }
.document-preview-card > span:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.document-preview-card strong { flex-basis: 100%; }
.document-preview-card small { display: none; }
.document-preview-card button { min-height: 36px; margin: 0; }
.document-preview-card button[hidden] { display: none; }
.app-shell .attachment-card .attachment-save-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; margin: 8px 0 0; padding: 0; border: 1px solid var(--chat-border); border-radius: 6px; color: var(--chat-text); background: var(--chat-soft); text-decoration: none; cursor: pointer; }
.app-shell .attachment-card .attachment-save-icon:hover { color: var(--blue); border-color: var(--blue); }
.app-shell .attachment-card .attachment-save-icon:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.video-message-card .attachment-save-icon, .document-preview-card .attachment-save-icon { justify-self: end; margin-left: auto; }
.call-diagnostics { margin: 8px 0; font-size: 11px; color: var(--chat-muted); text-align: left; }
.call-diagnostics summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.call-controls { padding-top: 10px; border-top: 1px solid var(--chat-border); }
.call-control { width: 44px; height: 44px; border-radius: 6px; }
.call-control:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.call-quality-status { min-height: 18px; }
.network-indicator { min-width: 0; overflow-wrap: anywhere; }
.network-banner { align-items: center; }
.network-banner button { flex-shrink: 0; min-height: 30px; }
.composer-status, .settings-feedback { line-height: 1.5; overflow-wrap: anywhere; }
.action-icon { flex-shrink: 0; stroke-width: 1.7; }
.attachment-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 6px; background: var(--chat-soft); color: var(--blue); }
.search-box > span { display: flex; align-items: center; }
.composer-status, #file-transfer-status, #account-status { min-height: 18px; }
.emotion-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 4px 0 0 auto; border: 1px solid var(--chat-border); border-radius: 4px; color: var(--chat-muted); background: var(--chat-surface); }
.emotion-toggle[aria-pressed="true"] { color: var(--blue); background: var(--chat-soft); }
.emotion-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.message-actions { flex-wrap: wrap; }
.message-actions[hidden] { display: none !important; }
.typing-indicator { display: flex; align-items: center; gap: 8px; min-height: 26px; margin: 0 0 8px; padding: 4px 8px; color: var(--chat-muted); font-size: 12px; }
.typing-indicator.hidden { display: none; }
.typing-dots { display: inline-flex; align-items: center; gap: 3px; width: 30px; height: 18px; padding: 0 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: typing-pulse 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
.header-typing-indicator { display: block; color: var(--blue); font-size: 11px; line-height: 1.4; }
.header-typing-indicator.hidden { display: none; }
@keyframes typing-pulse { 0%, 60%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .8; } }
.message-delete-action { color: #b34550; }
html[data-theme="dark"] .message-delete-action { color: #f29ba5; }
.mobile-action-label, .header-actions .mobile-actions-button { display: none; }
.radio-panel-close { display: none; }
@media (max-width: 1050px) {
  .radio-panel-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; background: var(--chat-soft); color: var(--chat-text); cursor: pointer; }
  .radio-heading-copy { min-width: 0; }
}
.mobile-action-menu { width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--chat-border); border-radius: 8px; color: var(--chat-text); background: var(--chat-surface); overflow-y: auto; }
.mobile-action-menu::backdrop { background: #00000066; }
.mobile-action-menu h2 { margin: 0 44px 16px 0; font-size: 18px; }
.mobile-action-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 4px; color: var(--chat-text); background: var(--chat-soft); cursor: pointer; }
.mobile-action-list { display: grid; gap: 6px; }
.mobile-action-list .round-action { display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: auto; min-height: 44px; padding: 10px 12px; border-radius: 4px; color: var(--chat-text); background: var(--chat-soft); text-align: left; }
.mobile-action-list .round-action.hidden { display: none; }
.mobile-action-list .mobile-action-label { display: block; font-size: 13px; overflow-wrap: anywhere; }
#new-chat-button { display: flex; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 600px) {
  html .app-shell .chat-header { min-height: 72px; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }
  .header-actions { width: auto; gap: 4px; }
  .header-actions .mobile-actions-button { display: grid; }
  .header-actions .action-divider { display: none; }
  .app-shell .header-actions .round-action { width: 40px; height: 40px; flex-basis: 40px; }
  .chat-person { gap: 6px; }
  .chat-person .header-avatar { display: none; }
  .person-copy { min-width: 0; }
  .person-copy h1 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .person-copy p { font-size: 11px; }
  .message-meta { gap: 6px; }
  .composer-area { padding: 8px; }
  .composer-tool { width: 40px; height: 44px; flex-shrink: 0; }
}
dialog.contact-action-dialog { width: min(360px, calc(100vw - 32px)); padding: 16px; }
.contact-action-header { display: flex; align-items: center; gap: 12px; padding: 0 4px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--chat-border); }
.contact-action-header h2 { margin: 0; font-size: 16px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.contact-action-avatar { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 6px; background: var(--chat-soft); color: var(--blue); font-size: 16px; font-weight: 600; }
.contact-action-list { gap: 4px; }
.message-context-menu { width: min(320px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--chat-border); border-radius: 8px; color: var(--chat-text); background: var(--chat-surface); }
.message-context-menu::backdrop { background: #00000066; }
.message-context-menu h2 { margin: 6px 10px 12px; font-size: 15px; font-weight: 600; }
.message-context-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px; border: 0; border-radius: 4px; background: transparent; color: var(--chat-text); font-size: 13px; text-align: left; cursor: pointer; }
.message-context-action:hover { background: var(--chat-soft); }
.message-context-reactions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.message-context-reactions[hidden] { display: none; }
.message-context-reactions button { width: 40px; height: 40px; padding: 0; border: 1px solid var(--chat-border); border-radius: 6px; color: var(--chat-text); background: var(--chat-soft); font-size: 20px; cursor: pointer; }
.message-context-reactions button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.message-quick-reactions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 8px 10px; }
.message-quick-reaction { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px; border: 1px solid var(--chat-border); border-radius: 6px; background: var(--chat-soft); color: var(--chat-text); font-size: 12px; cursor: pointer; }
.quick-reaction-symbol { font-size: 22px; line-height: 1; flex-shrink: 0; }
.message-quick-reaction:hover { border-color: var(--blue); }
.message-quick-reaction[aria-pressed="true"], .message-context-reactions button[aria-pressed="true"] { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--chat-surface)); }
.message-quick-reaction:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.message-quick-reaction:disabled { cursor: not-allowed; }
.message-context-menu a.message-context-action { box-sizing: border-box; text-decoration: none; }
.message-context-action:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.message-context-action.danger { color: #b34550; }
html[data-theme="dark"] .message-context-action.danger { color: #f29ba5; }
.contact-action-list .details-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 8px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--chat-text); font-size: 14px; }
.contact-action-list .details-button:hover { background: var(--chat-soft); border-color: var(--chat-border); }
.contact-action-list .details-button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.contact-action-symbol { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; color: var(--blue); }
.contact-action-list [data-contact-action="cancel"] { border-top: 1px solid var(--chat-border); margin-top: 8px; color: var(--chat-muted); }
.contact-action-list [data-contact-action="cancel"] .contact-action-symbol { color: var(--chat-muted); }
.app-shell .composer { display: grid; grid-template-columns: repeat(4, 44px) minmax(0, 1fr) 44px; align-items: center; padding: 10px; gap: 6px; border: 1px solid var(--chat-border); border-radius: 8px; background: var(--chat-surface); box-shadow: 0 2px 8px #00000006; }
.app-shell .composer textarea { grid-column: 1 / -1; grid-row: 1; width: 100%; min-width: 0; min-height: 60px; padding: 10px 8px 14px; line-height: 1.6; font-size: 14px; border-bottom: 1px solid var(--chat-border); background: transparent; }
.app-shell .composer textarea::placeholder { color: var(--chat-muted); opacity: 1; }
.app-shell .composer-tool { grid-row: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--chat-muted); background: transparent; }
.app-shell .composer-tool:hover { border-color: var(--chat-border); color: var(--chat-text); background: var(--chat-soft); }
.app-shell .send-button { grid-column: 6; grid-row: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; border-radius: 6px; color: #fff; background: var(--blue); }
.app-shell .send-button:hover:not(:disabled) { filter: brightness(.94); }
.app-shell .send-button:disabled { opacity: 1; color: var(--chat-muted); background: var(--chat-soft); cursor: not-allowed; }
.app-shell .composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 12%, transparent); }
.composer-footer { gap: 12px; padding: 4px 2px 0; font-size: 11px; }
.app-shell .composer-tool:focus-visible, .app-shell .send-button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (max-width: 600px) {
  .app-shell .composer { grid-template-columns: repeat(4, 44px) minmax(0, 1fr) 44px; gap: 2px; padding: 8px; }
  .app-shell .composer textarea { min-height: 56px; padding: 8px 4px 12px; }
  .app-shell .composer-tool { grid-row: 2; }
  .app-shell .send-button { grid-column: 6; grid-row: 2; }
}
html.desktop-app,
html.desktop-app body,
html.desktop-app .access-gate,
html.desktop-app .access-gate * { font-family: "Segoe UI Variable", "Segoe UI", sans-serif; }
html.desktop-app .access-gate { --desktop-background: #f3f3f3; --desktop-field: #ffffff; --desktop-line: #d1d1d1; --desktop-text: #242424; --desktop-muted: #616161; --desktop-accent: #0067c0; padding: 0; color: var(--desktop-text); background: var(--desktop-background); }
html[data-theme="dark"].desktop-app .access-gate { --desktop-background: #202020; --desktop-field: #2d2d2d; --desktop-line: #454545; --desktop-text: #f5f5f5; --desktop-muted: #bdbdbd; --desktop-accent: #60cdff; }
html.desktop-app .access-gate-layout,
html.desktop-app .access-gate-layout.panel-hidden { display: block; width: 100%; height: 100%; max-height: none; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--desktop-background); }
html.desktop-app .access-brand-panel,
html.desktop-app .access-panel-show,
html.desktop-app .access-form-eyebrow { display: none; }
html.desktop-app .access-gate-card,
html.desktop-app .access-gate-layout.panel-hidden .access-gate-card { width: 100%; height: 100%; max-height: none; min-height: 0; padding: 32px max(24px, calc((100% - 420px) / 2)); border: 0; border-radius: 0; background: var(--desktop-background); overflow-y: auto; justify-content: center; align-items: stretch; gap: 12px; }
html.desktop-app .access-gate-card > img { display: block; width: 56px; height: 56px; align-self: center; margin-bottom: 4px; }
html.desktop-app .access-gate-card h1 { color: var(--desktop-text); font-size: 24px; font-weight: 600; text-align: center; }
html.desktop-app .access-gate-card > p { color: var(--desktop-muted); }
html.desktop-app .access-gate-card > #access-gate-description { font-size: 13px; text-align: center; }
html.desktop-app .access-gate-tabs { display: flex; justify-content: center; gap: 24px; padding: 0; margin: 4px 0 8px; border-radius: 0; background: transparent; }
html.desktop-app .access-gate-tab { position: relative; min-height: 36px; padding: 0 4px; border-radius: 0; color: var(--desktop-muted); background: transparent; box-shadow: none; font-size: 14px; font-weight: 400; }
html.desktop-app .access-gate-tab.active { color: var(--desktop-text); background: transparent; box-shadow: none; font-weight: 600; }
html.desktop-app .access-gate-tab.active::after { position: absolute; bottom: 0; left: 4px; right: 4px; height: 3px; border-radius: 2px; background: var(--desktop-accent); content: ""; }
html.desktop-app .access-gate-field { color: var(--desktop-text); font-size: 13px; font-weight: 400; }
html.desktop-app .access-gate-field input { min-height: 36px; padding: 7px 11px; border: 1px solid var(--desktop-line); border-bottom-color: var(--desktop-muted); border-radius: 4px; color: var(--desktop-text); background: var(--desktop-field); }
html.desktop-app .access-gate-field input:focus-visible { border-bottom: 2px solid var(--desktop-accent); outline: none; padding-bottom: 6px; }
html.desktop-app .access-gate-field .access-password-toggle { border-color: var(--desktop-line); border-radius: 4px; color: var(--desktop-text); background: var(--desktop-field); font-weight: 400; }
html.desktop-app .access-gate-card .access-help-link { color: var(--desktop-accent); font-weight: 400; text-decoration: none; }
html.desktop-app .access-gate-card .access-help-link:hover { text-decoration: underline; }
html.desktop-app .access-gate-card .primary-button { width: 100%; min-height: 36px; margin-top: 4px; border: 1px solid transparent; border-radius: 4px; color: #ffffff; background: var(--desktop-accent); font-size: 14px; font-weight: 600; box-shadow: none; }
html[data-theme="dark"].desktop-app .access-gate-card .primary-button { color: #202020; }
html.desktop-app .access-gate-card .primary-button:hover { filter: brightness(.94); }
html.desktop-app .access-gate-tab:focus-visible,
html.desktop-app .access-gate-card button:focus-visible { outline: 2px solid var(--desktop-accent); outline-offset: 2px; }
html.desktop-app .access-gate-card .access-form-status { color: #c42b1c; }
html[data-theme="dark"].desktop-app .access-gate-card .access-form-status { color: #ff99a4; }
html.desktop-app .access-gate-card .access-gate-privacy { margin-top: 8px; font-size: 11px; line-height: 1.5; }
@media (max-height: 700px) {
  html.desktop-app .access-gate-card,
  html.desktop-app .access-gate-layout.panel-hidden .access-gate-card { justify-content: flex-start; padding-top: 24px; padding-bottom: 24px; gap: 9px; }
}
.app-shell #message-form { grid-template-columns: 40px minmax(0, 1fr) repeat(4, 40px); align-items: end; gap: 4px; padding: 8px; }
.app-shell #message-form textarea { grid-column: 2; grid-row: 1; min-height: 44px; padding: 10px 8px; border: 0; }
.app-shell #message-form > button { grid-row: 1; width: 40px; height: 44px; }
.app-shell #emoji-button { grid-column: 1; }
.app-shell #send-message-button { grid-column: 3; }
.app-shell #attach-button { grid-column: 4; }
.app-shell #video-message-button { grid-column: 5; }
.app-shell #voice-record-button { grid-column: 6; }
.app-shell #message-form #send-message-button { border-radius: 6px; box-shadow: 0 2px 5px #00000010; }
@media (max-width: 600px) {
  .app-shell #message-form { grid-template-columns: 36px minmax(0, 1fr) repeat(4, 36px); gap: 1px; padding: 5px; }
  .app-shell #message-form > button { width: 36px; height: 44px; }
  .app-shell #message-form textarea { padding: 10px 4px; font-size: 14px; }
}
@media (max-width: 620px) {
  html.android-app .chat-header { min-height: 72px; }
  html.android-app .chat-person { gap: 8px; }
  html.android-app .chat-person .header-avatar { display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px; }
  html.android-app .person-copy h1 { font-size: 15px; }
  html.android-app .person-copy p { font-size: 11px; }
  html.android-app .messages { padding: 14px 12px 18px; background: color-mix(in srgb, var(--chat-canvas) 96%, var(--blue) 4%); }
  html.android-app .message-row { gap: 6px; margin: 6px 0; }
  html.android-app .message-row.grouped { margin-top: 2px; }
  html.android-app .message-content { max-width: min(82%, 360px); }
  html.android-app .message-row.mine .message-content { max-width: min(88%, 400px); }
  html.android-app .messages .bubble { padding: 11px 14px; border-color: transparent; border-radius: 18px 18px 18px 5px; background: var(--chat-soft); font-size: max(14px, var(--message-font-size, 12px)); line-height: 1.45; }
  html.android-app .messages .mine .bubble { border-color: color-mix(in srgb, var(--blue) 22%, var(--chat-border)); border-radius: 18px 18px 5px 18px; color: var(--chat-text); background: color-mix(in srgb, var(--blue) 18%, var(--chat-surface)); }
  html.android-app .message-row.grouped:not(.mine) .bubble { border-top-left-radius: 6px; }
  html.android-app .message-row.grouped.mine .bubble { border-top-right-radius: 6px; }
  html.android-app .welcome-chat { max-width: 320px; margin: 24px auto; padding: 12px 8px; }
  html.android-app .welcome-chat h2 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; }
  html.android-app .welcome-chat p { font-size: 13px; line-height: 1.55; }
  html.android-app .welcome-chat small { display: block; margin-top: 10px; font-size: 11px; line-height: 1.45; }
  html.android-app .composer-area { padding: 8px 10px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--chat-border); }
  html.android-app #message-form { grid-template-columns: 36px 36px minmax(0, 1fr) 36px 36px; align-items: center; gap: 2px; padding: 5px; border-radius: 28px; }
  html.android-app #message-form textarea { grid-column: 3; grid-row: 1; min-width: 0; min-height: 40px; padding: 8px 5px; border: 0; font-size: 16px; }
  html.android-app #message-form #emoji-button { grid-column: 2; grid-row: 1; }
  html.android-app #message-form #attach-button { grid-column: 1; grid-row: 1; }
  html.android-app #message-form #voice-record-button { grid-column: 4; grid-row: 1; }
  html.android-app #message-form #send-message-button { grid-column: 5; grid-row: 1; width: 36px; height: 36px; border-radius: 50%; }
  html.android-app #message-form > button { border-radius: 50%; }
}
@media (max-width: 600px) {
  .access-gate {
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    overflow-y: auto;
  }
  .access-gate-layout {
    width: min(100%, 440px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
    border-radius: 16px;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
  }
  .access-brand-panel { display: none; }
  .access-gate-card .access-panel-toggle { display: none; }
  .access-gate-card {
    min-height: 0;
    max-height: none;
    gap: 12px;
    padding: 26px 22px;
    overflow: visible;
  }
  .access-gate-card > img { width: 52px; height: 52px; }
  .access-gate-card h1 { margin: 0; font-size: 24px; line-height: 1.2; }
  html.android-app .access-form-eyebrow,
  html.android-app .access-gate-card #access-gate-description { display: none; }
  html.android-app .access-gate-card { gap: 10px; padding: 22px 20px; }
  .access-gate-card #access-gate-description { margin: 0; font-size: 13px; line-height: 1.5; }
  .access-gate-tabs, .access-gate-tab { min-height: 44px; }
  .access-gate-field { margin: 0 0 12px; font-size: 12px; }
  .access-gate-field input { min-height: 48px; font-size: 16px; }
  .access-gate-field .access-password-toggle { min-width: 78px; min-height: 44px; }
  .access-gate-card .primary-button { min-height: 50px; border-radius: 12px; font-size: 15px; }
  .access-gate-card .details-button { min-height: 44px; border-radius: 10px; }
  .access-gate-card .access-gate-privacy { margin-top: 2px; font-size: 11px; line-height: 1.45; }
}
@media (min-width: 821px) {
  html.desktop-app .access-gate { padding: 32px; background: #e9efed; }
  html[data-theme="dark"].desktop-app .access-gate { background: #111a18; }
  html.desktop-app .access-gate-layout:not(.panel-hidden) {
    display: grid;
    width: min(1080px, calc(100vw - 80px));
    height: min(740px, calc(100dvh - 64px));
    min-height: 0;
    max-height: none;
    grid-template-columns: minmax(340px, .92fr) minmax(420px, 1.08fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--chat-border);
    border-radius: 16px;
    background: var(--chat-surface);
    box-shadow: 0 24px 80px #10252224;
  }
  html.desktop-app .access-brand-panel {
    display: flex;
    min-width: 0;
    height: 100%;
    padding: 48px;
    gap: 20px;
    background-color: #153f3a;
    background-image: repeating-linear-gradient(135deg, #d5f5ec0b 0 1px, transparent 1px 22px),
      repeating-linear-gradient(45deg, transparent 0 48px, #8bd6c012 49px 50px, transparent 51px 96px);
  }
  html.desktop-app .access-brand-panel::before,
  html.desktop-app .access-brand-panel::after { display: none; }
  html.desktop-app .access-brand-lockup .access-panel-toggle,
  html.desktop-app .access-gate-card .access-panel-toggle { display: none; }
  html.desktop-app .access-downloads { display: none; }
  html.desktop-app .access-brand-content { max-width: 34ch; margin: auto 0; padding: 0; }
  html.desktop-app .access-brand-kicker { margin: 0 0 16px; color: #a9ddd0; font-size: 11px; letter-spacing: 0; }
  html.desktop-app .access-brand-content h2 { margin-bottom: 14px; font-size: 38px; line-height: 1.14; letter-spacing: 0; }
  html.desktop-app .access-brand-content > p:last-child { max-width: 30ch; font-size: 14px; line-height: 1.6; }
  html.desktop-app .access-brand-footer { color: #d8ece6; }
  html.desktop-app .access-gate-card { width: 100%; height: 100%; min-width: 0; min-height: 0; max-height: none; padding: 44px 54px; gap: 12px; overflow-y: auto; border: 0; background: var(--chat-surface); }
  html.desktop-app .access-gate-card .access-form-eyebrow,
  html.desktop-app .access-gate-card #access-gate-description { display: none; }
  html.desktop-app .access-gate-card > img { display: none; }
  html.desktop-app .access-gate-card h1 { font-size: 28px; line-height: 1.2; letter-spacing: 0; }
  html.desktop-app .access-gate-card .access-gate-tabs { margin: 6px 0; }
  html.desktop-app .access-gate-card .access-gate-field input { min-height: 48px; font-size: 15px; }
  html.desktop-app .access-gate-card .primary-button { min-height: 50px; }
  html.desktop-app .access-gate-card .access-gate-privacy { align-self: flex-start; max-width: 42ch; text-align: left; font-size: 11px; }
}
