:root {
  color-scheme: dark;
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  background: #14141c;
  color: #f3f1f8;
  --rail: #15151e;
  --pane: #191923;
  --stage: #14141d;
  --lift: #242431;
  --border: #2a2937;
  --text: #f3f1f8;
  --muted: #a3a0b4;
  --quiet: #8b899f;
  --accent: #b8a8ff;
  --purple: #a38cff;
  --green: #57d8a0;
  --red: #fa657e;
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button { background: none; border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
button, .search, select { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 680; letter-spacing: -.032em; }
input, textarea, select { color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--quiet); opacity: 1; }
[hidden] { display: none !important; }
::selection { color: #fff; background: #6752b5; }
* { scrollbar-color: #444257 transparent; scrollbar-width: thin; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.welcome {
  display: grid; place-items: center; min-height: 100dvh; padding: 28px;
  background: var(--stage); text-align: center;
}
.welcome-content { width: 100%; max-width: 420px; }
.welcome-content img { display: block; margin: 0 auto 22px; }
.welcome-content h1 { font-size: clamp(1.9rem,5vw,2.75rem); line-height: 1.1; }
.welcome-content p { color: var(--muted); margin-top: 12px; line-height: 1.5; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.welcome-content .text-button { margin-top: 14px; }
.profile-entry { height: 100dvh; overflow-y: auto; }
.setup-view { max-width: 510px; margin-inline: auto; padding: clamp(26px,8vh,78px) 20px 36px; }
.setup-view .setup-actions { gap: 16px; }
.shell {
  width: 100%; height: 100vh; height: 100dvh;
  display: grid; grid-template-columns: 88px minmax(255px, 312px) minmax(0, 1fr) 0;
  isolation: isolate; overflow: hidden;
}
.shell.with-detail { grid-template-columns: 88px minmax(255px,312px) minmax(0,1fr) 278px; }
.rail {
  background: var(--rail); border-right: 1px solid var(--border);
  display: flex; align-items: center; flex-direction: column; min-width: 0; padding: 26px 9px 21px;
}
.brand { display: grid; place-items: center; gap: 7px; padding: 0 4px; margin-bottom: 43px; }
.brand img { width: 43px; height: 43px; }
.brand > span { font-size: 16px; font-weight: 780; line-height: 1; letter-spacing: -.045em; }
.brand > span > span { color: var(--purple); }
#nav-items { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.nav-button {
  width: 100%; min-height: 65px; border-radius: 12px; padding: 8px 2px 7px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  color: var(--muted); font-size: .72rem; font-weight: 580; position: relative;
}
.nav-button:hover { background: #22222e; color: var(--text); }
.nav-button.selected { background: #2a2342; color: #c6b6ff; }
.nav-icon { position: relative; display: grid; place-items: center; }
.badge {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 100px;
  background: var(--red); color: #211119; font-weight: 760; font-size: .72rem; font-variant-numeric: tabular-nums; line-height: 1;
}
.nav-icon .badge { position: absolute; top: -6px; left: 15px; box-shadow: 0 0 0 2px #2a2342; }
#rail-account { margin-top: auto; }
.account-button { display: grid; place-items: center; padding: 4px; border-radius: 50%; border: 1px solid #39374a; }
.account-button:hover { border-color: var(--accent); }
.avatar { position: relative; width: var(--size); height: var(--size); display: inline-grid; flex: none; vertical-align: middle; }
.face {
  display: grid; place-items: center; border-radius: 50%; width: 100%; height: 100%;
  background-color: #393057; color: #e2d8ff; overflow: hidden; font-size: calc(var(--size) * .34);
  font-weight: 730; letter-spacing: -.04em;
}
.face img { width: 100%; height: 100%; object-fit: cover; }
.presence {
  position: absolute; bottom: -1px; right: -1px; width: calc(var(--size) * .28); height: calc(var(--size) * .28);
  min-width: 11px; min-height: 11px; border-radius: 50%; background: #69677a; border: 2px solid var(--pane);
}
.presence.is-online { background: var(--green); }
.inbox { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--pane); border-right: 1px solid var(--border); }
.inbox-heading { padding: 26px 20px 13px; }
.inbox-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.inbox-title h1 { font-size: 1.78rem; line-height: 1; }
.icon-button { width: 37px; height: 37px; padding: 0; display: inline-grid; flex: none; place-items: center; border-radius: 10px; color: var(--muted); }
.icon-button:hover { color: var(--text); background: #2c2b3a; }
.new-chat { background: #2a2341; color: #c7b7ff; }
.new-chat:hover { background: #3c305d; color: #e6dcff; }
.new-chat svg { width: 19px; height: 19px; }
.search { display: flex; align-items: center; gap: 10px; background: #22222f; border: 1px solid #2e2d3c; border-radius: 10px; padding: 0 12px; color: var(--quiet); min-width: 0; }
.search:focus-within { border-color: #8871dc; }
.search svg { flex: none; }
.search input { width: 100%; min-width: 0; height: 41px; outline: none; border: 0; background: transparent; font-size: .86rem; }
.search input:focus-visible { outline: none; }
.chat-filters { display: flex; gap: 8px; margin-top: 15px; }
.chat-filters button { border-radius: 8px; min-height: 32px; color: var(--muted); font-size: .78rem; font-weight: 600; padding: 0 11px; }
.chat-filters button:hover { color: var(--text); background: #242432; }
.chat-filters button.selected { color: #d1c2ff; background: #302648; }
#chat-unread:not(:empty) { margin-left: 4px; color: var(--accent); font-variant-numeric: tabular-nums; }
#chat-list { overflow-y: auto; padding: 0 12px 11px; }
.chat-row {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px;
  padding: 12px 10px; width: 100%; min-height: 72px; border: 1px solid transparent; border-radius: 11px; text-align: left;
}
.chat-row:hover { background: #232331; }
.chat-row.selected { background: #2b2540; border-color: #3c3055; }
.row-text { display: grid; gap: 5px; min-width: 0; }
.row-text strong, .row-text > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text strong { font-size: .93rem; font-weight: 650; letter-spacing: -.015em; }
.row-text > span { font-size: .8rem; color: var(--muted); }
.row-meta { height: 38px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; justify-content: flex-start; }
.row-meta time { color: var(--quiet); font-size: .68rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-empty { padding: 16px 9px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
#list-footer {
  display: flex; align-items: center; gap: 8px; min-height: 56px; margin-top: auto; padding: 9px 20px;
  border-top: 1px solid var(--border); color: var(--quiet); font-size: .76rem;
}
#list-footer button { margin-left: auto; }
.connection-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #7864ab; }
.connection-dot.connected { background: var(--green); }
.text-button { color: var(--accent); padding: 5px 0; font-size: .86rem; font-weight: 640; }
.text-button:hover { color: #e3daff; text-decoration: underline; text-underline-offset: 3px; }
.stage { min-width: 0; min-height: 0; background: var(--stage); }
.chat-view { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.chat-header {
  min-height: 81px; display: flex; align-items: center; gap: 12px; padding: 13px 22px;
  background: #181822; border-bottom: 1px solid var(--border);
}
.chat-title { display: grid; gap: 4px; flex: 1; min-width: 0; }
.chat-title .name-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-age { flex: none; color: var(--muted); font-size: .76rem; }
.chat-title h1 { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; min-width: 0; }
.chat-status > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .78rem; }
.status.online { color: var(--green); }
.status i { height: 6px; width: 6px; background: currentColor; border-radius: 100%; }
.meta-dot { color: #6f6a86; }
.chat-header .info-button[aria-expanded="true"] { color: var(--accent); background: #282239; }
.menu-anchor { position: relative; flex: none; }
.menu {
  display: grid; position: absolute; top: calc(100% + 8px); right: 0; min-width: 175px; border: 1px solid #3b384d;
  z-index: 5; box-shadow: 0 8px 25px #0005; padding: 5px; border-radius: 11px; background: #232331;
}
.menu button { border-radius: 7px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; text-align: left; font-size: .86rem; }
.menu button:hover { background: #343246; }
.menu button.danger { color: #ffa0ad; }
.mobile-back { display: none; }
.timeline { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 21px clamp(19px, 3.4vw, 48px) 15px; }
.message-stack { width: 100%; max-width: 845px; margin: auto; }
.date-rule { display: flex; align-items: center; gap: 14px; color: var(--quiet); font-size: .75rem; margin: 1px 0 27px; }
.date-rule span { background: var(--border); flex: 1; height: 1px; }
.load-older { display: block; margin: 0 auto 14px; }
.message { display: flex; align-items: flex-start; gap: 9px; margin-top: 19px; }
.message.grouped { margin-top: 7px; }
.message.mine { justify-content: end; }
.message-avatar { width: 30px; flex: none; margin-top: 4px; }
.bubble-wrap { min-width: 0; max-width: min(88%,480px); display: grid; justify-items: start; gap: 5px; }
.mine .bubble-wrap { justify-items: end; }
.bubble {
  border-radius: 4px 13px 13px 13px; width: fit-content; white-space: pre-wrap; overflow-wrap: anywhere;
  background: #252536; color: #f2effb; padding: 12px 15px; font-size: .92rem; line-height: 1.42;
}
.mine .bubble { border-radius: 13px 4px 13px 13px; background: #7359d4; color: #fff; }
.message-time { color: var(--quiet); font-size: .68rem; min-height: 14px; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; padding-inline: 1px; }
.message-time span { display: inline-flex; }
.message-time .read { color: #bcaaff; }
.message-image { display: block; width: min(100%, 298px); padding: 0; overflow: hidden; border: 1px solid #36384a; border-radius: 12px; }
.message-image img { display: block; width: 100%; height: auto; aspect-ratio: 1.89; object-fit: cover; transition: transform .22s ease; }
.message-image:hover img { transform: scale(1.025); }
.audio-message { background: #252536; display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 8px 12px 8px 9px; max-width: 100%; }
.mine .audio-message { background: #7359d4; }
.play { border-radius: 50%; width: 33px; height: 33px; flex: none; display: grid; place-items: center; padding: 0; background: #423761; color: #dacdff; }
.play:hover { background: #514179; }
.waveform { display: flex; align-items: center; flex: 1; gap: 3px; overflow: hidden; min-width: 0; mask-image: linear-gradient(to right, #000 var(--played,0%), #0008 var(--played,0%)); }
.waveform i { display: block; background: #c3aaff; height: var(--bar); width: 2px; border-radius: 2px; flex: none; }
.voice-duration { font-size: .72rem; font-variant-numeric: tabular-nums; color: #d5cce8; }
.compose-area { padding: 0 24px 19px; position: relative; background: var(--stage); }
#typing { min-height: 20px; display: flex; align-items: center; gap: 7px; color: var(--quiet); font-size: .75rem; margin-left: 3px; }
.typing-dots { display: flex; gap: 3px; }
.typing-dots i { background: #9c83ea; border-radius: 100%; width: 4px; height: 4px; animation: pulse-dot 1.1s infinite alternate; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse-dot { to { transform: translateY(-2px); opacity: .45; } }
.composer {
  display: flex; align-items: center; gap: 8px; border: 1px solid #373548; background: #20202e; border-radius: 14px;
  min-height: 58px; padding: 7px 8px 7px 9px; max-width: 930px; margin-inline: auto;
}
.composer:focus-within { border-color: #7e67c7; }
.composer textarea {
  resize: none; flex: 1; min-width: 0; height: 37px; line-height: 21px; background: none; border: 0; outline: none;
  padding: 8px 3px; font-size: .9rem;
}
.composer textarea:focus-visible { outline: none; }
.composer .icon-button { width: 33px; height: 36px; }
.composer .icon-button svg { width: 20px; height: 20px; }
.send { display: grid; place-items: center; width: 41px; height: 41px; flex: none; border-radius: 10px; padding: 0; color: #1f1735; background: #a891ff; }
.send:hover { background: #c2b0ff; }
.send:active, .primary:active { transform: translateY(1px); }
.record { touch-action: none; user-select: none; }
.record.recording { background: #4c2636; color: #ff95a6; animation: pulse-dot 1s infinite alternate; }
#record-state {
  display: none; position: absolute; bottom: 82px; right: 25px; color: #ffb2bf; background: #322332; border-radius: 8px; padding: 8px 12px; font-size: .78rem;
}
#record-state.visible { display: block; }
.detail { display: none; }
.with-detail .detail {
  display: flex; min-width: 0; min-height: 0; overflow-y: auto; flex-direction: column; background: #191923; border-left: 1px solid var(--border);
}
.detail-heading { min-height: 81px; display: flex; align-items: center; justify-content: space-between; padding: 13px 18px 13px 21px; border-bottom: 1px solid var(--border); }
.detail-heading h2 { font-size: 1.02rem; }
.detail-close svg { width: 18px; height: 18px; }
.detail-person { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px 21px; }
.detail-person > .avatar { margin-bottom: 4px; }
.detail-person .presence { height: 15px; width: 15px; bottom: 3px; right: 3px; border-width: 3px; }
.detail-person h3 { font-size: 1.16rem; text-align: center; overflow-wrap: anywhere; }
.detail-section { border-top: 1px solid var(--border); margin: 0 19px; padding: 17px 0; }
.detail-meta { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 6px 0; font-size: .83rem; }
.detail-meta span { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.detail-meta strong { font-weight: 620; text-align: right; overflow-wrap: anywhere; }
.bio { color: var(--muted); font-size: .82rem; line-height: 1.55; margin-top: 11px; overflow-wrap: anywhere; }
.shared-title { display: flex; align-items: center; justify-content: space-between; }
.shared-title h3 { font-size: .91rem; letter-spacing: 0; }
.shared-title > span { color: var(--quiet); font-size: .76rem; }
.thumbnails { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 11px; }
.thumbnail { border-radius: 8px; overflow: hidden; aspect-ratio: 1; padding: 0; background: #303041; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .18s ease; }
.thumbnail:hover img { transform: scale(1.07); }
.detail-bottom { padding: 16px 17px 19px; margin-top: auto; }
.random-link {
  display: flex; align-items: center; width: 100%; gap: 10px; padding: 11px 9px 11px 10px; border: 1px solid #3b3254;
  border-radius: 12px; background: #242036; color: var(--accent); text-align: left;
}
.random-link:hover { background: #2d2546; }
.random-link-icon { display: grid; place-items: center; background: #382950; width: 34px; height: 34px; border-radius: 8px; flex: none; }
.random-link > span:nth-child(2) { flex: 1; display: grid; gap: 3px; }
.random-link strong { color: #eee8ff; font-size: .81rem; font-weight: 640; }
.random-link small { color: #b4a8ce; font-size: .72rem; }
.full-view { height: 100%; overflow-y: auto; padding: clamp(24px,4.6vw,60px); }
.page-heading { margin-bottom: 28px; }
.page-heading h1, .random-center h1 { font-size: clamp(1.8rem,3vw,2.46rem); line-height: 1.1; }
.page-heading p, .random-center p { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.directory-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.directory-controls .search { flex: 1 1 205px; }
.directory-controls select { min-width: 133px; max-width: 178px; }
select {
  appearance: none; padding: 0 32px 0 12px; min-height: 43px; border-radius: 9px; border: 1px solid #393749; background: #22222f;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23aaa4bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; font-size: .87rem;
}
.online-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 9px 0; color: var(--muted); font-size: .86rem; cursor: pointer; }
.online-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle { width: 33px; height: 19px; border-radius: 100px; background: #414054; position: relative; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; height: 13px; width: 13px; border-radius: 50%; background: #efedf8; transition: transform .16s ease; }
.online-toggle input:checked + .toggle { background: #8063d9; }
.online-toggle input:checked + .toggle::after { transform: translateX(14px); }
.online-toggle input:focus-visible + .toggle { outline: 2px solid var(--accent); outline-offset: 3px; }
.result-count { color: var(--quiet); font-size: .83rem; padding: 23px 0 13px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 12px; }
.person-card {
  display: flex; align-items: center; gap: 12px; padding: 15px; min-width: 0; border: 1px solid #323142;
  border-radius: 12px; background: #20202d; text-align: left; transition: transform .16s ease, border-color .16s ease;
}
.person-card:hover { border-color: #71609b; transform: translateY(-2px); }
.person-card > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 5px; }
.person-card strong { font-size: .95rem; overflow-wrap: anywhere; }
.person-card small { font-size: .77rem; color: var(--muted); }
.person-card svg { color: var(--quiet); flex: none; }
.page-empty, .empty-thread { display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; color: var(--accent); padding: 32px 10px; min-height: 245px; }
.empty-stage, .empty-thread { height: 100%; }
.page-empty h1, .page-empty h2, .empty-thread h2 { color: var(--text); font-size: 1.3rem; }
.page-empty p, .empty-thread p { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.page-empty .primary { margin-top: 5px; }
.primary, .secondary, .danger-button, .small-control {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; min-height: 42px;
  padding: 0 14px; font-weight: 680; font-size: .86rem; white-space: nowrap; border: 1px solid transparent;
}
.primary { background: #a891ff; color: #201637; }
.primary:hover { background: #c2aeff; }
.secondary, .small-control { background: #242433; color: var(--text); border-color: #3b394f; }
.secondary:hover, .small-control:hover { background: #33314a; }
.small-control { min-height: 35px; padding: 0 9px; }
.small-control.leave { color: #ffadba; }
.danger-button { background: #fa657e; color: #281019; }
.danger-button:hover { background: #ff8b9e; }
.random-view {
  height: 100%; display: grid; place-items: center; text-align: center; overflow: auto; padding: 22px;
  background: #181620;
}
.random-center { max-width: 500px; }
.random-mark {
  display: grid; place-items: center; width: 100px; height: 100px; border: 1px solid #51416a; border-radius: 28px;
  background: #2f2545; color: #cbb8ff; margin: 0 auto 26px; position: relative;
}
.random-mark > span { position: absolute; border: 1px solid #69528d; inset: -9px; border-radius: 33px; opacity: .35; }
.random-mark > span:nth-child(2) { inset: -17px; border-radius: 38px; opacity: .18; }
.random-mark.searching > span { animation: match-ring 1.6s ease infinite; }
.random-mark.searching > span:nth-child(2) { animation-delay: .35s; }
@keyframes match-ring { 65%,100% { transform: scale(1.14); opacity: 0; } }
.random-center .primary, .random-center .secondary { margin-top: 21px; }
.random-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 19px; font-size: .81rem; color: var(--quiet); }
.profile-form { max-width: 630px; }
.profile-photo { display: flex; align-items: center; gap: 17px; padding-bottom: 6px; }
.profile-form, dialog form { display: grid; gap: 15px; }
.profile-form label, dialog form label { display: grid; gap: 7px; color: var(--muted); font-size: .86rem; min-width: 0; }
.profile-form input:not([type=file]), .profile-form textarea, dialog input, dialog textarea {
  width: 100%; padding: 10px 12px; min-height: 43px; resize: vertical; border: 1px solid #393749;
  background: #22222f; border-radius: 9px; font-size: .93rem; line-height: 1.4;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-row select { width: 100%; }
.field-row.name-age { grid-template-columns: minmax(0,1fr) minmax(76px,7rem); }
.field-hint { color: var(--muted); font-size: .83rem; line-height: 1.45; }
.welcome-content .policy-links { margin-top: 27px; }
.profile-links { margin-top: 27px; max-width: 630px; }
.profile-links .policy-links { justify-content: start; }
form label.policy-agreement { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 9px; line-height: 1.45; }
form .policy-agreement input[type=checkbox] { margin: 3px 0 0; width: 16px; height: 16px; min-height: 0; accent-color: var(--purple); }
.policy-agreement a { color: var(--accent); text-underline-offset: 3px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.profile-view .form-actions { justify-content: flex-start; }
.settings { max-width: 630px; margin-top: 27px; border-top: 1px solid var(--border); padding: 16px 0 0; }
.settings h2 { font-size: 1.05rem; }
.settings p { font-size: .85rem; color: var(--muted); margin-top: 7px; }
.settings .secondary { margin: 12px 8px 0 0; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); border-bottom: 1px solid var(--border); padding: 8px 0; font-size: .9rem; }
dialog {
  width: min(440px,calc(100% - 28px)); padding: 19px 22px 22px; border: 1px solid #464158; border-radius: 16px;
  background: #222131; color: var(--text); box-shadow: 0 20px 85px #08061399; max-height: calc(100dvh - 36px); overflow-y: auto;
}
dialog::backdrop { background: #0b0a11a8; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.dialog-head h2 { font-size: 1.32rem; }
dialog > p { color: var(--muted); font-size: .89rem; margin-bottom: 16px; line-height: 1.5; }
.dialog-head .icon-button { margin-right: -6px; }
.form-error:not(:empty) { color: #ffabb8; font-size: .83rem; }
.form-error:empty { display: none; }
.auth-actions { display: flex; justify-content: space-between; gap: 9px; margin-top: 14px; }
.photo-dialog { width: min(790px,calc(100% - 28px)); }
.attachment-preview { display: block; width: 100%; max-height: 67dvh; object-fit: contain; border-radius: 8px; }
.attachment-preview + .form-actions { margin-top: 14px; }
.contact-dialog .detail-heading { min-height: 48px; padding: 0 0 6px; }
.contact-dialog .detail-section { margin-inline: 0; }
.contact-dialog .detail-bottom { padding: 10px 0 0; }
#toast {
  position: fixed; z-index: 20; bottom: 22px; left: 50%; transform: translate(-50%,8px);
  opacity: 0; pointer-events: none; max-width: calc(100% - 25px); width: max-content; transition: opacity .18s ease, transform .18s ease;
  border: 1px solid #54496b; border-radius: 10px; background: #312640; color: #f4ebff; padding: 10px 14px; font-size: .88rem;
}
#toast.show { opacity: 1; transform: translate(-50%,0); }
@media (min-width: 1450px) {
  .shell { grid-template-columns: 90px minmax(310px, 23vw) minmax(0,1fr) 0; }
  .shell.with-detail { grid-template-columns: 90px minmax(310px, 23vw) minmax(0,1fr) minmax(278px,19vw); }
}
@media (max-width: 1120px) {
  .shell.with-detail { grid-template-columns: 88px minmax(255px,29vw) minmax(0,1fr) 0; }
  .shell.with-detail .detail { display: none; }
  .chat-header .info-button[aria-expanded="true"] { background: none; color: var(--muted); }
}
@media (max-width: 890px) and (min-width: 761px) {
  .shell, .shell.with-detail { grid-template-columns: 71px 242px minmax(0,1fr) 0; }
  .rail { padding-inline: 6px; }
  .chat-header { padding-inline: 15px; }
  .inbox-heading { padding-inline: 14px; }
  #chat-list { padding-inline: 8px; }
  .chat-row { gap: 7px; padding-inline: 7px; }
  .chat-row .avatar { width: 38px; height: 38px; }
}
@media (max-width: 760px) {
  .shell, .shell.with-detail { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; }
  .rail {
    grid-row: 2; grid-column: 1; padding: 4px 8px max(4px,env(safe-area-inset-bottom));
    flex-direction: row; border-right: 0; border-top: 1px solid var(--border); z-index: 2;
  }
  .brand, #rail-account { display: none; }
  #nav-items { flex-direction: row; gap: 4px; }
  .nav-button { min-height: 55px; gap: 3px; flex: 1; }
  .nav-button.selected { background: transparent; }
  .nav-button.selected .nav-icon { background: #302547; border-radius: 9px; }
  .nav-icon { width: 41px; min-height: 30px; }
  .nav-icon .badge { left: 28px; top: -1px; }
  .inbox, .stage { grid-row: 1; grid-column: 1; }
  .inbox { display: none; border-right: 0; }
  .shell[data-tab="chats"]:not(.mobile-open) .inbox { display: flex; }
  .shell[data-tab="chats"]:not(.mobile-open) .stage { display: none; }
  .inbox-heading { padding: 24px 17px 13px; }
  .inbox-title { margin-bottom: 17px; }
  #chat-list { padding-inline: 10px; }
  .chat-row { min-height: 68px; }
  #list-footer { min-height: 42px; }
  .chat-header { min-height: 66px; padding: 8px 11px; gap: 7px; }
  .chat-header .avatar { width: 38px; height: 38px; }
  .chat-header .icon-button { width: 33px; height: 37px; }
  .chat-header .mobile-back { display: inline-grid; width: 28px; }
  .shell[data-tab="random"] .mobile-back { display: none; }
  .chat-title h1 { font-size: .98rem; }
  .chat-title .name-line { gap: 5px; }
  .chat-age { font-size: .68rem; }
  .chat-status { font-size: .69rem; gap: 5px; }
  .chat-title .status { font-size: .69rem; }
  .timeline { padding: 15px 12px 10px; }
  .date-rule { margin-bottom: 20px; }
  .message { margin-top: 14px; gap: 7px; }
  .bubble-wrap { max-width: 85%; }
  .bubble { padding: 10px 12px; font-size: .91rem; }
  .message-image { width: min(100%,255px); }
  .compose-area { padding: 0 10px 9px; }
  .composer { padding: 5px; gap: 3px; min-height: 47px; }
  .composer textarea { font-size: 1rem; }
  .send { width: 37px; height: 37px; }
  #typing { min-height: 15px; }
  .directory-controls { gap: 8px; }
  .directory-controls .search { flex-basis: 100%; }
  .directory-controls select { flex: 1; min-width: 0; }
  .full-view { padding: 25px 17px; }
  .page-heading { margin-bottom: 19px; }
  .people-grid { grid-template-columns: 1fr; gap: 8px; }
  .person-card { padding: 12px; }
  .profile-form input, .profile-form textarea, dialog input, dialog textarea { font-size: 1rem; }
  #toast { bottom: calc(75px + env(safe-area-inset-bottom)); }
}
@media (max-width: 370px) {
  .chat-header { gap: 5px; padding-inline: 7px; }
  .chat-header .avatar { width: 33px; height: 33px; }
  .small-control { min-height: 32px; padding: 0 5px; gap: 4px; }
  .small-control svg { width: 13px; }
  .chat-title .meta-dot, .chat-status > span:not(.status) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
