:root {
  color-scheme: dark;
  --bg: #050914;
  --bg-deep: #030711;
  --surface: #08111f;
  --surface-2: #0d1728;
  --surface-3: #121f34;
  --blue: #315dff;
  --blue-bright: #5275ff;
  --blue-soft: rgba(49, 93, 255, .16);
  --lime: #b7f34a;
  --lime-soft: rgba(183, 243, 74, .12);
  --text: #f7f9ff;
  --muted: #8390a6;
  --muted-2: #536078;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .13);
  --danger: #ff4f67;
  --success: #39d98a;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  --sidebar: 340px;
  --details: 330px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.hidden { display: none !important; }
.svg-sprite { position: fixed; width: 0; height: 0; pointer-events: none; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.5px; }
.brand-mark {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
  overflow: hidden; border-radius: 14px; color: #07101e;
  background: linear-gradient(145deg, var(--lime), #75dc6e 64%, #3ba89e);
  box-shadow: 0 10px 28px rgba(132, 225, 93, .18);
}
.brand-mark::after { content: ""; position: absolute; width: 28px; height: 28px; right: -12px; top: -9px; border: 7px solid rgba(5, 12, 22, .26); border-radius: 50%; }
.brand-mark span { position: relative; z-index: 1; font-size: 21px; font-weight: 850; font-style: italic; transform: translateX(-1px); }
.brand-mark.small { width: 36px; height: 36px; border-radius: 12px; }
.brand-mark.small span { font-size: 18px; }
.brand-mark.hero { width: 84px; height: 84px; border-radius: 28px; box-shadow: 0 22px 60px rgba(132, 225, 93, .2); }
.brand-mark.hero span { font-size: 41px; }
.brand-large { gap: 14px; }
.brand-large .brand-name { font-size: 22px; }

.auth-view { position: relative; display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(460px, .8fr); min-height: 100dvh; overflow: hidden; background: var(--bg-deep); }
.auth-story { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 100dvh; padding: 6vh clamp(38px, 6vw, 96px); border-right: 1px solid var(--line); }
.auth-ambient { position: absolute; pointer-events: none; filter: blur(3px); opacity: .75; }
.auth-ambient-one { left: 2%; bottom: -35%; width: 54vw; height: 54vw; border-radius: 50%; background: radial-gradient(circle, rgba(31, 76, 255, .23), transparent 65%); }
.auth-ambient-two { left: 36%; top: -37%; width: 42vw; height: 42vw; border-radius: 50%; background: radial-gradient(circle, rgba(183, 243, 74, .1), transparent 66%); }
.auth-story::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(to bottom, transparent 5%, black 35%, transparent 90%); }
.auth-copy { position: relative; z-index: 1; max-width: 720px; margin: auto 0; padding: 5vh 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #aab6ca; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px var(--lime-soft), 0 0 24px rgba(183,243,74,.5); }
.auth-copy h1 { margin: 24px 0 18px; font-size: clamp(52px, 6vw, 96px); line-height: .96; letter-spacing: -.075em; font-weight: 800; }
.auth-copy h1 em { color: var(--blue-bright); font-style: normal; }
.auth-copy p { max-width: 570px; margin: 0; color: #9ba7bb; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; }
.auth-proof { position: relative; z-index: 1; display: flex; align-items: center; gap: 17px; }
.proof-avatars { display: flex; padding-left: 7px; }
.proof-avatars span { display: grid; place-items: center; width: 38px; height: 38px; margin-left: -7px; border: 3px solid var(--bg-deep); border-radius: 50%; background: var(--avatar); font-size: 12px; font-weight: 700; }
.auth-proof strong, .auth-proof small { display: block; }
.auth-proof strong { font-size: 13px; }
.auth-proof small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.auth-panel { position: relative; z-index: 2; display: grid; place-items: center; min-height: 100dvh; padding: 40px; background: linear-gradient(155deg, rgba(12, 23, 41, .86), rgba(5, 9, 20, .98)); }
.auth-card { width: min(100%, 410px); }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 44px; font-weight: 750; }
.auth-kicker, .modal-kicker { color: var(--lime); font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.auth-card h2 { margin: 12px 0 9px; font-size: 30px; letter-spacing: -.035em; }
.auth-card-head > p { margin: 0 0 34px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.field-label { display: block; margin: 0 0 17px; color: #b9c3d3; font-size: 12px; font-weight: 650; }
.field-label > span { color: var(--muted-2); font-weight: 500; }
.field-label input { display: block; width: 100%; height: 51px; margin-top: 8px; padding: 0 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3, 8, 17, .74); color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s; }
.field-label input::placeholder { color: #536078; }
.field-label input:focus { border-color: rgba(82, 117, 255, .7); outline: none; background: #07101e; box-shadow: 0 0 0 4px rgba(49, 93, 255, .1); }
.form-error { min-height: 19px; margin: 0 0 10px; color: #ff7c8e; font-size: 12px; line-height: 1.4; }
.primary-button, .secondary-button { border: 0; cursor: pointer; transition: transform .18s, filter .18s, opacity .18s; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 51px; padding: 0 20px; border-radius: 14px; background: var(--blue); color: white; font-size: 13px; font-weight: 720; box-shadow: 0 14px 34px rgba(49, 93, 255, .22); }
.primary-button .icon { transform: rotate(180deg); }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.primary-button:disabled { opacity: .5; cursor: wait; transform: none; }
.text-button { display: block; margin: 19px auto 27px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.text-button strong { color: var(--text); }
.demo-box { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.025); }
.demo-label { display: block; margin: 0 0 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.demo-account { display: inline-flex; align-items: center; gap: 8px; width: calc(50% - 3px); padding: 7px; border: 0; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.demo-account:hover { background: rgba(255,255,255,.045); }
.demo-account strong, .demo-account small { display: block; }
.demo-account strong { font-size: 11px; }
.demo-account small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.demo-box > small { display: block; margin: 11px 4px 0; color: var(--muted-2); font-size: 10px; }

.app-view { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); width: 100vw; height: 100dvh; background: var(--bg); }
.app-view.details-open { grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--details); }
.sidebar { position: relative; z-index: 3; display: flex; flex-direction: column; min-width: 0; height: 100dvh; border-right: 1px solid var(--line); background: #07101d; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 0 18px 0 20px; }
.sidebar-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #93a0b4; cursor: pointer; transition: color .18s, background .18s, border-color .18s, transform .18s; }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.icon-button.accent { background: var(--blue); color: white; box-shadow: 0 8px 22px rgba(49,93,255,.22); }
.icon-button.accent:hover { background: var(--blue-bright); transform: translateY(-1px); }
.icon-button.ghost { width: 35px; height: 35px; }
.search-box { display: flex; align-items: center; gap: 10px; height: 43px; margin: 1px 14px 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.034); color: var(--muted); }
.search-box:focus-within { border-color: rgba(82, 117, 255, .45); background: rgba(255,255,255,.045); }
.search-box .icon { width: 17px; height: 17px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-box input::placeholder { color: #657187; }
.chat-list { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px 10px; scrollbar-width: thin; scrollbar-color: #253249 transparent; }
.chat-item { position: relative; display: grid; grid-template-columns: 49px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; min-height: 67px; padding: 8px 9px; border: 0; border-radius: 14px; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background .16s; }
.chat-item:hover { background: rgba(255,255,255,.035); }
.chat-item.active { background: linear-gradient(110deg, rgba(49,93,255,.2), rgba(49,93,255,.08)); }
.chat-item.active::before { content: ""; position: absolute; left: -8px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); box-shadow: 0 0 14px rgba(183,243,74,.35); }
.avatar { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 15px; background: var(--avatar, #315dff); color: white; font-size: 14px; font-weight: 750; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.avatar.small { width: 35px; height: 35px; border-radius: 11px; font-size: 12px; }
.avatar.tiny { width: 29px; height: 29px; border-radius: 9px; font-size: 10px; }
.avatar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(145deg, rgba(255,255,255,.18), transparent 55%); pointer-events: none; }
.avatar .type-icon { width: 19px; height: 19px; }
.avatar-wrap { position: relative; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border: 3px solid #07101d; border-radius: 50%; background: var(--success); }
.chat-copy { min-width: 0; }
.chat-copy-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-copy strong { overflow: hidden; color: #e9eef8; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { flex: 0 0 auto; color: #5f6c81; font-size: 9px; font-weight: 550; }
.chat-preview { display: flex; align-items: center; min-width: 0; margin-top: 6px; color: #728096; font-size: 10.5px; }
.chat-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview .sender-prefix { flex: 0 0 auto; margin-right: 3px; color: #92a0b6; }
.chat-trailing { display: grid; align-content: center; justify-items: end; min-width: 20px; }
.unread-badge { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--blue); color: white; font-size: 9px; font-weight: 750; }
.chat-list-empty { padding: 44px 25px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.55; }
.profile-bar { display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); background: rgba(3,8,16,.42); }
.profile-main { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { margin-top: 3px; color: var(--success); font-size: 9px; }

.chat-pane { position: relative; min-width: 0; height: 100dvh; overflow: hidden; background-color: #050b16; background-image: radial-gradient(circle at 90% 4%, rgba(49,93,255,.08), transparent 30%), radial-gradient(circle at 30% 100%, rgba(183,243,74,.035), transparent 32%); }
.chat-pane::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12; background-image: radial-gradient(rgba(255,255,255,.16) .7px, transparent .7px); background-size: 20px 20px; }
.empty-state { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; height: 100%; padding: 30px; text-align: center; }
.empty-orbit { position: relative; display: grid; place-items: center; width: 190px; height: 190px; margin-bottom: 30px; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; }
.empty-orbit::before { content: ""; position: absolute; inset: 23px; border: 1px dashed rgba(82,117,255,.2); border-radius: 50%; }
.empty-orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-bright); box-shadow: 0 0 15px currentColor; }
.empty-orbit i:nth-child(2) { top: 18px; left: 74px; }
.empty-orbit i:nth-child(3) { right: 18px; bottom: 63px; background: var(--lime); }
.empty-orbit i:nth-child(4) { left: 13px; bottom: 51px; background: #8e7dff; }
.empty-state h2 { margin: 16px 0 7px; font-size: 27px; letter-spacing: -.035em; }
.empty-state p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.secondary-button { display: inline-flex; align-items: center; gap: 8px; min-height: 43px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(255,255,255,.045); color: #dfe6f2; font-size: 11px; font-weight: 650; }
.secondary-button .icon { width: 16px; height: 16px; }
.conversation-view { position: relative; z-index: 1; display: grid; grid-template-rows: 66px auto minmax(0,1fr) auto auto auto; height: 100%; }
.conversation-header { display: flex; align-items: center; min-width: 0; padding: 0 17px; border-bottom: 1px solid var(--line); background: rgba(5, 11, 22, .88); backdrop-filter: blur(20px); }
.conversation-identity { display: flex; align-items: center; gap: 11px; min-width: 0; margin-right: auto; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.conversation-header .avatar { width: 39px; height: 39px; border-radius: 13px; font-size: 12px; }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { max-width: min(35vw, 480px); font-size: 12px; font-weight: 680; }
.conversation-copy small { max-width: min(40vw, 520px); margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.conversation-actions { display: flex; align-items: center; gap: 3px; }
.conversation-actions .icon-button { width: 38px; height: 38px; }
.mobile-only { display: none; }
.connection-banner { z-index: 3; height: 30px; padding: 8px 16px; background: #6a5215; color: #ffe8a5; text-align: center; font-size: 10px; }
.message-list { min-height: 0; overflow-y: auto; padding: 22px max(18px, 6vw) 16px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #26334a transparent; }
.message-row { display: flex; align-items: flex-end; gap: 8px; margin: 5px 0; }
.message-row.own { justify-content: flex-end; }
.message-row.system { justify-content: center; margin: 15px 0; }
.message-row.system .system-message { padding: 6px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,9,18,.7); color: #6d7a90; font-size: 9px; }
.message-row .message-avatar { align-self: flex-end; width: 26px; height: 26px; border-radius: 8px; font-size: 8px; }
.bubble { position: relative; max-width: min(67%, 600px); padding: 9px 12px 7px; border: 1px solid var(--line); border-radius: 6px 16px 16px 16px; background: #101a2a; box-shadow: 0 6px 20px rgba(0,0,0,.09); }
.message-row.own .bubble { border-color: rgba(65,101,255,.27); border-radius: 16px 6px 16px 16px; background: linear-gradient(135deg, #1c3b9d, #1a327c); }
.message-sender { display: block; margin: 0 0 4px; color: var(--sender, #8e7dff); font-size: 9px; font-weight: 700; }
.message-body { color: #e9eef8; font-size: 12px; line-height: 1.48; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 40px; margin: 3px -2px -1px 10px; color: rgba(205,216,235,.52); font-size: 8px; line-height: 1; float: right; transform: translateY(3px); }
.message-meta .icon { width: 12px; height: 12px; color: #8fb4ff; }
.image-attachment { display: block; width: min(380px, 100%); max-height: 360px; margin: -4px -7px 7px; border-radius: 11px; object-fit: cover; background: #050914; cursor: zoom-in; }
.file-attachment { display: flex; align-items: center; gap: 10px; min-width: min(310px, 55vw); margin: -1px 0 5px; padding: 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(0,0,0,.12); color: inherit; text-decoration: none; }
.file-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; background: rgba(82,117,255,.2); color: #9aafff; }
.file-copy { min-width: 0; }
.file-copy strong, .file-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy strong { font-size: 10px; }
.file-copy small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.file-attachment > .icon { flex: 0 0 auto; width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
.date-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: #647188; font-size: 8.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.date-divider::before, .date-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.typing-indicator { min-height: 20px; padding: 2px max(22px, 6vw); color: #728198; font-size: 9px; }
.composer { display: grid; grid-template-columns: 40px minmax(0,1fr) 41px; align-items: end; gap: 6px; margin: 0 max(14px, 5vw) max(12px, env(safe-area-inset-bottom)); padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: #0b1423; box-shadow: 0 14px 34px rgba(0,0,0,.24); }
.composer:focus-within { border-color: rgba(82,117,255,.36); }
.composer-tool { width: 40px; height: 40px; }
.composer textarea { width: 100%; min-height: 40px; max-height: 130px; padding: 11px 5px 9px; resize: none; border: 0; outline: 0; overflow-y: auto; background: transparent; color: var(--text); font-size: 12px; line-height: 1.45; }
.composer textarea::placeholder { color: #59667c; }
.send-button { display: grid; place-items: center; width: 41px; height: 41px; padding: 0; border: 0; border-radius: 13px; background: var(--blue); color: white; cursor: pointer; transition: transform .15s, background .15s; }
.send-button:hover { transform: scale(1.04); background: var(--blue-bright); }
.send-button .icon { width: 18px; height: 18px; }
.attachment-preview { display: flex; align-items: center; gap: 10px; margin: 0 max(19px, 5.4vw) 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; background: #0c1626; }
.attachment-preview img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; }
.attachment-preview .attachment-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--blue-soft); color: #8da6ff; }
.attachment-preview-copy { min-width: 0; flex: 1; }
.attachment-preview-copy strong, .attachment-preview-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-copy strong { font-size: 10px; }
.attachment-preview-copy small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.attachment-preview .icon-button { width: 34px; height: 34px; }
.channel-lock { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 55px; margin: 0 max(14px,5vw) max(12px, env(safe-area-inset-bottom)); border: 1px solid rgba(183,243,74,.1); border-radius: 15px; background: var(--lime-soft); color: #b8c987; font-size: 10px; }
.channel-lock .icon { width: 16px; height: 16px; }

.details-panel { position: relative; z-index: 4; height: 100dvh; overflow: hidden; border-left: 1px solid var(--line); background: #08111f; }
.details-header { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 0 15px 0 20px; border-bottom: 1px solid var(--line); }
.details-header h3 { margin: 0; font-size: 13px; }
.details-content { height: calc(100% - 66px); padding: 22px 17px; overflow-y: auto; }
.details-hero { display: grid; place-items: center; padding: 13px 0 25px; text-align: center; }
.details-hero .avatar { width: 73px; height: 73px; border-radius: 23px; font-size: 22px; }
.details-hero h3 { margin: 13px 0 5px; font-size: 16px; }
.details-hero p { max-width: 250px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.details-section { padding-top: 18px; border-top: 1px solid var(--line); }
.details-section + .details-section { margin-top: 18px; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #647188; font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.member-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 5px 2px; }
.member-row .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 10px; }
.member-copy { min-width: 0; }
.member-copy strong, .member-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-copy strong { font-size: 10px; }
.member-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.member-role { margin-left: auto; padding: 4px 7px; border-radius: 8px; background: rgba(255,255,255,.045); color: var(--muted); font-size: 7px; text-transform: uppercase; }

.modal-layer { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(1,4,10,.76); backdrop-filter: blur(14px); }
.modal-card { width: min(100%, 540px); max-height: min(760px, 92dvh); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: #0a1423; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 22px 14px; }
.modal-header h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.035em; }
.type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 20px 18px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.18); }
.type-tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 650; }
.type-tabs button.active { background: #16233a; color: white; box-shadow: 0 4px 13px rgba(0,0,0,.18); }
.type-tabs .icon { width: 15px; height: 15px; }
#new-chat-form { padding: 0 20px 20px; }
.chat-meta-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chat-meta-fields .field-label { margin-bottom: 12px; }
.chat-meta-fields .field-label input { height: 43px; }
.modal-search { margin: 0 0 8px; }
.user-list { min-height: 130px; max-height: 270px; overflow-y: auto; padding: 3px; }
.user-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 53px; padding: 7px 9px; border: 0; border-radius: 13px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.user-row:hover { background: rgba(255,255,255,.035); }
.user-row.selected { background: var(--blue-soft); }
.user-row .avatar { width: 37px; height: 37px; border-radius: 12px; font-size: 10px; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { font-size: 10px; }
.user-copy small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.select-indicator { display: grid; place-items: center; width: 20px; height: 20px; margin-left: auto; border: 1px solid var(--line-strong); border-radius: 7px; color: transparent; }
.user-row.selected .select-indicator { border-color: var(--blue); background: var(--blue); color: white; }
.select-indicator .icon { width: 13px; height: 13px; }
.selected-users { display: flex; gap: 7px; min-height: 43px; padding: 3px 0 9px; overflow-x: auto; }
.selected-chip { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 5px 9px 5px 5px; border-radius: 11px; background: rgba(255,255,255,.05); color: #c8d1df; font-size: 8px; }
.selected-chip .avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 7px; }
.user-list-empty { padding: 30px; color: var(--muted); text-align: center; font-size: 10px; }

.call-layer { position: fixed; z-index: 80; inset: 0; overflow: hidden; background: #020610; }
.call-layer > #remote-video { width: 100%; height: 100%; object-fit: cover; }
.call-backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 50% 34%, rgba(49,93,255,.25), transparent 28%), linear-gradient(to bottom, rgba(2,6,16,.46), rgba(2,6,16,.86)); backdrop-filter: blur(0); }
.call-layer.has-video .call-backdrop { background: linear-gradient(to bottom, rgba(2,6,16,.18), rgba(2,6,16,.7)); }
.local-video { position: absolute; z-index: 2; top: 24px; right: 24px; width: min(24vw, 240px); aspect-ratio: 3/4; border: 1px solid rgba(255,255,255,.2); border-radius: 19px; object-fit: cover; background: #101a2a; box-shadow: var(--shadow); transform: scaleX(-1); }
.call-content { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; }
.call-avatar { width: 108px; height: 108px; border-radius: 34px; font-size: 33px; box-shadow: 0 26px 70px rgba(0,0,0,.35); }
.call-layer.has-video .call-avatar { opacity: 0; }
.call-content h2 { margin: 24px 0 8px; font-size: 28px; letter-spacing: -.04em; }
.call-content p { margin: 0; color: #aab5c6; font-size: 12px; }
.call-actions, .incoming-actions { position: absolute; bottom: max(38px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 23px; }
.call-action { display: grid; justify-items: center; gap: 8px; width: 70px; padding: 0; border: 0; background: transparent; color: #dce3ee; cursor: pointer; font-size: 8px; }
.call-action .icon { width: 23px; height: 23px; box-sizing: content-box; padding: 16px; border-radius: 50%; background: rgba(255,255,255,.13); backdrop-filter: blur(10px); }
.call-action.off .icon { background: white; color: #152033; }
.call-action.danger .icon { background: var(--danger); color: white; }
.call-action.accept .icon { background: var(--success); color: white; }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(13,23,40,.96); color: #dce4f1; font-size: 10px; line-height: 1.4; box-shadow: 0 16px 45px rgba(0,0,0,.3); animation: toast-in .25s ease; }
.toast::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--lime); }
.toast.error::before { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  :root { --sidebar: 310px; --details: 290px; }
  .app-view.details-open { grid-template-columns: var(--sidebar) minmax(0,1fr); }
  .details-panel { position: fixed; top: 0; right: 0; width: var(--details); box-shadow: -24px 0 70px rgba(0,0,0,.38); }
  .auth-view { grid-template-columns: 1fr 440px; }
  .auth-copy h1 { font-size: clamp(48px, 5.7vw, 72px); }
}

@media (max-width: 760px) {
  :root { --sidebar: 100%; }
  .auth-view { display: block; overflow-y: auto; background: #060c17; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100dvh; padding: 32px 22px; background: radial-gradient(circle at 50% -20%, rgba(49,93,255,.22), transparent 48%), #060c17; }
  .mobile-brand { display: flex; }
  .auth-card { max-width: 430px; }
  .app-view { display: block; }
  .sidebar { width: 100%; border: 0; }
  .chat-pane { position: fixed; z-index: 8; inset: 0; transform: translateX(100%); transition: transform .24s cubic-bezier(.22,.8,.3,1); }
  .app-view.mobile-chat-open .chat-pane { transform: translateX(0); }
  .details-panel { z-index: 12; width: min(88vw, 340px); transform: translateX(100%); transition: transform .22s ease; }
  .details-panel:not(.hidden) { transform: translateX(0); }
  .mobile-only { display: inline-grid; margin-right: 4px; }
  .conversation-header { padding: 0 9px; }
  .conversation-header .avatar { width: 36px; height: 36px; }
  .conversation-actions { gap: 0; }
  .conversation-actions .icon-button { width: 36px; }
  .conversation-copy strong { max-width: 30vw; }
  .conversation-copy small { max-width: 34vw; }
  .message-list { padding-right: 12px; padding-left: 12px; }
  .bubble { max-width: 82%; }
  .composer { margin-right: 8px; margin-left: 8px; }
  .typing-indicator { padding-right: 15px; padding-left: 15px; }
  .attachment-preview { margin-right: 12px; margin-left: 12px; }
  .channel-lock { margin-right: 8px; margin-left: 8px; }
  .modal-layer { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 92dvh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 23px 23px 0 0; }
  .chat-meta-fields { grid-template-columns: 1fr; gap: 0; }
  .user-list { max-height: 34dvh; }
  .local-video { top: 18px; right: 18px; width: 31vw; border-radius: 15px; }
  .call-avatar { width: 92px; height: 92px; border-radius: 29px; }
}

@media (max-width: 390px) {
  .conversation-actions #audio-call-button { display: none; }
  .conversation-copy strong { max-width: 36vw; }
  .conversation-copy small { max-width: 39vw; }
  .type-tabs button { gap: 4px; font-size: 8px; }
  .call-actions, .incoming-actions { gap: 8px; }
}

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