:root {
  color-scheme: light;
  --accent: #0f9f92;
  --accent-strong: #08776f;
  --accent-soft: #dff7f3;
  --ink: #071714;
  --muted: #627a75;
  --line: #d8e8e4;
  --surface: #ffffff;
  --surface-2: #f3faf8;
  --surface-3: #e7f2ef;
  --bubble-in: #e6f0ed;
  --bubble-out: #0f9f92;
  --danger: #ed4e58;
  --success: #0f9f92;
  --shadow: 0 18px 55px rgba(2, 35, 31, .13);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--surface-2); color: var(--ink); font-size: 15px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.bare, .link, .back-link { border: 0; background: none; padding: 0; color: var(--accent); }
.link { font-weight: 700; }
.wide { width: 100%; }

body.dark {
  color-scheme: dark;
  --ink: #f3fffc;
  --muted: #91aaa5;
  --line: #21443e;
  --surface: #0a1715;
  --surface-2: #050c0b;
  --surface-3: #102622;
  --bubble-in: #13302b;
  --accent-soft: #12332e;
  --shadow: 0 18px 55px rgba(0, 0, 0, .3);
}

.auth-screen { min-height: 100%; display: grid; grid-template-columns: minmax(380px, .92fr) minmax(500px, 1.08fr); background: var(--surface); }
.auth-art { position: relative; display: flex; min-height: 100vh; flex-direction: column; overflow: hidden; padding: max(36px, var(--safe-top)) 7vw 34px; color: white; background: radial-gradient(circle at 80% 15%, #45d8c6 0, transparent 30%), linear-gradient(145deg, #0e9e91, #075d57 64%, #032e2a); }
.brand, .mobile-brand { display: flex; align-items: center; gap: 12px; font-size: 24px; }
.brand img, .mobile-brand img { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 8px 24px rgba(35, 16, 114, .25); }
.art-copy { position: relative; z-index: 2; max-width: 520px; margin: auto 0; }
.art-copy .eyebrow { color: #d9d1ff; }
.art-copy h1 { margin: 16px 0 20px; font-size: clamp(48px, 5vw, 76px); line-height: .98; letter-spacing: -.055em; }
.art-copy p { max-width: 440px; margin: 0; color: #e2ddff; font-size: 18px; line-height: 1.65; }
.art-orbit { position: absolute; right: -140px; bottom: -170px; width: 530px; height: 530px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.art-orbit::before, .art-orbit::after { content: ""; position: absolute; inset: 70px; border: inherit; border-radius: inherit; }
.art-orbit::after { inset: 150px; }
.art-orbit span { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #d5ff4b; box-shadow: 0 0 36px #d5ff4b; }
.art-orbit span:nth-child(1) { left: 80px; top: 54px; }.art-orbit span:nth-child(2) { left: 204px; top: 124px; width: 12px; height: 12px; }.art-orbit span:nth-child(3) { left: 236px; top: 238px; width: 9px; height: 9px; }
.from { margin: 0; color: #d9d1ff; font-weight: 600; }
.auth-panel { display: grid; place-items: center; min-width: 0; padding: 40px; background: var(--surface); overflow: auto; }
.auth-card { width: min(100%, 460px); }
.auth-card h2 { margin: 10px 0 8px; font-size: 36px; letter-spacing: -.035em; }
.auth-card > .muted { margin: 0 0 30px; }
.mobile-brand { display: none; margin-bottom: 38px; }
.field { display: grid; gap: 8px; margin: 18px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .search-box, .composer textarea { border: 1px solid var(--line); outline: none; background: var(--surface-2); }
.field input { width: 100%; height: 52px; border-radius: 14px; padding: 0 16px; color: var(--ink); font-weight: 500; }
.field input:focus, .search-box:focus-within, .composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.password-field { position: relative; }.password-field input { padding-right: 52px; }.password-field .bare { position: absolute; top: 0; right: 0; display: grid; width: 52px; height: 52px; place-items: center; color: var(--muted); }
.form-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 24px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }.check input { accent-color: var(--accent); }
.primary, .secondary, .danger { min-height: 48px; border: 0; border-radius: 14px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; }
.primary { color: white; background: var(--accent); box-shadow: 0 10px 24px rgba(15,159,146,.24); }.primary:hover { background: var(--accent-strong); }
.secondary { color: var(--accent); background: var(--accent-soft); }.danger { color: white; background: var(--danger); }
.button-spinner { display: none; width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.loading .button-spinner { display: block; }.loading { pointer-events: none; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; font-weight: 650; }
.auth-switch { margin: 24px 0 0; color: var(--muted); text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 26px; font-weight: 700; }.back-link svg { width: 18px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.two-fields .field { margin-bottom: 0; }

.workspace { position: fixed; inset: 0; display: grid; width: 100%; height: 100%; min-height: 0; grid-template-columns: 82px 350px minmax(0, 1fr); overflow: hidden; background: var(--surface); }
.rail { z-index: 5; display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--line); padding: max(18px, var(--safe-top)) 10px max(14px, var(--safe-bottom)); background: var(--surface-2); }
.rail-logo { width: 50px; height: 50px; border: 0; border-radius: 15px; padding: 0; background: transparent; }.rail-logo img { width: 100%; border-radius: inherit; }
.rail nav { display: grid; gap: 9px; width: 100%; margin-top: 40px; }
.nav-button { display: flex; min-height: 58px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 14px; padding: 7px 3px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.nav-button:hover { color: var(--ink); background: var(--surface-3); }.nav-button.active { color: var(--accent); background: var(--accent-soft); }.nav-button svg { width: 21px; height: 21px; }
.rail-bottom { display: grid; gap: 12px; width: 100%; margin-top: auto; place-items: center; }
.account-avatar, .avatar, .profile-avatar, .call-avatar, .pulse-avatar { display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 50%; color: white; background: linear-gradient(145deg, #25cdbb, #08776f); font-weight: 800; }
.phone-download { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #eeeaff, #f8f7fc 55%); }.phone-download-card { width: min(100%, 420px); text-align: center; }.phone-download-card img { width: 104px; height: 104px; border-radius: 28px; box-shadow: var(--shadow); }.phone-download-card h1 { margin: 18px 0 10px; font-size: 32px; }.phone-download-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }.phone-download-card a { display: flex; align-items: center; justify-content: center; text-decoration: none; }.phone-download-card small { display: block; margin-top: 14px; color: var(--muted); }@media(max-width:600px) and (pointer:coarse){.phone-download{display:grid!important}.auth-screen,.workspace,.incoming-call,.call-screen{display:none!important}}
.sticker-picker { position: fixed; right: 74px; bottom: 76px; z-index: 20; display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; border: 1px solid var(--line); border-radius: 18px; padding: 10px; background: var(--surface); box-shadow: var(--shadow); }.sticker-picker.hidden { display: none; }.sticker-picker button { border: 0; border-radius: 12px; padding: 6px; background: transparent; font-size: 28px; cursor: pointer; }.sticker-picker button:hover { background: var(--surface-2); transform: scale(1.08); }.sticker-message { display: inline-block; font-size: 64px; line-height: 1.05; animation: sticker-pop .55s cubic-bezier(.2,.9,.3,1.3), sticker-float 2.4s ease-in-out .55s infinite; transform-origin: center bottom; }@keyframes sticker-pop{from{opacity:0;transform:scale(.25) rotate(-12deg)}to{opacity:1;transform:scale(1) rotate(0)}}@keyframes sticker-float{50%{transform:translateY(-5px) rotate(2deg)}}
.account-avatar { width: 40px; height: 40px; }.account-avatar img, .avatar img, .profile-avatar img, .call-avatar img, .pulse-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sun { display: none; } body.dark .moon { display: none; } body.dark .sun { display: block; }

.list-pane { display: flex; min-width: 0; min-height: 0; height: 100%; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); background: var(--surface); }
.pane-header { display: flex; align-items: center; justify-content: space-between; min-height: 91px; padding: 19px 22px 12px; }
.pane-header h2 { margin: 4px 0 0; font-size: 27px; letter-spacing: -.035em; }
.icon-button { display: inline-grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: var(--surface-3); }.icon-button.accent { color: white; background: var(--accent); }
.search-box { display: flex; min-height: 46px; align-items: center; gap: 10px; margin: 0 20px 14px; border-radius: 14px; padding: 0 13px; color: var(--muted); }
.search-box svg { width: 19px; }.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 0 20px 12px; scrollbar-width: none; }.filter-row::-webkit-scrollbar { display: none; }
.chip { min-height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; white-space: nowrap; }.chip.active { border-color: var(--accent-soft); color: var(--accent); background: var(--accent-soft); }
.conversation-list { min-height: 0; flex: 1; overflow: auto; padding: 3px 10px 16px; }
.conversation-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 72px; border: 0; border-radius: 16px; padding: 9px 11px; color: inherit; background: transparent; text-align: left; width: 100%; }
.conversation-row:hover { background: var(--surface-2); }.conversation-row.active { background: var(--accent-soft); }
.avatar { width: 52px; height: 52px; font-size: 19px; }.avatar.group { background: linear-gradient(145deg, #4ca6e8, #7759e7); }
.row-copy { min-width: 0; }.row-copy strong, .row-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.row-copy strong { font-size: 15px; }.row-copy span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.row-meta { align-self: center; color: var(--muted); font-size: 11px; }.group-tag { display: inline-flex; margin-left: 5px; color: var(--accent); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.list-empty { display: grid; min-height: 270px; place-items: center; padding: 28px; color: var(--muted); text-align: center; }.list-empty svg { width: 42px; height: 42px; color: var(--accent); }

.empty-pane { display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; background: radial-gradient(circle at center, var(--accent-soft), transparent 40%); }
.empty-pane h2 { margin: 24px 0 7px; }.empty-pane p { max-width: 380px; margin: 0 0 24px; color: var(--muted); }
.empty-visual { position: relative; width: 130px; height: 130px; }.empty-visual img { position: absolute; inset: 25px; z-index: 2; width: 80px; border-radius: 23px; box-shadow: var(--shadow); }.empty-visual span { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 50%; animation: pulse 2.4s infinite; }.empty-visual span:last-child { inset: 13px; animation-delay: .6s; }
@keyframes pulse { 50% { transform: scale(1.06); opacity: .45; } }

.chat-pane { position: relative; display: grid; min-width: 0; min-height: 0; height: 100%; grid-template-rows: 76px minmax(0, 1fr) auto auto auto; overflow: hidden; background: var(--surface-2); }
.chat-header { position: relative; z-index: 8; display: flex; min-height: 76px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: max(10px, var(--safe-top)) 18px 10px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(18px); }
.chat-header .avatar { width: 46px; height: 46px; }.chat-heading { min-width: 0; flex: 1; }.chat-heading h3, .chat-heading p { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }.chat-heading h3 { font-size: 17px; }.chat-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }.chat-actions { display: flex; gap: 2px; }.mobile-back { display: none; }
.messages { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 20px clamp(20px, 4.5vw, 72px); scroll-behavior: smooth; }
.day-badge { width: fit-content; margin: 6px auto 16px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 750; }
.message-line { display: flex; width: min(100%, 980px); margin: 6px auto; }.message-line.outgoing { justify-content: flex-end; }.message-line.system { justify-content: center; }
.bubble { position: relative; max-width: min(72%, 660px); border-radius: 17px 17px 17px 5px; padding: 10px 12px 8px; background: var(--bubble-in); box-shadow: 0 1px 2px rgba(0,0,0,.055); }
.outgoing .bubble { border-radius: 17px 17px 5px 17px; color: white; background: var(--bubble-out); }.system .bubble { border-radius: 99px; padding: 7px 13px; color: var(--muted); background: var(--surface-3); font-size: 12px; }
.sender-name { display: block; margin-bottom: 3px; color: var(--accent); font-size: 12px; font-weight: 800; }.outgoing .sender-name { color: #e0d9ff; }
.message-text { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.48; white-space: pre-wrap; }.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin: 4px 0 0 20px; color: color-mix(in srgb, currentColor 70%, transparent); font-size: 10px; }
.call-message { display: grid; min-width: 150px; gap: 2px; border: 0; padding: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }.call-message b { font-size: 13px; }.call-message span { color: var(--accent); font-size: 10px; font-weight: 750; }.system .call-message { text-align: center; }.system .message-meta { margin-left: 0; }
.ticks { font-size: 12px; letter-spacing: -4px; margin-right: 4px; }.ticks.seen { color: #79d9ff; }
.message-media { display: block; width: min(360px, 52vw); max-height: 360px; margin: -4px -6px 7px; border: 0; border-radius: 13px; object-fit: cover; background: var(--surface-3); }.message-media.audio { width: min(330px, 55vw); height: 42px; margin: 2px 0 4px; }.file-card { display: flex; min-width: 230px; align-items: center; gap: 10px; border-radius: 12px; padding: 11px; color: inherit; background: color-mix(in srgb, var(--surface) 18%, transparent); text-decoration: none; }.file-card svg { flex: 0 0 auto; }.file-card span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-card { display: grid; min-width: 240px; gap: 7px; color: inherit; text-decoration: none; }.location-map { display: grid; height: 108px; place-items: center; border-radius: 12px; color: var(--accent); background: repeating-linear-gradient(45deg, var(--accent-soft), var(--accent-soft) 14px, var(--surface) 14px, var(--surface) 28px); }.location-map svg { width: 34px; height: 34px; }
.reply-quote { display: grid; gap: 2px; margin-bottom: 7px; border-left: 3px solid currentColor; border-radius: 5px; padding: 6px 9px; color: color-mix(in srgb, currentColor 74%, transparent); background: rgba(255,255,255,.13); font-size: 12px; }.reply-quote b { color: inherit; }
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 0 clamp(18px, 5vw, 64px) 8px; color: var(--muted); font-size: 11px; }.typing-indicator span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: dots 1s infinite; }.typing-indicator span:nth-child(2) { animation-delay: .15s; }.typing-indicator span:nth-child(3) { animation-delay: .3s; }.typing-indicator b { margin-left: 4px; }
@keyframes dots { 50% { transform: translateY(-3px); } }
.reply-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 16px; border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px 10px; background: var(--surface-3); }.reply-bar div { display: grid; min-width: 0; gap: 2px; }.reply-bar b { color: var(--accent); font-size: 11px; }.reply-bar span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; align-items: flex-end; gap: 7px; border-top: 1px solid var(--line); padding: 10px clamp(14px, 3.5vw, 56px) max(10px, var(--safe-bottom)); background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
.composer textarea { min-width: 0; min-height: 44px; max-height: 130px; flex: 1; resize: none; border-radius: 22px; padding: 11px 16px; line-height: 20px; }.send-button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--accent); }.record-button.recording { color: white; background: var(--danger); width: auto; border-radius: 22px; padding: 0 13px; gap: 5px; }.record-button.recording .record-time { display: inline; }.record-time { display: none; font-size: 11px; font-weight: 800; }

.modal { width: min(92vw, 480px); max-height: min(90vh, 720px); border: 1px solid var(--line); border-radius: 22px; padding: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }.modal::backdrop { background: rgba(13, 10, 24, .52); backdrop-filter: blur(3px); }.modal form { position: relative; overflow: auto; padding: 30px; }.modal h2 { margin: 8px 0; font-size: 27px; }.dialog-close { position: absolute; top: 14px; right: 14px; }.dialog-link { display: block; margin: 17px auto 0; }.modal-search { margin: 22px 0 12px; }.people-results, .member-list { max-height: 300px; overflow: auto; margin: 10px 0 18px; }.person-row, .member-option { display: flex; min-height: 64px; align-items: center; gap: 11px; border-radius: 13px; padding: 7px; }.person-row:hover, .member-option:hover { background: var(--surface-2); }.person-row .avatar, .member-option .avatar { width: 44px; height: 44px; }.person-row div:nth-child(2) { min-width: 0; flex: 1; }.person-row strong, .person-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.person-row small { color: var(--muted); }.person-row button { min-height: 36px; border-radius: 10px; }.member-option { cursor: pointer; }.member-option input { accent-color: var(--accent); }.member-option span { min-width: 0; }.field-caption, .empty-copy { color: var(--muted); font-size: 13px; }.profile-avatar { width: 88px; height: 88px; margin: 4px auto 14px; font-size: 30px; }.account-modal h2, .account-modal p { text-align: center; }.account-modal .danger { margin-top: 24px; }
.web-qr-trigger { margin-top: 14px; }.qr-modal { width: min(92vw, 410px); }.qr-modal form { text-align: center; }.web-qr-frame { display: grid; width: min(100%, 320px); aspect-ratio: 1; margin: 22px auto 14px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; padding: 14px; background: #fff; box-shadow: var(--shadow-soft); }.web-qr-frame img { display: block; width: 100%; height: 100%; }.qr-address { margin: 0; color: var(--accent); font-size: 13px; font-weight: 800; }

.incoming-call, .call-screen { position: fixed; inset: 0; z-index: 50; }
.incoming-call { display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--surface-2) 84%, transparent); backdrop-filter: blur(24px); }.incoming-card { width: min(100%, 400px); text-align: center; }.call-avatar { width: 108px; height: 108px; margin: 0 auto 26px; font-size: 38px; box-shadow: 0 0 0 16px var(--accent-soft); }.incoming-card h2 { margin: 10px 0 4px; font-size: 30px; }.incoming-card p { margin: 0; color: var(--muted); }.incoming-actions { display: flex; justify-content: center; gap: 70px; margin-top: 60px; }.call-action { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; color: var(--muted); background: none; font-weight: 750; }.call-action svg { width: 27px; height: 27px; }.call-action::before { content: ""; position: absolute; }.call-action svg { box-sizing: content-box; border-radius: 50%; padding: 18px; color: white; }.call-action.decline svg { background: var(--danger); transform: rotate(135deg); }.call-action.accept svg { background: var(--success); }
.call-screen { overflow: hidden; color: white; background: #000; }.remote-videos { position: absolute; inset: 0; display: grid; background: #000; transition: all .28s ease; }.remote-videos video { width: 100%; height: 100%; object-fit: contain; background:#000; }.remote-videos.has-remote-video .call-waiting { display: none; }.remote-videos.single-remote-video { display: block; }.remote-videos.single-remote-video video[data-remote-media] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }.remote-videos.has-remote-video:not(.single-remote-video) { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 2px; }.call-waiting { display: grid; place-content: center; justify-items: center; text-align: center; }.pulse-avatar { width: 118px; height: 118px; font-size: 42px; box-shadow: 0 0 0 20px rgba(109,85,231,.17); }.call-waiting h2 { margin: 32px 0 6px; }.call-waiting p { margin: 0; color: #c9c3d8; }.local-video { position: absolute; top: max(22px, var(--safe-top)); right: 22px; z-index: 2; width: min(24vw, 230px); aspect-ratio: 9/16; border: 2px solid rgba(255,255,255,.45); border-radius: 19px; object-fit: contain; background: #000; box-shadow: 0 14px 40px rgba(0,0,0,.32); transform: scaleX(-1); transition:all .28s ease; }.local-video.rear { transform: none; }.call-screen.local-primary .local-video{inset:0;width:100%;height:100%;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;z-index:1}.call-screen.local-primary .remote-videos{inset:max(22px,var(--safe-top)) 22px auto auto;width:min(24vw,230px);height:auto;aspect-ratio:9/16;border:2px solid rgba(255,255,255,.45);border-radius:19px;overflow:hidden;box-shadow:0 14px 40px rgba(0,0,0,.32);z-index:2}.call-screen.local-primary .remote-videos video[data-remote-media]:not(:first-of-type){display:none}.call-top { position: absolute; top: max(24px, var(--safe-top)); left: 24px; z-index: 3; border-radius: 99px; padding: 8px 13px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); font-variant-numeric: tabular-nums; transition:opacity .25s; }.call-controls { position: absolute; left: 50%; bottom: max(26px, calc(var(--safe-bottom) + 18px)); z-index: 3; display: flex; gap: 12px; transform: translateX(-50%); transition:opacity .25s,transform .25s; }.call-screen.controls-hidden .call-controls,.call-screen.controls-hidden .call-top{opacity:0;pointer-events:none}.call-screen.controls-hidden .call-controls{transform:translate(-50%,12px)}.control-button { display: flex; min-width: 68px; flex-direction: column; align-items: center; gap: 7px; border: 0; color: white; background: none; font-size: 11px; }.control-button svg { box-sizing: content-box; border-radius: 50%; padding: 15px; background: rgba(255,255,255,.18); backdrop-filter: blur(12px); }.control-button.off svg { background: white; color: #19171f; }.control-button.hangup svg { background: var(--danger); transform: rotate(135deg); }
.toast { position: fixed; left: 50%; bottom: max(26px, calc(var(--safe-bottom) + 18px)); z-index: 100; max-width: min(90vw, 520px); transform: translateX(-50%); border-radius: 12px; padding: 12px 17px; color: white; background: #27242e; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }

.control-button.active svg { background: #0f9f92; color: white; }
.remote-videos.has-remote-video .call-waiting { display: none !important; }
.call-screen .remote-videos.mesh-1{grid-template-columns:1fr;grid-template-rows:1fr}.call-screen .remote-videos.mesh-2{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr}.call-screen .remote-videos.mesh-3{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:1fr}.call-screen .remote-videos.mesh-3>*{grid-column:span 2}.call-screen .remote-videos.mesh-4{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-5{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-5>*{grid-column:span 2}.call-screen .remote-videos.mesh-5>*:nth-child(4){grid-column:2/span 2}.call-screen .remote-videos.mesh-5>*:nth-child(5){grid-column:4/span 2}.call-screen .remote-videos.mesh-6{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos[class*="mesh-"]{gap:4px;padding:4px}.mesh-local-tile{position:relative;min-width:0;min-height:0;overflow:hidden;border-radius:18px;background:#000;outline:2px solid #7657f4;outline-offset:-2px}.mesh-local-tile .local-video{position:static;width:100%;height:100%;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;transform:scaleX(-1)}.mesh-local-tile .local-video.rear{transform:none}.mesh-name{position:absolute;left:12px;bottom:10px;padding:5px 9px;border-radius:10px;background:rgba(8,7,13,.72);font-size:12px;font-weight:700}.call-screen.group-call .call-waiting{position:absolute;inset:0;z-index:1;pointer-events:none}.call-screen.group-call.local-primary .remote-videos{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;display:grid}.call-screen.group-call.local-primary .remote-videos video[data-remote-media]:not(:first-of-type){display:block}
@media(max-width:900px){.call-screen .remote-videos.mesh-2{grid-template-columns:1fr;grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-3{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-3>*{grid-column:auto}.call-screen .remote-videos.mesh-3>*:first-child{grid-column:1/-1}.call-screen .remote-videos.mesh-5{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}.call-screen .remote-videos.mesh-5>*{grid-column:auto}.call-screen .remote-videos.mesh-5>*:first-child{grid-column:1/-1}.call-screen .remote-videos.mesh-6{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}}
.call-screen .remote-videos.mesh-3{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:1fr}.call-screen .remote-videos.mesh-3>.mesh-item{grid-column:auto}.call-screen .remote-videos.mesh-5{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-5>.mesh-item{grid-column:auto}
@media(max-width:900px){.call-screen .remote-videos.mesh-3{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-3>.mesh-local-tile{grid-column:1/-1}.call-screen .remote-videos.mesh-5{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}.call-screen .remote-videos.mesh-5>.mesh-local-tile{grid-column:1/-1}}
.call-screen .remote-videos.mesh-1,.call-screen .remote-videos.mesh-2,.call-screen .remote-videos.mesh-3{grid-template-rows:minmax(0,1fr)}.call-screen .remote-videos>.mesh-item{min-width:0;min-height:0;max-width:100%;max-height:100%;overflow:hidden}
@media(max-width:900px){.call-screen .remote-videos.mesh-2{grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen .remote-videos.mesh-3{grid-template-rows:repeat(2,minmax(0,1fr))}}
.call-screen.group-call .local-video{position:absolute;inset:max(20px,var(--safe-top)) 20px auto auto;width:min(18vw,170px);height:auto;aspect-ratio:9/16;border:2px solid rgba(255,255,255,.55);border-radius:17px;z-index:4;box-shadow:0 14px 40px rgba(0,0,0,.38)}
.call-screen.group-call .remote-videos.mesh-1{grid-template-columns:1fr;grid-template-rows:1fr}.call-screen.group-call .remote-videos.mesh-2{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr}.call-screen.group-call .remote-videos.mesh-3{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:1fr}.call-screen.group-call .remote-videos.mesh-4{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen.group-call .remote-videos.mesh-5{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen.group-call .remote-videos.mesh-5>.mesh-item{grid-column:span 2}.call-screen.group-call .remote-videos.mesh-5>.mesh-item:nth-child(4){grid-column:2/span 2}.call-screen.group-call .remote-videos.mesh-5>.mesh-item:nth-child(5){grid-column:4/span 2}
.call-screen.group-call .remote-videos.has-pin>.mesh-item{grid-column:auto!important;grid-row:auto!important}.call-screen.group-call .remote-videos.has-pin>.mesh-item.pinned{grid-column:1/-1!important;grid-row:1!important;outline:2px solid #8c68ff;outline-offset:-2px}.call-screen.group-call .remote-videos.has-pin.pin-1{grid-template-columns:1fr;grid-template-rows:1fr}.call-screen.group-call .remote-videos.has-pin.pin-2{grid-template-columns:1fr;grid-template-rows:minmax(0,3fr) minmax(0,1fr)}.call-screen.group-call .remote-videos.has-pin.pin-3{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,2.5fr) minmax(0,1fr)}.call-screen.group-call .remote-videos.has-pin.pin-4{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,2.5fr) minmax(0,1fr)}.call-screen.group-call .remote-videos.has-pin.pin-5{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,3fr) minmax(0,1fr) minmax(0,1fr)}
@media(max-width:900px){.call-screen.group-call .local-video{width:min(22vw,116px);right:12px}.call-screen.group-call .remote-videos.mesh-2{grid-template-columns:1fr;grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen.group-call .remote-videos.mesh-3{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}.call-screen.group-call .remote-videos.mesh-3>.mesh-item:first-child{grid-column:1/-1}.call-screen.group-call .remote-videos.mesh-5{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}.call-screen.group-call .remote-videos.mesh-5>.mesh-item{grid-column:auto}.call-screen.group-call .remote-videos.mesh-5>.mesh-item:first-child{grid-column:1/-1}}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 74px 320px minmax(0, 1fr); }.auth-screen { grid-template-columns: .8fr 1.2fr; }.auth-art { padding-inline: 5vw; }.bubble { max-width: 82%; }
}

@media (max-width: 780px) {
  .auth-screen { display: block; overflow: auto; background: var(--surface); }.auth-art { display: none; }.auth-panel { min-height: 100%; padding: max(34px, var(--safe-top)) 24px max(34px, var(--safe-bottom)); }.mobile-brand { display: flex; }.auth-card h2 { font-size: 31px; }
  .workspace { position: fixed; display: block; height: 100%; padding-bottom: calc(66px + var(--safe-bottom)); }
  .rail { position: fixed; inset: auto 0 0; z-index: 20; display: block; height: calc(66px + var(--safe-bottom)); border-top: 1px solid var(--line); border-right: 0; padding: 5px 10px var(--safe-bottom); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(18px); }
  .rail-logo, .rail-bottom { display: none; }.rail nav { display: grid; width: 100%; height: 100%; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 0; }.nav-button { min-height: 54px; border-radius: 12px; }.nav-button.active { background: transparent; }
  .list-pane { width: 100%; height: 100%; border: 0; }.pane-header { min-height: 78px; padding-top: max(15px, var(--safe-top)); }.conversation-list { padding-bottom: 12px; }
  .empty-pane { display: none; }.chat-pane { position: fixed; inset: 0; z-index: 30; height: 100%; }.mobile-back { display: inline-grid; }.chat-header { min-height: 70px; padding-right: 9px; padding-left: 6px; }.chat-actions { gap: 0; }.chat-actions .icon-button { width: 38px; }.chat-heading h3 { font-size: 16px; }.chat-heading p { font-size: 11px; }
  .messages { padding: 14px 11px; }.bubble { max-width: 86%; }.message-media { width: min(300px, 68vw); }.composer { padding-inline: 7px; }.composer .icon-button { width: 39px; }.optional-action { display: none; }
  .modal { width: min(94vw, 480px); max-height: 88vh; }.modal form { padding: 27px 22px; }
  .local-video { top: max(17px, var(--safe-top)); right: 14px; width: min(31vw, 170px); }.call-controls { gap: 5px; }.control-button { min-width: 69px; }
}

@media (max-width: 430px) {
  .two-fields { grid-template-columns: 1fr; gap: 0; }.form-line { align-items: flex-start; }.pane-header { padding-inline: 17px; }.search-box { margin-inline: 15px; }.filter-row { padding-inline: 15px; }.conversation-row { grid-template-columns: 48px minmax(0, 1fr) auto; }.avatar { width: 48px; height: 48px; }.chat-header .avatar { width: 42px; height: 42px; }.incoming-actions { gap: 54px; }.bubble { max-width: 90%; }.composer textarea { padding-inline: 13px; }.call-controls { gap: 1px; }.control-button { min-width: 58px; }.control-button svg { padding: 12px; }
}

.connection-request { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 11px; margin: 8px 12px; border: 1px solid color-mix(in srgb,var(--accent) 28%,var(--line)); border-radius: 17px; padding: 11px; background: var(--accent-soft); }.connection-request .avatar { width: 48px; height: 48px; }.request-actions { display: flex; gap: 7px; }.request-actions button { min-height: 36px; border-radius: 10px; padding: 0 12px; }@media(max-width:760px){.connection-request{grid-template-columns:44px minmax(0,1fr)}.request-actions{grid-column:1/-1}.request-actions button{flex:1}}

/* Monochrome liquid interaction system. Motion is deliberately short so it
   reads as fluid feedback without delaying messages, navigation or calls. */
button, .conversation-row, .person-row, .member-option, .chip, .message-media,
.bubble, .search-box, .field input, .composer textarea, .nav-button, .icon-button {
  transition: transform .26s cubic-bezier(.2,.9,.24,1.28),
              border-radius .26s cubic-bezier(.2,.9,.24,1.28),
              background-color .22s ease, color .22s ease, box-shadow .22s ease,
              border-color .22s ease, opacity .22s ease;
}
button:active, .conversation-row:active, .person-row:active, .member-option:active,
.chip:active, .message-media:active { transform: scale(.955); border-radius: 28px; }
.conversation-row:hover, .person-row:hover, .member-option:hover {
  transform: translateY(-2px); box-shadow: 0 12px 30px rgba(5,80,72,.12);
}
.modal[open] { animation: liquid-dialog .34s cubic-bezier(.18,.9,.2,1.2); }
.incoming-call:not(.hidden), .call-screen:not(.hidden) { animation: liquid-screen .32s ease-out; }
.toast { animation: liquid-toast .32s cubic-bezier(.18,.9,.2,1.22); background: #102622; }
.pulse-avatar { box-shadow: 0 0 0 20px rgba(31,199,181,.17); animation: teal-pulse 2.2s ease-in-out infinite; }
.mesh-local-tile { outline-color: #27d6c2; }
.call-screen.group-call .remote-videos.has-pin>.mesh-item.pinned { outline-color: #27d6c2; }
.sender-name, .outgoing .sender-name { color: #b8fff4; }
.ticks.seen { color: #55e6d5; }
.phone-download { background: radial-gradient(circle at 20% 10%, #dff7f3, #f3faf8 55%); }
@keyframes liquid-dialog { from { opacity: 0; transform: translateY(18px) scale(.92); border-radius: 42px; } to { opacity: 1; transform: none; } }
@keyframes liquid-screen { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: none; } }
@keyframes liquid-toast { from { opacity: 0; transform: translate(-50%,18px) scale(.9); } to { opacity: 1; transform: translate(-50%,0) scale(1); } }
@keyframes teal-pulse { 50% { box-shadow: 0 0 0 32px rgba(31,199,181,.04); transform: scale(1.025); } }

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