/* LinkBridge responsive layout: shared foundations, components, then screen states. */
@import url('/theme.css');

*,*::before,*::after { box-sizing:border-box; }
[hidden] { display:none!important; }
:root { font-family:Inter,"Segoe UI","Microsoft YaHei",system-ui,sans-serif; color:#243d36; background:#f6f8f5; font-synthesis:none; font-size:14px; --ink:#183d34; --green:#226653; --mint:#d9eee3; --muted:#687c70; --border:#e3eae2; --white:#fff; --danger:#b14040; --rail-width:80px; --list-width:330px; --page-gutter:clamp(24px,3vw,48px); }
body { margin:0; }
button,input,textarea,select { font:inherit; }
button,a,input,textarea,select { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.55; }
a { color:inherit; text-decoration:none; }
button { border:0; background:none; color:inherit; }
input,textarea,select { border:1px solid #dde4dc; background:#fff; border-radius:10px; outline:none; color:#243d36; }
input:focus,textarea:focus,select:focus { border-color:#76a995; box-shadow:0 0 0 3px #76a99520; }
button:focus-visible,a:focus-visible { outline:3px solid #8ec4ac; outline-offset:3px; }
svg { width:20px; height:20px; flex-shrink:0; vertical-align:middle; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:44px; border:1px solid var(--border); border-radius:10px; padding:12px 18px; font-weight:600; line-height:1.5; background:#fff; transition:background .15s,border-color .15s; text-align:center; }
.button:hover { background:#f1f6f1; }
.button.primary { background:var(--green); border-color:var(--green); color:#fff; }
.button.primary:hover { background:#194d3f; }
.button.compact { padding:10px 12px; font-size:12px; }
.text-button { color:var(--green); min-height:44px; padding:10px 2px; font-weight:600; }
.icon-button { width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; border-radius:10px; flex:0 0 44px; color:#5d7466; }
.icon-button:hover { background:#eaf1eb; }
.eyebrow { font-size:10px; font-weight:700; letter-spacing:1.8px; line-height:1.6; }
.muted { color:var(--muted); }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.demo-banner { position:relative; z-index:2; background:#fff4d9; text-align:center; padding:7px 12px; color:#795b21; font-size:11px; line-height:17px; border-bottom:1px solid #f4e4bf; min-height:32px; }
.demo-banner span { margin-left:18px; opacity:.8; }
.boot { min-height:90dvh; display:flex; align-items:center; justify-content:center; flex-direction:column; padding:24px; gap:12px; color:var(--muted); text-align:center; }

/* Login, registration and guest entry */
.auth-view { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:100dvh; }
.demo-banner:not([hidden])~.auth-view { min-height:calc(100dvh - var(--demo-height,32px)); }
.brand-panel { position:relative; background:#173e34; color:#edf4eb; padding:clamp(32px,4vw,56px) clamp(30px,5vw,84px); overflow:hidden; display:flex; flex-direction:column; min-width:0; min-height:680px; }
.brand { display:flex; gap:12px; align-items:center; width:fit-content; min-height:44px; }
.brand>span { font-size:23px; font-weight:600; letter-spacing:2px; }
.brand small { font-size:8px; letter-spacing:2.4px; display:block; margin-top:3px; }
.brand-copy { margin-top:clamp(42px,7vh,85px); z-index:1; }
.brand-copy .eyebrow { color:#b1cbbb; font-size:10px; }
.brand-copy .eyebrow>span { width:6px; height:6px; display:inline-block; background:#afe0bc; border-radius:50%; margin-right:10px; }
.brand-copy h1 { font-size:clamp(34px,3.5vw,60px); line-height:1.45; font-weight:500; letter-spacing:1px; margin:22px 0; }
.brand-copy h1>span { color:#a4d2b0; }
.brand-copy p { line-height:2; color:#b6cdbd; font-size:14px; }
.brand-bottom { margin-top:auto; padding-top:24px; font-size:10px; line-height:1.6; color:#abc4b1; display:flex; justify-content:space-between; gap:16px; }
.brand-bottom>span:first-child { letter-spacing:1.4px; }
.bridge-art { position:relative; height:250px; margin-top:5px; max-width:410px; width:100%; flex-shrink:0; }
.orbit { position:absolute; border:1px solid #62837244; border-radius:50%; width:300px; height:300px; left:35px; top:-10px; }
.orbit-two { width:225px; height:225px; left:74px; top:30px; }
.art-thread { position:absolute; top:76px; left:30px; right:15px; display:flex; align-items:center; gap:16px; padding:20px 22px; background:#f2f3e7; border-radius:14px; transform:rotate(-5deg); box-shadow:0 20px 60px #09251955; }
.art-avatar { background:#bcdbb9; color:#2a5543; border-radius:11px; display:grid; place-items:center; width:42px; height:42px; font-size:18px; }
.art-lines { flex:1; }
.art-lines i { height:6px; width:85%; background:#dce3d5; display:block; border-radius:8px; margin:8px 0; }
.art-lines i:first-child { width:55%; background:#8fa58c; }
.art-thread>span { color:#6e947a; font-size:22px; }
.art-bubble { position:absolute; border-radius:12px; padding:15px 20px; font-size:13px; box-shadow:0 12px 30px #0d2e2733; }
.art-bubble-one { top:170px; left:102px; background:#add6ad; color:#224b36; transform:rotate(5deg); }
.art-bubble-one>span { margin-left:18px; }
.art-bubble-two { top:23px; right:0; background:#295449; color:#bfd2bd; font-size:10px; transform:rotate(3deg); }
.art-dot { height:5px; width:5px; background:#aeda9b; display:inline-block; border-radius:50%; margin-right:7px; }
.art-avatar-small { position:absolute; bottom:17px; left:10px; width:34px; height:34px; background:#d9c9a7; transform:rotate(-10deg); }
.art-spark { position:absolute; right:8px; bottom:15px; color:#bad9a8; font-size:42px; }
.auth-panel { display:flex; flex-direction:column; justify-content:center; min-width:0; padding:48px clamp(28px,6vw,96px) 26px; background:#fcfdfa; }
.auth-card { width:100%; max-width:400px; margin:auto; }
.auth-card h2 { font-size:30px; letter-spacing:1px; font-weight:600; margin:17px 0 10px; }
.auth-description { color:#687c70; line-height:1.8; margin:0 0 26px; }
.auth-tabs { display:flex; gap:26px; border-bottom:1px solid var(--border); margin-bottom:24px; }
.auth-tabs button { padding:12px 0; min-height:46px; font-size:14px; color:#718174; position:relative; }
.auth-tabs button[aria-selected=true] { color:#265d49; font-weight:600; }
.auth-tabs button[aria-selected=true]::after { content:''; height:2px; position:absolute; bottom:-1px; left:0; right:0; background:#377c5d; }
.auth-card label,.modal label { display:block; margin:18px 0; font-size:13px; line-height:1.5; font-weight:600; }
.auth-card input::placeholder,textarea::placeholder { color:#859389; opacity:1; }
.password-wrap { position:relative; }
.password-wrap input { padding-right:64px; }
.password-wrap button { position:absolute; right:4px; top:2px; min-height:44px; min-width:48px; border-radius:8px; color:#577463; font-size:12px; }
.field-hint { font-size:11px; line-height:1.7; font-weight:400; color:#6b7d70; margin-top:8px; display:block; }
.auth-submit { width:100%; min-height:48px; justify-content:space-between; margin-top:12px; }
.auth-divider { display:flex; align-items:center; gap:15px; color:#778574; font-size:11px; margin:26px 0 18px; }
.auth-divider::before,.auth-divider::after { content:''; height:1px; background:#e4e9df; flex:1; }
.guest-button { width:100%; min-height:48px; justify-content:space-between; background:transparent; color:#456751; font-size:13px; }
.auth-note { font-size:11px; line-height:1.9; color:#71816d; text-align:center; margin-top:20px; }
.auth-footer { display:flex; justify-content:space-between; gap:16px; font-size:10px; line-height:1.6; color:#7f8e78; width:100%; max-width:400px; margin:38px auto 0; }
.demo-login { width:100%; background:#fff5de; color:#926f35; margin-top:10px; font-size:12px; }
.mobile-brand { display:none; }
.notice { background:#edf5eb; color:#426c46; padding:12px 14px; border-radius:9px; font-size:12px; line-height:1.7; margin:14px 0; overflow-wrap:anywhere; }
.form-error { font-size:12px; color:var(--danger); background:#fff0ed; padding:12px 14px; border-radius:9px; line-height:1.7; margin:14px 0; overflow-wrap:anywhere; }

/* Application frame and conversation list */
.app-view { position:fixed; top:calc(var(--app-top,0px) + var(--demo-height,0px)); left:0; display:grid; grid-template-columns:var(--rail-width) var(--list-width) minmax(0,1fr); grid-template-rows:minmax(0,1fr); width:100%; height:calc(var(--app-height,100dvh) - var(--demo-height,0px)); min-height:0; overflow:hidden; }
.rail { background:#183e34; color:#b1ccba; display:flex; flex-direction:column; align-items:center; gap:24px; padding:24px 8px 16px; overflow-y:auto; }
.rail-logo { display:flex; align-items:center; justify-content:center; flex-shrink:0; width:48px; height:48px; margin-bottom:12px; }
.rail-navigation { display:flex; flex-direction:column; gap:12px; }
.rail-button { width:56px; min-height:56px; display:flex; flex-direction:column; align-items:center; justify-content:center; flex-shrink:0; gap:5px; border-radius:12px; color:#b0c9b7; position:relative; }
.rail-button small { font-size:11px; }
.rail-button.active,.rail-button:hover { color:#c6e5ca; background:#295245; }
.rail-button.active:before { content:''; position:absolute; left:-12px; top:17px; height:24px; width:3px; background:#b4d8a7; border-radius:3px; }
.rail-bottom { margin-top:auto; display:flex; align-items:center; flex-direction:column; gap:10px; flex-shrink:0; }
.profile-avatar { background:#e3d5b6; color:#614f30; width:44px; height:44px; border-radius:12px; font-size:16px; font-weight:600; }
.logout-button { min-height:44px; }
.conversation-pane { background:#fff; display:flex; flex-direction:column; min-width:0; border-right:1px solid var(--border); }
.conversation-heading { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:10px; padding:27px 22px 21px; }
.workspace-label { font-size:9px; line-height:1.6; letter-spacing:1.2px; color:#768875; }
.conversation-heading h1 { font-size:23px; line-height:1.3; letter-spacing:.5px; font-weight:600; margin:7px 0 0; display:flex; align-items:center; gap:9px; }
.total-unread { font-size:10px; border-radius:8px; background:#e1eee1; min-width:22px; text-align:center; padding:3px; color:#537b54; }
.add-button { background:#e9f1e8; }
.search-wrap { position:relative; margin:0 20px; display:flex; align-items:center; flex-shrink:0; }
.search-wrap>span:first-child { position:absolute; left:13px; color:#a3ada4; }
.search-wrap svg { width:15px; height:15px; }
.search-wrap input { width:100%; min-height:44px; border:1px solid transparent; background:#f1f5ef; font-size:12px; border-radius:10px; padding:11px 34px; }
.search-wrap input::placeholder { color:#788a76; }
.search-key { position:absolute; right:13px; color:#b0b8ac; }
.conversation-filters { display:flex; flex-shrink:0; gap:4px; margin:12px 20px; padding:3px; border-radius:10px; background:#f5f7f2; }
.conversation-filters button { flex:1; min-width:0; min-height:44px; color:#6d8067; font-size:12px; padding:8px; border-radius:8px; white-space:nowrap; }
.conversation-filters button.active { background:#e7eee0; color:#426838; font-weight:600; }
.list-caption { display:flex; justify-content:space-between; flex-shrink:0; gap:10px; font-size:11px; color:#788b73; padding:2px 24px 10px; }
.conversation-list { flex:1 1 0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding:0 10px 12px; scrollbar-width:thin; scrollbar-color:#cbd6c5 transparent; }
.conversation-item { position:relative; display:flex; align-items:center; width:100%; min-height:78px; gap:11px; padding:14px 12px; margin-bottom:4px; border:1px solid transparent; border-radius:12px; text-align:left; }
.conversation-item:hover { background:#f5f8f1; }
.conversation-item.selected { border-color:#dce8d3; background:#eaf2e4; }
.avatar { width:41px; height:41px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; background:#dcecd5; color:#587b49; font-size:15px; font-weight:600; }
.avatar.tone-1 { background:#e9e5d5; color:#8a7a4a; }
.avatar.tone-2 { background:#e0eaf0; color:#607a8b; }
.avatar.tone-3 { background:#e9dfd8; color:#987258; }
.avatar.tone-4 { background:#e7e1ee; color:#867398; }
.conversation-content { flex:1; min-width:0; }
.conversation-topline { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.conversation-name { font-size:14px; line-height:1.5; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; color:#324e3a; }
.conversation-time { color:#7e8e75; font-size:10px; flex-shrink:0; }
.conversation-preview { margin-top:7px; font-size:12px; line-height:1.5; color:#6f8465; display:flex; justify-content:space-between; gap:8px; }
.conversation-preview>span:first-child { overflow:hidden; min-width:0; white-space:nowrap; text-overflow:ellipsis; }
.unread-badge { flex-shrink:0; font-size:10px; background:#668452; color:#fff; border-radius:6px; min-width:18px; height:18px; text-align:center; padding:1px 4px; }
.kind-label { font-size:8px; border:1px solid #bed1b7; color:#7a936b; padding:1px 3px; border-radius:3px; margin-left:5px; font-weight:400; }
.workspace-footer { min-height:43px; display:flex; align-items:center; flex-shrink:0; gap:7px; font-size:10px; line-height:1.6; color:#6b8063; padding:10px 22px; border-top:1px solid #eff2ec; }
.sync-indicator { width:5px; height:5px; border-radius:50%; background:#9cb291; }
.sync-indicator.offline { background:#d39b60; }
.workspace-lock { margin-left:auto; }
.workspace-lock svg { height:12px; width:12px; }
.guest-upgrade { flex-shrink:0; background:#f0f6ea; padding:14px; border-radius:11px; margin:10px 12px; font-size:13px; }
.guest-upgrade p { margin:6px 0 10px; font-size:12px; line-height:1.6; color:#607a51; }

/* Conversation and messages */
.chat-pane { background:#f7f9f4; position:relative; overflow:hidden; }
.empty-chat { display:flex; flex-direction:column; height:100%; padding:30px var(--page-gutter); overflow:auto; }
.empty-top,.welcome-footer { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:16px; color:#74866a; font-size:11px; line-height:1.6; }
.welcome-content { width:100%; max-width:620px; margin:auto; text-align:center; padding:32px 0; }
.welcome-eyebrow { font-size:9px; letter-spacing:2.6px; color:#8ba07c; }
.welcome-content h2 { font-size:clamp(27px,2.5vw,38px); line-height:1.4; font-weight:500; letter-spacing:1px; margin:20px 0; }
.welcome-content h2>span { color:#9eb483; }
.welcome-content>p { font-size:13px; line-height:2; color:#708062; }
.welcome-art { width:300px; max-width:100%; height:190px; margin:22px auto; position:relative; }
.welcome-art-back { position:absolute; border-radius:24px; background:#e9eee0; top:50px; left:36px; width:240px; height:118px; transform:rotate(9deg); }
.welcome-chat-card { position:absolute; top:49px; left:18px; right:17px; height:83px; background:#fff; box-shadow:0 16px 28px #5664440b; border-radius:15px; transform:rotate(-5deg); display:flex; align-items:center; gap:13px; padding:19px; }
.welcome-avatar { width:38px; height:38px; border-radius:11px; background:#d8e6c4; color:#6c864f; display:grid; place-items:center; font-weight:600; }
.welcome-chat-card>div { flex:1; }
.welcome-chat-card i { display:block; height:5px; background:#e8ecdf; margin:8px 0; border-radius:5px; }
.welcome-chat-card i:first-child { width:58%; background:#bbc9a6; }
.welcome-check { font-size:18px; color:#9eb582; }
.welcome-reply { position:absolute; bottom:24px; right:3px; border-radius:10px; padding:13px 20px; background:#dbe7c9; font-size:11px; color:#6b8351; transform:rotate(3deg); }
.welcome-reply>span { margin-right:9px; }
.welcome-orbit { position:absolute; right:12px; top:12px; width:21px; height:21px; border:1px solid #c6d1b7; border-radius:50%; }
.welcome-promises { display:flex; flex-wrap:wrap; gap:12px 24px; justify-content:center; font-size:11px; color:#718362; margin-top:30px; }
.welcome-promises svg { width:12px; height:12px; margin-right:4px; }
.welcome-footer>span:first-child { font-size:11px; font-weight:500; color:#89997b; }
.active-chat { display:flex; flex-direction:column; height:100%; position:relative; }
.chat-heading { min-height:88px; padding:15px var(--page-gutter); display:flex; align-items:center; flex-shrink:0; gap:12px; border-bottom:1px solid var(--border); background:#fbfcf9; }
.chat-avatar { width:40px; height:40px; }
.chat-title-wrap { flex:1; min-width:0; }
.chat-title-wrap h2 { font-size:16px; line-height:1.4; font-weight:600; margin:0 0 6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-subtitle { font-size:11px; line-height:1.5; color:#708462; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.status-tag { flex-shrink:0; font-size:11px; line-height:1.5; color:#647e40; background:#edf2de; padding:5px 8px; border-radius:6px; white-space:nowrap; }
.status-tag.resolved { color:#5b906a; background:#e4f1e4; }
.chat-context { flex-shrink:0; max-height:66px; overflow-y:auto; border-bottom:1px solid #e4ebd9; font-size:12px; line-height:1.7; color:#61764d; background:#f0f5e8; padding:9px var(--page-gutter); overflow-wrap:anywhere; }
.messages { flex:1 1 0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding:24px var(--page-gutter) 16px; scroll-behavior:auto; scrollbar-width:thin; scrollbar-color:#cbd6c5 transparent; }
.message-date { text-align:center; font-size:11px; line-height:1.6; color:#7b8b70; margin:4px 0 24px; }
.message-row { display:flex; align-items:flex-start; gap:10px; margin-bottom:22px; }
.message-row.mine { flex-direction:row-reverse; }
.message-row .avatar { width:31px; height:31px; font-size:12px; border-radius:9px; margin-top:4px; }
.message-stack { max-width:min(78%,720px); min-width:0; }
.message-meta { display:flex; gap:10px; align-items:baseline; margin:0 2px 7px; font-size:11px; line-height:1.5; color:#6c7f60; }
.mine .message-meta { justify-content:flex-end; }
.message-meta time { font-size:10px; color:#839275; flex-shrink:0; }
.message-bubble { background:#fff; padding:11px 14px; border-radius:2px 13px 13px; font-size:14px; line-height:1.8; color:#3d5539; white-space:pre-wrap; overflow-wrap:anywhere; border:1px solid #e4ebdc; }
.mine .message-bubble { background:#e1edcf; border-color:#d8e5c8; border-radius:13px 2px 13px 13px; color:#3e5830; }
.file-link { display:flex; gap:10px; align-items:center; white-space:normal; min-width:0; min-height:44px; }
.file-link svg { width:25px; height:25px; flex-shrink:0; }
.file-link strong { display:block; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.file-link small { font-size:11px; line-height:1.5; display:block; color:#6b815a; margin-top:3px; }
.composer { flex-shrink:0; padding:10px var(--page-gutter) 16px; background:#f7f9f4; }
.composer-box { border:1px solid #d5e1c9; border-radius:14px; background:#fff; padding:8px 10px; }
.composer-box:focus-within { border-color:#a4bd8a; box-shadow:0 0 0 2px #dce8d140; }
.composer textarea { display:block; width:100%; resize:none; border:0; border-radius:0; background:none; box-shadow:none; padding:5px 4px; min-height:52px; max-height:min(160px,25dvh); overflow-y:auto; font-size:15px; line-height:1.6; }
.composer-tools { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.composer-tools>div { display:flex; align-items:center; gap:6px; min-width:0; }
.composer-status { font-size:11px; line-height:1.5; color:#718568; overflow:hidden; min-width:0; text-overflow:ellipsis; white-space:nowrap; }
.send-button { flex-shrink:0; min-width:82px; padding:10px 15px; font-size:13px; gap:9px; border-radius:9px; }
.send-button svg { height:16px; width:16px; }
.composer-hint { display:flex; justify-content:space-between; gap:16px; color:#7a8c6d; font-size:10px; line-height:1.5; margin-top:8px; }
.composer-hint kbd { font-family:inherit; }
.message-error { padding:4px var(--page-gutter); background:#fff1df; color:#936223; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:12px; max-height:100px; overflow-y:auto; font-size:12px; line-height:1.6; }
.message-error .text-button { font-size:12px; flex-shrink:0; }
.new-message-alert { position:absolute; z-index:1; bottom:calc(var(--composer-height,155px) + 12px); left:50%; transform:translateX(-50%); background:#2c6850; color:white; border-radius:24px; min-height:44px; max-width:calc(100% - 32px); padding:10px 17px; font-size:12px; line-height:1.5; white-space:nowrap; box-shadow:0 3px 15px #183e3420; }
.join-bar { padding:22px var(--page-gutter); display:flex; align-items:center; flex-shrink:0; gap:18px; justify-content:space-between; border-top:1px solid var(--border); }
.join-bar strong,.join-bar span { display:block; }
.join-bar strong { font-size:13px; line-height:1.6; }
.join-bar span { font-size:12px; line-height:1.6; color:#697f59; margin-top:5px; }
.mobile-back { display:none; }
.empty-list { text-align:center; font-size:12px; color:#6a7e61; padding:36px 18px; line-height:1.9; overflow-wrap:anywhere; }
.load-older { display:block; min-height:44px; margin:0 auto 24px; font-size:12px; color:#53793c; padding:10px 15px; border:1px solid #d9e4d0; border-radius:9px; }

/* Dialogs and feedback */
.modal { position:fixed; top:calc(var(--app-top,0px) + 16px); bottom:auto; border:1px solid #dce6d6; border-radius:18px; padding:24px; width:min(480px,calc(100% - 32px)); max-width:100%; color:#294734; max-height:calc(var(--app-height,100dvh) - 32px); margin:0 auto; overflow:auto; overscroll-behavior:contain; scroll-padding-block:20px; box-shadow:0 24px 80px #10291d33; background:#fdfefb; }
.modal::backdrop { background:#132d2555; backdrop-filter:blur(3px); }
.modal-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.modal-header h2 { font-size:21px; line-height:1.45; font-weight:600; margin:6px 0 0; overflow-wrap:anywhere; }
.modal p { font-size:13px; color:#637956; line-height:1.8; overflow-wrap:anywhere; }
.modal .button { width:100%; margin-top:14px; }
.modal .member-picker { border:1px solid #dfe8d6; border-radius:10px; max-height:220px; overflow:auto; overscroll-behavior:contain; margin:14px 0; padding:5px; }
.modal .member-option { display:flex; align-items:center; gap:10px; min-height:58px; margin:0; padding:10px; cursor:pointer; font-size:13px; border-radius:8px; }
.member-option:hover { background:#eef5e8; }
.member-option input { accent-color:#568142; flex-shrink:0; width:18px; height:18px; margin:0; padding:0; }
.member-option small { display:block; font-size:11px; color:#6f865f; margin-top:4px; }
.member-option .avatar { width:30px; height:30px; border-radius:8px; font-size:11px; }
.modal .member-option>span:last-child { flex:1; min-width:0; overflow-wrap:anywhere; }
.invite-result { background:#eef5e7; border:1px solid #d8e6cd; border-radius:10px; padding:14px; margin-top:15px; }
.invite-result input { font-size:10px; word-break:break-all; }
.profile-summary { display:flex; gap:14px; align-items:center; padding:5px 0 15px; }
.profile-summary strong { font-size:15px; overflow-wrap:anywhere; }
.profile-summary small { display:block; color:#647e53; font-size:12px; line-height:1.7; margin-top:5px; overflow-wrap:anywhere; }
.detail-row { padding:12px 0; border-bottom:1px solid #e8efdf; font-size:13px; line-height:1.7; display:flex; justify-content:space-between; align-items:baseline; gap:18px; }
.detail-row span { flex-shrink:0; color:#637c52; }
.detail-members { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.detail-person { display:flex; align-items:center; gap:5px; max-width:100%; font-size:12px; line-height:1.6; border-radius:7px; background:#eff5e8; padding:7px 9px; overflow-wrap:anywhere; }
.danger-button { color:#b35b4a!important; }
.toast { position:fixed; bottom:max(20px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 32px); padding:13px 18px; background:#254e3f; color:#f3f8ed; border-radius:11px; box-shadow:0 8px 40px #152e2733; font-size:13px; line-height:1.7; z-index:20; text-align:center; overflow-wrap:anywhere; pointer-events:none; }
.toast.error { background:#8d4b3f; }
.loading-copy { text-align:center; color:#6d835d; font-size:13px; line-height:1.8; padding:28px 12px; overflow-wrap:anywhere; }
.divider { height:1px; background:#e5edde; margin:22px 0; }
.modal-help { font-size:12px!important; }

/* Email verification */
.email-verification { margin:18px 0; }
.email-verification>label { margin:0 0 8px; }
.verification-row { display:flex; align-items:stretch; gap:8px; }
.auth-card .verification-row input,.modal .verification-row input { margin:0; flex:1; min-width:0; letter-spacing:3px; }
.auth-card .verification-row input::placeholder,.modal .verification-row input::placeholder { letter-spacing:0; }
.verification-row .verification-send,.modal .verification-row .verification-send { width:auto; flex:0 0 auto; min-height:48px; margin:0; padding:10px 12px; font-size:12px; color:var(--green); background:#edf5ef; white-space:nowrap; }
.verification-row .verification-send:disabled { cursor:default; }
.email-verification .verification-status { margin:8px 0 0; font-size:12px; font-weight:400; line-height:1.7; color:#38704f; overflow-wrap:anywhere; }
.email-verification .verification-status.error { color:var(--danger); }

/* Content bounds and shared input controls. */
html { min-width:280px; -webkit-text-size-adjust:100%; }
body.app-open { overflow:hidden; overscroll-behavior:none; }
.rail, .conversation-pane, .chat-pane, .active-chat, .messages, .conversation-list { min-width:0; min-height:0; }
.conversation-heading > div, .file-link > div, .profile-summary > div, .modal-header > div, .join-bar > div { min-width:0; }
.auth-card input, .modal input:where(:not([type=checkbox]):not([type=radio])), .modal select { display:block; width:100%; min-width:0; min-height:48px; padding:12px 14px; margin-top:8px; line-height:1.5; font-size:14px; }
input[readonly] { background:#f2f6f2; color:#586f60; }
.message-meta > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.message-error > span, .join-bar strong, .join-bar span { min-width:0; overflow-wrap:anywhere; }
.join-bar .button { flex-shrink:0; }
.guest-upgrade .button { width:100%; }
.detail-row > strong { min-width:0; text-align:right; overflow-wrap:anywhere; }
.invite-result label { margin-top:0; }

/* Wide desktop and compact desktop layouts. */
@media (min-width:1500px) {
  :root { --rail-width:86px; --list-width:360px; --page-gutter:clamp(40px,4vw,90px); }
  .auth-panel { padding-left:18%; padding-right:18%; }
}
@media (min-width:901px) and (max-width:1199px) {
  :root { --rail-width:68px; --list-width:286px; --page-gutter:22px; }
  .rail { padding-left:6px; padding-right:6px; }
  .rail-button { width:48px; }
  .rail-button.active:before { left:-10px; }
  .conversation-heading { padding:23px 16px 18px; }
  .conversation-heading h1 { font-size:21px; }
  .search-wrap { margin-left:14px; margin-right:14px; }
  .conversation-filters { margin-left:14px; margin-right:14px; }
  .conversation-item { gap:9px; padding-left:9px; padding-right:9px; }
  .conversation-item .avatar { width:38px; height:38px; }
  .conversation-name { font-size:13px; }
  .conversation-time { font-size:9px; }
  .brand-panel { padding-left:30px; padding-right:30px; }
  .brand-bottom { flex-direction:column; gap:6px; }
  .brand-copy h1 { font-size:35px; }
  .auth-panel { padding-left:36px; padding-right:36px; }
  .chat-heading { gap:9px; padding-left:18px; padding-right:18px; }
  .chat-heading .chat-avatar { width:36px; height:36px; }
  .chat-title-wrap h2 { font-size:15px; }
  .status-tag { font-size:10px; }
  .composer-hint > span:last-child { display:none; }
  .welcome-footer > span:last-child { max-width:210px; text-align:right; }
}

/* Phone and portrait tablet: full-width lists with navigation beneath. */
@media (max-width:900px) {
  :root { --page-gutter:18px; }
  input, textarea, select { font-size:16px; }
  .auth-view { display:block; }
  .brand-panel { display:none; }
  .auth-panel { min-height:calc(100dvh - var(--demo-height,0px)); padding:max(22px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left)); }
  .mobile-brand { display:flex; align-items:center; gap:10px; width:100%; max-width:420px; margin:0 auto 32px; font-size:20px; font-weight:600; }
  .mobile-brand span { color:#718469; font-size:12px; letter-spacing:.8px; font-weight:400; }
  .auth-card, .auth-footer { max-width:420px; }
  .auth-card h2 { font-size:29px; }
  .auth-card input, .modal input:where(:not([type=checkbox]):not([type=radio])), .modal select, .search-wrap input, .composer textarea { font-size:16px; }
  .auth-footer { margin-top:30px; }
  .demo-banner span { display:none; }
  .app-view { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; }
  .conversation-pane { grid-area:1 / 1; border-right:0; }
  .rail { grid-area:2 / 1; flex-direction:row; justify-content:space-between; gap:10px; overflow:hidden; min-height:70px; padding:8px max(14px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .rail-logo { display:none; }
  .rail-navigation { flex:1; flex-direction:row; justify-content:space-around; gap:4px; min-width:0; max-width:400px; }
  .rail-button { width:56px; min-height:50px; gap:3px; border-radius:10px; }
  .rail-button small { font-size:11px; }
  .rail-button.active:before { top:auto; bottom:3px; left:calc(50% - 8px); width:16px; height:2px; }
  .rail-button.active { padding-bottom:5px; }
  .rail-bottom { flex-direction:row; align-items:center; gap:6px; margin-top:0; padding-left:10px; border-left:1px solid #486455; }
  .rail-bottom .logout-button { width:44px; min-height:50px; }
  .rail-bottom .logout-button::after { content:'退出'; font-size:11px; line-height:16px; }
  .profile-avatar { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; width:44px; height:50px; font-size:16px; line-height:20px; }
  .profile-avatar::after { content:'账号'; font-size:10px; line-height:14px; font-weight:400; }
  .conversation-heading { gap:12px; padding:max(22px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) 18px max(22px,env(safe-area-inset-left)); }
  .workspace-label { font-size:10px; }
  .conversation-heading h1 { margin-top:5px; font-size:26px; }
  .search-wrap { margin:0 max(20px,env(safe-area-inset-right)) 0 max(20px,env(safe-area-inset-left)); }
  .search-wrap input { min-height:46px; padding-right:34px; }
  .search-wrap input::placeholder { font-size:14px; }
  .search-key { display:none; }
  .conversation-filters { margin:12px max(20px,env(safe-area-inset-right)) 12px max(20px,env(safe-area-inset-left)); }
  .conversation-filters button { font-size:13px; }
  .list-caption { padding-left:max(24px,env(safe-area-inset-left)); padding-right:max(24px,env(safe-area-inset-right)); }
  .conversation-list { padding-left:max(10px,env(safe-area-inset-left)); padding-right:max(10px,env(safe-area-inset-right)); }
  .conversation-item { min-height:80px; gap:12px; padding:14px 12px; }
  .conversation-item .avatar { width:46px; height:46px; border-radius:13px; }
  .conversation-name { font-size:15px; }
  .conversation-time { font-size:11px; }
  .conversation-preview { font-size:13px; }
  .workspace-footer { min-height:34px; padding:7px max(22px,env(safe-area-inset-right)) 7px max(22px,env(safe-area-inset-left)); }
  .guest-upgrade { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:3px 12px; margin:8px 16px; padding:12px; }
  .guest-upgrade > strong { font-size:12px; }
  .guest-upgrade p { grid-column:1; margin:0; font-size:11px; }
  .guest-upgrade .button { grid-column:2; grid-row:1 / span 2; width:auto; padding:8px 10px; font-size:11px; }
  .chat-pane { display:none; }
  .app-view.show-chat { display:block; }
  .show-chat .rail, .show-chat .conversation-pane { display:none; }
  .show-chat .chat-pane { display:block; height:100%; }
  .mobile-back { display:inline-flex; margin-left:-6px; }
  .chat-heading { min-height:76px; gap:8px; padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left)); }
  .chat-avatar { width:36px; height:36px; border-radius:10px; }
  .chat-title-wrap h2 { margin-bottom:4px; font-size:16px; }
  .chat-subtitle { font-size:11px; }
  .status-tag { padding:4px 6px; font-size:10px; }
  .chat-context { max-height:60px; padding:8px max(18px,env(safe-area-inset-right)) 8px max(18px,env(safe-area-inset-left)); font-size:12px; }
  .messages { padding:20px max(14px,env(safe-area-inset-right)) 12px max(14px,env(safe-area-inset-left)); }
  .message-row { gap:8px; margin-bottom:20px; }
  .message-row .avatar { width:30px; height:30px; font-size:12px; }
  .message-stack { max-width:min(calc(100% - 38px),620px); }
  .message-bubble { padding:10px 12px; font-size:15px; }
  .composer { padding:8px max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); border-top:1px solid #e7eddf; }
  .composer-box { padding:7px 8px; border-radius:13px; }
  .composer textarea { min-height:48px; max-height:min(130px,24dvh); padding:4px; }
  .composer-tools { gap:8px; }
  .composer-hint { margin-top:6px; font-size:10px; }
  .composer-hint > span:last-child { display:none; }
  .message-error { padding-left:16px; padding-right:16px; font-size:12px; }
  .join-bar { gap:12px; padding:16px max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
  .join-bar span { font-size:11px; }
  .join-bar .button { max-width:45%; padding:10px 12px; font-size:12px; }
  .modal { top:calc(var(--app-top,0px) + max(12px,env(safe-area-inset-top))); width:min(480px,calc(100% - 24px)); max-height:calc(var(--app-height,100dvh) - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom))); padding:20px; border-radius:16px; }
  .modal-header { margin-bottom:16px; }
  .modal-header h2 { font-size:20px; }
  .toast { bottom:auto; top:calc(var(--app-top,0px) + var(--app-height,100dvh) - max(20px,env(safe-area-inset-bottom))); transform:translate(-50%,-100%); }
  .app-open .toast { top:calc(var(--app-top,0px) + var(--app-height,100dvh) - 88px - env(safe-area-inset-bottom)); }
  .app-open:has(.show-chat) .toast { top:calc(var(--app-top,0px) + var(--app-height,100dvh) - var(--composer-height,150px) - 12px); }
}

/* Narrow phones keep full-size controls and more space for titles. */
@media (max-width:380px) {
  .auth-panel { padding-right:max(18px,env(safe-area-inset-right)); padding-left:max(18px,env(safe-area-inset-left)); }
  .mobile-brand { margin-bottom:26px; }
  .auth-card h2 { font-size:27px; }
  .auth-tabs { gap:20px; }
  .verification-row .verification-send, .modal .verification-row .verification-send { padding-left:10px; padding-right:10px; font-size:11px; }
  .auth-card .verification-row input, .modal .verification-row input { padding-left:10px; padding-right:10px; }
  .conversation-heading { padding-left:18px; padding-right:18px; }
  .conversation-heading h1 { font-size:24px; }
  .search-wrap { margin-left:16px; margin-right:16px; }
  .conversation-filters { margin-left:16px; margin-right:16px; }
  .rail { gap:4px; padding-right:max(8px,env(safe-area-inset-right)); padding-left:max(8px,env(safe-area-inset-left)); }
  .rail-button { width:48px; }
  .rail-bottom { gap:2px; padding-left:6px; }
  .guest-upgrade { margin-left:10px; margin-right:10px; gap:4px 6px; padding:10px; }
  .guest-upgrade .button { font-size:10px; padding-left:8px; padding-right:8px; }
  .chat-heading { gap:6px; padding-left:max(8px,env(safe-area-inset-left)); padding-right:max(8px,env(safe-area-inset-right)); }
  .chat-heading .chat-avatar { display:none; }
  .chat-title-wrap h2 { font-size:15px; }
  .messages { padding-left:max(10px,env(safe-area-inset-left)); padding-right:max(10px,env(safe-area-inset-right)); }
  .message-bubble { padding-left:10px; padding-right:10px; }
  .composer { padding-left:max(8px,env(safe-area-inset-left)); padding-right:max(8px,env(safe-area-inset-right)); }
  .composer-status { font-size:10px; }
  .modal { padding:16px; }
  .modal-header h2 { font-size:19px; }
}

/* Short windows and software keyboards leave room for message content. */
@media (max-height:650px) and (min-width:901px) {
  .rail { gap:12px; padding-top:14px; }
  .rail-logo { margin-bottom:0; }
  .rail-navigation { gap:6px; }
  .conversation-heading { padding-top:16px; padding-bottom:14px; }
  .conversation-filters { margin-top:8px; margin-bottom:8px; }
  .chat-heading { min-height:70px; padding-top:10px; padding-bottom:10px; }
  .welcome-art { height:156px; margin:12px auto; }
  .welcome-promises { margin-top:20px; }
  .empty-chat { padding-top:20px; padding-bottom:20px; }
  .composer-hint { display:none; }
  .composer { padding-bottom:10px; }
}
@media (max-height:520px) and (max-width:900px) {
  .conversation-heading { padding-top:max(10px,env(safe-area-inset-top)); padding-bottom:10px; }
  .workspace-label { display:none; }
  .conversation-heading h1 { margin-top:0; font-size:23px; }
  .conversation-filters { margin-top:6px; margin-bottom:6px; }
  .list-caption { display:none; }
  .guest-upgrade { margin-top:5px; margin-bottom:5px; padding-top:6px; padding-bottom:6px; }
  .guest-upgrade > strong { display:none; }
  .guest-upgrade p, .guest-upgrade .button { grid-row:1; }
  .workspace-footer { min-height:28px; padding-top:4px; padding-bottom:4px; }
  .rail { min-height:58px; padding-top:4px; padding-bottom:max(4px,env(safe-area-inset-bottom)); }
  .rail-button { min-height:44px; }
  .chat-heading { min-height:58px; padding-top:max(5px,env(safe-area-inset-top)); padding-bottom:5px; }
  .chat-context { max-height:40px; padding-top:5px; padding-bottom:5px; font-size:11px; line-height:1.5; }
  .messages { padding-top:12px; padding-bottom:8px; }
  .composer { padding-top:5px; padding-bottom:max(5px,env(safe-area-inset-bottom)); }
  .composer textarea { min-height:36px; height:36px; max-height:72px; }
  .composer-hint { display:none; }
  .join-bar { padding-top:8px; padding-bottom:max(8px,env(safe-area-inset-bottom)); }
}
@media (max-width:900px) {
  .keyboard-open .chat-heading { min-height:58px; padding-top:max(5px,env(safe-area-inset-top)); padding-bottom:5px; }
  .keyboard-open .chat-context { max-height:36px; padding-top:4px; padding-bottom:4px; font-size:11px; line-height:1.5; }
  .keyboard-open .messages { padding-top:12px; }
  .keyboard-open .composer { padding-top:5px; padding-bottom:5px; }
  .keyboard-open .composer textarea { min-height:36px; max-height:84px; }
  .keyboard-open .composer-hint { display:none; }
  .keyboard-open .modal { scroll-padding-block:12px; }
}

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