:root {
  --black: var(--bg);
  --white: var(--text);
  --green: var(--accent);
  --muted: var(--text-muted);
  --line: var(--border);
  --panel: var(--surface);
  --sidebar: var(--surface);
  --chat-list-width: 360px;
  --chat-row-height: 68px;
  --message-width: 640px;
  --message-font: 14.7px;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--black); color: var(--white); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { color: var(--text-on-accent); background: var(--accent); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { border-radius: 8px; background: var(--surface-hover); }
::-webkit-scrollbar-track { background: transparent; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.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; }
.app-shell { height: 100vh; height: 100svh; display: grid; grid-template-columns: 72px var(--chat-list-width) minmax(0,1fr); overflow: hidden; }
.app-nav { background: var(--bg); display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--line); position: relative; z-index: 4; }
.brand { display: flex; align-items: center; justify-content: center; gap: 5px; height: 83px; font-size: 27px; letter-spacing: -1.6px; font-weight: 700; }
.brand i { display: block; height: 7px; width: 7px; background: var(--accent-text); border-radius: 50%; }
/* On white, --accent-text resolves to ink, which left the mark a black dot.
   Match the marketing header: lime fill with a 1px ink ring. */
:root[data-theme="light"] .brand i { background: var(--accent); border: 1px solid var(--ink); }
.nav-sections { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 14px 6px; }
.nav-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 60px; padding: 8px 2px; border-radius: 9px; background: transparent; color: var(--text-secondary); font-size: 9px; font-weight: 500; transition: background .15s, color .15s; }
.nav-tab:hover { background: var(--bg-subtle); color: var(--text); }
.nav-tab.active { background: var(--accent-subtle); color: var(--accent-text); }
.nav-tab-icon { position: relative; }
.nav-tab-icon svg { width: 23px; height: 23px; stroke-width: 1.5; }
.nav-unread-dot { position: absolute; width: 6px; height: 6px; background: var(--accent-text); border-radius: 50%; border: 2px solid var(--border-strong); box-sizing: content-box; top: -3px; right: -3px; }
.nav-bottom { margin-top: auto; padding: 25px 0 24px; display: flex; flex-direction: column; align-items: center; gap: 27px; }
.self-avatar { position: relative; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: var(--accent-subtle); color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.self-avatar i { width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--accent-text); position: absolute; bottom: 0; right: 0; }
.chat-sidebar { min-height: 0; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--border-strong); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 21px 20px; }
.sidebar-header h1 { font-size: 24px; letter-spacing: -.8px; font-weight: 550; line-height: 1; }
.sidebar-header h1 span { color: var(--accent-text); }
.sidebar-header p { font-size: 9px; color: var(--text-secondary); margin-top: 10px; letter-spacing: .1px; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; width: 37px; height: 37px; padding: 7px; border-radius: 8px; background: transparent; color: var(--text-secondary); transition: color .15s, background .15s; }
.icon-button:hover { background: var(--surface); color: var(--text); }
.icon-button svg { width: 21px; height: 21px; }
.compose-button { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: 10px; }
.compose-button svg { width: 18px; height: 18px; }
.sidebar-search { position: relative; display: flex; align-items: center; margin: 0 21px 15px; border: 1px solid var(--border-strong); background: var(--bg-subtle); border-radius: 9px; min-height: 43px; gap: 9px; padding: 0 12px; }
.sidebar-search svg { width: 17px; height: 17px; color: var(--text-secondary); }
.sidebar-search input { color: var(--text); min-width: 0; width: 100%; background: none; border: 0; outline: 0; height: 41px; font-size: 11px; }
.sidebar-search:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 2px var(--accent-subtle); }
.sidebar-search input:focus-visible { outline: 0; }
input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: 1; }
.sidebar-search kbd { font-family: inherit; font-size: 17px; color: var(--text-muted); padding-bottom: 3px; }
.list-filters { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.list-filters button { display: flex; align-items: center; gap: 7px; padding: 1px 0 15px; background: none; color: var(--text-secondary); font-size: 11px; position: relative; }
.list-filters button.active { color: var(--text); }
.list-filters button.active:after { position: absolute; content: ""; bottom: -1px; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--accent-text); }
.filter-dot { height: 4px; width: 4px; border-radius: 50%; background: var(--accent-text); }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 9px 9px 18px; }
.chat-row { width: 100%; min-height: var(--chat-row-height); display: flex; align-items: center; gap: 11px; padding: 10px; background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left; position: relative; margin-bottom: 2px; transition: background .15s; }
.chat-row:hover { background: var(--surface-hover); }
.chat-row.active { background: var(--surface-hover); border-color: var(--border-strong); }
.chat-avatar, .message-avatar, .member-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--text-secondary); font-weight: 550; font-size: 14px; position: relative; }
.chat-avatar svg { width: 20px; height: 20px; }
.chat-avatar.group-avatar, .group-avatar { background: var(--surface-raised); color: var(--text); }
.chat-row:nth-of-type(3n) .chat-avatar:not(.group-avatar) { background: var(--accent-subtle); color: var(--text-secondary); }
.chat-row:nth-of-type(3n + 1) .chat-avatar:not(.group-avatar) { background: var(--accent-subtle); color: var(--text); }
.chat-row:nth-of-type(4n) .chat-avatar:not(.group-avatar) { background: var(--surface-hover); color: var(--text); }
.avatar-online, .online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border: 2px solid var(--sidebar); border-radius: 50%; background: var(--accent-text); }
.chat-row-body { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 6px; }
.chat-row-top, .chat-row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-row-top strong { color: var(--text); font-size: 13px; font-weight: 550; letter-spacing: -.1px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-row-top strong svg { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-right: 5px; color: var(--text); }
.chat-row-top time, .chat-row-time { color: var(--text-secondary); font-size: 9px; margin-left: auto; flex-shrink: 0; }
.chat-row.active .chat-row-top time { color: var(--text); }
.chat-row-bottom .preview { font-size: 11px; line-height: 1.4; color: var(--text-secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.chat-row-bottom .preview b { font-weight: 500; color: var(--text); }
.chat-row-bottom .preview.is-draft, .draft-label { color: var(--text); }
.unread-badge { min-width: 19px; height: 19px; border-radius: 50%; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: var(--text-on-accent); background: var(--green); flex-shrink: 0; }
.chat-row .i-pin, .chat-row .row-pin, .chat-row .row-muted, .chat-row-bottom>svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--text-secondary); }
.chat-row.active .chat-row-bottom .preview { color: var(--text); }
.list-empty { padding: 65px 28px; text-align: center; color: var(--text-secondary); }
.list-empty svg { margin: 0 auto 18px; width: 30px; height: 30px; }
.list-empty h2 { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 9px; }
.list-empty p { font-size: 11px; line-height: 1.8; }
.sidebar-footer { display: flex; align-items: center; gap: 7px; padding: 14px 21px; border-top: 1px solid var(--line); font-size: 8px; color: var(--text-secondary); background: var(--sidebar); }
.tiny-dot { width: 4px; height: 4px; display: inline-block; flex-shrink: 0; border-radius: 50%; background: var(--accent-text); }
.sidebar-footer-mark { margin-left: auto; font-size: 14px; color: var(--text-secondary); }
.conversation-screen { min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; background: var(--bg-subtle); isolation: isolate; }
.conversation-screen:before { content: ""; position: absolute; inset: 79px 0 0; z-index: -1; opacity: .55; background-image: radial-gradient(var(--accent-subtle) .75px, transparent .75px); background-size: 23px 23px; mask-image: radial-gradient(ellipse at 50% 45%, #000, transparent 85%); }
.conversation-header { min-height: 83px; display: flex; align-items: center; gap: 15px; padding: 16px 31px; background: var(--bg); border-bottom: 1px solid var(--border-strong); position: relative; z-index: 3; }
.conversation-identity { min-width: 0; display: flex; align-items: center; gap: 13px; background: none; text-align: left; padding: 0; border-radius: 6px; }
.conversation-avatar { width: 43px; height: 43px; border-radius: 50%; background: var(--surface-raised); color: var(--text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 550; font-size: 13px; }
.conversation-avatar svg { width: 23px; height: 23px; }
.conversation-identity>span:last-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.conversation-identity strong { font-size: 14px; font-weight: 550; letter-spacing: -.1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-status { font-size: 10px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.conversation-actions .icon-button { width: 33px; height: 33px; }
.conversation-actions svg { width: 20px; height: 20px; }
.mobile-back { display: none; }
.conversation-welcome { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 15px 20px 0; flex-shrink: 0; }
.conversation-welcome>span:not(.welcome-rule) { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 7px; letter-spacing: 1.5px; }
.welcome-rule { width: 34px; height: 1px; background: var(--surface); }
.conversation-welcome .tiny-dot { width: 3px; height: 3px; background: var(--accent-subtle); }
.message-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 17px 38px 27px; scroll-behavior: smooth; }
.message-thread { max-width: 960px; margin-inline: auto; display: flex; flex-direction: column; gap: 10px; min-height: 100%; justify-content: flex-end; }
.date-pill { align-self: center; background: var(--surface); color: var(--text-secondary); font-size: 9px; padding: 5px 12px; border-radius: 20px; margin-bottom: 7px; margin-top: 4px; letter-spacing: .1px; }
.system-message { align-self: center; text-align: center; font-size: 10px; line-height: 1.7; color: var(--text-secondary); margin-block: 2px 9px; }
.message-row { display: flex; align-items: flex-end; gap: 10px; width: 100%; }
.message-row.incoming { justify-content: flex-start; }
.message-row.outgoing { justify-content: flex-end; padding-left: 45px; }
.message-avatar { width: 31px; height: 31px; font-size: 9px; margin-bottom: 2px; background: var(--accent-subtle); color: var(--text); }
.message-row:nth-of-type(3n) .message-avatar { background: var(--accent-subtle); color: var(--text-muted); }
.message-row:nth-of-type(4n) .message-avatar { background: var(--surface-raised); color: var(--text); }
.message-bubble { background: var(--bubble-in); border: 1px solid var(--border); color: var(--bubble-in-text); max-width: min(var(--message-width), 85%); border-radius: 10px 10px 10px 3px; padding: 8px 12px 6px; min-width: 70px; position: relative; }
.outgoing .message-bubble { color: var(--bubble-out-text); background: var(--bubble-out); border-color: var(--bubble-out); border-radius: 10px 10px 3px 10px; }
.message-author { display: block; margin: 0 0 3px; font-size: 10px; line-height: 1.3; font-weight: 550; color: var(--text); }
.message-text { font-size: var(--message-font); line-height: 1.45; font-weight: 400; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-text a { text-decoration: underline; text-underline-offset: 3px; }
.message-text:empty { display: none; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 2px; color: var(--text-secondary); font-size: 8px; line-height: 1.3; }
.message-meta svg { width: 15px; height: 11px; stroke-width: 1.7; }
.outgoing .message-meta { color: var(--bubble-out-muted); }
.outgoing .message-author { color: var(--bubble-out-muted); }
.message-attachment { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--accent-subtle); border-radius: 7px; margin-bottom: 8px; background: var(--accent-subtle); min-width: 200px; max-width: 100%; }
.message-attachment>svg { width: 23px; height: 23px; color: var(--text); }
.message-attachment strong, .message-attachment span { font-size: 11px; overflow-wrap: anywhere; }
.message-attachment small { display: block; color: var(--text-secondary); font-size: 9px; margin-top: 4px; }
.message-attachment img { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 5px; }
.outgoing .message-attachment { border-color: var(--accent-subtle); background: var(--accent-subtle); }
.outgoing .message-attachment>svg { color: var(--text-muted); }
.outgoing .message-attachment small { color: var(--text-muted); }
.message-text mark { background: var(--accent); color: var(--text-on-accent); border-radius: 2px; padding-inline: 2px; }
.outgoing .message-text mark { background: var(--accent-subtle); color: var(--text); }
.composer-wrap { position: relative; width: calc(100% - 76px); max-width: 960px; margin: 0 auto; padding-top: 5px; padding-bottom: 19px; flex-shrink: 0; }
.composer-form { display: flex; align-items: flex-end; padding: 10px 11px; gap: 12px; border: 1px solid var(--border-strong); background: var(--bg-subtle); border-radius: 12px; box-shadow: 0 7px 30px rgb(0 0 0 / .45); }
.composer-form:focus-within { border-color: var(--border-strong); }
.composer-form>.icon-button { width: 33px; height: 39px; color: var(--text-secondary); }
.composer-form>.icon-button svg { width: 21px; height: 21px; }
.composer-form textarea { flex: 1; width: 100%; min-width: 0; max-height: 132px; height: 39px; resize: none; border: 0; background: none; outline: 0; color: var(--text); font-size: 13px; line-height: 22px; padding: 8px 0; }
.composer-form textarea:focus-visible { outline: 0; }
.send-button { display: flex; align-items: center; justify-content: center; width: 39px; height: 39px; flex-shrink: 0; background: var(--green); color: var(--text-on-accent); border-radius: 9px; transition: background .15s, transform .15s; }
.send-button svg { width: 19px; height: 19px; transform: translateX(-1px); }
.send-button:hover { background: var(--accent-hover); }
.send-button:active { transform: scale(.94); }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 3px 0; color: var(--text-secondary); font-size: 7px; }
.composer-footer>span:first-child { display: flex; gap: 6px; align-items: center; }
.composer-footer .tiny-dot { width: 3px; height: 3px; background: var(--accent-subtle); }
.keyboard-hint { color: var(--text-muted); display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.keyboard-hint kbd { font-family: inherit; font-size: 7px; }
.keyboard-hint>span { margin-inline: 2px; }
.typing-indicator { font-size: 10px; color: var(--text-secondary); padding: 0 5px 11px; }
.attachment-preview { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); margin-bottom: 9px; color: var(--text); font-size: 11px; overflow-wrap: anywhere; }
.attachment-preview img { max-width: 44px; max-height: 40px; object-fit: cover; border-radius: 4px; }
.attachment-preview>span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview button { margin-left: auto; background: none; color: var(--text); flex-shrink: 0; display: grid; place-items: center; }
.attachment-preview button svg { width: 16px; height: 16px; }
.popover { position: absolute; padding: 7px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 10px 45px rgb(0 0 0 / .45); z-index: 10; }
.more-menu { right: 25px; top: 70px; min-width: 220px; }
.more-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 13px; background: none; border-radius: 6px; font-size: 11px; color: var(--text); text-align: left; }
.more-menu button:hover { background: var(--surface-raised); }
.more-menu button svg { width: 17px; height: 17px; }
.emoji-picker { right: 35px; bottom: 103px; display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; }
.emoji-picker button { background: none; padding: 10px; font-size: 22px; border-radius: 6px; }
.emoji-picker button:hover { background: var(--surface-raised); }
.conversation-search { display: flex; align-items: center; gap: 12px; padding: 10px 25px; border-bottom: 1px solid var(--border-strong); background: var(--bg-subtle); flex-shrink: 0; }
.conversation-search>svg { width: 17px; height: 17px; color: var(--text); }
.conversation-search input { min-width: 0; flex: 1; border: 0; background: transparent; color: var(--text); font-size: 12px; padding: 8px 0; outline: none; }
.conversation-search input:focus-visible { outline: 0; }
#search-count { color: var(--text); font-size: 9px; white-space: nowrap; }
.conversation-search>.icon-button { width: 28px; height: 28px; }
.conversation-search>.icon-button svg { width: 16px; height: 16px; }
.app-shell.info-open { grid-template-columns: 72px var(--chat-list-width) minmax(0,1fr) 285px; }
.info-panel { background: var(--bg-subtle); border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; z-index: 8; }
.info-panel>header { display: flex; justify-content: space-between; align-items: center; padding: 22px 21px; border-bottom: 1px solid var(--border-strong); min-height: 83px; }
.info-panel h2 { font-size: 13px; font-weight: 550; }
.info-panel>header .icon-button { width: 29px; height: 29px; }
.info-panel>header svg { width: 17px; height: 17px; }
.info-profile { text-align: center; padding: 32px 20px 28px; }
.info-avatar { margin: 0 auto 18px; width: 78px; height: 78px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-hover); color: var(--text); font-size: 23px; }
.info-avatar svg { width: 33px; height: 33px; }
.info-profile h3 { font-size: 19px; font-weight: 500; letter-spacing: -.5px; overflow-wrap: anywhere; }
.info-profile p { font-size: 10px; color: var(--text-secondary); margin-top: 9px; }
.info-actions { display: flex; gap: 9px; padding: 0 19px 28px; border-bottom: 1px solid var(--border-strong); }
.info-actions button { flex: 1; min-width: 0; display: flex; align-items: center; flex-direction: column; gap: 9px; border-radius: 8px; background: var(--surface); padding: 13px 6px; color: var(--text); font-size: 8px; }
.info-actions button:hover { background: var(--surface-hover); }
.info-actions button svg { width: 20px; height: 20px; }
.members-heading { padding: 24px 22px 14px; color: var(--text-secondary); font-size: 7px; letter-spacing: 1.1px; }
.info-members { padding: 0 16px 23px; }
.member { display: flex; align-items: center; gap: 10px; padding: 11px 6px; }
.member-avatar { width: 35px; height: 35px; background: var(--surface-hover); color: var(--text); font-size: 10px; }
.member:nth-child(2n) .member-avatar { background: var(--accent-subtle); color: var(--text-muted); }
.member-body strong { display: block; font-size: 11px; font-weight: 500; color: var(--text); }
.member-body small { display: block; margin-top: 5px; font-size: 9px; color: var(--text-secondary); }
.info-footnote { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; padding: 25px 15px; color: var(--text-secondary); font-size: 8px; }
dialog { background: var(--bg-subtle); color: var(--white); border: 1px solid var(--border-strong); border-radius: 14px; padding: 27px; box-shadow: 0 25px 110px rgb(0 0 0 / .45); width: calc(100% - 36px); max-height: calc(100svh - 36px); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); }
.new-chat-dialog { max-width: 440px; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 26px; }
.dialog-eyebrow { font-size: 7px; letter-spacing: 1.3px; color: var(--text); }
.dialog-header h2 { font-size: 24px; letter-spacing: -.8px; font-weight: 500; margin-top: 10px; }
.dialog-header .icon-button { margin: -4px -5px 0 0; width: 30px; height: 30px; }
.dialog-header .icon-button svg { width: 17px; height: 17px; }
.new-type-tabs { display: flex; background: var(--bg); border: 1px solid var(--border-strong); padding: 5px; border-radius: 8px; gap: 5px; margin-bottom: 23px; }
.new-type-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; background: transparent; padding: 11px; border-radius: 5px; font-size: 11px; color: var(--text-secondary); }
.new-type-tabs button svg { width: 16px; height: 16px; }
.new-type-tabs button.active { background: var(--surface-raised); color: var(--text); }
.new-chat-dialog form>label { display: block; font-size: 11px; color: var(--text); margin-bottom: 8px; }
.new-chat-dialog input:not([type=checkbox]):not([type=radio]) { width: 100%; min-width: 0; padding: 13px; font-size: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; }
.new-chat-dialog fieldset { margin: 22px 0 0; padding: 13px; border: 1px solid var(--border-strong); border-radius: 8px; max-height: 220px; overflow-y: auto; }
.new-chat-dialog legend { font-size: 10px; color: var(--text); padding-inline: 5px; }
.new-chat-dialog fieldset label { display: flex; align-items: center; gap: 10px; padding: 9px 2px; color: var(--text); font-size: 12px; }
.new-chat-dialog input[type=checkbox], .new-chat-dialog input[type=radio] { accent-color: var(--accent-text); width: 15px; height: 15px; margin: 0; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--green); color: var(--text-on-accent); padding: 14px 18px; font-size: 12px; font-weight: 550; border-radius: 7px; }
.primary-button:hover { background: var(--accent-subtle); }
.primary-button svg { width: 17px; height: 17px; }
.new-chat-dialog .primary-button { width: 100%; margin-top: 24px; }
.dialog-note { font-size: 9px; line-height: 1.8; text-align: center; color: var(--text-secondary); margin-top: 15px; }
.clear-dialog { max-width: 430px; }
.clear-dialog .dialog-header { margin-bottom: 14px; }
.clear-dialog .dialog-header h2 { font-size: 21px; margin-top: 0; }
.clear-dialog>p { font-size: 12px; line-height: 1.8; color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.secondary-button { padding: 13px 15px; font-size: 11px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: 7px; }
.dialog-actions .primary-button { font-size: 11px; padding: 13px 15px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 105px; transform: translateX(-50%); background: var(--accent-subtle); color: var(--text-on-accent); border: 1px solid var(--border-strong); font-size: 12px; padding: 12px 20px; border-radius: 8px; box-shadow: 0 8px 40px rgb(0 0 0 / .45); max-width: calc(100% - 35px); line-height: 1.6; }
@media (min-width:1700px) {
  :root { --chat-list-width: 380px; }
  .message-list { padding-inline: 50px; }
  .composer-wrap { width: calc(100% - 100px); }
  .message-thread { gap: 11px; }
  .chat-row { padding-block: 10px; }
}
@media (max-width:1200px) {
  :root { --chat-list-width: 328px; }
  .app-shell.info-open { grid-template-columns: 72px var(--chat-list-width) minmax(0,1fr); }
  .info-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 285px; box-shadow: -15px 0 60px rgb(0 0 0 / .45); }
  .message-list { padding-inline: 27px; }
  .composer-wrap { width: calc(100% - 54px); }
  .message-bubble { max-width: min(var(--message-width),88%); }
  .message-text { font-size: 14px; }
  .message-row.outgoing { padding-left: 20px; }
  .composer-form { gap: 7px; }
  .keyboard-hint { display: none; }
}
@media (max-width:1000px) {
  :root { --chat-list-width: 300px; }
  .app-shell { grid-template-columns: 72px var(--chat-list-width) minmax(0,1fr); }
  .app-shell.info-open { grid-template-columns: 72px var(--chat-list-width) minmax(0,1fr); }
  .sidebar-header { padding: 28px 19px 24px; }
  .sidebar-header h1 { font-size: 23px; }
  .sidebar-header p { font-size: 8px; }
  .sidebar-search { margin-inline: 16px; padding-inline: 11px; }
  .sidebar-search input { font-size: 10px; }
  .list-filters { padding-inline: 20px; }
  .chat-list { padding-inline: 7px; }
  .chat-row { padding-inline: 9px; gap: 10px; }
  .chat-avatar { width: 38px; height: 38px; font-size: 13px; }
  .chat-row-top strong { font-size: 12px; }
  .chat-row-bottom .preview { font-size: 10px; }
  .chat-row-top time, .chat-row-time { font-size: 8px; }
  .conversation-header { padding: 17px 20px; gap: 9px; }
  .conversation-identity { gap: 10px; }
  .conversation-avatar { width: 38px; height: 38px; }
  .conversation-identity strong { font-size: 13px; }
  .conversation-status { font-size: 9px; }
  .conversation-actions { gap: 2px; }
  .conversation-actions .icon-button { width: 29px; }
  .conversation-actions svg { width: 18px; height: 18px; }
  .message-list { padding-inline: 20px; padding-bottom: 20px; }
  .message-thread { gap: 9px; }
  .message-avatar { width: 26px; height: 26px; font-size: 8px; }
  .message-row { gap: 7px; }
  .message-bubble { padding: 8px 11px 6px; max-width: 88%; }
  .message-text { font-size: 13px; }
  .message-author { font-size: 9px; }
  .message-meta { font-size: 7px; }
  .composer-wrap { width: calc(100% - 36px); }
  .composer-form { padding: 9px; gap: 6px; }
  .composer-form>.icon-button { width: 27px; }
  .composer-form>.icon-button svg { width: 19px; height: 19px; }
  .composer-form textarea { font-size: 12px; }
  .send-button { width: 36px; }
  .message-attachment { min-width: 0; gap: 8px; padding: 9px; }
  .message-attachment strong, .message-attachment span { font-size: 10px; }
  .conversation-welcome>span:not(.welcome-rule) { font-size: 6px; letter-spacing: 1.2px; }
  .welcome-rule { width: 20px; }
  .sidebar-footer { padding-inline: 19px; }
}
@media (max-width:800px) and (min-width:681px) {
  :root { --chat-list-width: 280px; }
  .app-shell, .app-shell.info-open { grid-template-columns: 68px var(--chat-list-width) minmax(0,1fr); }
  .brand { font-size: 24px; }
  .brand i { width: 6px; height: 6px; }
  .nav-tab { font-size: 8px; }
  .nav-sections { padding-inline: 5px; }
  .sidebar-header h1 { font-size: 21px; }
  .sidebar-header p { font-size: 7px; }
  .chat-row { gap: 8px; padding-inline: 8px; }
  .chat-avatar { height: 38px; width: 38px; font-size: 12px; }
  .chat-row-top strong { font-size: 11px; }
  .chat-row-bottom .preview { font-size: 9px; }
  .conversation-header { padding-inline: 14px; }
  .conversation-avatar { width: 33px; height: 33px; }
  .conversation-avatar svg { width: 20px; height: 20px; }
  .conversation-identity strong { font-size: 12px; }
  .conversation-status { font-size: 8px; }
  .conversation-actions .icon-button { width: 25px; }
  .message-list { padding-inline: 14px; }
  .message-avatar { width: 23px; height: 23px; font-size: 7px; }
  .message-bubble { padding: 7px 10px 5px; max-width: 87%; }
  .message-text { font-size: 12px; }
  .composer-wrap { width: calc(100% - 25px); }
  .composer-form { gap: 3px; }
  .composer-form textarea { font-size: 11px; }
  .composer-form>.icon-button { width: 24px; }
  .composer-form>.icon-button svg { width: 17px; height: 17px; }
  .send-button { width: 32px; }
}
@media (max-width:680px) {
  .app-shell { grid-template-columns: 70px minmax(0,1fr); }
  .app-shell.info-open { grid-template-columns: 70px minmax(0,1fr); }
  .app-shell.chat-open, .app-shell.chat-open.info-open { grid-template-columns: minmax(0,1fr); }
  .conversation-screen { display: none; }
  .app-shell.chat-open .conversation-screen { display: flex; }
  .app-shell.chat-open .app-nav, .app-shell.chat-open .chat-sidebar { display: none; }
  .brand { height: 88px; font-size: 25px; }
  .brand i { width: 6px; height: 6px; }
  .nav-sections { padding: 20px 6px; gap: 10px; }
  .nav-tab { min-height: 60px; font-size: 8px; gap: 7px; }
  .nav-tab-icon svg { width: 23px; height: 23px; }
  .sidebar-header { padding: 29px 20px 24px; gap: 10px; }
  .sidebar-header h1 { font-size: 24px; }
  .sidebar-header p { font-size: 8px; margin-top: 9px; }
  .compose-button { width: 33px; height: 33px; }
  .sidebar-search { margin-inline: 16px; margin-bottom: 18px; }
  .sidebar-search input { font-size: 12px; }
  .sidebar-search kbd { display: none; }
  .list-filters { padding-inline: 20px; }
  .list-filters button { font-size: 11px; }
  .chat-list { padding: 9px 7px 15px; }
  .chat-row { min-height: var(--chat-row-height); padding: 10px 9px; gap: 9px; }
  .chat-avatar { width: 38px; height: 38px; font-size: 12px; }
  .chat-row-top strong { font-size: 12px; }
  .chat-row-top time { font-size: 8px; }
  .chat-row-body { gap: 6px; }
  .chat-row-bottom .preview { font-size: 10px; }
  .unread-badge { height: 17px; min-width: 17px; font-size: 8px; }
  .sidebar-footer { padding: 18px 20px; font-size: 8px; }
  .conversation-header { min-height: 76px; padding: 14px 14px 14px 10px; gap: 6px; }
  .mobile-back { display: inline-flex; width: 30px; height: 37px; margin-right: 2px; padding: 3px; }
  .mobile-back svg { width: 23px; height: 23px; }
  .conversation-avatar { width: 38px; height: 38px; }
  .conversation-identity { gap: 10px; }
  .conversation-identity strong { font-size: 13px; }
  .conversation-status { font-size: 9px; }
  .conversation-actions { gap: 3px; }
  .conversation-actions .icon-button { width: 29px; }
  .conversation-actions svg { height: 19px; width: 19px; }
  .conversation-welcome { display: none; }
  .conversation-welcome>span:not(.welcome-rule) { font-size: 6px; letter-spacing: 1.2px; }
  .welcome-rule { width: 20px; }
  .message-list { padding: 19px 15px 22px; }
  .message-thread { gap: 10px; }
  .message-row { gap: 7px; }
  .message-avatar { width: 26px; height: 26px; font-size: 8px; }
  .message-row.outgoing { padding-left: 28px; }
  .message-bubble { padding: 8px 11px 6px; max-width: 88%; }
  .message-text { font-size: 14px; line-height: 1.45; }
  .message-author { font-size: 9px; margin-bottom: 3px; }
  .message-meta { font-size: 7px; margin-top: 2px; }
  .date-pill { font-size: 9px; }
  .composer-wrap { width: calc(100% - 22px); padding-bottom: max(12px,env(safe-area-inset-bottom)); }
  .composer-form { gap: 5px; padding: 8px; border-radius: 11px; }
  .composer-form>.icon-button { width: 28px; height: 41px; }
  .composer-form>.icon-button svg { width: 21px; height: 21px; }
  .composer-form textarea { font-size: 16px; line-height: 24px; height: 41px; padding-top: 8px; }
  .send-button { width: 39px; height: 41px; }
  .send-button svg { width: 18px; height: 18px; }
  .composer-footer { font-size: 6px; padding-top: 10px; padding-left: 4px; }
  .info-panel { width: min(315px,90vw); }
  .info-panel>header { min-height: 76px; }
  .conversation-search { padding: 9px 14px; gap: 8px; }
  .conversation-search input { font-size: 16px; }
  #search-count { font-size: 8px; }
  .conversation-search>svg { width: 15px; height: 15px; }
  .more-menu { right: 12px; top: 64px; }
  .more-menu button { font-size: 12px; }
  .emoji-picker { right: 12px; bottom: 90px; }
  .new-chat-dialog { padding: 24px; }
  .new-chat-dialog input:not([type=checkbox]):not([type=radio]) { font-size: 16px; }
  .dialog-header h2 { font-size: 22px; }
  .clear-dialog { padding: 24px; }
  .clear-dialog .dialog-header h2 { font-size: 19px; }
}
@media (max-width:360px) {
  .app-shell, .app-shell.info-open { grid-template-columns: 61px minmax(0,1fr); }
  .app-shell.chat-open, .app-shell.chat-open.info-open { grid-template-columns: minmax(0,1fr); }
  .brand { font-size: 23px; gap: 3px; }
  .nav-sections { padding-inline: 4px; }
  .nav-tab { font-size: 7px; }
  .sidebar-header { padding-inline: 15px; }
  .sidebar-header h1 { font-size: 22px; }
  .sidebar-header p { font-size: 6px; }
  .sidebar-search { margin-inline: 12px; }
  .sidebar-search input { font-size: 10px; }
  .list-filters { padding-inline: 16px; }
  .chat-row { padding-inline: 7px; gap: 8px; }
  .chat-avatar { height: 36px; width: 36px; font-size: 11px; }
  .chat-row-top strong { font-size: 11px; }
  .chat-row-top time { font-size: 7px; }
  .chat-row-bottom .preview { font-size: 9px; }
  .unread-badge { height: 15px; min-width: 15px; font-size: 7px; }
  .conversation-header { padding-inline: 8px; gap: 4px; }
  .conversation-identity { gap: 7px; }
  .conversation-avatar { width: 32px; height: 32px; }
  .conversation-avatar svg { width: 19px; height: 19px; }
  .conversation-identity strong { font-size: 12px; }
  .conversation-status { font-size: 8px; }
  .conversation-actions { gap: 0; }
  .conversation-actions .icon-button { width: 25px; }
  .message-list { padding-inline: 11px; }
  .message-text { font-size: 13px; }
  .message-bubble { padding-inline: 11px; }
  .message-row { gap: 6px; }
  .message-avatar { width: 23px; height: 23px; font-size: 7px; }
  .composer-form { gap: 2px; padding: 7px; }
  .composer-form>.icon-button { width: 26px; }
  .send-button { width: 35px; }
  .dialog-actions { gap: 7px; }
  .dialog-actions .primary-button, .secondary-button { font-size: 10px; padding: 11px 12px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Local attachment controls share the composer spacing. */
.attachment-preview { flex-wrap: wrap; max-height: 144px; overflow-y: auto; }
.attachment-chip { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 6px 8px; background: var(--surface-raised); border-radius: 5px; }
.attachment-chip>span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.attachment-chip>svg { width: 16px; height: 16px; }
.remove-attachment { padding: 4px; border-radius: 4px; }
.remove-attachment:hover { background: var(--surface-hover); }
.attachment-image { max-width: 100%; max-height: 220px; object-fit: contain; }
.message-attachment:has(.attachment-image) { flex-wrap: wrap; }
.message-attachment:has(.attachment-image) .attachment-image { flex-basis: 100%; }

.chat-list:empty { flex: 0; padding: 0; }
.list-empty:not([hidden]) { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 24px; }
.message-thread:has(> .system-message:only-child) { justify-content: center; }
.message-thread> .system-message:only-child { font-size: 12px; }

/* Workspace shortcuts use the same calendar and grid icons as the landing page. */
.nav-bottom { width: 100%; gap: 16px; padding-top: 12px; }
.settings-button { width: calc(100% - 12px); min-height: 53px; }
.settings-button .nav-tab-icon svg { width: 22px; height: 22px; }
.app-nav { overflow-y: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav .brand, .nav-sections, .nav-bottom { flex-shrink: 0; }
.hide-dots .conversation-screen:before { display: none; }
.utility-dialog { max-width: 470px; }
.utility-dialog .dialog-header { margin-bottom: 25px; }
.utility-section-label { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 11px; padding-bottom: 16px; border-bottom: 1px solid var(--border-strong); }
.utility-section-label svg { width: 17px; height: 17px; color: var(--text-secondary); }
.calendar-agenda { padding-top: 6px; }
.agenda-item { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border-strong); }
.agenda-time { font-size: 10px; color: var(--text); min-width: 56px; }
.agenda-copy { min-width: 0; flex: 1; }
.agenda-copy strong { display: block; font-size: 12px; font-weight: 500; color: var(--text); }
.agenda-copy p { margin-top: 6px; font-size: 10px; line-height: 1.6; color: var(--text-secondary); }
.agenda-open { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 8px; border-radius: 7px; background: var(--surface-raised); color: var(--text); flex-shrink: 0; }
.agenda-open:hover { background: var(--surface-hover); }
.agenda-open svg { width: 16px; height: 16px; }
.misc-files { max-height: 280px; overflow-y: auto; padding-block: 7px; }
.utility-empty { font-size: 12px; color: var(--text); line-height: 1.8; padding: 25px 12px; text-align: center; }
.shared-file { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border-strong); }
.shared-file>svg { color: var(--text); width: 20px; height: 20px; }
.shared-file a { flex: 1; min-width: 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-muted); }
.shared-file button { background: var(--surface-raised); color: var(--text); border-radius: 6px; padding: 8px; font-size: 9px; flex-shrink: 0; }
.shared-file button svg { width: 15px; height: 15px; }
.utility-action { margin-top: 23px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; text-align: left; }
.utility-action:hover { background: var(--surface-raised); }
.utility-action-icon { display: grid; place-items: center; width: 32px; height: 32px; background: var(--surface-hover); color: var(--text); border-radius: 7px; flex-shrink: 0; }
.utility-action-icon svg { width: 18px; height: 18px; }
.utility-action>span:nth-child(2) { flex: 1; min-width: 0; }
.utility-action strong { display: block; color: var(--text); font-size: 11px; font-weight: 500; }
.utility-action small { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 9px; line-height: 1.6; }
.utility-action>svg { color: var(--text); width: 16px; height: 16px; }
.settings-profile { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--border-strong); padding-bottom: 23px; margin-bottom: 23px; }
.settings-profile .self-avatar { width: 43px; height: 43px; font-size: 12px; flex-shrink: 0; }
.settings-profile strong { color: var(--text); font-size: 13px; font-weight: 550; }
.settings-profile p { margin-top: 6px; color: var(--text-secondary); font-size: 10px; }
.settings-section-label { font-size: 7px; letter-spacing: 1.3px; color: var(--text); margin-bottom: 8px; }
.setting-row { display: flex; align-items: center; gap: 15px; padding: 17px 0; border-bottom: 1px solid var(--border-strong); cursor: pointer; position: relative; }
.setting-row>span:first-child { flex: 1; }
.setting-row strong { font-size: 12px; font-weight: 500; color: var(--text); }
.setting-row small { display: block; color: var(--text-secondary); font-size: 10px; margin-top: 7px; line-height: 1.6; }
.setting-row input { position: absolute; width: 1px; height: 1px; opacity: 0; right: 20px; }
.setting-switch { width: 35px; height: 20px; background: var(--surface-hover); border: 1px solid var(--border-strong); border-radius: 12px; position: relative; flex-shrink: 0; transition: background .15s; }
.setting-switch:after { content: ""; width: 12px; height: 12px; border-radius: 50%; position: absolute; top: 3px; left: 3px; background: var(--accent-subtle); transition: transform .15s, background .15s; }
.setting-row input:checked+.setting-switch { background: var(--accent); border-color: var(--accent-border); }
.setting-row input:checked+.setting-switch:after { transform: translateX(15px); background: var(--surface-raised); }
.setting-row input:focus-visible+.setting-switch { outline: 2px solid var(--accent-ring); outline-offset: 4px; }
@media (max-width:680px) {
  .nav-sections { gap: 5px; padding-top: 13px; }
  .utility-dialog { padding: 24px; }
  .agenda-item { gap: 10px; }
  .agenda-time { min-width: 48px; font-size: 9px; }
  .agenda-copy strong { font-size: 11px; }
  .agenda-copy p { font-size: 9px; }
  .setting-row small { font-size: 9px; }
}

.shared-file-link { display: flex; align-items: center; gap: 10px; }
.shared-file-link>svg { width: 22px; height: 22px; color: var(--text); }
.shared-file-copy { min-width: 0; }
.shared-file-copy strong { font-size: 11px; font-weight: 500; }
.shared-file-copy small { display: block; font-size: 9px; color: var(--text-secondary); margin-top: 5px; }
.settings-button[aria-expanded=true] { background: var(--accent-subtle); color: var(--accent-text); }

/* Account-connected messenger flows, using the existing compact scale. */
.flow-dialog { max-width: 500px; }
.flow-description { color: var(--text); font-size: 12px; line-height: 1.7; margin: 0 0 20px; overflow-wrap: anywhere; }
.flow-field { margin: 17px 0 12px; }
.flow-field label { display: block; color: var(--text); font-size: 12px; margin-bottom: 8px; }
.flow-field input, .flow-field select { width: 100%; min-width: 0; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: 12px; font: inherit; }
.flow-submit { width: 100%; justify-content: center; margin-top: 22px; }
.full-button { display: block; width: 100%; margin-top: 10px; }
.list-filters svg { width: 12px; height: 12px; }
.inline-error { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); font-size: 12px; line-height: 1.6; margin-top: 18px; }
.inline-error small, .lookup-result small, .request-reference { display: block; margin-top: 6px; }
.request-reference { font-size: 9px; overflow-wrap: anywhere; opacity: .75; }
.connection-status, .conversation-notice, .state-notice { background: var(--surface); padding: 10px 20px; color: var(--text); font-size: 12px; line-height: 1.6; flex-shrink: 0; }
.connection-status { text-align: center; border-bottom: 1px solid var(--border-strong); }
.state-notice { border-radius: 8px; margin-bottom: 18px; }
.status-retry { background: none; color: var(--accent-text); text-decoration: underline; margin-left: 10px; }
.conversation-empty { text-align: center; margin: auto; padding: 40px 12px; max-width: 380px; color: var(--text-secondary); }
.conversation-empty h2 { color: var(--text); font-size: 24px; font-weight: 500; letter-spacing: -.7px; margin-bottom: 12px; }
.conversation-empty p { font-size: 12px; line-height: 1.8; }
.empty-mark { display: grid; place-items: center; width: 60px; height: 60px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 18px; color: var(--green); margin: 0 auto 22px; }
.empty-mark svg { width: 28px; height: 28px; }
.conversation-empty .primary-button, .list-empty .primary-button { margin: 22px auto 0; justify-content: center; }
.load-older { display: block; align-self: center; margin: 12px auto; color: var(--text); background: var(--surface); padding: 9px 14px; border-radius: 20px; font-size: 11px; }
.profile-image { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.message-author { background: transparent; padding: 0; text-align: left; }
.message-action { background: none; color: inherit; padding: 0 3px; font-size: 14px; line-height: 12px; border-radius: 3px; }
.message-action:hover { background: var(--accent-subtle); }
.deleted-message { opacity: .7; font-style: italic; }
.pending-message { opacity: .72; }
.pending-retry { background: transparent; color: inherit; font-size: 11px; text-decoration: underline; padding: 4px 0; }
.attachment-preview { flex-direction: column; align-items: stretch; max-height: 200px; overflow-y: auto; padding: 9px; }
.upload-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.upload-chip > svg { width: 17px; height: 17px; }
.upload-chip > span { flex: 1; min-width: 80px; overflow-wrap: anywhere; }
.upload-chip > small { font-size: 10px; }
.upload-chip progress { accent-color: var(--accent-text); width: 100%; height: 4px; }
.upload-chip .remove-attachment { margin: 0; font-size: 20px; min-width: 26px; min-height: 28px; }
.file-preview-image { display: block; max-width: 100%; max-height: 48svh; margin: 0 auto 20px; border-radius: 8px; object-fit: contain; }
.reuse-file { width: 100%; background: none; color: var(--text); padding: 16px 0 0; font-size: 12px; }
button.shared-file { width: 100%; background: transparent; color: var(--text); text-align: left; }
button.shared-file > span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.lookup-button { margin-bottom: 10px; }
.lookup-person { border: 1px solid var(--border-strong); border-radius: 8px; padding: 14px; margin-top: 10px; }
.lookup-person strong { color: var(--text); font-weight: 500; font-size: 13px; }
.lookup-person small { color: var(--text-secondary); font-size: 11px; }
.lookup-person .primary-button { margin-top: 12px; width: 100%; justify-content: center; padding: 10px; }
.selected-members { display: flex; gap: 6px; flex-wrap: wrap; }
.selected-member { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--surface-raised); color: var(--text); border-radius: 6px; font-size: 11px; }
.remove-member-chip { color: inherit; background: none; font-size: 18px; padding: 0 2px; }
.manage-members { margin: 18px 0; max-height: 290px; overflow-y: auto; border-block: 1px solid var(--border-strong); }
.member { width: 100%; background: transparent; text-align: left; }
button.member:hover { background: var(--surface); border-radius: 7px; }
.member-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.member-remove { padding: 7px 9px; color: var(--text); background: var(--surface-raised); border-radius: 6px; font-size: 10px; }
.member-choice { display: block; width: 100%; border-bottom: 1px solid var(--border-strong); background: transparent; color: var(--text); padding: 16px 8px; text-align: left; }
.profile-detail { color: var(--text); font-size: 13px; line-height: 1.8; margin: 10px 0; overflow-wrap: anywhere; }
.settings-profile { width: 100%; background: none; text-align: left; }
.settings-profile > span:nth-child(2) { flex: 1; min-width: 0; }
.settings-profile small { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 7px; overflow-wrap: anywhere; }
.settings-profile > svg { width: 16px; height: 16px; color: var(--text); }
.signout-button { width: 100%; margin-top: 24px; }
#workspace-links .utility-action { margin-top: 10px; }
.preview-tools { margin-top: 24px; border-top: 1px solid var(--border-strong); padding-top: 16px; color: var(--text-secondary); font-size: 10px; }
.preview-tools summary { cursor: pointer; line-height: 1.6; }
.preview-state-button { display: block; width: 100%; background: var(--surface); color: var(--text); border-radius: 6px; padding: 10px; margin-top: 9px; text-align: left; font-size: 11px; }
@media (max-width:680px) {
  .flow-dialog { padding: 22px; }
  .flow-dialog .new-type-tabs button { padding: 10px 5px; font-size: 10px; }
  .flow-field input, .flow-field select { font-size: 16px; }
  .conversation-empty h2 { font-size: 22px; }
  .connection-status, .conversation-notice { padding: 9px 14px; font-size: 11px; }
  .message-attachment { min-width: 0; gap: 8px; }
  .upload-chip > small { flex-basis: 100%; }
}

.theme-segmented { display: flex; gap: 4px; padding: 4px; margin-bottom: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-inset); }
.theme-segmented button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px; border-radius: 7px; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 500; transition: background .15s, color .15s; }
.theme-segmented button svg { width: 15px; height: 15px; }
.theme-segmented button:hover { background: var(--surface-hover); color: var(--text); }
.theme-segmented button[aria-checked=true] { background: var(--accent-subtle); color: var(--accent-text); }

/* Touch targets: 44px floor on touch-primary widths (guide §8). */
@media (max-width: 760px) {
  .icon-button, .compose-button { width: 44px; height: 44px; }
  .self-avatar { width: 44px; height: 44px; }
  .list-filters button { min-height: 44px; padding-top: 8px; }
  .sidebar-search { min-height: 46px; }
  .sidebar-search input { height: 44px; }
  .theme-segmented button { min-height: 44px; }
}

/* ---- handoff screen ----
   The only thing on screen between a cold load and the inbox. Content on the
   page: no card, no border, no texture, no chrome. --bg so it follows whichever
   theme booted, rather than pinning the dark value. */
.handoff {
  position: fixed; inset: 0; z-index: 60;
  display: grid; align-content: center; justify-items: center; gap: 0;
  background: var(--bg); color: var(--text);
  padding: 24px; text-align: center;
}
.handoff[hidden] { display: none; }
.handoff > * { width: 100%; max-width: 420px; }
.handoff-brand {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -1.4px; line-height: 1;
}
.handoff-brand i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.handoff-pulse {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  margin: 40px 0 28px; animation: handoff-pulse 1.2s ease-in-out infinite;
}
@keyframes handoff-pulse { 0%, 100% { opacity: .4 } 50% { opacity: 1 } }
.handoff-title { margin: 0 0 8px; font-size: 18px; font-weight: 550; letter-spacing: -.3px; color: var(--text); }
.handoff-body { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.handoff-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.handoff-actions:empty { display: none; }
.handoff-actions .primary-button,
.handoff-actions .secondary-button { justify-content: center; min-height: 44px; font-size: 13px; }
@media (max-width: 520px) {
  .handoff-actions { flex-direction: column; align-items: stretch; }
  .handoff-actions .primary-button, .handoff-actions .secondary-button { width: 100% }
}
@media (prefers-reduced-motion: reduce) {
  .handoff-pulse { animation: none; opacity: 1 }
}
