:root {
  --accent: #1f5cff; --accent-2: #0a2cff;
  --bg1: #0b1550; --bg2: #03050f;
  --text: #eef1ff; --text-2: rgba(238,241,255,.66); --text-3: rgba(238,241,255,.42);
  --glass-rgb: 255,255,255; --glass-alpha: .075; --edge: rgba(255,255,255,.14); --edge-2: rgba(255,255,255,.06);
  --fill: rgba(255,255,255,.07); --fill-2: rgba(255,255,255,.12); --hover: rgba(255,255,255,.06);
  --blur: 26px; --shadow: 0 18px 50px rgba(0,0,0,.35);
  --bubble-mine: var(--accent); --bubble-mine-text: #fff;
  --danger: #ff4d5e; --ok: #22c983; --idle: #f5b301; --dnd: #ff4d5e;
  --radius: 22px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2,.9,.25,1); --spring: cubic-bezier(.3,1.35,.45,1);
  --dock-h: 68px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg1: #dfe7ff; --bg2: #f6f7ff;
  --text: #0c1230; --text-2: rgba(12,18,48,.64); --text-3: rgba(12,18,48,.4);
  --glass-alpha: .5; --edge: rgba(255,255,255,.75); --edge-2: rgba(12,18,48,.08);
  --fill: rgba(12,18,48,.06); --fill-2: rgba(12,18,48,.1); --hover: rgba(12,18,48,.05);
  --shadow: 0 18px 50px rgba(30,50,120,.16);
  color-scheme: light;
}
html[data-theme="black"] {
  --bg1: #000; --bg2: #000; --glass-alpha: .06; --edge: rgba(255,255,255,.12);
  --fill: rgba(255,255,255,.07); --shadow: none;
}
html[data-custom] body { background: linear-gradient(180deg, var(--bg1), var(--bg2)) fixed; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.42 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text);
  background: linear-gradient(180deg, var(--bg1), var(--bg2)) fixed; overflow: hidden;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: manipulation;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--fill-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }

/* background blobs */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.b1 { width: 60vmax; height: 60vmax; left: -18vmax; top: -22vmax; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 70%, transparent), transparent 65%); }
.b2 { width: 50vmax; height: 50vmax; right: -16vmax; top: 22vh; background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 60%, #7a3cff 20%), transparent 65%); opacity: .4; }
.b3 { width: 46vmax; height: 46vmax; left: 10vw; bottom: -26vmax; background: radial-gradient(circle, #00b4ff55, transparent 65%); opacity: .35; }
html[data-theme="black"] .blob { opacity: .16; }
html[data-theme="light"] .blob { opacity: .5; }

#root { position: relative; z-index: 1; height: 100%; }
.boot { height: 100%; display: grid; place-items: center; }

/* glass */
.glass {
  background: rgba(var(--glass-rgb), var(--glass-alpha));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.7);
  backdrop-filter: blur(var(--blur)) saturate(1.7);
  border: 1px solid var(--edge-2);
  box-shadow: inset 0 1px 0 0 var(--edge), inset 0 0 0 1px rgba(255,255,255,.03), var(--shadow);
}
.glass.lensed { backdrop-filter: var(--lens) blur(calc(var(--blur) * .55)) saturate(1.8); }
html[data-theme="black"] .glass { background: rgba(18,18,22,.55); }
.soft { background: var(--fill); border-radius: 16px; }

/* buttons, fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; background: var(--fill); transition: transform .18s var(--spring), background .2s, opacity .2s; white-space: nowrap; }
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff 8%), var(--accent)); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--edge-2); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ic { margin-left: -4px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text-2); transition: background .2s, color .2s, transform .18s var(--spring); flex: none; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.on { color: var(--accent); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.filled { background: var(--fill); color: var(--text); }
.field { width: 100%; min-height: 46px; padding: 12px 15px; border-radius: 15px; border: 1px solid var(--edge-2); background: var(--fill); outline: none; transition: border-color .2s, background .2s, box-shadow .2s; resize: none; }
.field:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--fill-2); }
.field::placeholder { color: var(--text-3); }
textarea.field { min-height: 90px; line-height: 1.45; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
select.field option { background: #111526; color: #fff; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 14px 2px 6px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-buttons { display: flex; gap: 10px; justify-content: flex-end; }
.row-buttons .btn { flex: 1; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small-text { font-size: 13px; }
.center { text-align: center; }
.error-text { color: var(--danger); font-size: 13.5px; min-height: 18px; }
.empty { padding: 50px 20px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ic { opacity: .5; }
.spin { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--text-2); }

/* toggle */
.toggle { position: relative; width: 48px; height: 29px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--fill-2); transition: background .25s; }
.toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .3s var(--spring), width .2s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(19px); }
.toggle input:active + i::after { width: 28px; }
.toggle input:checked:active + i::after { transform: translateX(14px); }

/* segmented */
.seg { position: relative; display: flex; padding: 4px; border-radius: 999px; background: var(--fill); gap: 2px; }
.seg button { position: relative; z-index: 1; flex: 1; height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: color .25s; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { color: var(--text); }
.seg .seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: rgba(var(--glass-rgb), .14); box-shadow: inset 0 1px 0 var(--edge), 0 4px 14px rgba(0,0,0,.18); transition: transform .45s var(--spring), width .45s var(--spring); }
html[data-theme="light"] .seg .seg-thumb { background: rgba(255,255,255,.9); }
.seg.small button { height: 30px; font-size: 13px; }
.seg:not(:has(.seg-thumb)) button.on { background: rgba(var(--glass-rgb), .14); }
.seg .badge { height: 17px; min-width: 17px; font-size: 10.5px; }

/* avatars & names */
.av { --s: 40px; position: relative; width: var(--s); height: var(--s); flex: none; border-radius: 50%; background: var(--av-bg, linear-gradient(135deg, #3a63ff, #1f2fb8)); display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) * .38); user-select: none; }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.av.shape-squircle { border-radius: 30%; }
.av.shape-square { border-radius: 12%; }
.av.shape-hex img, .av.shape-hex { border-radius: 0; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.av.shape-hex .presence { clip-path: none; }
.av.ringed { box-shadow: 0 0 0 calc(var(--s) * .05) var(--bg2), 0 0 0 calc(var(--s) * .1) var(--ring, var(--accent)); }
.av-letters { line-height: 1; }
.presence { position: absolute; right: -1px; bottom: -1px; width: max(10px, calc(var(--s) * .3)); height: max(10px, calc(var(--s) * .3)); border-radius: 50%; border: max(2px, calc(var(--s) * .065)) solid var(--bg2); background: #6b7280; }
.presence[data-state="online"] { background: var(--ok); }
.presence[data-state="idle"] { background: var(--idle); }
.presence[data-state="dnd"] { background: var(--dnd); }
.presence[data-state="offline"] { background: #6b7280; }
html[data-theme="light"] .presence { border-color: #fff; }
.nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-icon { --s: 44px; width: var(--s); height: var(--s); flex: none; border-radius: 30%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: calc(var(--s) * .38); overflow: hidden; }
.chat-icon img { width: 100%; height: 100%; object-fit: cover; }
.chat-icon.group { border-radius: 50%; }
.stack-av { position: relative; width: 44px; height: 44px; flex: none; }
.stack-av .av { position: absolute; --s: 30px; box-shadow: 0 0 0 2px var(--bg2); }
.stack-av .av:first-child { left: 0; top: 0; }
.stack-av .av:last-child { right: 0; bottom: 0; }

/* shell & nav */
.shell { height: 100%; }
.views { position: relative; height: 100%; }
.view { position: absolute; inset: 0; display: none; }
.view.on { display: block; }
.nav { position: fixed; z-index: 30; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); height: var(--dock-h); padding: 7px; border-radius: 999px; display: flex; align-items: center; transition: transform .45s var(--ease), opacity .3s; }
.nav-logo { display: none; }
.nav-items { position: relative; display: flex; gap: 4px; }
.nav-btn { position: relative; z-index: 1; width: 86px; height: 54px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); transition: color .25s, transform .25s var(--spring); }
.nav-btn:active { transform: scale(.9); }
.nav-btn.on { color: var(--text); }
.nav-btn .nav-label { font-size: 11px; font-weight: 600; }
.nav-btn .nav-ic { height: 28px; display: grid; place-items: center; transition: transform .35s var(--spring); }
.nav-btn.on .nav-ic { transform: translateY(-1px) scale(1.06); }
.nav-btn .av { --s: 26px !important; font-size: 10px; transition: box-shadow .3s; }
.nav-btn.on .av { box-shadow: 0 0 0 2px var(--text); }
.nav-btn .nav-dot { position: absolute; top: 6px; right: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg2); }
.droplet { position: absolute; z-index: 0; left: 0; top: 0; border-radius: 999px; background: rgba(var(--glass-rgb), .13); box-shadow: inset 0 1px 0 var(--edge), inset 0 -1px 0 rgba(255,255,255,.04), 0 6px 18px rgba(0,0,0,.2); }
html[data-theme="light"] .droplet { background: rgba(255,255,255,.75); }
body.dock-hidden .nav { transform: translate(-50%, calc(100% + 30px)); opacity: 0; pointer-events: none; }

@media (min-width: 900px) {
  :root { --dock-h: 0px; }
  .nav { left: 14px; top: 14px; bottom: 14px; transform: none; width: 84px; height: auto; flex-direction: column; justify-content: flex-start; padding: 14px 7px; border-radius: 30px; gap: 18px; }
  .nav-logo { display: block; }
  .nav-items { flex-direction: column; }
  .nav-btn { width: 70px; height: 66px; border-radius: 22px; }
  .droplet { border-radius: 22px !important; }
  .nav-btn .nav-dot { right: 14px; top: 8px; }
  .views { margin-left: 112px; }
  body.dock-hidden .nav { transform: none; opacity: 1; pointer-events: auto; }
}

/* pages */
.page { height: 100%; display: flex; flex-direction: column; }
.page-head { position: relative; z-index: 5; padding: calc(12px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 8px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; flex: 1; }
.page-head h2 { margin: 0; font-size: 18px; font-weight: 750; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scroll.padded { padding: 4px 12px calc(var(--dock-h) + 30px + var(--safe-b)); }
@media (min-width: 900px) { .scroll.padded { padding-bottom: 30px; } .page-head { padding-top: 22px; } }

/* chats layout */
.chats-page { height: 100%; display: flex; }
.chat-list-pane { width: 100%; height: 100%; display: flex; flex-direction: column; }
.chat-list-pane .seg { margin: 0 16px 8px; }
.conv-pane { position: fixed; inset: 0; z-index: 25; display: flex; transform: translateX(100%); transition: transform .42s var(--ease); background: linear-gradient(180deg, var(--bg1), var(--bg2)); }
.conv-pane.open { transform: none; }
.conv-pane .conv-empty { display: none; }
@media (min-width: 900px) {
  .chats-page { padding: 14px 14px 14px 0; gap: 14px; }
  .chat-list-pane { width: 360px; flex: none; border-radius: 30px; overflow: hidden; }
  .conv-pane { position: relative; inset: auto; flex: 1; transform: none; transition: none; border-radius: 30px; overflow: hidden; background: rgba(var(--glass-rgb), calc(var(--glass-alpha) * .6)); border: 1px solid var(--edge-2); }
  .conv-pane .conv-empty { display: flex; flex: 1; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--text-3); }
  .conv-pane .conv-empty .logo { opacity: .9; }
}
.list-section { margin: 14px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.list-section .grow + * { text-transform: none; letter-spacing: 0; }
.chat-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; text-align: left; transition: background .2s, transform .2s var(--spring); position: relative; }
.chat-row:hover { background: var(--hover); }
.chat-row:active { transform: scale(.985); }
.chat-row.on { background: rgba(var(--glass-rgb), .12); box-shadow: inset 0 1px 0 var(--edge-2); }
.chat-row .cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-row .cr-top { display: flex; align-items: baseline; gap: 8px; }
.chat-row .cr-top .nm, .chat-row .cr-title { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .cr-time { font-size: 12px; color: var(--text-3); flex: none; }
.chat-row .cr-sub { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.chat-row.unread .cr-title, .chat-row.unread .cr-top .nm { font-weight: 800; }
.chat-row.unread .cr-sub { color: var(--text); font-weight: 600; }
.chat-row .unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 10px var(--accent); }
.chat-row .row-actions { display: flex; gap: 4px; }

/* conversation */
.conv { flex: 1; min-width: 0; display: flex; height: 100%; }
.conv-side { width: 100%; flex: none; display: flex; flex-direction: column; height: 100%; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; position: relative; }
.conv.has-side .conv-main { position: absolute; inset: 0; transform: translateX(100%); transition: transform .4s var(--ease); background: linear-gradient(180deg, var(--bg1), var(--bg2)); z-index: 2; }
.conv.has-side.channel-open .conv-main { transform: none; }
@media (min-width: 900px) {
  .conv.has-side .conv-side { width: 260px; border-right: 1px solid var(--edge-2); background: rgba(0,0,0,.08); }
  html[data-theme="light"] .conv.has-side .conv-side { background: rgba(255,255,255,.25); }
  .conv.has-side .conv-main { position: relative; transform: none; transition: none; background: none; }
  .conv-side .side-back { display: none; }
}
.conv-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 10px 10px; border-bottom: 1px solid var(--edge-2); position: relative; z-index: 3; min-height: 64px; }
@media (min-width: 900px) { .conv-head { padding-top: 10px; } .conv-head .back-btn.mobile-only { display: none; } }
.conv-head .head-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; border-radius: 14px; padding: 4px 6px; }
.conv-head .head-title:hover { background: var(--hover); }
.conv-head .head-text { min-width: 0; display: flex; flex-direction: column; }
.conv-head .head-text b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-head .head-text small { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-banner { height: 110px; flex: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)) center/cover; position: relative; }
.community-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.45)); }
.community-banner .cb-title { position: absolute; left: 14px; right: 50px; bottom: 10px; z-index: 1; color: #fff; font-weight: 800; font-size: 18px; text-shadow: 0 2px 10px rgba(0,0,0,.4); display: flex; align-items: center; gap: 6px; }
.community-banner .cb-btn { position: absolute; z-index: 1; right: 8px; bottom: 6px; color: #fff; }
.community-banner .side-back { position: absolute; z-index: 1; left: 8px; top: calc(8px + var(--safe-t)); color: #fff; background: rgba(0,0,0,.25); }
.channel-list { flex: 1; overflow-y: auto; padding: 8px 8px 30px; }
.channel-cat { display: flex; align-items: center; gap: 4px; margin: 14px 6px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); width: calc(100% - 12px); text-align: left; }
.channel-cat .ic { transition: transform .25s; }
.channel-cat.collapsed .ic:first-child { transform: rotate(-90deg); }
.channel-row { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; color: var(--text-2); text-align: left; font-weight: 550; transition: background .15s, color .15s; }
.channel-row:hover { background: var(--hover); color: var(--text); }
.channel-row.on { background: rgba(var(--glass-rgb), .12); color: var(--text); }
.channel-row.unread { color: var(--text); font-weight: 750; }
.channel-row .ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-row .ch-mention { background: var(--danger); }
.voice-occupants { padding: 0 0 4px 34px; display: flex; flex-direction: column; gap: 3px; }
.voice-occupants .vo { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.voice-occupants .vo .ic { opacity: .6; }

.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px 8px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.messages .msg-top { margin-top: auto; }
.day-sep { align-self: center; margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 3px 11px; border-radius: 99px; background: var(--fill); }
.msg { display: flex; gap: 9px; padding: 1px 4px; position: relative; max-width: 100%; animation: msgIn .35s var(--spring); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.msg.first { margin-top: 10px; }
.msg .msg-av { width: 34px; flex: none; }
.msg .msg-av .av { --s: 34px; cursor: pointer; }
.msg .msg-body { min-width: 0; max-width: min(78%, 620px); display: flex; flex-direction: column; align-items: flex-start; }
.msg .msg-meta { display: flex; align-items: baseline; gap: 7px; margin: 0 0 2px 4px; font-size: 13px; }
.msg .msg-meta .nm { cursor: pointer; }
.msg .msg-meta time { font-size: 11px; color: var(--text-3); }
.msg .role-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; font-weight: 700; background: color-mix(in srgb, var(--rc, var(--accent)) 22%, transparent); color: var(--rc, var(--accent)); }
.bubble { position: relative; padding: 8px 13px; border-radius: 20px; background: rgba(var(--glass-rgb), .1); box-shadow: inset 0 1px 0 var(--edge-2); word-wrap: break-word; overflow-wrap: anywhere; max-width: 100%; user-select: text; }
html[data-theme="light"] .bubble { background: rgba(255,255,255,.7); }
.msg:not(.first) .bubble { border-top-left-radius: 8px; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .bubble { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, #fff 10%), var(--accent)); color: var(--bubble-mine-text); box-shadow: none; }
.msg.mine:not(.first) .bubble { border-top-left-radius: 20px; border-top-right-radius: 8px; }
.msg.mine .bubble a { color: #fff; text-decoration: underline; }
.msg.mine .msg-av { display: none; }
.msg.mentioned .bubble { box-shadow: inset 0 0 0 1.5px var(--idle); }
.bubble.emoji-only { background: none !important; box-shadow: none !important; font-size: 40px; line-height: 1.15; padding: 0 4px; }
.bubble code { background: rgba(0,0,0,.2); padding: 1px 5px; border-radius: 6px; font-size: .92em; }
.bubble .edited { font-size: 11px; opacity: .55; margin-left: 4px; }
.bubble img.msg-img { max-width: min(280px, 100%); max-height: 340px; border-radius: 14px; margin: 3px -7px; cursor: zoom-in; object-fit: cover; }
.bubble.has-img { padding: 6px; }
.bubble.has-img img.msg-img { margin: 0; }
.bubble.has-img .bubble-text { padding: 4px 6px 2px; }
.mention { background: color-mix(in srgb, var(--accent) 25%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); padding: 0 3px; border-radius: 5px; font-weight: 600; cursor: pointer; }
.mention.me { background: color-mix(in srgb, var(--idle) 28%, transparent); color: var(--idle); }
.msg.mine .mention { background: rgba(255,255,255,.22); color: #fff; }
.reply-quote { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin: 0 6px 3px; max-width: 100%; cursor: pointer; }
.reply-quote::before { content: ""; width: 14px; height: 9px; border: 2px solid var(--text-3); border-right: 0; border-bottom: 0; border-top-left-radius: 8px; flex: none; margin-top: 6px; opacity: .6; }
.reply-quote span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--fill); font-size: 13px; box-shadow: inset 0 0 0 1px var(--edge-2); transition: transform .2s var(--spring); }
.reaction:active { transform: scale(.88); }
.reaction.on { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.reaction b { font-size: 12px; font-weight: 700; }
.msg-tools { position: absolute; top: -14px; right: 12px; display: none; gap: 2px; padding: 3px; border-radius: 14px; z-index: 4; }
.msg.mine .msg-tools { right: auto; left: 12px; }
@media (hover: hover) { .msg:hover .msg-tools { display: flex; } .msg:hover { background: var(--hover); border-radius: 12px; } }
.msg.highlight { animation: flash 1.4s; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 12px; } }
.system-msg { align-self: center; font-size: 12.5px; color: var(--text-3); margin: 8px 0; display: flex; align-items: center; gap: 6px; }
.typing { height: 22px; padding: 0 18px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: dot 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.load-more { align-self: center; margin: 8px; }

.composer-wrap { padding: 6px 10px calc(10px + var(--safe-b)); position: relative; }
@media (min-width: 900px) { .composer-wrap { padding-bottom: 12px; } }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 5px; border-radius: 26px; }
.composer textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; resize: none; padding: 10px 6px; max-height: 160px; line-height: 1.4; }
.composer .send-btn { background: var(--accent); color: #fff; transition: transform .25s var(--spring), opacity .2s, background .2s; }
.composer .send-btn:hover { background: var(--accent); filter: brightness(1.1); color: #fff; }
.composer .send-btn[disabled] { opacity: .35; transform: scale(.85); }
.composer-note { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px; font-size: 13px; color: var(--text-2); }
.composer-note .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-preview { padding: 6px 8px 2px; display: flex; gap: 8px; }
.composer-preview .thumb { position: relative; }
.composer-preview img { width: 70px; height: 70px; object-fit: cover; border-radius: 14px; }
.composer-preview .icon-btn { position: absolute; top: -8px; right: -8px; background: var(--bg2); width: 26px; height: 26px; }
.composer-locked { padding: 14px; text-align: center; color: var(--text-3); font-size: 13.5px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.mention-pop { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 2px); border-radius: 18px; padding: 5px; max-height: 240px; overflow-y: auto; z-index: 6; }
.mention-pop button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 12px; text-align: left; }
.mention-pop button.on, .mention-pop button:hover { background: var(--hover); }
.emoji-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-pick button { font-size: 26px; height: 44px; border-radius: 12px; transition: transform .2s var(--spring), background .2s; }
.emoji-pick button:hover { background: var(--hover); transform: scale(1.15); }
.quick-react { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 8px; padding: 4px; border-radius: 20px; background: var(--fill); }
.quick-react button { font-size: 26px; flex: 1; height: 48px; border-radius: 14px; transition: transform .2s var(--spring); }
.quick-react button:active { transform: scale(1.3); }

/* forum / board */
.board { flex: 1; overflow-y: auto; padding: 10px 12px 30px; }
.board-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px 0; flex-wrap: wrap; }
.board-bar .field { min-height: 38px; padding: 8px 13px; flex: 1; min-width: 140px; }
.tag-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-chip { height: 28px; padding: 0 11px; border-radius: 99px; background: var(--fill); font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.tag-chip.on { background: var(--accent); color: #fff; }
.board-card { width: 100%; text-align: left; display: block; padding: 14px; border-radius: 22px; margin-bottom: 10px; transition: transform .2s var(--spring); }
.board-card:active { transform: scale(.99); }
.board-card h3 { margin: 6px 0 4px; font-size: 17px; line-height: 1.25; }
.board-card .bc-text { color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.board-card .bc-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; margin-top: 8px; }
.board-card .bc-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-3); }
.board-card .bc-foot span { display: inline-flex; align-items: center; gap: 5px; }
.board-card.pinned { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent), var(--shadow); }
.board-card.announcement h3 { font-size: 19px; }
.board-card .bc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.board-card .bc-head time { color: var(--text-3); }
.pending-tag { color: var(--idle); }

/* voice */
.voice-stage { flex: 1; overflow-y: auto; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; align-content: start; }
.voice-tile { aspect-ratio: 1; border-radius: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; position: relative; padding: 10px; }
.voice-tile .av { --s: 72px; transition: box-shadow .12s; }
.voice-tile.speaking .av { box-shadow: 0 0 0 3px var(--ok), 0 0 24px color-mix(in srgb, var(--ok) 60%, transparent); }
.voice-tile .vt-name { font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.voice-tile .vt-state { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; color: var(--danger); }
.voice-tile .vt-volume { width: 80%; }
.voice-controls { display: flex; justify-content: center; gap: 12px; padding: 14px 14px calc(16px + var(--safe-b)); }
.voice-controls .icon-btn { width: 56px; height: 56px; background: var(--fill-2); color: var(--text); }
.voice-controls .icon-btn.off { background: var(--text); color: var(--bg2); }
.voice-controls .icon-btn.hangup { background: var(--danger); color: #fff; }
.voice-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; flex: 1; padding: 30px; text-align: center; }
.voice-join .occupant-row { display: flex; gap: -6px; }
.voice-join .occupant-row .av { margin-left: -8px; box-shadow: 0 0 0 3px var(--bg2); }
.voice-bar { position: fixed; z-index: 35; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + 22px + var(--safe-b)); display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 999px; max-width: calc(100vw - 24px); animation: barIn .45s var(--spring); }
@keyframes barIn { from { transform: translate(-50%, 30px); opacity: 0; } }
body.dock-hidden .voice-bar { bottom: calc(86px + var(--safe-b)); }
@media (min-width: 900px) { .voice-bar { left: auto; right: 24px; transform: none; bottom: 24px; } @keyframes barIn { from { transform: translateY(30px); opacity: 0; } } body.dock-hidden .voice-bar { bottom: 24px; } }
.voice-bar .vb-text { display: flex; flex-direction: column; min-width: 0; margin-right: 6px; cursor: pointer; }
.voice-bar .vb-text b { font-size: 13px; color: var(--ok); display: flex; align-items: center; gap: 5px; }
.voice-bar .vb-text small { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.voice-bar .icon-btn.off { color: var(--danger); }
.voice-bar .icon-btn.hangup { background: var(--danger); color: #fff; }
.call-banner { margin: 8px 10px 0; padding: 10px 12px; border-radius: 20px; display: flex; align-items: center; gap: 10px; }
.call-banner .grow b { display: block; font-size: 14px; }
.call-banner .grow small { color: var(--text-2); font-size: 12.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* posts */
.feed { max-width: 620px; margin: 0 auto; }
.feed-head { position: sticky; top: 0; }
.post { border-radius: 28px; margin: 0 0 14px; overflow: hidden; animation: msgIn .45s var(--ease); }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px; }
.post-head .ph-text { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.post-head .ph-text small { color: var(--text-3); font-size: 12.5px; }
.post-media { position: relative; user-select: none; background: rgba(0,0,0,.15); }
.post-media img { width: 100%; max-height: 78vh; object-fit: cover; }
.post-text { padding: 2px 16px 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; }
.post-text.big { font-size: 22px; font-weight: 650; line-height: 1.3; padding: 18px 18px 12px; letter-spacing: -.01em; }
.post-text .tag-link { color: var(--accent); font-weight: 600; }
.post-actions { display: flex; align-items: center; gap: 2px; padding: 4px 8px 10px; }
.post-actions .icon-btn.liked { color: #ff3b5c; }
.post-actions .count { font-weight: 650; font-size: 14px; margin-right: 10px; }
.post-actions .icon-btn.liked .ic { animation: pop .45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.35); } }
.burst { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px 0 0 -55px; color: #fff; pointer-events: none; filter: drop-shadow(0 6px 20px rgba(255,40,80,.6)); animation: burst .9s var(--spring) forwards; z-index: 3; }
.burst svg { width: 100%; height: 100%; color: #ff3b5c; }
@keyframes burst { 0% { transform: scale(.2); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 55% { transform: scale(.95); opacity: 1; } 100% { transform: scale(1.3) translateY(-30px); opacity: 0; } }
.post-text-wrap { position: relative; }
.compose-post textarea { min-height: 130px; font-size: 17px; }
.compose-img img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 18px; }
.compose-img { position: relative; }
.compose-img .icon-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.5); color: #fff; }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .grow { display: flex; flex-direction: column; gap: 1px; }
.comment small { color: var(--text-3); }
.feed-end { text-align: center; color: var(--text-3); padding: 20px; font-size: 13px; }
.new-posts { position: sticky; top: 60px; z-index: 4; display: flex; justify-content: center; height: 0; overflow: visible; }
.new-posts .btn { transform: translateY(6px); }

/* profile */
.profile-card { border-radius: 30px; overflow: hidden; position: relative; isolation: isolate; }
.profile-card .fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.pc-banner { height: 150px; background: linear-gradient(135deg, var(--pc-accent, var(--accent)), var(--pc-accent2, var(--accent-2))) center/cover; position: relative; }
.pc-body { padding: 0 18px 18px; position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--pc-accent, var(--accent)) 16%, transparent), transparent 70%); }
.pc-avatar { margin-top: -48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.pc-avatar .av { --s: 96px; box-shadow: 0 0 0 5px var(--bg2); }
.pc-avatar .av.ringed { box-shadow: 0 0 0 4px var(--bg2), 0 0 0 8px var(--ring, var(--accent)); }
.pc-name { margin-top: 10px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.pc-un { color: var(--text-3); font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pc-status { margin-top: 10px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 16px; background: var(--fill); font-size: 14px; max-width: 100%; }
.pc-status .presence { position: static; border: 0; width: 9px; height: 9px; flex: none; }
.pc-bio { margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 14.5px; }
.pc-stats { display: flex; gap: 18px; margin-top: 14px; font-size: 14px; color: var(--text-2); }
.pc-stats b { color: var(--text); font-weight: 750; margin-right: 3px; }
.pc-stats button { color: inherit; }
.pc-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pc-actions .btn { flex: 1; min-width: 110px; }
.account-page .scroll { padding-top: 6px; }
.account-wrap { max-width: 620px; margin: 0 auto; }
.settings-group { border-radius: 24px; overflow: hidden; margin-top: 14px; }
.setting { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-align: left; min-height: 54px; }
.setting + .setting { border-top: 1px solid var(--edge-2); }
button.setting:hover { background: var(--hover); }
.setting .grow { display: flex; flex-direction: column; }
.setting .grow small { color: var(--text-3); font-size: 12.5px; }
.setting.danger { color: var(--danger); }
.setting > .ic:first-child { color: var(--text-2); }
.setting.danger > .ic:first-child { color: var(--danger); }
.my-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 14px; border-radius: 20px; overflow: hidden; }
.my-posts button { aspect-ratio: 1; background: var(--fill) center/cover; position: relative; overflow: hidden; padding: 8px; font-size: 12px; text-align: left; color: var(--text-2); }
.my-posts button span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* editor */
.editor { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .editor { grid-template-columns: 1fr 360px; align-items: start; } .editor .preview-col { position: sticky; top: 0; } }
.editor .preview-col .profile-card { box-shadow: var(--shadow); }
.media-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; }
.color-row input[type="color"] { width: 46px; height: 32px; border: 0; padding: 0; background: none; border-radius: 10px; cursor: pointer; }
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type="color"]::-webkit-color-swatch { border: 1px solid var(--edge-2); border-radius: 10px; }
.range-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.range-row span { width: 70px; flex: none; }
input[type="range"] { flex: 1; accent-color: var(--accent); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 36px; padding: 0 13px; border-radius: 99px; background: var(--fill); font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: background .2s, color .2s, transform .2s var(--spring); display: inline-flex; align-items: center; gap: 6px; }
.chip:active { transform: scale(.94); }
.chip.on { background: var(--accent); color: #fff; }
.accent-dots { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 4px; }
.dot-pick { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); transition: transform .2s var(--spring); }
.dot-pick:hover { transform: scale(1.12); }
.dot-pick.on { box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--c); }
.effect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.effect-grid button { height: 64px; border-radius: 16px; background: var(--fill); position: relative; overflow: hidden; font-size: 12.5px; font-weight: 600; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; isolation: isolate; }
.effect-grid button .fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.effect-grid button.on { box-shadow: inset 0 0 0 2px var(--accent); }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.font-grid button { height: 46px; border-radius: 14px; background: var(--fill); font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 8px; }
.font-grid button.on { box-shadow: inset 0 0 0 2px var(--accent); }
.editor-sec { border-radius: 24px; padding: 14px; }
.editor-sec + .editor-sec { margin-top: 12px; }
.editor-sec h3 { margin: 0 0 10px; font-size: 15px; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(180deg, transparent, var(--sheet-bg, transparent) 40%); z-index: 3; }

/* theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .theme-grid { grid-template-columns: repeat(4, 1fr); } }
.theme-card { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 10px 10px 12px; border-radius: 22px; background: var(--fill); font-weight: 650; transition: transform .25s var(--spring), box-shadow .25s; }
.theme-card:hover { transform: translateY(-2px); }
.theme-card.on { box-shadow: inset 0 0 0 2px var(--accent); }
.theme-swatch { width: 100%; aspect-ratio: 1.2; border-radius: 14px; position: relative; overflow: hidden; display: block; }
.theme-swatch i { position: absolute; border-radius: 8px; }
.theme-swatch i:nth-child(1) { left: 12%; right: 30%; top: 16%; height: 18%; }
.theme-swatch i:nth-child(2) { left: 30%; right: 12%; top: 42%; height: 18%; }
.theme-swatch i:nth-child(3) { left: 20%; right: 20%; bottom: 10%; height: 14%; border-radius: 99px; }
.sw-light { background: linear-gradient(180deg, #dfe7ff, #f6f7ff); } .sw-light i { background: rgba(255,255,255,.9); } .sw-light i:nth-child(2) { background: #1f5cff; }
.sw-dark { background: linear-gradient(180deg, #0b1550, #03050f); } .sw-dark i { background: rgba(255,255,255,.14); } .sw-dark i:nth-child(2) { background: #1f5cff; }
.sw-black { background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); } .sw-black i { background: rgba(255,255,255,.1); } .sw-black i:nth-child(2) { background: #1f5cff; }
.sw-custom { background: conic-gradient(from 200deg, #7a5cff, #ff4f8b, #ff7a2f, #16b980, #00b4d8, #7a5cff); } .sw-custom i { background: rgba(255,255,255,.35); }
.custom-theme { margin-top: 14px; padding: 12px; border-radius: 20px; background: var(--fill); display: flex; flex-direction: column; gap: 2px; }
.custom-theme .seg { margin-bottom: 6px; }

/* auth / onboarding */
.center-screen { height: 100%; overflow-y: auto; display: flex; padding: calc(24px + var(--safe-t)) 18px calc(24px + var(--safe-b)); }
.center-screen > .card { margin: auto; width: 100%; max-width: 420px; border-radius: 34px; padding: 30px 24px 24px; animation: cardIn .6s var(--ease); }
.center-screen > .card.wide { max-width: 720px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand .logo { filter: drop-shadow(0 12px 30px rgba(0,60,255,.45)); }
.brand h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--edge-2); }
.text-btn { color: var(--accent); font-weight: 600; font-size: 14px; }
.text-btn.muted { color: var(--text-2); }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 6px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps i { width: 26px; height: 5px; border-radius: 9px; background: var(--fill-2); transition: background .3s, width .3s var(--spring); }
.steps i.on { background: var(--accent); width: 40px; }
.card h2.step-title { text-align: center; margin: 0 0 18px; font-size: 24px; letter-spacing: -.02em; }
.avatar-pick { align-self: center; position: relative; }
.avatar-pick .av { --s: 104px; }
.avatar-pick .cam { position: absolute; right: -2px; bottom: -2px; background: var(--accent); color: #fff; width: 36px; height: 36px; box-shadow: 0 0 0 3px var(--bg2); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-prefix .field { padding-left: 32px; }
.input-state { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.input-state.ok { color: var(--ok); } .input-state.bad { color: var(--danger); }

/* sheets */
#layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#layer > * { pointer-events: auto; }
.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.38); opacity: 0; transition: opacity .35s; }
html[data-theme="light"] .scrim { background: rgba(20,30,70,.22); }
.sheet-wrap.in .scrim { opacity: 1; }
.sheet { --sheet-bg: color-mix(in srgb, var(--bg2) 70%, transparent); position: relative; width: 100%; max-height: calc(100% - 40px - var(--safe-t)); display: flex; flex-direction: column; border-radius: 32px 32px 0 0; transform: translateY(105%); transition: transform .45s var(--ease); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--bg2) 55%, rgba(var(--glass-rgb), .08)); }
html[data-theme="light"] .sheet { background: rgba(255,255,255,.78); --sheet-bg: rgba(250,251,255,.95); }
.sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.out .sheet { transform: translateY(105%); transition-duration: .32s; }
.sheet-wrap.full .sheet { height: calc(100% - 20px - var(--safe-t)); }
.grabber { width: 40px; height: 5px; border-radius: 9px; background: var(--fill-2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 6px 20px; flex: none; min-height: 50px; touch-action: none; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 19px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head span { flex: 1; }
.sheet-body { overflow-y: auto; padding: 4px 20px 22px; flex: 1; overscroll-behavior: contain; }
.sheet-body.flush { padding: 0; }
@media (min-width: 900px) {
  .sheet-wrap { align-items: center; padding: 30px; }
  .sheet { width: 480px; border-radius: 32px; max-height: calc(100vh - 60px); transform: translateY(20px) scale(.96); opacity: 0; transition: transform .4s var(--spring), opacity .25s; padding-bottom: 0; }
  .sheet-wrap.wide .sheet { width: 760px; }
  .sheet-wrap.full .sheet { width: min(1020px, 100%); height: calc(100vh - 60px); }
  .sheet-wrap.in .sheet { transform: none; opacity: 1; }
  .sheet-wrap.out .sheet { transform: translateY(10px) scale(.97); opacity: 0; }
  .grabber { display: none; }
  .sheet-head { padding-top: 14px; }
}
.menu-sheet .sheet-head { min-height: 20px; padding: 0; } .menu-sheet .sheet-head .icon-btn { display: none; }
.menu-list { display: flex; flex-direction: column; padding-bottom: 6px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border-radius: 14px; text-align: left; font-weight: 550; }
.menu-item:hover { background: var(--hover); }
.menu-item span { flex: 1; }
.menu-item small { color: var(--text-3); }
.menu-item.danger { color: var(--danger); }
.menu-item .ic { color: var(--text-2); }
.menu-item.danger .ic { color: var(--danger); }
.menu-sep { height: 1px; background: var(--edge-2); margin: 4px 8px; }
.popmenu { position: fixed; min-width: 210px; max-width: 300px; padding: 6px; border-radius: 20px; z-index: 60; opacity: 0; transform: scale(.94) translateY(-4px); transform-origin: top left; transition: opacity .18s, transform .25s var(--spring); background: color-mix(in srgb, var(--bg2) 60%, rgba(var(--glass-rgb), .1)); }
html[data-theme="light"] .popmenu { background: rgba(255,255,255,.85); }
.popmenu.in { opacity: 1; transform: none; }
.popmenu .menu-item { padding: 9px 11px; border-radius: 12px; font-size: 14px; }

/* toasts */
#toasts { position: fixed; z-index: 70; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 20px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 22px; opacity: 0; transform: translateY(-20px) scale(.96); transition: opacity .3s, transform .45s var(--spring); background: color-mix(in srgb, var(--bg2) 50%, rgba(var(--glass-rgb), .1)); }
html[data-theme="light"] .toast { background: rgba(255,255,255,.85); }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(-14px) scale(.97); }
.toast.tappable { cursor: pointer; }
.toast .av { --s: 34px; }
.toast-text { flex: 1; min-width: 0; font-size: 14px; }
.toast-text b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-text span { display: block; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { #toasts { left: auto; right: 20px; transform: none; top: 20px; } }

/* lists in sheets */
.person-row { display: flex; align-items: center; gap: 11px; padding: 8px 4px; border-radius: 16px; }
.person-row .grow { display: flex; flex-direction: column; min-width: 0; }
.person-row.clickable { cursor: pointer; }
.person-row.clickable:hover { background: var(--hover); }
.tabs-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 0 -2px 6px; scrollbar-width: none; }
.tabs-row::-webkit-scrollbar { display: none; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.perm-row + .perm-row { border-top: 1px solid var(--edge-2); }
.perm-row .grow { font-weight: 550; }
.tri { display: flex; border-radius: 99px; background: var(--fill); padding: 3px; }
.tri button { width: 34px; height: 28px; border-radius: 99px; display: grid; place-items: center; color: var(--text-3); }
.tri button.on[data-v="deny"] { background: var(--danger); color: #fff; }
.tri button.on[data-v="inherit"] { background: var(--fill-2); color: var(--text); }
.tri button.on[data-v="allow"] { background: var(--ok); color: #fff; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, #99a); flex: none; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--fill); font-size: 12.5px; font-weight: 600; }
.discover-card { width: 100%; text-align: left; border-radius: 22px; overflow: hidden; margin-bottom: 10px; display: block; }
.discover-card .dc-banner { height: 70px; background: linear-gradient(135deg, var(--accent), var(--accent-2)) center/cover; }
.discover-card .dc-body { padding: 0 14px 14px; display: flex; gap: 12px; align-items: flex-end; }
.discover-card .chat-icon { margin-top: -22px; box-shadow: 0 0 0 4px var(--bg2); }
.discover-card .dc-body .grow { display: flex; flex-direction: column; min-width: 0; padding-top: 8px; }
.discover-card .dc-body small { color: var(--text-3); }
.discover-card .dc-desc { padding: 0 14px 14px; color: var(--text-2); font-size: 13.5px; }
.invite-box { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--fill); font-family: ui-monospace, monospace; font-size: 13px; }
.invite-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 18px; background: rgba(var(--glass-rgb), .1); margin-top: 4px; box-shadow: inset 0 1px 0 var(--edge-2); color: var(--text); min-width: 230px; }
.invite-card .grow { display: flex; flex-direction: column; min-width: 0; }
.invite-card small { color: var(--text-3); }
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; animation: fadeIn .25s; cursor: zoom-out; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer img { max-width: 96vw; max-height: 92vh; border-radius: 12px; object-fit: contain; }
@keyframes fadeIn { from { opacity: 0; } }
.fx { pointer-events: none; }
.status-preview { display: flex; gap: 8px; }
.presence-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.presence-pick button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--fill); font-weight: 600; font-size: 14px; }
.presence-pick button.on { box-shadow: inset 0 0 0 2px var(--accent); }
.presence-pick .presence { position: static; border: 0; width: 11px; height: 11px; }
.notif-row { display: flex; gap: 11px; align-items: center; padding: 10px 6px; border-radius: 16px; cursor: pointer; }
.notif-row:hover { background: var(--hover); }
.notif-row.unread { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.notif-row .grow { min-width: 0; font-size: 14px; }
.notif-row small { color: var(--text-3); display: block; }
.mobile-only { }
@media (min-width: 900px) { .mobile-only { display: none !important; } }
@media (max-width: 899px) { .desktop-only { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.text-channel{flex:1;min-height:0;display:flex;flex-direction:column}
