:root {
  --rail: #1e1f22;
  --sidebar: #2b2d31;
  --panel: #232428;
  --chat: #313338;
  --input: #383a40;
  --hover: #35373c;
  --active: #404249;
  --msg-hover: #2e3035;
  --float: #111214;
  --line: rgba(255,255,255,.06);
  --text: #dbdee1;
  --muted: #949ba4;
  --faint: #80848e;
  --header: #f2f3f5;
  --accent: #5865f2;
  --green: #23a55a;
  --red: #f23f43;
  --yellow: #f0b232;
  --link: #00a8fc;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--chat);
  color: var(--text);
  font: 16px/1.375 "gg sans", "Noto Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Thin dark scrollbars */
.scroller { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
.scroller::-webkit-scrollbar { width: 8px; }
.scroller::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
.messages.scroller::-webkit-scrollbar { width: 14px; }
.messages.scroller::-webkit-scrollbar-thumb { border-width: 3px; border-radius: 8px; }
.messages.scroller::-webkit-scrollbar-track { background: #2b2d31; border: 3px solid var(--chat); border-radius: 8px; }

/* ---- Server rail ---- */
.rail { width: 72px; background: var(--rail); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.rail-item { position: relative; width: 100%; display: flex; justify-content: center; }
.rail-item .pill { position: absolute; left: 0; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--header); transition: height .15s, margin .15s; opacity: 0; }
.rail-item:hover .pill { opacity: 1; height: 20px; margin-top: -10px; }
.rail-item.active .pill { opacity: 1; height: 40px; margin-top: -20px; }
.server { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 18px; background: var(--chat); color: var(--text); transition: border-radius .15s, background .15s, color .15s; }
.rail-item:hover .server, .rail-item.active .server { border-radius: 16px; background: var(--accent); color: #fff; }
.rail-item .tip { position: absolute; left: 70px; top: 50%; transform: translateY(-50%); background: var(--float); color: var(--header); font-weight: 600; font-size: 15px; padding: 7px 12px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 20; box-shadow: 0 8px 16px rgba(0,0,0,.24); }
.rail-item:hover .tip { opacity: 1; }

/* ---- Channel sidebar ---- */
.sidebar { width: 240px; background: var(--sidebar); display: flex; flex-direction: column; flex-shrink: 0; position: relative; }
.server-name { height: 48px; padding: 0 16px; display: flex; align-items: center; font-weight: 600; color: var(--header); box-shadow: 0 1px 0 rgba(4,4,5,.2), 0 1.5px 0 rgba(6,6,7,.05), 0 2px 0 rgba(4,4,5,.05); flex-shrink: 0; }
.channels { flex: 1; padding: 16px 8px 8px; }
.cat-row { display: flex; align-items: center; }
.category { display: flex; align-items: center; gap: 2px; flex: 1; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); padding: 0 0 4px; }
button.category:hover { color: var(--text); }
.category .ic { width: 12px; height: 12px; stroke-width: 3; transition: transform .15s; }
.category.closed .ic { transform: rotate(-90deg); }
.cat-add { color: var(--muted); padding: 0 4px 4px; }
.cat-add:hover { color: var(--text); }
.cat-add .ic { width: 16px; height: 16px; }
.apps-head { margin-top: 16px; cursor: default; }
#channelList.collapsed .channel:not(.active):not(.unread) { display: none; }
.channel { position: relative; width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 4px; color: var(--muted); text-align: left; margin-bottom: 2px; font-weight: 500; min-height: 34px; }
.channel:hover { background: var(--hover); color: var(--text); }
.channel.active { background: var(--active); color: var(--header); }
.channel.unread { color: var(--header); }
.channel .ic { color: var(--faint); }
.channel .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--header); }
.channel .avatar.xs { width: 24px; height: 24px; font-size: 11px; }
.channel .avatar.xs .dot { width: 12px; height: 12px; border-width: 2px; right: -3px; bottom: -3px; }
.badge { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; padding: 0 4px; text-align: center; }

/* ---- User panel ---- */
.me { height: 52px; background: var(--panel); padding: 0 8px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.me .who { flex: 1; min-width: 0; line-height: 1.2; }
.me .name { font-weight: 600; color: var(--header); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .status { font-size: 12px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; color: #b5bac1; flex-shrink: 0; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }

/* ---- Avatars ---- */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; position: relative; display: grid; place-items: center; color: #fff; font-weight: 600; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .dot { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: 3px solid var(--sidebar); z-index: 1; }
.me .avatar .dot { border-color: var(--panel); }
.avatar .dot.offline { background: var(--faint); }
.avatar .dot.connecting { background: var(--yellow); }

/* ---- Popovers ---- */
.popover { position: absolute; background: var(--float); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 30; }
.popover[hidden] { display: none; }
.user-menu { left: 8px; right: 8px; bottom: 60px; padding: 8px; }
.user-menu .um-head { padding: 8px; font-weight: 600; color: var(--header); border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-radius: 4px; font-size: 14px; font-weight: 500; text-align: left; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item.danger { color: #fa777c; }
.menu-item.danger:hover { background: #da373c; color: #fff; }
.menu-item .ic { width: 18px; height: 18px; }
.menu-item span { color: var(--muted); font-size: 12px; }
.menu-item:hover span { color: #fff; }

/* ---- Main chat ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar { height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 8px; color: var(--header); flex-shrink: 0; box-shadow: 0 1px 0 rgba(4,4,5,.2), 0 1.5px 0 rgba(6,6,7,.05), 0 2px 0 rgba(4,4,5,.05); z-index: 2; }
.topbar .head-icon { width: 24px; height: 24px; color: var(--faint); }
.topbar .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .divider { width: 1px; height: 24px; background: #3f4147; margin: 0 8px; flex-shrink: 0; }
.topbar .topic { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; }
.conn { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.conn.online { display: none; }
.conn.offline i { background: var(--red); }
.topbar .icon-btn.on { color: var(--header); }
.search { position: relative; flex-shrink: 0; }
.search input { width: 144px; height: 24px; background: var(--rail); border: 0; border-radius: 4px; color: var(--text); font: inherit; font-size: 14px; padding: 0 26px 0 6px; outline: 0; transition: width .2s; }
.search input:focus, .search input:not(:placeholder-shown) { width: 220px; }
.search input::placeholder { color: var(--muted); }
.search .ic { position: absolute; right: 5px; top: 4px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }

.messages { flex: 1; padding: 16px 0 24px; position: relative; }
.welcome { padding: 16px 16px 8px; }
.welcome .big { width: 68px; height: 68px; border-radius: 50%; background: #41434a; display: grid; place-items: center; color: #fff; margin-bottom: 8px; }
.welcome .big .ic { width: 42px; height: 42px; }
.welcome h1 { margin: 8px 0; color: var(--header); font-size: 32px; font-weight: 700; line-height: 1.25; }
.welcome p { margin: 0; color: var(--muted); }
.loading-older, .no-results { padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }

.day { display: flex; align-items: center; margin: 24px 14px 8px 16px; height: 0; border-top: 1px solid #3f4147; justify-content: center; }
.day span { background: var(--chat); padding: 2px 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: -1px; line-height: 13px; }
.newline { display: flex; align-items: center; margin: 8px 14px 0 16px; height: 0; border-top: 1px solid var(--red); justify-content: flex-end; }
.newline span { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 4px 0 0 4px; line-height: 13px; margin-top: -1px; margin-right: -14px; }

.msg { position: relative; padding: 2px 48px 2px 72px; margin-top: 17px; min-height: 44px; }
.msg.cont { margin-top: 0; min-height: 22px; }
.msg:hover, .msg.flash { background: var(--msg-hover); }
.msg.flash { transition: background 1.2s; background: rgba(88,101,242,.18); }
.msg .main-row { position: relative; }
.msg .avatar { position: absolute; left: -56px; top: 2px; cursor: pointer; }
.msg .avatar:hover { opacity: .85; }
.msg .gutter-time { position: absolute; left: -64px; width: 56px; text-align: right; display: none; font-size: 11px; color: var(--muted); line-height: 22px; white-space: nowrap; }
.msg.cont .avatar { display: none; }
.msg.cont:hover .gutter-time { display: block; }
.msg .head { display: flex; align-items: baseline; gap: 8px; line-height: 22px; }
.msg.cont .head { display: none; }
.msg .author { font-weight: 500; }
.msg .author:hover { text-decoration: underline; cursor: pointer; }
.msg .time { font-size: 12px; color: var(--muted); font-weight: 500; }
.tag { background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; height: 15px; padding: 0 4px; border-radius: 3px; text-transform: uppercase; flex-shrink: 0; align-self: center; }
.only-you { font-size: 12px; color: var(--muted); margin-top: 2px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 22px; }
.msg .text a { color: var(--link); text-decoration: none; }
.msg .text a:hover { text-decoration: underline; }
.msg .text code { background: var(--sidebar); border: 1px solid var(--rail); border-radius: 4px; padding: 0 3px; font: 14px/1.2 Consolas, "Andale Mono", Menlo, monospace; }
.msg .text pre { margin: 4px 0; background: var(--sidebar); border: 1px solid var(--rail); border-radius: 4px; padding: 8px; overflow-x: auto; max-width: 720px; }
.msg .text pre code { background: none; border: 0; padding: 0; font-size: 14px; line-height: 1.3; white-space: pre; }
.msg .edited { font-size: 10px; color: var(--muted); margin-left: 4px; user-select: none; }
.msg.kind-me .text, .msg.kind-roll .text { font-style: italic; color: #c7c9cc; }
.mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.mention:hover { background: var(--accent); color: #fff; }
.cmd { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.msg.mentioned { background: rgba(240,178,50,.1); }
.msg.mentioned::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--yellow); }
.msg.mentioned:hover { background: rgba(240,178,50,.08); }
.msg.editing { background: rgba(88,101,242,.12); }

/* Reply reference above a message */
.reply-ref { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); line-height: 18px; margin-bottom: 2px; cursor: pointer; position: relative; min-width: 0; }
.reply-ref::before { content: ""; position: absolute; left: -36px; top: 9px; width: 28px; height: 10px; border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px; }
.reply-ref .who { font-weight: 500; flex-shrink: 0; }
.reply-ref .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-ref:hover .what { color: var(--text); }
.reply-ref.gone { font-style: italic; cursor: default; }

/* Reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.rx { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 6px; border-radius: 8px; background: var(--sidebar); border: 1px solid transparent; font-size: 14px; }
.rx:hover { border-color: #4e5058; }
.rx.mine { background: rgba(88,101,242,.15); border-color: var(--accent); }
.rx .n { font-size: 13px; font-weight: 600; color: #b5bac1; min-width: 9px; text-align: center; }
.rx.mine .n { color: #dee0fc; }
.rx.add { color: var(--muted); visibility: hidden; }
.msg:hover .rx.add { visibility: visible; }
.rx.add .ic { width: 16px; height: 16px; }

/* While searching, every hit shows its author */
.searching .msg.cont { margin-top: 17px; min-height: 44px; }
.searching .msg.cont .avatar { display: grid; }
.searching .msg.cont .head { display: flex; }
.searching .msg.cont .gutter-time { display: none !important; }

.actions { position: absolute; right: 16px; top: -16px; display: none; background: var(--chat); border: 1px solid #26282c; border-radius: 8px; padding: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.2); z-index: 1; }
.msg:hover .actions, .msg:focus-within .actions { display: flex; }
.actions button { width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; color: #b5bac1; }
.actions button:hover { background: var(--active); color: var(--text); }
.actions button.danger:hover, .actions button.armed { background: #da373c; color: #fff; }
.actions .ic { width: 18px; height: 18px; }

.sys { display: flex; align-items: center; gap: 16px; padding: 2px 48px 2px 16px; margin-top: 17px; color: var(--muted); min-height: 22px; }
.sys .arrow { width: 40px; display: flex; justify-content: center; color: var(--green); flex-shrink: 0; }
.sys .arrow.out { color: var(--red); transform: scaleX(-1); }
.sys .arrow .ic { width: 16px; height: 16px; stroke-width: 2.5; }
.sys .time { font-size: 12px; margin-left: 4px; }
.sys:hover { background: var(--msg-hover); }

.help { margin: 16px 16px 0; padding: 12px 16px; background: var(--sidebar); border-radius: 8px; border-left: 3px solid var(--accent); font-size: 14px; }
.help h3 { margin: 0 0 6px; font-size: 14px; color: var(--header); }
.help dl { margin: 0 0 8px; display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; }
.help dt { color: var(--header); font-weight: 500; font-family: Consolas, Menlo, monospace; font-size: 13px; }
.help dd { margin: 0; color: #b5bac1; }
.help .only-you { margin: 0; }

.jump { position: absolute; right: 24px; bottom: 84px; z-index: 3; display: flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 10px 6px 12px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.jump[hidden] { display: none; }
.jump:hover { background: #4752c4; }
.jump .ic { width: 16px; height: 16px; }

/* ---- Composer ---- */
.composer { padding: 0 16px 0; flex-shrink: 0; position: relative; }
.composer form { background: var(--input); border-radius: 8px; display: flex; align-items: flex-end; padding-right: 8px; }
.context-bar + form { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer textarea { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); padding: 11px 0 11px 16px; font: inherit; line-height: 22px; height: 44px; max-height: 198px; resize: none; overflow-y: auto; scrollbar-width: thin; }
.composer textarea::placeholder { color: #6d6f78; }
.composer textarea:disabled { cursor: not-allowed; }
.composer form .icon-btn { margin-bottom: 6px; }
.context-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--sidebar); border-radius: 8px 8px 0 0; padding: 6px 8px 6px 16px; font-size: 14px; color: #b5bac1; }
.context-bar[hidden] { display: none; }
.context-bar b { color: var(--header); font-weight: 600; }
.context-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing { height: 24px; font-size: 14px; color: var(--text); padding: 0 4px; display: flex; align-items: center; gap: 6px; }
.typing b { font-weight: 600; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { opacity: .3; transform: scale(.8); } 30% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dots i, .bload { animation: none; } }

.suggest { left: 16px; right: 16px; bottom: 76px; padding: 8px; background: var(--sidebar); border: 1px solid var(--rail); max-height: min(420px, 60vh); overflow-y: auto; scrollbar-width: thin; }
.suggest .s-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); padding: 4px 8px 8px; }
.s-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; text-align: left; min-height: 36px; }
.s-item.sel, .s-item:hover { background: var(--active); }
.s-item .s-name { font-weight: 600; color: var(--header); white-space: nowrap; }
.s-item .s-arg { font-size: 13px; color: var(--muted); border: 1px solid #4e5058; border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.s-item .s-desc { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-item .avatar.xs { width: 24px; height: 24px; font-size: 11px; }

.emoji-pop { position: fixed; padding: 10px; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; z-index: 40; }
.emoji-pop button { width: 36px; height: 36px; border-radius: 4px; font-size: 22px; line-height: 1; }
.emoji-pop button:hover { background: var(--active); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--float); color: var(--header); padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 60; font-size: 14px; max-width: min(480px, calc(100vw - 32px)); border-left: 3px solid var(--yellow); }
.toast[hidden] { display: none; }

/* ---- Shared browser channel ---- */
.browser { display: none; flex: 1; flex-direction: column; min-height: 0; background: var(--rail); }
body.view-browser .browser { display: flex; }
body.view-browser .messages, body.view-browser .composer, body.view-browser .search, body.view-browser .jump { display: none; }
.bbar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; background: var(--sidebar); flex-shrink: 0; }
.bbar form { flex: 1; display: flex; min-width: 0; margin: 0 4px; }
.bbar .addr { flex: 1; min-width: 0; height: 32px; background: var(--rail); border: 0; border-radius: 16px; color: var(--text); padding: 0 14px; font: inherit; font-size: 14px; outline: 0; }
.bbar .addr:focus { box-shadow: 0 0 0 2px var(--accent); }
.bbar .addr::placeholder { color: var(--muted); }
.bbar .ask { height: 32px; padding: 0 12px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; }
.bbar .ask:hover { background: #4752c4; }
.bload { height: 2px; flex-shrink: 0; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: bload 1s linear infinite; }
.bload[hidden] { display: block; visibility: hidden; animation: none; }
@keyframes bload { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.bstage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 8px 12px; outline: 0; overflow: hidden; }
.bstage img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.4); user-select: none; -webkit-user-drag: none; cursor: default; }
.bstage img:not([src]) { visibility: hidden; }
.bstage:focus img { box-shadow: 0 0 0 2px var(--accent), 0 4px 16px rgba(0,0,0,.4); }
.bmsg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); pointer-events: none; }
.bmsg[hidden] { display: none; }
.bnote { font-size: 12px; color: var(--muted); padding: 0 12px 8px; text-align: center; flex-shrink: 0; }
.bnote.warn { color: var(--yellow); }

/* ---- Members ---- */
.members { width: 240px; background: var(--sidebar); padding: 0 8px 20px; flex-shrink: 0; }
body.members-closed .members { display: none; }
.group { padding: 24px 8px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.member { width: 100%; display: flex; align-items: center; gap: 12px; padding: 5px 8px; border-radius: 4px; height: 42px; text-align: left; }
.member:hover { background: var(--hover); }
.member .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .you { font-size: 11px; color: var(--muted); margin-left: -6px; flex-shrink: 0; }
.member.off { opacity: .3; }
.member.off:hover { opacity: 1; }
.member.off .name { color: var(--muted) !important; }

/* ---- Dialogs ---- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 10%, #4752c4 0%, transparent 60%), radial-gradient(900px 600px at 90% 90%, #3c45a5 0%, transparent 55%), #1e1f22; }
.overlay.modal { background: rgba(0,0,0,.7); }
.overlay[hidden] { display: none; }
.dialog { background: var(--chat); border-radius: 8px; padding: 32px; width: 100%; max-width: 480px; box-shadow: 0 2px 10px rgba(0,0,0,.2); text-align: center; }
.dialog h2 { margin: 0 0 8px; color: var(--header); font-size: 24px; font-weight: 600; }
.dialog p { margin: 0 0 20px; color: #b5bac1; }
.modal .dialog { text-align: left; padding: 24px; }
.dialog label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b5bac1; margin-bottom: 8px; }
.dialog label .optional { text-transform: none; font-weight: 400; color: var(--muted); }
.dialog input { width: 100%; background: var(--rail); border: 0; border-radius: 4px; padding: 10px; color: var(--text); font: inherit; outline: 0; margin-bottom: 16px; }
.dialog input:focus { box-shadow: 0 0 0 2px var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.btn { height: 38px; padding: 0 16px; border-radius: 4px; font-size: 14px; font-weight: 500; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #4752c4; }
.btn.ghost:hover { text-decoration: underline; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.login-error { margin: 16px 0 0 !important; color: #fa777c !important; font-size: 14px; }

/* ---- Attachments ---- */
.composer form .attach-btn { margin-left: 8px; }
.composer form .attach-btn .ic { background: #b5bac1; color: var(--input); border-radius: 50%; padding: 2px; width: 22px; height: 22px; stroke-width: 3; }
.composer form .attach-btn:hover .ic { background: var(--header); }
.composer textarea { padding-left: 8px; }
#voiceBtn.recording { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.rec-time { align-self: center; font-size: 13px; color: var(--red); font-variant-numeric: tabular-nums; margin-right: 4px; }
.rec-time[hidden] { display: none; }
.attach-list { display: flex; gap: 8px; flex-wrap: wrap; background: var(--input); border-radius: 8px 8px 0 0; padding: 10px 12px 4px; }
.attach-list[hidden] { display: none; }
.attach-list + form { border-top-left-radius: 0; border-top-right-radius: 0; }
.context-bar + .attach-list { border-radius: 0; }
.chip { position: relative; display: flex; align-items: center; gap: 8px; background: var(--sidebar); border-radius: 6px; padding: 6px 30px 6px 6px; max-width: 240px; min-height: 48px; }
.chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.chip .ic { width: 28px; height: 28px; color: var(--muted); flex-shrink: 0; }
.chip .c-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .c-size { font-size: 11px; color: var(--muted); }
.chip .c-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); border-radius: 0 0 0 6px; transition: width .2s; }
.chip.error { outline: 1px solid var(--red); }
.chip .c-x { position: absolute; top: 4px; right: 4px; }
.attachments { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; align-items: flex-start; }
.att-img { display: block; max-width: min(420px, 100%); max-height: 320px; border-radius: 6px; cursor: zoom-in; background: var(--sidebar); }
.att-video { max-width: min(480px, 100%); max-height: 320px; border-radius: 6px; background: #000; }
.att-audio { display: flex; flex-direction: column; gap: 4px; background: var(--sidebar); border: 1px solid var(--rail); border-radius: 8px; padding: 8px 10px; max-width: min(420px, 100%); }
.att-audio .a-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.att-audio .a-head .ic { width: 16px; height: 16px; color: var(--muted); }
.att-audio audio { width: min(380px, 100%); height: 36px; }
.att-file { display: flex; align-items: center; gap: 10px; background: var(--sidebar); border: 1px solid var(--rail); border-radius: 8px; padding: 10px 12px; max-width: min(420px, 100%); text-decoration: none; }
.att-file .ic { width: 28px; height: 28px; color: var(--muted); flex-shrink: 0; }
.att-file .f-name { color: var(--link); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file .f-size { color: var(--muted); font-size: 12px; }
.att-file:hover .f-name { text-decoration: underline; }
.drop-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(88,101,242,.35); display: grid; place-items: center; pointer-events: none; }
.drop-overlay[hidden] { display: none; }
.drop-overlay div { background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; padding: 24px 40px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.lightbox { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.lightbox a { color: #dbdee1; font-size: 14px; }

/* ---- Custom emoji ---- */
.emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.emoji.big { width: 48px; height: 48px; }
.rx .emoji { width: 16px; height: 16px; vertical-align: -3px; }
.emoji-pop .ep-title { grid-column: 1 / -1; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 2px 2px; }
.emoji-pop button img { width: 26px; height: 26px; object-fit: contain; }
.emoji-form { display: flex; gap: 16px; align-items: stretch; margin-bottom: 24px; }
.emoji-drop { width: 120px; min-height: 100px; border: 2px dashed #4e5058; border-radius: 8px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; padding: 8px; flex-shrink: 0; }
.emoji-drop:hover { border-color: var(--accent); color: var(--text); }
.emoji-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.emoji-drop img { width: 64px; height: 64px; object-fit: contain; }
.emoji-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; max-width: 320px; }
.emoji-fields label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b5bac1; }
.emoji-fields input { background: var(--sidebar); border: 0; border-radius: 4px; padding: 9px 10px; color: var(--text); font: inherit; outline: 0; }
.emoji-fields input:focus { box-shadow: 0 0 0 2px var(--accent); }
.emoji-fields .btn { align-self: flex-start; }
.emoji-fields .btn:disabled { opacity: .5; cursor: default; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.emoji-cell { display: flex; align-items: center; gap: 8px; background: var(--sidebar); border-radius: 8px; padding: 8px 6px 8px 10px; min-width: 0; }
.emoji-cell img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.emoji-cell span { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-panel code { background: var(--sidebar); padding: 1px 4px; border-radius: 3px; font-size: 13px; }

/* ---- Pins ---- */
.pins-pop { right: 16px; top: 52px; width: min(440px, calc(100% - 32px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--sidebar); border: 1px solid var(--rail); }
.pp-head { padding: 14px 16px; font-weight: 600; color: var(--header); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.pp-list { padding: 8px; overflow-y: auto; display: grid; gap: 8px; }
.pp-item { background: var(--chat); border-radius: 6px; padding: 10px 12px; }
.pp-item .pp-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.pp-item .pp-author { font-weight: 600; }
.pp-item .pp-time { font-size: 12px; color: var(--muted); }
.pp-item .pp-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 6.5em; overflow: hidden; }
.pp-item .pp-actions { display: flex; gap: 12px; margin-top: 6px; }
.pp-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.pp-sub { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.pp-item .pp-where { font-size: 12px; color: var(--muted); }
.pp-item.reply .pp-where::before { content: "↩ "; }
.inbox-btn { position: relative; }
.inbox-btn .badge { position: absolute; right: -2px; bottom: -2px; font-size: 10px; min-width: 15px; height: 15px; line-height: 15px; border: 2px solid var(--chat); box-sizing: content-box; }
.inbox-btn .badge[hidden] { display: none; }
#inboxBtn.on { color: var(--header); }
.bio-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 24px; }
.bio-row textarea { flex: 1; min-height: 44px; background: var(--sidebar); border: 0; border-radius: 6px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; resize: vertical; outline: 0; }
.bio-row textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.bio-row .btn:disabled { opacity: .5; cursor: default; }
.bio-count { font-size: 12px; color: var(--muted); }
.pc-bio { font-size: 13px; color: var(--text); margin: -4px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pin-mark { width: 13px; height: 13px; color: var(--muted); vertical-align: -1px; margin-left: 2px; }
#pinsBtn.on { color: var(--header); }

/* ---- Role-only channels and role pings ---- */
.channel .lock { width: 12px; height: 12px; color: var(--faint); margin-left: -2px; }
.new-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.new-roles label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); text-transform: none; font-weight: 500; margin: 0; cursor: pointer; background: var(--rail); border-radius: 6px; padding: 6px 10px; }
.new-roles input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.new-roles-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.mention.role { background: color-mix(in srgb, var(--role) 22%, transparent); color: var(--role); }
.mention.role:hover { background: color-mix(in srgb, var(--role) 40%, transparent); color: #fff; }

/* ---- Owner ---- */
.crown { width: 14px; height: 14px; color: #f0b232; flex-shrink: 0; align-self: center; stroke: none; }
.crown use { stroke: none; }
.crown.co { color: #c4cbd6; }
.pc-owner.co { color: #c4cbd6; background: rgba(196,203,214,.1); }
.owner-note.co { background: rgba(196,203,214,.06); border-color: rgba(196,203,214,.3); }
.owner-note.co .ic { color: #c4cbd6; }
.owner-note { display: flex; gap: 12px; align-items: flex-start; background: rgba(240,178,50,.08); border: 1px solid rgba(240,178,50,.35); border-radius: 8px; padding: 12px 16px; margin: -8px 0 24px; font-size: 14px; color: #b5bac1; }
.owner-note[hidden] { display: none; }
.owner-note .ic { width: 20px; height: 20px; color: #f0b232; stroke: none; margin-top: 1px; }
.owner-note b { color: var(--header); }
.channel-row { position: relative; }
.channel-row .ch-del { position: absolute; right: 4px; top: 5px; width: 24px; height: 24px; display: none; }
.channel-row:hover .ch-del, .channel-row .ch-del:focus-visible { display: grid; }
.channel-row:hover .channel .badge { visibility: hidden; }
.ch-del:hover { color: #fa777c; }
.btn.danger { background: #da373c; color: #fff; }
.btn.small { height: 32px; padding: 0 12px; }
.btn.ghost-line { border: 1px solid #4e5058; color: var(--text); }
.btn.ghost-line:hover { background: var(--hover); }
.confirm-body { color: #b5bac1; margin-bottom: 16px; }
.confirm-body p { margin: 0 0 12px; }
.confirm-body label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b5bac1; margin: 12px 0 6px; }
.confirm-body select, .confirm-body input { width: 100%; background: var(--rail); border: 0; border-radius: 4px; padding: 10px; color: var(--text); font: inherit; outline: 0; margin: 0; }
.confirm-body select:focus, .confirm-body input:focus { box-shadow: 0 0 0 2px var(--accent); }

/* Moderation buttons on the profile card */
.pc-mod { display: flex; gap: 6px; margin-top: 10px; }
.pc-mod .btn { flex: 1; height: 30px; padding: 0 8px; font-size: 13px; }
.pc-flag { font-size: 12px; font-weight: 600; border-radius: 4px; padding: 4px 8px; margin-bottom: 10px; }
.pc-flag.timeout { color: var(--yellow); background: rgba(240,178,50,.1); }
.pc-flag.banned { color: #fa777c; background: rgba(242,63,67,.12); }

/* Settings: Team, Moderation, Audit log */
.set-hint { font-size: 13px; color: #b5bac1; background: var(--sidebar); border-radius: 8px; padding: 10px 14px; margin: -8px 0 20px; }
.set-hint a { color: var(--link); }
.admin-list { display: grid; gap: 8px; margin-bottom: 24px; }
.admin-row { display: flex; align-items: center; gap: 12px; background: var(--sidebar); border-radius: 8px; padding: 10px 12px 10px 16px; min-height: 56px; }
.admin-row .ar-main { flex: 1; min-width: 0; }
.admin-row .ar-title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--header); min-width: 0; }
.admin-row .ar-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .ar-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .ar-sub.warn { color: var(--yellow); }
.admin-row .ar-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.admin-row .ar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-empty { font-size: 14px; color: var(--muted); padding: 4px 0 8px; }
.team-form { background: var(--sidebar); border: 1px solid var(--accent); border-radius: 8px; padding: 16px; display: grid; gap: 12px; }
.team-form .tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team-form label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b5bac1; margin-bottom: 6px; }
.team-form input[type=text], .team-form input[type=email] { width: 100%; background: var(--rail); border: 0; border-radius: 4px; padding: 9px 10px; color: var(--text); font: inherit; outline: 0; }
.team-form input:focus { box-shadow: 0 0 0 2px var(--accent); }
.team-form .tf-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.team-form .tf-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); text-transform: none; font-weight: 500; margin: 0; cursor: pointer; background: var(--rail); border-radius: 6px; padding: 6px 10px; }
.team-form .tf-check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.team-form .tf-actions { display: flex; justify-content: flex-end; gap: 8px; }
.audit-list { display: grid; gap: 2px; }
.audit-row { display: flex; gap: 12px; padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.audit-row:nth-child(odd) { background: var(--sidebar); }
.audit-row .au-time { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 128px; padding-top: 2px; }
.audit-row .au-text { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.audit-row .au-text b { color: var(--header); font-weight: 600; }
.audit-row .au-detail { color: var(--muted); }
@media (max-width: 700px) {
  .team-form .tf-row { grid-template-columns: 1fr; }
  .admin-row { flex-wrap: wrap; }
  .audit-row { flex-direction: column; gap: 2px; }
}
.btn.danger:hover { background: #a12828; }
.modal .dialog p b { color: var(--header); }

/* ---- Role tags ---- */
.role-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; line-height: 16px; height: 18px; padding: 0 7px 0 5px; border-radius: 9px; border: 1px solid; white-space: nowrap; flex-shrink: 0; align-self: center; }
.role-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.member .m-text { flex: 1; min-width: 0; line-height: 1.25; }
.member .m-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.member .m-line .you { margin-left: 0; }
.member .m-role { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Settings ---- */
.settings { position: fixed; inset: 0; z-index: 48; display: flex; background: var(--chat); }
.settings[hidden] { display: none; }
.set-nav { width: 280px; flex-shrink: 0; background: var(--sidebar); padding: 60px 8px 20px 20px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.set-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); padding: 6px 10px; }
.set-tab { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 4px; color: #b5bac1; font-weight: 500; text-align: left; }
.set-tab:hover { background: var(--hover); color: var(--text); }
.set-tab.active { background: var(--active); color: var(--header); }
.set-tab[hidden], .set-head[hidden] { display: none; }
.set-nav .set-head.staff-only { margin-top: 12px; }
.set-tab.danger { color: #fa777c; }
.set-tab.danger:hover { background: #da373c; color: #fff; }
.set-tab .ic { width: 16px; height: 16px; }
.set-sep { height: 1px; background: #3f4147; margin: 8px 10px; }
.set-body { flex: 1; min-width: 0; padding: 60px 40px 40px; position: relative; }
.set-panel { max-width: 660px; }
.set-panel[hidden] { display: none; }
.set-panel h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: var(--header); }
.set-panel > p { margin: 0 0 24px; color: #b5bac1; }
.set-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #b5bac1; margin: 0 0 8px; }
.set-close { position: absolute; top: 60px; right: 40px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #b5bac1; font-size: 12px; font-weight: 600; }
.set-close .ic { width: 36px; height: 36px; padding: 8px; border: 2px solid #4e5058; border-radius: 50%; }
.set-close:hover { color: var(--header); }
.set-close:hover .ic { border-color: var(--header); }

.role-preview { margin-bottom: 24px; }
.role-preview .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 22px; }
.role-preview .author { font-weight: 500; }
.role-preview .time { font-size: 12px; color: var(--muted); }
.role-preview .text { color: var(--text); }
.role-options { display: grid; gap: 8px; }
.role-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 8px; background: var(--sidebar); border: 1px solid transparent; text-align: left; font-weight: 500; color: var(--text); }
.role-option:hover { background: var(--hover); }
.role-option.selected { border-color: var(--accent); background: rgba(88,101,242,.12); color: var(--header); }
.role-option .check { width: 20px; height: 20px; border-radius: 4px; border: 2px solid #b5bac1; flex-shrink: 0; display: grid; place-items: center; }
.role-option.selected .check { border-color: var(--accent); background: var(--accent); }
.role-option.selected .check::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.set-label-row { display: flex; align-items: baseline; justify-content: space-between; }
.link-btn { color: var(--link); font-size: 13px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }
.role-preview .head .role-tag { margin-left: 0; }
/* ---- Profile card (hover a name or picture) ---- */
.profile-card { width: 300px; background: var(--float); border-radius: 8px; overflow: hidden; position: relative; }
.profile-card.floating { position: fixed; z-index: 55; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.profile-card[hidden] { display: none; }
.profile-card.static { box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.pc-banner { height: 60px; }
.profile-card .pc-avatar { width: 80px; height: 80px; font-size: 30px; margin: -40px 0 0 16px; border: 6px solid var(--float); box-sizing: content-box; }
.profile-card .pc-avatar img { inset: 0; }
.profile-card .pc-avatar .dot { width: 18px; height: 18px; right: -2px; bottom: -2px; border: 4px solid var(--float); }
.pc-body { padding: 8px 16px 16px; }
.pc-name { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; color: var(--header); min-width: 0; }
.pc-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name .crown { width: 18px; height: 18px; }
.pc-name .you { font-size: 12px; font-weight: 500; color: var(--muted); }
.pc-status { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pc-owner { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #f0b232; background: rgba(240,178,50,.1); border-radius: 4px; padding: 4px 8px; margin-bottom: 10px; }
.pc-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #b5bac1; margin: 8px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.pc-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-roles .role-tag { height: 22px; font-size: 12px; padding: 0 8px 0 6px; border-radius: 11px; }
.pc-muted { font-size: 13px; color: var(--muted); }
.pc-message { width: 100%; margin-top: 14px; }
.role-option .role-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.role-option .role-name { flex: 1; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 8px; background: var(--sidebar); font-weight: 500; text-align: left; }
.switch { width: 40px; height: 24px; border-radius: 12px; background: #80848e; position: relative; flex-shrink: 0; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch-row[aria-checked="true"] .switch { background: var(--green); }
.switch-row[aria-checked="true"] .switch i { left: 19px; }
#shortcutList .help { margin: 0; border-left: 0; }

.set-h2 { margin-top: 32px; }

/* ---- Threads ---- */
.thread-chip { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px; padding: 3px 10px 3px 8px; border-radius: 6px; background: var(--sidebar); color: var(--link); font-size: 13px; font-weight: 600; }
.thread-chip:hover { background: var(--active); }
.thread-chip .ic { width: 14px; height: 14px; }
.thread-chip .last { color: var(--muted); font-weight: 400; }
.thread-panel { width: 400px; flex-shrink: 0; background: var(--chat); border-left: 1px solid var(--rail); display: flex; flex-direction: column; min-width: 0; }
.thread-panel[hidden] { display: none; }
body.thread-open .members { display: none; }
.tp-head { height: 48px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; box-shadow: 0 1px 0 rgba(0,0,0,.25); font-weight: 600; color: var(--header); }
.tp-head > .ic { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.tp-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-title span { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 4px; }
.tp-messages { flex: 1; overflow-y: auto; padding: 0 0 16px; min-height: 0; }
.tp-messages .msg { padding-right: 16px; }
.tp-messages .actions { right: 8px; }
.tp-count { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.tp-count::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tp-empty { padding: 12px 16px; color: var(--muted); font-size: 14px; }
.tp-form { margin: 0 16px; background: var(--input); border-radius: 8px; display: flex; flex-shrink: 0; }
.tp-form textarea { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); padding: 11px 16px; font: inherit; line-height: 22px; height: 44px; max-height: 198px; resize: none; overflow-y: auto; scrollbar-width: thin; }
.tp-form textarea::placeholder { color: #6d6f78; }
.thread-panel .typing { padding: 0 20px; flex-shrink: 0; }

/* ---- A reply that is still being written ---- */
.msg.live .text::after { content: ""; display: inline-block; width: 7px; height: 16px; margin-left: 2px; vertical-align: text-bottom; background: var(--text); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.live-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; line-height: 22px; }
.live-status .dots i { background: var(--muted); }
@media (prefers-reduced-motion: reduce) { .msg.live .text::after { animation: none; } }

/* ---- Read aloud ---- */
.voice-row { display: flex; align-items: flex-end; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.voice-row > div:first-child { flex: 1; min-width: 200px; }
.voice-row select { width: 100%; height: 40px; background: var(--rail); border: 0; border-radius: 4px; padding: 0 10px; color: var(--text); font: inherit; outline: 0; }
.voice-row select:focus { box-shadow: 0 0 0 2px var(--accent); }
.voice-row .btn { height: 40px; }
.voice-row + .set-hint { margin-top: 10px; }
.voice-row label { display: block; }
.set-hint:empty { display: none; }
.msg.speaking { background: rgba(35,165,90,.1); }
.msg.speaking::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--green); }
.actions button.on { color: var(--green); }
.read-stop { position: absolute; left: 24px; bottom: 84px; z-index: 3; display: flex; align-items: center; gap: 8px; background: var(--float); color: var(--text); font-size: 13px; padding: 6px 12px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.35); border: 1px solid var(--green); }
.read-stop[hidden] { display: none; }
.read-stop .ic { width: 16px; height: 16px; color: var(--green); }
.read-stop b { color: var(--header); font-weight: 600; }
.read-stop:hover b { text-decoration: underline; }

/* ---- Tap-to-answer options under a bot's message ---- */
.options { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.options button { padding: 5px 12px; border-radius: 14px; background: var(--sidebar); border: 1px solid #4e5058; color: var(--header); font-size: 14px; font-weight: 500; }
.options button:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.options button:disabled { opacity: .5; cursor: default; }

/* ---- Suggestions while you type ---- */
.assist-bar { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px; overflow-x: auto; scrollbar-width: none; }
.assist-bar[hidden] { display: none; }
.assist-bar > .ic { width: 16px; height: 16px; color: var(--yellow); flex-shrink: 0; }
.assist-bar button { flex-shrink: 0; max-width: 100%; padding: 4px 12px; border-radius: 14px; background: var(--sidebar); border: 1px solid #4e5058; color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assist-bar button:hover { background: var(--active); color: var(--header); border-color: var(--accent); }
.assist-bar button kbd { font: inherit; font-size: 11px; color: var(--muted); margin-right: 6px; }

.channel .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--rail); border-radius: 9px; padding: 0 6px; line-height: 18px; }

/* ---- Task board ---- */
.tasks-view { display: none; flex: 1; flex-direction: column; min-height: 0; }
body.view-tasks .tasks-view { display: flex; }
body.view-tasks .messages, body.view-tasks .composer, body.view-tasks .search, body.view-tasks .jump, body.view-tasks #pinsBtn { display: none; }
.tv-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-shrink: 0; }
.tv-filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.tv-filters button { padding: 4px 12px; border-radius: 14px; background: var(--sidebar); color: var(--muted); font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.tv-filters button:hover { color: var(--text); }
.tv-filters button.on { background: var(--active); color: var(--header); border-color: var(--accent); }
.tv-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.tv-col { background: var(--sidebar); border-radius: 8px; display: flex; flex-direction: column; min-height: 0; border: 2px solid transparent; }
.tv-col.over { border-color: var(--accent); }
.tv-col h3 { margin: 0; padding: 12px 14px 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tv-col h3 .n { background: var(--rail); color: var(--text); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.tv-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.tv-empty { color: var(--faint); font-size: 14px; padding: 8px 6px; }
.task { background: var(--chat); border-radius: 6px; padding: 10px 12px; border-left: 3px solid var(--faint); cursor: grab; }
.task.mine { border-left-color: var(--accent); }
.task.dragging { opacity: .4; }
.task .t-title { color: var(--header); font-weight: 500; overflow-wrap: anywhere; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-notes { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task .t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.task .t-who { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 500; }
.task .t-who .avatar { width: 18px; height: 18px; font-size: 10px; }
.task .t-due.late { color: var(--red); font-weight: 600; }
.task .t-by { margin-left: auto; }
.task .t-actions { display: flex; gap: 4px; margin-top: 8px; }
.task .t-actions button { height: 26px; padding: 0 8px; border-radius: 4px; background: var(--sidebar); color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.task .t-actions button:hover { background: var(--active); color: var(--header); }
.task .t-actions .ic { width: 14px; height: 14px; }
.task .t-actions .flip { transform: scaleX(-1); }
.task .t-actions .spacer { flex: 1; }
.task-dialog { text-align: left; max-width: 520px; }
.task-dialog h2 { text-align: center; margin-bottom: 20px; }
.task-dialog textarea, .task-dialog select { width: 100%; background: var(--rail); border: 0; border-radius: 4px; padding: 10px; color: var(--text); font: inherit; outline: 0; margin-bottom: 16px; resize: vertical; }
.task-dialog textarea:focus, .task-dialog select:focus { box-shadow: 0 0 0 2px var(--accent); }
.task-dialog input[type="date"] { color-scheme: dark; }
.td-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
.task-dialog .new-roles { margin-bottom: 16px; }
.td-delete { margin-right: auto; }

/* ---- Owner's overview ---- */
.ov-attention { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ov-alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--sidebar); border-left: 3px solid var(--faint); }
.ov-alert i { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); margin-top: 6px; flex-shrink: 0; }
.ov-alert.bad { border-left-color: var(--red); } .ov-alert.bad i { background: var(--red); }
.ov-alert.warn { border-left-color: var(--yellow); } .ov-alert.warn i { background: var(--yellow); }
.ov-alert.good { border-left-color: var(--green); } .ov-alert.good i { background: var(--green); }
.ov-section h3 { margin: 26px 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #b5bac1; }
.ov-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ov-fact { background: var(--sidebar); border-radius: 8px; padding: 12px 14px; }
.ov-value { font-size: 24px; font-weight: 700; color: var(--header); line-height: 1.2; }
.ov-label { font-size: 13px; color: #b5bac1; }
.ov-note { font-size: 12px; color: var(--yellow); margin-top: 2px; }
.ov-line { margin: 6px 0; color: var(--text); }
.ov-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin: 12px 0 8px; padding: 0 2px; }
.ov-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.ov-bar i { width: 100%; max-width: 34px; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .65; }
.ov-bar.today i { opacity: 1; }
.ov-bar .n { font-size: 11px; color: var(--muted); height: 14px; }
.ov-bar .d { font-size: 11px; color: var(--faint); }
.ov-person { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px; background: var(--sidebar); }
.ov-person .avatar { position: relative; flex-shrink: 0; }
.ov-ptext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ov-ptext span { font-size: 13px; color: var(--muted); }
.ov-pstat { font-size: 13px; color: #b5bac1; text-align: right; }
.ov-table { width: 100%; border-collapse: collapse; background: var(--sidebar); border-radius: 8px; overflow: hidden; font-size: 14px; }
.ov-table th, .ov-table td { padding: 8px 12px; text-align: left; }
.ov-table th { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b5bac1; background: var(--rail); }
.ov-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-table tr.total td { border-top: 1px solid var(--line); font-weight: 600; color: var(--header); }
.ov-section .set-hint { margin: 10px 0 0; }
.ov-path { font: 12px/1.5 Consolas, Menlo, monospace; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.ov-stamp { margin-top: 20px; font-size: 12px; color: var(--faint); }
.admin-list .ov-person + .ov-person { margin-top: 6px; }

/* ---- Bug board extras ---- */
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; background: var(--rail); color: var(--muted); }
.sev.high { color: #fff; background: #c9772c; }
.sev.blocker { color: #fff; background: var(--red); }
.sev.low { color: var(--faint); }
.task.dup { opacity: .6; }
.task .t-dup { color: var(--yellow); font-weight: 600; }
.task .t-shots { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.task .t-shots img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; cursor: zoom-in; background: var(--rail); }
.task-dialog input[type="file"] { padding: 7px; font-size: 13px; }
.td-row.bug-only { grid-template-columns: 1fr 1.4fr; }
.td-row[hidden], #taskRolesWrap[hidden], #bugShotWrap[hidden] { display: none; }

/* ---- Studio tools: voice lines, cast, port tracker ---- */
.app-view { display: none; flex: 1; flex-direction: column; min-height: 0; }
body.view-app .app-view { display: flex; }
body.view-app .messages, body.view-app .composer, body.view-app .search, body.view-app .jump, body.view-app #pinsBtn, body.view-app .missed, body.view-tasks .missed { display: none; }
.app-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 24px; }
.tv-bar select { height: 32px; background: var(--sidebar); border: 0; border-radius: 4px; padding: 0 10px; color: var(--text); font: inherit; font-size: 14px; outline: 0; max-width: 100%; min-width: 0; }
.tv-bar select:focus { box-shadow: 0 0 0 2px var(--accent); }
.tv-bar .grow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.app-empty { color: var(--muted); padding: 32px 8px; text-align: center; max-width: 520px; margin: 0 auto; }
.app-empty b { color: var(--header); display: block; font-size: 18px; margin-bottom: 6px; }
.progress { height: 8px; border-radius: 4px; background: var(--rail); overflow: hidden; flex: 1; min-width: 80px; max-width: 320px; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .2s; }
.progress-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 0 0 14px; flex-wrap: wrap; }
.sc-scene { color: var(--text); font-style: italic; margin: 0 0 12px; }
.vline { display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; padding: 12px; border-radius: 8px; background: var(--sidebar); margin-bottom: 8px; border-left: 3px solid var(--faint); }
.vline.recorded { border-left-color: var(--yellow); }
.vline.picked { border-left-color: var(--green); }
.vline .v-n { color: var(--muted); font-weight: 700; text-align: right; line-height: 22px; }
.vline .v-who { font-weight: 700; color: var(--header); letter-spacing: .02em; }
.vline .v-actor { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.vline .v-dir { color: var(--muted); font-style: italic; font-size: 14px; }
.vline .v-text { font-size: 17px; line-height: 24px; margin: 2px 0 8px; overflow-wrap: anywhere; }
.vline .v-takes { display: flex; flex-direction: column; gap: 6px; }
.take { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--chat); border-radius: 6px; padding: 6px 8px; border: 1px solid transparent; }
.take.picked { border-color: var(--green); }
.take audio { height: 32px; flex: 1; min-width: 180px; max-width: 360px; }
.take .tk-who { font-size: 13px; color: var(--muted); white-space: nowrap; }
.take .tk-pick { height: 28px; padding: 0 10px; border-radius: 4px; background: var(--sidebar); color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.take .tk-pick .ic { width: 14px; height: 14px; }
.take .tk-pick:hover { color: var(--header); background: var(--active); }
.take.picked .tk-pick { background: var(--green); color: #fff; }
.v-rec { margin-top: 8px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--chat); border: 1px solid #4e5058; color: var(--text); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.v-rec .ic { width: 15px; height: 15px; }
.v-rec:hover { border-color: var(--accent); color: var(--header); }
.v-rec.recording { background: var(--red); border-color: var(--red); color: #fff; }
.v-rec:disabled { opacity: .5; cursor: default; }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cast-card { background: var(--sidebar); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.cast-card h3 { margin: 0; font-size: 18px; color: var(--header); display: flex; align-items: center; gap: 8px; }
.cast-card h3 button { margin-left: auto; }
.cast-card .cc-actor { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.cast-card .cc-actor.none { color: var(--muted); font-weight: 400; font-style: italic; }
.cast-card .cc-actor .avatar { width: 24px; height: 24px; font-size: 11px; }
.cast-card .cc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.cast-card .cc-text { font-size: 14px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cast-card .progress-row { margin: 2px 0 0; font-size: 13px; }
.port-group h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.port-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px; background: var(--sidebar); margin-bottom: 6px; border-left: 3px solid var(--faint); }
.port-row.doing { border-left-color: var(--yellow); }
.port-row.done { border-left-color: var(--green); }
.port-row select { height: 30px; background: var(--chat); border: 0; border-radius: 4px; padding: 0 8px; color: var(--text); font: inherit; font-size: 13px; outline: 0; flex-shrink: 0; }
.port-row .pr-main { flex: 1; min-width: 0; }
.port-row .pr-name { font-weight: 500; color: var(--header); overflow-wrap: anywhere; }
.port-row.done .pr-name { color: var(--muted); }
.port-row .pr-notes { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.port-row .pr-owner { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; flex-shrink: 0; }
.port-row .pr-owner .avatar { width: 20px; height: 20px; font-size: 10px; }
.small-btn { height: 28px; padding: 0 10px; border-radius: 4px; background: var(--chat); color: var(--muted); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.small-btn:hover { background: var(--active); color: var(--header); }
#formFields label { margin-top: 0; }
#formFields textarea.tall { min-height: 220px; font: 14px/1.4 Consolas, Menlo, monospace; }
#formFields .hint { font-size: 12px; color: var(--muted); margin: -10px 0 14px; }

/* ---- Search everywhere, and "while you were away" ---- */
.search-pop .pp-section { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.search-pop .so-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--link); margin-right: 6px; }
.search-pop mark { background: rgba(240,178,50,.35); color: inherit; border-radius: 2px; }
.missed { margin: 8px 16px 0; background: var(--sidebar); border-radius: 8px; border-left: 3px solid var(--yellow); padding: 8px 8px 8px 14px; flex-shrink: 0; max-height: 40vh; overflow-y: auto; }
.missed[hidden] { display: none; }
.ms-head { display: flex; align-items: center; gap: 8px; color: var(--header); }
.ms-head > .ic { width: 16px; height: 16px; color: var(--yellow); }
.ms-head button { margin-left: auto; }
.ms-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 14px; }
.ms-row button { color: var(--link); font-weight: 600; white-space: nowrap; }
.ms-row button:hover { text-decoration: underline; }
.ms-row .ms-n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.msg.kind-build { border-left: 3px solid var(--accent); background: rgba(88,101,242,.06); }

.scrim { display: none; }

/* ---- Smaller screens ---- */
@media (max-width: 1200px) {
  .thread-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 6; width: min(420px, 100vw); box-shadow: -4px 0 16px rgba(0,0,0,.4); padding-bottom: 4px; }
}
@media (max-width: 800px) {
  .tv-cols { grid-template-columns: 1fr; overflow-y: auto; }
  .tv-col { min-height: 140px; }
  .tv-list { overflow: visible; }
  .td-row { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 1000px) {
  .members { display: none; position: fixed; right: 0; top: 48px; bottom: 0; z-index: 5; box-shadow: -4px 0 12px rgba(0,0,0,.3); }
  body.members-open .members { display: block; }
  .topbar .topic, .topbar .divider { display: none; }
  .topbar .title { flex: 1; }
}
@media (max-width: 700px) {
  .rail { display: none; }
  .search { display: none; }
  .nav-toggle { display: grid; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 45; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 4px 0 16px rgba(0,0,0,.4); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 44; }
  .msg { padding-right: 16px; }
  .sys { padding-right: 16px; }
  .topbar { padding: 0 8px; }
  .composer { padding: 0 8px; }
  .jump { right: 12px; }
  .emoji-pop { grid-template-columns: repeat(6, 36px); }
  .actions { right: 8px; }
  .settings { flex-direction: column; }
  .set-nav { width: auto; flex-direction: row; align-items: center; padding: 8px 56px 8px 8px; overflow-x: auto; overflow-y: hidden; }
  .set-head, .set-sep { display: none; }
  .set-tab { white-space: nowrap; flex-shrink: 0; }
  .set-body { padding: 20px 16px 32px; }
  .set-close { position: fixed; top: 8px; right: 8px; z-index: 1; }
  .set-close span { display: none; }
  .set-close .ic { width: 32px; height: 32px; padding: 6px; background: var(--sidebar); }
}
