/* RamiGram web client — design language v3 (see design/project/System.dc.html) */

@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/jakarta-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/jakarta-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/vazirmatn.woff2) format('woff2'); }

:root {
  --font-en: 'Plus Jakarta Sans', 'Vazirmatn', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-fa: 'Vazirmatn', 'Plus Jakarta Sans', system-ui, Tahoma, sans-serif;
  --font-emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
  --accent: #5B4CF5; --accentText: #A99DFF; --accentSoft: rgba(169,157,255,.15);
  --msgSize: 15px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root, :root[data-theme="dark"] {
  --bg: #0E0F15; --rail: #0A0B10; --surface: #161722; --surface2: #1F2130; --surface3: #272A3C;
  --hover: rgba(255,255,255,.045); --press: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.24);
  --text: #F3F3F8; --muted: #9C9EB3; --wall: #0B0C11; --dot: rgba(255,255,255,.07);
  --bubbleIn: #1F2130; --green: #34D399; --danger: #FF7A7A; --warn: #F7B955; --mutedBadge: #3A3D50;
  --toast: #F3F3F8; --toastText: #14151B; --pill: rgba(31,33,48,.94); --scrim: rgba(5,6,10,.66);
  --shadow: 0 30px 80px -20px rgba(0,0,0,.6); --menuShadow: 0 18px 50px -12px rgba(0,0,0,.65);
  --skeleton: rgba(255,255,255,.06);
}
:root[data-theme="light"] {
  --bg: #F3F2EE; --rail: #E6E4DE; --surface: #FFFFFF; --surface2: #F0EFEA; --surface3: #E6E5DF;
  --hover: rgba(0,0,0,.035); --press: rgba(0,0,0,.07);
  --line: rgba(20,20,30,.08); --line2: rgba(20,20,30,.26);
  --text: #14151B; --muted: #5D5F6E; --wall: #E8E6E0; --dot: rgba(0,0,0,.08);
  --bubbleIn: #FFFFFF; --green: #15803D; --danger: #C62828; --warn: #8A5200; --mutedBadge: #6B6D7A;
  --toast: #1B1C24; --toastText: #FFFFFF; --pill: rgba(255,255,255,.94); --scrim: rgba(20,21,27,.45);
  --shadow: 0 30px 80px -20px rgba(0,0,0,.25); --menuShadow: 0 18px 50px -12px rgba(0,0,0,.3);
  --skeleton: rgba(0,0,0,.06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-en); font-size: 14.5px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  transition: background-color .25s ease, color .25s ease;
}
:root[lang="fa"] body { font-family: var(--font-fa); }
#app { height: 100%; height: 100dvh; position: relative; }
button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; text-align: inherit; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; opacity: .5; }
input, textarea, select { font: inherit; color: inherit; background: none; border: 0; outline: 0; margin: 0; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); }
a { color: var(--accentText); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accentText); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline: none; }
.input:focus-visible { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.emoji { font-family: var(--font-emoji); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.grow { flex: 1; min-width: 0; }
.row-c { display: flex; align-items: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.accent { color: var(--accentText); }
.danger { color: var(--danger); }
.hidden { display: none !important; }

.scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.hscroll { overflow-x: auto; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
@media (pointer: coarse) { .scroll { scrollbar-width: none; } .scroll::-webkit-scrollbar { display: none; } }

/* ---------- motion ---------- */
@keyframes rgMsg { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rgMsgOut { from { opacity: 0; transform: translateY(14px) scale(.94); transform-origin: bottom right; } to { opacity: 1; transform: none; } }
@keyframes rgPop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rgScale { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
@keyframes rgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rgFadeOut { to { opacity: 0; } }
@keyframes rgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rgPush { from { opacity: .3; transform: translateX(42px); } to { opacity: 1; transform: none; } }
@keyframes rgPushR { from { opacity: .3; transform: translateX(-42px); } to { opacity: 1; transform: none; } }
@keyframes rgSheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes rgDrawer { from { transform: translateX(100%); } to { transform: none; } }
@keyframes rgDrawerR { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes rgDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes rgSpin { to { transform: rotate(360deg); } }
@keyframes rgPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes rgBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes rgShimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes rgBurst { 0% { transform: scale(.2); opacity: 0; } 40% { transform: scale(1.35); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rgFloatUp { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); } 100% { transform: translate(-50%, -120px) scale(1); opacity: 0; } }
@keyframes rgShake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes rgBlink { 50% { opacity: .2; } }
@keyframes rgHighlight { 0% { background: var(--accentSoft); } 100% { background: transparent; } }
@keyframes rgProgress { from { width: 0; } to { width: 100%; } }
@keyframes rgLogo { 0% { transform: scale(.6) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.08) rotate(3deg); opacity: 1; } 100% { transform: none; } }
@keyframes rgWave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes rgRing { 0% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(10deg); } 40% { transform: rotate(-6deg); } 50%, 100% { transform: rotate(0); } }

.anim-pop { animation: rgPop .24s var(--ease); }
.anim-scale { animation: rgScale .22s var(--spring); }
.anim-fade { animation: rgFade .2s ease; }
.anim-in { animation: rgIn .26s var(--ease); }
.anim-push { animation: rgPush .3s var(--ease); }
[dir="rtl"] .anim-push { animation-name: rgPushR; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: rgSpin .8s linear infinite; display: inline-block; flex-shrink: 0; }
.tdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: rgDot 1.2s infinite ease-in-out; }
.tdot:nth-child(2) { animation-delay: .15s; } .tdot:nth-child(3) { animation-delay: .3s; }
.skel { background: linear-gradient(90deg, var(--skeleton) 25%, var(--hover) 37%, var(--skeleton) 63%); background-size: 400% 100%; animation: rgShimmer 1.4s ease infinite; border-radius: 8px; }
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ---------- primitives ---------- */
.tap { transition: transform .12s ease, opacity .15s ease, background-color .15s ease, color .15s ease; }
.tap:active { transform: scale(.94); }
.ib { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; transition: background-color .15s ease, color .15s ease, transform .12s ease; position: relative; }
.ib:hover { background: var(--hover); color: var(--text); }
.ib:active { transform: scale(.92); background: var(--press); }
.ib.on { background: var(--accentSoft); color: var(--accentText); }
.ib.round { border-radius: 50%; }
.ib.sm { width: 34px; height: 34px; border-radius: 10px; }
.ib.lg { width: 44px; height: 44px; }
.btn { height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s ease, filter .15s ease, background-color .15s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -14px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.soft { background: var(--accentSoft); color: var(--accentText); }
.btn.ghost { color: var(--accentText); }
.btn.ghost:hover { background: var(--hover); }
.btn.surface { background: var(--surface2); }
.btn.danger { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); }
.btn.danger-fill { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.btn .spinner { width: 18px; height: 18px; border-width: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input { height: 48px; border-radius: 14px; background: var(--surface2); padding: 0 14px; font-size: 15px; width: 100%; border: 1.5px solid transparent; transition: border-color .15s, background-color .15s; }
.input:focus { border-color: var(--accentText); background: var(--surface); }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input.error { border-color: var(--danger); animation: rgShake .4s; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err { font-size: 13px; color: var(--danger); }

.switch { width: 46px; height: 26px; border-radius: 999px; padding: 2px; display: flex; flex-shrink: 0; transition: background-color .2s; background: var(--line2); position: relative; }
.switch::after { content: ''; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .22s var(--spring); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
[dir="rtl"] .switch[aria-checked="true"]::after { transform: translateX(-20px); }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; }
.radio.on { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3.5px var(--surface); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; transition: all .18s var(--spring); }
.check.on { border-color: var(--accent); background: var(--accent); transform: scale(1.05); }
.check svg { opacity: 0; transition: opacity .15s; } .check.on svg { opacity: 1; }
input[type="range"] { accent-color: var(--accent); width: 100%; height: 28px; }

.avatar { border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; position: relative; overflow: hidden; user-select: none; background: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; animation: rgFade .3s ease; }
.avatar.saved { background: var(--accent); }
.av-wrap { position: relative; flex-shrink: 0; display: inline-block; }
.online-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 15px; height: 15px; border-radius: 50%; background: var(--green); border: 3px solid var(--surface); animation: rgScale .3s var(--spring); }
.badge { min-width: 21px; height: 21px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--accent); color: #fff; animation: rgScale .25s var(--spring); }
.badge.muted { background: var(--mutedBadge); }
.badge.mention { width: 21px; padding: 0; font-weight: 800; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface2); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; transition: background-color .2s, color .2s; white-space: nowrap; }
.chip.on { background: var(--accent); color: #fff; }
.chip .badge { min-width: 20px; height: 20px; font-size: 11.5px; padding: 0 6px; background: rgba(255,255,255,.24); }
.chip:not(.on) .badge { background: var(--accent); }
.kbd { font-family: inherit; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line2); color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 8px 0; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 16px 16px 8px; }
.card { background: var(--surface); border-radius: 18px; overflow: hidden; }
.card + .card { margin-top: 14px; }
.verified { flex-shrink: 0; }

/* ---------- app shell (desktop) ---------- */
.shell { height: 100%; display: flex; overflow: hidden; position: relative; background: var(--bg); }
.rail { width: 78px; flex-shrink: 0; background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 14px 0 16px; gap: 4px; }
.rail .logo { margin-bottom: 14px; animation: rgLogo .7s var(--spring); }
.rail-btn { position: relative; width: 66px; min-height: 60px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); transition: background-color .2s, color .2s, transform .12s; text-align: center; padding: 4px; }
.rail-btn:hover { background: var(--hover); color: var(--text); }
.rail-btn.on { background: var(--accentSoft); color: var(--accentText); }
.rail-btn:active { transform: scale(.94); }
.rail-btn .badge { position: absolute; top: 5px; inset-inline-end: 8px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; font-weight: 800; border: 2px solid var(--rail); }
.rail-me { width: 40px; height: 40px; border-radius: 14px; }

.list-pane { width: 368px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--surface); border-inline-end: 1px solid var(--line); position: relative; min-width: 0; }
.list-head { flex-shrink: 0; height: 66px; display: flex; align-items: center; gap: 8px; padding-inline: 20px 10px; }
.list-head h1 { margin: 0; flex: 1; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
[lang="fa"] .list-head h1, [lang="fa"] h1, [lang="fa"] h2, [lang="fa"] h3 { letter-spacing: 0 !important; }
.search-box { height: 42px; border-radius: 13px; background: var(--surface2); display: flex; align-items: center; gap: 10px; padding-inline: 12px 8px; color: var(--muted); transition: box-shadow .2s, background-color .2s; }
.search-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--accentText); background: var(--surface); }
.search-box input { flex: 1; height: 100%; font-size: 14.5px; color: var(--text); }
.search-box .clear { width: 26px; height: 26px; border-radius: 50%; background: var(--line2); color: var(--bg); display: flex; align-items: center; justify-content: center; animation: rgScale .2s var(--spring); }
.list-scroll { flex: 1; min-height: 0; padding: 0 8px 12px; position: relative; }
.folders-bar { display: flex; gap: 6px; padding: 0 14px 10px; }

.chat-row { width: 100%; height: 74px; display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 14px; text-align: start; margin-bottom: 2px; position: relative; transition: background-color .15s ease; contain: layout style; }
.chat-row:hover { background: var(--hover); }
.chat-row:active { background: var(--press); }
.chat-row.on { background: var(--accent); color: #fff; }
.chat-row.on .muted, .chat-row.on .r-sub, .chat-row.on .r-time, .chat-row.on .r-icon { color: rgba(255,255,255,.84) !important; }
.chat-row.on .badge { background: #fff; color: var(--accent); }
.chat-row.on .online-dot { border-color: var(--accent); }
.chat-row.on .r-sender { color: #fff; }
.chat-row.on .r-typing { color: #fff; }
.chat-row .r-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-row .r-top, .chat-row .r-bot { display: flex; align-items: center; gap: 5px; }
.chat-row .r-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .r-time { font-size: 12px; flex-shrink: 0; color: var(--muted); margin-inline-start: auto; }
.chat-row .r-time.unread { color: var(--accentText); }
.chat-row .r-sub { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chat-row .r-sender { color: var(--text); }
.chat-row .r-typing { color: var(--accentText); }
.chat-row .r-icon { color: var(--muted); flex-shrink: 0; }
.chat-row .r-tick { color: var(--accentText); flex-shrink: 0; }
.chat-row.on .r-tick { color: #fff; }
.chat-row .r-draft { color: var(--danger); }
.chat-row .r-thumb { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex-shrink: 0; display: inline-block; vertical-align: -4px; margin-inline-end: 4px; }
.list-enter { animation: rgIn .25s var(--ease) both; }
.archive-row .avatar { background: var(--mutedBadge); }

.empty { padding: 56px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; animation: rgFade .3s ease; }
.empty .ico { width: 72px; height: 72px; border-radius: 22px; background: var(--surface2); display: flex; align-items: center; justify-content: center; }
.empty h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 14px 0 0; }
.empty p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; max-width: 320px; }

.fab { position: absolute; bottom: calc(16px + var(--safe-b)); inset-inline-end: 16px; width: 58px; height: 58px; border-radius: 20px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 28px -10px var(--accent); z-index: 5; transition: transform .25s var(--spring), box-shadow .2s; animation: rgScale .35s var(--spring); }
.fab:active { transform: scale(.9); }
.fab.hide { transform: scale(0); }

.chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.chat-head { flex-shrink: 0; height: 66px; display: flex; align-items: center; gap: 6px; padding-inline: 18px 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.chat-head .who { flex: 1; min-width: 0; height: 52px; display: flex; align-items: center; gap: 12px; border-radius: 12px; text-align: start; }
.chat-head .who-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; min-width: 0; }
.chat-head .who-status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; min-height: 17px; }
.chat-head .who-status.on { color: var(--accentText); }
.no-chat { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--muted); text-align: center; padding: 24px; }
.no-chat .pill { padding: 7px 14px; border-radius: 999px; background: var(--pill); color: var(--text); font-size: 13.5px; font-weight: 600; }

.pinned-bar { flex-shrink: 0; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 20px; padding-inline: 20px 8px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; animation: rgFade .2s ease; position: relative; z-index: 2; }
.pinned-bar .lines { display: flex; flex-direction: column; gap: 2px; width: 3px; height: 32px; flex-shrink: 0; }
.pinned-bar .lines span { flex: 1; border-radius: 2px; background: var(--accentSoft); transition: background .2s; }
.pinned-bar .lines span.on { background: var(--accent); }
.pinned-bar .pt { font-size: 13px; font-weight: 700; color: var(--accentText); }
.pinned-bar .pb { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-bar { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 20px; padding-inline: 20px 12px; background: var(--surface); border-bottom: 1px solid var(--line); animation: rgFade .2s ease; }

.wall { background-color: var(--wall); background-image: radial-gradient(var(--dot) 1.1px, transparent 1.4px); background-size: 22px 22px; }
.wall.w-none { background-image: none; }
.wall.w-grid { background-image: linear-gradient(var(--dot) 1px, transparent 1px), linear-gradient(90deg, var(--dot) 1px, transparent 1px); background-size: 26px 26px; }
.wall.w-aurora { background-image: radial-gradient(1200px 600px at 10% 0%, var(--accentSoft), transparent 60%), radial-gradient(900px 500px at 100% 100%, var(--accentSoft), transparent 60%), radial-gradient(var(--dot) 1.1px, transparent 1.4px); background-size: auto, auto, 22px 22px; }
.msgs { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.msgs-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; }
.msgs-inner { width: 100%; max-width: 860px; margin: 0 auto; padding: 14px 24px 10px; margin-top: auto; }
.date-pill, .svc-pill { display: flex; justify-content: center; margin: 12px 0; position: relative; }
.date-pill span, .svc-pill span { padding: 5px 13px; border-radius: 999px; background: var(--pill); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: center; max-width: 86%; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); line-height: 1.45; }
.date-pill.sticky { position: sticky; top: 8px; z-index: 2; margin: 6px 0; }
.svc-pill span { cursor: default; }
.svc-pill.clickable span { cursor: pointer; }
.unread-sep { display: flex; justify-content: center; margin: 10px -24px; padding: 4px; background: var(--pill); color: var(--accentText); font-size: 13px; font-weight: 700; }

.m-row { display: flex; align-items: flex-end; gap: 8px; margin: 2px 0; position: relative; border-radius: 12px; transition: background-color .3s; }
.m-row.out { justify-content: flex-end; }
.m-row.grp-start { margin-top: 8px; }
.m-row.new { animation: rgMsg .26s var(--ease) both; }
.m-row.out.new { animation-name: rgMsgOut; }
.m-row.hl { animation: rgHighlight 1.8s ease; }
.m-row.selecting { cursor: pointer; padding-inline-start: 36px; }
.m-row.selected { background: var(--accentSoft); }
.m-row .sel-check { position: absolute; inset-inline-start: 4px; bottom: 8px; }
.m-av { width: 34px; height: 34px; flex-shrink: 0; }
.m-av-space { width: 34px; flex-shrink: 0; }
.bubble { max-width: min(560px, 78%); border-radius: 18px; padding: 7px 12px 6px; box-shadow: 0 1px 1.5px rgba(0,0,0,.12); position: relative; background: var(--bubbleIn); color: var(--text); min-width: 64px; transition: transform .2s var(--ease); word-wrap: break-word; }
.out .bubble { background: var(--accent); color: #fff; }
.m-row.tail .bubble { border-end-start-radius: 6px; }
.m-row.out.tail .bubble { border-end-start-radius: 18px; border-end-end-radius: 6px; }
.bubble.media-only { padding: 3px; background: transparent; box-shadow: none; }
.out .bubble.media-only { background: transparent; }
.bubble.has-media { padding: 4px 4px 6px; }
.bubble.sticker { background: transparent !important; box-shadow: none; padding: 0; }
.bubble.big-emoji { background: transparent !important; box-shadow: none; padding: 0 4px; }
.bubble.big-emoji .m-text { font-size: 46px; line-height: 1.15; }
.bubble.big-emoji .m-meta { background: var(--pill); color: var(--text) !important; border-radius: 999px; padding: 0 7px; }
.m-sender { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.m-sender .role { font-weight: 500; font-size: 11.5px; opacity: .75; margin-inline-start: auto; }
.has-media .m-sender, .has-media .m-fwd { padding: 2px 8px 4px; }
.m-fwd { font-size: 13px; margin-bottom: 4px; opacity: .92; cursor: pointer; }
.m-fwd b { font-weight: 700; }
.m-reply { border-radius: 9px; padding: 5px 10px; margin: 2px 0 6px; display: flex; gap: 8px; cursor: pointer; background: var(--accentSoft); border-inline-start: 3px solid var(--accentText); min-width: 0; transition: filter .15s; }
.m-reply:hover { filter: brightness(1.12); }
.out .m-reply { background: rgba(255,255,255,.16); border-inline-start-color: rgba(255,255,255,.85); }
.has-media .m-reply { margin: 2px 4px 6px; }
.m-reply .rn { font-size: 13px; font-weight: 700; color: var(--accentText); }
.out .m-reply .rn { color: #fff; }
.m-reply .rt { font-size: 13.5px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-reply img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.m-text { font-size: var(--msgSize); line-height: 1.45; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.has-media .m-text { padding: 4px 8px 0; }
.m-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.in .m-text a { color: var(--accentText); }
.m-text .mention, .m-text .hashtag { color: var(--accentText); cursor: pointer; font-weight: 600; text-decoration: none; }
.out .m-text .mention, .out .m-text .hashtag { color: #fff; text-decoration: underline; }
.m-text code { font-family: 'Cascadia Code', Consolas, 'Courier New', monospace; font-size: .9em; background: rgba(0,0,0,.18); padding: 1px 5px; border-radius: 5px; }
.m-text pre { font-family: 'Cascadia Code', Consolas, 'Courier New', monospace; font-size: .88em; background: rgba(0,0,0,.2); padding: 8px 10px; border-radius: 9px; margin: 4px 0; overflow-x: auto; white-space: pre; direction: ltr; text-align: left; }
.m-text .spoiler { background: currentColor; border-radius: 4px; cursor: pointer; transition: background .3s; filter: blur(.5px); }
.m-text .spoiler.shown { background: rgba(0,0,0,.15); filter: none; }
.m-text blockquote { margin: 4px 0; padding: 2px 10px; border-inline-start: 3px solid currentColor; opacity: .9; }
.m-foot { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 10px; row-gap: 2px; }
.m-meta { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: auto; height: 18px; font-size: 11.5px; color: var(--muted); white-space: nowrap; position: relative; top: 3px; user-select: none; }
.out .m-meta { color: rgba(255,255,255,.86); }
.m-meta .edited { font-style: italic; }
.media-only .m-meta, .m-meta.over { position: absolute; bottom: 8px; inset-inline-end: 8px; background: rgba(0,0,0,.45); color: #fff !important; border-radius: 999px; padding: 0 7px; top: auto; height: 20px; backdrop-filter: blur(6px); }
.m-tick { flex-shrink: 0; }
.m-tick.read { animation: rgScale .3s var(--spring); }
.m-meta .clock { animation: rgSpin 2s linear infinite; }
.m-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.has-media .m-reacts { padding: 0 6px; }
.m-react { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px 0 6px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--accentSoft); color: var(--accentText); transition: transform .15s, background .2s; animation: rgBurst .35s var(--spring); }
.m-react .emoji { font-size: 15px; }
.m-react.me { background: var(--accent); color: #fff; }
.out .m-react { background: rgba(255,255,255,.2); color: #fff; }
.out .m-react.me { background: #fff; color: var(--accent); }
.m-react:active { transform: scale(.9); }
.m-views { display: inline-flex; align-items: center; gap: 3px; }
.m-sig { font-style: italic; margin-inline-end: 4px; }
.m-actions-hover { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: -40px; opacity: 0; transition: opacity .15s; }
.m-row:hover .m-actions-hover { opacity: 1; }
.out .m-actions-hover { inset-inline-end: auto; inset-inline-start: -40px; }
.m-error { color: var(--danger); cursor: pointer; }

/* media inside bubbles */
.m-photo { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--surface2); max-width: 100%; }
.media-only .m-photo { border-radius: 16px; }
.m-photo img, .m-photo video { width: 100%; height: 100%; object-fit: cover; }
.m-photo .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(12px); transform: scale(1.1); }
.m-photo .full { position: relative; opacity: 0; transition: opacity .35s ease; }
.m-photo .full.loaded { opacity: 1; }
.m-photo.spoiler .full, .m-photo.spoiler video { filter: blur(28px); transform: scale(1.1); }
.m-photo .spoiler-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; background: rgba(0,0,0,.25); }
.m-photo .play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); transition: transform .2s var(--spring); }
.m-photo:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.m-photo .dur { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.m-photo .prog { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 54px; height: 54px; }
.album { display: grid; gap: 3px; border-radius: 14px; overflow: hidden; }
.album .m-photo { border-radius: 4px; }
.m-round { width: 220px; height: 220px; border-radius: 50%; overflow: hidden; position: relative; cursor: pointer; background: #000; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.m-round video { width: 100%; height: 100%; object-fit: cover; }
.m-round svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none; }
.m-file { display: flex; align-items: center; gap: 12px; min-width: 230px; padding: 2px 0; }
.m-file .ficon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.out .m-file .ficon { background: rgba(255,255,255,.22); }
.m-file .fname { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.m-file .fsub { font-size: 12.5px; opacity: .8; margin-top: 2px; }
.m-voice { display: flex; align-items: center; gap: 12px; min-width: 240px; padding: 2px 0; }
.m-voice .play-btn, .m-file .play-btn { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--accent); color: #fff; transition: transform .15s; }
.out .m-voice .play-btn { background: rgba(255,255,255,.22); }
.m-voice .play-btn:active { transform: scale(.9); }
.wave { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; direction: ltr; }
.wave span { display: block; width: 3px; border-radius: 2px; flex-shrink: 0; background: currentColor; opacity: .4; transition: opacity .1s; }
.wave span.p { opacity: 1; }
.in .wave { color: var(--accentText); }
.m-voice .vsub { font-size: 12px; opacity: .85; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.unplayed-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.m-contact { display: flex; align-items: center; gap: 12px; min-width: 220px; padding: 4px 0; cursor: pointer; }
.m-poll { min-width: 260px; max-width: 360px; padding: 4px 2px; }
.m-poll .pq { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.m-poll .ptype { font-size: 12.5px; opacity: .8; margin-bottom: 10px; }
.m-poll .popt { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; width: 100%; text-align: start; }
.m-poll .popt .bar { position: absolute; bottom: 2px; inset-inline-start: 32px; height: 4px; border-radius: 3px; background: currentColor; opacity: .85; transition: width .6s var(--ease); }
.m-poll .popt .pct { width: 22px; font-size: 12.5px; font-weight: 700; flex-shrink: 0; text-align: end; }
.m-poll .pfoot { font-size: 12.5px; opacity: .8; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.m-secret-lock { display: flex; align-items: center; gap: 6px; opacity: .75; font-size: 13px; }

.scroll-down { position: absolute; bottom: 16px; inset-inline-end: 22px; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--muted); box-shadow: 0 6px 20px -6px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 4; transition: transform .25s var(--spring), opacity .2s; }
.scroll-down.hide { transform: scale(.4) translateY(30px); opacity: 0; pointer-events: none; }
.scroll-down .badge { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); animation: none; }
.scroll-down.mention { bottom: 72px; }
.reaction-float { position: fixed; z-index: 400; font-size: 34px; pointer-events: none; animation: rgFloatUp 1.1s ease-out forwards; }

/* composer */
.composer-wrap { flex-shrink: 0; padding: 8px 24px 16px; display: flex; justify-content: center; position: relative; z-index: 3; }
.composer { width: 100%; max-width: 812px; display: flex; align-items: flex-end; gap: 8px; }
.composer .box { flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 20px -12px rgba(0,0,0,.35); overflow: hidden; transition: border-color .2s; }
.composer .box:focus-within { border-color: var(--line2); }
.composer .box-row { display: flex; align-items: flex-end; gap: 2px; padding: 5px 6px; min-height: 52px; }
.composer textarea { flex: 1; resize: none; max-height: 220px; min-height: 40px; padding: 10px 6px; font-size: 15px; line-height: 1.4; overflow-y: auto; scrollbar-width: thin; }
.composer .send { width: 52px; height: 52px; border-radius: 18px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 10px 24px -12px var(--accent); transition: transform .2s var(--spring), background-color .2s; animation: rgScale .25s var(--spring); }
.composer .send:active { transform: scale(.9); }
.composer .send.mic { background: var(--surface); border: 1px solid var(--line); color: var(--accentText); box-shadow: none; }
.composer .send.rec { background: var(--danger); color: #fff; border: 0; }
.composer-ctx { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px 14px; padding-inline: 14px 6px; animation: rgSheet .2s var(--ease); border-bottom: 1px solid var(--line); }
.composer-ctx .ci { color: var(--accentText); flex-shrink: 0; }
.composer-ctx .ct { font-size: 13px; font-weight: 700; color: var(--accentText); }
.composer-ctx .cb { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-bar { flex-shrink: 0; padding: 10px 24px 16px; display: flex; justify-content: center; }
.channel-bar .btn { width: 100%; max-width: 812px; background: var(--surface); color: var(--accentText); border: 1px solid var(--line); }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: rgFade .2s; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rgBlink 1s infinite; flex-shrink: 0; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 48px; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; overflow: hidden; justify-content: flex-end; direction: ltr; }
.rec-wave span { width: 3px; border-radius: 2px; background: var(--accentText); flex-shrink: 0; transition: height .08s; }
.rec-round-preview { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); width: 260px; height: 260px; border-radius: 50%; overflow: hidden; box-shadow: 0 20px 60px -10px rgba(0,0,0,.6); animation: rgScale .3s var(--spring); z-index: 20; background: #000; }
.rec-round-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.mention-list { position: absolute; bottom: 100%; left: 0; right: 0; max-height: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; box-shadow: var(--menuShadow); animation: rgPop .18s var(--ease); z-index: 10; }
.mention-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.mention-item.on, .mention-item:hover { background: var(--hover); }

/* typing */
.typing-bubble { display: flex; justify-content: flex-start; margin: 4px 0; animation: rgMsg .22s var(--ease); }
.typing-bubble > div { padding: 13px 15px; border-radius: 18px; border-end-start-radius: 6px; background: var(--bubbleIn); color: var(--muted); display: flex; gap: 4px; }
.typing-inline { display: inline-flex; gap: 2px; align-items: center; margin-inline-end: 4px; }
.typing-inline .tdot { width: 4px; height: 4px; }

/* info pane */
.info-pane { width: 340px; flex-shrink: 0; flex-direction: column; background: var(--surface); border-inline-start: 1px solid var(--line); display: flex; animation: rgFade .2s; }
.info-head { height: 66px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding-inline: 10px 10px; border-bottom: 1px solid var(--line); }
.info-head h2 { margin: 0; flex: 1; font-size: 17px; font-weight: 700; }
.profile-top { display: flex; flex-direction: column; align-items: center; padding: 24px 20px 18px; text-align: center; }
.profile-top .pname { margin-top: 14px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 6px; justify-content: center; }
.profile-top .pstatus { margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.profile-top .pstatus.on { color: var(--accentText); }
.profile-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.profile-actions .pa { flex: 1; height: 64px; border-radius: 16px; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--accentText); font-size: 12.5px; font-weight: 600; transition: transform .12s, background-color .15s; }
.profile-actions .pa:hover { background: var(--surface3); }
.profile-actions .pa:active { transform: scale(.95); }
.info-rows { padding: 0 8px 6px; }
.info-row { padding: 10px 12px; border-radius: 12px; display: flex; gap: 14px; align-items: flex-start; text-align: start; width: 100%; }
button.info-row:hover { background: var(--hover); }
.info-row .iv { font-size: 15px; line-height: 1.4; word-break: break-word; }
.info-row .il { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.info-row .ii { color: var(--muted); margin-top: 2px; flex-shrink: 0; }
.set-row { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 14px; padding: 6px 16px; text-align: start; transition: background-color .15s; position: relative; }
.set-row:hover { background: var(--hover); }
.set-row:active { background: var(--press); }
.set-row + .set-row::before { content: ''; position: absolute; top: 0; inset-inline-start: 60px; inset-inline-end: 0; height: 1px; background: var(--line); }
.set-row.no-ico + .set-row::before, .set-row.no-ico::before { inset-inline-start: 16px; }
.set-row .sico { width: 30px; height: 30px; border-radius: 9px; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.set-row .stext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-row .st { font-size: 15px; }
.set-row .ss { font-size: 12.5px; color: var(--muted); }
.set-row .sv { font-size: 14px; color: var(--accentText); font-weight: 600; flex-shrink: 0; }
.set-row.danger .st { color: var(--danger); }
.set-row.accent .st { color: var(--accentText); font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 12px 12px 0; position: relative; }
.tab { flex: 1; height: 36px; border-radius: 10px; font-size: 13px; font-weight: 600; text-align: center; color: var(--muted); transition: background-color .2s, color .2s; }
.tab.on { background: var(--accentSoft); color: var(--accentText); }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 12px; }
.media-grid .tile { aspect-ratio: 1; position: relative; overflow: hidden; border-radius: 8px; background: var(--surface2); cursor: pointer; animation: rgFade .3s; }
.media-grid .tile img, .media-grid .tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.media-grid .tile:hover img { transform: scale(1.05); }
.media-grid .tile .dur { position: absolute; bottom: 4px; inset-inline-start: 4px; font-size: 11px; color: #fff; background: rgba(0,0,0,.5); padding: 1px 5px; border-radius: 6px; }
.member-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; text-align: start; }
.member-row:hover { background: var(--hover); }
.member-row .mr-role { font-size: 12.5px; color: var(--accentText); font-weight: 600; }
.key-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; font-size: 22px; text-align: center; padding: 12px; background: var(--surface2); border-radius: 14px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--scrim); animation: rgFade .2s ease; }
.overlay.closing { animation: rgFadeOut .18s ease forwards; }
.dialog { position: relative; width: 100%; max-width: 440px; max-height: 100%; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; animation: rgScale .26s var(--spring); }
.dialog.wide { max-width: 900px; height: 100%; max-height: 680px; }
.dialog.mid { max-width: 560px; }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 18px 14px 10px 22px; padding-inline: 22px 12px; flex-shrink: 0; }
.dialog-head h2 { margin: 0; flex: 1; font-size: 19px; font-weight: 800; }
.dialog-body { padding: 4px 22px 18px; overflow-y: auto; flex: 1; min-height: 0; }
.dialog-body p { line-height: 1.55; margin: 0 0 12px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px 18px; flex-shrink: 0; flex-wrap: wrap; }
.confirm .dialog-body { font-size: 15px; }
.settings-dlg { flex-direction: row; }
.settings-nav { width: 250px; flex-shrink: 0; background: var(--surface2); padding: 22px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.settings-nav h2 { margin: 0 10px 16px; font-size: 20px; font-weight: 800; }
.settings-nav .sn { flex-shrink: 0; height: 44px; border-radius: 12px; display: flex; align-items: center; gap: 12px; padding: 0 10px; font-size: 14.5px; font-weight: 600; transition: background-color .15s; width: 100%; text-align: start; }
.settings-nav .sn:hover { background: var(--hover); }
.settings-nav .sn.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.settings-nav .sn .sico { width: 28px; height: 28px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-main { flex: 1; min-width: 0; padding: 22px 30px 30px; overflow-y: auto; }
.settings-main .sm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.settings-main .sm-head h3 { margin: 0; flex: 1; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.bordered { border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.bordered + .bordered { margin-top: 14px; }
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.theme-card { border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line2); transition: box-shadow .2s, transform .12s; }
.theme-card.on { box-shadow: inset 0 0 0 2px var(--accentText); }
.theme-card .prev { display: flex; height: 80px; border-radius: 12px; overflow: hidden; }
.theme-card .tl { font-weight: 700; font-size: 14px; padding: 0 4px; }
.accent-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.accent-chip { height: 44px; padding-inline: 10px 14px; border-radius: 999px; display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; background: var(--surface2); transition: box-shadow .2s, background-color .2s; }
.accent-chip.on { background: var(--accentSoft); color: var(--accentText); box-shadow: inset 0 0 0 2px var(--accentText); }
.accent-chip .sw { width: 24px; height: 24px; border-radius: 50%; }
.preview-wall { margin-top: 14px; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.lang-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.lang-card { border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line2); text-align: start; transition: box-shadow .2s; }
.lang-card.on { box-shadow: inset 0 0 0 2px var(--accentText); }
.lang-card .lh { display: flex; align-items: center; gap: 10px; width: 100%; }
.lang-card .lg { width: 46px; height: 46px; border-radius: 14px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.lang-card .ld { height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface2); font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; margin-inline-start: auto; }
.lang-card .ln { font-size: 20px; font-weight: 800; }
.lang-card .lp { font-size: 14px; color: var(--muted); }
.device-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface2); }
.device-card.cur { box-shadow: inset 0 0 0 1.5px var(--accentText); }
.device-card .dico { width: 44px; height: 44px; border-radius: 13px; background: var(--accentSoft); color: var(--accentText); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tag { height: 24px; padding: 0 9px; border-radius: 8px; background: var(--accentSoft); color: var(--accentText); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; flex-shrink: 0; }
.tag.green { background: rgba(52,211,153,.15); color: var(--green); }
.tag.red { background: rgba(255,122,122,.14); color: var(--danger); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface2); border-radius: 16px; padding: 14px; }
.stat .sv { font-size: 22px; font-weight: 800; }
.stat .sl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: start; color: var(--muted); font-weight: 700; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--hover); }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }

/* menus */
.menu-layer { position: fixed; inset: 0; z-index: 200; }
.menu { position: fixed; min-width: 220px; max-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: var(--menuShadow); animation: rgScale .18s var(--spring); transform-origin: var(--origin, top left); z-index: 201; backdrop-filter: blur(20px); max-height: calc(100vh - 20px); overflow-y: auto; }
:root[data-theme="dark"] .menu { background: rgba(28,30,44,.96); }
:root[data-theme="light"] .menu { background: rgba(255,255,255,.97); }
.menu-item { width: 100%; height: 42px; display: flex; align-items: center; gap: 14px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; text-align: start; transition: background-color .12s; }
.menu-item:hover, .menu-item.kb { background: var(--hover); }
.menu-item svg { color: var(--muted); flex-shrink: 0; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.react-bar { display: flex; gap: 2px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.react-bar button { width: 38px; height: 38px; border-radius: 50%; font-size: 23px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s var(--spring), background .15s; animation: rgScale .3s var(--spring) both; }
.react-bar button:hover { transform: scale(1.25); background: var(--hover); }
.react-bar button.on { background: var(--accentSoft); }

/* emoji picker */
.emoji-panel { width: 352px; height: 400px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--menuShadow); overflow: hidden; animation: rgPop .2s var(--ease); }
.emoji-tabs { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
.emoji-tabs button { width: 36px; height: 34px; border-radius: 10px; font-size: 19px; display: flex; align-items: center; justify-content: center; opacity: .55; transition: opacity .15s, background .15s; flex-shrink: 0; }
.emoji-tabs button.on { opacity: 1; background: var(--accentSoft); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: 6px 8px; gap: 2px; }
.emoji-grid button { height: 38px; border-radius: 10px; font-size: 25px; display: flex; align-items: center; justify-content: center; transition: transform .12s, background .12s; }
.emoji-grid button:hover { background: var(--hover); transform: scale(1.18); }
.emoji-cat { font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px 2px; grid-column: 1 / -1; position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* toast */
.toasts { position: fixed; bottom: 28px; left: 16px; right: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 500; }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--toast); color: var(--toastText); font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); text-align: center; animation: rgPop .25s var(--spring); max-width: 520px; pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.toast .ta { color: var(--accent); font-weight: 800; }
:root[data-theme="dark"] .toast .ta { color: #5B4CF5; }
.toast.out { animation: rgFadeOut .2s forwards; }
.banner { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: var(--surface2); color: var(--muted); animation: rgFade .2s; }
.banner.warn { background: rgba(247,185,85,.14); color: var(--warn); }

/* media viewer */
.viewer { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.94); display: flex; flex-direction: column; animation: rgFade .2s; color: #fff; touch-action: none; }
.viewer-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: calc(12px + var(--safe-t)); flex-shrink: 0; z-index: 2; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.viewer-top .ib { color: rgba(255,255,255,.85); }
.viewer-top .ib:hover { background: rgba(255,255,255,.12); color: #fff; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s var(--ease); animation: rgScale .28s var(--ease); user-select: none; -webkit-user-drag: none; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; transition: background .15s; }
.viewer-nav:hover { background: rgba(255,255,255,.2); }
.viewer-nav.prev { inset-inline-start: 16px; } .viewer-nav.next { inset-inline-end: 16px; }
.viewer-cap { text-align: center; padding: 12px 20px; padding-bottom: calc(18px + var(--safe-b)); font-size: 15px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }

/* calls */
.call { position: fixed; inset: 0; z-index: 250; background: #0b0c12; color: #fff; display: flex; flex-direction: column; animation: rgFade .25s; overflow: hidden; }
.call-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(50px) saturate(1.4); opacity: .55; transform: scale(1.1); }
.call-bg.grad { background: radial-gradient(800px 500px at 20% 10%, var(--accent), transparent 60%), radial-gradient(700px 500px at 90% 90%, #0E7490, transparent 60%), #0b0c12; opacity: .8; filter: none; }
.call-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 16px; padding-top: calc(14px + var(--safe-t)); }
.call-top .ib { color: rgba(255,255,255,.85); }
.call-top .ib:hover { background: rgba(255,255,255,.12); color: #fff; }
.call-center { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px; }
.call-av { position: relative; }
.call-av .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); animation: rgPulse 2s ease-out infinite; }
.call-av .ring:nth-child(2) { animation-delay: .65s; } .call-av .ring:nth-child(3) { animation-delay: 1.3s; }
.call-av.speaking .avatar { box-shadow: 0 0 0 4px rgba(52,211,153,.8); }
.call-name { font-size: 28px; font-weight: 800; }
.call-status { font-size: 16px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.call-video { position: absolute; inset: 0; z-index: 1; background: #000; }
.call-video video { width: 100%; height: 100%; object-fit: contain; }
.call-video video.cover { object-fit: cover; }
.call-local { position: absolute; z-index: 3; width: 150px; aspect-ratio: 3/4; bottom: 120px; inset-inline-end: 20px; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.5); background: #222; cursor: grab; animation: rgScale .3s var(--spring); touch-action: none; }
.call-local video { width: 100%; height: 100%; object-fit: cover; }
.call-local video.mirror { transform: scaleX(-1); }
.call-controls { position: relative; z-index: 3; display: flex; justify-content: center; gap: 16px; padding: 20px 16px; padding-bottom: calc(28px + var(--safe-b)); flex-wrap: wrap; background: linear-gradient(transparent, rgba(0,0,0,.5)); }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); width: 68px; }
.cbtn .cc { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; transition: transform .15s var(--spring), background .2s; backdrop-filter: blur(10px); }
.cbtn:hover .cc { background: rgba(255,255,255,.24); }
.cbtn:active .cc { transform: scale(.9); }
.cbtn.on .cc { background: #fff; color: #111; }
.cbtn.red .cc { background: #E5484D; color: #fff; }
.cbtn.green .cc { background: #22C55E; color: #fff; animation: rgBeat 1.2s ease-in-out infinite; }
.cbtn.green .cc svg { animation: rgRing 1.2s ease-in-out infinite; }
.call-grid { position: relative; z-index: 1; flex: 1; display: grid; gap: 8px; padding: 8px 12px; align-content: center; min-height: 0; }
.call-tile { position: relative; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; min-height: 0; aspect-ratio: 16/10; transition: box-shadow .2s; animation: rgScale .3s var(--spring); }
.call-tile.speaking { box-shadow: 0 0 0 3px var(--green); }
.call-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call-tile video.contain { object-fit: contain; background: #000; }
.call-tile .tn { position: absolute; bottom: 8px; inset-inline-start: 10px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.call-mini { position: fixed; z-index: 240; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; padding-inline: 16px 8px; border-radius: 999px; background: #22C55E; color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.5); cursor: pointer; animation: rgPop .3s var(--spring); }
.call-mini .ib { width: 32px; height: 32px; color: #fff; background: rgba(0,0,0,.2); border-radius: 50%; }
.quality { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.quality span { width: 3px; border-radius: 1px; background: rgba(255,255,255,.35); }
.quality span.on { background: #fff; }

/* stories */
.stories-row { display: flex; gap: 12px; padding: 4px 16px 12px; }
.story-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 66px; flex-shrink: 0; animation: rgScale .35s var(--spring) both; }
.story-ring { display: block; width: 66px; height: 66px; border-radius: 50%; padding: 2.5px; background: conic-gradient(from 210deg, var(--accent), var(--accentText), #FF957C, var(--accent)); transition: transform .2s var(--spring); }
.story-btn:active .story-ring { transform: scale(.92); }
.story-ring.seen { background: var(--line2); }
.story-ring.none { background: transparent; }
.story-ring > .avatar { width: 100%; height: 100%; border: 2.5px solid var(--bg); }
.list-pane .story-ring > .avatar { border-color: var(--surface); }
.story-btn .sl { font-size: 12px; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.story-btn .add { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 2.5px solid var(--bg); display: flex; align-items: center; justify-content: center; color: #fff; }
.story-viewer { position: fixed; inset: 0; z-index: 320; background: #000; display: flex; align-items: center; justify-content: center; animation: rgFade .2s; color: #fff; }
.story-frame { position: relative; width: 100%; max-width: 440px; height: 100%; max-height: 860px; background: #111; overflow: hidden; display: flex; flex-direction: column; animation: rgScale .3s var(--ease); }
@media (min-width: 640px) { .story-frame { border-radius: 18px; height: calc(100% - 40px); } }
.story-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.story-media img, .story-media video { width: 100%; height: 100%; object-fit: contain; }
.story-bars { position: relative; z-index: 2; display: flex; gap: 4px; padding: 10px 10px 0; padding-top: calc(10px + var(--safe-t)); }
.story-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.story-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.story-bars span.done i { width: 100%; }
.story-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(rgba(0,0,0,.4), transparent); }
.story-cap { position: absolute; bottom: 80px; left: 0; right: 0; z-index: 2; padding: 14px 18px; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.6)); font-size: 15px; line-height: 1.45; }
.story-foot { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px; padding-bottom: calc(12px + var(--safe-b)); }
.story-foot input { flex: 1; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.4); padding: 0 16px; color: #fff; background: rgba(0,0,0,.25); }
.story-foot input::placeholder { color: rgba(255,255,255,.7); }
.story-tap { position: absolute; top: 80px; bottom: 80px; width: 35%; z-index: 1; }
.story-tap.l { left: 0; } .story-tap.r { right: 0; }

/* login */
.login { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; background: var(--bg); }
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: rgFloat 18s ease-in-out infinite; }
@keyframes rgFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, -40px) scale(1.1); } 66% { transform: translate(-40px, 50px) scale(.95); } }
.login-card { position: relative; width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 34px 28px 26px; box-shadow: var(--shadow); animation: rgPop .45s var(--spring); }
.login-card .logo { display: flex; justify-content: center; margin-bottom: 18px; animation: rgLogo .8s var(--spring); }
.login-card h1 { text-align: center; margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.login-card .sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 14.5px; }
.pw-wrap { position: relative; }
.pw-wrap .ib { position: absolute; top: 4px; inset-inline-end: 4px; }
.splash { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); }
.splash svg { animation: rgLogo .8s var(--spring), rgBeat 2s 1s ease-in-out infinite; }

/* mobile shell */
.m-shell { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.m-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.m-screen.push { animation: rgPush .3s var(--ease); box-shadow: -10px 0 40px rgba(0,0,0,.25); z-index: 10; }
[dir="rtl"] .m-screen.push { animation-name: rgPushR; }
.m-screen.leaving { animation: rgFadeOut .2s forwards; }
.m-tabscreen { position: absolute; inset: 0; display: flex; flex-direction: column; animation: rgIn .24s var(--ease); }
.m-head { flex-shrink: 0; padding: 12px 12px 10px 16px; padding-inline: 16px 8px; padding-top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 10px; min-height: 66px; }
.m-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; flex: 1; min-width: 0; }
.m-bar { flex-shrink: 0; height: calc(60px + var(--safe-t)); padding-top: var(--safe-t); display: flex; align-items: center; gap: 2px; padding-inline: 4px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.m-bar h2 { margin: 0; flex: 1; text-align: center; font-size: 17px; font-weight: 700; }
.m-back { height: 44px; min-width: 44px; display: flex; align-items: center; gap: 2px; padding: 0 6px; color: var(--accentText); font-size: 16px; font-weight: 600; }
.m-tabs { flex-shrink: 0; height: calc(64px + var(--safe-b)); padding: 6px 8px; padding-bottom: calc(8px + var(--safe-b)); display: flex; background: var(--surface); border-top: 1px solid var(--line); position: relative; z-index: 5; }
.m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); transition: color .2s; }
.m-tab .ti { position: relative; display: flex; padding: 3px 18px; border-radius: 999px; transition: background-color .25s, transform .2s var(--spring); }
.m-tab.on { color: var(--accentText); }
.m-tab.on .ti { background: var(--accentSoft); transform: scale(1.04); }
.m-tab .badge { position: absolute; top: -5px; inset-inline-start: 34px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 10.5px; font-weight: 800; border: 2px solid var(--surface); }
.m-chatlist .chat-row { border-radius: 0; height: 76px; padding: 0 16px; margin: 0; }
.m-chatlist .chat-row .r-body { height: 100%; justify-content: center; border-bottom: 1px solid var(--line); }
.m-chatlist .chat-row .r-name { font-size: 16px; }
.m-chatlist .chat-row .r-sub { font-size: 14.5px; }
.m-chatlist .chat-row.on { background: var(--hover); color: inherit; }
.m-chatlist .chat-row.on .muted, .m-chatlist .chat-row.on .r-sub, .m-chatlist .chat-row.on .r-time { color: var(--muted) !important; }
.m-chatlist .chat-row.on .badge { background: var(--accent); color: #fff; }
.m-chatlist .chat-row.on .r-sender { color: var(--text); }
.m-chatlist .online-dot { border-color: var(--bg); }
.m-group { margin: 0 16px 16px; border-radius: 18px; background: var(--surface); overflow: hidden; }
.m-group-title { padding: 0 32px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.m-shell .chat-head { height: calc(62px + var(--safe-t)); padding-top: var(--safe-t); padding-inline: 4px 4px; gap: 2px; }
.m-shell .msgs-inner { padding: 10px 10px 8px; }
.m-shell .composer-wrap { padding: 6px 8px; padding-bottom: calc(8px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.m-shell .composer .box { border-radius: 22px; background: var(--surface2); border: 0; box-shadow: none; }
.m-shell .composer .box-row { min-height: 44px; padding: 0 4px 0 6px; }
.m-shell .composer textarea { padding: 11px 6px; font-size: 15.5px; min-height: 44px; }
.m-shell .composer .send { width: 44px; height: 44px; border-radius: 50%; box-shadow: none; }
.m-shell .composer .send.mic { background: transparent; border: 0; color: var(--muted); }
.m-shell .composer-ctx { background: transparent; }
.m-shell .channel-bar { padding: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.m-shell .channel-bar .btn { border: 0; border-radius: 0; height: 56px; max-width: none; }
.m-shell .bubble { max-width: 84%; }
.m-shell .scroll-down { bottom: 12px; inset-inline-end: 12px; }
.m-shell .info-pane { width: 100%; border: 0; }
.swipe-reply { position: absolute; inset-inline-end: -36px; top: 50%; transform: translateY(-50%) scale(.5); width: 32px; height: 32px; border-radius: 50%; background: var(--pill); color: var(--accentText); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .1s, transform .15s; }
.sheet-layer { position: fixed; inset: 0; z-index: 150; background: var(--scrim); animation: rgFade .2s; display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 92%; background: var(--surface); border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); animation: rgSheet .32s var(--ease); display: flex; flex-direction: column; overflow: hidden; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 8px auto 4px; flex-shrink: 0; }
.drawer-layer { position: fixed; inset: 0; z-index: 120; background: var(--scrim); animation: rgFade .2s; display: flex; justify-content: flex-end; }
.drawer { width: 380px; max-width: 100%; height: 100%; background: var(--surface); animation: rgDrawer .28s var(--ease); display: flex; flex-direction: column; box-shadow: var(--shadow); }
[dir="rtl"] .drawer { animation-name: rgDrawerR; }

/* attachment preview */
.att-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.att-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface2); animation: rgScale .25s var(--spring) both; }
.att-item img, .att-item video { width: 100%; height: 100%; object-fit: cover; }
.att-item .rm { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.att-file { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface2); }
.upload-ring { transform: rotate(-90deg); }
.upload-ring circle { transition: stroke-dashoffset .2s; }
.drop-zone { position: absolute; inset: 12px; z-index: 30; border-radius: 22px; border: 2.5px dashed var(--accentText); background: color-mix(in srgb, var(--bg) 85%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--accentText); animation: rgFade .15s; pointer-events: none; }

/* download page */
.dl-page { min-height: 100%; overflow-y: auto; height: 100%; }

/* responsive (design rule 9) */
@media (max-width: 1180px) { .shell .info-pane.docked { display: none; } }
@media (max-width: 880px) { .shell .rail { display: none; } .shell .list-pane { width: 310px; } }
@media (max-width: 640px) {
  .dialog.wide { height: 100%; max-height: none; border-radius: 0; }
  .overlay { padding: 0; }
  .overlay .dialog:not(.wide) { margin: 16px; }
  .settings-dlg { flex-direction: column; }
  .settings-nav { width: auto; flex-direction: row; overflow-x: auto; padding: 10px; }
  .settings-nav h2 { display: none; }
  .settings-nav .sn { width: auto; }
  .settings-main { padding: 18px 16px 24px; }
  .theme-cards { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .lang-cards { grid-template-columns: 1fr; }
  .emoji-panel { width: 100%; border-radius: 20px 20px 0 0; }
  .call-local { width: 110px; bottom: 140px; inset-inline-end: 12px; }
  .cbtn { width: 62px; } .cbtn .cc { width: 56px; height: 56px; }
  .call-controls { gap: 8px; }
}
@media (hover: none) { .m-actions-hover { display: none; } }
