:root { --accent:#7c5cff; --bg:#0c0d13; --surface:#151823; --surface-2:#1c2030; --surface-3:#252b3e; --text:#f4f6fc; --muted:#9aa3b8; --line:rgba(255,255,255,.09); --danger:#ff6478; --shadow:0 24px 70px rgba(0,0,0,.35); --app-font-size:16px; color-scheme:dark; }
:root[data-theme="light"] { --bg:#eef1f8; --surface:#fff; --surface-2:#f5f7fc; --surface-3:#e9edf6; --text:#172033; --muted:#64708a; --line:rgba(23,32,51,.12); --shadow:0 24px 70px rgba(34,47,76,.15); color-scheme:light; }
:root[data-palette="oceano"] { --bg:#07131d; --surface:#0e202d; --surface-2:#143142; --surface-3:#1b4054; --muted:#9bc0ce; --line:rgba(157,220,239,.13); }
:root[data-palette="violeta"] { --bg:#120d1c; --surface:#211632; --surface-2:#302146; --surface-3:#412d5e; --muted:#c5afd7; --line:rgba(226,196,255,.13); }
:root[data-palette="floresta"] { --bg:#0c1813; --surface:#15281e; --surface-2:#1d3829; --surface-3:#274a35; --muted:#b4ccb9; --line:rgba(188,232,202,.13); }
:root[data-palette="rosa"] { --bg:#1d0d18; --surface:#301522; --surface-2:#442032; --surface-3:#5c2a43; --muted:#d9b4c7; --line:rgba(255,207,231,.13); }
:root[data-palette="por-do-sol"] { --bg:#210b22; --surface:#35112a; --surface-2:#501534; --surface-3:#70213d; --text:#fff3ec; --muted:#ffc2b0; --line:rgba(255,181,123,.18); --shadow:0 24px 70px rgba(125,18,67,.38); }
:root[data-palette="neon"] { --bg:#071a22; --surface:#092936; --surface-2:#0b3a48; --surface-3:#105264; --text:#eaffff; --muted:#9debed; --line:rgba(89,255,231,.19); --shadow:0 24px 70px rgba(0,186,209,.28); }
:root[data-palette="ouro"] { --bg:#2b2100; --surface:#443300; --surface-2:#624b05; --surface-3:#856710; --text:#fff9df; --muted:#f2db8c; --line:rgba(255,222,111,.22); --shadow:0 24px 70px rgba(154,108,0,.34); }
:root[data-palette="baunilha"] { --bg:#fff5cf; --surface:#fffaf0; --surface-2:#fff0b8; --surface-3:#ffe495; --text:#4a3700; --muted:#8a6b1d; --line:rgba(103,74,0,.18); --shadow:0 24px 70px rgba(174,131,0,.18); color-scheme:light; }
:root[data-palette="carmesim"] { --bg:#28070c; --surface:#440e17; --surface-2:#641725; --surface-3:#8a2638; --text:#fff5f5; --muted:#f2b0b7; --line:rgba(255,164,174,.2); --shadow:0 24px 70px rgba(146,17,38,.38); }
:root[data-palette="coral"] { --bg:#fff0ee; --surface:#fff9f8; --surface-2:#ffdeda; --surface-3:#ffc2ba; --text:#52201b; --muted:#8f554d; --line:rgba(109,42,32,.16); --shadow:0 24px 70px rgba(201,77,59,.18); color-scheme:light; }
:root[data-palette="frutiger-aero"] { --accent:#078fd3; --bg:#caefff; --surface:rgba(241,253,255,.78); --surface-2:rgba(218,248,255,.76); --surface-3:rgba(187,237,250,.82); --text:#06365f; --muted:#246b83; --line:rgba(255,255,255,.82); --shadow:0 18px 48px rgba(0,105,162,.23); color-scheme:light; }
:root[data-palette="frutiger-aero"] body { background:linear-gradient(180deg,rgba(0,109,213,.08),rgba(74,244,205,.10)),url('/assets/frutiger-aero-sky-v1.png') center/cover fixed; }
:root[data-palette="frutiger-aero"] .surface,:root[data-palette="frutiger-aero"] .auth-card { border-color:rgba(255,255,255,.9); background:linear-gradient(135deg,rgba(255,255,255,.77),rgba(198,245,255,.48)); box-shadow:inset 0 1px 0 rgba(255,255,255,.92),var(--shadow); backdrop-filter:blur(18px) saturate(135%); }
:root[data-palette="frutiger-aero"] .server-rail,:root[data-palette="frutiger-aero"] .context-panel,:root[data-palette="frutiger-aero"] .main-panel { background-color:rgba(229,250,255,.58); }
:root[data-palette="frutiger-aero"] .primary { background:linear-gradient(180deg,#27c5f4,#087dce); border-color:rgba(255,255,255,.85); box-shadow:inset 0 1px 0 rgba(255,255,255,.78),0 8px 16px rgba(0,126,205,.24); }
:root[data-palette="frutiger-aero"] .secondary,:root[data-palette="frutiger-aero"] .icon-button,:root[data-palette="frutiger-aero"] .mini-icon,:root[data-palette="frutiger-aero"] .rail-button,:root[data-palette="frutiger-aero"] .tab { background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(179,239,255,.64)); border-color:rgba(255,255,255,.9); box-shadow:inset 0 1px 0 rgba(255,255,255,.95); }
:root[data-palette="frutiger-aero"] .channel-button:hover,:root[data-palette="frutiger-aero"] .channel-button.active,:root[data-palette="frutiger-aero"] .rail-button:hover,:root[data-palette="frutiger-aero"] .rail-button.active { background:linear-gradient(180deg,#6ae2ff,#149fdb); color:#fff; }
:root[data-palette="frutiger-aero"] .video-tile { border-color:rgba(255,255,255,.76); background:linear-gradient(135deg,rgba(4,105,180,.92),rgba(35,205,214,.72)); box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 10px 26px rgba(0,83,141,.22); }
:root[data-palette="frutiger-aero"] .call-dock { border-color:rgba(255,255,255,.78); background:rgba(225,250,255,.82); box-shadow:inset 0 1px 0 #fff,0 14px 32px rgba(0,94,157,.25); backdrop-filter:blur(18px) saturate(140%); }
:root[data-palette="preto"] { --bg:#000; --surface:#0a0a0a; --surface-2:#141414; --surface-3:#202020; --text:#f5f5f5; --muted:#a3a3a3; --line:rgba(255,255,255,.13); --shadow:0 20px 55px rgba(0,0,0,.55); color-scheme:dark; }
:root[data-palette="branco"] { --bg:#f6f6f6; --surface:#fff; --surface-2:#f0f0f0; --surface-3:#e3e3e3; --text:#111; --muted:#606060; --line:rgba(0,0,0,.14); --shadow:0 18px 45px rgba(0,0,0,.10); color-scheme:light; }
:root[data-theme="light"][data-palette="oceano"] { --bg:#e7f5f9; --surface:#fff; --surface-2:#f0fbfd; --surface-3:#dceff4; --text:#123140; --muted:#527682; --line:rgba(18,49,64,.13); }
:root[data-theme="light"][data-palette="violeta"] { --bg:#f4effb; --surface:#fff; --surface-2:#f8f4ff; --surface-3:#ece2fb; --text:#2c1d42; --muted:#716183; --line:rgba(44,29,66,.13); }
:root[data-theme="light"][data-palette="floresta"] { --bg:#edf7ef; --surface:#fff; --surface-2:#f3fbf4; --surface-3:#e0f1e3; --text:#1d3828; --muted:#617968; --line:rgba(29,56,40,.13); }
:root[data-theme="light"][data-palette="rosa"] { --bg:#fbeef5; --surface:#fff; --surface-2:#fff5fa; --surface-3:#f7dfeb; --text:#421d31; --muted:#836174; --line:rgba(66,29,49,.13); }
:root[data-theme="light"][data-palette="por-do-sol"] { --bg:#fff0eb; --surface:#fff; --surface-2:#fff5ee; --surface-3:#ffe1d2; --text:#532036; --muted:#90576b; --line:rgba(83,32,54,.14); }
:root[data-theme="light"][data-palette="neon"] { --bg:#e8fbfa; --surface:#fff; --surface-2:#f0fffe; --surface-3:#cef7f1; --text:#073b48; --muted:#39717a; --line:rgba(7,59,72,.14); }
:root[data-theme="light"][data-palette="ouro"] { --bg:#fff3c2; --surface:#fff; --surface-2:#fff8df; --surface-3:#ffebb0; --text:#4b3600; --muted:#88671a; --line:rgba(75,54,0,.15); }
:root[data-theme="light"][data-palette="carmesim"] { --bg:#fff0f1; --surface:#fff; --surface-2:#fff6f6; --surface-3:#ffdce0; --text:#531521; --muted:#8c4a55; --line:rgba(83,21,33,.15); }
:root[data-palette="lavanda"] { --bg:#171225; --surface:#241b38; --surface-2:#33274d; --surface-3:#493768; --text:#faf7ff; --muted:#c9bce0; --line:rgba(218,201,255,.15); }
:root[data-palette="menta"] { --bg:#e9fff5; --surface:#f9fffc; --surface-2:#d7f8e8; --surface-3:#afe9cd; --text:#173e31; --muted:#547e6e; --line:rgba(23,62,49,.14); color-scheme:light; }
:root[data-palette="mirtilo"] { --bg:#080e29; --surface:#101b43; --surface-2:#18285c; --surface-3:#263c82; --text:#f3f6ff; --muted:#aebbe7; --line:rgba(157,177,255,.16); }
:root[data-palette="brasa"] { --bg:#210b08; --surface:#35120d; --surface-2:#551b12; --surface-3:#7b291b; --text:#fff7f0; --muted:#efb7a0; --line:rgba(255,181,148,.17); }
:root[data-palette="cyber"] { --bg:#060716; --surface:#0c1026; --surface-2:#101b37; --surface-3:#153d55; --text:#eeffff; --muted:#84dfe2; --line:rgba(55,246,236,.18); --shadow:0 22px 64px rgba(0,241,221,.13); }
:root[data-palette="sakura"] { --bg:#fff0f6; --surface:#fffafd; --surface-2:#ffe0ed; --surface-3:#f7b6cf; --text:#54243a; --muted:#946078; --line:rgba(84,36,58,.14); color-scheme:light; }
:root[data-palette="gelo"] { --bg:#eafaff; --surface:#fbfeff; --surface-2:#d9f2f9; --surface-3:#b7ddea; --text:#173a4a; --muted:#577c8c; --line:rgba(23,58,74,.14); color-scheme:light; }
:root[data-palette="mocha"] { --bg:#211712; --surface:#30231c; --surface-2:#453228; --surface-3:#60483a; --text:#fff8f1; --muted:#d1b9a8; --line:rgba(237,207,187,.15); }
:root[data-font-size="small"] { --app-font-size:14px; }
:root[data-font-size="large"] { --app-font-size:18px; }
:root[data-font-family="rounded"] body { font-family:"Arial Rounded MT Bold",Nunito,ui-rounded,system-ui,sans-serif; }
:root[data-font-family="serif"] body { font-family:Georgia,"Times New Roman",serif; }
:root[data-font-family="mono"] body { font-family:"Cascadia Code",Consolas,monospace; }
:root[data-motion="reduced"] *,:root[data-motion="reduced"] *::before,:root[data-motion="reduced"] *::after { scroll-behavior:auto!important; animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; }
:root[data-corners="soft"] .surface,:root[data-corners="soft"] .dialog,:root[data-corners="soft"] button,:root[data-corners="soft"] input,:root[data-corners="soft"] select,:root[data-corners="soft"] textarea { border-radius:7px!important; }
:root[data-corners="square"] .surface,:root[data-corners="square"] .dialog,:root[data-corners="square"] button,:root[data-corners="square"] input,:root[data-corners="square"] select,:root[data-corners="square"] textarea { border-radius:0!important; }
:root[data-density="compact"] .messages { gap:7px; padding-block:12px; }
:root[data-density="compact"] .message { gap:8px; }
:root[data-density="spacious"] .messages { gap:22px; padding-block:27px; }
:root[data-density="spacious"] .message { gap:14px; }
:root[data-surfaces="soft"] .surface { background:color-mix(in srgb,var(--surface),var(--accent) 4%); }
:root[data-surfaces="glass"] .surface,:root[data-surfaces="glass"] .dialog { background:color-mix(in srgb,var(--surface),transparent 18%); backdrop-filter:blur(20px) saturate(125%); }
* { box-sizing:border-box; }
html { font-size:var(--app-font-size); }
html,body { min-height:100%; margin:0; background:var(--bg); color:var(--text); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
body { min-height:100dvh; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid color-mix(in srgb,var(--accent),transparent 60%); outline-offset:2px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:clamp(1.7rem,4vw,2.35rem); letter-spacing:-.045em; }
h2 { font-size:1.03rem; letter-spacing:-.02em; }
h3 { font-size:1.1rem; }
.hidden { display:none!important; }
.boot-splash{position:fixed;z-index:10000;inset:0;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 24% 13%,color-mix(in srgb,var(--accent),transparent 53%),transparent 35%),radial-gradient(circle at 78% 84%,#18bed844,transparent 43%),#0e1020;color:#f7f8ff;transition:opacity .2s ease}.boot-splash-leaving{opacity:0;pointer-events:none}.boot-splash-card{width:min(390px,100%);text-align:center}.boot-splash-mark{width:78px;height:78px;margin:0 auto 24px;border:1px solid #ffffff55;border-radius:25px;background:#edf7ff url('/auralink-icon-alpha-013.png') center/cover no-repeat;box-shadow:0 20px 55px #0008}.boot-splash-card strong,.boot-splash-card span,.boot-splash-card small{display:block}.boot-splash-card strong{font-size:1.6rem;letter-spacing:-.04em}.boot-splash-card span{min-height:1.5em;margin:10px 0 24px;color:#c9cae6;font-size:.95rem}.boot-splash-progress{display:block;height:7px;overflow:hidden;border-radius:99px;background:#ffffff1c}.boot-splash-progress::before{content:'';display:block;width:42%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#67ecf2,#997cff);animation:aura-boot-loading 1.25s ease-in-out infinite}.boot-splash-card small{margin-top:18px;color:#a3a4c1;font-size:.75rem}@keyframes aura-boot-loading{from{transform:translateX(-110%)}to{transform:translateX(340%)}}
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; clip-path:inset(50%); }
.muted,.field-hint,.empty-note { color:var(--muted); }
.eyebrow { color:var(--muted); font-size:.66rem; font-weight:800; letter-spacing:.13em; }
.primary,.secondary,.danger,.text-button,.icon-button,.mini-icon,.rail-button,.tab { border:1px solid var(--line); color:var(--text); background:var(--surface-2); border-radius:11px; font-weight:750; }
.primary { border-color:transparent; color:#fff; background:var(--accent); padding:.66rem .88rem; }
.secondary,.danger { padding:.6rem .76rem; }
.device-choice { display:flex; align-items:center; gap:8px; }
.device-choice select { min-width:0; flex:1; }
.device-permission { flex:0 0 auto; white-space:nowrap; }
.danger { color:var(--danger); background:color-mix(in srgb,var(--danger),transparent 88%); }
.wide { width:100%; }
.icon-button,.mini-icon { display:grid; place-items:center; padding:0; }
.icon-button { width:36px; height:36px; font-size:1.05rem; }
.mini-icon { width:26px; height:26px; font-size:1.05rem; }
.text-button { padding:.38rem .56rem; font-size:.73rem; }
.auth-view { min-height:100dvh; display:grid; place-items:center; padding:20px; background:radial-gradient(circle at 15% 20%,color-mix(in srgb,var(--accent),transparent 65%),transparent 32rem),var(--bg); }
.auth-card { width:min(430px,100%); display:flex; flex-direction:column; gap:17px; padding:34px; background:color-mix(in srgb,var(--surface),transparent 3%); border:1px solid var(--line); border-radius:27px; box-shadow:var(--shadow); }
.brand-mark { width:48px; height:48px; display:grid; place-items:center; color:#fff; background:linear-gradient(135deg,var(--accent),#20bfe9); border-radius:16px; border:0; font-size:1.3rem; font-weight:900; box-shadow:0 9px 22px color-mix(in srgb,var(--accent),transparent 67%); }
.app-logo { background:#edf7ff url('/auralink-icon-alpha-013.png') center/cover no-repeat; box-shadow:0 9px 24px rgba(20,132,255,.26); }
.tab-row { display:grid; grid-template-columns:1fr 1fr; padding:4px; background:var(--surface-2); border-radius:13px; }
.tab { border:0; background:transparent; padding:.58rem; color:var(--muted); }
.tab.active { color:var(--text); background:var(--surface-3); }
.auth-form,.dialog form { display:flex; flex-direction:column; gap:14px; }
label { display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:.82rem; font-weight:650; }
input,select,textarea { width:100%; min-height:43px; padding:.62rem .72rem; color:var(--text); background:var(--surface-2); border:1px solid var(--line); border-radius:10px; }
textarea { resize:vertical; }
input[type="color"] { padding:4px; }
.field-hint { font-weight:500; }
.captcha-box { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.captcha-box > div { display:flex; flex-direction:column; gap:2px; }
.captcha-box strong { color:var(--text); font-size:.92rem; }

.app-shell { display:grid; grid-template-columns:74px 270px minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:10px; height:100dvh; min-height:0; max-height:100dvh; padding:10px; overflow:hidden; }
.surface { border:1px solid var(--line); border-radius:20px; background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
:root[data-layout="minimal"] .surface { border-radius:0; box-shadow:none; }
:root[data-layout="minimal"] .server-rail { gap:7px; padding:8px; }
:root[data-layout="minimal"] .context-head,:root[data-layout="minimal"] .main-head { padding:14px; }
:root[data-layout="minimal"] .invite-bar { margin:10px; }
:root[data-layout="minimal"] .composer { padding:10px; }
:root[data-layout="minimal"] .messages { gap:11px; padding:16px; }
@media (min-width:851px) { :root[data-layout="minimal"] .app-shell { grid-template-columns:62px 238px minmax(0,1fr); gap:0; padding:0; } :root[data-layout="minimal"] .server-rail { border-left:0; border-top:0; border-bottom:0; } :root[data-layout="minimal"] .context-panel { border-top:0; border-bottom:0; border-radius:0; } :root[data-layout="minimal"] .main-panel { border-top:0; border-right:0; border-bottom:0; border-radius:0; } }
@media (min-width:851px) {
:root[data-layout="horizon"] .app-shell { grid-template-columns:minmax(238px,27vw) minmax(0,1fr); grid-template-rows:78px minmax(0,1fr); gap:0; padding:0; background:radial-gradient(circle at 72% 0%,color-mix(in srgb,var(--accent),transparent 76%),transparent 37rem),var(--bg); }
:root[data-layout="horizon"] .server-rail { grid-column:1 / -1; grid-row:1; flex-direction:row; align-items:center; justify-content:flex-start; width:100%; padding:12px 20px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:color-mix(in srgb,var(--surface),transparent 4%); overflow-x:hidden; overflow-y:hidden; }
:root[data-layout="horizon"] .server-rail .rail-button { width:48px; height:48px; border-radius:18px; }
:root[data-layout="horizon"] .server-rail .rail-dm-notifications,:root[data-layout="horizon"] .server-rail .rail-list { width:auto; max-height:none; flex-direction:row; overflow-x:auto; overflow-y:hidden; }
:root[data-layout="horizon"] .server-rail .rail-dm-notifications { flex:0 0 auto; }
:root[data-layout="horizon"] .server-rail .rail-list { flex:1 1 auto; min-width:0; }
:root[data-layout="horizon"] .server-rail .rail-actions { flex:0 0 auto; flex-direction:row; margin:0 0 0 auto; }
:root[data-layout="horizon"] .context-panel { grid-column:1; grid-row:2; border-width:0 1px 0 0; border-radius:0 24px 0 0; box-shadow:none; }
:root[data-layout="horizon"] .main-panel { grid-column:2; grid-row:2; margin:18px 18px 18px 0; border-radius:26px; }
:root[data-layout="horizon"] .profile-strip { border-radius:0; }
}
.server-rail { display:flex; flex-direction:column; align-items:center; gap:10px; padding:10px; overflow:hidden; }
.web-download-button { display:grid; place-items:center; width:46px; min-height:54px; padding:5px 2px; border:1px solid color-mix(in srgb,var(--accent),transparent 30%); border-radius:13px; color:#fff; background:linear-gradient(155deg,var(--accent),color-mix(in srgb,var(--accent),#1ecbe1 35%)); box-shadow:0 7px 17px color-mix(in srgb,var(--accent),transparent 68%); text-align:center; text-decoration:none; font-weight:850; line-height:1; }
.web-download-button span { font-size:1.1rem; }
.web-download-button small { margin-top:2px; font-size:.56rem; letter-spacing:.01em; }
.web-download-button:hover { filter:brightness(1.12); transform:translateY(-1px); }
.tauri-desktop .web-download-button { display:none; }
.mobile-web-download-button { display:none; }
.rail-button { position:relative; flex:0 0 auto; display:grid; place-items:center; width:46px; height:46px; padding:0; font-size:1.2rem; transition:.16s ease; }
.rail-button:hover,.rail-button.active { color:#fff; border-color:transparent; background:var(--accent); border-radius:14px; transform:translateY(-1px); }
.rail-avatar { width:100%; height:100%; display:grid; place-items:center; overflow:hidden; color:#fff; border-radius:13px; font-size:.88rem; font-weight:900; }
.rail-avatar img { width:100%; height:100%; object-fit:cover; }
.rail-dm-notifications,.rail-list { width:100%; display:flex; flex-direction:column; align-items:center; gap:8px; min-height:0; scrollbar-width:none; }
.rail-dm-notifications { flex:0 0 auto; max-height:35%; overflow-y:auto; overflow-x:hidden; }
.rail-list { flex:1 1 auto; overflow-y:auto; overflow-x:hidden; }
.rail-dm-notifications::-webkit-scrollbar,.rail-list::-webkit-scrollbar,.server-rail::-webkit-scrollbar { display:none; }
.rail-dm-button { border-color:color-mix(in srgb,var(--accent),transparent 38%); background:color-mix(in srgb,var(--accent),var(--surface-2) 84%); }
.rail-unread-badge { z-index:2; right:-6px; top:-6px; border-color:var(--surface); }
.rail-call-indicator { position:absolute; z-index:3; right:-7px; bottom:-6px; display:grid; width:23px; height:23px; place-items:center; color:#07140d; border:2px solid var(--surface); border-radius:50%; background:#52e29a; font-size:.72rem; animation:ring-phone 1.15s ease-in-out infinite; }
.rail-dm-button.is-ringing { border-color:#52e29a; box-shadow:0 0 0 3px rgba(82,226,154,.18); }
.rail-actions { display:flex; flex-direction:column; gap:8px; margin-top:auto; }
.mobile-account-button { display:none; }
.context-panel { display:flex; flex-direction:column; min-height:0; }
.context-panel.surface { overflow:visible; }
#serverContext,#directContext { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.context-head,.main-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:17px; border-bottom:1px solid var(--line); }
.context-head h2,.main-head h2 { margin-top:2px; }
.context-head-actions { display:flex; align-items:center; gap:5px; }
.invite-bar { display:flex; justify-content:space-between; align-items:center; gap:6px; padding:10px 12px; margin:12px; background:var(--surface-2); border:1px dashed var(--line); border-radius:12px; }
.invite-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
code { color:color-mix(in srgb,var(--accent),#fff 18%); font-size:.79rem; font-weight:800; }
.channel-section-head { display:flex; justify-content:space-between; align-items:center; padding:10px 14px 5px; color:var(--muted); font-size:.65rem; letter-spacing:.11em; font-weight:850; }
.channel-create-actions { display:flex; gap:4px; }
.channel-tree { display:flex; flex-direction:column; gap:10px; min-height:0; overflow:auto; padding:0 9px 12px; }
.category-group { display:flex; flex-direction:column; gap:2px; }
.category-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 5px 2px; color:var(--muted); font-size:.67rem; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.category-remove { width:22px; height:22px; color:var(--muted); font-size:1rem; }
.server-presence { border-top:1px solid var(--line); }
.online-member-list { display:flex; flex-direction:column; gap:3px; max-height:150px; overflow:auto; padding:0 12px 10px; }
.online-member { display:flex; align-items:center; gap:8px; min-height:32px; color:var(--muted); font-size:.8rem; }
.online-member .avatar { width:27px; height:27px; border-radius:9px; font-size:.65rem; }
.channel-list { display:flex; flex-direction:column; gap:2px; padding:0 9px; overflow:auto; }
.channel-entry { display:flex; flex-wrap:wrap; align-items:center; min-width:0; gap:2px; }
.channel-entry .channel-button { width:100%; flex:1; min-width:0; }
.dm-entry { display:flex; align-items:center; gap:2px; min-width:0; }
.dm-entry .channel-button { flex:1; min-width:0; }
.channel-remove { width:22px; height:22px; flex:0 0 auto; color:var(--muted); font-size:1rem; opacity:.7; }
.channel-entry:hover .channel-remove,.channel-remove:focus-visible { color:var(--danger); opacity:1; }
.channel-notifications,.dm-notifications { width:22px; height:22px; flex:0 0 auto; color:var(--muted); font-size:.78rem; opacity:.72; }
.channel-entry:hover .channel-notifications,.dm-entry:hover .dm-notifications,.channel-notifications:focus-visible,.dm-notifications:focus-visible { color:var(--text); opacity:1; }
.channel-button { display:flex; align-items:center; gap:8px; border:0; border-radius:10px; min-height:37px; padding:8px 10px; color:var(--muted); background:transparent; text-align:left; }
.channel-button:hover,.channel-button.active { color:var(--text); background:var(--surface-2); }
.channel-button.is-ringing { border:1px solid color-mix(in srgb,#52e29a,transparent 42%); }
.channel-typing-indicator,.channel-call-activity { display:grid; flex:0 0 auto; width:23px; height:23px; margin-left:auto; place-items:center; color:var(--accent); border-radius:8px; background:color-mix(in srgb,var(--accent),transparent 86%); font-size:.88rem; font-weight:900; line-height:1; }
.channel-call-activity { color:#52e29a; background:color-mix(in srgb,#52e29a,transparent 85%); font-size:.76rem; }
.dm-call-indicator { display:inline-grid; flex:0 0 auto; width:25px; height:25px; margin-left:auto; place-items:center; color:#07140d; border-radius:50%; background:#52e29a; font-size:.75rem; animation:ring-phone 1.15s ease-in-out infinite; }
@keyframes ring-phone { 0%,100% { transform:rotate(0deg) scale(1); } 18% { transform:rotate(-12deg) scale(1.08); } 36% { transform:rotate(12deg) scale(1.08); } 54% { transform:rotate(-8deg) scale(1.04); } 72% { transform:rotate(8deg) scale(1.04); } }
.channel-icon { color:var(--muted); font-weight:900; }
.voice-participant-list { display:flex; flex:0 0 calc(100% - 25px); flex-direction:column; gap:3px; min-width:0; margin:1px 0 4px 25px; padding:4px 5px; border-left:1px solid var(--line); }
.voice-participant { display:flex; align-items:center; gap:6px; min-width:0; min-height:25px; color:var(--muted); font-size:.72rem; }
.voice-participant > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.voice-screen-indicator { flex:0 0 auto; margin-left:auto; font-size:.72rem; }
.voice-participant-avatar { position:relative; width:21px; height:21px; display:grid; place-items:center; overflow:hidden; border-radius:7px; color:#fff; font-size:.55rem; font-weight:800; }
.voice-participant-avatar img { width:100%; height:100%; object-fit:cover; }
.presence-avatar { position:relative; }
.presence-avatar::after { position:absolute; right:-2px; bottom:-2px; width:10px; height:10px; content:""; border:2px solid var(--surface); border-radius:50%; background:#3ddc97; }
.presence-avatar[data-presence="away"]::after,.presence-dot[data-presence="away"] { background:#f4b942; }
.presence-avatar[data-presence="dnd"]::after,.presence-dot[data-presence="dnd"] { background:#ef5d6b; }
.presence-avatar[data-presence="offline"]::after,.presence-dot[data-presence="offline"] { background:#77819a; }
.voice-participant-avatar.presence-avatar::after { width:7px; height:7px; }
.context-actions { display:flex; flex-direction:column; gap:8px; padding:12px; margin-top:auto; }
.profile-strip { position:relative; display:flex; align-items:center; gap:8px; padding:10px; border-top:1px solid var(--line); background:var(--surface-2); border-radius:0 0 20px 20px; }
.avatar { flex:0 0 auto; width:38px; height:38px; border-radius:13px; display:grid; place-items:center; overflow:hidden; background:var(--accent); color:#fff; font-weight:900; }
.avatar img,.message-avatar img { width:100%; height:100%; object-fit:cover; }
.person-avatar-button { flex:0 0 auto; padding:0; border:0; cursor:pointer; transition:filter .15s ease,transform .15s ease; }
.person-avatar-button:hover,.person-avatar-button:focus-visible { filter:brightness(1.1); transform:translateY(-1px); outline:2px solid color-mix(in srgb,var(--accent),transparent 35%); outline-offset:2px; }
.profile-avatar-button { padding:0; border:0; cursor:pointer; }
.profile-avatar-button:hover { filter:brightness(1.08); }
.profile-summary { min-width:0; flex:1; display:flex; flex-direction:column; gap:2px; padding:0; text-align:left; color:var(--text); background:transparent; border:0; }
.profile-summary strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.profile-summary span { color:var(--muted); font-size:.72rem; }
.profile-popover { position:absolute; z-index:70; right:8px; bottom:calc(100% + 8px); left:8px; display:flex; flex-direction:column; gap:12px; padding:13px; color:var(--text); border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
.profile-popover-head { display:flex; align-items:center; gap:10px; min-width:0; }
.profile-popover-head > div:last-child { display:flex; min-width:0; flex-direction:column; gap:2px; }
.profile-popover-head strong,.profile-popover-head span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile-popover-head span { color:var(--muted); font-size:.76rem; }
.profile-popover-avatar { width:48px; height:48px; border-radius:15px; font-size:1rem; }
.profile-action-row { display:flex; align-items:center; gap:8px; }
.profile-action-row .secondary { flex:1; }
.profile-popover-label { color:var(--muted); font-size:.63rem; font-weight:850; letter-spacing:.12em; }
.presence-options { display:flex; flex-direction:column; gap:3px; }
.presence-options button { display:grid; grid-template-columns:15px minmax(0,1fr) auto; align-items:center; gap:8px; width:100%; padding:8px; color:var(--text); border:1px solid transparent; border-radius:10px; background:transparent; text-align:left; }
.presence-options button:hover,.presence-options button.active { border-color:var(--line); background:var(--surface-2); }
.presence-options button small { color:var(--muted); font-size:.68rem; }
.presence-dot { display:block; width:11px; height:11px; border-radius:50%; background:#3ddc97; }
.notification-button { position:relative; }
.badge { position:absolute; right:-5px; top:-6px; display:grid; min-width:18px; height:18px; place-items:center; padding:0 4px; border:2px solid var(--surface-2); border-radius:20px; color:#fff; background:var(--danger); font-size:.62rem; font-style:normal; }
.rail-server-activity { position:absolute; right:-5px; bottom:-5px; display:grid; width:20px; height:20px; place-items:center; border:2px solid var(--surface); border-radius:50%; color:#07140d; background:#52e29a; font-size:.62rem; line-height:1; box-shadow:0 3px 9px rgba(0,0,0,.28); }

.context-panel,.main-panel { min-height:0; max-height:100%; }
.main-panel { display:flex; flex-direction:column; min-width:0; height:100%; }
body.has-active-call .main-panel { padding-bottom:82px; }
.main-head { flex:0 0 auto; }
.head-actions { display:flex; gap:7px; align-items:center; }
.conversation-workspace { display:flex; flex:1; min-width:0; min-height:0; overflow:hidden; }
.message-area { display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; }
.dm-profile-panel { width:274px; flex:0 0 274px; min-width:0; overflow:auto; border-left:1px solid var(--line); background:var(--surface-2); }
.dm-profile-cover { height:92px; background:linear-gradient(135deg,var(--accent),var(--surface-3)); }
.dm-profile-body { display:flex; min-height:calc(100% - 92px); flex-direction:column; align-items:flex-start; gap:7px; padding:0 16px 17px; }
.dm-profile-avatar { width:76px; height:76px; margin-top:-38px; border:4px solid var(--surface-2); border-radius:23px; font-size:1.55rem; }
.dm-profile-body h3 { margin:1px 0 0; font-size:1.13rem; }
.dm-profile-body > .muted { margin:0; font-size:.78rem; }
.dm-profile-body .profile-presence { margin:3px 0 0; }
.dm-profile-voice { margin:0; padding:5px 8px; border-radius:999px; color:#0b3321; background:#52e29a; font-size:.74rem; font-weight:850; }
.dm-profile-body .field-hint { margin:7px 0 0; line-height:1.45; }
.dm-profile-body .wide { margin-top:auto; }
.identity-copy { display:flex; min-width:0; flex:1; flex-direction:column; gap:2px; }
.identity-copy strong,.identity-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.identity-copy small { color:#52e29a; font-size:.68rem; font-weight:800; }
.identity-copy small::before { content:'⌁ '; }
.messages { flex:1; min-height:0; display:flex; flex-direction:column; gap:14px; overflow:auto; overscroll-behavior:contain; padding:20px; }
.message-divider { display:flex; align-items:center; gap:9px; margin:4px 0; color:var(--muted); font-size:.7rem; font-weight:800; text-align:center; }
.message-divider::before,.message-divider::after { height:1px; flex:1; content:""; background:var(--line); }
.message-divider.unread { color:var(--accent); }
.message-divider.unread::before,.message-divider.unread::after { background:color-mix(in srgb,var(--accent),transparent 55%); }
.message { display:grid; grid-template-columns:39px minmax(0,1fr); gap:10px; }
.message-content { min-width:0; direction:ltr; unicode-bidi:plaintext; }
.message.is-pinned { padding:6px; margin:-6px; border:1px solid color-mix(in srgb,var(--accent),transparent 42%); border-radius:13px; background:color-mix(in srgb,var(--accent),transparent 93%); }
.message.message-highlight { animation:message-highlight 1.35s ease; }
@keyframes message-highlight { 0%,100% { background:transparent; } 20%,65% { background:color-mix(in srgb,var(--accent),transparent 82%); } }
.call-summary { display:flex; align-items:center; justify-content:center; min-height:32px; padding:7px 12px; color:var(--muted); font-size:.78rem; text-align:center; border-radius:10px; background:color-mix(in srgb,var(--surface-2),transparent 35%); }
.message-avatar { width:39px; height:39px; display:grid; place-items:center; overflow:hidden; color:#fff; background:var(--accent); border-radius:13px; font-weight:900; }
.message-meta { display:flex; align-items:baseline; gap:8px; }
.message-meta strong { font-size:.88rem; }
.message-meta time { color:var(--muted); font-size:.7rem; }
.message-delete,.message-pin { width:21px; height:21px; padding:0; color:var(--muted); border:0; border-radius:7px; background:transparent; font-size:.77rem; line-height:1; opacity:0; }
.message:hover .message-delete,.message:hover .message-pin,.message-delete:focus-visible,.message-pin:focus-visible,.message.is-pinned .message-pin { opacity:1; }
.message-delete:hover,.message-delete:focus-visible { color:var(--danger); background:color-mix(in srgb,var(--danger),transparent 88%); }
.message-pin:hover,.message-pin:focus-visible,.message.is-pinned .message-pin { color:var(--accent); background:color-mix(in srgb,var(--accent),transparent 86%); }
.message-reply { display:flex; max-width:min(560px,100%); align-items:center; gap:7px; margin:5px 0 2px; padding:6px 9px; overflow:hidden; color:var(--muted); border:0; border-left:3px solid var(--accent); border-radius:4px 9px 9px 4px; background:color-mix(in srgb,var(--surface-2),transparent 18%); text-align:left; }
.message-reply strong { flex:0 0 auto; max-width:150px; overflow:hidden; color:var(--text); text-overflow:ellipsis; white-space:nowrap; font-size:.72rem; }
.message-reply span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.72rem; }
.message-reply:hover { background:var(--surface-2); }
.message p { margin-top:2px; color:color-mix(in srgb,var(--text),transparent 7%); white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.42; }
.message-mention { display:inline; padding:1px 4px; color:color-mix(in srgb,var(--accent),#fff 12%); border:0; border-radius:5px; background:color-mix(in srgb,var(--accent),transparent 80%); font-weight:800; line-height:inherit; }
.message-mention:hover,.message-mention:focus-visible { background:color-mix(in srgb,var(--accent),transparent 67%); }
.message-inline-link { color:color-mix(in srgb,var(--accent),#fff 14%); font-weight:750; text-decoration:none; }
.message-inline-link:hover { text-decoration:underline; }
.message-link-previews { display:grid; gap:8px; width:min(430px,100%); margin-top:9px; }
.message-link-preview { display:flex; overflow:hidden; color:var(--text); border:1px solid var(--line); border-radius:13px; background:var(--surface-2); text-decoration:none; transition:border-color .15s ease,transform .15s ease; }
.message-link-preview:hover { border-color:color-mix(in srgb,var(--accent),transparent 35%); transform:translateY(-1px); }
.link-preview-image { position:relative; display:block; flex:0 0 146px; min-height:96px; overflow:hidden; background:#111; }
.link-preview-image img { width:100%; height:100%; object-fit:cover; }
.link-preview-image b { position:absolute; left:50%; top:50%; display:grid; width:42px; height:32px; place-items:center; color:#fff; border-radius:9px; background:#f20d18; font-size:1.05rem; transform:translate(-50%,-50%); }
.link-preview-copy { display:flex; min-width:0; flex:1; flex-direction:column; justify-content:center; gap:4px; padding:12px; }
.link-preview-copy small { color:var(--accent); font-size:.71rem; font-weight:850; }
.link-preview-copy strong,.link-preview-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.link-preview-copy strong { font-size:.84rem; }
.link-preview-copy span { color:var(--muted); font-size:.75rem; }
.message-attachments { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.message-attachment { display:flex; align-items:center; max-width:260px; min-height:36px; overflow:hidden; color:var(--text); border:1px solid var(--line); border-radius:10px; background:var(--surface-2); text-decoration:none; }
.message-attachment:hover { border-color:color-mix(in srgb,var(--accent),transparent 40%); }
.message-attachment span { padding:8px 10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.78rem; }
.message-attachment img { display:block; width:min(260px,55vw); max-height:230px; object-fit:cover; }
.message-image-attachment { position:relative; width:fit-content; max-width:260px; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); outline:0; }
.message-image-attachment:hover,.message-image-attachment:focus-within,.message-image-attachment.is-selected { border-color:color-mix(in srgb,var(--accent),transparent 35%); }
.message-image-attachment .message-attachment { border:0; border-radius:0; }
.message-image-attachment .message-image-preview { display:block; }
.message-image-actions { position:absolute; right:7px; bottom:7px; display:flex; gap:5px; opacity:0; transform:translateY(4px); transition:opacity .15s ease,transform .15s ease; }
.message-image-attachment:hover .message-image-actions,.message-image-attachment:focus-within .message-image-actions,.message-image-attachment.is-selected .message-image-actions { opacity:1; transform:translateY(0); }
.message-image-actions button { display:grid; width:30px; height:30px; place-items:center; padding:0; color:#fff; border:1px solid #ffffff55; border-radius:8px; background:#0a0c14d9; box-shadow:0 3px 12px #0008; font-size:.92rem; }
.message-image-actions button:hover,.message-image-actions button:focus-visible { border-color:#fff; background:var(--accent); }
/* Em touch não existe hover. Os controles precisam ficar acessíveis sem
   primeiro abrir a imagem em outra aba, principalmente no WebView Android. */
@media (hover:none),(pointer:coarse) { .message-image-actions { opacity:1; transform:translateY(0); } }
.message-reactions { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; }
.message-reaction { display:flex; min-width:38px; height:27px; align-items:center; justify-content:center; gap:4px; padding:0 7px; color:var(--muted); border:1px solid var(--line); border-radius:999px; background:var(--surface-2); font-size:.74rem; }
.message-reaction.is-mine { color:var(--text); border-color:color-mix(in srgb,var(--accent),transparent 28%); background:color-mix(in srgb,var(--accent),transparent 80%); }
.message-reaction:not(:disabled):hover { border-color:var(--accent); }
.message-reaction:disabled { cursor:default; opacity:1; }
.message-context-menu,.navigation-context-menu { position:fixed; z-index:90; width:230px; padding:7px; color:var(--text); border:1px solid var(--line); border-radius:13px; background:color-mix(in srgb,var(--surface),#05060a 18%); box-shadow:0 18px 50px rgba(0,0,0,.46); backdrop-filter:blur(16px); }
.message-context-menu > button,.navigation-context-menu > button { width:100%; padding:9px 10px; color:var(--text); border:0; border-radius:8px; background:transparent; text-align:left; font-size:.78rem; font-weight:800; }
.message-context-menu > button:hover,.navigation-context-menu > button:hover { background:var(--surface-3); }
.navigation-context-menu > button.context-danger { color:var(--danger); }
.navigation-context-menu > button + button { margin-top:2px; }
.message-context-reactions { display:grid; grid-template-columns:repeat(6,1fr); gap:3px; padding-top:5px; margin-top:4px; border-top:1px solid var(--line); }
.message-context-reactions button { display:grid; width:32px; height:32px; place-items:center; padding:0; border:0; border-radius:8px; background:transparent; font-size:1rem; }
.message-context-reactions button:hover { background:var(--surface-3); transform:scale(1.08); }
.composer-reply { display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:10px; padding:8px 13px 0; color:var(--muted); border-top:1px solid var(--line); background:var(--surface); }
.composer-reply > span { display:grid; min-width:0; grid-template-columns:auto 1fr; column-gap:6px; }
.composer-reply small { color:var(--muted); font-size:.65rem; font-weight:800; text-transform:uppercase; }
.composer-reply strong { min-width:0; overflow:hidden; color:var(--accent); text-overflow:ellipsis; white-space:nowrap; font-size:.73rem; }
.composer-reply em { grid-column:1 / -1; min-width:0; margin-top:2px; overflow:hidden; color:var(--text); text-overflow:ellipsis; white-space:nowrap; font-size:.73rem; font-style:normal; }
.composer-reply > button { width:27px; height:27px; flex:0 0 auto; padding:0; color:var(--muted); border:0; border-radius:8px; background:var(--surface-2); font-size:1.05rem; }
.composer-reply > button:hover { color:var(--danger); }
.composer { display:flex; gap:9px; padding:13px; border-top:1px solid var(--line); background:var(--surface); }
.composer-reply:not(.hidden) + .composer { padding-top:8px; border-top:0; }
.composer input { flex:1; direction:ltr; unicode-bidi:plaintext; text-align:start; }
.typing-status { flex:0 0 auto; min-height:26px; margin:0; padding:7px 13px 2px; color:var(--muted); background:var(--surface); font-size:.73rem; font-style:italic; }
.attachment-tray { display:flex; flex-wrap:wrap; gap:6px; padding:0 13px 12px; background:var(--surface); }
.attachment-chip { display:flex; align-items:center; gap:5px; max-width:100%; padding:5px 7px; color:var(--muted); border:1px solid var(--line); border-radius:9px; background:var(--surface-2); font-size:.72rem; }
.attachment-chip > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachment-chip button { width:19px; height:19px; padding:0; color:var(--muted); border:0; border-radius:5px; background:transparent; font-size:1rem; line-height:1; }
.attachment-chip button:hover { color:var(--danger); }
.empty-state { display:grid; place-items:center; min-height:100%; padding:25px; color:var(--muted); text-align:center; }

@media (hover:none),(pointer:coarse) { .message-context-menu,.navigation-context-menu { display:none!important; } }

.desktop-navigation .channel-create-actions,.desktop-navigation .category-remove,.desktop-navigation .channel-remove,.desktop-navigation .channel-notifications,.desktop-navigation .dm-notifications,.desktop-navigation #serverContext .context-head-actions { display:none!important; }
.desktop-navigation .navigation-draggable { cursor:grab; user-select:none; }
.desktop-navigation .navigation-draggable:active { cursor:grabbing; }
.navigation-drag-source { opacity:.45; }
.navigation-drop-before { box-shadow:inset 0 3px 0 var(--accent); }
.navigation-drop-after { box-shadow:inset 0 -3px 0 var(--accent); }
.desktop-navigation[data-layout="horizon"] .server-rail .navigation-drop-before { box-shadow:inset 3px 0 0 var(--accent); }
.desktop-navigation[data-layout="horizon"] .server-rail .navigation-drop-after { box-shadow:inset -3px 0 0 var(--accent); }
.category-group.navigation-drop-inside,.channel-tree.navigation-drop-inside { border-radius:10px; background:color-mix(in srgb,var(--accent),transparent 88%); outline:1px dashed color-mix(in srgb,var(--accent),transparent 35%); }

.voice-landing { flex:1; min-height:200px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:13px; padding:25px; text-align:center; }
.voice-orb { width:76px; height:76px; display:grid; place-items:center; border-radius:50%; color:#fff; background:radial-gradient(circle at 30% 30%,#35d5ed,var(--accent)); font-size:2.2rem; box-shadow:0 0 0 12px color-mix(in srgb,var(--accent),transparent 86%); }
.voice-landing p { color:var(--muted); }
.call-area { flex:1 1 0; width:100%; height:100%; min-height:0; align-items:stretch; display:flex; overflow:hidden; padding:13px; border-bottom:1px solid var(--line); background:linear-gradient(180deg,var(--surface-2),var(--surface)); }
/* Em DMs, a chamada permanece acima do histórico para que a conversa nunca
   desapareça. Chamadas de canais do servidor continuam em tela cheia. */
body.is-viewing-dm-call .call-area { flex:0 1 clamp(220px,43%,390px); height:auto; min-height:220px; }
body.is-viewing-dm-call .video-grid { min-height:0; }
.call-dock { position:fixed; z-index:24; left:50%; bottom:18px; display:flex; align-items:center; gap:8px; max-width:calc(100vw - 30px); padding:7px; border:1px solid color-mix(in srgb,var(--line),#fff 5%); border-radius:17px; background:color-mix(in srgb,var(--surface),#07090f 30%); box-shadow:0 16px 42px rgba(0,0,0,.42); backdrop-filter:blur(18px); transform:translateX(-50%); }
/* No PC, a barra pertence visualmente ao painel principal. Deslocá-la para o
   centro desse painel impede que sobreponha o perfil preso ao rodapé lateral. */
@media (min-width:851px) {
  .call-dock { left:calc(50% + 177px); max-width:calc(100vw - 392px); }
  :root[data-layout="minimal"] .call-dock { left:calc(50% + 150px); max-width:calc(100vw - 326px); }
  :root[data-layout="horizon"] .call-dock { left:calc(50% + 120px); max-width:calc(100vw - 260px); }
}
@media (min-width:851px) and (max-width:1100px) {
  .call-dock { bottom:10px; gap:5px; padding:5px; }
  .call-return { max-width:130px; }
  .call-mode { display:none; }
  .call-control { width:39px; height:40px; }
  .call-leave { width:44px; height:40px; }
}
.call-return { display:flex; align-items:center; gap:7px; min-width:0; max-width:220px; height:42px; padding:0 12px; overflow:hidden; color:var(--text); border:1px solid var(--line); border-radius:12px; background:var(--surface-2); font-size:.76rem; font-weight:800; white-space:nowrap; text-overflow:ellipsis; }
.call-return > span:first-child { color:#52e29a; font-size:1.14rem; font-weight:900; }
.call-return > span:last-child { overflow:hidden; text-overflow:ellipsis; }
.call-control-group { display:flex; align-items:center; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:color-mix(in srgb,var(--surface-2),#050609 30%); }
.call-control { display:grid; width:42px; height:42px; place-items:center; padding:0; color:var(--text); border:0; border-radius:0; background:transparent; font-size:1rem; }
.call-audio-unlock { display:flex; width:auto; min-width:42px; padding:0 10px; gap:5px; color:#52e29a; font-size:.72rem; font-weight:800; }
.call-control + .call-control { border-left:1px solid var(--line); }
.call-control:hover,.call-return:hover { background:var(--surface-3); }
.call-control.is-off { color:#fff; background:color-mix(in srgb,var(--danger),#171019 24%); }
.call-incoming-actions { display:flex; align-items:center; gap:6px; }
.call-answer { min-width:78px; height:42px; padding:0 13px; color:#fff; border:0; border-radius:12px; font-size:.74rem; font-weight:850; }
.call-answer-decline { background:#ee4d5f; }
.call-answer-decline:hover { background:#ff6272; }
.call-answer-accept { background:#3fbd7c; box-shadow:0 8px 18px rgba(63,189,124,.2); }
.call-answer-accept:hover { background:#52cf90; }
.call-mode { max-width:120px; overflow:hidden; color:var(--muted); font-size:.69rem; font-weight:750; white-space:nowrap; text-overflow:ellipsis; }
.call-leave { display:grid; width:48px; height:42px; place-items:center; padding:0; color:#fff; border:0; border-radius:13px; background:#ee4d5f; box-shadow:0 8px 18px rgba(238,77,95,.22); font-size:1.08rem; transform:rotate(180deg); }
.call-leave:hover { background:#ff6272; }
.video-grid { flex:1 1 0; width:100%; height:100%; min-width:0; min-height:0; display:grid; grid-template-columns:repeat(var(--call-columns,1),minmax(0,1fr)); grid-template-rows:repeat(var(--call-rows,1),minmax(0,1fr)); gap:10px; overflow:hidden; }
.video-tile { position:relative; min-width:0; min-height:0; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--surface-3),#080a10 45%),#080a10); transition:border-color .14s ease,box-shadow .14s ease; }
.video-tile video { display:block; width:100%; height:100%; object-fit:cover; background:#080a10; }
.video-tile:not(.has-video) video { opacity:0; pointer-events:none; }
.video-tile.is-screen-sharing video { object-fit:contain; }
.video-tile.media-hidden video { opacity:0; pointer-events:none; }
.video-tile:fullscreen { width:100vw; height:100vh; max-width:none; min-height:100vh; aspect-ratio:auto; border:0; border-radius:0; background:#000; }
.video-tile:fullscreen video { object-fit:contain; }
.call-avatar { position:absolute; z-index:1; top:50%; left:50%; width:clamp(68px,24%,104px); aspect-ratio:1; display:grid; place-items:center; overflow:hidden; color:#fff; border:4px solid rgba(255,255,255,.12); border-radius:50%; font-size:2rem; font-weight:900; transform:translate(-50%,-56%); box-shadow:0 14px 38px rgba(0,0,0,.42); transition:opacity .16s ease,box-shadow .14s ease,transform .14s ease; }
.call-avatar img { width:100%; height:100%; object-fit:cover; }
.video-tile.has-video .call-avatar { opacity:0; pointer-events:none; }
.video-tile.has-video.media-hidden .call-avatar { opacity:1; pointer-events:auto; }
.video-tile.is-speaking { border-color:#52e29a; box-shadow:0 0 0 3px rgba(82,226,154,.23),0 12px 34px rgba(0,0,0,.25); }
.video-tile.is-speaking .call-avatar { border-color:#52e29a; box-shadow:0 0 0 5px rgba(82,226,154,.2),0 14px 38px rgba(0,0,0,.42); transform:translate(-50%,-56%) scale(1.04); }
.video-tile.is-speaking::after { content:'falando'; position:absolute; z-index:3; top:8px; left:8px; padding:4px 7px; color:#07140d; border-radius:999px; background:#52e29a; font-size:.65rem; font-weight:850; letter-spacing:.04em; }
.video-grid.is-incoming .local-tile { display:none; }
.incoming-call-tile { border-color:color-mix(in srgb,#52e29a,transparent 45%); box-shadow:inset 0 0 70px rgba(82,226,154,.06); }
.incoming-call-tile .call-avatar { border-color:#52e29a; box-shadow:0 0 0 8px rgba(82,226,154,.12),0 14px 38px rgba(0,0,0,.42); animation:incoming-pulse 1.6s ease-in-out infinite; }
.incoming-call-label { justify-content:center; }
@keyframes incoming-pulse { 50% { transform:translate(-50%,-56%) scale(1.06); box-shadow:0 0 0 14px rgba(82,226,154,.04),0 14px 38px rgba(0,0,0,.42); } }
.tile-label { position:absolute; right:8px; bottom:8px; left:8px; z-index:3; display:flex; justify-content:space-between; gap:8px; padding:5px 7px; color:#fff; border-radius:8px; background:rgba(0,0,0,.55); font-size:.72rem; backdrop-filter:blur(8px); transition:opacity .14s ease; }
.remote-controls { position:absolute; z-index:3; top:8px; right:48px; left:8px; display:flex; align-items:flex-start; justify-content:flex-end; flex-wrap:wrap; gap:5px; pointer-events:none; transition:opacity .14s ease; }
.remote-controls button { padding:.36rem .52rem; color:#fff; border:1px solid rgba(255,255,255,.26); border-radius:8px; background:rgba(0,0,0,.64); font-size:.7rem; backdrop-filter:blur(8px); pointer-events:auto; }
.remote-controls button:hover { border-color:rgba(255,255,255,.65); background:rgba(22,25,38,.9); }
.remote-controls button.is-muted { color:#fff; border-color:color-mix(in srgb,var(--danger),#fff 25%); background:color-mix(in srgb,var(--danger),#12141d 37%); }
.remote-volume-panel { position:absolute; z-index:8; top:calc(100% + 6px); right:0; display:grid; width:178px; gap:5px; padding:6px; overflow:hidden; border:1px solid rgba(255,255,255,.26); border-radius:10px; background:rgba(8,10,18,.9); box-shadow:0 10px 24px rgba(0,0,0,.36); backdrop-filter:blur(12px); }
.remote-audio-settings:not([open]) > .remote-volume-panel { display:none; }
.remote-volume { display:grid; width:100%; min-width:0; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px 7px; padding:.38rem .45rem; color:#fff; border:1px solid rgba(255,255,255,.18); border-radius:8px; background:rgba(255,255,255,.07); font-size:.68rem; font-weight:750; pointer-events:auto; }
.remote-volume input { grid-column:1 / -1; width:100%; min-height:0; margin:0; accent-color:var(--accent); cursor:pointer; }
.remote-volume output { min-width:34px; text-align:right; font-variant-numeric:tabular-nums; }
.remote-volume:has(input:disabled) { opacity:.56; }
.remote-audio-settings { position:relative; min-width:0; color:#fff; pointer-events:auto; }
.remote-audio-settings[open] { z-index:8; }
.remote-audio-settings > summary { display:flex; align-items:center; min-height:30px; padding:.36rem .52rem; list-style:none; color:#fff; border:1px solid rgba(255,255,255,.26); border-radius:8px; background:rgba(0,0,0,.64); font-size:.7rem; cursor:pointer; user-select:none; backdrop-filter:blur(8px); }
.remote-audio-settings > summary::-webkit-details-marker { display:none; }
.remote-audio-settings > summary:hover,.remote-audio-settings[open] > summary { border-color:rgba(255,255,255,.65); background:rgba(22,25,38,.9); }
.tile-fullscreen { position:absolute; z-index:4; top:8px; right:8px; padding:.36rem .52rem; color:#fff; border:1px solid rgba(255,255,255,.26); border-radius:8px; background:rgba(0,0,0,.64); font-size:.7rem; backdrop-filter:blur(8px); }
.tile-fullscreen:hover { border-color:rgba(255,255,255,.65); background:rgba(22,25,38,.9); }
.remote-controls .tile-fullscreen { position:static; }
.local-tile > .tile-fullscreen { right:48px; }
.tile-menu { position:absolute; z-index:5; top:8px; right:8px; display:grid; width:34px; height:30px; place-items:center; padding:0; color:#fff; border:1px solid rgba(255,255,255,.26); border-radius:9px; background:rgba(0,0,0,.68); font-size:1.1rem; line-height:1; backdrop-filter:blur(8px); }
.tile-menu:hover,.tile-menu[aria-expanded="true"] { border-color:rgba(255,255,255,.65); background:rgba(22,25,38,.94); }
.video-tile:not(.has-video) .tile-menu { display:none; }
.remote-tile:not(.has-video) .tile-menu { display:grid; }
.remote-tile:not(.has-video):not(.is-menu-open) .remote-controls { opacity:0; pointer-events:none; }
.remote-tile:not(.has-video).is-menu-open .remote-controls { opacity:1; pointer-events:auto; }
.video-tile.has-video:not(.is-menu-open) .tile-label,.video-tile.has-video:not(.is-menu-open) .remote-controls,.video-tile.has-video:not(.is-menu-open) > .tile-fullscreen { opacity:0; pointer-events:none; }
.video-tile.has-video.is-menu-open .tile-label,.video-tile.has-video.is-menu-open .remote-controls,.video-tile.has-video.is-menu-open > .tile-fullscreen { opacity:1; pointer-events:auto; }

.dialog { width:min(470px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:0; color:var(--text); border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:var(--shadow); overflow:auto; }
.dialog::backdrop { background:rgba(2,3,8,.63); backdrop-filter:blur(5px); }
.dialog form,.dialog-stack { padding:20px; }
.dialog h3 { margin-bottom:4px; }
.dialog hr { width:100%; border:0; border-top:1px solid var(--line); margin:2px 0; }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:5px; }
.changelog-dialog { width:min(520px,calc(100vw - 24px)); }
.changelog-dialog header > div { min-width:0; }
.changelog-list { display:flex; flex-direction:column; gap:10px; margin:0; padding:2px 4px 2px 22px; color:var(--text); line-height:1.45; }
.changelog-list li::marker { color:var(--accent); }
.dialog-actions button:not(.primary):not(.danger),.dialog-stack header .icon-button { padding:.6rem .75rem; color:var(--text); background:var(--surface-2); border:1px solid var(--line); border-radius:10px; }
.check-label { flex-direction:row; align-items:center; padding:4px 0; }
.check-label input { width:17px; min-height:17px; }
.invite-settings { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px; border:1px solid var(--line); border-radius:10px; color:var(--muted); font-size:.8rem; }
.invite-settings span { min-width:0; overflow-wrap:anywhere; }
.danger-zone { display:flex; flex-direction:column; align-items:flex-start; gap:7px; padding:11px; border:1px solid color-mix(in srgb,var(--danger),transparent 48%); border-radius:11px; background:color-mix(in srgb,var(--danger),transparent 92%); }
.danger-zone strong { color:var(--danger); font-size:.8rem; }
.danger-zone p { color:var(--muted); font-size:.76rem; line-height:1.35; }
.dialog-stack { display:flex; flex-direction:column; gap:13px; }
.dialog-stack header { display:flex; justify-content:space-between; align-items:center; }
.dialog-tabs { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; padding:4px; border-radius:13px; background:var(--surface-2); }
.dialog-tabs .tab { color:var(--muted); }
.dialog-tabs .tab.active { color:var(--text); background:var(--surface-3); }
.inline-form { display:flex!important; flex-direction:row!important; gap:8px!important; }
.stack-list { display:flex; flex-direction:column; gap:7px; max-height:50vh; overflow:auto; }
.stack-item { display:flex; align-items:center; gap:10px; padding:9px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.stack-item .item-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.stack-item small { color:var(--muted); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.stack-item select { width:auto; min-height:34px; padding:.35rem; }
.role-form { display:flex; flex-direction:column; gap:10px; padding:12px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.role-form h4 { margin:0; font-size:.83rem; }
.permission-checks { display:grid; gap:3px; }
.permission-checks .check-label,.member-role-picker .check-label { font-size:.72rem; }
.role-color { width:13px; height:13px; flex:0 0 auto; border-radius:50%; }
.member-role-picker { display:flex; flex-wrap:wrap; gap:3px 8px; width:100%; padding-top:4px; }
.member-role-picker .check-label { width:auto; color:var(--muted); }
.member-role-picker input { width:14px; min-height:14px; }
.custom-role-summary { width:100%; color:var(--muted); }
.member-stack-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; }
.member-stack-item .member-role-picker,.member-stack-item .custom-role-summary { grid-column:1 / -1; }
.member-stack-item .member-role-picker { max-width:100%; padding:7px 0 0; border-top:1px solid color-mix(in srgb,var(--line),transparent 20%); }
.pinned-message { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:start; gap:9px; padding:9px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.pinned-message .avatar { width:34px; height:34px; border-radius:11px; font-size:.72rem; }
.pinned-message > div { display:flex; min-width:0; flex-direction:column; gap:3px; }
.pinned-message span { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.8rem; }
.pinned-message { grid-template-columns:34px minmax(0,1fr) auto; }
.message-unpin { align-self:center; padding:.4rem .55rem; color:var(--danger); border:1px solid color-mix(in srgb,var(--danger),transparent 65%); border-radius:9px; background:color-mix(in srgb,var(--danger),transparent 91%); font-size:.72rem; font-weight:750; }
.user-profile-dialog { width:min(520px,calc(100vw - 24px)); overflow:hidden; }
.user-profile { position:relative; min-height:355px; }
.user-profile-cover { height:126px; background:linear-gradient(135deg,var(--accent),var(--surface-3)); }
.user-profile-close { position:absolute; top:12px; right:12px; }
.user-profile-body { display:flex; flex-direction:column; align-items:flex-start; gap:7px; padding:0 22px 22px; }
.user-profile-avatar { width:94px; height:94px; margin-top:-47px; border:5px solid var(--surface); border-radius:27px; font-size:2rem; }
.user-profile-body h3 { margin:0; font-size:1.35rem; }
.profile-note { color:var(--text); font-size:.82rem; line-height:1.4; }
.profile-bio { margin:4px 0; color:var(--text); font-size:.82rem; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.profile-connections { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0; }
.profile-connections a { padding:5px 8px; color:var(--text); border:1px solid var(--line); border-radius:999px; background:var(--surface-2); font-size:.7rem; font-weight:800; text-decoration:none; }
.profile-connections a:hover { color:#fff; border-color:transparent; background:var(--accent); }

.profile-editor-dialog { width:min(980px,calc(100vw - 24px)); overflow:hidden; }
.profile-editor-dialog .profile-editor-shell { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); width:100%; height:min(760px,calc(100dvh - 26px)); min-height:0; padding:0; gap:0; overflow:hidden; }
.profile-editor-fields { display:flex; min-width:0; min-height:0; flex-direction:column; gap:14px; padding:24px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; -webkit-overflow-scrolling:touch; }
.dialog-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.profile-field-grid,.settings-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.connections-fieldset { margin:0; padding:15px; border:1px solid var(--line); border-radius:14px; }
.connections-fieldset legend { padding:0 7px; color:var(--text); font-size:.82rem; font-weight:850; }
.profile-editor-preview { min-width:0; padding:24px; border-left:1px solid var(--line); background:var(--surface-2); overflow:auto; }
.profile-preview-card { margin-top:12px; overflow:hidden; border:1px solid var(--line); border-radius:20px; background:var(--surface); box-shadow:var(--shadow); }
.profile-preview-cover { height:112px; background:linear-gradient(135deg,var(--accent),var(--surface-3)); }
.profile-preview-body { display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:0 18px 20px; }
.profile-preview-avatar { width:82px; height:82px; margin-top:-41px; border:4px solid var(--surface); border-radius:24px; font-size:1.5rem; }
.profile-preview-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-preview-body h3 { margin:2px 0 0; }
.profile-preview-note { font-size:.78rem; }
.profile-preview-bio { line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }

.settings-dialog { width:min(1180px,calc(100vw - 24px)); height:min(820px,calc(100dvh - 24px)); max-height:calc(100dvh - 24px); overflow:hidden; }
.settings-dialog .settings-shell { display:grid; grid-template-columns:240px minmax(0,1fr); width:100%; height:100%; padding:0; gap:0; }
.settings-sidebar { display:flex; min-height:0; flex-direction:column; gap:14px; padding:22px 16px; border-right:1px solid var(--line); background:var(--surface-2); }
.settings-user-card,.settings-account-card { display:flex; align-items:center; gap:10px; min-width:0; }
.settings-user-card > div:last-child,.settings-account-card > div:nth-child(2) { display:flex; min-width:0; flex:1; flex-direction:column; gap:2px; }
.settings-user-card strong,.settings-user-card span,.settings-account-card strong,.settings-account-card span,.settings-account-card small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.settings-user-card span,.settings-account-card span,.settings-account-card small { color:var(--muted); font-size:.72rem; }
.settings-nav { display:flex; flex-direction:column; gap:4px; }
.settings-nav button { padding:10px 11px; color:var(--muted); border:1px solid transparent; border-radius:10px; background:transparent; font-weight:750; text-align:left; }
.settings-nav button:hover,.settings-nav button.active { color:var(--text); border-color:var(--line); background:var(--surface-3); }
.settings-search-hidden { display:none!important; }
.settings-logout { margin-top:auto; }
.settings-main { display:grid; min-width:0; min-height:0; grid-template-rows:auto minmax(0,1fr) auto; }
.settings-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:19px 25px; border-bottom:1px solid var(--line); }
.settings-scroll { min-height:0; padding:28px clamp(22px,4vw,52px); overflow:auto; }
.settings-panel { max-width:900px; }
.settings-panel > h2 { margin-bottom:6px; font-size:1.48rem; }
.settings-panel > .muted { margin-bottom:22px; }
.settings-actions { display:flex; justify-content:flex-end; gap:8px; padding:14px 25px; border-top:1px solid var(--line); background:var(--surface); }
.settings-actions button:not(.primary) { padding:.65rem .82rem; color:var(--text); border:1px solid var(--line); border-radius:10px; background:var(--surface-2); font-weight:750; }
.settings-account-card { padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--surface-2); }
.settings-account-card .avatar { width:58px; height:58px; }
.settings-info-list { display:flex; flex-direction:column; margin-top:18px; border:1px solid var(--line); border-radius:15px; overflow:hidden; }
.settings-info-list > div { display:flex; justify-content:space-between; gap:15px; padding:15px 17px; border-bottom:1px solid var(--line); }
.settings-info-list > div:last-child { border-bottom:0; }
.settings-info-list span { color:var(--muted); }
.appearance-layout { display:grid; grid-template-columns:minmax(260px,.8fr) minmax(300px,1.2fr); gap:26px; align-items:start; }
.appearance-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.appearance-preview { --preview-bg:#0c0d13; --preview-surface:#1c2030; --preview-nav:#1c2030; --preview-call:#1c2030; --preview-accent:#7c5cff; position:sticky; top:0; min-width:0; padding:16px; border:1px solid var(--line); border-radius:18px; background:var(--surface-2); }
.appearance-preview-window { display:grid; grid-template-columns:62px minmax(0,1fr); min-height:310px; margin-top:12px; overflow:hidden; color:#f5f7ff; border:1px solid rgba(255,255,255,.12); border-radius:16px; background:var(--preview-bg); box-shadow:0 16px 34px rgba(0,0,0,.25); }
.appearance-preview-window nav { display:flex; flex-direction:column; align-items:center; gap:10px; padding:14px 10px; background:color-mix(in srgb,var(--preview-nav),#000 18%); }
.appearance-preview-window nav i { width:36px; height:36px; border-radius:12px; background:var(--preview-accent); }
.appearance-preview-window nav i:nth-child(2),.appearance-preview-window nav i:nth-child(3) { background:var(--preview-surface); }
.appearance-preview-window section { display:flex; flex-direction:column; gap:16px; padding:26px 18px; background:var(--preview-bg); }
.preview-message { display:flex; align-items:flex-start; gap:10px; }
.preview-message > span { display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center; border-radius:12px; background:var(--preview-accent); font-weight:900; }
.preview-message p { display:flex; flex-direction:column; gap:4px; }
.preview-message small { color:#b6bfd2; }
.appearance-preview-window button { align-self:flex-start; margin-top:auto; padding:9px 12px; color:#fff; border:0; border-radius:10px; background:linear-gradient(135deg,var(--preview-accent),var(--preview-call)); font-weight:800; }
.appearance-section-themes { grid-column:1 / -1; display:grid; gap:12px; padding:14px; border:1px solid var(--line); border-radius:14px; background:color-mix(in srgb,var(--surface-2),transparent 12%); }
.appearance-section-themes > div:first-child { display:grid; gap:3px; }
.appearance-section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.appearance-preview[data-preview-theme="light"] .appearance-preview-window { color:#172033; filter:brightness(1.17); }
.appearance-preview[data-preview-theme="light"] .preview-message small { color:#56637b; }
.appearance-preview[data-preview-density="compact"] .appearance-preview-window section { gap:8px; padding-block:18px; }
.appearance-preview[data-preview-density="spacious"] .appearance-preview-window section { gap:28px; padding-block:34px; }
.appearance-preview[data-preview-corners="square"] .appearance-preview-window,.appearance-preview[data-preview-corners="square"] .appearance-preview-window * { border-radius:0!important; }
.appearance-preview[data-preview-corners="soft"] .appearance-preview-window,.appearance-preview[data-preview-corners="soft"] .appearance-preview-window * { border-radius:6px!important; }
.appearance-preview[data-preview-font="rounded"] { font-family:"Arial Rounded MT Bold",ui-rounded,sans-serif; }
.appearance-preview[data-preview-font="serif"] { font-family:Georgia,serif; }
.appearance-preview[data-preview-font="mono"] { font-family:Consolas,monospace; }
.appearance-preview[data-preview-font-size="small"] .appearance-preview-window { font-size:.82rem; }
.appearance-preview[data-preview-font-size="large"] .appearance-preview-window { font-size:1.08rem; }
.appearance-preview[data-preview-layout="minimal"] .appearance-preview-window { border-radius:0; box-shadow:none; }
.appearance-preview[data-preview-layout="horizon"] .appearance-preview-window { grid-template-columns:1fr; grid-template-rows:54px minmax(0,1fr); }
.appearance-preview[data-preview-layout="horizon"] .appearance-preview-window nav { flex-direction:row; }
.appearance-preview[data-preview-surfaces="glass"] .appearance-preview-window section { background:color-mix(in srgb,var(--preview-bg),transparent 18%); backdrop-filter:blur(12px); }
.settings-feature-card { display:flex; align-items:center; gap:14px; padding:18px; border:1px solid var(--line); border-radius:15px; background:var(--surface-2); }
.settings-feature-card > span { font-size:1.5rem; }
.settings-feature-card > div { flex:1; }
.settings-feature-card p { margin-top:4px; }
.voice-settings-card { display:grid; grid-template-columns:minmax(180px,.75fr) minmax(240px,1.25fr); align-items:center; gap:18px; margin-top:18px; padding:18px; border:1px solid var(--line); border-radius:15px; background:var(--surface-2); }
.voice-settings-card p,.voice-settings-card small { display:block; margin:5px 0 0; color:var(--muted); font-weight:500; line-height:1.45; }
.microphone-test-controls { display:grid; grid-template-columns:auto minmax(110px,1fr); align-items:center; gap:10px 12px; }
.microphone-test-controls .field-hint { grid-column:1/-1; margin:0; }
.microphone-level { height:12px; overflow:hidden; border:1px solid var(--line); border-radius:999px; background:var(--surface); box-shadow:inset 0 1px 4px rgba(0,0,0,.22); }
.microphone-level span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#48d597 0 72%,#ffd166 72% 88%,#ff6478 88%); transition:width 70ms linear; }
.noise-suppression-setting { grid-template-columns:auto 1fr; cursor:pointer; }
.noise-suppression-setting input { width:20px; min-height:20px; margin:0; }
.desktop-settings { display:flex; flex-direction:column; gap:12px; margin-bottom:18px; padding:18px; border:1px solid var(--line); border-radius:15px; background:var(--surface-2); }

@media (max-width:760px) {
  .settings-dialog { width:calc(100dvw - 8px); min-width:0; height:calc(100dvh - 8px); max-width:calc(100dvw - 8px); max-height:calc(100dvh - 8px); margin:4px; }
  .settings-dialog .settings-shell { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); min-width:0; }
  .settings-sidebar { gap:9px; padding:10px; border-right:0; border-bottom:1px solid var(--line); }
  .settings-user-card,.settings-sidebar > input,.settings-logout { display:none; }
  .settings-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; }
  .settings-nav button { min-width:0; padding:8px 7px; overflow:hidden; font-size:clamp(.7rem,2.8vw,.83rem); text-align:center; text-overflow:ellipsis; white-space:nowrap; }
  .settings-header { min-width:0; padding:12px 15px; }
  .settings-header > * { min-width:0; }
  .settings-header h2,.settings-header h3 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .settings-main { width:100%; overflow:hidden; }
  .settings-scroll { padding:18px 14px; overflow-x:hidden; }
  .settings-actions { width:100%; min-width:0; padding:10px 14px; }
  .settings-actions button { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .settings-account-card { flex-wrap:wrap; }
  .settings-account-card > button { width:100%; }
  .settings-info-list > div { flex-direction:column; gap:5px; }
  .settings-info-list strong { overflow-wrap:anywhere; }
  .settings-panel .device-choice { flex-wrap:wrap; }
  .settings-panel .device-choice .device-permission { width:100%; }
  .voice-settings-card { grid-template-columns:1fr; gap:12px; }
  .noise-suppression-setting { grid-template-columns:auto 1fr; }
  .microphone-test-controls { grid-template-columns:1fr; }
  .microphone-test-controls .field-hint { grid-column:auto; }
  .appearance-layout,.appearance-controls,.appearance-section-grid,.profile-field-grid,.settings-form-grid { grid-template-columns:1fr; }
  .appearance-preview { position:static; }
  .profile-editor-dialog { width:calc(100vw - 8px); }
  .profile-editor-dialog .profile-editor-shell { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr); width:100%; height:calc(100dvh - 8px); max-height:calc(100dvh - 8px); }
  .profile-editor-preview { display:none; }
  .profile-editor-fields { height:100%; padding:18px 14px max(18px,env(safe-area-inset-bottom)); }
}
.capacitor-android .profile-editor-dialog { width:100dvw; max-width:100dvw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
.capacitor-android .profile-editor-dialog .profile-editor-shell { height:100dvh; max-height:100dvh; }
/* O WebView leva em conta barras do sistema de formas diferentes conforme o
   aparelho. Um painel sem margens elimina a faixa que cortava o cabeçalho e
   o botão Salvar na versão instalada. */
.capacitor-android .settings-dialog { width:100dvw; max-width:100dvw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
.profile-presence { margin:0; padding:4px 8px; color:var(--text); border-radius:999px; background:var(--surface-2); font-size:.78rem; }
.profile-actions { width:100%; justify-content:flex-start; margin-top:12px; }
.dm-friend-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:10px; width:min(760px,100%); margin:auto; padding:clamp(14px,4vw,34px); border:1px solid var(--line); border-radius:23px; background:linear-gradient(135deg,color-mix(in srgb,var(--surface-2),transparent 8%),color-mix(in srgb,var(--surface),transparent 2%)); box-shadow:var(--shadow); }
.dm-friend-gallery-head { grid-column:1 / -1; display:flex; flex-direction:column; gap:5px; padding-bottom:7px; }
.dm-friend-card { display:flex; align-items:center; gap:10px; min-width:0; padding:11px; color:var(--text); border:1px solid var(--line); border-radius:15px; background:var(--surface-2); text-align:left; transition:transform .15s ease,border-color .15s ease; }
.dm-friend-card:hover,.dm-friend-card:focus-visible { border-color:color-mix(in srgb,var(--accent),transparent 35%); transform:translateY(-2px); }
.dm-friend-card .avatar { width:42px; height:42px; border-radius:13px; }
.dm-friend-card > span { display:flex; min-width:0; flex-direction:column; gap:3px; }
.dm-friend-card strong,.dm-friend-card small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-friend-card small { color:var(--muted); }
.notification-item { align-items:flex-start; cursor:pointer; }
.notification-item.unread { border-color:color-mix(in srgb,var(--accent),transparent 25%); }

#toast { position:fixed; z-index:30; left:50%; top:18px; max-width:calc(100vw - 26px); padding:10px 14px; color:var(--text); border:1px solid var(--line); border-radius:11px; background:var(--surface-3); box-shadow:var(--shadow); opacity:0; pointer-events:none; transform:translate(-50%,-18px); transition:.2s ease; }
#toast.show { opacity:1; transform:translate(-50%,0); }
#connectionMeter { position:fixed; z-index:20; right:14px; bottom:12px; display:flex; align-items:center; gap:5px; padding:5px 8px; color:var(--muted); border:1px solid color-mix(in srgb,var(--line),transparent 20%); border-radius:8px; background:color-mix(in srgb,var(--surface),transparent 8%); box-shadow:var(--shadow); font-size:.68rem; font-weight:800; letter-spacing:.04em; pointer-events:none; }
.ping-dot { width:7px; height:7px; border-radius:50%; background:var(--muted); box-shadow:0 0 0 2px color-mix(in srgb,var(--muted),transparent 78%); }
#connectionMeter.good .ping-dot { background:#3ddc97; box-shadow:0 0 0 2px color-mix(in srgb,#3ddc97,transparent 78%); }
#connectionMeter.warning .ping-dot { background:#f3bd4c; box-shadow:0 0 0 2px color-mix(in srgb,#f3bd4c,transparent 78%); }
#connectionMeter.bad .ping-dot { background:var(--danger); box-shadow:0 0 0 2px color-mix(in srgb,var(--danger),transparent 78%); }

@media (max-width:850px) { .app-shell { grid-template-columns:67px minmax(0,1fr); grid-template-rows:minmax(180px,32vh) minmax(0,1fr); padding:7px; gap:7px; } .server-rail { grid-row:1 / span 2; border-radius:16px; } .context-panel { border-radius:16px; } .main-panel { min-height:0; border-radius:16px; } .profile-strip { display:none; } .context-actions { display:none; } .online-member-list { max-height:62px; } .channel-tree { flex-direction:row; align-items:flex-start; } .category-group { min-width:max-content; } .channel-list { flex-direction:row; flex-wrap:wrap; align-content:flex-start; } .channel-button { width:auto; } .channel-entry .channel-button { width:auto; } .voice-participant-list { margin-left:12px; } .dm-profile-panel { display:none!important; } #dmProfileToggleBtn { display:none!important; } }
@media (max-width:850px) { .web-download-button { display:none; } .mobile-web-download-button { display:grid; place-items:center; flex:0 0 auto; width:46px; min-height:48px; padding:5px 3px; border:1px solid color-mix(in srgb,#31bd70,transparent 28%); border-radius:13px; color:#fff; background:linear-gradient(155deg,#249454,#49cb84); box-shadow:0 7px 17px #24945455; text-align:center; text-decoration:none; font-weight:850; line-height:1; } .mobile-web-download-button span { font-size:1.1rem; } .mobile-web-download-button small { margin-top:2px; font-size:.56rem; letter-spacing:.01em; } .tauri-desktop .mobile-web-download-button,.capacitor-android .mobile-web-download-button { display:none!important; } }
@media (max-width:560px) {
  /* O instalador Windows continua exclusivo do site desktop. No navegador
     móvel há um atalho próprio para a página de APKs Android. */
  .web-download-button { display:none; }
  .auth-card { padding:25px; border-radius:22px; }
  .app-shell { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:62px fit-content(42dvh) minmax(0,1fr); gap:0; height:100dvh; min-height:0; max-height:100dvh; padding:0; overflow:hidden; }
  .app-shell.is-direct-context { grid-template-rows:62px minmax(174px,30dvh) minmax(0,1fr); }
  .surface { border-right:0; border-left:0; border-radius:0; }
  .server-rail { grid-row:1; flex-direction:row; align-items:center; width:100%; min-width:0; min-height:62px; padding:7px; border-top:0; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
  .rail-dm-notifications,.rail-list,.rail-actions { flex:0 0 auto; flex-direction:row; width:auto; min-width:0; max-height:none; overflow:visible; }
  .rail-actions { margin:0 0 0 auto; }
  .mobile-account-button { display:grid; }
  .rail-button { width:42px; height:42px; }
  .context-panel { grid-row:2; min-width:0; min-height:0; max-height:none; overflow:hidden!important; }
  #serverContext,#directContext { min-width:0; overflow:hidden; }
  #serverContext { flex:0 1 auto; }
  .app-shell.is-direct-context #directContext { flex:1 1 auto; }
  .context-head { flex:0 0 auto; padding:11px 12px; }
  .invite-bar { display:none; }
  .channel-section-head { flex:0 0 auto; padding:7px 11px 3px; }
  #serverContext .channel-tree { flex:0 1 auto; flex-direction:column; align-items:stretch; max-height:min(26dvh,230px); min-width:0; overflow-x:hidden; overflow-y:auto; padding:0 7px 8px; }
  #serverContext .category-group { width:100%; min-width:0; flex:0 0 auto; }
  #serverContext .channel-list { flex:0 0 auto; flex-direction:column; flex-wrap:nowrap; min-width:0; overflow:visible; padding:0 0 3px; }
  #directContext .channel-list { flex:1 1 0; flex-direction:column; flex-wrap:nowrap; align-content:stretch; min-width:0; overflow-x:hidden; overflow-y:auto; padding:0 7px 8px; }
  .channel-entry,.channel-entry .channel-button,.channel-button { width:100%; min-width:0; }
  .server-presence { flex:0 0 auto; }
  .server-presence .channel-section-head { padding-top:5px; }
  .online-member-list { max-height:45px; padding-bottom:6px; }
  .online-member { min-height:27px; }
  .profile-strip { display:none!important; }
  .main-panel { grid-row:3; min-width:0; min-height:0; height:auto; }
  body.has-active-call .main-panel { padding-bottom:66px; }
  .main-head { padding:12px; align-items:flex-start; }
  .head-actions { flex-wrap:wrap; justify-content:flex-end; }
  #requestNotificationsBtn { display:none; }
  .messages { padding:14px; }
  .composer { padding:9px; }
  .call-area { height:100%; align-items:flex-start; overflow-x:hidden; overflow-y:auto; padding:9px; overscroll-behavior:contain; scroll-padding-bottom:12px; }
  body.is-viewing-dm-call .call-area { flex:0 0 min(38dvh,310px); height:auto; min-height:178px; overflow:hidden; }
  body.is-viewing-dm-call .video-grid { height:100%; min-height:0; overflow:hidden; }
  .video-grid { flex:0 0 auto; width:100%; height:auto; min-height:100%; grid-template-columns:repeat(auto-fit,minmax(138px,1fr)); grid-template-rows:none!important; grid-auto-rows:minmax(132px,30dvh); align-content:start; gap:7px; overflow:visible; }
  .call-dock { right:9px; bottom:9px; left:9px; justify-content:space-between; gap:5px; max-width:none; padding:5px; transform:none; }
  .call-return { width:42px; min-width:42px; padding:0; justify-content:center; }
  .call-return > span:last-child,.call-mode { display:none; }
  .call-control { width:39px; height:40px; }
  .call-leave { width:44px; height:40px; }
  /* Tela cheia não depende do menu no toque: continua acessível mesmo com os
     controles da mídia recolhidos. */
  .video-tile.has-video:not(.is-menu-open) .remote-controls { opacity:1; pointer-events:none; }
  .video-tile.has-video:not(.is-menu-open) .remote-controls > :not(.tile-fullscreen) { opacity:0; pointer-events:none; }
  .video-tile.has-video:not(.is-menu-open) .remote-controls .tile-fullscreen { display:grid; opacity:1; pointer-events:auto; }
  .remote-controls .tile-fullscreen { position:absolute; top:0; right:0; display:grid; width:32px; min-height:30px; padding:0; place-items:center; font-size:0; }
  .remote-controls .tile-fullscreen::before { content:'⛶'; font-size:.9rem; }
  .local-tile > .tile-fullscreen { display:grid!important; width:32px; min-height:30px; padding:0; place-items:center; font-size:0; opacity:1!important; pointer-events:auto!important; }
  .local-tile > .tile-fullscreen::before { content:'⛶'; font-size:.9rem; }
  .remote-audio-settings { max-width:calc(100vw - 92px); }
  .remote-volume-panel { right:0; width:min(178px,calc(100vw - 44px)); }
  /* O menu da mídia é um popover no celular. Assim os comandos não são
     cortados pela grade pequena de vídeo. */
  .remote-tile.is-menu-open { z-index:12; overflow:visible; }
  .remote-tile.has-video.is-menu-open .remote-controls { position:fixed; z-index:40; top:auto; right:10px; bottom:76px; left:10px; width:auto; max-height:min(48dvh,340px); align-items:flex-start; justify-content:flex-end; overflow-x:hidden; overflow-y:auto; padding:6px; border:1px solid rgba(255,255,255,.24); border-radius:11px; background:rgba(8,10,18,.92); box-shadow:0 10px 24px rgba(0,0,0,.36); backdrop-filter:blur(12px); }
  .remote-tile.has-video.is-menu-open .remote-controls .tile-fullscreen { position:static; display:inline-flex; width:auto; min-height:30px; padding:.36rem .52rem; font-size:.7rem; }
  .remote-tile.has-video.is-menu-open .remote-controls .tile-fullscreen::before { display:none; }
  .remote-tile.has-video.is-menu-open .remote-audio-settings { flex:0 0 auto; }
  .remote-tile.has-video.is-menu-open .remote-audio-settings[open] { width:100%; flex-basis:100%; }
  .remote-tile.has-video.is-menu-open .remote-audio-settings[open] .remote-volume-panel { position:static; width:100%; margin-top:5px; }
  .dialog-actions { flex-wrap:wrap; }
  .inline-form { flex-direction:column!important; }
}

@media (min-width:561px) and (max-width:850px) { .profile-strip { display:flex; } .profile-popover { position:fixed; right:12px; bottom:12px; left:12px; max-width:430px; margin:auto; } }
