/*
 * hang.css — the Hang landing bits and the app shell, on top of s3.css.
 * Four columns on a laptop: rail, left (channels/DMs), conversation, members.
 * On a phone the rail+left become a left drawer and members a right drawer.
 */

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── landing ──────────────────────────────────────────────────────────── */
.lobby-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .lobby-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.joinbox { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.joinbox .field { flex: 1; min-width: 0; }
.hang-art { display: flex; gap: 10px; width: min(360px, 82vw); aspect-ratio: 4/3; animation: s3float 3.4s ease-in-out infinite alternate; }
.hang-art .ha-rail { display: flex; flex-direction: column; gap: 10px; width: 54px; flex: none; }
.hang-art .ha-rail i { height: 54px; border-radius: 16px; background: var(--surface-3); border: 1px solid var(--line); }
.hang-art .ha-rail i:first-child { background: linear-gradient(150deg, rgba(34,211,166,.3), rgba(31,157,99,.12)); border-color: rgba(34,211,166,.34); }
.hang-art .ha-body { flex: 1; display: flex; flex-direction: column; gap: 10px; justify-content: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.hang-art .ha-body i { height: 12px; border-radius: 6px; background: rgba(255,255,255,.09); }
.hang-art .ha-body i:nth-child(1) { width: 70%; } .hang-art .ha-body i:nth-child(2) { width: 90%; } .hang-art .ha-body i:nth-child(3) { width: 55%; } .hang-art .ha-body i:nth-child(4) { width: 78%; background: rgba(34,211,166,.28); }
@media (prefers-reduced-motion: reduce) { .hang-art { animation: none; } }
.faq { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--faint); font-weight: 400; } .faq[open] summary::after { content: '–'; }
.faq p { padding: 0 16px 14px; }

/* ── shell ────────────────────────────────────────────────────────────── */
/* Discord's layout: rail · sidebar · conversation/voice · members. */
:root { --msg-font: 15px; --rail: 72px; --side: 240px; --right: 240px; --st-online: #23A55A; --st-idle: #F0B232; --st-dnd: #F23F43; --st-off: #6F7B76; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); overflow: hidden; }
.hang { display: grid; height: 100dvh; overflow: hidden; grid-template-columns: var(--rail) var(--side) 1fr var(--right); background: var(--bg); }
.hang.hide-right { grid-template-columns: var(--rail) var(--side) 1fr 0; }
.hang.hide-right .right { display: none; }
.hang button { font: inherit; color: inherit; }
.muted { color: var(--dim); }

/* status dots */
.dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--st-off); border: 2.5px solid var(--surface); box-sizing: border-box; }
.dot.online { background: var(--st-online); }
.dot.idle { background: var(--st-idle); }
.dot.dnd { background: var(--st-dnd); }
.dot.offline { background: var(--st-off); }
.avw { position: relative; display: inline-flex; flex: none; }
.avw.big .dot { width: 22px; height: 22px; border-width: 4px; right: 2px; bottom: 2px; }
.av, .av-lg { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--surface-3); color: var(--glow); font-weight: 700; object-fit: cover; }
.av { width: 32px; height: 32px; font-size: 12px; }
.av-lg { width: 80px; height: 80px; font-size: 26px; border: 5px solid var(--surface-2); box-sizing: content-box; }

/* rail */
.rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: #050D0A; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn { position: relative; width: 48px; height: 48px; border: 0; border-radius: 24px; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-radius .18s, background .18s, color .18s; }
.rail-btn .ic { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.rail-btn:hover, .rail-btn.on { border-radius: 16px; background: var(--green); color: #fff; }
.rail-btn::before { content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--ink); opacity: 0; transition: height .18s, margin .18s, opacity .18s; }
.rail-btn.unread::before { opacity: 1; }
.rail-btn:hover::before { opacity: 1; height: 20px; margin-top: -10px; }
.rail-btn.on::before { opacity: 1; height: 40px; margin-top: -20px; }
.rail-btn.add { background: var(--surface-2); color: var(--st-online); }
.rail-btn.add:hover { background: var(--st-online); color: #fff; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--surface-3); margin: 2px 0; }
.badge { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 3px solid #050D0A; box-sizing: content-box; }

/* sidebar */
.left { display: flex; flex-direction: column; background: var(--surface); min-height: 0; }
.left-top { height: 48px; flex: none; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.2); display: flex; align-items: stretch; }
.left-title { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border: 0; background: none; font-weight: 700; cursor: pointer; text-align: left; }
.left-title:hover { background: rgba(255,255,255,.04); }
.left-title .caret { color: var(--dim); display: inline-flex; }
.left-list { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.group { display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.group .gadd { border: 0; background: none; color: var(--dim); cursor: pointer; display: inline-flex; padding: 2px; border-radius: 4px; }
.group .gadd:hover { color: var(--ink); }
.chan { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: pointer; text-align: left; margin-bottom: 2px; font-weight: 500; }
.chan .ci { display: inline-flex; color: var(--faint); flex: none; }
.chan > span:not(.ci):not(.cnt):not(.x):not(.avw) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.chan.on { background: rgba(255,255,255,.09); color: var(--ink); }
.chan.on .ci, .chan:hover .ci { color: var(--ink); }
.chan.unread { color: var(--ink); font-weight: 600; }
.chan.live .ci { color: var(--st-online); }
.chan .cnt { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chan .x { flex: none; display: none; color: var(--dim); padding: 2px; }
.chan:hover .x { display: inline-flex; }
.chan .x:hover { color: var(--ink); }
.chan.dm .dmt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.chan.dm .dmt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan.dm .dmt small { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occ { padding: 0 0 4px 22px; }
.occ-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: pointer; text-align: left; font-size: 14px; }
.occ-row .av { width: 24px; height: 24px; font-size: 10px; box-sizing: border-box; border: 2px solid transparent; transition: border-color .12s; }
.occ-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occ-row:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.occ-row.speaking .av { border-color: var(--st-online); }
.occ-row .oi { display: inline-flex; color: var(--faint); }
.occ-row .oi.live { color: var(--danger); }

/* voice connected panel */
.vc-panel { flex: none; padding: 10px 12px; background: var(--surface-2); border-top: 1px solid var(--line); }
.vc-row { display: flex; align-items: center; gap: 8px; }
.vc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vc-state { font-size: 13px; color: var(--st-idle); }
.vc-panel.ok .vc-state { color: var(--st-online); }
.vc-info small { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-acts { display: flex; gap: 6px; margin-top: 8px; }
.pill-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border: 0; border-radius: 6px; background: var(--surface-3); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.pill-btn:hover { background: rgba(255,255,255,.12); }
.pill-btn[aria-pressed="true"] { background: var(--green); color: #fff; }

/* user panel */
.me-panel { flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 8px; background: #061009; }
.me-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; cursor: pointer; text-align: left; }
.me-id:hover { background: rgba(255,255,255,.06); }
.me-id .dot { border-color: #061009; }
.me-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.me-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: pointer; flex: none; }
.ibtn:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.ibtn[aria-pressed="true"] { color: var(--danger); }
.ibtn .i-on, .ibtn .i-off { display: inline-flex; }

/* conversation column */
.convo { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); }
.convo-top { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.convo-ico { display: inline-flex; color: var(--faint); }
.convo-title { font-weight: 700; white-space: nowrap; }
.convo-title.clickable { cursor: pointer; }
.convo-title.clickable:hover { text-decoration: underline; }
.convo-sub { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 1px solid var(--line); padding-left: 10px; }
.convo-sub:empty { display: none; }
.hdr-spacer { flex: 1; }
.hdr-actions { display: inline-flex; gap: 2px; }
.only-phone { display: none; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }

/* voice view */
.voice-view { display: flex; flex-direction: column; flex: 1; min-height: 0; background: #040A08; }
.voice-view.dm { flex: 0 0 auto; height: 46%; min-height: 240px; border-bottom: 1px solid var(--line); }
.voice-grid { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 14px; align-content: center; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.voice-grid[data-n="1"] { grid-template-columns: minmax(0, 720px); justify-content: center; }
.voice-grid[data-n="2"], .voice-grid[data-n="3"], .voice-grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.voice-grid[data-n="5"], .voice-grid[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.voice-grid.has-share { grid-template-columns: 1fr !important; grid-auto-rows: 88px; grid-template-rows: 1fr; align-content: stretch; }
.voice-grid.has-share .vtile.sharing { grid-row: 1; aspect-ratio: auto; height: 100%; min-height: 0; }
.voice-grid.has-share .vtile:not(.sharing) { aspect-ratio: auto; height: 88px; }
.voice-grid.has-share .vtile:not(.sharing) .av-lg { width: 44px; height: 44px; font-size: 16px; border-width: 3px; }
.vtile { position: relative; aspect-ratio: 16/9; border-radius: 12px; background: var(--surface); overflow: hidden; display: grid; place-items: center; border: 2px solid transparent; transition: border-color .12s, box-shadow .12s; cursor: pointer; }
.vtile.speaking { border-color: var(--st-online); box-shadow: 0 0 0 1px rgba(35,165,90,.35); }
.vtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.vtile.video video { display: block; }
.vtile.sharing video { object-fit: contain; }
.vtile.mirror video { transform: scaleX(-1); }
.vtile.video .vt-av { display: none; }
.vt-av { display: inline-flex; }
.vt-av .av-lg { border-color: var(--surface); }
.vtile.connecting .av-lg { opacity: .55; }
.vt-tag { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.55); font-size: 13px; font-weight: 600; color: #fff; backdrop-filter: blur(6px); }
.vt-tag svg { color: var(--danger); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: hspin .8s linear infinite; }
@keyframes hspin { to { transform: rotate(360deg); } }
.voice-bar { flex: none; display: flex; justify-content: center; gap: 12px; padding: 14px; }
.rbtn { width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .12s, transform .12s; }
.rbtn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.rbtn[aria-pressed="true"] { background: #fff; color: #07120E; }
.rbtn.share[aria-pressed="true"] { background: var(--st-online); color: #fff; }
.rbtn.danger { background: var(--danger); color: #fff; }
.rbtn.danger:hover { background: #ff5c60; }
.rbtn.ok { background: var(--st-online); color: #fff; }
.rbtn.ok:hover { background: #2fc46b; }
.rbtn .i-on, .rbtn .i-off { display: inline-flex; }
.voice-join { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px; }
.voice-join .btn { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; }

/* chat */
.chatwrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 0 8px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.start { padding: 24px 16px 12px; border-bottom: 1px solid var(--line); margin: 0 16px 8px; }
.older { display: block; margin: 0 auto 8px; padding: 6px 12px; border: 0; border-radius: 6px; background: var(--surface-3); color: var(--dim); cursor: pointer; font-size: 13px; }
.daydiv, .newdiv { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; font-size: 12px; font-weight: 700; color: var(--dim); }
.daydiv::before, .daydiv::after, .newdiv::before, .newdiv::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.newdiv { color: var(--danger); }
.newdiv::before, .newdiv::after { background: var(--danger); opacity: .5; }
.msg { position: relative; display: flex; gap: 14px; padding: 2px 16px; margin-top: 14px; font-size: var(--msg-font); line-height: 1.4; }
.msg.cont { margin-top: 0; }
.msg:hover { background: rgba(0,0,0,.14); }
.msg .avw { margin-top: 2px; cursor: pointer; }
.msg .av { width: 40px; height: 40px; font-size: 14px; }
.msg .av-gap { width: 40px; flex: none; }
.msg .ct { position: absolute; left: 16px; width: 40px; text-align: center; font-size: 10px; color: var(--faint); opacity: 0; margin-top: 4px; }
.msg.cont:hover .ct { opacity: 1; }
.mb { flex: 1; min-width: 0; }
.mh { display: flex; align-items: baseline; gap: 8px; }
.mh b { cursor: pointer; }
.mh b:hover { text-decoration: underline; }
.mh time { font-size: 12px; color: var(--faint); }
.mt { overflow-wrap: anywhere; }
.mt pre { margin: 6px 0; padding: 8px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow-x: auto; font-size: 13px; }
.mt code { padding: 1px 4px; border-radius: 4px; background: var(--bg); font-size: .92em; }
.mt a { color: var(--glow); }
.edited { font-size: 11px; color: var(--faint); }
.deleted { color: var(--faint); font-style: italic; }
.replyq { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--dim); margin-bottom: 2px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.replyq::before { content: ""; width: 24px; height: 8px; border: 2px solid var(--faint); border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; margin-left: -34px; flex: none; }
.replyq b { color: var(--ink); }
.msg.flash { background: rgba(34,211,166,.12); }
.rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rx:empty { display: none; }
.rxb { padding: 2px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); color: var(--ink); font-size: 13px; cursor: pointer; }
.rxb.me { border-color: var(--green); background: rgba(31,157,99,.18); }
.acts { position: absolute; right: 16px; top: -14px; display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.msg:hover .acts { display: inline-flex; }
.acts button { width: 30px; height: 28px; border: 0; background: none; color: var(--dim); cursor: pointer; display: grid; place-items: center; }
.acts button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
body.compact .msg { margin-top: 2px; }
body.compact .msg .av { width: 24px; height: 24px; font-size: 10px; }
body.compact .msg .av-gap { width: 24px; }
.jump { position: absolute; left: 16px; right: 16px; top: 0; padding: 6px 12px; border: 0; border-radius: 0 0 8px 8px; background: var(--green); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.typing { flex: none; padding: 2px 16px; font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 6px; height: 20px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); animation: hdot 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; } .typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes hdot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.reply-bar, .edit-bar { flex: none; margin: 0 16px; padding: 6px 12px; border-radius: 8px 8px 0 0; background: var(--surface-3); font-size: 13px; color: var(--dim); display: flex; align-items: center; justify-content: space-between; }
.composer { flex: none; display: flex; align-items: flex-end; gap: 4px; margin: 0 16px 20px; padding: 4px 6px; border-radius: 8px; background: var(--surface-3); }
.reply-bar:not([hidden]) ~ .composer, .edit-bar:not([hidden]) ~ .composer { border-radius: 0 0 8px 8px; }
.say { flex: 1; min-height: 40px; max-height: 180px; padding: 10px 6px; border: 0; background: none; color: var(--ink); resize: none; outline: 0; font: inherit; font-size: var(--msg-font); line-height: 1.35; }
.say::placeholder { color: var(--faint); }
.composer .ibtn { width: 36px; height: 40px; }
.composer .send { color: var(--green); }
.emoji-pop { position: absolute; z-index: 5; display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.emoji-pop button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; font-size: 20px; cursor: pointer; }
.emoji-pop button:hover { background: rgba(255,255,255,.08); }

/* friends */
.friends { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ftabs { flex: none; display: flex; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.ftab { padding: 4px 10px; border: 0; border-radius: 6px; background: none; color: var(--dim); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ftab:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.ftab.on { background: rgba(255,255,255,.09); color: var(--ink); }
.ftab.add { background: var(--green); color: #fff; }
.ftab .pill { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; }
.fbody { flex: 1; overflow-y: auto; padding: 8px 16px; }
.frow { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--line); border-radius: 8px; }
.frow:hover { background: rgba(255,255,255,.04); border-color: transparent; }
.fid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; text-align: left; padding: 0; }
.fn { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.fn small { color: var(--dim); font-size: 12px; }
.fa { display: inline-flex; gap: 6px; align-items: center; }
.frow .ibtn { background: var(--surface-3); border-radius: 50%; }
.addbox { padding: 16px 8px; }
.fresults { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.fres { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.fres:hover { background: rgba(255,255,255,.05); }

/* members */
.right { background: var(--surface); overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.mrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: pointer; text-align: left; margin-bottom: 2px; }
.mrow:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.mn { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.mn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mn small { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .oi { display: inline-flex; color: var(--faint); }
.role { display: inline-flex; color: var(--st-idle); }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); }

/* profile card */
.profile-pop { position: fixed; z-index: 40; width: 320px; max-width: calc(100vw - 16px); border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.5); overflow: hidden; }
.pf-loading { padding: 24px; text-align: center; color: var(--dim); }
.pf-banner { height: 72px; background: var(--green); }
.pf-body { position: relative; padding: 0 16px 16px; }
.pf-body .avw.big { margin-top: -40px; margin-bottom: 8px; }
.pf-body .av-lg { border-color: var(--surface-2); }
.pf-name { display: block; font-size: 18px; }
.pf-st { font-size: 13px; color: var(--ink); margin-top: 2px; }
.pf-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pf-sec small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); margin-bottom: 4px; }
.pf-sec p { margin: 0; font-size: 14px; }
.pf-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }
.pf-acts .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ring */
.ring-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.ring-card { width: 300px; padding: 28px 24px 24px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.ring-av { display: inline-flex; margin-bottom: 8px; animation: hring 1.4s ease-in-out infinite; }
@keyframes hring { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.ring-card b { font-size: 18px; }
.ring-card small { color: var(--dim); }
.ring-acts { display: flex; gap: 16px; margin-top: 18px; }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.dlg.wide { width: min(560px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg-in { display: flex; flex-direction: column; gap: 10px; padding: 20px; max-height: 85dvh; overflow-y: auto; }
.dlg-in label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); margin-top: 6px; }
.dlg-in .row { display: flex; gap: 8px; align-items: center; }
.dlg-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.dlg-or::before, .dlg-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { color: var(--danger); }
.field.sm { padding: 4px 8px; font-size: 13px; }
.invcode { flex: 1; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-family: ui-monospace, monospace; letter-spacing: .1em; }
.danger-zone { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.quiet { background: none; color: var(--dim); align-self: flex-end; }
.stabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.stab { padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.stab.on { color: var(--ink); border-bottom-color: var(--green); }
.srow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.srow > span:first-child { display: inline-flex; align-items: center; gap: 6px; flex: 1; }
.srow .role { color: var(--dim); font-size: 12px; }
.quick-list { display: flex; flex-direction: column; gap: 2px; max-height: 50dvh; overflow-y: auto; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.qrow svg { color: var(--dim); flex: none; }
.qrow span { flex: 1; }
.qrow small { color: var(--dim); }
.qrow.on, .qrow:hover { background: rgba(255,255,255,.07); }

/* settings */
.pf-preview { border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.pf-preview .pf-body { padding: 0 16px 14px; }
.pf-preview .pf-av { display: inline-flex; margin-top: -40px; margin-bottom: 6px; }
.pf-preview .pf-av .av-lg { border-color: var(--surface); }
.pf-preview b { display: block; font-size: 17px; }
.pf-preview small { color: var(--dim); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 32px; height: 32px; border: 2px solid transparent; border-radius: 8px; cursor: pointer; }
.sw.on { border-color: #fff; }
.meter { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--glow)); transition: width .06s; }
.cam-prev { aspect-ratio: 16/9; border-radius: 10px; background: #000; overflow: hidden; margin-top: 6px; }
.cam-prev video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.switch { display: flex !important; align-items: center; gap: 10px; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; padding: 6px 0; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--st-online); }
.switch input:checked::after { left: 21px; }
input[type="range"] { accent-color: var(--green); width: 100%; }

/* toasts */
.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line); color: var(--ink); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* phones */
@media (max-width: 1100px) { .hang { grid-template-columns: var(--rail) var(--side) 1fr 0; } .right { display: none; } .hang.show-right { grid-template-columns: var(--rail) var(--side) 1fr var(--right); } .hang.show-right .right { display: block; } }
@media (max-width: 860px) {
    .hang { grid-template-columns: 1fr; }
    .rail, .left { position: fixed; top: 0; bottom: 0; z-index: 35; transform: translateX(-110%); transition: transform .22s ease; }
    .rail { left: 0; width: var(--rail); }
    .left { left: var(--rail); width: min(var(--side), calc(100vw - var(--rail) - 40px)); transform: translateX(calc(-100% - var(--rail) - 8px)); }
    .hang.nav-open .rail, .hang.nav-open .left { transform: none; }
    .right { display: block; position: fixed; top: 0; bottom: 0; right: 0; z-index: 35; width: min(var(--right), 80vw); transform: translateX(110%); transition: transform .22s ease; }
    .hang.people-open .right { transform: none; }
    .only-phone { display: inline-grid; }
    .convo-sub { display: none; }
    .composer { margin: 0 8px 8px; }
    .msg { padding: 2px 10px; gap: 10px; }
    .msg .ct { left: 10px; }
    .acts { right: 8px; }
    .voice-grid { padding: 8px; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .voice-grid[data-n="1"], .voice-grid.has-share { grid-template-columns: 1fr !important; }
    .voice-view.dm { height: 40%; }
    .rbtn { width: 46px; height: 46px; }
}

/* ── v5: attachments, mentions, pins, search, menus, invite page ────────── */
.attach-strip { flex: none; display: flex; gap: 8px; margin: 0 16px; padding: 8px; border-radius: 8px 8px 0 0; background: var(--surface-3); overflow-x: auto; }
.attach-strip:not([hidden]) ~ .composer { border-radius: 0 0 8px 8px; }
.pf { position: relative; flex: none; width: 120px; padding: 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.pf img { width: 100%; height: 72px; object-fit: cover; border-radius: 6px; }
.pf .pf-ico { display: grid; place-items: center; height: 72px; color: var(--dim); }
.pf .pf-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf .pf-bar { display: block; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; } .pf .pf-bar b { display: block; height: 100%; background: var(--glow); transition: width .15s; }
.pf.err { border-color: var(--danger); } .pf small { color: var(--danger); font-size: 10px; }
.pf button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; display: grid; place-items: center; cursor: pointer; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.att.img { display: block; max-width: min(420px, 100%); max-height: 320px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.att.img img { display: block; width: 100%; height: 100%; max-height: 320px; object-fit: contain; cursor: zoom-in; }
.att.vid { max-width: min(480px, 100%); max-height: 320px; border-radius: 10px; background: #000; }
.att.aud { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
.att.aud audio { height: 32px; }
.att.file { display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; max-width: 100%; }
.att.file:hover { border-color: var(--green); }
.att.file .fname { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; } .att.file .fname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; } .att.file .fname small { color: var(--dim); font-size: 11px; }
.att.file svg:last-child { color: var(--dim); }
.mention { display: inline; padding: 0 3px; border-radius: 4px; background: rgba(31,157,99,.22); color: var(--glow); font-weight: 600; cursor: pointer; }
.mention.me { background: rgba(240,178,50,.22); color: #F0B232; }
.msg.pings { background: rgba(240,178,50,.08); box-shadow: inset 2px 0 0 #F0B232; }
.msg.pinned .mh::after { content: "pinned"; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.spoiler { background: var(--surface-3); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 3px; transition: color .12s, background .12s; }
.spoiler.open { background: rgba(255,255,255,.08); color: var(--ink); }
.mt blockquote { margin: 4px 0; padding: 2px 10px; border-left: 3px solid var(--faint); color: var(--dim); }
.mt s { color: var(--dim); }
.mention-pop { position: absolute; left: 16px; right: 16px; bottom: 92px; z-index: 6; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.mention-pop .mrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.mention-pop .mrow.on, .mention-pop .mrow:hover { background: rgba(255,255,255,.08); }
.mention-pop .mrow .av { width: 26px; height: 26px; font-size: 10px; }
.mention-pop .mn small { display: block; color: var(--dim); font-size: 11px; }
.hdr-search { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; height: 30px; border-radius: 6px; background: var(--bg); color: var(--dim); width: 160px; transition: width .15s; }
.hdr-search:focus-within { width: 260px; color: var(--ink); }
.hdr-search input { border: 0; background: none; color: var(--ink); outline: 0; font: inherit; font-size: 13px; width: 100%; }
.side-pop { position: fixed; top: 56px; right: 12px; z-index: 32; width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 72px); display: flex; flex-direction: column; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.5); overflow: hidden; }
.side-pop header { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.side-body { overflow-y: auto; padding: 8px; }
.scard { display: flex; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; margin-bottom: 6px; font: inherit; }
.scard:hover { background: var(--surface-3); }
.scard .sc-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scard .sc-h { display: flex; align-items: baseline; gap: 8px; } .scard .sc-h small { color: var(--faint); font-size: 11px; }
.scard .sc-t { font-size: 13px; color: var(--dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0,0,0,.85); cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 84vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox .btn { cursor: pointer; }
.ctx { position: fixed; z-index: 90; min-width: 190px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; font-size: 13px; }
.ctx button:hover { background: var(--green); color: #fff; } .ctx button.danger { color: var(--danger); } .ctx button.danger:hover { background: var(--danger); color: #fff; }
.drop-hint { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(7,18,14,.8); border: 3px dashed var(--green); pointer-events: none; }
.drop-hint div { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--glow); font-size: 18px; }
.vtile .vol { position: absolute; right: 10px; bottom: 10px; display: none; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; }
.vtile:hover .vol { display: inline-flex; } .vtile .vol input { width: 90px; accent-color: var(--green); }
.inv-card { text-align: center; padding: 36px 28px; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.inv-icon { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; font-weight: 800; font-size: 26px; background: var(--green); color: #fff; margin-bottom: 6px; }
.inv-meta { display: inline-flex; align-items: center; gap: 6px; } .inv-meta .dot { position: static; width: 9px; height: 9px; border: 0; }
@media (max-width: 860px) { .hdr-search { width: 34px; padding: 0 9px; } .hdr-search input { display: none; } .hdr-search:focus-within { width: 200px; } .hdr-search:focus-within input { display: block; } .side-pop { top: 52px; right: 8px; } }

/* ── v6: link previews, polls, saved, mute, seen ──────────────────────── */
.lp { display: flex; gap: 10px; margin-top: 6px; max-width: 520px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border-left: 3px solid var(--green); color: var(--ink); text-decoration: none; }
.lp:hover { background: var(--surface-3); }
.lp .lp-b { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lp small { color: var(--dim); font-size: 11px; }
.lp b { color: var(--glow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp p { margin: 0; font-size: 13px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lp img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; flex: none; }
.poll { margin-top: 6px; max-width: 480px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.poll h4 { margin: 0 0 8px; font-size: 15px; }
.poll-opt { display: block; width: 100%; position: relative; margin: 4px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; font: inherit; }
.poll-opt i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(31,157,99,.22); transition: width .3s; }
.poll-opt > span { position: relative; display: flex; justify-content: space-between; gap: 10px; }
.poll-opt small { color: var(--dim); white-space: nowrap; }
.poll-opt.me { border-color: var(--green); }
.poll-opt:hover { background: rgba(255,255,255,.04); }
.poll > small { display: block; margin-top: 6px; color: var(--faint); font-size: 11px; }
.seen { text-align: right; font-size: 11px; color: var(--faint); padding: 0 16px 6px; }
.chan.muted { opacity: .55; }
.chan .mu { display: inline-flex; color: var(--faint); flex: none; }
.rail-btn.muted .ic { opacity: .5; }
.mention-pop.emo .mrow .av { font-size: 18px; background: none; }
.saved-list { width: min(640px, 100%); text-align: left; max-height: 100%; overflow-y: auto; }
.empty:has(.saved-list) { justify-content: flex-start; align-items: stretch; padding: 16px; }

/* ── v7: server images, roles, system lines, quick reactions, ptt ─────── */
.rail-btn .ic-img { width: 48px; height: 48px; object-fit: cover; border-radius: inherit; }
.s-icon-row { display: flex; align-items: center; gap: 10px; }
.s-icon-prev { width: 56px; height: 56px; border-radius: 18px; background: var(--green); color: #fff; display: grid; place-items: center; overflow: hidden; font-weight: 800; flex: none; }
.s-icon-prev img { width: 100%; height: 100%; object-fit: cover; }
.r-owner { color: #F0B232; } .r-admin { color: var(--glow); }
.msg.sys { margin-top: 8px; padding: 2px 16px; }
.sysmsg { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; padding-left: 8px; }
.sysmsg svg { color: var(--st-online); } .sysmsg time { font-size: 11px; color: var(--faint); }
.sysmsg .mention { background: none; padding: 0; color: var(--ink); }
.acts .qr { font-size: 15px; }
.say:disabled { opacity: .55; cursor: not-allowed; }
.ptt { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 40; padding: 8px 14px; border-radius: 20px; background: var(--st-online); color: #fff; font-weight: 600; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.field.sm-select { padding: 6px 8px; font-size: 13px; }
