:root {
  color-scheme: light;
  --ink: #172033; --muted: #626d80; --line: #e2e7ee; --surface: #fff;
  --canvas: #f3f5f9; --thread: #f8f9fc; --accent: #285ce8; --accent-hover: #164bd4;
  --tint: #edf2ff; --self: #285ce8; --nav: #121c30; --nav-ink: #c4cee0;
  --nav-selected: #263b60; --field: #f6f8fb; --shadow: 0 18px 70px #142a4d20;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary, label[for] { touch-action: manipulation; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #769aff; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .global-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.global-status { top: 0; left: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; background: var(--surface); padding: 12px 20px; border-radius: 8px; z-index: 30; }
.skip-link:focus { top: 12px; }
svg { width: 21px; height: 21px; flex: none; }
.desk { display: grid; grid-template-columns: 232px minmax(0,1fr); height: 100dvh; min-height: 500px; }
.sidebar { background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; padding: 27px 16px 18px; min-height: 0; border-right: 1px solid #1b2a44; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; padding: 0 6px; font-weight: 720; font-size: 19px; letter-spacing: -.55px; margin-bottom: 36px; }
.brand small { display: block; font-size: 10px; letter-spacing: 1.4px; font-weight: 600; margin-top: 3px; color: #9badc9; }
.brand-mark, .welcome-monogram { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #cafd59; color: #122a39; font-size: 31px; font-weight: 800; line-height: 1; letter-spacing: -2px; flex: none; }
.brand-mark span, .welcome-monogram span { color: #234ab0; }
.sidebar-label { margin: 0 12px 12px; font-size: 11px; letter-spacing: 1.3px; font-weight: 650; color: #899ab6; }
.view-filters { display: grid; gap: 5px; }
.nav-item, .network-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 10px 12px; border-radius: 8px; background: transparent; color: var(--nav-ink); text-align: left; font-size: 14px; }
.nav-item { font-weight: 560; }
.nav-item:hover, .network-item:hover { background: #ffffff09; color: #fff; }
.nav-item.selected { background: var(--nav-selected); color: #fff; }
.nav-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: #9cafcf; }
.nav-item.selected .nav-icon { color: #bad0ff; }
.nav-count { margin-left: auto; min-width: 24px; padding: 1px 6px; border-radius: 5px; text-align: center; background: #ffffff08; color: #aebeD7; font-size: 12px; font-variant-numeric: tabular-nums; }
.nav-item.selected .nav-count { color: #fff; background: #ffffff12; }
.sidebar-section { display: flex; align-items: center; justify-content: space-between; margin-top: 32px; }
.sidebar-section .sidebar-label { margin-bottom: 0; }
.quiet-count { font-size: 12px; color: #94a7c6; padding-right: 14px; }
.network-filters { margin-top: 12px; flex-shrink: 0; }
.network-item { font-size: 14px; }
.network-item.selected { background: #243650; color: #fff; }
.network-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.network-item small { font-size: 12px; margin-left: auto; color: #94a7c6; }
.network-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: #8394ab; }
.network-logo { width: 18px; height: 18px; border-radius: 0; background: none; color: #99a7ba; }
.network-logo svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.network-logo[data-network=WhatsApp] { color: #2aae7d; }
.network-logo[data-network=Signal] { color: #5989ff; }
.network-logo[data-network=Slack] { color: #b77dd0; }
.network-logo[data-network=Telegram] { color: #349dcc; }
.network-logo[data-network=Instagram] { color: #e574ab; }
.network-logo[data-network=Messenger] { color: #657df0; }
.sidebar-empty { font-size: 14px; color: #93a4c0; margin: 0 12px; line-height: 1.7; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.connection-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #a9bad6; margin: 0 12px 12px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #8c9cb5; }
.status-dot.connected { background: #4fce9a; }
.status-dot.demo { background: #a3b9ff; }
.connect-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; padding: 10px; border-radius: 8px; background: #f7f9ff; color: #21314a; font-size: 14px; font-weight: 650; }
.connect-button:hover { background: #dce8ff; }
.billing-link { display: block; width: fit-content; padding: 12px; font-size: 13px; color: #b4c3db; text-decoration: none; }
.billing-link:hover { color: #fff; text-decoration: underline; }
.sidebar-footnote { color: #8f9fb9; font-size: 12px; line-height: 1.6; margin: 7px 12px 15px; }
.hub-link { display: flex; gap: 7px; align-items: center; border-top: 1px solid #ffffff12; padding: 15px 6px 0; font-size: 12px; color: #94a7c6; text-decoration: none; }
.hub-link svg { width: 15px; height: 15px; }
.hub-link:hover { color: #fff; }
.workspace { display: grid; grid-template-rows: 66px auto minmax(0,1fr); min-width: 0; min-height: 0; background: var(--surface); }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 26px; border-bottom: 1px solid var(--line); }
.workspace-heading p { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.workspace-location { color: var(--muted); font-weight: 450; }
.breadcrumb-divider { margin: 0 13px; color: #adb6c5; font-weight: 400; }
.workspace-actions { display: flex; gap: 12px; align-items: center; }
.mode-pill { white-space: nowrap; font-size: 12px; font-weight: 600; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--field); }
.mode-pill.demo { color: #3458a2; background: #edf3ff; border-color: #d6e2fd; }
.mode-banner { min-height: 38px; display: flex; align-items: center; padding: 8px 26px; background: var(--field); color: var(--muted); font-size: 12px; line-height: 1.6; border-bottom: 1px solid var(--line); }
.desk[data-mode=demo] .mode-banner { background: var(--tint); color: #47618e; }
.workspace-body { display: grid; grid-template-columns: 352px minmax(0,1fr); min-width: 0; min-height: 0; }
.inbox { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); background: var(--surface); }
.inbox-header { display: flex; justify-content: space-between; align-items: center; padding: 26px 24px 19px; }
h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.1; font-weight: 690; letter-spacing: -.8px; }
.inbox-subtitle { color: var(--muted); font-size: 13px; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; min-width: 36px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; }
.icon-button:hover { background: var(--field); color: var(--ink); }
.icon-button svg { width: 20px; height: 20px; }
.text-button { padding: 6px 0; min-height: 36px; background: transparent; color: var(--accent); font-size: 13px; text-underline-offset: 3px; }
.text-button:hover { text-decoration: underline; }
#clear-workspace { color: var(--muted); }
.search-wrap { display: flex; align-items: center; gap: 9px; min-height: 43px; margin: 0 22px 13px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--muted); }
.search-wrap svg { width: 17px; height: 17px; }
.search-wrap input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 10px 0; font-size: 14px; }
.search-wrap input::placeholder { color: var(--muted); }
kbd { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: inherit; white-space: nowrap; }
.history-search { margin: 0 23px 13px; color: var(--muted); font-size: 13px; }
.history-search summary { cursor: pointer; min-height: 28px; padding: 3px 0; }
.history-search form { display: flex; gap: 7px; margin-top: 8px; }
.history-search input { min-width: 0; width: 100%; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; }
.history-search form button { padding: 7px 11px; }
.history-search p { font-size: 12px; line-height: 1.6; margin: 9px 0; }
.inbox-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); padding: 0 22px 12px; }
.inbox-tabs button { min-height: 34px; padding: 6px 14px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; }
.inbox-tabs button[aria-pressed=true] { background: var(--tint); color: var(--accent); }
.inbox-tabs button:hover { background: var(--field); }
.filter-line { display: flex; align-items: center; justify-content: space-between; min-height: 41px; gap: 7px; padding: 6px 23px; }
.inbox-filter-summary { font-size: 12px; color: var(--muted); letter-spacing: .15px; }
#reset-filters { flex: none; font-size: 12px; min-height: 28px; }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 14px; scrollbar-width: thin; }
.chat-item { display: grid; grid-template-columns: 43px minmax(0,1fr); gap: 12px; align-items: center; width: 100%; min-height: 94px; padding: 14px 12px; text-align: left; position: relative; border: 1px solid transparent; border-radius: 9px; background: var(--surface); color: var(--ink); margin: 2px 0; }
.chat-item:hover { background: var(--field); }
.chat-item.selected { background: var(--tint); border-color: #dce5ff; }
.chat-item.selected::before { content: ""; position: absolute; left: -11px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.avatar { width: 43px; height: 43px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--avatar-bg,#e8eefe); color: var(--avatar-ink,#31519d); font-size: 14px; font-weight: 650; letter-spacing: .3px; flex: none; position: relative; }
.avatar-tone-0 { --avatar-bg: #e6eafe; --avatar-ink: #4f56a2; }
.avatar-tone-1 { --avatar-bg: #dcefe9; --avatar-ink: #24675e; }
.avatar-tone-2 { --avatar-bg: #f9e8d4; --avatar-ink: #946226; }
.avatar-tone-3 { --avatar-bg: #ddeafb; --avatar-ink: #2f629c; }
.avatar-tone-4 { --avatar-bg: #f3e0e9; --avatar-ink: #92496c; }
.avatar .avatar-network { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; padding: 2px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--surface); z-index: 2; }
.chat-item.selected .avatar .avatar-network { background: var(--tint); box-shadow: 0 0 0 2px var(--tint); }
.contact-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--avatar-bg); z-index: 1; }
.chat-content { min-width: 0; }
.chat-top, .chat-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-name { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chat-preview { font-size: 13px; line-height: 1.5; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 4px 0 0; }
.chat-bottom { margin-top: 6px; }
.chat-network { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; color: var(--muted); }
.chat-network .network-dot { width: 11px; height: 11px; }
.chat-draft { color: #b45336; font-size: 12px; font-weight: 650; margin-right: 5px; }
.chat-pin { color: var(--accent); font-size: 11px; font-weight: 600; }
.unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; line-height: 1; font-weight: 650; }
.list-empty { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 230px; padding: 28px 22px; text-align: center; color: var(--muted); font-size: 14px; }
.list-empty strong { font-size: 16px; font-weight: 600; color: var(--ink); }
.list-empty p { max-width: 245px; line-height: 1.65; margin-top: 8px; }
.empty-list-icon { font-size: 30px; margin-bottom: 12px; color: #9babc5; }
.thread { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--thread); position: relative; }
.welcome { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; text-align: center; overflow: auto; }
.welcome-monogram { width: 68px; height: 68px; font-size: 48px; border-radius: 20px; margin-bottom: 26px; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 1.3px; color: var(--muted); margin: 0 0 8px; }
.welcome h2 { font-size: clamp(28px,3vw,42px); line-height: 1.2; letter-spacing: -1.3px; margin: 7px 0 18px; font-weight: 650; color: var(--ink); }
.welcome-copy { max-width: 400px; color: var(--muted); font-size: 16px; line-height: 1.75; margin: 0; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.primary-button, .secondary-button { min-height: 44px; padding: 10px 17px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.primary-button { color: #fff; background: var(--accent); }
.primary-button:hover { background: var(--accent-hover); }
.primary-button span { margin-left: 12px; }
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.secondary-button:hover { background: var(--field); }
.welcome-caption { color: var(--muted); max-width: 380px; font-size: 12px; line-height: 1.7; margin: 18px 0 0; }
.thread-content { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread-header { display: flex; align-items: center; gap: 12px; flex: none; padding: 22px 28px; min-height: 88px; background: var(--surface); border-bottom: 1px solid var(--line); }
.thread-person { flex: 1; min-width: 80px; }
.thread-person h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.4px; overflow-wrap: anywhere; line-height: 1.35; }
.thread-person p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.thread-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thread-action { background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 7px; min-height: 34px; font-size: 12px; padding: 7px 10px; white-space: nowrap; }
.thread-action:hover, .thread-action[aria-pressed=true] { background: var(--tint); color: var(--accent); border-color: #bfcffc; }
.thread-notice { flex: none; padding: 8px 20px 0; text-align: center; font-size: 12px; color: var(--muted); }
.message-scroll { flex: 1; min-height: 70px; overflow-y: auto; padding: 14px 36px 22px; scrollbar-width: thin; }
.messages { display: flex; flex-direction: column; gap: 18px; max-width: 960px; margin: auto; }
.message-day { align-self: center; font-size: 11px; color: var(--muted); padding: 4px 10px; margin: 2px 0 5px; border-radius: 5px; background: var(--field); }
.message { display: flex; flex-direction: column; align-self: flex-start; min-width: 0; max-width: min(86%,520px); }
.message.self { align-self: flex-end; align-items: flex-end; }
.message-sender { margin: 0 0 6px 2px; color: var(--muted); font-size: 12px; font-weight: 550; }
.message-bubble { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 16px; line-height: 1.65; padding: 12px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; }
.message.self .message-bubble { color: #fff; background: var(--self); border-color: var(--self); border-radius: 13px 13px 3px 13px; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 5px 2px 0; font-size: 11px; color: var(--muted); }
.message-state { color: var(--muted); }
.message-reply { color: var(--muted); background: transparent; font-size: 11px; padding: 3px 5px; border-radius: 4px; min-height: 24px; }
.message-reply:hover { background: var(--tint); color: var(--accent); }
.composer-wrap { flex: none; margin: 7px 28px 20px; }
.composer-label { font-size: 12px; color: var(--muted); font-weight: 550; margin: 0 2px 8px; }
.composer-wrap form { border: 1px solid #ced7e6; border-radius: 12px; background: var(--surface); padding: 14px 16px 12px; box-shadow: 0 3px 12px #15273f05; }
.composer-wrap form:focus-within { border-color: #7798ee; box-shadow: 0 0 0 3px #507ae515; }
.composer-wrap textarea { display: block; resize: vertical; min-width: 0; width: 100%; min-height: 64px; max-height: 140px; border: 0; background: transparent; color: var(--ink); padding: 2px; font-size: 16px; line-height: 1.6; }
.composer-wrap textarea::placeholder { color: #7f8a9c; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.composer-actions p { font-size: 12px; color: var(--muted); margin: 0; }
.send-button { display: inline-flex; align-items: center; gap: 12px; min-height: 40px; padding: 9px 13px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.send-button:hover:not(:disabled) { background: var(--accent-hover); }
.send-button:disabled { background: var(--field); color: #73839d; opacity: 1; }
.send-button>span:last-child { font-size: 18px; }
.composer-status, .inline-status { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 8px 2px 0; }
.inline-status { margin: 10px 22px; }
.composer-status:empty, .inline-status:empty { display: none; }
.uncertainty-button { font-size: 13px; }
.load-button { display: block; margin: 8px auto; min-height: 36px; padding: 8px 13px; font-size: 13px; background: var(--tint); color: var(--accent); border-radius: 7px; }
.thread-empty { text-align: center; padding: 28px; color: var(--muted); font-size: 14px; }
.error-text { color: #b43e42 !important; }
.mobile-menu, .sidebar-close, .sidebar-scrim, .thread-back { display: none; }
.connection-dialog { width: min(520px,calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 34px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); overflow: auto; }
.connection-dialog::backdrop { background: #10203b70; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.dialog-mark { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--tint); color: var(--accent); border-radius: 12px; margin-bottom: 22px; font-size: 24px; }
.connection-dialog h2 { font-size: 25px; font-weight: 650; line-height: 1.25; letter-spacing: -.7px; margin: 8px 0 14px; }
.connection-dialog>p:not(.eyebrow) { font-size: 14px; line-height: 1.75; color: var(--muted); }
.setup-steps { padding: 0; margin: 25px 0; list-style: none; display: grid; gap: 20px; }
.setup-steps li { display: flex; gap: 13px; }
.setup-steps li>span { display: flex; align-items: center; justify-content: center; flex: none; width: 25px; height: 25px; background: var(--tint); color: var(--accent); border-radius: 7px; font-size: 12px; font-weight: 650; }
.setup-steps strong { color: var(--ink); font-size: 14px; }
.setup-steps p { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 5px 0 0; }
.setup-steps code { font-size: 12px; overflow-wrap: anywhere; }
.connection-dialog .connection-footnote { font-size: 12px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 15px; }
.download-note { font-size: 12px; color: var(--muted); }
.local-connect-form { display: grid; gap: 10px; margin-top: 22px; }
.local-connect-form label { font-size: 14px; font-weight: 600; }
.local-connect-form input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; background: var(--field); color: var(--ink); font-size: 16px; }
.local-connect-form p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.local-connect-form .primary-button { margin-top: 7px; }
.disconnect-button { margin-top: 12px; width: 100%; }
.sidebar-scrim { position: fixed; inset: 0; background: #0b19366b; z-index: 4; border: 0; }
.shortcut-list { margin: 24px 0; }
.shortcut-list>div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.shortcut-list dt { font-size: 14px; }
.shortcut-list dt small { color: var(--muted); font-size: 12px; }
.shortcut-list dd { margin: 0; font-size: 12px; white-space: nowrap; }
.reply-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--tint); border-left: 3px solid var(--accent); border-radius: 6px; margin-bottom: 12px; }
.reply-context>div { min-width: 0; }
.reply-context strong { color: var(--accent); font-size: 13px; }
.reply-context p { font-size: 13px; margin: 3px 0 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cancel-reply { width: 32px; height: 32px; flex: none; background: transparent; color: var(--accent); font-size: 22px; border-radius: 5px; }
.search-results { padding: 0 16px; overflow-y: auto; min-height: 0; }
.search-result { display: flex; flex-direction: column; gap: 6px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); text-align: left; padding: 12px; margin: 6px 0; }
.search-result strong { font-size: 14px; }
.search-result p { font-size: 14px; line-height: 1.6; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 120px; overflow: auto; }
.search-result small { font-size: 12px; color: var(--muted); }
#clear-message-search { align-self: center; margin: 5px 0 12px; }
.search-match { margin: 10px 26px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--tint); color: var(--ink); border-radius: 6px; font-size: 14px; max-height: 110px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.reaction-picker { display: flex; gap: 3px; padding: 4px; margin-top: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 24px; align-self: flex-start; }
.reaction-picker button { width: 34px; min-height: 34px; background: transparent; border-radius: 50%; font-size: 19px; }
.reaction-picker button:hover { background: var(--tint); }
.reaction-count { align-self: flex-start; background: var(--field); border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; padding: 3px 8px; font-size: 12px; }
.attachment-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin: 8px 0; }
.attachment-control { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 6px 9px; border-radius: 6px; color: var(--muted); background: var(--field); font-size: 12px; cursor: pointer; }
.attachment-control svg { width: 16px; height: 16px; }
.attachment-control:has(+input:disabled) { opacity: .5; cursor: not-allowed; }
.attachment-control:has(+input:focus-visible) { outline: 3px solid #769aff; outline-offset: 2px; }
#attachment-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reminder-controls { flex: none; margin: 11px 28px 0; font-size: 12px; color: var(--muted); }
.reminder-controls summary { cursor: pointer; min-height: 27px; }
.reminder-controls form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.reminder-controls input[type=datetime-local] { max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 14px; }
.reminder-checkbox { display: flex; align-items: center; gap: 5px; }
.reminder-controls p { margin: 0 0 7px; }
.reminder-controls button { font-size: 12px; min-height: 36px; padding: 7px 10px; }
:root[data-theme=dark] { color-scheme: dark; --ink: #ecf0f7; --muted: #a7b3c8; --line: #303c50; --surface: #1b2639; --canvas: #111a29; --thread: #152033; --accent: #91aeff; --accent-hover: #a7bdff; --tint: #293c61; --self: #3265dc; --nav: #0c1422; --field: #202e43; --shadow: 0 18px 70px #0007; }
[data-theme=dark] .primary-button, [data-theme=dark] .send-button { background: #3869e5; color: #fff; }
[data-theme=dark] .primary-button:hover, [data-theme=dark] .send-button:hover:not(:disabled) { background: #4a79ec; }
[data-theme=dark] .send-button:disabled { background: #2d3b53; color: #a9b6cb; }
[data-theme=dark] .mode-pill.demo, [data-theme=dark] .desk[data-mode=demo] .mode-banner { background: #223455; color: #b6cbfb; border-color: var(--line); }
[data-theme=dark] .chat-item.selected { border-color: #3f5781; }
[data-theme=dark] .composer-wrap form { border-color: #465875; }
[data-theme=dark] .chat-draft { color: #ffad89; }
[data-theme=dark] .error-text { color: #ff9c9c !important; }
@media (min-width: 1600px) {
  .desk { grid-template-columns: 250px minmax(0,1fr); }
  .workspace-body { grid-template-columns: 390px minmax(0,1fr); }
  .message-scroll { padding-left: 54px; padding-right: 54px; }
  .composer-wrap { margin-left: 44px; margin-right: 44px; }
}
@media (max-width: 1200px) {
  .desk { grid-template-columns: 205px minmax(0,1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .brand { font-size: 17px; gap: 9px; }
  .brand small { font-size: 9px; letter-spacing: 1px; }
  .workspace-body { grid-template-columns: 312px minmax(0,1fr); }
  .thread-header { flex-wrap: wrap; gap: 10px; padding: 17px 22px; }
  .thread-tools { margin-left: auto; }
  .message-scroll { padding: 14px 24px 20px; }
  .composer-wrap { margin: 7px 20px 16px; }
  .composer-actions { align-items: flex-end; }
}
@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; min-height: 420px; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 270px; max-width: calc(100% - 38px); z-index: 5; padding: 29px 16px 20px; transform: translateX(-100%); transition: transform .16s ease; }
  .desk[data-sidebar-open=true] .sidebar { transform: translateX(0); }
  .sidebar-close { display: flex; position: absolute; top: 9px; right: 8px; color: #b9c9e4; }
  .sidebar-close:hover { color: #fff; background: #ffffff15; }
  .sidebar-scrim:not([hidden]) { display: block; }
  .brand { font-size: 19px; margin-bottom: 32px; }
  .mobile-menu { display: inline-flex; }
  .workspace { grid-template-rows: 64px auto minmax(0,1fr); }
  .workspace-bar { padding: 10px 16px; gap: 9px; }
  .workspace-heading { flex: 1; }
  .workspace-actions { gap: 7px; }
  .workspace-location, .breadcrumb-divider { display: none; }
  .workspace-body { grid-template-columns: 290px minmax(0,1fr); }
  .mode-banner { padding: 8px 20px; }
  .thread-header { gap: 9px; padding: 15px 18px; }
  .thread-person { min-width: 150px; }
  .thread-tools { flex-basis: 100%; justify-content: flex-end; }
  .thread-notice { padding: 7px 17px 0; }
}
@media (max-width: 620px) {
  .desk { height: 100dvh; min-height: 360px; }
  .workspace { grid-template-rows: 58px auto minmax(0,1fr); }
  .workspace-bar { padding: 7px 12px; gap: 5px; }
  .workspace-heading p { font-size: 14px; }
  .workspace-actions { gap: 4px; }
  .mode-pill { display: none; }
  .keyboard-toggle { display: inline-grid; }
  #clear-workspace { font-size: 12px; max-width: 42px; line-height: 1.3; }
  .mode-banner { padding: 8px 16px; font-size: 12px; line-height: 1.5; }
  .workspace-body { display: block; position: relative; }
  .inbox, .thread { width: 100%; height: 100%; }
  .desk[data-mobile-view=list] .thread { display: none; }
  .desk[data-mobile-view=thread] .inbox { display: none; }
  .desk[data-mode=empty] .inbox { display: none; }
  .desk[data-mode=empty] .thread { display: flex; }
  .inbox-header { padding: 22px 22px 17px; }
  h1 { font-size: 28px; }
  .inbox-subtitle { font-size: 13px; }
  .search-wrap input, .history-search input { font-size: 16px; }
  .search-wrap { min-height: 46px; }
  .inbox-tabs { padding-bottom: 10px; }
  .inbox-tabs button { min-height: 40px; font-size: 14px; padding: 6px 17px; }
  .history-search summary { min-height: 34px; font-size: 13px; }
  .conversation-list { padding-left: 10px; padding-right: 10px; }
  .chat-item { min-height: 96px; padding: 15px 13px; }
  .chat-name { font-size: 16px; }
  .chat-preview { font-size: 14px; }
  .chat-time, .chat-network { font-size: 12px; }
  .thread-back { display: inline-flex; }
  .icon-button { min-width: 40px; width: 40px; height: 40px; }
  .mobile-menu, .theme-toggle, .thread-back, .sidebar-close { min-width: 44px; width: 44px; height: 44px; }
  .thread-header { padding: 12px 12px 10px; gap: 8px; }
  .thread-avatar { width: 37px; height: 37px; font-size: 12px; }
  .thread-person { flex: 1; min-width: 0; }
  .thread-person h2 { font-size: 17px; }
  .thread-person p { font-size: 12px; }
  .thread-tools { flex-basis: 100%; padding-left: 0; justify-content: flex-end; gap: 7px; }
  .thread-action { min-height: 40px; padding: 7px 12px; font-size: 12px; }
  .thread-notice { font-size: 12px; }
  .reminder-controls { margin: 8px 16px 0; }
  .reminder-controls summary { min-height: 30px; }
  .reminder-controls input[type=datetime-local] { font-size: 16px; }
  .message-scroll { padding: 12px 16px 18px; }
  .messages { gap: 16px; }
  .message { max-width: 91%; }
  .message-bubble { font-size: 16px; padding: 10px 13px; }
  .message-meta, .message-day { font-size: 12px; }
  .message-reply { min-height: 32px; padding: 5px 7px; font-size: 12px; }
  .composer-wrap { margin: 5px 12px max(10px,env(safe-area-inset-bottom)); }
  .composer-label { margin-bottom: 6px; }
  .composer-wrap form { padding: 10px 12px; }
  .composer-wrap textarea { min-height: 57px; max-height: 110px; }
  .composer-actions { gap: 7px; }
  .composer-actions p { font-size: 12px; }
  .send-button { min-height: 44px; font-size: 12px; padding: 9px 11px; gap: 7px; }
  .attachment-row { font-size: 12px; gap: 7px; margin: 6px 0; }
  .attachment-control { min-height: 40px; }
  .reaction-picker button { min-width: 37px; min-height: 44px; }
  .search-match { margin: 8px 16px 0; }
  .welcome { padding: 30px 22px; }
  .welcome h2 { font-size: 30px; }
  .welcome-monogram { margin-bottom: 20px; }
  .welcome-copy { font-size: 16px; }
  .welcome-actions { width: 100%; flex-direction: column; }
  .primary-button, .secondary-button { min-height: 46px; }
  .connection-dialog { width: calc(100% - 24px); padding: 28px 22px; max-height: calc(100dvh - 24px); }
  .connection-dialog h2 { font-size: 23px; }
  .shortcut-list dd { white-space: normal; text-align: right; }
}
@media (max-height: 650px) {
  .sidebar { overflow-y: auto; }
  .sidebar-bottom { padding-top: 15px; }
  .sidebar-section { margin-top: 18px; }
  .brand { margin-bottom: 24px; }
  .thread-notice, .composer-label { display: none; }
  .thread-header { min-height: 70px; }
  .message-scroll { min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
