:root {
  --sidebar: #f4f7f8;
  --surface: #ffffff;
  --accent: #26614d;
  --accent-hover: #1b503e;
  --text: #18202d;
  --muted: #778394;
  --border: #dae1e7;
  --success: #3a9c61;
  --error: #aa4242;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, textarea, select, input { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, select, textarea, a, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.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 { display: grid; grid-template-columns: clamp(240px, 20.83vw, 320px) minmax(0, 1fr); height: 100vh; height: 100dvh; min-height: 480px; }
.sidebar { display: flex; flex-direction: column; min-width: 0; background: var(--sidebar); border-right: 1px solid #e3e8ec; }
.wordmark { padding: 23px 29px 20px; font-size: 38px; line-height: 1.25; font-weight: 700; letter-spacing: -1.5px; color: var(--accent); }
.room-nav { display: flex; align-items: center; gap: 17px; min-height: 60px; margin: 0 10px; padding: 15px 25px; border: 0; border-radius: 8px; background: transparent; color: #5b6b66; font-size: 18px; font-weight: 600; text-align: left; }
.room-nav[aria-current="page"] { background: #e2ece9; color: #214f43; }
.room-nav:hover:not([aria-current="page"]) { background: #eaf0ed; }
.connections-nav { margin-top: 5px; }
.room-nav .icon { width: 26px; height: 26px; }
.members-section { padding: 31px 29px; }
.members-section h2 { margin: 0 0 20px; font-size: 16px; font-weight: 400; color: #78838f; }
.members-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 19px; }
.member-item { display: flex; align-items: center; gap: 18px; font-size: 17px; }
.avatar { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 50%; color: white; font-size: 25px; font-weight: 500; background: var(--avatar-color, #26614d); }
.member-item .avatar { width: 48px; height: 48px; font-size: 23px; }
.avatar.agent-avatar { background: #606969; }
.agent-avatar .icon { width: 29px; height: 29px; stroke-width: 2.1; }
.local-caption { margin-top: auto; padding: 26px 30px 37px; color: #8a95a2; font-size: 14px; }
.main-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-header { height: 91px; flex: 0 0 91px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 33px 14px 35px; border-bottom: 1px solid #e6eaee; }
.room-header h1 { margin: 0; font-size: 24px; font-weight: 650; line-height: 1.35; letter-spacing: .2px; }
.member-count { margin: 2px 0 0; color: #7d8793; font-size: 15px; line-height: 1.4; }
.agent-connection { display: flex; align-items: center; gap: 10px; color: #485464; font-size: 15px; white-space: nowrap; }
.status-dot { display: inline-block; width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--success); }
.agent-connection .status-dot { width: 13px; height: 13px; }
.room-header-actions { display: flex; align-items: center; gap: 13px; min-width: 0; }
.connections-mobile { display: none; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 7px; border: 1px solid #dce6e0; border-radius: 8px; background: #f6f9f7; color: var(--accent); }
.connections-mobile .icon { width: 21px; height: 21px; }
.is-checking .status-dot, .is-disconnected .status-dot { background: #a4adb7; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d7dfe2 transparent; }
.messages { min-height: 100%; padding: 36px 50px 48px; display: flex; flex-direction: column; gap: 32px; }
.message { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 24px; min-width: 0; }
.message-content { min-width: 0; padding-top: 4px; }
.message-header { min-height: 25px; display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-bottom: 7px; line-height: 1.4; }
.author-name { font-size: 16px; font-weight: 600; }
.message-time { font-size: 14px; color: #8994a4; }
.message-text { margin: 0; font-size: 17px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.mention { color: var(--accent); }
.message-text pre { white-space: pre-wrap; margin: 14px 0; padding: 14px 16px; border: 1px solid #e6ebee; background: #f6f8f9; border-radius: 6px; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; }
.message-text pre:first-child { margin-top: 0; }
.message-text pre:last-child { margin-bottom: 0; }
.message-text.markdown-body { white-space: normal; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote { margin: 0 0 12px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 18px 0 8px; line-height: 1.5; font-weight: 600; }
.markdown-body h1 { font-size: 1.2em; }
.markdown-body h2 { font-size: 1.13em; }
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; }
.markdown-body li { margin: 4px 0; }
.markdown-body li > p { margin: 4px 0; }
.markdown-body blockquote { margin-left: 0; padding-left: 12px; border-left: 3px solid #d2dfd7; color: #64736b; }
.markdown-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body :not(pre) > code { padding: 1px 4px; border-radius: 4px; background: #eaf0ed; font: .9em/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; }
.message-text.markdown-body pre { max-width: 100%; overflow-x: auto; white-space: pre; overflow-wrap: normal; font-size: 13px; }
.markdown-body pre code { font: inherit; }
.markdown-body .markdown-table { max-width: 100%; overflow-x: auto; margin: 12px 0; border: 1px solid #dce5df; border-radius: 6px; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.55; }
.markdown-body th, .markdown-body td { padding: 7px 10px; text-align: left; border-bottom: 1px solid #e1e8e3; vertical-align: top; min-width: 70px; }
.markdown-body th { background: #edf3ef; font-weight: 600; }
.markdown-body tr:last-child td { border-bottom: 0; }
.markdown-body hr { border: 0; border-top: 1px solid #dce5df; margin: 16px 0; }
.markdown-body details { margin: 12px 0; border-top: 1px solid #e0e8e2; padding-top: 9px; }
.markdown-body summary { cursor: pointer; color: #536d5f; font-size: .93em; }
.markdown-body details[open] > summary { margin-bottom: 10px; }
.markdown-body details > :last-child { margin-bottom: 0; }
.markdown-body .markdown-table:focus-visible, .markdown-body summary:focus-visible, .markdown-body a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message-attachments { list-style: none; margin: 15px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.attachment-link { width: min(100%, 360px); display: flex; align-items: center; gap: 15px; border: 1px solid var(--border); border-radius: 6px; background: #f7f9fa; color: var(--text); padding: 13px 17px; text-decoration: none; font-size: 15px; }
.attachment-link:hover { background: #f0f5f3; border-color: #b8cdc3; }
.attachment-link .icon { width: 25px; height: 25px; color: #606b77; }
.attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-thread { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; padding-left: 15px; border-left: 2px solid #e5ebe7; min-width: 0; }
.reply-thread .agent-message { grid-template-columns: 25px minmax(0, 1fr); gap: 10px; margin: 0; }
.reply-thread .agent-message > .avatar { width: 25px; height: 25px; font-size: 12px; }
.reply-thread .agent-avatar .icon { width: 15px; height: 15px; }
.reply-thread .message-content { padding-top: 0; }
.reply-thread .message-header { gap: 8px; min-height: 23px; margin-bottom: 7px; }
.reply-thread .author-name { font-size: 13px; font-weight: 500; }
.reply-thread .agent-status { font-size: 12px; gap: 5px; }
.reply-thread .agent-status .status-dot { width: 7px; height: 7px; }
.reply-thread .message-text { font-size: 15px; }
.unlinked-label { margin: 0; color: var(--muted); font-size: 12px; }
.agent-status { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 400; }
.agent-status[data-status="queued"], .agent-status[data-status="interrupted"] { color: #78838f; }
.agent-status[data-status="queued"] .status-dot, .agent-status[data-status="interrupted"] .status-dot { background: #9da7b2; }
.agent-status[data-status="failed"] { color: var(--error); }
.agent-status[data-status="failed"] .status-dot { background: #bb6161; }
.agent-status[data-status="delivery_unknown"], .agent-status[data-status="final_unconfirmed"], .agent-status[data-status="unknown"], .agent-status[data-status="waiting"] { color: #8a6a35; }
.agent-status[data-status="delivery_unknown"] .status-dot, .agent-status[data-status="final_unconfirmed"] .status-dot, .agent-status[data-status="unknown"] .status-dot, .agent-status[data-status="waiting"] .status-dot { background: #a98851; }
.agent-status[data-status="response_observed"] { color: #667b70; }
.agent-status[data-status="response_observed"] .status-dot { background: #7f9589; }
.agent-status[data-status="running"] .status-dot { animation: breathe 1.6s ease-in-out infinite; }
.agent-card { border: 1px solid #e8eeea; border-radius: 7px; padding: 12px 14px; background: #f8faf9; min-width: 0; }
.agent-answer { min-height: 0; font-size: 15px; }
.agent-answer.is-collapsed > .agent-final > .reply-preview-omitted { display: none; }
.agent-answer.is-collapsed > .agent-final > .reply-preview-tail { margin-block: 0; }
.expand-reply { display: flex; align-items: center; gap: 5px; border: 0; padding: 0 0 9px; background: transparent; color: var(--accent); font-size: 12px; line-height: 1.5; }
.expand-reply .icon { width: 11px; height: 11px; transform: rotate(-90deg); }
.expand-reply[aria-expanded="true"] .icon { transform: rotate(90deg); }
.expand-reply[aria-expanded="true"] { position: sticky; top: 8px; z-index: 1; width: 100%; background: #f8faf9; }
.agent-placeholder { color: #7b8791; font-size: 16px; line-height: 1.7; margin: 0; }
.message-error { margin: 0 0 12px; color: var(--error); font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-error:last-child { margin-bottom: 0; }
.progress-details { margin: 0 0 10px; font-size: 12px; color: #758078; }
.progress-details summary { display: flex; align-items: center; gap: 10px; width: fit-content; cursor: pointer; list-style: none; user-select: none; }
.progress-details summary::-webkit-details-marker { display: none; }
.progress-details summary .icon { width: 13px; height: 13px; stroke-width: 2.5; transition: transform 140ms; }
.progress-details[open] summary .icon { transform: rotate(90deg); }
.progress-list { list-style: none; margin: 15px 0 0 6px; padding: 0 0 0 16px; border-left: 1px solid #e2e8e5; display: flex; flex-direction: column; gap: 12px; }
.progress-list li { font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.cancel-task { margin-left: auto; color: #68737e; padding: 2px 5px; border: 0; background: transparent; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.cancel-task:disabled { opacity: .55; }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 12px; color: #89939d; text-align: center; }
.empty-state p { font-size: 16px; line-height: 1.7; margin: 0; }
.empty-state p + p { margin-top: 6px; font-size: 14px; color: #9ba3ad; }
.composer-area { flex: 0 0 auto; padding: 0 32px 37px; background: white; }
.composer { border: 1px solid var(--border); border-radius: 10px; padding: 18px 15px 17px; }
#message-input { position: relative; display: block; width: 100%; min-height: 94px; max-height: 210px; overflow-y: auto; overflow-wrap: anywhere; white-space: pre-wrap; border: 1px solid var(--border); border-radius: 8px; padding: 13px 16px; background: white; color: var(--text); font-size: 17px; line-height: 1.65; outline-offset: 2px; }
#message-input p { margin: 0; min-height: 1.65em; }
#message-input[data-empty="true"]::before { content: attr(data-placeholder); position: absolute; color: #8d99a8; pointer-events: none; }
#message-input:focus { border-color: #9fb9ad; outline: none; box-shadow: 0 0 0 2px #26614d0b; }
.mention-token { display: inline-block; max-width: min(100%, 360px); overflow: hidden; text-overflow: ellipsis; padding: 0 3px; border-radius: 4px; color: #3b73bd; background: #eff5fc; font-weight: 500; white-space: nowrap; vertical-align: bottom; cursor: pointer; }
.mention-token:hover { background: #e2edfc; }
.message-mention { margin-inline: 2px 4px; cursor: default; user-select: all; vertical-align: bottom; }
.message-mention:hover { background: #eff5fc; }
.mention-token.ProseMirror-selectednode { background: #dbe9fc; outline: 2px solid #7fa7d9; outline-offset: 0; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
img.ProseMirror-separator { display: inline; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; }
.composer-controls { display: flex; align-items: center; gap: 20px; margin-top: 18px; min-height: 46px; }
.attachment-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 4px 6px; border: 0; background: transparent; color: #586575; font-size: 14px; }
.attachment-button:disabled { opacity: .45; }
.attachment-button:hover:not(:disabled) { color: var(--accent); }
.attachment-button .icon { width: 24px; height: 24px; }
.author-control { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.author-control label { font-size: 14px; color: #5c6675; white-space: nowrap; }
.author-control select { width: 150px; height: 46px; padding: 9px 14px; color: var(--text); border: 1px solid var(--border); border-radius: 8px; background-color: white; font-size: 14px; }
.send-button { display: inline-grid; place-items: center; min-width: 100px; height: 46px; padding: 10px 22px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: white; font-size: 15px; font-weight: 500; transition: background 120ms; }
.send-button:hover:not(:disabled) { background: var(--accent-hover); }
.send-button:disabled { background: #75998a; border-color: #75998a; color: #fffffff0; opacity: .65; }
.send-label, .send-spinner { grid-area: 1 / 1; }
.send-spinner { display: none; width: 17px; height: 17px; border: 2px solid #ffffff55; border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.send-button.is-busy .send-label { visibility: hidden; }
.send-button.is-busy .send-spinner { display: block; }
.pending-attachments { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; }
.pending-file { display: flex; align-items: center; gap: 8px; max-width: 100%; min-height: 35px; padding: 5px 7px 5px 10px; background: #f4f7f6; border: 1px solid #e0e7e3; border-radius: 6px; font-size: 13px; color: #526359; }
.pending-file .icon { width: 16px; height: 16px; }
.pending-file-name { max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-file-status { color: #89938e; font-size: 12px; white-space: nowrap; }
.pending-file.is-failed { color: var(--error); border-color: #e8cccc; background: #fcf7f7; }
.remove-file { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: transparent; border: 0; border-radius: 4px; color: inherit; }
.remove-file:hover { background: #18202d09; }
.composer-error { margin: 12px 5px 0; color: var(--error); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

.mention-menu { position: fixed; z-index: 100; display: flex; flex-direction: column; overflow: hidden; padding: 5px; border: 1px solid #484848; border-radius: 13px; background: #2b2b2b; color: #f0f0f0; box-shadow: 0 14px 44px #18202d30, 0 2px 6px #18202d14; color-scheme: dark; }
.mention-menu-header { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 28px; padding: 0 7px 3px; color: #aaa; font-size: 12px; }
#mention-title { flex: 1; }
#mention-back { display: flex; align-items: center; justify-content: center; width: 25px; height: 25px; margin-left: -6px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #bcbcbc; }
#mention-back:hover { background: #414141; color: white; }
#mention-back .icon { width: 15px; height: 15px; transform: rotate(180deg); }
.mention-note { flex: 0 0 auto; padding: 3px 10px 7px; margin: 0; color: #c6b8a0; font-size: 12px; line-height: 1.5; max-height: 58px; overflow-y: auto; overflow-wrap: anywhere; }
.mention-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #5c5c5c transparent; }
.mention-options:focus-visible { outline: none; }
.mention-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 6px 8px; margin: 0; border: 0; border-radius: 8px; background: transparent; color: #e1e1e1; text-align: left; text-decoration: none; }
.mention-option.is-active, .mention-option:hover:not(:disabled):not([aria-disabled="true"]) { background: #3e3e3e; color: #fff; }
.mention-option:disabled, .mention-option[aria-disabled="true"] { opacity: .43; cursor: default; }
.mention-option-icon { display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: 0 0 23px; color: #c0c4c1; font-size: 21px; font-weight: 300; }
.mention-option-icon.is-agent { border-radius: 6px; background: #4b5e52; color: #c7e5d2; font-size: 16px; font-weight: 500; }
.mention-option-icon .icon { width: 17px; height: 17px; }
.mention-option-copy { display: flex; align-items: center; min-width: 0; flex: 1; gap: 9px; }
.mention-option-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.35; }
.mention-option-detail { flex: 0 0 auto; white-space: nowrap; color: #929792; font-size: 10px; line-height: 1.4; }
.mention-option-tail { flex: 0 0 auto; color: #b9cdbf; font-size: 16px; }
.mention-empty { margin: 0; padding: 19px 12px; color: #999; font-size: 13px; }
.agent-status[data-status="response_observed"] { color: #55776a; }
.agent-status[data-status="final_unconfirmed"] { color: #86734e; }
.agent-status[data-status="final_unconfirmed"] .status-dot { background: #b49a68; }

body[data-view="connections"] .mention-menu { display: none !important; }
.connections-view { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: #fbfcfb; }
.connections-header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 18px; min-height: 104px; padding: 22px 35px; border-bottom: 1px solid #e6eaee; background: var(--surface); }
.connections-header h1 { margin: 0; color: var(--text); font-size: 24px; line-height: 1.35; font-weight: 650; }
.connections-header p { margin: 6px 0 0; color: #7d8793; font-size: 14px; line-height: 1.5; }
.connections-header .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.connections-body { flex: 1; min-height: 0; padding: 28px 35px 40px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d7dfe2 transparent; }
.connections-list { display: flex; flex-direction: column; gap: 15px; max-width: 920px; margin: 0 auto; }
.connection-card { min-width: 0; padding: 22px 24px; border: 1px solid #dfe7e2; border-radius: 10px; background: white; }
.connection-card-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 20px; }
.connection-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.connection-mark { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 43px; height: 43px; border: 1px solid #d9e4dd; border-radius: 11px; background: #eff5f1; color: var(--accent); font-size: 21px; font-weight: 600; }
.connection-heading-copy { min-width: 0; }
.connection-name { margin: 0 0 5px; font-size: 17px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: #7c8582; font-size: 12px; line-height: 1.4; }
.connection-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a5aea9; }
.connection-state.is-connected { color: #397650; }
.connection-state.is-connected::before { background: var(--success); }
.connection-reason { margin: 15px 0 0; color: #77827b; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.connection-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.connection-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 6px; min-height: 36px; padding: 7px 17px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: white; font-size: 13px; line-height: 1.5; font-weight: 500; text-decoration: none; }
.connection-button:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.connection-button:disabled { opacity: .45; }
.connection-button-secondary { border-color: #d5e0d9; background: white; color: var(--accent); }
.connection-button-secondary:hover:not(:disabled) { border-color: #9fb8a9; background: #f2f7f4; }
.connection-auth { margin-top: 16px; padding: 14px 16px; border-radius: 7px; background: #f3f7f4; }
.connection-auth-text { margin: 0; color: #51695b; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-line; }
.connection-auth .connection-button { margin-top: 11px; }
.connection-code { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12px; color: #607267; }
.connection-code strong { padding: 4px 9px; border: 1px solid #d3e0d7; border-radius: 5px; background: white; font: 600 16px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: 1px; overflow-wrap: anywhere; user-select: all; }
.connection-config { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; margin-top: 21px; padding-top: 18px; border-top: 1px solid #edf1ee; }
.connection-config-multi { grid-template-columns: minmax(130px, .85fr) minmax(0, 1.5fr) auto; }
.connection-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.connection-field-label { color: #586a5f; font-size: 12px; }
.connection-input { width: 100%; height: 38px; padding: 8px 11px; border: 1px solid #d8e2dc; border-radius: 6px; background: white; color: var(--text); font-size: 13px; }
.connection-input::placeholder { color: #9ba69f; }
.connection-input:focus { border-color: #9fb9ad; outline: 2px solid #26614d14; outline-offset: 0; }
.connection-input:disabled { background: #f8faf8; color: #8a978e; }
.connection-config .connection-button { min-height: 38px; }
.connection-config-note { grid-column: 1 / -1; margin: -2px 0 0; color: #94a097; font-size: 11px; line-height: 1.6; }
.connections-loading { margin: 20px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.connections-notice, .connections-feedback { max-width: 920px; margin: 0 auto 18px; padding: 11px 15px; border: 1px solid #e1e9e3; border-radius: 7px; background: #f0f6f2; color: #526e5d; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.connections-notice { background: #f5f7f5; color: #7a877e; }
.connections-feedback.is-error { border-color: #ecd5d2; background: #fcf6f5; color: var(--error); }
#connections-retry { margin-top: 10px; }

@keyframes breathe { 50% { opacity: .4; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .messages { padding-left: 32px; padding-right: 32px; }
  .composer-controls { gap: 14px; }
  .author-control label { display: none; }
  .author-control select { width: 116px; }
  .send-button { min-width: 84px; padding-inline: 15px; }
  .connection-config-multi { grid-template-columns: minmax(110px, .8fr) minmax(0, 1.4fr); }
  .connection-config .connection-button { justify-self: start; }
  .connection-config-note { grid-column: 2; align-self: center; }
}

@media (max-width: 850px) and (min-width: 701px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .messages { padding: 28px 22px 36px; }
  .message { grid-template-columns: 46px minmax(0, 1fr); gap: 15px; }
  .message > .avatar { width: 46px; height: 46px; font-size: 21px; }
  .composer-area { padding: 0 20px 24px; }
  .composer-controls { gap: 10px; flex-wrap: wrap; }
  .author-control { margin-left: auto; }
  .attachment-button { padding-inline: 0; }
  .agent-card { padding: 12px; }
}

@media (max-width: 700px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); min-height: 360px; }
  .sidebar { display: none; }
  .room-header { height: 78px; flex-basis: 78px; padding: 14px 20px; gap: 12px; }
  .room-header h1 { font-size: 21px; }
  .member-count { font-size: 13px; }
  .agent-connection { font-size: 12px; gap: 7px; }
  .agent-connection .status-dot { width: 9px; height: 9px; }
  .room-header-actions { gap: 9px; }
  .room-header-actions .agent-connection { min-width: 0; }
  #connection-label { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
  .connections-mobile { display: inline-flex; }
  .connections-header { min-height: 94px; padding: 18px 20px; gap: 12px; }
  .connections-header h1 { font-size: 21px; }
  .connections-header p { font-size: 12px; }
  .connections-header .connection-button { padding: 7px 10px; font-size: 12px; }
  .connections-body { padding: 18px 16px max(24px, env(safe-area-inset-bottom)); }
  .connections-list { gap: 13px; }
  .connection-card { padding: 18px; }
  .connection-card-heading { gap: 12px; }
  .connection-name { font-size: 16px; }
  .connection-mark { width: 39px; height: 39px; font-size: 19px; }
  .connection-identity { gap: 11px; }
  .connection-reason { margin-top: 13px; font-size: 12px; }
  .connection-button { min-height: 38px; }
  .connection-config { grid-template-columns: minmax(0, 1fr); gap: 15px; margin-top: 18px; }
  .connection-config .connection-button { width: 100%; }
  .connection-config-note { grid-column: 1; font-size: 11px; }
  .connection-input { height: 42px; font-size: 14px; }
  .connection-auth { padding: 12px; }
  .messages { padding: 25px 18px 30px; gap: 28px; }
  .message { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .message > .avatar { width: 38px; height: 38px; font-size: 18px; }
  .agent-avatar .icon { width: 23px; height: 23px; }
  .message-content { padding-top: 0; }
  .message-header { gap: 9px; margin-bottom: 6px; }
  .author-name { font-size: 14px; }
  .message-time { font-size: 12px; }
  .message-text { font-size: 15px; }
  .agent-status { gap: 5px; font-size: 12px; }
  .agent-status .status-dot { width: 8px; height: 8px; }
  .agent-card { padding: 10px 11px; }
  .reply-thread { padding-left: 10px; margin-top: 12px; }
  .reply-thread .agent-message { gap: 7px; }
  .expand-reply, .progress-details { font-size: 13px; }
  .attachment-link { padding: 11px 12px; gap: 10px; font-size: 13px; }
  .composer-area { padding: 0 12px max(12px, env(safe-area-inset-bottom)); }
  .composer { padding: 11px; }
  #message-input { min-height: 78px; max-height: 140px; font-size: 16px; padding: 10px 12px; }
  .composer-controls { gap: 10px; flex-wrap: wrap; margin-top: 10px; }
  .attachment-button { font-size: 13px; min-height: 38px; padding: 3px 0; gap: 5px; }
  .attachment-button .icon { width: 20px; height: 20px; }
  .author-control { margin-left: auto; }
  .author-control select { width: 88px; height: 38px; padding: 6px 8px; font-size: 13px; }
  .send-button { min-width: 64px; height: 38px; font-size: 13px; padding: 7px 13px; border-radius: 7px; }
}

@media (max-width: 480px) {
  .composer-controls { gap: 5px; }
  .attachment-button span { display: none; }
  .attachment-button { width: 27px; }
  .author-control select { width: 66px; }
  .send-button { min-width: 57px; padding-inline: 10px; margin-left: auto; }
}

@media (max-width: 390px) { .agent-card { padding: 9px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Team conversations share the existing chat and connection views. */
.app-shell { grid-template-columns: 266px minmax(0, 1fr); }
.sidebar { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* Preserve each section's natural height; overflow belongs to the sidebar,
   otherwise flex shrink lets conversation buttons paint over later sections. */
.sidebar > * { flex-shrink: 0; }
.sidebar > .team-conversations { flex: 0 0 auto; }
.team-heading { padding: 22px 24px 17px; }
.team-heading .wordmark { padding: 0; font-size: 31px; }
.team-name { margin: 7px 0 0; overflow: hidden; color: #78877f; font-size: 12px; line-height: 1.5; white-space: nowrap; text-overflow: ellipsis; }
.team-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 18px 17px; }
.team-action { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 35px; padding: 7px 10px; border: 1px solid #dce5df; border-radius: 7px; background: #fafcfb; color: #536a5c; font-size: 12px; text-align: left; text-decoration: none; }
.team-action > span { color: #83988c; font-size: 16px; font-weight: 400; line-height: 1; }
.team-action-invite { grid-column: 1 / -1; border-color: #c8dcd0; background: #edf4ef; color: var(--accent); }
.team-action-public { grid-column: 1 / -1; background: transparent; }
.team-action:hover:not(:disabled) { border-color: #a9c2b4; background: #e9f1ec; }
.team-action:disabled { opacity: .5; }
.sidebar > .room-nav { min-height: 42px; margin-inline: 14px; gap: 11px; padding: 10px 13px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.sidebar > .room-nav .icon { width: 19px; height: 19px; }
.sidebar > .connections-nav { margin-top: 3px; }
.team-conversations { padding: 15px 14px 7px; min-height: 80px; }
.team-conversation-group + .team-conversation-group { margin-top: 16px; }
.team-list-heading { display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: 0 9px; }
.team-list-heading h2 { margin: 0; color: #8b978f; font-size: 11px; font-weight: 500; }
.team-list-add { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #84958a; font-size: 19px; line-height: 1; }
.team-list-add:hover { background: #e2eae5; color: var(--accent); }
.team-conversation { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 39px; margin: 3px 0 0; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #53645b; font-size: 13px; text-align: left; }
.team-conversation:hover { background: #eaf0ec; }
.team-conversation[aria-current="page"] { background: #e2ece9; color: #214f43; font-weight: 600; }
.team-conversation-mark { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%; background: #dce8e1; color: #607969; font-size: 11px; font-weight: 500; }
.team-conversation-mark.is-group { border-radius: 6px; background: #e5eae6; color: #748479; font-size: 16px; }
.team-conversation-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.team-list-empty { margin: 7px 10px 9px; color: #9aa59f; font-size: 12px; line-height: 1.6; }
.team-list-retry { margin: 0 8px; padding: 8px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; }
.team-sidebar-feedback { margin: 8px 24px; color: #8b685c; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.sidebar .members-section { padding: 19px 24px; margin-top: 10px; border-top: 1px solid #e3e9e5; }
.sidebar .members-section h2 { margin-bottom: 13px; font-size: 11px; color: #8b978f; }
.sidebar .members-list { gap: 12px; }
.sidebar .member-item { gap: 10px; font-size: 12px; }
.sidebar .member-item .avatar { width: 27px; height: 27px; font-size: 12px; }
.sidebar .local-caption { display: flex; flex-direction: column; gap: 5px; padding: 20px 24px 24px; color: #9aa69f; font-size: 10px; line-height: 1.4; }
#team-account-label { color: #6d8275; font-size: 11px; }
.team-mobile { display: none; align-items: center; justify-content: center; height: 34px; padding: 6px 9px; border: 1px solid #dce6e0; border-radius: 7px; background: #f6f9f7; color: var(--accent); font-size: 12px; white-space: nowrap; }
.team-dialog { width: min(440px, calc(100vw - 32px)); max-height: min(680px, calc(100dvh - 40px)); margin: auto; padding: 0; overflow-y: auto; border: 1px solid #dae4dd; border-radius: 14px; background: white; color: var(--text); box-shadow: 0 24px 90px #163c2930; }
.team-dialog::backdrop { background: #1c302b55; backdrop-filter: blur(3px); }
.team-dialog-form { padding: 23px 24px 20px; }
.team-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.team-dialog-header h2 { margin: 0; font-size: 19px; line-height: 1.4; font-weight: 650; }
.team-dialog-close { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; margin: -5px -6px 0 0; padding: 5px; border: 0; border-radius: 6px; background: transparent; color: #89988f; }
.team-dialog-close:hover { background: #f0f5f2; color: var(--accent); }
.team-dialog-close .icon { width: 18px; height: 18px; }
.team-dialog-description { margin: 0 0 20px; color: #7a897f; font-size: 13px; line-height: 1.75; }
.team-field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 17px; color: #5d7164; font-size: 12px; }
.team-input { display: block; width: 100%; min-width: 0; height: 40px; padding: 9px 11px; border: 1px solid #d9e3dc; border-radius: 7px; background: #fff; color: var(--text); font-size: 13px; }
.team-input::placeholder { color: #a2aca6; }
.team-input:focus { border-color: #8fac99; outline: 2px solid #26614d12; outline-offset: 0; }
.team-search-field { margin-bottom: 10px; }
.team-members-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.team-member-picker { max-height: 260px; min-height: 76px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.team-member-option { display: flex; align-items: center; gap: 11px; min-height: 49px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.team-member-option:hover { background: #f2f6f3; }
.team-member-avatar { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: #e7f0e9; color: #557560; font-size: 13px; }
.team-member-name { flex: 1; min-width: 0; color: #43574b; font-size: 13px; overflow-wrap: anywhere; }
.team-member-option input { width: 16px; height: 16px; margin: 0 1px 0 0; accent-color: var(--accent); }
.team-picker-empty { margin: 20px 8px; color: #95a098; font-size: 12px; line-height: 1.7; }
.team-selection-note { margin: 12px 1px 0; color: #96a198; font-size: 11px; line-height: 1.7; }
.team-form-error { margin: 13px 0 0; color: var(--error); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.team-dialog-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid #edf1ee; }
.team-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 37px; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: white; font-size: 12px; line-height: 1.5; }
.team-button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.team-button:disabled { opacity: .45; }
.team-button-secondary { border-color: #d9e3dc; background: white; color: #6c7c72; }
.team-button-secondary:hover:not(:disabled) { border-color: #afc7b9; background: #f2f7f3; }
.team-copy-row { display: flex; gap: 8px; }
.team-copy-row .team-input { background: #f7faf8; font-size: 12px; }
.team-copy-row .team-button { min-height: 40px; padding-inline: 13px; }
#team-invite-link-field > .team-field { margin-bottom: 8px; }
.team-mobile-actions { padding: 0 0 14px; }
.team-mobile-dialog .team-conversations { padding: 0; }
.team-mobile-dialog .team-conversation { min-height: 43px; }
.team-mobile-dialog .team-conversation-group + .team-conversation-group { margin-top: 14px; }
.team-mobile-dialog .team-selection-note { margin-top: 22px; padding-top: 14px; border-top: 1px solid #edf1ee; }

@media (max-width: 700px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .team-mobile { display: inline-flex; }
  .room-header { padding-inline: 16px; }
  .room-header-actions { gap: 6px; }
  #connection-label { max-width: 105px; }
  .team-dialog-form { padding: 22px 20px 18px; }
  .team-dialog { max-height: calc(100dvh - 28px); }
}

@media (max-width: 390px) {
  #connection-label { max-width: 70px; }
  .room-header h1 { max-width: 118px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

.connections-header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.relay-pair-dialog { width: min(470px, calc(100vw - 32px)); }
.relay-app-downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 13px; }
.relay-download-button { width: 100%; min-width: 0; padding: 8px 5px; font-size: 11px; text-align: center; text-decoration: none; }
.relay-setup-text { margin: 0 0 18px; color: #7a897f; font-size: 12px; line-height: 1.8; white-space: pre-line; }
#relay-pair-content > .team-field { margin-bottom: 8px; }
.relay-pair-code { color: var(--accent); background: #f5f9f6; font: 600 19px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 3px; text-align: center; }
.relay-pair-code.is-long { font-size: 11px; letter-spacing: 0; text-align: left; }
.relay-server-field { margin-top: 18px; }
.relay-server-field .team-input { color: #7b8b80; font-size: 11px; }
@media (max-width: 700px) {
  .connections-header { flex-wrap: wrap; }
  .connections-header-actions { width: 100%; justify-content: flex-start; gap: 7px; }
  .connections-header-actions .connection-button { min-height: 35px; padding: 6px 10px; }
  .connections-header-actions #connections-back { margin-left: auto; }
  .relay-pair-code.is-long { padding-inline: 8px; font-size: 10px; }
  .relay-app-downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relay-app-downloads > :last-child { grid-column: 1 / -1; }
}

.connection-onboarding { max-width: 920px; margin: 0 auto 20px; padding: 20px 24px; border: 1px solid #d7e5dc; border-radius: 10px; background: #f3f8f4; }
.connection-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 0 0 19px; padding: 0; list-style: none; }
.connection-steps li { display: inline-flex; align-items: center; gap: 7px; color: #8c9a91; font-size: 11px; line-height: 1.5; }
.connection-steps li > span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #d5e0d8; border-radius: 50%; background: #fff; font-size: 10px; }
.connection-steps li.is-current { color: var(--accent); font-weight: 600; }
.connection-steps li.is-current > span { border-color: var(--accent); background: var(--accent); color: #fff; }
.connection-steps li.is-complete { color: #5b7c67; }
.connection-steps li.is-complete > span { border-color: #c4d9cb; background: #e2eee6; }
.connection-onboarding-main { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; }
.connection-onboarding-main > div:first-child { min-width: 0; }
.connection-onboarding h2 { margin: 0 0 7px; color: #315b42; font-size: 16px; line-height: 1.5; font-weight: 600; }
.connection-onboarding p { max-width: 590px; margin: 0; color: #6a8072; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.connection-onboarding-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.relay-source-downloads { display: flex; margin-bottom: 12px; }
.relay-source-downloads .relay-download-button { width: auto; padding: 8px 16px; font-size: 12px; }
.relay-prerequisite { margin: 0 0 13px; color: #8d9991; font-size: 11px; line-height: 1.8; }
.relay-prerequisite a { margin-left: 4px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.relay-source-options { margin-bottom: 12px; }
.relay-source-options summary { margin-bottom: 9px; color: #7a897f; font-size: 12px; cursor: pointer; }
.relay-source-link { display: inline-block; margin-bottom: 9px; color: var(--accent); font-size: 12px; text-decoration: none; }
.relay-source-options .relay-prerequisite { margin-bottom: 7px; }
#relay-pair-platform { margin-bottom: 9px; }
.relay-pair-dialog .team-dialog-footer { flex-wrap: wrap; }
.relay-pair-dialog .team-dialog-footer a { text-decoration: none; }
@media (max-width: 700px) {
  .connection-onboarding { padding: 18px; }
  .connection-steps { gap: 9px 14px; margin-bottom: 16px; }
  .connection-steps li { gap: 5px; font-size: 10px; }
  .connection-onboarding-main { align-items: flex-start; flex-direction: column; gap: 15px; }
  .connection-onboarding-actions { width: 100%; }
}

/* Files remain inside their message or the agent reply that produced them. */
.file-entry { display: flex; align-items: center; max-width: min(100%, 390px); min-width: 0; border: 1px solid var(--border); border-radius: 7px; background: #f7f9fa; }
.file-entry .attachment-link { flex: 1; width: auto; min-width: 0; gap: 10px; border: 0; background: transparent; padding: 9px 11px; text-align: left; }
.file-entry .attachment-link .icon { flex: 0 0 21px; width: 21px; height: 21px; }
.file-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.file-meta { color: #829087; font-size: 11px; line-height: 1.3; white-space: nowrap; }
.file-download { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 36px; padding: 4px 11px; color: var(--accent); font-size: 12px; text-decoration: none; }
.file-download:hover { text-decoration: underline; }
.output-files { margin-top: 11px; }
.quote-message { margin-left: auto; padding: 2px 0 2px 6px; border: 0; background: transparent; color: #829087; font-size: 12px; opacity: 0; }
.message:hover > .message-content > .message-header .quote-message, .quote-message:focus-visible { opacity: 1; }
.cancel-task + .quote-message { margin-left: 0; }
.composer-quote, .message-quote { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; padding: 8px 11px; border: 0; border-left: 2px solid #aec2b7; border-radius: 0 5px 5px 0; background: #f3f7f4; color: #6a7c71; font-size: 12px; line-height: 1.5; }
.quote-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.quote-author { display: block; color: #556b5e; font-size: 12px; font-weight: 500; }
.quote-summary, .quote-files { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-files { color: #7d8c82; font-size: 11px; }
.message-quote { display: block; }
.message-quote .message-attachments { margin-top: 7px; }
.message-quote .attachment-link { font-size: 12px; }
.file-preview-dialog { width: min(980px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #dce5df; border-radius: 12px; box-shadow: 0 22px 90px #16281d30; }
.file-preview-dialog::backdrop { background: #19251f75; }
.file-preview-shell { display: flex; flex-direction: column; min-width: 0; max-height: calc(100dvh - 48px); }
.file-preview-header { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 11px 15px 11px 20px; border-bottom: 1px solid #e7ece9; }
.file-preview-header h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 15px; font-weight: 550; }
.file-preview-content { min-height: 140px; overflow: auto; background: #f7f9f8; }
.file-preview-image { display: block; max-width: 100%; max-height: calc(100dvh - 150px); margin: auto; object-fit: contain; }
.file-preview-pdf { display: block; width: 100%; height: min(720px, calc(100dvh - 140px)); border: 0; background: white; }
.file-preview-text { margin: 0; padding: 22px; min-height: 140px; white-space: pre-wrap; overflow-wrap: anywhere; color: #34453b; font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.file-preview-status { margin: 0; padding: 14px 20px; color: #7b887f; font-size: 13px; line-height: 1.6; }
@media (hover: none) { .quote-message { opacity: 1; } }
@media (max-width: 700px) {
  .file-entry { max-width: 100%; }
  .file-entry .attachment-link { max-width: calc(100vw - 145px); font-size: 13px; }
  .file-preview-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 9px; }
  .file-preview-shell { max-height: calc(100dvh - 20px); }
  .file-preview-header { padding-left: 14px; }
  .file-preview-text { padding: 15px; }
}

.file-sync-status { margin: 9px 0 0; color: #7b887f; font-size: 12px; line-height: 1.5; }
.file-sync-status.is-error { color: var(--error); }

.pdf-preview-toolbar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; align-items: center; gap: 18px; min-height: 44px; padding: 6px 12px; background: #f3f6f4; border-bottom: 1px solid #e2e9e4; }
.pdf-page-button { min-height: 30px; padding: 3px 9px; border: 1px solid #d9e2dc; border-radius: 5px; background: white; color: var(--accent); font-size: 12px; }
.pdf-page-button:disabled { opacity: .4; }
.pdf-page-label { font-size: 12px; color: #6a7c71; font-variant-numeric: tabular-nums; }
.pdf-preview-paper { padding: 18px; }
.pdf-preview-canvas { display: block; max-width: 100%; height: auto !important; margin: 0 auto; background: white; box-shadow: 0 1px 9px #24352918; }

.agent-waiting { font-size: 13px; }
.waiting-settings-link { color: var(--accent); white-space: nowrap; text-underline-offset: 3px; }

.native-question { margin-top: 4px; color: var(--text); font-size: 13px; line-height: 1.5; }
.native-question-field { min-width: 0; margin: 0 0 12px; padding: 0; border: 0; }
.native-question-field:last-of-type { margin-bottom: 10px; }
.native-question-title { width: 100%; margin: 0 0 6px; padding: 0; font-size: 14px; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.native-question-header, .native-question-hint { display: block; margin-bottom: 5px; color: #748178; font-size: 11px; }
.native-question-option { display: flex; align-items: flex-start; gap: 8px; width: 100%; margin-top: 5px; padding: 7px 9px; border: 1px solid #dfe7e2; border-radius: 6px; color: inherit; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.native-question-option:has(input:checked), .native-question-option[aria-pressed="true"] { border-color: #83a28f; background: #eef5f0; }
.native-question-option:has(input:focus-visible), .native-question-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.native-question-option input { flex: 0 0 auto; width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--accent); }
.native-question-option-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.native-question-option-number { display: grid; place-items: center; flex: 0 0 21px; min-height: 21px; margin-top: 1px; border-radius: 5px; color: #718077; background: #f2f5f3; font-size: 12px; }
.native-question-option-arrow { flex: 0 0 auto; margin-left: auto; color: #78857c; }
.native-question-option-label { white-space: pre-wrap; }
.native-question-description { color: #78857c; font-size: 12px; white-space: pre-wrap; }
.native-question-option:has(input:disabled), .native-question-option:disabled { cursor: default; }
.native-question-option:not(button):not(:has(input)) { cursor: default; }
.native-question-other { display: block; margin-top: 7px; padding: 4px 2px; border: 0; color: #78857c; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.native-question-other:hover:not(:disabled) { color: var(--accent); }
.native-question-other:disabled { cursor: default; }
.native-question-custom { margin-top: 5px; }
.native-question-custom[hidden] { display: none; }
.native-question-text { display: block; box-sizing: border-box; width: 100%; min-height: 64px; resize: vertical; padding: 8px 9px; border: 1px solid #c9d9ce; border-radius: 6px; background: #fff; color: inherit; font: inherit; line-height: 1.5; }
.native-question-text:focus { outline: 2px solid #83a28f; outline-offset: 1px; }
.native-question-custom .native-question-hint { margin: 4px 0 0; }
.native-question-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; }
.native-question-submit { flex: 0 0 auto; min-height: 30px; padding: 4px 11px; border: 1px solid #c9dacd; border-radius: 6px; color: #355f43; background: #edf5ef; font-size: 12px; }
.native-question-submit:disabled { color: #839289; border-color: #dfe7e1; background: #f3f6f4; cursor: not-allowed; }
.native-question-state { margin: 0; color: #748178; font-size: 12px; overflow-wrap: anywhere; }

.inline-composer { margin: 12px 0 0; border: 1px solid #e0e7e2; border-radius: 7px; background: #fff; transition: border-color 120ms; }
.inline-composer:focus-within { border-color: #8eae9a; box-shadow: 0 0 0 2px #4b876415; }
.inline-composer-row { display: flex; align-items: flex-end; gap: 5px; padding: 5px 6px; }
.inline-input { display: block; flex: 1; min-width: 0; height: 28px; min-height: 28px; max-height: 140px; padding: 4px 2px; resize: none; border: 0; border-radius: 0; outline: 0; color: var(--text); background: transparent; font: inherit; font-size: 14px; line-height: 20px; overflow-y: auto; overflow-wrap: anywhere; }
.inline-attach, .inline-send { display: flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 4px; border: 0; border-radius: 5px; background: transparent; color: #75887d; }
.inline-attach .icon { width: 16px; height: 16px; }
.inline-send { font-family: system-ui, sans-serif; font-size: 20px; line-height: 1; color: #426b52; }
.inline-attach:hover:not(:disabled), .inline-send:hover:not(:disabled) { background: #edf4ef; }
.inline-attach:focus-visible, .inline-send:focus-visible { outline: 2px solid #8eae9a; outline-offset: 1px; }
.inline-attach:disabled, .inline-send:disabled { color: #b4bdb7; cursor: default; }
.inline-files { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 0; padding: 7px 8px 1px; }
.inline-files[hidden], .inline-composer-note[hidden] { display: none; }
.inline-files .pending-file { max-width: min(100%, 280px); font-size: 12px; }
.inline-composer-note { margin: 0; padding: 0 10px 7px; color: #7b877e; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.inline-composer-note.is-error { color: var(--error); }
.native-origin, .native-sharing-state { color: #87958c; font-size: 11px; white-space: nowrap; }
.sharing-preferences-open { border: 0; padding: 3px 0; width: fit-content; background: transparent; color: #75877c; font-size: 11px; text-align: left; }
.sharing-preferences-open:hover { color: #315e44; text-decoration: underline; }
.agent-device-source { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #8a978f; }
.agent-device-source.is-foreign { color: #8c744a; }
.confirm-local-device { color: #426b52; font-size: 12px; white-space: nowrap; text-decoration: none; }
.confirm-local-device[hidden] { display: none; }
.inline-input[readonly] { color: #8b958f; cursor: default; }

.composer-continuation { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 4px 10px; padding: 8px 10px; border-left: 2px solid #729882; background: #f1f6f2; border-radius: 4px; }
.composer-continuation[hidden] { display: none; }
.continuation-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.continuation-title { font-size: 12px; font-weight: 500; color: #426451; overflow-wrap: anywhere; }
.continuation-note { font-size: 11px; color: #7b877e; line-height: 1.5; }
.composer-continuation .remove-file { flex-shrink: 0; white-space: nowrap; }
#message-input[data-mention-locked="true"] .mention-token { cursor: default; }

.reply-sharing { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.reply-sharing-toggle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 4px; border: 0; border-radius: 5px; color: #60816e; background: transparent; flex: 0 0 auto; }
.reply-sharing-toggle.is-private { color: #8a9290; }
.reply-sharing-toggle:hover:not(:disabled) { color: #315f45; background: #edf4ef; }
.reply-sharing-toggle:focus-visible { outline: 2px solid #8eae9a; outline-offset: 1px; }
.reply-sharing-toggle:disabled { opacity: .5; cursor: default; }
.reply-sharing-icon { display: block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reply-sharing-slash { stroke-width: 2; paint-order: stroke; }
.reply-sharing-error { color: var(--error); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; max-width: 260px; }
.reply-sharing-error[hidden], .reply-sharing-preference-state[hidden] { display: none; }
.reply-sharing-preferences { padding: 4px 0; }
.reply-sharing-default { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 14px; line-height: 1.5; }
.reply-sharing-default input { width: 16px; height: 16px; margin: 0; accent-color: #386d51; flex: 0 0 auto; }
.reply-sharing-preference-hint { margin: 7px 0 0 25px; color: #7b877e; font-size: 12px; line-height: 1.5; }
.reply-sharing-preference-state { margin: 7px 0 0 25px; color: #7b877e; font-size: 12px; line-height: 1.5; }
.reply-sharing-preference-state.is-error { color: var(--error); }
