html, body { overflow: hidden; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; cursor: default; touch-action: manipulation; }
img, svg, video { display: block; }
a { color: var(--text-link); text-decoration: none; cursor: pointer; }
a.link:hover { text-decoration: underline; }
input, textarea, select { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--sc-focus-ring); }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.danger { color: var(--text-danger); }
.ic { display: inline-flex; flex: none; }
.name.grad { -webkit-background-clip: text; background-clip: text; color: transparent; }
.hd-space { flex: 1; }

::-webkit-scrollbar { width: var(--sc-scrollbar-auto); height: var(--sc-scrollbar-auto); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-auto-thumb); border-radius: var(--sc-radius-pill); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.side-scroll::-webkit-scrollbar, .members::-webkit-scrollbar, .rail::-webkit-scrollbar { width: 0; }

/* buttons and rows: fading tint, spring press */
.row, .ibtn, .btn, .pill { transition: background-color var(--sc-motion-hover-out), color var(--sc-motion-hover-out), border-color var(--sc-motion-color), transform var(--sc-motion-release); }
.row:hover, .ibtn:hover { background-color: var(--background-modifier-hover); transition: background-color var(--sc-motion-hover-tint), color var(--sc-motion-hover-tint), transform var(--sc-motion-release); }
.ibtn:active, .btn:active, .pill:active { transform: scale(var(--sc-press-scale)); transition: transform var(--sc-motion-press); }
.ibtn { display: inline-flex; align-items: center; justify-content: center; color: var(--interactive-normal); border-radius: var(--sc-radius-md); }
.ibtn:hover { color: var(--interactive-hover); }
.ibtn.active { color: var(--interactive-active); background: var(--background-modifier-selected); }
.icon-btn { width: var(--sc-icon-button); height: var(--sc-icon-button); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sc-space-sm); height: var(--sc-button-height); padding: 0 var(--sc-button-pad-x); border-radius: var(--sc-button-radius); background: var(--button-secondary-background); color: var(--header-primary); flex: none; }
.btn:hover { background: var(--button-secondary-background-hover); }
.btn.sm { height: var(--sc-button-height-sm); }
.btn.primary { background: var(--brand-500); color: var(--white-500); }
.btn.primary:hover { background: var(--brand-560); }
.btn.danger { background: var(--button-danger-background); color: var(--white-500); }
.btn.positive { background: var(--button-positive-background); color: var(--sc-button-positive-text); }
.btn.ghost { background: transparent; color: var(--text-link); }
.btn:disabled { opacity: .5; pointer-events: none; }
.tog { position: relative; width: var(--sc-toggle-width); height: var(--sc-toggle-height); border-radius: var(--sc-radius-pill); background: var(--sc-toggle-off); flex: none; transition: background-color var(--sc-motion-color); }
.tog.on { background: var(--brand-500); }
.tog-knob { position: absolute; top: var(--sc-toggle-inset); left: var(--sc-toggle-inset); width: var(--sc-toggle-knob); height: var(--sc-toggle-knob); border-radius: 50%; background: var(--sc-toggle-knob-color); transition: transform var(--sc-motion-toggle); }
.tog.on .tog-knob { transform: translateX(calc(var(--sc-toggle-width) - var(--sc-toggle-knob) - 2 * var(--sc-toggle-inset))); }
.tog:active .tog-knob { transform: scaleX(1.15); }
.tog.on:active .tog-knob { transform: translateX(calc(var(--sc-toggle-width) - var(--sc-toggle-knob) - 2 * var(--sc-toggle-inset))) scaleX(1.15); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: var(--sc-badge-height); height: var(--sc-badge-height); padding: 0 var(--sc-badge-pad-x); border-radius: var(--sc-radius-pill); background: var(--sc-badge-background); color: var(--sc-badge-text); flex: none; animation: pop var(--sc-motion-badge-pop) both; }
.tag { display: inline-flex; align-items: center; gap: 2px; height: var(--sc-badge-height); padding: 0 var(--sc-badge-pad-x); border-radius: var(--sc-radius-xs); background: var(--brand-500); color: var(--white-500); flex: none; }
.tag.danger { background: var(--button-danger-background); }
.server-tag { display: inline-flex; align-items: center; gap: var(--sc-space-xs); height: var(--sc-badge-height); padding: 0 var(--sc-badge-pad-x); border-radius: var(--sc-radius-xs); background: var(--background-accent); color: var(--header-secondary); border: var(--sc-border-width) solid var(--border-strong); }
.clan-badge { width: var(--sc-icon-sm); height: var(--sc-icon-sm); }
.role-icon { width: var(--sc-icon-md); height: var(--sc-icon-md); object-fit: contain; }
.spinner { display: flex; gap: var(--sc-space-xs); justify-content: center; padding: var(--sc-space-lg); }
.spinner span, .typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--interactive-normal); animation: dots 1.4s infinite ease-in-out both; }
.spinner span:nth-child(2), .typing-dots i:nth-child(2) { animation-delay: .16s; }
.spinner span:nth-child(3), .typing-dots i:nth-child(3) { animation-delay: .32s; }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.empty { padding: var(--sc-space-xl); color: var(--text-muted); text-align: center; }
@keyframes typing-wave { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-3px); } }
@keyframes typing-ring { 0%, 50%, 100% { transform: none; } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(8deg); } 40% { transform: rotate(-4deg); } }
@keyframes dots { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes popover { from { opacity: 0; transform: scale(var(--sc-popover-from-scale)) translateY(var(--sc-popover-from-offset)); } to { opacity: 1; transform: none; } }
@keyframes modal { from { opacity: 0; transform: scale(var(--sc-modal-from-scale)); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(var(--sc-space-sm)); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes flash { from { background-color: var(--background-message-highlight-hover); } to { background-color: transparent; } }

/* avatars */
.avatar { position: relative; display: inline-block; flex: none; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--background-accent); }
.avatar .deco { position: absolute; inset: 0; width: 100%; height: 100%; transform: scale(var(--sc-avatar-decoration-scale)); pointer-events: none; }
.avatar .dot { position: absolute; border-radius: 50%; box-shadow: 0 0 0 var(--ring) var(--ring-bg, var(--background-secondary)); }
.dot.online { background: var(--status-online); }
.dot.idle { background: var(--status-idle); }
.dot.dnd { background: var(--status-dnd); }
.dot.offline { background: var(--status-offline); }
.dot.streaming { background: var(--status-streaming); }
.dot.mobile { background: var(--status-online); border-radius: 3px; }
.avatar.group-default { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-500); color: var(--white-500); }
.group-default.g1, .group-default.g5 { background: var(--status-positive); color: var(--sc-button-positive-text); }
.group-default.g2, .group-default.g6 { background: var(--status-streaming); }
.group-default.g3, .group-default.g7 { background: var(--sc-brand-secondary); color: var(--sc-button-positive-text); }
.emoji { width: var(--sc-emoji-inline); height: var(--sc-emoji-inline); display: inline-block; vertical-align: -5px; object-fit: contain; }
.emoji.jumbo { width: var(--sc-emoji-jumbo); height: var(--sc-emoji-jumbo); vertical-align: bottom; }
.emoji-wrap { display: inline; }

/* tooltip, toasts */
.tooltip { position: fixed; z-index: 900; transform: translate(-50%, -100%); max-width: var(--sc-tooltip-max-width); padding: var(--sc-tooltip-pad-y) var(--sc-tooltip-pad-x); border-radius: var(--sc-radius-md); background: var(--sc-tooltip-background); color: var(--sc-tooltip-text); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); pointer-events: none; animation: fade var(--sc-motion-tooltip) both; text-align: center; overflow-wrap: anywhere; width: max-content; }
.tooltip.below { transform: translate(-50%, 0); }
.tooltip.right { transform: translate(0, -50%); white-space: nowrap; max-width: none; }
.toasts { position: fixed; z-index: 950; left: 50%; bottom: calc(var(--sc-space-xl) + var(--sc-safe-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--sc-space-sm); align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-space-sm) var(--sc-space-lg); border-radius: var(--sc-radius-pill); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); color: var(--header-primary); animation: rise var(--sc-motion-popover) both; }
.toast .ic { color: var(--text-positive); }
.toast.error .ic { color: var(--text-danger); }

/* splash */
.splash { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sc-space-md); background: var(--background-tertiary); }
.splash-logo { color: var(--brand-500); }
.splash-error { color: var(--text-danger); max-width: var(--sc-modal-width-sm); text-align: center; padding: 0 var(--sc-space-lg); user-select: text; -webkit-user-select: text; }

/* layout */
.app { display: flex; height: 100dvh; width: 100vw; background: var(--background-tertiary); }
.left { position: relative; display: flex; flex-direction: column; flex: none; height: 100%; }
.left-cols { display: flex; flex: 1; min-height: 0; }
.rail { width: var(--sc-rail-width); flex: none; background: var(--background-tertiary); padding: var(--sc-rail-pad-top) 0 calc(var(--sc-user-bar-height) + 2 * var(--sc-user-bar-margin)); display: flex; flex-direction: column; align-items: center; gap: var(--sc-rail-gap); overflow-y: auto; scrollbar-width: none; }
.rail-side { border-left: var(--sc-border-width) solid var(--border-subtle); }
.sidebar { width: var(--sc-sidebar-width); flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--background-secondary); border-left: var(--sc-border-width) solid var(--border-subtle); border-right: var(--sc-border-width) solid var(--border-subtle); }
.chat { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; background: var(--chat-background); }
.chat-body { flex: 1; min-height: 0; display: flex; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* rail */
.rail-item { position: relative; width: 100%; display: flex; justify-content: center; flex: none; }
.rail-pill { position: absolute; left: 0; top: 50%; width: var(--sc-rail-pill-width); height: 0; border-radius: 0 var(--sc-radius-xs) var(--sc-radius-xs) 0; background: var(--header-primary); transform: translateY(-50%); transition: height var(--sc-motion-rail-pill); }
.rail-item.unread .rail-pill { height: var(--sc-rail-pill-unread); }
.rail-item:hover .rail-pill { height: var(--sc-rail-pill-hover); }
.rail-item.selected .rail-pill { height: var(--sc-rail-pill-active); }
.guild-icon { width: var(--sc-guild-icon); height: var(--sc-guild-icon); border-radius: var(--sc-guild-icon-radius); background: var(--background-primary); color: var(--text-normal); overflow: hidden; transition: border-radius var(--sc-motion-rail-icon), background-color var(--sc-motion-color), color var(--sc-motion-color), transform var(--sc-motion-release); font-size: var(--sc-guild-icon-font); font-weight: 600; }
.guild-icon:hover, .rail-item.selected > .guild-icon { border-radius: var(--sc-guild-icon-radius-active); background: var(--brand-500); color: var(--white-500); }
.guild-img { width: 100%; height: 100%; object-fit: cover; }
.guild-icon .avatar, .guild-icon .avatar-img { border-radius: inherit; }
.guild-icon .avatar .dot { display: none; }
.rail-item.unavailable .guild-icon { opacity: .5; }
.rail-badge { position: absolute; right: calc((var(--sc-rail-width) - var(--sc-guild-icon)) / 2 - var(--sc-rail-badge-ring)); bottom: calc(-1 * var(--sc-rail-badge-ring) / 2); height: var(--sc-rail-badge-height); box-shadow: 0 0 0 var(--sc-rail-badge-ring) var(--background-tertiary); pointer-events: none; }
.rail-sep { width: var(--sc-rail-separator-width); height: var(--sc-rail-separator-height); border-radius: var(--sc-radius-pill); background: var(--border-strong); flex: none; }
.rail-folder { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--sc-rail-gap); flex: none; }
.rail-folder.open { background: var(--background-secondary); border-radius: var(--sc-guild-icon-radius); width: calc(var(--sc-guild-icon) + var(--sc-space-sm)); padding: var(--sc-space-xs) 0; }
.rail-folder.open .rail-item { width: var(--sc-rail-width); }
.folder-guilds { display: contents; }
.folder-icon { background: var(--background-secondary); color: var(--folder, var(--brand-500)); }
.folder-icon:hover { background: var(--background-accent); color: var(--folder, var(--brand-500)); border-radius: var(--sc-guild-icon-radius-active); }
.folder-grid { display: grid; grid-template-columns: repeat(2, var(--sc-folder-mini-icon)); gap: var(--sc-folder-mini-gap); }
.folder-mini { width: var(--sc-folder-mini-icon); height: var(--sc-folder-mini-icon); border-radius: 50%; object-fit: cover; }
.folder-mini.acr { display: flex; align-items: center; justify-content: center; background: var(--background-accent); color: var(--text-normal); font-size: 9px; }
.folder-open { display: none; }
.rail-folder.open .folder-open { display: inline-flex; }
.rail-folder.open .folder-grid { display: none; }

/* sidebar */
.side-head { position: relative; height: var(--sc-sidebar-header-height); flex: none; display: flex; align-items: center; gap: var(--sc-space-sm); padding: 0 var(--sc-space-lg); border-bottom: var(--sc-border-width) solid var(--border-subtle); color: var(--header-primary); cursor: pointer; }
.side-head.with-banner { height: var(--sc-guild-banner-height); align-items: flex-start; padding-top: var(--sc-space-md); }
.guild-banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.side-head > :not(.guild-banner) { position: relative; z-index: 1; }
.side-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-badge { color: var(--text-positive); display: inline-flex; }
.guild-head { padding: var(--sc-space-sm); border-bottom: 0; cursor: default; }
.guild-head.with-banner { padding-top: var(--sc-space-sm); }
.guild-pill { flex: 1; min-width: 0; height: 100%; max-height: calc(var(--sc-sidebar-header-height) - 2 * var(--sc-space-sm)); display: flex; align-items: center; gap: var(--sc-space-sm); padding: 0 var(--sc-space-xs) 0 var(--sc-space-md); border-radius: var(--sc-radius-lg); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); cursor: pointer; transition: background var(--sc-motion-hover-tint-duration) var(--sc-motion-hover-tint-easing); }
.guild-pill:hover { background: var(--background-modifier-hover); }
.guild-head-icon { width: var(--sc-icon-md); height: var(--sc-icon-md); flex: none; border-radius: var(--sc-radius-sm); object-fit: cover; }
.guild-head-icon.acr { display: inline-flex; align-items: center; justify-content: center; background: var(--background-accent); color: var(--text-normal); font-size: 8px; font-weight: 700; }
.guild-invite { flex: none; margin-left: var(--sc-space-xs); width: var(--sc-icon-button); height: var(--sc-icon-button); border-radius: var(--sc-radius-md); color: var(--interactive-normal); }
.guild-invite:hover { color: var(--interactive-hover); background: var(--background-modifier-hover); }
.search-head { padding: 0 var(--sc-space-sm); cursor: default; }
.find-btn { flex: 1; height: var(--sc-button-height-sm); border-radius: var(--sc-radius-md); background: var(--background-tertiary); color: var(--text-muted); text-align: left; padding: 0 var(--sc-space-sm); border: var(--sc-border-width) solid var(--border-subtle); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sc-space-sm) var(--sc-channel-list-pad-x) 0; scrollbar-width: none; }
.side-pad { height: calc(var(--sc-user-bar-height) + 2 * var(--sc-user-bar-margin)); }
.category { display: flex; align-items: center; gap: var(--sc-space-xxs); height: var(--sc-category-height); margin-top: var(--sc-category-pad-top); color: var(--channels-default); cursor: pointer; transition: color var(--sc-motion-hover-out); }
.category:hover { color: var(--interactive-hover); }
.category.static { cursor: default; padding-left: var(--sc-space-sm); }
.category:first-child { margin-top: var(--sc-space-xs); }
.cat-chevron { display: inline-flex; transition: transform var(--sc-motion-chevron); }
.category.collapsed .cat-chevron { transform: rotate(-90deg); }
.row.channel, .row.thread, .row.voice-user { position: relative; display: flex; align-items: center; gap: var(--sc-channel-icon-gap); height: var(--sc-channel-row-height); margin-top: var(--sc-channel-row-gap); padding: 0 var(--sc-channel-row-pad-x); border-radius: var(--sc-channel-row-radius); color: var(--channels-default); cursor: pointer; }
.row.channel:hover, .row.thread:hover, .row.dm:hover { color: var(--interactive-hover); }
.row.selected { background: var(--background-modifier-selected); color: var(--interactive-active); }
.row.unread:not(.muted) { color: var(--interactive-active); }
.row.muted { color: var(--interactive-muted); }
.row.locked { opacity: .6; }
.chan-pill { position: absolute; left: var(--sc-channel-pill-left); top: 50%; width: var(--sc-rail-pill-width); height: 0; border-radius: 0 var(--sc-radius-xs) var(--sc-radius-xs) 0; background: var(--header-primary); transform: translateY(-50%); transition: height var(--sc-motion-rail-pill); }
.row.unread:not(.muted) .chan-pill { height: var(--sc-rail-pill-unread); }
.chan-icon { position: relative; display: inline-flex; color: var(--channel-icon); flex: none; }
.row.selected .chan-icon, .row.unread:not(.muted) .chan-icon { color: inherit; }
.chan-lock { position: absolute; right: -3px; top: -3px; display: inline-flex; background: var(--background-secondary); border-radius: 50%; }
.chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-count, .voice-status { color: var(--text-muted); flex: none; }
.row.thread { height: var(--sc-thread-row-height); padding-left: var(--sc-thread-indent); }
.thread-spine { position: absolute; left: calc(var(--sc-thread-indent) / 2); top: calc(-1 * var(--sc-channel-row-gap)); width: var(--sc-space-sm); height: calc(50% + var(--sc-channel-row-gap)); border-left: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); border-bottom-left-radius: var(--sc-radius-sm); }
.row.voice-user { height: var(--sc-voice-user-row-height); padding-left: var(--sc-voice-user-indent); }
.voice-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-icons { display: inline-flex; gap: var(--sc-space-xs); color: var(--text-muted); }
.voice-ic.danger { color: var(--text-danger); }
.voice-ic.live { color: var(--status-streaming); }
.row.dm { display: flex; align-items: center; gap: var(--sc-space-md); height: var(--sc-dm-row-height); margin-top: var(--sc-channel-row-gap); padding: 0 var(--sc-channel-row-pad-x); border-radius: var(--sc-channel-row-radius); color: var(--channels-default); cursor: pointer; }
.dm-lead { width: var(--sc-avatar-md); display: inline-flex; justify-content: center; flex: none; }
.dm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-title, .dm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-sub { color: var(--text-muted); display: block; }
.dm-sub .emoji, .member-sub .emoji, .ub-sub .emoji, .hd-topic .emoji, .line-emoji { width: var(--sc-icon-sm); height: var(--sc-icon-sm); vertical-align: -3px; margin-right: var(--sc-space-xs); }
.dm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sc-space-xxs); flex: none; }
.dm-time { color: var(--text-muted); }
.verb { color: inherit; }

/* user bar */
.user-bar { position: absolute; left: var(--sc-user-bar-margin); right: var(--sc-user-bar-margin); bottom: var(--sc-user-bar-margin); height: var(--sc-user-bar-height); display: flex; align-items: center; gap: var(--sc-space-xs); padding: 0 var(--sc-space-sm); border-radius: var(--sc-panel-radius); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-low); --ring-bg: var(--background-secondary-alt); }
.ub-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sc-space-sm); height: calc(var(--sc-user-bar-height) - 2 * var(--sc-space-sm)); padding: 0 var(--sc-space-xs); border-radius: var(--sc-radius-md); text-align: left; }
.ub-text { min-width: 0; display: flex; flex-direction: column; }
.ub-name, .ub-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-name { color: var(--header-primary); }
.ub-sub { color: var(--text-muted); }
.ub-buttons { display: flex; flex: none; align-items: center; gap: var(--sc-space-xxs); }
.ub-buttons .icon-btn { width: var(--sc-user-bar-button); height: var(--sc-user-bar-button); }
.ub-group { display: inline-flex; align-items: center; border-radius: var(--sc-radius-md); }
.ub-group.chev:hover { background: var(--background-modifier-hover); }
.ub-group.chev .ub-btn { width: calc(var(--sc-user-bar-button) - 2px); border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ub-chev { width: var(--sc-space-lg); height: var(--sc-user-bar-button); border-radius: 0 var(--sc-radius-md) var(--sc-radius-md) 0; color: var(--interactive-normal); }
.ub-chev:hover { color: var(--interactive-hover); background: var(--background-modifier-hover); }
.ub-group.danger .ub-btn, .ub-group.danger .ub-btn.active { color: var(--status-danger); background: transparent; }
.ub-group.danger .ub-btn:hover { background: var(--background-modifier-hover); }
.ub-sub { display: flex; align-items: center; gap: var(--sc-space-xs); }
.ub-sub .line-text { overflow: hidden; text-overflow: ellipsis; }

/* header */
.header { height: var(--sc-header-height); flex: none; display: flex; align-items: center; gap: var(--sc-space-sm); padding: 0 var(--sc-space-sm) 0 var(--sc-header-pad-x); border-bottom: var(--sc-border-width) solid var(--border-subtle); min-width: 0; --ring-bg: var(--chat-background); }
.hd-icon { color: var(--channel-icon); display: inline-flex; flex: none; }
.hd-title { color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.hd-parent { color: var(--header-secondary); white-space: nowrap; }
.hd-chev, .hd-flag { color: var(--text-muted); display: inline-flex; flex: none; }
.hd-div { width: var(--sc-border-width); height: var(--sc-space-xl); background: var(--border-strong); flex: none; margin: 0 var(--sc-space-xs); }
.hd-topic { color: var(--header-secondary); flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-buttons { display: flex; gap: var(--sc-space-xxs); flex: none; }
.hd-btn { position: relative; display: inline-flex; }
.hd-dot { position: absolute; right: 4px; bottom: 4px; width: var(--sc-space-sm); height: var(--sc-space-sm); border-radius: 50%; background: var(--sc-badge-background); box-shadow: 0 0 0 2px var(--chat-background); pointer-events: none; }
.rich-inline { white-space: nowrap; }
.rich-inline br { display: none; }
.rich-inline .md-h, .rich-inline .md-sub, .rich-inline .md-quote, .rich-inline .md-list, .rich-inline li, .rich-inline .codeblock { display: inline; font: inherit; border: 0; padding: 0; margin: 0; background: none; }
.rich-inline .code-copy { display: none; }
.rich-inline .emoji { width: var(--sc-icon-sm); height: var(--sc-icon-sm); vertical-align: -3px; }
.conn-banner { display: flex; align-items: center; justify-content: center; gap: var(--sc-space-sm); min-height: var(--sc-jump-bar-height); padding: var(--sc-space-xs) var(--sc-space-lg); background: var(--background-accent); color: var(--header-primary); border-bottom: var(--sc-border-width) solid var(--border-strong); flex: none; }
.conn-banner.warn { background: var(--info-warning-foreground); color: var(--sc-button-positive-text); }
.conn-banner.error { background: var(--button-danger-background); color: var(--white-500); }

/* messages */
.messages { position: relative; flex: 1; min-height: 0; }
.scroller { height: 100%; overflow-y: auto; overflow-x: hidden; overflow-anchor: none; overscroll-behavior: contain; }
.scroller-in { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.scroller-end { height: var(--sc-message-list-pad-bottom); flex: none; }
.list-status { display: flex; justify-content: center; padding: var(--sc-space-xl); }
.more { height: var(--sc-space-xxxl); display: flex; align-items: center; justify-content: center; }
.start { padding: var(--sc-space-xl) var(--sc-space-lg) var(--sc-space-sm); display: flex; flex-direction: column; gap: var(--sc-space-sm); align-items: flex-start; }
.start h1 { margin: 0; color: var(--header-primary); }
.start-icon { width: var(--sc-avatar-xl); height: var(--sc-avatar-xl); border-radius: 50%; background: var(--background-accent); color: var(--header-primary); display: flex; align-items: center; justify-content: center; }
.start-sub, .start-body { color: var(--header-secondary); }
.start-body strong { color: var(--header-primary); }
.day { display: flex; align-items: center; height: var(--sc-day-divider-height); margin: var(--sc-space-sm) var(--sc-space-lg) 0; color: var(--text-muted); gap: var(--sc-space-sm); }
.day::before, .day::after { content: ""; flex: 1; height: var(--sc-border-width); background: var(--sc-day-divider); }
.new-line { position: relative; height: var(--sc-border-width); margin: var(--sc-space-sm) var(--sc-space-lg) 0; background: var(--sc-new-divider); }
.new-pill { position: absolute; right: 0; top: 50%; transform: translateY(-50%); height: var(--sc-new-pill-height); padding: 0 var(--sc-space-xs); border-radius: var(--sc-radius-xs); background: var(--sc-new-divider); color: var(--white-500); display: flex; align-items: center; }
.hidden-run { display: flex; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-space-sm) var(--sc-space-lg) var(--sc-space-sm) var(--sc-message-gutter); color: var(--text-muted); }
.msg { position: relative; padding: var(--sc-message-pad-y) var(--sc-message-pad-right) var(--sc-message-pad-y) var(--sc-message-gutter); transition: background-color var(--sc-motion-hover-out); user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; min-width: 0; }
.msg.head { margin-top: var(--sc-message-group-spacing); }
.msg:hover, .msg.editing { background: var(--background-message-hover); transition: background-color var(--sc-motion-hover-tint); }
.msg.mentioned { background: var(--background-mentioned); box-shadow: inset var(--sc-mention-bar-width) 0 0 var(--info-warning-foreground); }
.msg.mentioned:hover { background: var(--background-mentioned-hover); }
.msg.highlight { animation: flash var(--sc-motion-highlight) both; }
.msg.deleted { background: var(--sc-menu-danger-hover); }
.msg.deleted .msg-content { color: var(--text-danger); }
.msg.sending .msg-content { color: var(--text-muted); }
.msg.failed .msg-content { color: var(--text-danger); }
.msg-avatar { position: absolute; left: var(--sc-message-avatar-left); top: calc(var(--sc-message-avatar-top) + var(--sc-message-pad-y)); cursor: pointer; transition: transform var(--sc-motion-release); }
.msg-avatar:active { transform: scale(var(--sc-press-scale)); }
.msg.has-reply .msg-avatar { top: calc(var(--sc-message-avatar-top) + var(--sc-message-pad-y) + var(--sc-space-xl)); }
.msg-stamp { position: absolute; left: 0; top: var(--sc-message-pad-y); width: var(--sc-message-gutter); padding-right: var(--sc-space-sm); text-align: right; color: var(--text-muted); opacity: 0; user-select: none; -webkit-user-select: none; height: 1.375rem; display: flex; align-items: center; justify-content: flex-end; }
.msg:hover .msg-stamp { opacity: 1; }
.msg-header { display: flex; align-items: center; gap: var(--sc-space-sm); min-width: 0; flex-wrap: wrap; }
.msg-author { color: var(--header-primary); cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { color: var(--text-muted); user-select: none; -webkit-user-select: none; margin-left: var(--sc-space-xxs); }
.msg-flag { color: var(--text-muted); display: inline-flex; }
.msg-content { white-space: pre-wrap; color: var(--text-normal); }
.msg-content.old { color: var(--text-muted); text-decoration: line-through; }
.edited { color: var(--text-muted); user-select: none; -webkit-user-select: none; }
.reply { position: relative; display: flex; align-items: center; gap: var(--sc-space-xs); height: var(--sc-space-xl); color: var(--header-secondary); cursor: pointer; min-width: 0; user-select: none; -webkit-user-select: none; }
.reply-spine { position: absolute; left: calc(-1 * var(--sc-message-gutter) + var(--sc-message-avatar-left) + var(--sc-message-avatar) / 2); top: 50%; width: var(--sc-reply-spine-width); height: calc(50% + var(--sc-space-xs)); border-left: 2px solid var(--border-strong); border-top: 2px solid var(--border-strong); border-top-left-radius: var(--sc-radius-sm); }
.reply-name { flex: none; font-weight: 600; }
.reply-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--sc-space-xs); }
.reply-text .rich-inline { overflow: hidden; text-overflow: ellipsis; }
.reply:hover .reply-text { color: var(--header-primary); }
.reply-icon { display: inline-flex; }
.sys { display: flex; flex-wrap: wrap; align-items: flex-start; margin-top: var(--sc-space-xs); }
.sys-icon { position: absolute; left: 0; width: var(--sc-message-gutter); display: flex; justify-content: center; top: calc(var(--sc-message-pad-y) + 3px); color: var(--text-muted); }
.sys.join .sys-icon, .sys.boost .sys-icon { color: var(--text-positive); }
.sys.boost .sys-icon { color: var(--status-streaming); }
.sys.leave .sys-icon, .sys.missed .sys-icon, .sys.alert .sys-icon { color: var(--text-danger); }
.sys.call .sys-icon { color: var(--text-positive); }
.sys-text { color: var(--header-secondary); width: 100%; }
.sys-text strong, .sys-user { color: var(--header-primary); font-weight: 600; cursor: pointer; }
.toolbar { position: absolute; right: var(--sc-hover-bar-right); top: var(--sc-hover-bar-offset-y); z-index: 2; display: flex; align-items: center; height: var(--sc-hover-bar-height); border-radius: var(--sc-radius-md); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-low); animation: popover var(--sc-motion-menu) both; transform-origin: 100% 100%; user-select: none; -webkit-user-select: none; }
.tb-btn { width: var(--sc-hover-bar-button); height: calc(var(--sc-hover-bar-height) - 2 * var(--sc-border-width)); border-radius: var(--sc-radius-sm); }
.tb-btn .emoji { width: var(--sc-icon-md); height: var(--sc-icon-md); vertical-align: 0; }
.tb-btn.danger:hover { color: var(--text-danger); }
.tb-sep { width: var(--sc-border-width); height: var(--sc-space-lg); background: var(--border-strong); margin: 0 var(--sc-space-xxs); }
.send-failed, .ephemeral { display: flex; align-items: center; gap: var(--sc-space-xs); color: var(--text-muted); margin-top: var(--sc-space-xs); }
.send-failed { color: var(--text-danger); }
.translation { margin-top: var(--sc-space-xs); padding-left: var(--sc-quote-gap); border-left: var(--sc-quote-bar-width) solid var(--sc-brand-line); }
.translation .ic { display: inline-flex; vertical-align: -2px; }
.forward { margin-top: var(--sc-space-xs); padding-left: var(--sc-quote-gap); border-left: var(--sc-quote-bar-width) solid var(--sc-quote-bar); }
.fwd-head { display: flex; align-items: center; gap: var(--sc-space-xs); color: var(--text-muted); }
.fwd-origin { display: inline-flex; align-items: center; gap: var(--sc-space-xxs); color: var(--text-muted); margin-top: var(--sc-space-xs); }
.thread-card { margin-top: var(--sc-message-accessory-gap); max-width: var(--sc-file-card-width); padding: var(--sc-space-sm) var(--sc-space-md); border-radius: var(--sc-attachment-radius); background: var(--sc-embed-background); border: var(--sc-border-width) solid var(--sc-embed-border); cursor: pointer; user-select: none; -webkit-user-select: none; }
.thread-top, .thread-bottom { display: flex; align-items: center; gap: var(--sc-space-sm); min-width: 0; }
.thread-bottom { margin-top: var(--sc-space-xs); color: var(--text-muted); }
.thread-name { color: var(--header-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-box { margin: var(--sc-space-xs) 0; }
.edit-input { width: 100%; min-height: var(--sc-composer-min-height); padding: var(--sc-space-md) var(--sc-composer-pad-x); border-radius: var(--sc-composer-radius); background: var(--channeltextarea-background); border: var(--sc-border-width) solid var(--border-strong); resize: none; field-sizing: content; }
.edit-hint { color: var(--text-muted); margin-top: var(--sc-space-xs); }

/* markdown */
.msg-content strong, .embed strong { font-weight: 700; }
.mention { display: inline; padding: 0 var(--sc-mention-pad-x); -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: var(--sc-mention-radius); color: var(--m-fg, var(--mention-foreground)); background: var(--m-bg, var(--mention-background)); font-weight: 500; cursor: pointer; transition: background-color var(--sc-motion-hover-out); vertical-align: baseline; }
.mention:hover { background: var(--m-hover, var(--sc-mention-background-hover)); }
.mention .ic { display: inline-block; vertical-align: -0.15em; margin-right: 2px; }
.mention.locked { opacity: .7; }
.spoiler { border-radius: var(--sc-spoiler-radius); background: var(--spoiler-hidden-background); cursor: pointer; transition: background-color var(--sc-motion-color); }
.spoiler:hover { background: var(--sc-spoiler-hidden-background-hover); }
.spoiler .spoiler-in { visibility: hidden; }
.spoiler.shown { background: var(--spoiler-revealed-background); cursor: auto; }
.spoiler.shown .spoiler-in { visibility: visible; }
.inline-code { padding: 0 var(--sc-inline-code-pad-x); border-radius: var(--sc-radius-xs); background: var(--sc-code-background); border: var(--sc-border-width) solid var(--sc-code-border); white-space: pre-wrap; }
.codeblock { position: relative; margin: var(--sc-space-xs) 0 0; padding: var(--sc-code-block-pad); border-radius: var(--sc-radius-md); background: var(--sc-code-background); border: var(--sc-border-width) solid var(--sc-code-border); white-space: pre-wrap; max-width: 90%; overflow-x: auto; }
.code-copy { position: absolute; right: var(--sc-space-xs); top: var(--sc-space-xs); width: var(--sc-icon-lg); height: var(--sc-icon-lg); opacity: 0; background: var(--sc-code-background); }
.codeblock:hover .code-copy { opacity: 1; }
.md-h { color: var(--header-primary); margin: var(--sc-space-sm) 0 var(--sc-space-xs); }
.md-h:first-child { margin-top: 0; }
.md-sub { color: var(--text-muted); }
.md-quote { padding-left: var(--sc-quote-gap); border-left: var(--sc-quote-bar-width) solid var(--sc-quote-bar); border-radius: 2px; }
.md-list { margin: var(--sc-space-xs) 0 0 var(--sc-space-lg); padding: 0; white-space: normal; }
.md-list li { white-space: pre-wrap; }
.md-time { padding: 0 var(--sc-mention-pad-x); border-radius: var(--sc-mention-radius); background: var(--background-modifier-active); }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-tag, .hljs-name { color: var(--sc-syntax-keyword); }
.hljs-title, .hljs-built_in, .hljs-bullet { color: var(--sc-syntax-function); }
.hljs-string, .hljs-regexp, .hljs-quote, .hljs-code { color: var(--sc-syntax-string); }
.hljs-number, .hljs-symbol, .hljs-link { color: var(--sc-syntax-number); }
.hljs-comment { color: var(--sc-syntax-comment); font-style: italic; }
.hljs-type { color: var(--sc-syntax-type); }
.hljs-attr, .hljs-meta { color: var(--sc-syntax-attribute); }
.hljs-variable { color: var(--sc-syntax-variable); }
.hljs-addition { color: var(--sc-syntax-inserted); }
.hljs-deletion { color: var(--sc-syntax-deleted); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* attachments, embeds */
.attachments, .embed-bare, .components, .poll { margin-top: var(--sc-message-accessory-gap); display: flex; flex-direction: column; gap: var(--sc-message-accessory-gap); align-items: flex-start; user-select: none; -webkit-user-select: none; }
.visual-grid { position: relative; max-width: 100%; }
.visual { position: absolute; overflow: hidden; border-radius: var(--sc-attachment-radius); background: var(--background-secondary); cursor: pointer; max-width: 100%; }
.visual-img { width: 100%; height: 100%; object-fit: cover; }
.visual-poster { position: absolute; inset: 0; }
.play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: var(--sc-space-xxxl); height: var(--sc-space-xxxl); border-radius: 50%; background: var(--sc-scrim); color: var(--white-500); display: flex; align-items: center; justify-content: center; }
.gif-tag, .alt-tag, .spoiler-tag { position: absolute; padding: var(--sc-space-xxs) var(--sc-space-xs); border-radius: var(--sc-radius-xs); background: var(--sc-scrim); color: var(--white-500); }
.gif-tag { left: var(--sc-space-xs); top: var(--sc-space-xs); }
.alt-tag { left: var(--sc-space-xs); bottom: var(--sc-space-xs); }
.visual:hover .gif-tag { opacity: 0; }
.spoiler-tag { display: none; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: var(--sc-space-sm) var(--sc-space-md); border-radius: var(--sc-radius-pill); }
.spoilered .spoiler-tag { display: block; }
.spoilered > :not(.spoiler-tag) { visibility: hidden; }
.spoilered { background: var(--spoiler-hidden-background); cursor: pointer; }
.file-card { width: var(--sc-file-card-width); max-width: 100%; padding: var(--sc-space-md); border-radius: var(--sc-attachment-radius); background: var(--sc-embed-background); border: var(--sc-border-width) solid var(--sc-embed-border); }
.file-row { display: flex; align-items: center; gap: var(--sc-space-sm); }
.file-icon { color: var(--interactive-normal); display: inline-flex; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--text-muted); }
.file-audio { width: 100%; margin-top: var(--sc-space-sm); height: var(--sc-button-height-sm); }
.voice-msg { display: flex; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-space-sm) var(--sc-space-md); border-radius: var(--sc-radius-pill); background: var(--sc-embed-background); border: var(--sc-border-width) solid var(--sc-embed-border); }
.voice-play { width: var(--sc-button-height-sm); height: var(--sc-button-height-sm); padding: 0; border-radius: 50%; background: var(--brand-500); color: var(--white-500); }
.voice-bars { display: flex; align-items: center; gap: 2px; height: var(--sc-icon-lg); }
.voice-bars i { width: 2px; border-radius: 1px; background: var(--interactive-normal); }
.voice-clock { color: var(--text-muted); }
.sticker-img { width: 100%; height: 100%; object-fit: contain; }
.sticker { margin-top: var(--sc-message-accessory-gap); }
.sticker-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sc-space-sm); border-radius: var(--sc-attachment-radius); background: var(--sc-embed-background); color: var(--text-muted); }
.embed { margin-top: var(--sc-message-accessory-gap); max-width: min(var(--sc-embed-max-width), 100%); width: fit-content; padding: var(--sc-space-md) var(--sc-embed-pad) var(--sc-embed-pad) var(--sc-space-md); border-radius: var(--sc-attachment-radius); background: var(--sc-embed-background); border: var(--sc-border-width) solid var(--sc-embed-border); border-left: var(--sc-embed-bar-width) solid var(--bar, var(--sc-embed-bar)); display: flex; flex-direction: column; gap: var(--sc-space-sm); user-select: text; -webkit-user-select: text; }
.embed-main { display: flex; gap: var(--sc-space-lg); }
.embed-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sc-space-xs); }
.embed-provider { color: var(--text-muted); }
.embed-author { display: flex; align-items: center; gap: var(--sc-space-sm); color: var(--header-primary); }
.embed-author-icon { width: var(--sc-avatar-sm); height: var(--sc-avatar-sm); border-radius: 50%; }
.embed-title { color: var(--header-primary); }
.embed-title.link { color: var(--text-link); }
.embed-desc { white-space: pre-wrap; color: var(--text-normal); }
.embed-fields { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--sc-space-sm); }
.embed-field { min-width: 0; white-space: pre-wrap; }
.embed-field > :first-child { color: var(--header-primary); }
.embed-footer { display: flex; align-items: center; gap: var(--sc-space-sm); color: var(--text-muted); }
.embed-footer-icon { width: var(--sc-icon-md); height: var(--sc-icon-md); border-radius: 50%; }
.embed-media { max-width: 100%; }
.embed .visual { flex: none; }
.yt { position: relative; max-width: 100%; border-radius: var(--sc-attachment-radius); overflow: hidden; background: var(--background-tertiary); }
.yt-poster { position: absolute; inset: 0; cursor: pointer; }
.yt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reactions { display: flex; flex-wrap: wrap; gap: var(--sc-reaction-gap); margin-top: var(--sc-message-accessory-gap); user-select: none; -webkit-user-select: none; }
.reaction { display: inline-flex; align-items: center; gap: var(--sc-space-xs); height: var(--sc-reaction-height); padding: 0 var(--sc-reaction-pad-x); border-radius: var(--sc-radius-md); background: var(--sc-reaction-background); border: var(--sc-border-width) solid var(--sc-reaction-border); color: var(--header-secondary); animation: pop var(--sc-motion-reaction-pop) both; }
.reaction:hover { border-color: var(--border-strong); background: var(--background-accent); }
.reaction.me { background: var(--sc-reaction-me-background); border-color: var(--sc-reaction-me-border); color: var(--header-primary); }
.reaction.burst { border-color: var(--burst, var(--sc-reaction-border)); }
.reaction.add { opacity: 0; color: var(--interactive-normal); }
.msg:hover .reaction.add { opacity: 1; }
.reaction-emoji { width: var(--sc-emoji-reaction); height: var(--sc-emoji-reaction); vertical-align: 0; }
.poll { width: var(--sc-file-card-width); max-width: 100%; padding: var(--sc-space-lg); border-radius: var(--sc-attachment-radius); background: var(--sc-embed-background); border: var(--sc-border-width) solid var(--sc-embed-border); align-items: stretch; }
.poll-q { color: var(--header-primary); }
.poll-hint, .poll-foot { color: var(--text-muted); }
.poll-foot { display: flex; align-items: center; justify-content: space-between; }
.poll-answers { display: flex; flex-direction: column; gap: var(--sc-space-sm); }
.poll-answer { position: relative; display: flex; align-items: center; gap: var(--sc-space-sm); min-height: var(--sc-composer-min-height); padding: 0 var(--sc-space-md); border-radius: var(--sc-radius-md); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-subtle); overflow: hidden; cursor: pointer; }
.poll-answer.mine, .poll-answer.picked { border-color: var(--brand-500); }
.poll-answer.winner { border-color: var(--status-positive); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--background-modifier-selected); z-index: 0; }
.poll-answer > :not(.poll-bar) { position: relative; z-index: 1; }
.poll-text { flex: 1; }
.poll-votes { color: var(--header-secondary); }
.c-row { display: flex; flex-wrap: wrap; gap: var(--sc-space-sm); }
.c-select { height: var(--sc-input-height); min-width: var(--sc-menu-width); padding: 0 var(--sc-space-md); border-radius: var(--sc-input-radius); background: var(--input-background); border: var(--sc-border-width) solid var(--border-strong); }
.c-section { display: flex; gap: var(--sc-space-md); align-items: flex-start; }
.c-section-body { flex: 1; min-width: 0; }
.c-sep { height: var(--sc-space-sm); }
.c-sep.large { height: var(--sc-space-lg); }
.c-sep.line { border-top: var(--sc-border-width) solid var(--border-subtle); margin-top: var(--sc-space-sm); }
.jump-bar { position: absolute; left: 50%; bottom: var(--sc-space-sm); transform: translateX(-50%); height: var(--sc-jump-bar-height); border-radius: var(--sc-radius-pill); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); color: var(--header-primary); animation: rise var(--sc-motion-popover) both; z-index: 3; }
.jump-bar:active { transform: translateX(-50%) scale(var(--sc-press-scale)); }

/* composer */
.composer-wrap { position: relative; flex: none; padding: 0 var(--sc-composer-margin-x) var(--sc-space-lg); }
.composer { position: relative; border-radius: var(--sc-composer-radius); background: var(--channeltextarea-background); border: var(--sc-border-width) solid var(--border-strong); transition: border-color var(--sc-motion-color); }
.composer:focus-within { border-color: var(--sc-brand-line); }
.composer.has-reply { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer-row { display: flex; align-items: flex-end; min-height: var(--sc-composer-min-height); padding: 0 var(--sc-space-xs); }
.composer-field { position: relative; flex: 1; min-width: 0; align-self: stretch; display: flex; }
.composer-input { flex: 1; min-width: 0; padding: calc((var(--sc-composer-min-height) - 1.375rem) / 2 - var(--sc-border-width)) var(--sc-space-sm); max-height: calc(100dvh * var(--sc-composer-max-fraction)); overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; cursor: text; }
.composer-input:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.composer.blocked .composer-input { display: none; }
.composer-block { flex: 1; display: flex; align-items: center; padding: 0 var(--sc-space-sm); color: var(--text-muted); }
.tok { user-select: all; -webkit-user-select: all; }
.composer-input .md-b { font-weight: 700; }
.composer-input .md-i { font-style: italic; }
.composer-input .md-u { text-decoration-line: underline; }
.composer-input .md-s { text-decoration-line: line-through; }
.composer-input .md-u.md-s { text-decoration-line: underline line-through; }
.composer-input .md-p { border-radius: var(--sc-spoiler-radius); background: var(--spoiler-revealed-background); }
.composer-input .md-c, .composer-input .md-cb { background: var(--sc-code-background); }
.composer-input .md-c { border-radius: var(--sc-radius-xs); }
.composer-input .md-t { color: var(--text-muted); }
.composer-input .md-l { color: var(--text-link); }
.composer-input .md-q { border-left: var(--sc-quote-bar-width) solid var(--sc-quote-bar); padding-left: var(--sc-quote-gap); }
.composer-input .md-m { color: var(--text-muted); }
.phone .composer.typed .composer-row > .cbtn:not(.send, .emoji, :first-child) { display: none; }
.cbtn { width: var(--sc-composer-button); height: var(--sc-composer-button); margin: calc((var(--sc-composer-min-height) - var(--sc-composer-button)) / 2 - var(--sc-border-width)) 0; flex: none; }
.cbtn.send { background: var(--brand-500); color: var(--white-500); border-radius: 50%; }
.composer-meta { display: flex; align-items: center; gap: var(--sc-space-sm); align-self: flex-end; height: var(--sc-composer-min-height); color: var(--text-muted); flex: none; }
.composer-meta:empty { display: none; }
.counter.over { color: var(--text-danger); }
.slowmode { display: inline-flex; align-items: center; gap: var(--sc-space-xxs); }
.reply-bar { display: flex; align-items: center; gap: var(--sc-space-sm); height: var(--sc-button-height-sm); padding: 0 var(--sc-space-xs) 0 var(--sc-composer-pad-x); border-radius: var(--sc-composer-radius) var(--sc-composer-radius) 0 0; background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); border-bottom: 0; color: var(--header-secondary); }
.reply-ping { gap: var(--sc-space-xxs); padding: 0 var(--sc-space-xs); height: var(--sc-icon-lg); color: var(--text-muted); }
.reply-ping.on { color: var(--text-link); }
.typing { position: relative; height: 0; flex: none; z-index: 1; }
.typing-strip { position: absolute; left: 0; right: 0; bottom: 0; height: var(--sc-typing-height); display: flex; align-items: center; gap: var(--sc-space-xs); padding: 0 calc(var(--sc-composer-margin-x) + var(--sc-space-xs)); color: var(--header-secondary); white-space: nowrap; overflow: hidden; pointer-events: none; background: linear-gradient(to top, color-mix(in srgb, var(--chat-background) 92%, transparent), color-mix(in srgb, var(--chat-background) 55%, transparent)); animation: fade var(--sc-motion-hover-tint) both; }
.typing strong { color: var(--header-primary); font-weight: 600; }
.typing-avatars { display: inline-flex; gap: 2px; }
.typing-emoji { display: inline-flex; gap: 2px; align-items: center; flex: none; }
.typing-emoji .emoji { width: var(--sc-emoji-reaction); height: var(--sc-emoji-reaction); vertical-align: middle; }
.typing-emoji.pulse > * { animation: dots 1.4s infinite ease-in-out both; }
.typing-emoji.wave > * { animation: typing-wave 1.2s infinite ease-in-out; }
.typing-emoji.ring > * { animation: typing-ring 1.4s infinite ease-in-out; }
.typing-emoji > :nth-child(2) { animation-delay: .16s; }
.typing-emoji > :nth-child(3) { animation-delay: .32s; }
.typing-text { overflow: hidden; text-overflow: ellipsis; }
.autocomplete { position: absolute; left: var(--sc-composer-margin-x); right: var(--sc-composer-margin-x); bottom: calc(100% + var(--sc-space-sm)); max-height: calc(var(--sc-autocomplete-row-height) * var(--sc-autocomplete-max-rows) + var(--sc-space-xxl)); overflow-y: auto; padding: var(--sc-menu-pad); border-radius: var(--sc-popout-radius); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); z-index: 5; animation: popover var(--sc-motion-menu) both; transform-origin: 50% 100%; }
.ac-title { color: var(--text-muted); padding: var(--sc-space-xs) var(--sc-space-sm); }
.ac-row { display: flex; align-items: center; gap: var(--sc-space-sm); height: var(--sc-autocomplete-row-height); padding: 0 var(--sc-space-sm); border-radius: var(--sc-radius-md); cursor: pointer; }
.ac-row.selected { background: var(--sc-menu-hover); }
.ac-icon { display: inline-flex; color: var(--interactive-normal); }
.ac-sub { color: var(--text-muted); margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray { display: flex; gap: var(--sc-space-md); padding: var(--sc-space-md); overflow-x: auto; border-bottom: var(--sc-border-width) solid var(--border-subtle); }
.tray-card { position: relative; width: 160px; flex: none; padding: var(--sc-space-sm); border-radius: var(--sc-radius-md); background: var(--background-secondary); border: var(--sc-border-width) solid var(--border-subtle); display: flex; flex-direction: column; gap: var(--sc-space-sm); }
.tray-card.spoilered > .tray-img { visibility: visible; opacity: .2; }
.tray-card.spoilered > * { visibility: visible; }
.tray-img, .tray-file { width: 100%; height: 120px; object-fit: contain; border-radius: var(--sc-radius-sm); display: flex; align-items: center; justify-content: center; color: var(--interactive-normal); }
.tray-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-actions { position: absolute; right: var(--sc-space-xs); top: var(--sc-space-xs); display: flex; border-radius: var(--sc-radius-md); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); }
.upload-bar { height: var(--sc-space-xs); background: var(--background-accent); }
.upload-bar span { display: block; height: 100%; background: var(--brand-500); transition: width var(--sc-motion-color); }

/* member list */
.members { width: var(--sc-member-list-width); flex: none; overflow-y: auto; padding: 0 var(--sc-member-list-pad-x) var(--sc-space-lg); background: var(--background-secondary); border-left: var(--sc-border-width) solid var(--border-subtle); scrollbar-width: none; }
.member-counts { display: flex; padding: var(--sc-space-md) var(--sc-space-sm) 0; color: var(--text-muted); }
.member-group { height: var(--sc-member-group-height); display: flex; align-items: flex-end; padding: 0 var(--sc-space-sm) var(--sc-space-xs); color: var(--channels-default); }
.row.member { display: flex; align-items: center; gap: var(--sc-space-md); height: var(--sc-member-row-height); padding: 0 var(--sc-space-sm); border-radius: var(--sc-channel-row-radius); cursor: pointer; }
.row.member.offline { opacity: .45; }
.row.member.offline:hover { opacity: 1; }
.member-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-top { display: flex; align-items: center; gap: var(--sc-space-xs); min-width: 0; }
.member-top .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-top .name:not(.grad) { color: var(--sc-role-default); }
.member-sub { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown { color: var(--status-idle); display: inline-flex; flex: none; }
.boost { color: var(--sc-boost); display: inline-flex; flex: none; }
.boost svg path { fill: currentColor; }
.skeleton .sk-avatar { width: var(--sc-avatar-md); height: var(--sc-avatar-md); border-radius: 50%; background: var(--background-accent); }
.skeleton .sk-line { height: var(--sc-space-md); width: 50%; border-radius: var(--sc-radius-pill); background: var(--background-accent); }

/* phone */
.app.phone { display: block; position: relative; overflow: hidden; background: var(--background-mobile-secondary); }
.pager { --pane: 0; display: flex; width: 300vw; height: 100%; transform: translate3d(calc(var(--pane) * -100vw), 0, 0); will-change: transform; }
.pane { position: relative; width: 100vw; height: 100%; flex: none; display: flex; flex-direction: column; min-width: 0; padding-top: var(--sc-safe-top); }
.pane-chat { background: var(--chat-background); box-shadow: var(--elevation-high); }
.pane-members { background: var(--background-secondary); }
.phone .left { flex: 1; min-height: 0; width: 100%; }
.phone .rail { width: var(--sc-phone-rail-width); padding-bottom: calc(var(--sc-phone-tab-bar-height) + 2 * var(--sc-phone-tab-bar-margin) + var(--sc-safe-bottom)); }
.phone .sidebar { flex: 1; width: auto; border-right: 0; border-top-left-radius: var(--sc-panel-radius); border-top: var(--sc-border-width) solid var(--border-subtle); }
.phone .side-pad { height: calc(var(--sc-phone-tab-bar-height) + 2 * var(--sc-phone-tab-bar-margin) + var(--sc-safe-bottom)); }
.phone .user-bar { display: none; }
.phone .row.channel, .phone .row.thread { height: var(--sc-phone-row-height); }
.phone .row.dm { height: calc(var(--sc-phone-row-height) + var(--sc-space-lg)); }
.phone .dm-title, .phone .side-title { font-size: 1rem; }
.tab-bar { position: absolute; left: var(--sc-phone-tab-bar-margin); right: var(--sc-phone-tab-bar-margin); bottom: calc(var(--sc-phone-tab-bar-margin) + var(--sc-safe-bottom)); height: var(--sc-phone-tab-bar-height); display: flex; border-radius: var(--sc-phone-tab-bar-radius); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); z-index: 4; padding: var(--sc-space-xs); gap: var(--sc-space-xs); }
.tab { position: relative; flex: 1; flex-direction: column; gap: var(--sc-space-xxs); border-radius: calc(var(--sc-phone-tab-bar-radius) - var(--sc-space-xs)); color: var(--interactive-normal); }
.tab.selected { color: var(--brand-360); background: var(--background-modifier-selected); }
.tab .badge { position: absolute; top: var(--sc-space-xs); left: calc(50% + var(--sc-space-sm)); }
.phone .header { height: var(--sc-phone-header-height); padding-left: var(--sc-space-xs); }
.phone .hd-title { font-size: 1.0625rem; }
.phone .icon-btn { width: var(--sc-phone-touch-target); height: var(--sc-phone-touch-target); }
.phone .msg { padding-left: var(--sc-phone-message-gutter); padding-right: var(--sc-phone-message-pad-right); }
.phone .msg:hover { background: transparent; }
.phone .msg.mentioned:hover { background: var(--background-mentioned); }
.phone .msg-avatar { left: var(--sc-phone-message-avatar-left); }
.phone .msg-avatar .avatar { width: var(--sc-phone-message-avatar) !important; height: var(--sc-phone-message-avatar) !important; }
.phone .msg-stamp { display: none; }
.phone .reply-spine { left: calc(-1 * var(--sc-phone-message-gutter) + var(--sc-phone-message-avatar-left) + var(--sc-phone-message-avatar) / 2); width: calc(var(--sc-phone-message-gutter) - var(--sc-phone-message-avatar-left) - var(--sc-phone-message-avatar) / 2 - var(--sc-space-xs)); }
.phone .sys-icon { width: var(--sc-phone-message-gutter); }
.phone .hidden-run { padding-left: var(--sc-phone-message-gutter); }
.phone .composer-wrap { padding: 0 var(--sc-space-sm) calc(var(--sc-space-sm) + var(--sc-safe-bottom)); }
.phone .composer { border-radius: calc(var(--sc-phone-composer-min-height) / 2 + var(--sc-space-xs)); }
.phone .typing-strip { padding: 0 var(--sc-space-lg); }
.phone .members { width: 100%; flex: 1; border-left: 0; }
.phone .reaction { height: calc(var(--sc-reaction-height) + var(--sc-space-xs)); }
.phone .reaction.add { opacity: 1; }
.phone .codeblock { max-width: 100%; }
.phone .tooltip { display: none; }
.phone-page { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sc-space-lg) var(--sc-space-lg) calc(var(--sc-phone-tab-bar-height) + 2 * var(--sc-phone-tab-bar-margin) + var(--sc-safe-bottom) + var(--sc-space-lg)); }
.phone-page h1 { margin: 0 0 var(--sc-space-lg); color: var(--header-primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

.grad { -webkit-background-clip: text; background-clip: text; color: transparent; }
.composer-input:focus-visible, .field:focus-visible, .edit-input:focus-visible { box-shadow: none; }
.grow { flex: 1; }
.ok-text { color: var(--text-positive); }
.err-text { color: var(--text-danger); }
.field { width: 100%; height: var(--sc-input-height); padding: 0 var(--sc-space-md); border-radius: var(--sc-input-radius); background: var(--input-background); border: var(--sc-border-width) solid var(--border-strong); user-select: text; -webkit-user-select: text; transition: border-color var(--sc-motion-color); }
.field:focus { border-color: var(--sc-brand-line); }
.field::placeholder { color: var(--text-muted); }
textarea.field, .field.area { height: auto; padding: var(--sc-space-sm) var(--sc-space-md); resize: vertical; }
.field.big { height: calc(var(--sc-input-height) + var(--sc-space-md)); font-size: 1.125rem; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sc-space-sm); }
.chip { display: inline-flex; align-items: center; gap: var(--sc-space-xs); border-radius: var(--sc-radius-pill); }
span.chip { height: var(--sc-icon-lg); padding: 0 var(--sc-space-sm); background: var(--background-accent); color: var(--header-secondary); flex: none; }
span.chip.ok { color: var(--text-positive); }
.btn.secondary { background: var(--button-secondary-background); }
.round-btn { width: var(--sc-button-height); height: var(--sc-button-height); border-radius: 50%; background: var(--background-secondary-alt); flex: none; }
.round-btn.ok:hover { color: var(--text-positive); }
.round-btn.danger:hover { color: var(--text-danger); }
.kbd { padding: var(--sc-space-xxs) var(--sc-space-sm); border-radius: var(--sc-radius-sm); background: var(--sc-code-background); border: var(--sc-border-width) solid var(--sc-code-border); color: var(--header-primary); flex: none; }

/* overlays */
.overlays { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.overlay > * { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: var(--sc-scrim); animation: fade var(--sc-motion-scrim) both; }
.scrim.dark { background: var(--background-tertiary); opacity: .96; }
.popout { position: fixed; left: 0; top: 0; visibility: hidden; max-width: calc(100vw - 2 * var(--sc-popout-edge-margin)); max-height: calc(100dvh - 2 * var(--sc-popout-edge-margin)); display: flex; flex-direction: column; border-radius: var(--sc-popout-radius); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); overflow: hidden; transform-origin: var(--ox, 50%) var(--oy, 0); }
.popout.placed { visibility: visible; animation: popover var(--sc-motion-popover) both; }
.grip { width: var(--sc-phone-sheet-grip-width); height: var(--sc-phone-sheet-grip-height); border-radius: var(--sc-radius-pill); background: var(--border-strong); margin: var(--sc-space-sm) auto; flex: none; }
.menu { min-width: var(--sc-menu-width); padding: var(--sc-menu-pad); display: flex; flex-direction: column; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: var(--sc-space-sm); min-height: var(--sc-menu-row-height); padding: 0 var(--sc-menu-row-pad-x); border-radius: var(--sc-radius-sm); color: var(--interactive-normal); cursor: pointer; flex: none; }
.menu-item:hover { background: var(--sc-menu-hover); color: var(--header-primary); }
.menu-item.danger { color: var(--sc-menu-danger-text); }
.menu-item.danger:hover { background: var(--sc-menu-danger-hover); color: var(--sc-menu-danger-text); }
.menu-item.tall { min-height: calc(var(--sc-menu-row-height) + var(--sc-space-md)); }
.menu-item.selected { background: var(--background-modifier-selected); color: var(--header-primary); }
.menu-item > .ic { flex: none; }
.menu-label { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; }
.menu-hint { color: var(--text-muted); flex: none; }
.menu-check { width: var(--sc-checkbox-size); height: var(--sc-checkbox-size); border-radius: var(--sc-radius-sm); border: var(--sc-border-width) solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background-color var(--sc-motion-checkbox); }
.menu-check.on { background: var(--brand-500); border-color: var(--brand-500); color: var(--white-500); }
.menu-sep { height: var(--sc-border-width); margin: var(--sc-menu-separator-margin) var(--sc-space-xs); background: var(--border-subtle); flex: none; }
.menu-sub > .submenu { display: none; padding: 0 0 0 var(--sc-space-md); min-width: 0; }
.menu-sub.open > .submenu { display: flex; }
.menu-sub.open > .menu-item .ic { transform: rotate(90deg); }
.menu-reactions { display: flex; gap: var(--sc-space-xs); padding: var(--sc-space-xs); }
.menu-react { flex: 1; height: var(--sc-emoji-picker-cell); border-radius: var(--sc-radius-md); background: var(--background-secondary-alt); }
.menu-react .emoji { width: var(--sc-icon-lg); height: var(--sc-icon-lg); vertical-align: 0; }
.status-dot { width: var(--sc-space-md); height: var(--sc-space-md); border-radius: 50%; flex: none; }
.modal-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--sc-space-xl); pointer-events: none; }
.modal { pointer-events: auto; width: var(--sc-modal-width-sm); max-width: 100%; max-height: 100%; display: flex; flex-direction: column; border-radius: var(--sc-radius-modal); background: var(--modal-background); border: var(--sc-border-width) solid var(--border-strong); box-shadow: var(--elevation-high); overflow: hidden; animation: modal var(--sc-motion-modal) both; }
.modal.md { width: var(--sc-modal-width-md); }
.modal.lg { width: var(--sc-modal-width-lg); }
.modal.static { animation: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sc-space-sm); padding: var(--sc-modal-pad) var(--sc-modal-pad) 0; color: var(--header-primary); flex: none; }
.modal-body { padding: var(--sc-modal-pad); display: flex; flex-direction: column; gap: var(--sc-space-md); overflow-y: auto; min-height: 0; user-select: text; -webkit-user-select: text; }
.modal-body.center { align-items: center; text-align: center; }
.modal-body.list, .list { gap: var(--sc-space-xxs); display: flex; flex-direction: column; }
.list.tall { height: calc(8 * var(--sc-autocomplete-row-height)); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-modal-pad); background: var(--modal-footer-background); border-top: var(--sc-border-width) solid var(--border-subtle); flex: none; }
.leaving-url { padding: var(--sc-space-md); border-radius: var(--sc-radius-md); background: var(--sc-code-background); border: var(--sc-border-width) solid var(--sc-code-border); overflow-wrap: anywhere; }
.viewer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sc-space-md); padding: var(--sc-space-xxl); animation: modal var(--sc-motion-modal) both; }
.viewer-img { max-width: 100%; max-height: calc(100% - var(--sc-space-xxxl)); object-fit: contain; border-radius: var(--sc-radius-md); min-height: 0; }
.viewer { overflow: hidden; }
.viewer-img { cursor: zoom-in; touch-action: none; user-select: none; }
.viewer-img.zoomed { cursor: grab; z-index: 1; }
.viewer-img.snap { transition: transform var(--sc-motion-release); }
.viewer-alt { color: var(--header-secondary); max-width: var(--sc-modal-width-md); text-align: center; }
.viewer-bar { display: flex; gap: var(--sc-space-lg); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sc-space-xs) var(--sc-space-lg); }
.perm-row { display: flex; align-items: center; gap: var(--sc-space-sm); color: var(--text-muted); }
.perm-row.on { color: var(--header-primary); }
.perm-row.on .ic { color: var(--text-positive); }
.perm-row.off .ic { color: var(--text-danger); }
.invite-icon { width: var(--sc-avatar-xl); height: var(--sc-avatar-xl); border-radius: var(--sc-guild-icon-radius); background: var(--brand-500); color: var(--white-500); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }

/* pickers */
.picker { width: var(--sc-emoji-picker-width); height: var(--sc-emoji-picker-height); max-width: 100%; display: flex; flex-direction: column; min-height: 0; }
.picker-top { padding: var(--sc-space-md); border-bottom: var(--sc-border-width) solid var(--border-subtle); flex: none; }
.picker-main { flex: 1; min-height: 0; display: flex; }
.picker-nav { width: calc(var(--sc-emoji-picker-cell) + var(--sc-space-sm)); flex: none; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; gap: var(--sc-space-xxs); padding: var(--sc-space-xs) 0; background: var(--background-secondary-alt); border-right: var(--sc-border-width) solid var(--border-subtle); }
.picker-nav-btn { width: var(--sc-icon-button); height: var(--sc-icon-button); flex: none; }
.picker-nav-btn img, .picker-guild { width: var(--sc-icon-lg); height: var(--sc-icon-lg); border-radius: var(--sc-radius-sm); object-fit: cover; }
.picker-guild.acr, .mutual-icon.acr { display: inline-flex; align-items: center; justify-content: center; background: var(--background-accent); color: var(--text-normal); font-size: 10px; font-weight: 600; }
.picker-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--sc-space-sm) var(--sc-space-sm); }
.emoji-picker .picker-scroll { padding: 0 var(--sc-space-sm); overflow-anchor: none; }
.emoji-rows { position: relative; contain: strict; }
.emoji-row { position: absolute; left: 0; right: 0; height: var(--sc-emoji-picker-cell); display: flex; }
.emoji-sec-title { height: var(--sc-space-xxl); align-items: center; color: var(--header-secondary); overflow: hidden; white-space: nowrap; }
.emoji-cell { width: var(--sc-emoji-picker-cell); height: var(--sc-emoji-picker-cell); border-radius: var(--sc-radius-md); }
.emoji-cell .emoji { width: calc(var(--sc-emoji-picker-cell) - var(--sc-space-sm)); height: calc(var(--sc-emoji-picker-cell) - var(--sc-space-sm)); vertical-align: 0; }
.emoji-cell.locked { opacity: .4; }
.picker-foot { height: var(--sc-space-xxxl); flex: none; display: flex; align-items: center; gap: var(--sc-space-sm); padding: 0 var(--sc-space-md); background: var(--background-secondary-alt); border-top: var(--sc-border-width) solid var(--border-subtle); color: var(--header-secondary); overflow: hidden; white-space: nowrap; }
.picker-foot .emoji { width: var(--sc-icon-lg); height: var(--sc-icon-lg); vertical-align: 0; }
.gif-picker .picker-scroll { padding-top: var(--sc-space-sm); }
.gif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sc-space-sm); }
.gif-grid.masonry { display: block; columns: 2; column-gap: var(--sc-space-sm); }
.gif-tile { position: relative; border-radius: var(--sc-radius-md); overflow: hidden; background: var(--background-secondary); cursor: pointer; break-inside: avoid; margin-bottom: var(--sc-space-sm); transition: transform var(--sc-motion-release); }
.gif-grid:not(.masonry) .gif-tile { margin-bottom: 0; }
.gif-tile:active { transform: scale(var(--sc-press-scale)); }
.gif-tile img, .gif-tile video { width: 100%; height: 100%; object-fit: cover; }
.gif-tile.cat { aspect-ratio: 16 / 9; }
.gif-cat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: var(--sc-space-xs); background: var(--sc-scrim); color: var(--white-500); }
.gif-fav { position: absolute; right: var(--sc-space-xs); top: var(--sc-space-xs); width: var(--sc-icon-button); height: var(--sc-icon-button); background: var(--sc-scrim); color: var(--white-500); opacity: 0; }
.gif-tile:hover .gif-fav, .gif-fav.active { opacity: 1; }
.gif-fav.active { color: var(--status-idle); }

/* profile */
.profile-wrap { position: relative; width: var(--sc-profile-popout-width); max-width: 100%; display: flex; min-height: 0; max-height: inherit; --pbg: var(--background-floating); }
.profile-wrap.themed { --pbg: color-mix(in srgb, var(--p1) 38%, var(--background-floating)); --pbg2: color-mix(in srgb, var(--p2) 38%, var(--background-floating)); background: linear-gradient(var(--p1), var(--p2)); padding: var(--sc-profile-theme-border); border-radius: inherit; }
.profile { --ring-bg: var(--pbg); flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; min-height: 0; background: var(--pbg); border-radius: inherit; scrollbar-width: none; }
.themed .profile { background: linear-gradient(var(--pbg), var(--pbg2)); border-radius: calc(var(--sc-popout-radius) - var(--sc-profile-theme-border)); }
.profile.loading { width: var(--sc-profile-popout-width); max-width: 100%; min-height: calc(2 * var(--sc-profile-banner-height)); justify-content: center; align-items: center; }
.profile-banner { position: relative; height: var(--sc-profile-banner-height); flex: none; background: var(--brand-600); overflow: hidden; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.themed .profile-banner { background: var(--p1); }
.profile.full .profile-banner { height: calc(var(--sc-profile-banner-height) * 1.6); }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-corner { position: absolute; top: var(--sc-space-sm); right: var(--sc-space-sm); display: flex; gap: var(--sc-space-xs); }
.profile-corner-btn { width: var(--sc-icon-button); height: var(--sc-icon-button); border-radius: 50%; background: var(--background-floating); color: var(--interactive-active); border: var(--sc-border-width) solid var(--border-strong); }
.profile-corner-btn:hover { background: var(--background-modifier-hover); }
.profile-head { position: relative; display: flex; align-items: flex-start; gap: var(--sc-space-sm); padding: 0 var(--sc-space-lg); margin-top: calc(var(--sc-avatar-xl) / -2); flex: none; }
.profile.full .profile-head { margin-top: calc(var(--sc-avatar-xxl) / -2); }
.profile-avatar { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 calc(var(--sc-space-xs) + 2px) var(--pbg); background: var(--pbg); cursor: pointer; flex: none; }
.profile.full .profile-avatar { cursor: default; }
.profile-bubble { position: relative; align-self: flex-end; margin-bottom: var(--sc-space-xs); min-width: 0; max-width: 100%; padding: var(--sc-space-xs) var(--sc-space-sm); border-radius: var(--sc-radius-lg); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); color: var(--text-normal); }
.profile-bubble > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.profile-bubble::before { content: ""; position: absolute; left: calc(-1 * var(--sc-space-sm)); top: var(--sc-space-xs); width: var(--sc-space-sm); height: var(--sc-space-sm); border-radius: 50%; background: inherit; border: inherit; }
.profile-body { padding: var(--sc-space-md) var(--sc-space-lg) var(--sc-space-md); display: flex; flex-direction: column; gap: var(--sc-space-sm); user-select: text; -webkit-user-select: text; }
.profile-names { display: flex; align-items: center; gap: var(--sc-space-sm); flex-wrap: wrap; color: var(--header-primary); }
.profile-name { cursor: pointer; min-width: 0; }
.profile.full .profile-name { cursor: text; }
.profile-name:hover .name:not(.grad) { text-decoration: underline; }
.profile-sub { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sc-space-xs); color: var(--header-primary); }
.profile-dotsep { color: var(--text-muted); }
.server-tag-badge { width: var(--sc-icon-xs); height: var(--sc-icon-xs); }
.profile-badges { display: flex; flex-wrap: wrap; align-self: flex-start; gap: var(--sc-space-xxs); padding: var(--sc-space-xxs) var(--sc-space-xs); border-radius: var(--sc-radius-sm); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-subtle); }
.profile-badge, .badge-img { width: var(--sc-icon-md); height: var(--sc-icon-md); display: inline-flex; }
.profile-mutuals { display: flex; align-items: center; gap: var(--sc-space-xs); align-self: flex-start; color: var(--header-secondary); }
.profile-mutuals:hover { color: var(--header-primary); text-decoration: underline; }
.profile-mutual-avatars { display: inline-flex; }
.profile-mutual-avatars .avatar { box-shadow: 0 0 0 2px var(--pbg); border-radius: 50%; }
.profile-mutual-avatars .avatar + .avatar { margin-left: calc(-1 * var(--sc-space-xs)); }
.profile-bio.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.profile-more { align-self: flex-start; color: var(--header-primary); font-weight: 600; }
.profile-more:hover { text-decoration: underline; }
.profile-actions { display: flex; flex-wrap: wrap; gap: var(--sc-space-sm); }
.profile-sec { display: flex; flex-direction: column; gap: var(--sc-space-xs); color: var(--header-primary); }
.profile-sec .sc-t-eyebrow { text-transform: none; letter-spacing: 0; color: var(--header-primary); }
.profile-fx { position: absolute; inset: 0; container-type: size; pointer-events: none; overflow: hidden; border-radius: inherit; z-index: 2; }
.profile-fx img { position: absolute; max-width: none; }
.role-chips { display: flex; flex-wrap: wrap; gap: var(--sc-space-xs); }
.role-chip { display: inline-flex; align-items: center; gap: var(--sc-space-xs); height: var(--sc-icon-lg); padding: 0 var(--sc-space-sm); border-radius: var(--sc-radius-sm); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); color: var(--header-secondary); }
.role-chip i { width: var(--sc-space-md); height: var(--sc-space-md); border-radius: 50%; background: var(--c, var(--sc-role-default)); }
.act-card { display: flex; flex-direction: column; gap: var(--sc-space-sm); padding: var(--sc-space-sm) var(--sc-space-md) var(--sc-space-md); border-radius: var(--sc-radius-md); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-subtle); }
.act-head { display: flex; align-items: center; gap: var(--sc-space-xs); color: var(--header-secondary); font-weight: 600; }
.act-row { display: flex; gap: var(--sc-space-md); align-items: center; }
.act-art { width: calc(var(--sc-avatar-xl) - var(--sc-space-md)); height: calc(var(--sc-avatar-xl) - var(--sc-space-md)); border-radius: var(--sc-radius-md); object-fit: cover; flex: none; background: var(--background-accent); }
.act-text { min-width: 0; display: flex; flex-direction: column; color: var(--header-primary); }
.act-title { font-weight: 700; }
.act-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-progress { display: flex; align-items: center; gap: var(--sc-space-sm); color: var(--header-secondary); font-variant-numeric: tabular-nums; }
.act-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--background-accent); overflow: hidden; }
.act-bar i { display: block; height: 100%; background: var(--header-primary); border-radius: inherit; }
.dm-profile { width: var(--sc-dm-profile-width); flex: none; display: flex; overflow-y: auto; background: var(--background-secondary); border-left: var(--sc-border-width) solid var(--border-subtle); scrollbar-width: none; }
.dm-profile .profile-wrap { width: 100%; min-height: 100%; box-sizing: border-box; border-radius: 0; }
.dm-profile .profile, .dm-profile .themed .profile { border-radius: 0; overflow: visible; }
.dm-profile .profile-banner { border-radius: 0; height: calc(var(--sc-profile-banner-height) + var(--sc-space-lg)); }
.dm-profile .profile.loading { width: 100%; }
.name.ns-neon { text-shadow: 0 0 6px var(--ns), 0 0 2px var(--ns); }
.name.ns-glow { text-shadow: 0 0 10px var(--ns); }
.name.ns-toon { -webkit-text-stroke: 1px var(--background-tertiary); paint-order: stroke fill; }
.name.ns-pop { text-shadow: 2px 2px 0 var(--background-tertiary); }
.name.grad.ns-neon, .name.grad.ns-glow, .name.grad.ns-pop { text-shadow: none; filter: drop-shadow(0 0 4px var(--ns)); }
.name.grad.ns-pop { filter: drop-shadow(2px 2px 0 var(--background-tertiary)); }
.mutual-icon { width: var(--sc-avatar-md); height: var(--sc-avatar-md); border-radius: var(--sc-radius-md); object-fit: cover; flex: none; }

/* panels */
.panel-pop { width: var(--sc-search-panel-width); height: min(70dvh, 640px); }
.panel-head { display: flex; align-items: center; gap: var(--sc-space-sm); height: var(--sc-header-height); padding: 0 var(--sc-space-md); border-bottom: var(--sc-border-width) solid var(--border-subtle); color: var(--header-primary); flex: none; }
.panel-tabs { padding: var(--sc-space-sm) var(--sc-space-md); flex: none; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sc-space-sm); display: flex; flex-direction: column; gap: var(--sc-space-sm); }
.panel-sub { padding: var(--sc-space-sm) var(--sc-space-xs) 0; }
.result-card { position: relative; border-radius: var(--sc-radius-md); background: var(--background-secondary); border: var(--sc-border-width) solid var(--border-subtle); padding: var(--sc-space-xs) 0; flex: none; }
.result-card .msg { padding-right: var(--sc-space-md); }
.result-card .msg:hover { background: transparent; }
.result-jump { position: absolute; right: var(--sc-space-sm); top: var(--sc-space-sm); z-index: 2; opacity: 0; }
.result-card:hover .result-jump { opacity: 1; }
.thread-item { display: flex; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-space-sm); border-radius: var(--sc-radius-md); cursor: pointer; flex: none; }
.thread-item-text { flex: 1; min-width: 0; }
.thread-item.unread .sc-t-label { color: var(--header-primary); }
.unread-group { display: flex; flex-direction: column; gap: var(--sc-space-xs); flex: none; }
.unread-head { display: flex; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-space-xs) var(--sc-space-sm); border-radius: var(--sc-radius-md); cursor: pointer; color: var(--header-primary); }
.search-panel { position: absolute; right: 0; top: var(--sc-header-height); bottom: 0; width: var(--sc-search-panel-width); display: flex; flex-direction: column; min-height: 0; background: var(--background-secondary); border-left: var(--sc-border-width) solid var(--border-subtle); animation: slide-in var(--sc-motion-panel-slide) both; }
.search-suggest { display: flex; flex-direction: column; }
.search-meta, .pager-row { display: flex; align-items: center; gap: var(--sc-space-sm); color: var(--header-secondary); flex: none; }
.pager-row { justify-content: center; }
.switcher { width: var(--sc-quick-switcher-width); padding: var(--sc-modal-pad); gap: var(--sc-space-sm); }
.switcher-tip { padding-top: var(--sc-space-xs); }
.add-account { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sc-space-xl); }
.add-col { display: flex; flex-direction: column; gap: var(--sc-space-sm); min-width: 0; }
.qr-box { aspect-ratio: 1; width: 100%; max-width: 240px; display: flex; align-items: center; justify-content: center; border-radius: var(--sc-radius-md); background: var(--white-500); padding: var(--sc-space-sm); align-self: center; }
.qr, .qr svg { width: 100%; height: 100%; }
.qr-note { display: flex; flex-direction: column; align-items: center; gap: var(--sc-space-sm); text-align: center; color: var(--background-tertiary); }
.qr-box .spinner span { background: var(--background-accent); }

/* friends */
.ftabs { display: flex; gap: var(--sc-space-sm); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ftab { display: inline-flex; align-items: center; gap: var(--sc-space-xs); height: var(--sc-button-height-sm); padding: 0 var(--sc-space-md); border-radius: var(--sc-radius-md); color: var(--interactive-normal); flex: none; transition: background-color var(--sc-motion-hover-out), color var(--sc-motion-hover-out), transform var(--sc-motion-release); }
.ftab:hover { background: var(--background-modifier-hover); color: var(--interactive-hover); }
.ftab:active { transform: scale(var(--sc-press-scale)); }
.ftab.selected { background: var(--background-modifier-selected); color: var(--interactive-active); }
.ftab.add { background: var(--brand-500); color: var(--white-500); }
.ftab.add.selected { background: transparent; color: var(--brand-360); }
.friends-body { flex: 1; min-height: 0; padding: var(--sc-space-lg) var(--sc-space-xl); }
.friends-search { margin-bottom: var(--sc-space-sm); }
.friend { display: flex; align-items: center; gap: var(--sc-space-md); height: calc(var(--sc-member-row-height) + var(--sc-space-lg)); padding: 0 var(--sc-space-md); border-radius: var(--sc-radius-md); border-top: var(--sc-border-width) solid var(--border-subtle); cursor: pointer; --ring-bg: var(--chat-background); }
.fr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-name { display: flex; align-items: baseline; gap: var(--sc-space-sm); color: var(--header-primary); min-width: 0; }
.fr-username { color: var(--text-muted); opacity: 0; transition: opacity var(--sc-motion-hover-out); }
.friend:hover .fr-username { opacity: 1; }
.fr-sub { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-actions { display: flex; gap: var(--sc-space-sm); flex: none; }
.add-friend { display: flex; flex-direction: column; gap: var(--sc-space-sm); max-width: var(--sc-settings-content-width); color: var(--header-primary); }
.add-friend-row { display: flex; gap: var(--sc-space-sm); margin-top: var(--sc-space-sm); }

/* settings */
.settings { position: fixed; inset: 0; z-index: 90; display: flex; background: var(--background-primary); animation: modal var(--sc-motion-modal) both; padding-top: var(--sc-safe-top); }
.set-nav { width: calc(var(--sc-settings-sidebar-width) + var(--sc-space-xl)); flex: none; height: 100%; padding: var(--sc-space-lg) var(--sc-space-md); background: var(--background-secondary); border-right: var(--sc-border-width) solid var(--border-subtle); }
.set-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sc-space-sm) var(--sc-space-sm); color: var(--header-primary); }
.set-nav-head .icon-btn { display: none; }
.set-nav-item { width: 100%; display: flex; align-items: center; gap: var(--sc-space-md); height: var(--sc-channel-row-height); margin-top: var(--sc-channel-row-gap); padding: 0 var(--sc-space-sm); border-radius: var(--sc-channel-row-radius); color: var(--channels-default); text-align: left; }
.set-nav-item:hover { color: var(--interactive-hover); }
.set-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-head { display: flex; align-items: center; gap: var(--sc-space-md); height: calc(var(--sc-header-height) + var(--sc-space-lg)); padding: 0 var(--sc-space-lg) 0 var(--sc-space-xxl); flex: none; color: var(--header-primary); border-bottom: var(--sc-border-width) solid var(--border-subtle); }
.set-head h2 { margin: 0; white-space: nowrap; }
.set-back { display: none; }
.set-back.show { display: inline-flex; }
.set-filter { width: var(--sc-header-search-width); height: var(--sc-button-height-sm); }
.set-body { flex: 1; min-height: 0; }
.set-page { max-width: var(--sc-settings-content-width); padding: var(--sc-space-lg) var(--sc-space-xxl) var(--sc-space-xxxl); display: flex; flex-direction: column; gap: var(--sc-space-xl); }
.set-section { display: flex; flex-direction: column; gap: var(--sc-space-sm); }
.set-section h3 { margin: 0; color: var(--channels-default); }
.set-row { display: flex; align-items: center; gap: var(--sc-space-md); min-height: calc(var(--sc-input-height) + var(--sc-space-md)); padding: var(--sc-space-sm) var(--sc-space-md); border-radius: var(--sc-radius-md); background: var(--background-secondary); border: var(--sc-border-width) solid var(--border-subtle); }
.set-row.col { flex-direction: column; align-items: stretch; }
.set-row.disabled { opacity: .5; }
.set-row.account { cursor: pointer; }
.set-row.account.selected { border-color: var(--sc-brand-line); }
.set-head-row, .set-head { min-width: 0; }
.set-row .set-head { height: auto; padding: 0; border: 0; justify-content: space-between; }
.set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sc-space-xxs); }
.set-label { color: var(--header-primary); }
.set-desc, .set-info { color: var(--header-secondary); margin: 0; }
.set-value { color: var(--brand-360); flex: none; }
.slider { position: relative; display: block; height: var(--sc-slider-knob); }
.slider input { -webkit-appearance: none; appearance: none; position: relative; width: 100%; height: var(--sc-slider-knob); margin: 0; background: transparent; cursor: pointer; }
.slider input::-webkit-slider-runnable-track { height: var(--sc-slider-track); border-radius: var(--sc-radius-pill); background: var(--sc-toggle-off); }
.slider input::-moz-range-track { height: var(--sc-slider-track); border-radius: var(--sc-radius-pill); background: var(--sc-toggle-off); }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: var(--sc-slider-knob); height: var(--sc-slider-knob); margin-top: calc((var(--sc-slider-track) - var(--sc-slider-knob)) / 2); border-radius: 50%; background: var(--brand-500); border: 0; transition: transform var(--sc-motion-release); }
.slider input::-moz-range-thumb { width: var(--sc-slider-knob); height: var(--sc-slider-knob); border-radius: 50%; background: var(--brand-500); border: 0; }
.slider input:active::-webkit-slider-thumb { transform: scale(1.2); }
.ticks { position: absolute; left: calc(var(--sc-slider-knob) / 2); right: calc(var(--sc-slider-knob) / 2); top: 0; bottom: 0; pointer-events: none; }
.tick { position: absolute; top: 50%; width: 2px; height: var(--sc-space-md); margin: calc(var(--sc-space-md) / -2) 0 0 -1px; border-radius: 1px; background: var(--border-strong); }
.radios { display: flex; flex-direction: column; gap: var(--sc-space-xs); }
.radio { display: flex; align-items: center; gap: var(--sc-space-md); min-height: var(--sc-input-height); padding: 0 var(--sc-space-md); border-radius: var(--sc-radius-md); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-subtle); color: var(--header-secondary); text-align: left; }
.radio.selected { border-color: var(--sc-brand-line); color: var(--header-primary); }
.radio-dot { width: var(--sc-checkbox-size); height: var(--sc-checkbox-size); border-radius: 50%; border: 2px solid var(--interactive-normal); flex: none; position: relative; }
.radio.selected .radio-dot { border-color: var(--brand-500); }
.radio.selected .radio-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand-500); animation: pop var(--sc-motion-checkbox) both; }
.plugin-card, .rule-card, .me-card { display: flex; flex-direction: column; gap: var(--sc-space-sm); padding: var(--sc-space-md); border-radius: var(--sc-radius-md); background: var(--background-secondary); border: var(--sc-border-width) solid var(--border-subtle); transition: border-color var(--sc-motion-color); }
.plugin-card.on { border-color: var(--sc-brand-line); }
.plugin-head { display: flex; align-items: center; gap: var(--sc-space-sm); }
.plugin-name { flex: 1; min-width: 0; color: var(--header-primary); font-weight: 600; }
.rule-card .set-row { background: var(--background-secondary-alt); }
.me-card { flex-direction: row; align-items: center; gap: var(--sc-space-lg); }
.me-avatar { width: var(--sc-avatar-xl); height: var(--sc-avatar-xl); border-radius: 50%; }
.acct-avatar { width: var(--sc-avatar-lg); height: var(--sc-avatar-lg); border-radius: 50%; }
.set-page:has(.plugin-card) .set-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.set-page:has(.plugin-card) .set-section > h3, .set-page:has(.plugin-card) .set-section > :not(.plugin-card) { grid-column: 1 / -1; }

/* phone overlays */
.phone .popout { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: none; max-height: 85dvh; border-radius: var(--sc-phone-sheet-radius) var(--sc-phone-sheet-radius) 0 0; border-width: var(--sc-border-width) 0 0; padding-bottom: var(--sc-safe-bottom); transform-origin: 50% 100%; }
.phone .popout.placed { animation: sheet var(--sc-motion-sheet) both; }
.phone .menu { min-width: 0; padding: 0 var(--sc-space-sm) var(--sc-space-sm); }
.phone .menu-item { min-height: var(--sc-phone-row-height); padding: 0 var(--sc-space-md); border-radius: var(--sc-radius-md); }
.phone .picker, .phone .profile, .phone .panel-pop { width: 100%; }
.phone .picker { height: 60dvh; }
.phone .panel-pop { height: 75dvh; }
.phone .modal-wrap { padding: var(--sc-space-md); align-items: flex-end; padding-bottom: calc(var(--sc-space-md) + var(--sc-safe-bottom)); }
.phone .modal { width: 100%; }
.phone .add-account { grid-template-columns: 1fr; }
.phone .perm-grid { grid-template-columns: 1fr; }
.phone .search-panel { position: fixed; inset: 0; width: 100%; z-index: 80; padding-top: var(--sc-safe-top); }
.phone .result-jump { opacity: 1; }
.phone .friends-body { padding: var(--sc-space-md); }
.phone .fr-username { display: none; }
.phone .settings { display: block; animation: sheet var(--sc-motion-sheet) both; }
.phone .set-nav { width: 100%; border-right: 0; }
.phone .set-nav-head .icon-btn { display: inline-flex; }
.phone .set-nav-item { height: var(--sc-phone-row-height); }
.phone .set-main { position: absolute; inset: 0; padding-top: var(--sc-safe-top); background: var(--background-primary); transform: translateX(100%); transition: transform var(--sc-motion-drawer); }
.phone .settings.detail .set-main { transform: none; }
.phone .set-head { padding: 0 var(--sc-space-xs); height: var(--sc-phone-header-height); }
.phone .set-back { display: inline-flex; }
.phone .set-close { display: none; }
.phone .set-page { padding: var(--sc-space-md) var(--sc-space-md) calc(var(--sc-space-xxxl) + var(--sc-safe-bottom)); }
.phone .set-filter { width: auto; flex: 1; min-width: 0; }
.inbox-page { display: flex; flex-direction: column; }
.inbox-page .panel-tabs { padding: 0 0 var(--sc-space-sm); }
.inbox-page .panel-scroll { padding: 0; overflow: visible; }
.you { padding: var(--sc-space-lg) var(--sc-space-lg) calc(var(--sc-phone-tab-bar-height) + 2 * var(--sc-phone-tab-bar-margin) + var(--sc-safe-bottom) + var(--sc-space-lg)); display: flex; flex-direction: column; gap: var(--sc-space-lg); }
.you-card { display: flex; flex-direction: column; align-items: center; gap: var(--sc-space-xs); padding: var(--sc-space-xl) var(--sc-space-lg); border-radius: var(--sc-panel-radius); background: var(--background-secondary); border: var(--sc-border-width) solid var(--border-subtle); color: var(--header-primary); --ring-bg: var(--background-secondary); }
.you-group { display: flex; flex-direction: column; border-radius: var(--sc-panel-radius); background: var(--background-secondary); border: var(--sc-border-width) solid var(--border-subtle); overflow: hidden; }
.you-row { display: flex; align-items: center; gap: var(--sc-space-md); min-height: calc(var(--sc-phone-row-height) + var(--sc-space-sm)); padding: 0 var(--sc-space-lg); color: var(--header-primary); text-align: left; }
.you-row + .you-row { border-top: var(--sc-border-width) solid var(--border-subtle); }
.you-icon { color: var(--interactive-normal); display: inline-flex; }
.you-chev { margin-left: auto; color: var(--text-muted); display: inline-flex; }
.hd-search { display: inline-flex; align-items: center; justify-content: space-between; width: var(--sc-header-search-width); height: calc(var(--sc-icon-button) - var(--sc-space-xs)); margin: 0 var(--sc-space-xs); padding: 0 var(--sc-space-sm); border-radius: var(--sc-radius-md); background: var(--background-tertiary); border: var(--sc-border-width) solid var(--border-subtle); color: var(--text-muted); cursor: text; transition: width var(--sc-motion-search-width), border-color var(--sc-motion-color); }
.hd-search:hover { border-color: var(--border-strong); }
.hd-buttons { align-items: center; }
.cbtn.silent.active { background: transparent; color: var(--text-danger); }
.phone .rail-item:not(.selected) > .guild-icon:not(.folder-icon):hover { border-radius: var(--sc-guild-icon-radius); background: var(--background-primary); color: var(--text-normal); }
/* full profile */
.modal.profile-modal { width: var(--sc-profile-modal-width); height: var(--sc-profile-modal-height); padding: 0; }
.pf { position: relative; flex: 1; min-height: 0; display: flex; gap: var(--sc-space-xl); padding: calc(var(--sc-space-xl) + var(--sc-space-md)) var(--sc-space-xl) var(--sc-space-xl); background: var(--modal-background); overflow: hidden; }
.pf.themed { background: linear-gradient(color-mix(in srgb, var(--p1) 30%, var(--modal-background)), color-mix(in srgb, var(--p2) 30%, var(--modal-background))); }
.pf-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .18; pointer-events: none; }
.pf-close { position: absolute; top: var(--sc-space-sm); right: var(--sc-space-sm); z-index: 3; }
.pf-left { width: var(--sc-profile-modal-left); max-width: none; flex: none; max-height: 100%; border-radius: var(--sc-radius-modal); overflow: hidden; z-index: 1; border: var(--sc-border-width) solid var(--border-strong); }
.pf-left.themed { border: 0; }
.pf-left .profile { overflow-y: auto; }
.pf-left .profile-banner { height: calc(var(--sc-profile-banner-height) * 1.35); }
.pf-actions { display: flex; align-items: center; gap: var(--sc-space-sm); }
.pf-act-icon { width: calc(var(--sc-icon-button) + var(--sc-space-xs)); height: calc(var(--sc-icon-button) + var(--sc-space-xs)); border-radius: var(--sc-radius-md); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); color: var(--header-primary); }
.pf-act-icon:hover { background: var(--background-modifier-hover); }
.pf-note { display: block; box-sizing: border-box; width: 100%; resize: none; border: 0; margin-top: var(--sc-space-sm); padding: var(--sc-space-xs) var(--sc-space-sm); border-radius: var(--sc-radius-sm); background: var(--background-modifier-accent); color: var(--text-muted); font: inherit; }
.pf-note:focus { outline: none; background: var(--background-secondary-alt); color: var(--text-normal); }
.pf-switch { display: inline-flex; margin-left: auto; padding: 2px; border-radius: var(--sc-radius-md); background: var(--background-secondary-alt); border: var(--sc-border-width) solid var(--border-strong); }
.pf-switch button { display: inline-flex; align-items: center; gap: var(--sc-space-xs); padding: var(--sc-space-xs) var(--sc-space-sm); border: 0; border-radius: var(--sc-radius-sm); background: transparent; color: var(--text-muted); font: inherit; cursor: pointer; }
.pf-switch button.selected { background: var(--background-modifier-selected); color: var(--header-primary); }
.pf-right { flex: 1; min-width: 0; display: flex; flex-direction: column; z-index: 1; }
.pf-tabs { display: flex; gap: var(--sc-space-lg); border-bottom: var(--sc-border-width) solid var(--border-subtle); flex: none; }
.pf-tab { white-space: nowrap; padding: var(--sc-space-sm) 0; color: var(--interactive-normal); border-bottom: 2px solid transparent; margin-bottom: calc(-1 * var(--sc-border-width)); }
.pf-tab:hover { color: var(--interactive-hover); }
.pf-tab.selected { color: var(--interactive-active); border-bottom-color: var(--interactive-active); }
.pf-pane { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sc-space-md) 0; display: flex; flex-direction: column; gap: var(--sc-space-sm); }
.pf-row { display: flex; align-items: center; gap: var(--sc-space-md); padding: var(--sc-space-sm); border-radius: var(--sc-radius-md); cursor: pointer; }
.pf-row:hover { background: var(--background-modifier-hover); }
.pf-row .mutual-icon { width: var(--sc-avatar-lg); height: var(--sc-avatar-lg); }
.pf-row-text { display: flex; flex-direction: column; min-width: 0; }
.pf-empty { padding: var(--sc-space-lg) 0; }
.phone .modal.profile-modal { height: 85dvh; }
.phone .pf { flex-direction: column; padding: var(--sc-space-md); overflow-y: auto; }
.phone .pf-left { width: 100%; }
.phone .pf-left .profile { overflow: visible; }

/* pane resize */
.sidebar { position: relative; }
.members-wrap { position: relative; display: flex; flex: none; min-height: 0; }
.resizer { position: absolute; top: 0; bottom: 0; right: calc(var(--sc-space-xxs) * -1); width: var(--sc-space-xs); z-index: 2; cursor: col-resize; touch-action: none; transition: background-color var(--sc-motion-hover); }
.members-wrap > .resizer { right: auto; left: calc(var(--sc-space-xxs) * -1); }
.resizer:hover, .resizer.active { background: var(--brand-500); }
.phone .resizer { display: none; }
.thread-wrap { position: relative; display: flex; flex: none; min-height: 0; }
.thread-wrap > .resizer { right: auto; left: calc(var(--sc-space-xxs) * -1); }
.thread-pane { width: var(--sc-thread-pane-width); flex: none; min-width: 0; display: flex; flex-direction: column; background: var(--chat-background); border-left: var(--sc-border-width) solid var(--border-subtle); }
.thread-pane > .header { flex: none; }
.phone .thread-wrap { display: none; }

/* text cursor on selectable text */
.msg-content, .embed, .sys-text, .profile-bio { cursor: text; }
.guild-icon { outline: var(--sc-border-width) solid var(--border-subtle); outline-offset: calc(var(--sc-border-width) * -1); }
/* Gradient role names glow like Discord's; the one soft edge the user asked for. */
.grad { filter: drop-shadow(0 0 var(--sc-space-xxs) color-mix(in srgb, var(--glow, transparent) calc(var(--sc-name-glow-alpha) * 100%), transparent)); background-size: var(--sc-name-gradient-span) 100%; background-repeat: repeat-x; animation: name-grad var(--sc-name-gradient-period) linear infinite; }
@keyframes name-grad { from { background-position-x: 0; } to { background-position-x: var(--sc-name-gradient-span); } }
.unfocused .grad { animation-play-state: paused; }
/* virtual member list */
.member-rows { position: relative; contain: layout; }
.member-slot { position: absolute; left: 0; right: 0; height: var(--sc-member-row-height); display: flex; flex-direction: column; justify-content: flex-end; }
.member-slot > .member-group { height: var(--sc-member-row-height); }
.member-group { gap: var(--sc-space-xs); text-transform: none; white-space: nowrap; overflow: hidden; }
.member-group .role-icon { width: var(--sc-icon-sm); height: var(--sc-icon-sm); flex: none; }
.group-name { overflow: hidden; text-overflow: ellipsis; }
.group-count { flex: none; }
.fwd-check svg { opacity: 0; }
.fwd-check.on svg { opacity: 1; }
.fwd-row .menu-label { flex: 1; min-width: 0; }
.fwd-count { margin-right: auto; }
.fwd-chips { display: flex; flex-wrap: wrap; gap: var(--sc-space-xs); }
.fwd-chips:empty { display: none; }
.fwd-chip { display: inline-flex; align-items: center; gap: var(--sc-space-xs); padding: var(--sc-space-xxs) var(--sc-space-sm); border-radius: var(--sc-radius-pill); background: var(--button-secondary-background); color: var(--header-primary); max-width: 100%; }
.fwd-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-chip:hover { background: var(--button-secondary-background-hover); }
.emoji-wrap { cursor: pointer; }
.emoji-info, .role-pop { display: flex; flex-direction: column; gap: var(--sc-space-sm); padding: var(--sc-space-md); width: var(--sc-popout-width-sm, 280px); max-width: 100%; }
.emoji-info-top, .role-pop-head { display: flex; align-items: center; gap: var(--sc-space-md); min-width: 0; }
.role-pop-list { max-height: calc(8 * var(--sc-autocomplete-row-height)); overflow-y: auto; }
.viewer-fail { display: flex; flex-direction: column; align-items: center; gap: var(--sc-space-md); padding: var(--sc-space-xxl); border-radius: var(--sc-radius-lg); background: var(--background-floating); border: var(--sc-border-width) solid var(--border-strong); }
.perm-view { display: flex; gap: var(--sc-space-lg); min-height: 0; align-items: stretch; }
.perm-side { flex: none; width: var(--sc-menu-width); display: flex; flex-direction: column; gap: var(--sc-space-xxs); overflow-y: auto; }
.perm-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sc-space-md); overflow-y: auto; }
.perm-group-label { padding: var(--sc-space-sm) var(--sc-space-sm) var(--sc-space-xxs); }
.perm-entry { display: flex; align-items: center; gap: var(--sc-space-sm); padding: var(--sc-space-xs) var(--sc-space-sm); border-radius: var(--sc-radius-sm); text-align: left; min-width: 0; flex: none; }
.perm-entry-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.perm-dot { width: var(--sc-space-md); height: var(--sc-space-md); border-radius: 50%; background: var(--sc-role-default); flex: none; }
.phone .perm-view { flex-direction: column; }
.phone .perm-side { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
.phone .perm-group-label { display: none; }
.viewer-img.pending { opacity: 0; }
.viewer-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
