:root {
  color-scheme: light;
  --ink: #172333;
  --muted: #718093;
  --line: #e7ebf0;
  --paper: #fff;
  --canvas: #f4f6f8;
  --navy: #172d48;
  --blue: #315f94;
  --blue-soft: #eaf1f8;
  --green: #36846c;
  --danger: #b34e52;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.chat-product { min-height: 100vh; }
.auth-screen { min-height: 100vh; padding: 0 6.4vw 22px; background: radial-gradient(ellipse at 78% 18%, rgba(220,231,243,.55), transparent 36%), #f6f7f9; }
.auth-brandbar, .auth-footer { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.auth-brandbar { height: 86px; border-bottom: 1px solid rgba(32,55,80,.09); }
.brand-lockup, .sidebar-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #cfdae5; border-radius: 12px; background: linear-gradient(145deg, #fff, #eaf0f6); color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 5px 14px rgba(31,52,76,.07); }
.brand-wordmark, .sidebar-brand > span:last-child { display: grid; gap: 3px; }
.brand-wordmark strong, .sidebar-brand strong { color: var(--navy); font-size: 14px; letter-spacing: -.025em; }
.brand-wordmark small, .sidebar-brand small { color: #8a96a4; font-size: 9px; letter-spacing: .18em; }
.site-return { color: #637287; text-decoration: none; font-size: 13px; transition: color .18s ease; }
.site-return:hover, .auth-footer a:hover { color: var(--blue); }
.auth-grid { max-width: 1190px; min-height: calc(100vh - 145px); margin: 0 auto; padding: 66px 0 58px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .76fr); align-items: center; gap: clamp(55px, 9vw, 150px); }
.auth-story { max-width: 570px; padding-bottom: 13px; }
.eyebrow { display: flex; align-items: center; gap: 11px; margin: 0 0 24px; color: #728298; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow-line { width: 26px; height: 1px; background: #52749c; }
.auth-story h1 { margin: 0; color: #1c2e44; font-size: clamp(44px, 5.25vw, 69px); line-height: 1.055; letter-spacing: -.06em; font-weight: 650; }
.auth-story h1 em { color: #58799e; font-style: normal; }
.auth-story-copy { max-width: 430px; margin: 26px 0 34px; color: #69798d; font-size: 16px; line-height: 1.75; }
.story-points { display: grid; gap: 19px; }
.story-points > div { display: flex; align-items: flex-start; gap: 17px; }
.story-number { min-width: 25px; padding-top: 3px; color: #8e9caf; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.story-points strong, .story-points small { display: block; }
.story-points strong { margin-bottom: 5px; color: #34465d; font-size: 13px; font-weight: 650; }
.story-points small { color: #8793a2; font-size: 12px; line-height: 1.5; }
.auth-story-foot { display: flex; align-items: center; gap: 9px; margin-top: 39px; color: #8090a2; font-size: 11px; }
.signal-dot, .connection-state i { width: 7px; height: 7px; border-radius: 50%; background: #67a68d; box-shadow: 0 0 0 4px rgba(91,165,135,.12); }
.auth-card { position: relative; width: 100%; padding: 36px 36px 27px; border: 1px solid rgba(26,48,72,.08); border-radius: 17px; background: rgba(255,255,255,.96); box-shadow: 0 22px 65px rgba(30,48,69,.09), 0 2px 8px rgba(30,48,69,.03); }
.auth-card-head { margin-bottom: 25px; }
.auth-card-kicker, .dialog-eyebrow { color: #8290a1; font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.auth-card-head h2 { margin: 12px 0 8px; color: #1c2e44; font-size: 27px; line-height: 1.18; letter-spacing: -.045em; }
.auth-card-head p { margin: 0; color: #788698; font-size: 13px; line-height: 1.5; }
.auth-form { display: grid; gap: 9px; }
.field-label { display: flex; justify-content: space-between; gap: 10px; margin: 9px 0 0; color: #46566a; font-size: 11px; font-weight: 650; }
.field-label > span { color: #94a0ae; font-size: 10px; font-weight: 450; }
.text-field { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #dfe5eb; border-radius: 8px; outline: none; background: #fff; color: #203248; font-size: 13px; transition: border-color .16s, box-shadow .16s, background .16s; }
.text-field:focus, .auth-form textarea:focus { border-color: #7897b9; box-shadow: 0 0 0 3px rgba(72,112,157,.11); }
.text-field::placeholder { color: #aab3be; }
.primary-button, .secondary-button, .danger-button { min-height: 43px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 650; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.primary-button { color: #fff; background: var(--navy); box-shadow: 0 5px 12px rgba(23,45,72,.12); }
.primary-button:hover { background: #23476f; box-shadow: 0 8px 18px rgba(23,45,72,.17); transform: translateY(-1px); }
.secondary-button { border-color: #dfe5eb; background: #fff; color: #536277; }
.secondary-button:hover { border-color: #bac8d6; background: #f8fafc; }
.danger-button { color: #fff; background: #a84e53; }
.danger-button:hover { background: #923d43; }
.auth-submit { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 9px; padding: 0 15px; }
.auth-submit span { font-size: 18px; font-weight: 400; }
.text-button { padding: 0; border: 0; background: none; color: #416a96; cursor: pointer; font-size: inherit; font-weight: 650; text-decoration: none; }
.text-button:hover { color: #23476f; text-decoration: underline; }
.forgot-toggle { justify-self: center; margin: 7px 0 1px; color: #718093; font-size: 11px; font-weight: 500; }
.auth-switch { margin: 15px 0 0; color: #8490a0; text-align: center; font-size: 11px; }
.auth-switch .text-button { margin-left: 3px; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 5px; color: #758396; font-size: 10px; line-height: 1.5; }
.consent-row input { width: 14px; height: 14px; flex: 0 0 auto; margin: 1px 0 0; accent-color: #294d73; }
.consent-row a, .auth-footer a { color: #466f99; text-underline-offset: 2px; }
.auth-message { margin: -7px 0 16px; padding: 11px 12px; border: 1px solid #d7e4ef; border-radius: 8px; background: #f3f7fb; color: #4d6279; font-size: 11px; line-height: 1.55; }
.auth-message[data-tone="error"] { border-color: #f0d9da; background: #fff7f7; color: #9b454a; }
.auth-message[data-tone="success"] { border-color: #d4e8dd; background: #f4faf6; color: #39745d; }
.auth-legal { margin-top: 22px; padding-top: 16px; border-top: 1px solid #edf0f3; color: #a1aab5; text-align: center; font-size: 9px; line-height: 1.5; }
.auth-footer { max-width: 1190px; min-height: 40px; color: #99a3af; font-size: 10px; }
.auth-footer nav { display: flex; gap: 20px; }
.auth-footer a { color: #8996a5; text-decoration: none; }
.verify-symbol { width: 47px; height: 47px; display: grid; place-items: center; margin: 4px auto 2px; border-radius: 50%; background: #edf4f8; color: #54799d; font-size: 20px; }
.verify-copy { color: #738195; text-align: center; font-size: 12px; line-height: 1.65; }
.resend-line { display: flex; justify-content: center; gap: 5px; margin: 7px 0 2px; color: #8c98a7; font-size: 10px; }
.invite-banner { display: flex; align-items: center; gap: 12px; margin: -10px -10px 25px; padding: 12px; border: 1px solid #dce7f0; border-radius: 10px; background: #f4f8fb; }
.invite-symbol { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #e4edf5; color: #52769b; }
.invite-banner strong, .invite-banner small { display: block; }
.invite-banner strong { color: #354a62; font-size: 11px; }
.invite-banner small { margin-top: 3px; color: #79889a; font-size: 10px; }

/* Workspace */
.workspace-screen { min-height: 100vh; height: 100dvh; display: grid; grid-template-columns: 270px minmax(0, 1fr); overflow: hidden; background: #fff; }
.chat-sidebar { z-index: 5; min-width: 0; display: flex; flex-direction: column; padding: 19px 14px 12px; border-right: 1px solid #e5e9ed; background: #f8f9fb; }
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 20px; }
.sidebar-brand .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
.sidebar-brand strong { font-size: 12px; }
.sidebar-brand small { font-size: 8px; }
.workspace-picker { position: relative; padding: 0 2px 18px; }
.workspace-picker-label, .sidebar-section-heading { color: #98a2ae; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.workspace-picker-label { display: block; padding: 0 8px 8px; }
.workspace-current { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 9px; padding: 5px 8px; border: 1px solid #e4e8ed; border-radius: 9px; background: #fff; cursor: pointer; text-align: left; }
.workspace-current:hover { border-color: #cad5df; }
.workspace-current > [data-workspace-name] { min-width: 0; flex: 1; overflow: hidden; color: #35465b; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.workspace-avatar, .account-avatar { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: #e9eff5; color: #527092; font-size: 9px; font-weight: 750; }
.picker-chevron { color: #8693a1; font-size: 15px; }
.sidebar-search { min-height: 34px; display: flex; align-items: center; gap: 8px; margin: -3px 2px 12px; padding: 0 9px; border: 1px solid #e6eaee; border-radius: 7px; background: #fff; color: #8b98a6; }
.sidebar-search:focus-within { border-color: #b6c6d6; box-shadow: 0 0 0 2px rgba(72,112,157,.08); }
.sidebar-search > span { font-size: 17px; line-height: 1; }
.sidebar-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #526277; font-size: 10px; }
.sidebar-search input::placeholder { color: #9ba6b2; }
.search-empty { margin: 8px 9px; color: #94a0ad; font-size: 10px; }
.workspace-menu { position: absolute; z-index: 15; top: calc(100% - 13px); right: 0; left: 0; padding: 5px; border: 1px solid #e3e8ed; border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(29,45,64,.13); }
.workspace-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 8px; border: 0; border-radius: 6px; background: transparent; color: #526277; cursor: pointer; text-align: left; font-size: 10px; }
.workspace-menu button:hover { background: #f3f6f8; }
.workspace-menu .workspace-menu-create { margin-top: 4px; border-top: 1px solid #edf0f3; border-radius: 0 0 6px 6px; color: #416c99; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 7px; }
.tiny-action { width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: #718095; cursor: pointer; font-size: 18px; line-height: 1; }
.tiny-action:hover { background: #e9edf1; color: #314c6a; }
.conversation-list { min-height: 0; display: grid; align-content: start; gap: 2px; }
.conversation-item { width: 100%; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: #657489; cursor: pointer; text-align: left; }
.conversation-item:hover { background: #edf1f4; color: #31445a; }
.conversation-item.is-active { background: #e8eef4; color: #294764; }
.conversation-symbol { width: 17px; flex: 0 0 auto; color: #8494a4; text-align: center; font-size: 13px; }
.conversation-item.is-active .conversation-symbol { color: #4c7094; }
.conversation-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.unread-count { min-width: 18px; padding: 3px 5px; border-radius: 10px; background: #dce8f2; color: #365b7f; text-align: center; font-size: 9px; font-weight: 700; }
.direct-heading { margin-top: 12px; }
.sidebar-spacer { flex: 1; min-height: 20px; }
.invite-button { width: 100%; min-height: 37px; display: flex; align-items: center; gap: 8px; margin: 9px 0 10px; padding: 0 10px; border: 1px solid #e2e7ec; border-radius: 8px; background: #fff; color: #52647a; cursor: pointer; text-align: left; font-size: 10px; font-weight: 600; }
.invite-button:hover { border-color: #cbd7e2; background: #fafcfd; }
.invite-button > span { color: #4d7499; font-size: 15px; }
.sidebar-account { display: flex; align-items: center; gap: 9px; padding: 10px 4px 2px; border-top: 1px solid #e8ebef; }
.account-avatar { width: 30px; height: 30px; border-radius: 50%; background: #e9edf3; color: #536d8a; }
.account-name { min-width: 0; flex: 1; }
.account-name strong, .account-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name strong { color: #435267; font-size: 10px; font-weight: 650; }
.account-name small { margin-top: 3px; color: #929daa; font-size: 9px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #778596; cursor: pointer; font-size: 15px; }
.icon-button:hover { background: #edf1f4; color: #354e69; }
.chat-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: 72px minmax(0, 1fr) auto; background: #fff; }
.chat-topbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; border-bottom: 1px solid #e9edf0; }
.conversation-heading { min-width: 0; }
.conversation-title-line { display: flex; align-items: center; gap: 8px; }
.conversation-title-line h1 { margin: 0; overflow: hidden; color: #26394e; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 680; letter-spacing: -.02em; }
.channel-hash { color: #8493a2; font-size: 16px; }
.conversation-heading p { margin: 5px 0 0 24px; color: #97a1ad; font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 19px; }
.connection-state { display: flex; align-items: center; gap: 8px; color: #778596; font-size: 10px; white-space: nowrap; }
.connection-state i { width: 6px; height: 6px; }
.connection-state[data-state="loading"] i { background: #c79343; box-shadow: 0 0 0 4px rgba(199,147,67,.13); }
.connection-state[data-state="error"] i { background: #b95459; box-shadow: 0 0 0 4px rgba(185,84,89,.12); }
.member-count { min-width: 48px; height: 31px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #e7ebef; border-radius: 7px; background: #fff; color: #718095; cursor: pointer; font-size: 11px; }
.member-count:hover { background: #f8fafb; }
.member-count b { color: #506177; font-size: 10px; }
.mobile-menu-button, .sidebar-close { display: none; }
.message-area { position: relative; min-height: 0; overflow-y: auto; padding: 26px clamp(24px, 5vw, 76px) 20px; scrollbar-color: #d9dfe5 transparent; scrollbar-width: thin; }
.load-older-button { display: block; margin: 0 auto 18px; padding: 8px 12px; border: 1px solid #e4e9ee; border-radius: 7px; background: #fff; color: #62768b; cursor: pointer; font: inherit; font-size: 10px; transition: background .18s ease, border-color .18s ease; }
.load-older-button:hover { border-color: #cfd9e2; background: #f7f9fb; }
.load-older-button:disabled { cursor: wait; opacity: .65; }
.message-list { width: min(100%, 920px); margin: 0 auto; display: grid; align-content: end; gap: 0; }
.message-day { display: flex; align-items: center; gap: 15px; margin: 12px 0 21px; color: #9aa4af; font-size: 9px; }
.message-day::before, .message-day::after { height: 1px; flex: 1; background: #edf0f2; content: ""; }
.message-row { display: flex; gap: 12px; margin: 0 0 17px; }
.message-row.is-mine { flex-direction: row-reverse; }
.message-avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #edf1f5; color: #637b94; font-size: 9px; font-weight: 700; }
.message-row.is-mine .message-avatar { background: #e7eef5; color: #42688f; }
.message-content { min-width: 0; max-width: min(78%, 700px); }
.message-meta { display: flex; align-items: baseline; gap: 8px; margin: 1px 0 5px; }
.message-row.is-mine .message-meta { justify-content: flex-end; }
.message-meta strong { color: #43556a; font-size: 10px; font-weight: 700; }
.message-meta time { color: #a4adb8; font-size: 9px; }
.message-bubble { padding: 10px 13px; border: 1px solid #edf0f3; border-radius: 3px 12px 12px 12px; background: #f8f9fa; color: #425165; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-bubble a { color: #315f88; text-decoration: underline; text-decoration-color: #b7cadd; text-underline-offset: 2px; }
.message-bubble code { padding: 1px 4px; border-radius: 4px; background: #e7edf1; color: #3d566e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
.message-row.is-mine .message-bubble { border-color: #e3ebf2; border-radius: 12px 3px 12px 12px; background: #f0f5f9; }
.conversation-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 25px; text-align: center; }
.empty-orbit { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid #e3eaf0; border-radius: 18px; background: #f5f8fa; color: #7790a8; font-size: 25px; }
.conversation-empty h2 { margin: 17px 0 7px; color: #45586f; font-size: 16px; letter-spacing: -.025em; }
.conversation-empty p { max-width: 310px; margin: 0; color: #909ca9; font-size: 11px; line-height: 1.6; }
.message-composer { width: min(calc(100% - 48px), 920px); margin: 0 auto 24px; padding: 12px 14px 10px; border: 1px solid #dfe5ea; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(34,50,68,.045); }
.message-composer .message-input, .thread-composer .message-input { width: 100%; min-height: 37px; max-height: 160px; display: block; overflow-y: auto; padding: 4px 1px 9px; border: 0; outline: 0; background: transparent; color: #35485d; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-composer .message-input:empty::before, .thread-composer .message-input:empty::before { content: attr(data-placeholder); color: #a0aab5; pointer-events: none; }
.message-composer .message-input strong, .message-composer .message-input b, .thread-composer .message-input strong, .thread-composer .message-input b { font-weight: 750; color: #2f4358; }
.message-composer .message-input code, .thread-composer .message-input code { padding: 1px 4px; border-radius: 4px; background: #e7edf1; color: #3d566e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 8px; border-top: 1px solid #f0f2f4; color: #a1aab5; font-size: 9px; }
.send-button { min-height: 30px; display: inline-flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; border: 0; border-radius: 7px; background: var(--navy); color: #fff; cursor: pointer; font-size: 10px; font-weight: 650; }
.send-button:hover { background: #284d73; }
.send-button:disabled { cursor: wait; opacity: .55; }
.send-button b { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 5px; background: rgba(255,255,255,.16); font-size: 14px; }
.chat-toast { position: fixed; z-index: 30; right: 24px; bottom: 22px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #dce4eb; border-radius: 9px; background: #fff; color: #4d5f73; box-shadow: 0 8px 28px rgba(26,43,62,.15); font-size: 11px; line-height: 1.5; }
.chat-toast[data-tone="error"] { border-color: #efd9da; color: #98494e; }

.chat-dialog { width: min(460px, calc(100vw - 28px)); max-height: min(86vh, 740px); padding: 0; overflow: auto; border: 1px solid #e4e9ee; border-radius: 15px; background: #fff; color: var(--ink); box-shadow: 0 25px 90px rgba(16,32,49,.2); }
.chat-dialog::backdrop { background: rgba(18,34,51,.34); backdrop-filter: blur(3px); }
.dialog-form { position: relative; padding: 29px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 31px; height: 31px; border: 0; border-radius: 7px; background: transparent; color: #8a96a3; cursor: pointer; font-size: 21px; }
.dialog-close:hover { background: #f2f4f6; color: #41546b; }
.dialog-form h2 { margin: 10px 34px 9px 0; color: #26394e; font-size: 21px; letter-spacing: -.035em; }
.dialog-form > p:not(.dialog-eyebrow) { margin: 0 0 19px; color: #7e8b9a; font-size: 11px; line-height: 1.6; }
.dialog-form .field-label { margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.dialog-actions button { min-height: 38px; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; top: 50%; left: 13px; color: #8c99a7; transform: translateY(-50%); font-size: 14px; }
.input-prefix .text-field { padding-left: 31px; }
.member-list { display: grid; gap: 2px; max-height: 360px; overflow: auto; margin-top: 16px; }
.member-search { margin-top: 8px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 3px; border-bottom: 1px solid #f0f2f4; }
.member-row .account-avatar { width: 32px; height: 32px; }
.member-row strong { display: block; color: #4c5c70; font-size: 11px; }
.member-row small { display: block; margin-top: 3px; color: #98a2ae; font-size: 9px; }
.account-details { display: grid; gap: 5px; padding: 13px; border: 1px solid #edf0f3; border-radius: 9px; background: #f9fafb; }
.account-details strong { color: #46586e; font-size: 12px; }
.account-details span { color: #8793a1; font-size: 10px; }
.account-dialog-actions { display: grid; gap: 9px; margin-top: 15px; }
.account-dialog-actions button { text-align: left; }
.select-field { appearance: none; cursor: pointer; }
.invite-management { margin: 0 29px 25px; padding-top: 19px; border-top: 1px solid #edf0f3; }
.management-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.management-heading h3 { margin: 5px 0 0; color: #42546a; font-size: 13px; letter-spacing: -.02em; }
.management-heading .tiny-action { flex: 0 0 auto; }
.invite-list { display: grid; gap: 7px; max-height: 230px; overflow: auto; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px 11px; border: 1px solid #e8edf1; border-radius: 9px; background: #fbfcfd; }
.invite-row-main { min-width: 0; }
.invite-row-email { display: block; overflow: hidden; color: #4a5d72; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.invite-row-meta { display: block; margin-top: 4px; color: #8996a3; font-size: 8px; line-height: 1.45; }
.invite-row-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; color: #788797; font-size: 8px; }
.invite-row-status::before { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #b9c4ce; content: ""; }
.invite-row-status[data-status="PENDING"] { color: #527294; }
.invite-row-status[data-status="PENDING"]::before { background: #5d8caf; }
.invite-row-status[data-status="ACCEPTED"] { color: #4d846e; }
.invite-row-status[data-status="ACCEPTED"]::before { background: #69a58d; }
.invite-row-status[data-status="EXPIRED"], .invite-row-status[data-status="REVOKED"] { color: #a07b70; }
.invite-row-status[data-status="EXPIRED"]::before, .invite-row-status[data-status="REVOKED"]::before { background: #c39a8a; }
.invite-row .secondary-button { min-height: 28px; padding: 0 8px; font-size: 9px; }
.account-dialog-form { padding-bottom: 24px; }
.account-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 18px 0 17px; padding: 3px; border-radius: 9px; background: #f2f5f7; }
.account-tab { min-height: 31px; border: 0; border-radius: 7px; background: transparent; color: #8190a0; cursor: pointer; font: inherit; font-size: 9px; font-weight: 650; }
.account-tab:hover { color: #4f6883; }
.account-tab.is-active { background: #fff; color: #395a78; box-shadow: 0 2px 8px rgba(34, 59, 83, .08); }
.account-panel[hidden] { display: none; }
.account-section-lead { margin: 0 0 14px; color: #7f8c9a; font-size: 10px; line-height: 1.55; }
.account-note { margin: 9px 0 0; color: #99a4af; font-size: 9px; line-height: 1.5; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #eef1f3; cursor: pointer; }
.setting-row:last-of-type { border-bottom: 0; }
.setting-row span { min-width: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { color: #526276; font-size: 10px; }
.setting-row small { margin-top: 3px; color: #96a1ac; font-size: 8px; line-height: 1.4; }
.setting-row input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #3f6d95; }
.notification-channel-label { margin: 17px 0 1px; color: #9aa6b2; font-size: 8px; font-weight: 750; letter-spacing: .13em; }
.notification-permission { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 9px 10px; border: 1px solid #e8edf1; border-radius: 8px; background: #f8fafb; color: #8794a1; font-size: 9px; line-height: 1.35; }
.notification-permission .secondary-button { min-height: 29px; padding: 0 9px; font-size: 9px; }
.account-panel .dialog-actions { margin-top: 17px; }
.account-panel .account-dialog-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf0f3; }
.danger-eyebrow { color: #ae5b5e; }

@media (min-width: 1500px) {
  .auth-screen { padding-right: max(6.4vw, calc((100vw - 1450px)/2)); padding-left: max(6.4vw, calc((100vw - 1450px)/2)); }
}
@media (max-width: 980px) {
  .auth-screen { padding-right: 5vw; padding-left: 5vw; }
  .auth-grid { gap: 6vw; grid-template-columns: minmax(0, 1fr) minmax(350px, .9fr); }
  .auth-card { padding: 31px 27px 24px; }
  .workspace-screen { grid-template-columns: 245px minmax(0, 1fr); }
  .chat-topbar { padding-right: 22px; padding-left: 22px; }
}
@media (max-width: 720px) {
  .auth-screen { padding: 0 20px 14px; background: #f5f7f9; }
  .auth-brandbar { height: 67px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .auth-grid { min-height: auto; display: block; padding: 29px 0 27px; }
  .auth-story { max-width: 520px; padding: 0 2px 24px; }
  .eyebrow { margin-bottom: 12px; font-size: 9px; }
  .auth-story h1 { font-size: clamp(34px, 8.6vw, 52px); }
  .auth-story-copy { max-width: 400px; margin: 13px 0 0; font-size: 13px; line-height: 1.6; }
  .story-points, .auth-story-foot { display: none; }
  .auth-card { max-width: 480px; margin: 0 auto; padding: 25px 21px 20px; border-radius: 13px; }
  .auth-card-head { margin-bottom: 19px; }
  .auth-card-head h2 { margin-top: 9px; font-size: 23px; }
  .auth-card-head p { font-size: 11px; }
  .auth-footer { align-items: flex-start; gap: 12px; padding-top: 5px; font-size: 9px; }
  .auth-footer nav { flex-wrap: wrap; justify-content: flex-end; gap: 8px 13px; }
  .workspace-screen { position: relative; grid-template-columns: minmax(0,1fr); }
  .chat-sidebar { position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 15px 0 40px rgba(20,35,51,.13); }
  .chat-sidebar.is-open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; z-index: 4; inset: 0; background: rgba(20,34,49,.28); }
  .sidebar-close { display: grid; }
  .chat-main { height: 100dvh; grid-template-rows: 64px minmax(0,1fr) auto; }
  .chat-topbar { justify-content: flex-start; gap: 11px; padding: 0 13px; }
  .mobile-menu-button { display: grid; flex: 0 0 auto; }
  .conversation-heading { flex: 1; }
  .conversation-title-line h1 { max-width: 43vw; font-size: 12px; }
  .conversation-heading p { max-width: 43vw; overflow: hidden; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
  .topbar-actions { gap: 10px; }
  .connection-state { gap: 6px; font-size: 9px; }
  .member-count { min-width: 39px; height: 29px; }
  .message-area { padding: 17px 13px 14px; }
  .message-row { gap: 8px; margin-bottom: 14px; }
  .message-avatar { width: 28px; height: 28px; border-radius: 9px; }
  .message-content { max-width: 86%; }
  .message-bubble { padding: 9px 10px; font-size: 11px; }
  .message-composer { width: calc(100% - 20px); margin-bottom: max(10px, env(safe-area-inset-bottom)); padding: 10px 10px 8px; border-radius: 10px; }
  .message-composer .message-input { min-height: 34px; font-size: 12px; }
  .composer-footer { font-size: 8px; }
  .send-button { min-height: 29px; }
  .send-button > span { display: none; }
  .send-button b { width: 22px; height: 22px; }
  .chat-toast { right: 12px; bottom: 12px; }
  .dialog-form { padding: 25px 21px 21px; }
  .invite-management { margin-right: 21px; margin-left: 21px; }
}
@media (max-width: 380px) {
  .auth-screen { padding-right: 14px; padding-left: 14px; }
  .auth-card { padding-right: 17px; padding-left: 17px; }
  .site-return { font-size: 11px; }
  .connection-state > span { display: none; }
  .composer-footer > span { max-width: 70%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Message tools and the focused thread workspace. */
.chat-main.has-thread { grid-template-columns: minmax(0, 1fr) 350px; }
.chat-main.has-thread .chat-topbar { grid-column: 1 / -1; grid-row: 1; }
.chat-main.has-thread .message-area,
.chat-main.has-thread .message-composer { grid-column: 1; }
.thread-panel { min-width: 0; grid-column: 2; grid-row: 2 / 4; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border-left: 1px solid #e8edf1; background: #fff; }
.thread-panel[hidden], .emoji-picker[hidden] { display: none !important; }
.thread-topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 17px; border-bottom: 1px solid #edf0f3; }
.thread-topbar .dialog-eyebrow { margin: 0; font-size: 8px; }
.thread-topbar h2 { margin: 4px 0 0; color: #34485d; font-size: 13px; letter-spacing: -.02em; }
.thread-parent { max-height: 260px; overflow: auto; padding: 15px 14px 11px; border-bottom: 1px solid #edf0f3; background: #fbfcfd; }
.thread-parent .message-row { margin: 0; }
.thread-message-list { min-height: 0; overflow: auto; padding: 15px 14px; overscroll-behavior: contain; }
.thread-message-list .message-row { margin-bottom: 15px; }
.thread-message-list .message-content { max-width: 100%; }
.thread-empty { margin: auto; padding: 22px 10px; color: #8995a3; font-size: 11px; line-height: 1.6; text-align: center; }
.thread-composer { position: relative; margin: 9px 12px 13px; padding: 10px 11px 8px; border: 1px solid #dfe5ea; border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(34,50,68,.045); }
.thread-composer .message-input { min-height: 34px; max-height: 130px; padding: 3px 1px 8px; font-size: 11px; }
.thread-composer .composer-footer { gap: 8px; font-size: 8px; }
.thread-composer .send-button { min-height: 28px; padding-left: 9px; }
.thread-composer-tools { display: flex; align-items: center; gap: 9px; min-height: 28px; margin: -2px 0 4px; }
.thread-composer-tools small { color: #9aa5b0; font-size: 8px; }
.thread-format-button { min-width: 26px; min-height: 25px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #718297; cursor: pointer; font: inherit; font-size: 10px; font-weight: 750; }
.thread-format-button:hover, .thread-format-button:focus-visible { border-color: #e4eaf0; background: #f8fafb; color: #3f5d79; outline: 0; }
.thread-format-button.is-italic { font-style: italic; }
.thread-format-button.is-code { min-width: 34px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; }
.thread-attach-button { min-height: 25px; display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; color: #738397; cursor: pointer; font-size: 9px; }
.thread-attach-button:hover, .thread-attach-button:focus-within { border-color: #e4eaf0; background: #f8fafb; color: #3f5d79; }
.thread-attach-button > span { font-size: 13px; }
.thread-mention-button { background: transparent; font: inherit; }
.thread-mention-button:hover, .thread-mention-button:focus-visible { border-color: #e4eaf0; background: #f8fafb; color: #3f5d79; outline: 0; }
.thread-attach-button input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.thread-attachment-list { margin: 0 0 7px; }
.message-content { position: relative; }
.message-meta { flex-wrap: wrap; }
.message-edited { color: #9aa5b1; font-size: 9px; }
.message-row.is-deleted .message-bubble { color: #98a2ad; background: #f6f7f8; font-style: italic; }
.message-actions { display: flex; align-items: center; gap: 4px; min-height: 25px; margin-top: 4px; opacity: .72; transition: opacity .16s ease; }
.message-row:hover .message-actions, .message-row:focus-within .message-actions { opacity: 1; }
.message-action { min-height: 25px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #738193; cursor: pointer; font: inherit; font-size: 9px; line-height: 1.2; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.message-action:hover { border-color: #e1e7ed; background: #f7f9fb; color: #344b63; }
.message-action.has-replies { color: #365f87; font-weight: 650; }
.message-action.is-primary { border-color: #203c5b; background: #203c5b; color: #fff; }
.message-action.is-primary:hover { background: #2b5279; }
.message-reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.reaction-chip { min-height: 26px; border-color: #e6ebef; background: #fff; color: #59697a; font-size: 10px; }
.reaction-chip.is-reacted { border-color: #a9c7e1; background: #edf5fb; color: #214d73; }
.emoji-picker { position: absolute; z-index: 3; right: 0; bottom: 27px; display: flex; gap: 3px; padding: 5px; border: 1px solid #e1e7ed; border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(26,43,62,.14); }
.emoji-option { width: 30px; height: 30px; padding: 0; color: #465a70; font-size: 15px; }
.emoji-option:hover { border-color: #d7e4ef; background: #f1f6fa; }
.message-editor { margin-top: 2px; }
.message-edit-input { width: 100%; min-height: 70px; max-height: 190px; resize: vertical; padding: 10px 11px; border: 1px solid #cbd7e2; border-radius: 9px; background: #fff; color: #35485d; font: inherit; font-size: 12px; line-height: 1.55; }
.message-edit-input:focus { border-color: #7193b2; outline: 3px solid rgba(80,125,164,.12); }
.message-edit-actions { display: flex; justify-content: flex-end; gap: 5px; margin-top: 6px; }
.message-row.is-highlighted { animation: message-highlight 1.7s ease-out; }
@keyframes message-highlight { 0%, 35% { background: rgba(233,241,248,.95); } 100% { background: transparent; } }
.topbar-search-button { width: 31px; height: 31px; flex: 0 0 auto; color: #68798b; font-size: 20px; }
.search-dialog { width: min(560px, calc(100vw - 28px)); }
.search-dialog .dialog-form { padding-bottom: 18px; }
.search-dialog .input-prefix .text-field { min-height: 44px; font-size: 12px; }
.search-status { min-height: 22px; margin-top: 9px; color: #8491a0; font-size: 10px; }
.search-status[data-tone="error"] { color: #a64f52; }
.search-results { display: grid; gap: 6px; max-height: min(52vh, 440px); overflow: auto; margin-top: 3px; overscroll-behavior: contain; }
.search-result { display: grid; gap: 6px; width: 100%; padding: 11px 12px; border: 1px solid #e8edf1; border-radius: 9px; background: #fff; color: #536477; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease; }
.search-result:hover, .search-result:focus-visible { border-color: #bfd2e3; background: #f7fafc; outline: 0; }
.search-result-meta { color: #7e8c9b; font-size: 9px; }
.search-result-body { overflow: hidden; color: #3e5064; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (hover: none) {
  .message-actions { opacity: 1; }
}
@media (max-width: 980px) and (min-width: 721px) {
  .chat-main.has-thread { grid-template-columns: minmax(0, 1fr) 310px; }
  .thread-parent { padding-right: 10px; padding-left: 10px; }
}
@media (max-width: 720px) {
  .chat-main.has-thread { grid-template-columns: minmax(0, 1fr); }
  .chat-main.has-thread .message-area,
  .chat-main.has-thread .message-composer { grid-column: 1; }
  .thread-panel { position: fixed; z-index: 8; inset: 64px 0 0; width: 100vw; height: calc(100dvh - 64px); border-left: 0; box-shadow: 0 12px 32px rgba(19,34,50,.16); }
  .thread-topbar { min-height: 58px; padding-right: 15px; padding-left: 15px; }
  .thread-parent { max-height: 34vh; padding: 12px 12px 9px; }
  .thread-message-list { padding: 12px; }
  .thread-composer { margin: 8px 10px max(10px, env(safe-area-inset-bottom)); }
  .message-actions { gap: 2px; }
  .message-action { padding-right: 6px; padding-left: 6px; }
  .topbar-search-button { width: 29px; height: 29px; }
  .topbar-actions { gap: 4px; }
  .feature-button, .topbar-search-button { width: 28px; height: 28px; }
  .member-count { min-width: 34px; height: 28px; gap: 3px; padding: 0 5px; }
}

/* Collaboration tools: private saves, shared pins, mentions and guarded files. */
.message-actions { flex-wrap: wrap; }
.message-composer { position: relative; }
.message-action.is-active { border-color: #d7e4ee; background: #f2f7fa; color: #315b7d; }
.message-markers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.message-markers span { padding: 4px 7px; border: 1px solid #e7edf1; border-radius: 99px; background: #fbfcfd; color: #74869a; font-size: 8px; }
.message-attachments { display: grid; gap: 6px; width: min(100%, 390px); margin-top: 8px; }
.message-file { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #e3eaf0; border-radius: 9px; background: #fff; color: #42566b; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.message-file:hover { border-color: #c5d6e4; background: #f8fbfd; }
.file-symbol { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: #edf3f7; color: #4e6f8c; font-size: 14px; }
.file-detail { min-width: 0; display: grid; gap: 3px; }
.file-detail strong { overflow: hidden; color: #43576c; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-detail small { color: #9aa5b0; font-size: 8px; }
.feature-button { position: relative; width: 30px; height: 30px; flex: 0 0 auto; color: #697b8d; font-size: 16px; }
.mention-button > span { font-size: 12px; font-weight: 700; }
.mention-button b { position: absolute; top: 0; right: 0; min-width: 14px; height: 14px; display: grid; place-items: center; padding: 0 3px; border: 1px solid #fff; border-radius: 99px; background: #b65b62; color: #fff; font-size: 7px; line-height: 1; }
.mention-button b[hidden] { display: none; }
.notification-button { font-size: 17px; }
.notification-button b { position: absolute; top: 0; right: 0; min-width: 14px; height: 14px; display: grid; place-items: center; padding: 0 3px; border: 1px solid #fff; border-radius: 99px; background: #3f6d95; color: #fff; font-size: 7px; line-height: 1; }
.notification-button b[hidden] { display: none; }
.composer-tools { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 30px; margin: 0 -3px 7px; }
.composer-tool { min-height: 27px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #738397; cursor: pointer; font: inherit; font-size: 9px; }
.composer-tool:hover, .composer-tool:focus-within { border-color: #e4eaf0; background: #f8fafb; color: #3f5d79; }
.composer-tool > span:first-of-type { font-size: 13px; font-weight: 650; }
.format-tool { width: 27px; justify-content: center; padding: 0; color: #687b8e; font-weight: 750; }
.format-tool.is-italic { font-style: italic; }
.format-tool.is-struck { text-decoration: line-through; }
.format-tool.is-code { width: 34px; font-size: 8px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.composer-tool input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.upload-hint { margin-left: auto; color: #a1aab4; font-size: 8px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.attachment-chip { max-width: 100%; display: inline-flex; align-items: center; gap: 7px; padding: 5px 7px 5px 9px; border: 1px solid #e3eaf0; border-radius: 7px; background: #f8fafb; color: #5d6f82; font-size: 9px; }
.attachment-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { width: 18px; height: 18px; flex: 0 0 auto; border: 0; border-radius: 5px; background: transparent; color: #8995a2; cursor: pointer; font-size: 15px; }
.attachment-chip button:hover { background: #e9eef2; color: #52687d; }
.mention-menu { position: absolute; z-index: 6; bottom: calc(100% - 8px); left: 12px; width: min(280px, calc(100% - 24px)); max-height: 240px; overflow: auto; padding: 6px; border: 1px solid #e1e7ed; border-radius: 10px; background: #fff; box-shadow: 0 14px 38px rgba(26,43,62,.17); }
.composer-emoji-menu { position: absolute; z-index: 7; bottom: calc(100% - 7px); left: clamp(90px, 35vw, 157px); display: grid; grid-template-columns: repeat(7, 32px); gap: 3px; padding: 6px; border: 1px solid #e1e7ed; border-radius: 10px; background: #fff; box-shadow: 0 14px 38px rgba(26,43,62,.17); }
.composer-emoji-menu[hidden] { display: none !important; }
.composer-emoji-option { width: 32px; height: 31px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 16px; }
.composer-emoji-option:hover, .composer-emoji-option:focus-visible { background: #edf3f7; outline: 0; }
.mention-menu[hidden] { display: none !important; }
.mention-option { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px; border: 0; border-radius: 7px; background: transparent; color: #465a70; cursor: pointer; text-align: left; font: inherit; font-size: 10px; }
.mention-option:hover, .mention-option:focus-visible { background: #f3f7fa; outline: 0; }
.mention-option .account-avatar { width: 26px; height: 26px; }
.mention-empty { margin: 7px; color: #8c99a7; font-size: 10px; line-height: 1.5; }
.sidebar-heading-actions { display: inline-flex; align-items: center; gap: 2px; }
.group-member-list { display: grid; gap: 3px; max-height: min(42vh, 300px); overflow: auto; margin-top: 10px; padding: 5px; border: 1px solid #e8edf1; border-radius: 9px; }
.group-member-option { display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 5px 7px; border-radius: 6px; color: #506176; cursor: pointer; font-size: 10px; }
.group-member-option:hover { background: #f5f8fa; }
.group-member-option input { width: 15px; height: 15px; accent-color: #284d73; }
.collection-dialog { width: min(580px, calc(100vw - 28px)); }
.collection-dialog .dialog-form { padding-bottom: 19px; }
.collection-list { display: grid; gap: 7px; max-height: min(58vh, 480px); overflow: auto; overscroll-behavior: contain; }
.notification-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-right: 25px; }
.notification-dialog-heading h2 { margin-bottom: 0; }
.notification-read-all { min-height: 29px; flex: 0 0 auto; padding: 0 9px; font-size: 9px; }
.notification-list { display: grid; gap: 7px; max-height: min(58vh, 480px); overflow: auto; overscroll-behavior: contain; }
.notification-item { display: grid; gap: 5px; width: 100%; padding: 11px 12px; border: 1px solid #e8edf1; border-radius: 9px; background: #fff; color: #536477; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease; }
.notification-item:hover, .notification-item:focus-visible { border-color: #bfd2e3; background: #f7fafc; outline: 0; }
.notification-item.is-unread { border-color: #d3e1eb; background: #f8fbfd; box-shadow: inset 3px 0 #4d789c; }
.notification-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #8c99a6; font-size: 8px; }
.notification-item-title { color: #3d5267; font-size: 10px; font-weight: 700; }
.notification-item-body { color: #617286; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.collection-item { display: grid; gap: 6px; width: 100%; padding: 11px 12px; border: 1px solid #e8edf1; border-radius: 9px; background: #fff; color: #536477; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease; }
.collection-item:hover, .collection-item:focus-visible { border-color: #bfd2e3; background: #f7fafc; outline: 0; }
.collection-item-body { color: #3e5064; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.scheduled-list { display: grid; gap: 8px; max-height: min(58vh, 480px); overflow: auto; overscroll-behavior: contain; }
.scheduled-item { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #e8edf1; border-radius: 9px; background: #fff; }
.scheduled-item-details { min-width: 0; }
.scheduled-item-details small { display: block; color: #8190a0; font-size: 9px; line-height: 1.5; }
.scheduled-item-details p { margin: 6px 0 0; color: #3e5064; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.scheduled-cancel { min-height: 29px; flex: 0 0 auto; padding: 0 9px; font-size: 9px; }
.scheduled-cancel:disabled { opacity: .55; cursor: wait; }
.scheduled-body { min-height: 125px; resize: vertical; padding: 10px 11px; font-size: 11px; line-height: 1.5; }
.scheduled-body:focus { border-color: #7193b2; outline: 3px solid rgba(80,125,164,.12); }
@media (max-width: 720px) {
  .message-composer { padding-bottom: 8px; }
  .composer-tools { gap: 4px; }
  .composer-tool { padding: 0 6px; }
  .upload-hint { max-width: 43%; text-align: right; line-height: 1.3; }
  .message-content { max-width: 88%; }
  .chat-topbar { gap: 6px; padding-right: 8px; padding-left: 8px; }
  .conversation-heading { min-width: 0; flex: 1 1 auto; }
  .conversation-title-line h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { flex: 0 0 auto; }
  .topbar-actions .connection-state { display: none; }
  .topbar-actions .feature-button, .topbar-search-button { width: 25px; height: 25px; }
  .topbar-actions .member-count { min-width: 30px; height: 26px; padding: 0 4px; }
  .topbar-actions { gap: 2px; }
  .scheduled-item { align-items: flex-start; gap: 8px; padding: 9px; }
  .scheduled-cancel { min-height: 27px; padding: 0 7px; }
}

/* Interaction scale: calm, visible controls with reliable touch targets. */
:root {
  --control-sm: 30px;
  --control-md: 36px;
  --control-lg: 42px;
  --control-radius: 9px;
}

.icon-button {
  width: var(--control-md);
  min-width: var(--control-md);
  height: var(--control-md);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-size: 16px;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.icon-button:hover, .icon-button:focus-visible {
  border-color: #dfe7ee;
  background: #f2f6f9;
  color: #2f5578;
  outline: 0;
}
.icon-button:active { transform: translateY(1px); }
.tiny-action {
  width: var(--control-sm);
  min-width: var(--control-sm);
  height: var(--control-sm);
  border: 1px solid transparent;
  border-radius: 8px;
}
.feature-button { width: var(--control-md); height: var(--control-md); }
.topbar-actions { gap: 8px; }
.member-count {
  min-width: 48px;
  min-height: var(--control-md);
  height: var(--control-md);
  padding: 0 9px;
  border-radius: var(--control-radius);
}
.primary-button, .secondary-button, .danger-button {
  min-height: 44px;
  border-radius: 10px;
}
.send-button {
  min-height: var(--control-lg);
  padding: 0 12px 0 15px;
  border-radius: 10px;
  font-size: 11px;
  box-shadow: 0 6px 16px rgba(23,45,72,.14);
}
.send-button b { width: 22px; height: 22px; border-radius: 7px; }
.message-action {
  min-height: var(--control-sm);
  padding: 0 10px;
  border-radius: 8px;
  font-size: 10px;
}
.composer-tools { gap: 6px; min-height: var(--control-md); }
.composer-tool {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10px;
}
.format-tool { width: 34px; min-width: 34px; }
.format-tool.is-code { width: 42px; }
.thread-composer-tools { gap: 6px; min-height: 34px; }
.thread-format-button {
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
}
.thread-attach-button { min-height: 32px; padding: 0 9px; border-radius: 8px; }
.thread-composer .send-button { min-height: 38px; }
.invite-row .secondary-button,
.notification-permission .secondary-button,
.scheduled-cancel,
.notification-read-all { min-height: 36px; font-size: 10px; }
.dialog-close { width: 34px; height: 34px; border-radius: 9px; }
.account-tab { min-height: 40px; border-radius: 8px; font-size: 10px; }
.dialog-actions button { min-height: 42px; }
.feature-item button { min-height: 34px; padding: 0 10px; border-radius: 8px; }
.composer-emoji-option { width: 36px; height: 35px; }

@media (max-width: 720px) {
  .chat-topbar { gap: 8px; padding-right: 10px; padding-left: 10px; }
  .topbar-actions { flex: 0 0 min(210px, calc(100vw - 190px)); gap: 5px; min-width: 0; max-width: min(210px, calc(100vw - 190px)); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions #openSearch,
  .topbar-actions #saved,
  .topbar-actions #pins,
  .topbar-actions #scheduled { display: flex; flex: 0 0 auto; }
  .topbar-actions .feature-button,
  .topbar-search-button { width: 34px; min-width: 34px; height: 34px; }
  .topbar-actions .member-count { min-width: 36px; height: 34px; padding: 0 7px; }
  .composer-tools { gap: 4px; }
  .composer-tool { min-width: 36px; min-height: 36px; padding: 0 8px; }
  .format-tool { width: 36px; min-width: 36px; }
  .format-tool.is-code { width: 42px; min-width: 42px; }
  .send-button { min-height: 42px; min-width: 44px; }
  .message-action { min-height: 32px; padding-right: 8px; padding-left: 8px; }
  .thread-format-button, .thread-attach-button { min-height: 36px; }
  .thread-format-button { min-width: 36px; }
  .thread-composer .send-button { min-height: 40px; }
}
